text
stringlengths 20
1.01M
| url
stringlengths 14
1.25k
| dump
stringlengths 9
15
⌀ | lang
stringclasses 4
values | source
stringclasses 4
values |
|---|---|---|---|---|
The QImageReader class provides a format independent interface for reading images from files or other devices. More...
#include <QImageReader>
Note: All the functions in this class are reentrant..
See also QImageWriter, QImageIOHandler, and QImageIOPlugin.().
Destructs the QImageReader object. sequence number of the current frame.().
For image formats that support animation, this function returns the number of times the animation should loop.().
Returns the quality level of the image.
This function was introduced in Qt 4.2.
See also setQuality()..
This is an overloaded member function, provided for convenience..:
To configure Qt with GIF support, pass -qt-gif to the configure script or check the appropriate option in the graphical installer.().().
|
https://doc.qt.io/archives/4.3/qimagereader.html
|
CC-MAIN-2019-26
|
en
|
refinedweb
|
I have a list of complex numbers for which I want to find the closest value in another list of complex numbers.
My current approach with numpy:
import numpy as np
refArray = np.random.random(16);
myArray = np.random.random(1000);
def find_nearest(array, value):
idx = (np.abs(array-value)).argmin()
return idx;
for value in np.nditer(myArray):
index = find_nearest(refArray, value);
print(index);
Here's one vectorized approach with
np.searchsorted based on
this post -
def closest_argmin(A, B): L = B.size sidx_B = B.argsort() sorted_B = B[sidx_B] sorted_idx = np.searchsorted(sorted_B, A) sorted_idx[sorted_idx==L] = L-1 mask = (sorted_idx > 0) & \ ((np.abs(A - sorted_B[sorted_idx-1]) < np.abs(A - sorted_B[sorted_idx])) ) return sidx_B[sorted_idx-mask]
Brief explanation :
Get the sorted indices for the left positions. We do this with -
np.searchsorted(arr1, arr2, side='left') or just
np.searchsorted(arr1, arr2). Now,
searchsorted expects sorted array as the first input, so we need some preparatory work there.
Compare the values at those left positions with the values at their immediate right positions
(left + 1) and see which one is closest. We do this at the step that computes
mask.
Based on whether the left ones or their immediate right ones are closest, choose the respective ones. This is done with the subtraction of indices with the
mask values acting as the offsets being converted to
ints.
Benchmarking
Original approach -
def org_app(myArray, refArray): out1 = np.empty(myArray.size, dtype=int) for i, value in enumerate(myArray): # find_nearest from posted question index = find_nearest(refArray, value) out1[i] = index return out1
Timings and verification -
In [188]: refArray = np.random.random(16) ...: myArray = np.random.random(1000) ...: In [189]: %timeit org_app(myArray, refArray) 100 loops, best of 3: 1.95 ms per loop In [190]: %timeit closest_argmin(myArray, refArray) 10000 loops, best of 3: 36.6 µs per loop In [191]: np.allclose(closest_argmin(myArray, refArray), org_app(myArray, refArray)) Out[191]: True
50x+ speedup for the posted sample and hopefully more for larger datasets!
|
https://codedump.io/share/733sPpwaK8g0/1/find-nearest-indices-for-one-array-against-all-values-in-another-array---python--numpy
|
CC-MAIN-2019-26
|
en
|
refinedweb
|
Safety-certified tools Tools for Automotive Applications C-STAT Static analysis C-RUN Runtime analysis Debugging and trace probes
To optimize system performance, it is important to have tools to monitor the application performance.
High-end ARM processors based on Cortex-A and Cortex-R include Performance Monitor Unit (PMU) which provides useful information about performance, for example event count and cycle count. PMU is located in CP (Co-processor) 15 register. To access the Co-processors from the code, special instructions MCR (Move from Register to Co-processor) and MRC (Move from Co-processor to Register) are used.
IAR Embedded Workbench for ARM offers intrinsic functions to issue those instructions from source code. Using these functions together makes it possible to see the current status and determine how to brush-up the performance. Let’s take a look at how to use these intrinsic functions and PMU of Cortex-A5 from the code.
To use intrinsic functions to access to Co-Processor, intrinsics.h needs to be included.
#include <stdint.h> //needed for using uint32_t #include <intrinsics.h> #define PMCNTENSET_CYCLECOUNTER_ENABLE 31 #define PMCR_CYCLECOUNTER_DIVIDER 3 #define PMCR_CYCLECOUNTER_RESET 2 #define PMCR_CYLECOUNTER_ENABLE 0 __arm uint32_t init_cyclecounter(){ uint32_t value; //enable cyclecouner function value =(unsigned long)( 1 << PMCNTENSET_CYCLECOUNTER_ENABLE); __MCR(15,0,value,9,12,1); //configure the cyclecounter module value = __MRC(15,0,9,12,0); value |= ((1 << PMCR_CYCLECOUNTER_DIVIDER) | (1 << PMCR_CYCLECOUNTER_RESET) | (1 << PMCR_CYLECOUNTER_ENABLE)); __MCR(15,0,value,9,12,0); //read current cyclecounter vlaue value = __MRC(15,0,9,13,0); return value; } __arm uint32_t get_cyclecounter() { //read the current cyclecounter value uint32_t value; value = __MRC(15,0,9,13,0); return value; }
Here is a simple example on how to use those two functions:
#define NUMBER 64 uint32_t a[NUMBER],b[NUMBER],c[NUMBER]; void function_to_be_measured() { for(uint32_t i = 0;i<NUMBER;i++) { c[i] = a[i]*b[i] + a[i]+b[i]; } return ; } #include int main() { uint32_t count1, count2 = 0; init_cyclecounter(); count1 = get_cyclecounter(); function_to_be_measured(); count2 = get_cyclecounter(); printf("time elapsed:%u\n",(count2-count1)); return 1; }
The result is displayed in cycle count based number. Here are some results with various compiler optimization levels for this particular code:
In this example, PMCR_CYCLECOUNTER_DIVIDER is set to update count every 64 cycles. You could clear PMCR_CYCLECOUNTER_DIVIDER to see the cycle counts. If you know the CPU clock cycle, the actual time elapsed can be calculated easily.
This article is written by Kyota Yokoo, Field Applications Engineer at IAR Systems Japan.
|
https://www.iar.com/support/resources/articles/monitor-performance-in-arm-cortex-a-from-your-code/
|
CC-MAIN-2019-26
|
en
|
refinedweb
|
We are building a WebApi that we're hosting using Owin. Previously we've used HttpResponseException for returning 404 status codes etc. in our controller actions and it's been working well.
However, when we started working with Owin (self hosted) we're experiencing an issue with this approach resulting in the HttpResponseException being serialized to json/xml and the status code to change from 404 to 500 (Internal Server Error). Here's the code we have:
public class InvoicesController : ApiController
{
private readonly IInvoiceRepository _invoiceRepository;
public InvoicesController(IInvoiceRepository invoiceRepository)
{
_invoiceRepository = invoiceRepository;
}
[HttpGet]
public IEnumerable<AccountCodeAssignment> AssignAccountCodesToInvoiceById(int id)
{
var invoice = _invoiceRepository.Get(id);
if (invoice == null) throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Invoice not found"));
yield return new AccountCodeAssignment(1, ...);
yield return new AccountCodeAssignment(2, ...);
yield return new AccountCodeAssignment(3, ...);
yield return new AccountCodeAssignment(4, ...);
}
}
{
"Message": "An error has occurred.",
"ExceptionMessage": "Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.",
"ExceptionType": "System.Web.Http.HttpResponseException",
"StackTrace": " at AccountCodeAssignmentService.Controllers.InvoicesController.<AssignAccountCodesToInvoiceById>d__0.MoveNext() in c:\\Projects\\AccountCodeAssignmentService\\Source\\AccountCodeAssignmentService\\Controllers\\InvoicesController.cs:line 38\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Owin.HttpMessageHandlerAdapter.<BufferResponseContentAsync>d__13.MoveNext()"
}
I don't think the problem is in throwing
HttpResponseException. If you look at the stack trace you posted, the problem appears to be in the call to
MoveNext(). This is an internal C# representation of the
yield statements you have.
I could be wrong, but the easiest way to verify this is to put a breakpoint on the first yield statement and see if it hits it. My guess is that it will, i.e. it won't throw a
HttpResponseException. Also, just change your code temporarily to always throw an
HttpResponseException and see how it handles it.
I'm currently working on a project that's self-hosted using OWIN and I can throw
HttpResponseExceptions without any issues.
On a related note, you may want to investigate global exception handling. I found it very useful to concentrate all my exception handling in one place. Note that
HttpResponseException is a special case and is not handled by the global exception handler.
|
https://codedump.io/share/sCcW4JpT5EVG/1/throwing-httpresponseexception-from-webapi-controller-when-using-owin-self-host
|
CC-MAIN-2019-26
|
en
|
refinedweb
|
umem: umalog shows free calls on memory not previously alloced?!user8840798 Dec 3, 2013 6:37 AM
We have a java webapp that has a problem with a native memory leak (not a java heap leak). At some point the process balloons to almost 4GB in size and we experience issues creating new threads. I was hoping to use umem to help pinpoint the culprit. We run the jvm with umem enabled and execute gcore to produce a core file. I then issue umem dcmds in mdb to gather information.
My current plan is to capture and analyze umalog output. I am using a perl script to process the output of "umalog -e" in reverse order (in time-sequence order in other words). By keeping a running heap size total (ie adding the buffer sizes of each allocation/ subtracting for free calls) over time I was hoping to detect at what point in time the process ballooned in size, and hopefully correlate that with events from the access log and/or application logs.
I first am testing with a trivial java application that simply sleeps for a short time.
public class Sleepy {
public static void main(String[] args) {
try { Thread.sleep(30000); } catch(java.lang.InterruptedException e) {}
}
}
What surprises me is a number of calls to umem_cache_free with addresses that had not previously been allocated by umem_cache_alloc. (See the comment in the perl script below: "WHY DOES THIS HAPPEN!?") Why would this happen I wonder? Doesn't each free need be passed a buffer that was earlier acquired via alloc? At initial startup, the heap experiences more free calls then allocs. This leads my running total of heap size to go negative for a while. I am guessing there is some flaw in my approach or understanding of umem or the umalog output, since this is clearly impossible. I'm assuming that all memory transactions are captured in the log. I'm assuming that the allocation size is the name of the memory buffer (e.g. umem_alloc_40 was an allocation of 40 bytes. Hmm that last one sounds suspect but I do not need to be exact to the byte I think; just need to see where allocations go nutty.
I'll try pasting my perl script below. Any ideas or tips? Thanks!
#!/usr/bin/env perl
use POSIX;
use strict;
my $minheap = 0;
my $maxheap = 0;
my $heapsize = 0;
my $maxtimestamp;
my $maxXactionIndex;
my $maxLine;
my $line = 0;
my $count = 0;
my $alloccount = 0;
my $freecount = 0;
my $totalfree = 0;
my $totalalloc = 0;
my %allocs = {};
my %frees = {};
my $timestamp;
my $prevline;
my $filename = $ARGV[0];
my $count = countRecords($filename);
open(LOG, "<$filename") or die "Failed to open file $filename!";
my $PERCENT_TO_REPORT = 0.05;
my $reportBoundary = ceil($count * $PERCENT_TO_REPORT);
#my $reportBoundary = 1;
print "\nUmem log file name (reversed): $filename\n";
print "Date: " . (strftime "%F %T", localtime(time)) . "\n\n";
print(sprintf("%10s %10s %13s %10s %s\n", "index", "line", "xaction index", "heap size", "timestamp"));
print(sprintf("%10s %10s %13s %10s %s\n", "----------", "----------", "-------------", "----------", "------------"));
my $xactionIndex = 0;
my $reportIndex = 0;
while(<LOG>) {
$line++;
if( /^T(-\d+\.\d+).*addr=(\w+).*umem_alloc_(\d+)/) {
$xactionIndex++;
$timestamp = $1;
my $addr = $2;
my $size = $3;
$prevline =~ /umem_cache_(\w+)/;
my $op = $1;
if( $op eq "alloc" ) {
$alloccount++;
$heapsize += $size;
$totalalloc += $size;
$allocs{$addr} = $size;
} else {
$freecount++;
$heapsize -= $size;
$totalfree += $size;
if( !defined($allocs{$addr}) ) {
print "*** No alloc of addr $addr was made previously! line $line; $op $size\n"; // WHY DOES THIS HAPPEN!?
}
}
if( $heapsize > $maxheap ) {
$maxheap = $heapsize;
$maxtimestamp = $timestamp;
$maxXactionIndex = $xactionIndex;
$maxLine = $line;
}
if( $heapsize < $minheap ) {
$minheap = $heapsize;
}
if( ($xactionIndex % $reportBoundary) == 0 or $xactionIndex == $count ) {
$reportIndex++;
report($reportIndex, $line, $xactionIndex, $heapsize, $timestamp);
}
} else {
$prevline = $_;
}
}
close LOG;
print "\n\nMax heap size was " . fmt($maxheap) . " at line $maxLine, xaction index $maxXactionIndex, at timestamp $maxtimestamp\n\n";
print "There were " . fmt($count) . " memory operations; $alloccount allocs and $freecount frees\n";
print "Total memory allocated: " . fmt($totalalloc) . + "\n";
print "Total memory freed : " . fmt($totalfree) . + "\n";
print "Min heap size was $minheap\n";
exit 0;
sub countRecords {
my $filename = $_[0];
my $count = 0;
open( LOGFILE, "<$filename" ) or die "Failed to open input file $filename!";
while(<LOGFILE>) {
if(/^T/) { $count++ }
}
close LOGFILE;
return $count;
}
sub report {
my $reportIndex = $_[0];
my $line = $_[1];
my $xactionIndex = $_[2];
my $heapsize = $_[3];
my $timestamp = $_[4];
$heapsize =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g;
print(sprintf("%10d %10d %13d %10s %s\n", $reportIndex, $line, $xactionIndex, $heapsize, $timestamp));
}
sub fmt {
my $number = $_[0];
$number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g;
$number;
}
1. Re: umem: umalog shows free calls on memory not previously alloced?!user8840798 Dec 3, 2013 7:56 AM (in response to user8840798)
Addendum: This script is meant to be run on an "::umalog -e" output file that has been reversed in line-order. I use the tac utility to do this.
|
https://community.oracle.com/thread/2609430
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
sorry for this noob question... let's say we have :
class TestMe
attr_reader :array
def initialize
@array = (1..10).to_a
end
>> a = TestMe.new
=> #<TestMe:0x00000005567228 @x=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]>
>> a.array.map! &:to_s
=> ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
>> a.array
=> ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
You cannot do much with
attr_reader, because
attr_reader :array generates the following code:
def array; @array; end
If you don't want to expose array instance, you can return Enumerator of this array (external iterator). Enumerator is a good iterator abstraction and does not allow you to modify original array.
def array; @array.to_enum; end
What good for encapsulation and what not depends on the abstraction your class presents. Generally this is not good for encapsulation to expose internal state of an object, including internal array. You may want to expose some methods that operate on the
@array instead of exposing
@array (or even its iterator) itself. Sometimes this is fine to expose array - always look at the abstraction your class presents.
|
https://codedump.io/share/GgeMsKI88oop/1/ruby--how-to-prevent-modification-of-an-array-instance-variable-through-an-attribute-reader
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
I am trying to run a small bash script inside a QT application which contains an if-test-then block and the necessary quotes inside the test. As the script should be compiled by QT and run by bash, the quotes have to be escaped twice, so the escaping backslashes for the quotes have to be escaped also, as I see it. Unfortunately it does not work as expected.
Here is the code:
#include <stdio.h>
QObject *parent;
int main(int argc, const char* argv[])
{
QProcess *myProcess = new QProcess(parent);
myProcess->execute("/bin/bash -c \"x=1 ; echo $x ; if [ \\\"$x\\\" = \\\"1\\\" ] ; then echo itsOne ; fi\"");
}
root@debian:~# ./proggy
1
/bin/bash: line 0: [: missing `]'
root@debian:~# x=1 ; echo $x ; if [ "$x" = "1" ] ; then echo itsOne ; fi
1
itsOne
A couple of points.
Firstly execute is a static member of QProcess so there's no need to create an instance of QProcess.
Secondly, it's generally easier to use the execute overload that separates the program name from the argument list.
With that in mind what you want is probably something like...
QProcess::execute("/bin/bash", QStringList() << "-c" << "x=1 ; echo $x ; if [ \\\"$x\\\" = \\\"1\\\" ] ; then echo itsOne ; fi");
|
https://codedump.io/share/jabNmOPdFODH/1/qt-program-containing-a-bash-script-with-an-if-test-then-block-and-the-escaped-necessary-quotes-inside-issues-error
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
I have imported an Existing Java Application into my Workspace .
I see that , a class with same name is present in different packages with in the Application.
For example a class named "Status.java" is present with in
com.tata.model.common.Status;
com.bayer.frontlayer.dao.Status;
import com.tata.model.common.Status;
import com.bayer.frontlayer.dao.Status;
public class Adapter
{
}
The import com.bayer.frontlayer.dao.Status collides with another import statement
You can use them explicitly without importing them, so the included package name differentiates between the two:
//No imports required! public class Adapter { private com.tata.model.common.Status x; private com.bayer.frontlayer.dao.Status y; }
|
https://codedump.io/share/nrGlrqDMEFv5/1/java--the-import-collides-with-another-import-statement
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Overview
Run IBM® MQ in a Docker container. By default, the supplied Dockerfile runs IBM MQ for Developers, but also works for IBM MQ. The source can be found on the ibm-messaging GitHub. There's also a short demo video available.
Preparing your Docker host
It is necessary to configure operating settings on your Docker host, to allow IBM MQ access to the resources it needs. This covers things like maximum file handles, which are governed by the Docker host, and not containers. If the host is configured incorrectly, the container will terminate with a message about what has failed.
You need to make sure that you either have a Linux kernel version of V3.16, or else you need to add the
--ipc host option when you run an MQ container. The reason for this is that IBM MQ uses shared memory, and on Linux kernels prior to V3.16, containers are usually limited to 32 MB of shared memory. In a change to Linux kernel V3.16, the hard-coded limit is greatly increased. This kernel version is available in Ubuntu 14.04.2 onwards, Fedora V20 onwards, and boot2docker V1.2 onwards. If you are using a host with an older kernel version, but Docker version 1.4 or newer, then you can still run MQ, but you have to give it access to the host's IPC namespace using the
--ipc host option on
docker run. Note that this reduces the security isolation of your container. Using the host's IPC namespace is a temporary workaround, and you should not attempt shared-memory connections to queue managers from outside the container.
Build
After extracting the code from this repository, you can build the image using the following command:
sudo docker build --tag mq ./8.0.0/
Usage
In order to use the image, it is necessary to accept the terms of the IBM MQ license. This is achieved by specifying the environment variable
LICENSE equal to
accept when running the image. You can also view the license terms by setting this variable to
view. Failure to set the variable will result in the termination of the container with a usage statement. You can view the license in a different language by also setting the
LANG environment variable.
This image is primarily intended to be used as an example base image for your own MQ images.
Running with the default configuration
You can run a queue manager with the default configuration and a listener on port 1414 using the following command. Note that the default configuration is locked-down from a security perspective, so you will need to customize the configuration in order to effectively use the queue manager. For example, the following command creates and starts a queue manager called
QM1, and maps port 1414 on the host to the MQ listener on port 1414 inside the container:
sudo docker run \ --env LICENSE=accept \ --env MQ_QMGR_NAME=QM1 \ --volume /var/example:/var/mqm \ --publish 1414:1414 \ --detach \ mq
Note that in this example, the name "mq" is the image tag you used in the previous build step.
Also note that the filesystem for the mounted volume directory (
/var/example in the above example) must be supported.
Customizing the queue manager configuration
You can customize the configuration in several ways:
- By creating your own image and adding your an MQSC file called
/etc/mqm/config.mqsc. This file will be run when your queue manager is created.
- By using remote MQ administration. Note that this will require additional configuration as remote administration is not enabled by default.
Note that a listener is always created on port 1414 inside the container. This port can be mapped to any port on the Docker host.
The following is an example
Dockerfile for creating your own pre-configured image, which adds a custom
config.mqsc and an administrative user
alice. Note that it is not normally recommended to include passwords in this way:
FROM mq RUN useradd alice -G mqm && \ echo alice:passw0rd | chpasswd COPY config.mqsc /etc/mqm/
Here is an example corresponding
config.mqsc script from the mqdev blog, which allows users with passwords to connect on the
PASSWORD.SVRCONN channel:
DEFINE CHANNEL(PASSWORD.SVRCONN) CHLTYPE(SVRCONN) SET CHLAUTH(PASSWORD.SVRCONN) TYPE(BLOCKUSER) USERLIST('nobody') DESCR('Allow privileged users on this channel') SET CHLAUTH('*') TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(NOACCESS) DESCR('BackStop rule') SET CHLAUTH(PASSWORD.SVRCONN) TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(CHANNEL) CHCKCLNT(REQUIRED) ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) ADOPTCTX(YES) REFRESH SECURITY TYPE(CONNAUTH)
Running MQ commands
It is recommended that you configure MQ in your own custom image. However, you may need to run MQ commands directly inside the process space of the container. To run a command against a running queue manager, you can use
docker exec, for example:
sudo docker exec \ --tty \ --interactive \ ${CONTAINER_ID} \ dspmq
Using this technique, you can have full control over all aspects of the MQ installation. Note that if you use this technique to make changes to the filesystem, then those changes would be lost if you re-created your container unless you make those changes in volumes.
Installed components
This image includes the core MQ server, Java, language packs, and GSKit. Other features (except the client) are not currently supported running in Docker. See the MQ documentation for details of which RPMs to choose.
Troubleshooting
Container command not found or does not exist
This message also appears as "System error: no such file or directory" in some versions of Docker. This can happen using Docker Toolbox on Windows, and is related to line-ending characters. When you clone the Git repository on Windows, Git is often configured to convert any UNIX-style LF line-endings to Windows-style CRLF line-endings. Files with these line-endings end up in the built Docker image, and cause the container to fail at start-up. One solution to this problem is to stop Git from converting the line-ending characters, with the following command:
git config --global core.autocrlf input
mqconfig fails
When the container starts, it runs
mqconfig to check the environment is OK. IBM MQ requires some kernel parameters to be set to particular values, which are not the default on many systems. You can fix this by issuing
sysctl commands to configure the kernel. For example, to set the maximum number of open files, use
sysctl fs.file-max=524288. See the section on "Preparing your Docker host" above for more details.
AMQ7017: Log not available
If you see this message in the container logs, it means that the directory being used for the container's volume doesn't use a filesystem supported by IBM MQ. This often happens when using Docker Toolbox or boot2docker, which use
tmpfs for the
/var directory. To solve this, you need to make sure the container's
/var/mqm volume is put on a supported filesystem. For example, with Docker Toolbox try using a directory under
/mnt/sda1. You can list filesystem types using the command
df -T
Issues and contributions
For issues relating specifically to this Docker image, please use the GitHub issue tracker. For more general issues relating to IBM MQ or to discuss the Docker technical preview, please use the messaging community. If you do submit a Pull Request related to this Docker image, please indicate in the Pull Request that you accept and agree to be bound by the terms of the IBM Contributor License Agreement.
License
The Dockerfile and associated scripts are licensed under the Apache License 2.0. IBM MQ Advanced for Developers is licensed under the IBM International License Agreement for Non-Warranted Programs. This license may be viewed from the image using the
LICENSE=view environment variable as described above or may be found online. Note that this license does not permit further distribution.
|
https://hub.docker.com/r/anoopnair/ibm-mq-debian/
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
If you take the hello world example, and add a time.sleep(5) at the
beginning... like this:
-----
import time
from mod_python import apache
def handler(req):
time.sleep(5)
req.content_type = "text/plain"
req.write("Hello World!")
return apache.OK
-----
Then request that URL twice, it seems that the second one doesn't
start until the first one is completely finished, that is, I can't
make them run at the same time. (And therefore, if I started 20 at
about the same time, the last one would not complete until about 100
seconds later, etc) How would I go about making them run at the same
time?
I've got a pretty standard mod_python install on gentoo. The
.htaccess for this directory is
-----
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
-----
I know this must be possible. But I don't know if it is a
configuration issue (.htaccess) or something within the code itself
(manually forking stuff off to handle multiple connections? bleh).
Jay K
|
http://modpython.org/pipermail/mod_python/2006-July/021657.html
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Not to self about mapM. Is it lazy? Sort of.
Literate source is here:.
First, some imports:
> {-# LANGUAGE OverloadedStrings, InstanceSigs #-} > > import Control.Applicative > import Control.Monad > import qualified Data.ByteString as B > import Data.ByteString.Internal (w2c) > import Data.Either
I recently wrote some code using wreq that seemed to use much more memory than I thought it should. The problem turned out not to be with wreq but with the way that I was using mapM. An equivalent snippet of code is:
> main1 = do > firstFile <- head mapM B.readFile (take 100000 $ repeat "MapM.lhs") > print $ B.length firstFile
I reasoned that mapM would construct its result lazily, then head would force evaluation of just the first element of the list. This isn’t the case, as explained here. The function mapM is basically equivalent to this:
> mapM' :: Monad m => (a -> m b) -> [a] -> m [b] > mapM' m [] = return [] > mapM' m (x:xs) = do > x' xs' return (x':xs')
So the monadic action m is evaluated to build up the list elements.
One of the answers on the StackOverflow page says to use a step by step series to only evaluate the bits that are required:
> data Stream m a = Nil | Stream a (m (Stream m a))
GHC 7.8.3 comes with Stream defined as:
> -- In GHC 7.8.3: > newtype Stream m a b = Stream { runStream :: m (Either b (a, Stream m a b)) }
The idea is that it represents a sequence of monadic actions. A Left is a final value of type b, while Right (a, Stream m a b) represents an intermediate value of type a along with the remaining stream.
The Monad instance is fairly straightforward. The return function turns a plain value into a final value (hence the Left), and the bind either stops with the final value or produces the new value along with the next stream.
> instance Monad m => Monad (Stream m a) where > return a = Stream $ return $ Left a > Stream m >>= k = Stream $ do > r case r of > Left b -> runStream $ k b > Right (a, str) -> return $ Right (a, str >>= k)
There are also instances for Functor and Applicative but we don’t need them here.
A handy function is liftIO which turns a normal monadic action into a stream:
> liftIO :: IO a -> Stream IO b a > liftIO io = Stream $ io >>= return . Left
It just runs the io action, and pipes it to a Left and then returns it in a Stream.
> readFileS :: FilePath -> Stream IO b B.ByteString > readFileS f = liftIO $ B.readFile f
To use readFileS we wrap it with runStream:
*Main> Left x print $ B.length x 4243
So we can produce final values, but what about intermediate ones? This is what yield does:
> yield :: Monad m => a -> Stream m a () > yield a = Stream $ return $ Right $ (a, return ())
At this point we have no idea about the remaining stream, so we return the unit ().
For testing the code here we’ll take the definition of collect from Stream as well. It just walks through the entire Stream and collects the values, ignoring the final unit value.
> collect :: Monad m => Stream m a () -> m [a] > collect str = go str [] > where > go str acc = do > r case r of > Left () -> return (reverse acc) > Right (a, str') -> go str' (a:acc)
Now we can try out yield using monadic notation:
> yield123 :: Stream IO Int () > yield123 = do > yield 1 > yield 2 > yield 3
*Main> collect yield123 [1,2,3]
We can mix normal Haskell control structures like if/then/else into the monadic notation:
> yieldEvens :: Int -> Stream IO Int () > yieldEvens n = if n > 10 > then return () > else do yield n > yieldEvens $ n + 2
*Main> collect $ yieldEvens 0 [0,2,4,6,8,10]
We could read some files using our readFileS function and yield the results:
> readAFewFiles :: Stream IO B.ByteString () > readAFewFiles = do > readFileS "MapM.lhs" >>= yield > readFileS "MapM.lhs" >>= yield > readFileS "MapM.lhs" >>= yield > readFileS "MapM.lhs" >>= yield > readFileS "MapM.lhs" >>= yield
*Main> length collect readAFewFiles 5
We can generalise this to apply a monadic function to a list of arguments, which is basically what mapM does:
> streamMapM :: (String -> IO B.ByteString) -> [String] -> Stream IO B.ByteString () > streamMapM _ [] = return () > streamMapM f (a:as) = do > (liftIO $ f a) >>= yield > streamMapM f as
And we can even make an infinite stream:
> readForever :: Stream IO B.ByteString () > readForever = streamMapM B.readFile (repeat "MapM.lhs")
Take from a stream and a definition of head for a stream:
> takeStream :: Integer -> Stream IO a () -> IO [a] > takeStream n str = go str [] n > where > go str acc n = do > if n else do r case r of > Left () -> return (reverse acc) > Right (a, str') -> go str' (a:acc) (n - 1) > > headStream :: Stream IO a () -> IO (Maybe a) > headStream str = do > h return $ case h of > [h'] -> Just h' > _ -> Nothing
So we can efficiently take the head of the stream without evaluating the entire thing:
*Main> (fmap B.length) headStream readForever Just 5917
I should point out that the example of reading a file a bunch of times could be achieved without Stream just by storing a list of the monadic actions, and then evaluating the one that we want:
> listOfActions :: [IO B.ByteString] > listOfActions = repeat $ B.readFile "MapM.lhs"
which can be used as follows:
*Main> B.length (head $ listOfActions) 6455
The difference is that the list is somewhat static, in that we can’t mix control structures into it as we can do with Stream.
Interestingly, the definition for Stream looks very similar to the definition for Free, which I used in an earlier post about free monads:
> data Stream m a = Nil | Stream a (m (Stream m a))
> data Free f r = MkPure r | MkFree (f (Free f r))
Here’s one way to encode Stream-like behaviour using free monads. I define two actions, yield and final. The yield action stores an input value of type a, a monadic function a -> IO b, and the rest of the structure, which turns out to be conveniently represented as a function b -> k. Being a function of b lets the rest of the structure depend on the result at the current node in the structure. The final action just stores the value and monadic action, and is a terminal node in the free monad.
> data StreamF a b k = Yield a (a -> IO b) (b -> k) > | Final a (a -> IO b)
For convenience, Command is a simpler type signature:
> type Command a b k = Free (StreamF a b) k
As in my earlier post, we need instances for Functor and Monad. They are fairly straightforward:
> instance Functor (StreamF a b) where > fmap f (Yield a io k) = Yield a io (f . k) > fmap _ (Final a io) = Final a io > > instance (Functor f) => Monad (Free f) where > return :: a -> Free f a > return x = MkPure x > > (>>=) :: Free f a -> (a -> Free f b) -> Free f b > (MkFree x) >>= h = MkFree $ fmap (q -> q >>= h) x > (MkPure r) >>= f = f r
Here are two helpers to make Command’s monadic usage easier:
> -- Lift an IO action to a final Command. > finalF :: a -> (a -> IO b) -> Command a b r > finalF a io = MkFree $ Final a io > > -- Lift an IO action to a Command that yields the value > -- and continues. > yieldF :: a -> (a -> IO b) -> Command a b b > yieldF a io = MkFree $ Yield a io (b -> MkPure b)
To run a Command we walk its structure recursively and run the IO actions as needed:
> runCommand :: (Show a, Show b, Show r) => Command a b r -> IO () > > runCommand (MkFree (Final a io)) = do > putStrLn $ "Final " ++ show a > x putStrLn $ "Produced the value: " ++ show x > > runCommand (MkFree (Yield a io next)) = do > b putStrLn $ "Yield: computed value: " ++ show b > runCommand (next b) > > runCommand (MkPure x) = putStrLn $ "MkPure: " ++ show x
As with Stream, we can mix control structures with the creation of the free monad:
> exampleCommand :: Command FilePath String String > exampleCommand = do > x y then yieldF "hello2.txt" readFile > else finalF "hello3.txt" readFile > return y
For example:
Yield: computed value: "hello1n" Yield: computed value: "hello2n" MkPure: "hello2n"
Taking the head of a Command is straightforward using the definition of runCommand:
> headCommand :: Command a r r -> IO r > headCommand (MkFree (Final a io )) = io a > headCommand (MkFree (Yield a io _)) = io a > headCommand (MkPure x) = return x
Here it is in action:
*Main> :t headCommand exampleCommand headCommand exampleCommand :: IO String *Main> headCommand exampleCommand "hello1n"
To finish things off, here are versions of take and mapM on Command:
> runOneCommand :: Command t t () -> IO (Either () (t, Command t t ())) > > runOneCommand (MkFree (Final a io)) = do > x return $ Right (x, MkPure ()) > > runOneCommand (MkFree (Yield a io next)) = do > b return $ Right (b, next b) > > runOneCommand (MkPure ()) = Left return () > > takeCommand :: Integer -> Command t t () -> IO [t] > takeCommand n str = go str [] n > where > go str acc n = do > if n else do r case r of > Left () -> return $ reverse acc > Right (a, str') -> go str' (a:acc) (n - 1) > > commandMapM :: (a -> IO a) -> [a] -> Command a a () > commandMapM _ [] = MkPure () > commandMapM f (a:as) = do > yieldF a f > commandMapM f as
It works like the Stream example:
> takeCommandExample = (fmap B.length) (takeCommand 3 $ commandMapM readFileBB (take 100000 $ repeat "MapM.lhs")) >>= print > where > -- Since B.readFile :: String -> B.ByteString > -- we have to write this wrapper so that the input > -- and result types match, as required by the > -- restriction "Command t t ()" in the signature > -- for takeCommand. > readFileBB :: B.ByteString -> IO B.ByteString > readFileBB = B.readFile . (map w2c) . B.unpack
There we go:
*Main> takeCommandExample [11241,11241,11241]
|
https://carlo-hamalainen.net/2014/10/
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Using Filters in Code Completion
ReSharper allows you to filter completion suggestions by kind of symbol, access modifiers, etc. You can modify the set of applied filters each time the code completion is invoked and/or choose to keep the state of filters.
By default, ReSharper shows filters bar at the bottom of the completion pou-up. In this bar, you can see the state of filters and click on box is selected, you can optionally modify the default state of filters. Note that these filter state controls are synchronized with the filter bar in the completion pop-up.
Filter modes
Each filter can be enabled in one of two modes: inclusive or exclusive.
Inclusive mode
if a filter is enabled in this mode, the completion list only shows items that match this filter. If there are several filters enabled in this mode, the completion list shows items that match all of these filters.
To enable filters in this mode, left-click on the filter icon.
On the filter bar, filters in this mode are highlighted with the uniform background.
Exclusive mode
if a filter is enabled in this mode, the completion list only shows items that match this filter. If there are several filters enabled in this mode, the completion list shows items that match all of these filters.
To enable filters in this mode, right-click on the filter icon.
On the filter bar, filters in this mode are highlighted with the border.
Shortcuts for completion filters
All completion filters can be toggled with keyboard shortcuts. The table below lists aliases for each action. You can use this aliases to find and assign specific shortcuts in Visual Studio options. ().
Custom filtersReSharper allows you to define custom filters that you can use to exclude items by their assembly, namespace, and other parameters from completion suggestions.
To define a custom completion filter
- Open thepage of ReSharper options.
- Make sure that the Enable Filters check box is ticked.
- Click Add.
- and technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.
|
https://www.jetbrains.com/help/resharper/2017.3/Using_Filters_in_Code_Completion.html
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Can VB 6 and VB.NET forms coexist?
Time and money are two of the biggest reasons developers don't migrate VB 6 applications. A toolkit due later this year will let VB 6 and VB.NET forms coexist.
This Article Covers
.NET 2.0 and VS 2005 Tech Ed 2006, SearchVB.com attended several breakout sessions focused on Visual Basic 2005. This three-part series looks at the language's past, present and future.
Migrating a Visual Basic 6 application to VB.NET requires a significant investment of both time and money -- neither of which are in large supply for anyone. The process can be especially troublesome for large, forms-based applications, since in almost all cases a decent chunk of code will not make it through the VB 6 Conversion Wizard and will have to be converted by hand.
One option that will be available soon is a toolkit from Clarity Consulting that will let developers created "hybrid" applications in which VB 6 forms and VB.NET forms coexist in an application running on VB 6.
During a breakout session at Tech Ed, Jon Rauschenberger, CTO of Clarity, offered a demo of this toolkit. Clarity is developing the product jointly with Microsoft, and it will be available alter this summer as a free download.
The toolkit is not a code converter. Rather, it provides shared state, an application event broker and interoperable forms functionality. The latter piece, interoperable forms, is by far the most important part, Rauschenberger said.
Developers create a new form in .NET and attribute the code, and the toolkit automatically generates a COM proxy. The resulting COM interface resembles a VB 6 form. "From a UI standpoint, you can't tell which version [of VB] I'm using," Rauschenberger said.
One major addition to VB.NET was My namespace, a resource locating framework that makes it easier to find and retrieve information from a file. Since VB 6 does not support My, the toolkit removes the resource and puts it in a namespace that VB 6 recognizes, Rauschenberger said.
"We want to keep VB 6 as familiar as possible while keeping the .NET experience as pure as possible," he continued. "There are no constraints on what you can do to a VB.NET form running in VB 6."
When migrating forms, it is a good idea to move over one functional unit at a time -- that is, both a master and a detail at the same time -- Rauschenberger said. Developers should also consider compiling all parts of a functional unit into a COM DLL; that way, there is a single executable, rather than one for each form.
Other considerations regarding the toolkit include the following:
Go on to Part 2 of the series, Tips and time-savers for VB 2005 application development
Go on to Part 3 of the series, What to expect from Vista development, VB 9
Start the conversation
|
http://searchwindevelopment.techtarget.com/news/1195714/Can-VB-6-and-VBNET-forms-coexist
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
This comes as a surprise to me.
I thought that: Xup, Xdown, Yup, Ydown and Zup, Zdown meant 6 'lots' of data. The XY and Z are clearly printed on the board:
HERE ARE IMAGES OF CALIBRATION RIGLSM303D is in the middle very near the middle of the big wooden pivoting 'arm', pivots on a clear acetate sheet over a printed compass rose glued to plywood on a stainless steel table.In this pic. it just so HAPPENS to be on the 'flat' i.e. X and Y out horizontally and Zup.
The rig allows accurate flat (horizontal) rotation with no other rotation:
SO I AM CLEARYour last posting means that i am going to need some description of what you say:
Here are the conventional labels for the "6 degrees of freedom" (the only one that i also use is 'heading' = yaw):
But when we say 'rotate', it may not be clear which we mean, so to clear that up here are conventional labels for referring to WHICH rotation we mean:
Can you please let me know each of:1. which three LSM303D orientations do you mean? (eg is X up the 'same' as X down etc), and2. which rotation. (eg turn about thetaZ, thetaY, thetaX)?
I have been fixing the LSM303D in all 6 directions and then rotating (10 degree increments) around 360 degrees of thetaZ
OMG, I think we might just be getting somewhere....
thanks in anticipation!
sixD, you need to have another look and and open your eyes, does mine look anything like yours, l am rotating the axle l am not turning the bucket, my segment device is on the end of the axle and l turn the axle.Have another read of my posts, l never say turn the IMU l say rotate it.You just need to do x,y,z axis once, not in both directions as when it is ROTATED about THE AXIS it goes max +-.As per your drawing of axis and arrows, please explain how turning your device rotates the axis? you are just pointing x,y,z in a different direction around 360 degrees on the flat.REPEAT have a look at my photo, l am NOT turning the bucket, l am rotating the axle.Now l reckon the penny might have dropped. I hoping anyway!
The difference between "turn" and "rotate" may be crystal clear to you, but that doesnt mean others will always know what you mean.
Your language in your recent post @kevin1961 is not respectful - i have been nothing but polite with you, and i would hope that you could extend the same courtesy to me.
I suggest you re read Merlin's posts, he shows how it is to be rotated at the top of the page, best of luck.kevin1961 out
I have gone back to first principles and re-read all information here and in the links, but i am still finding the LSM303D uncalibrate-able!!
i even closed off the possibility that my unit was faulty and wired in a new unit, but same outcome There must be something that i am overlooking, but for the life of me i cant see what it is. PLEASE SEND HELP!... i just want a tilt-compensated compass.
The problem (as with each run earlier in this thread) is that when the heading is constant but the unit tilts or rolls the heading does not remain constant.
OK can you see any problems with this process??
For each of A,B and C* my increments are 10 degrees each, so that's 36 stationary points around a circle. * at each reading i average 50 readings back to one data output for that position - the code for this is earlier in this thread.* this gives 108 orientations for Mag & Accel affected ONLY by gravity (they are stationary data reads)
For completeness here i can graph the RAW data (all 108 rows of x,y and z outputs, to see if the outputs are something that kinda 'looks right'.
Here is MagRAWdata for x-y, then y-z then x-z:
...and here is AccelRAWdata for x-y, then y-z then x-z:
For one extra check:
i can graph ONLY the relevant parts of each of the 108 data rows [i.e. only the 36 'A'-orientation points for x-y, only the 36 'B'-orientation for y-z, and only the 36 'C' orientation for X-Z] then this is the graphed output:
for mag:
and then for Accel:
Magneto can make the ovals into circles and centre the data and as you can see every one of the charts are like this EXCEPT FOR accel x-y which is weird! could this be where the problem lies?
THEN PUT THE DATA INTO MAGNETO
i separate the output into two tab-delimited .txt files, one Mag and one for Accel. I assume that i do this for all 108 points, not just the 36 for each orientation??
Can anyone kindly clarify if the process this far is correct?
many thanks
dB
Unless there is an error in the code or the mounting arrangement (with a nearby bit of iron or magnet), the "accel x-y" plot suggests that the sensor is defective. It should look similar to the other two accel plots.
Magneto fits an ellipsoid, not ellipses, and can use all the data points you provide. The more points, and the more evenly they are spaced over the 3D orientation sphere, the better.
It is in fact undesirable to consider only certain orientations of the sensor.
sixD, I don't know a lot about this method of calibration, but I don't think your accelerometer is defective. From looking at your test setup and your graphs, it doesn't look like you ever subject both the X and Y axes (blue and green) to gravitational acceleration at the same time. That is why you only see a cross pattern on your accel X-Y graph, and I think it explains why the software is having such a hard time "circularizing" it.
You should be able to get better data by adding another run (i.e. take your "A" setup and tip it over so the axis is parallel to the ground), but I think Jim is right that you want to get readings in as many orientations as you can; it might actually be better to wave the sensor around freely than to try to constrain its rotation to certain axes.
Kevin
Hi SixD, good to see you finally worked out the difference between turning and rotation of the axis.
Hi Kevin, l would thinking waving the IMU around for Cal won't work for the Accel as it would have a acceleration component as well as gravity??Merlin states that you only need to do approx 24 steps i.e 15 degree increments for Magneto to give a good enough correction ratio.My previously attached photo shows a V3 in the position you indicated for the X,Y axis data to be taken.That all being said, after magneto correction to Mag and accel, instead of max/min correction, my tilt error decreased from 13 degree to 11 degree error at 45 degree tilt. So not worth the effort. Better off building a gimbal and decreasing error to <2 at 45 degrees(when you are not constrained by size).What l can't understand is the Accel gives accurate degrees of tilt, which l would have though meant the complete DCM formula would give just as accurate tilt compensated heading, which it doesn't.
Hi.thankyou @Jim_Remington thats i i first thought it was a defective unit too, but thinking a bit more on it, and as per @kevin...
as he says:
REASON: the X and Y are producing reasonable results in other orientations, so they must be working. BUT it's def-o a problem and needs to be fixed. maybe i'm missing one orientation in my calibration.
re calibrate 'loose' or on the rig:@kevin, regarding waving the IMU instead, i'll keep it in mind, but from my testing i'd say that i agree with @kevin1961 that it would introduce more problems than it's worth.
so instead of plotting values against each other, i plotted my previous data against their dataNumber (for 1 thru 108 data points) and got this:
For MAG:
and for ACCEL:
so, while i thought i had them all covered, the first third (being 1-36) is flat-as-a-pancake so this data says that i am missing one IMU orientation. riiight.
so i took away the flat heading rotation that i called "A" above (rotated around a vertical axis) and substituted the data from the missing IMU position for one another rotation (around a horizontal axis)
and the new data now looks like this
for MAG:
hurrah, this looks to me like i think the RAW data should. hopefully you guys agree?
so i re-run all 108 data points thru magneto and it produces different calibrations values, but not very different. i input them into heading, carfully checking the +,- signs. OUTCOME: unfortunately the heading output is still NOT tilt-compensated
WHERE TO NOW?: this is some progress, no doubt, but i'm still not in the land of a tilt-compensated-compass. my current hunch is that the Xs and Ys should be reversed somehow. (i think this was true of early versions of LSM303 c/w later versions??. @kevin can you shed light on this?) its the only way i can see how a roll or pitch can make heading so much WORSE.
any other things to try would be gratefully received!
thanks
sixD
Hey SixD
I was having trouble with tilt compensation of my LSM303DLHC compass for an astronomy use.
For now I've managed a workaround involving limiting the position of the sensor, but I'm interested in figuring out the whole thing.
One quick question:
is this the code you are using for calculating the heading:?
fXm_comp = fXm*cos(pitch)+fZm*sin(pitch);fYm_comp = fXm*sin(roll)sin(pitch)+fYmcos(roll)-fZm*sin(roll)*cos(pitch);
I've noticed in your graphs that you calculate pitch and roll, which tells me you are using these formulas (which involve lots of trigonometric functions like sin and cos).
There is another way to calculate the heading, using vector math (dot products and cross products). that's the one I'm using, the bases is contained in the Pololu LSM303 library, ¿have you checked that out?
Hey @Adun,
yep, thats the one! A number of the tilt-compensated heading calcs i've seen use those formulae.
I would add this though: One of the three LSM303 library files is called heading.ino (i've taken out the remarks to keep it short):
#include <Wire.h>
#include <LSM303.h>
LSM303 compass;
void setup() {
Serial.begin(9600);
Wire.begin();
compass.init();
compass.enableDefault();
compass.m_min = (LSM303::vector<int16_t>){-32767, -32767, -32767};
compass.m_max = (LSM303::vector<int16_t>){+32767, +32767, +32767};
}
void loop() {
compass.read();
float heading = compass.heading();
Serial.println(heading);
delay(100);
}
yup, it doesn't get much simpler than that. in this trouble-shooting saga, i compared the heading output from the above sketch to the heading that outputs from the equation(s) approach (the ones you mention) and they come out exactly the same. i guess the same equations are onboard the IMU too. Anyway that was a) nice to know b) not helpful for solving any part of my problem.
i'm glad you are also
...after all this time all i can add is me too!
can you tell me more about the
either my library isnt uptodate or i'm missing something!
thanks much
Hi
I extended the class from LSM303.h file, which contains the body of the heading() method.
The template for the heading() method expects a "from" vector (which should be of magnitude 1 or -1), and it returns a heading relative to it.
The library always uses [0, -1, 0] which is the Y axis of the sensor for this, but as the sensor aims higher near zenith, it's heading makes no sense. Above 45° you should use the X axis (and add 90° to the result). This requires modifying (or extending) the Pololu library.
Try this experiment: Modify the library to calculate heading using 3 different "from" vectors: X (-1,0,0) Y(0, -1,0) Z(0,0,1), and then plot the data, like you've done (tilting from zero to zenith). You will see what I mean.
My workaround was to switch to using the Z axis (0,0,-1) and use the sensor inclined, so that Z should is always be horizontal and give a good reading, it works for me because it's for a telescope (not a boat) and it can keep the sensor vertical (zero rolling)
G'day,
i understand and as you say @Adun it makes perfect sense for a telescope. and if i needed such a big range i think what you're suggesting would be perfect. if that happened on a boat, the mast is in the water.
in regular use for a boat the tilt (roll) would go around 45 degrees but rarely and only momentarily and pitch would only be +/-10 ish i'd guess
Hats off to you, sir for getting into the .h file. something i've never done. I'm interested, though that you say...
...and i'm wondering if that is a clue to part of my problem/situation.
see, with the board 'on the flat' it's the Z axis which is up/down so heading would be based on X and Y axes, right? i wonder why the library would default to Y?? does that mean all this time that i should have my board on its 'edge' as its starting orientation, rather than on-the flat??
plus it might explain why the outputs for pitch and roll have always seemed so accurate compared with the wild errors that get introduced into the heading output - something i have always wondered how 2 outputs can be so reliable, but the third is lousy.
i have noticed that the tilt compensation amount varies around the heading. for example if the heading - that's the red line below - is at 100 (east-ish) and held constant and then the pitch goes up say 20deg - the first blue peak - then heading will wrongly adjust by MINUS 60degrees -thats the first red 'dip'.
I'm happy to try ANY experiment, but have never dived into the .h file. can you kindly post some code of what you are suggesting?
or maybe the above gives you some clue as to what's going on?!?!?
thanks much
Come On Jim, how about posting your complete code that can deliver what l would call amazing results that you have been able to get out of IMU's.I ask, because Kris has his code used by possible the biggest supplier of product at our level, has it openly available to all and l have found even his can't, down where l live, come anywhere near the the level of accuracy that you say you can get.Com on supply your code please.Thanks Kevin
Next assault. sixD, have you tried Kris's IMU as l said in earlier post's. I know it might be $50 but it will prove one way or the other. He backs his and is the person who shows all codes and fixes everyone else is.He says +-2, which they best l could get was 7.Buy one and prove one way or the other.You shouldn't need to be going into the .h (apart from looking and learning, not needing to change the code, maybe preferances) unless of course you can understand it all and if this was the case, you wouldn't need to be asking these questions.Regards
My code is here.
It obviously won't work for you, because it's meant for a telescope, and as you said, they don't move like boats.
My point is, instead of the code you're using (which has so many trigonometric functions) you could try Pololu's driver.
It has a "heading" method which according to the documentation:
float LSM303::heading(vector from)
"Returns the angular difference in the horizontal plane between the 'from' vector and north, in degrees"
Maybe you could try it.
Hi Jim, by the look of things you aren't willing to show the code you get the great results of zero tilt error with?????????????????????????????????????????????????????l am very keen to have a look and you could help a lot of people with it, so please post and help the IMU community.Regards Kevin
I've been using RTIMULib, which has a decent calibration routine built in, and have no need to revisit code for the LSM303D. I imagine that it wouldn't be difficult to modify RTIMULib to use that sensor, though.
My efforts were described here: and I highly recommend this software.
Of course, the accuracy of any IMU depends on doing the very best you can to calibrate both the magnetometer and the accelerometer, and in the latest posts, I don't see evidence that you folks have really accomplished that. I would like to see before and after calibration plots, showing nice circles (not ellipses) or spheres perfectly centered on the origin.
Thanks Jim, by the sounds of it you are using Rtimulib2 with soft and hard iron correction.Using Magneto l have centred circles on the Mag and Accel and as l said it only improved tilt error correction by 1-2 degrees to about +-10 of error (at worst).Also my guru Jack, devised an even more accurate means of axis measurement (data thru a whole sphere) that we put thru Magneto with no better results. His V3 went from +-7(max/min) to about +-5(magneto), he is in the Northern Hemisphere.Regards Kevin
|
https://forum.pololu.com/t/lsm303d-tilt-compensation-problem/11611/84
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Earlier in the year I wrote about using Bridge.net to write browser-based applications using React. Well, now, I'd like to present an update to that. I've changed how the base Component class ties into the React library (this is a class that may be derived from in order to create custom React components) - it now supports "SetState" - and I've added an alternative base class; the StatelessComponent, which will allow the writing of component classes that will operate as stateless components, as introduced by React 0.14. I've also improved how the components appear when viewed in the React Dev Tools browser extension and I've tied it into the latest, just-released version of Bridge (1.10) that has fixed a lot of bugs.
If you're the sort of person who likes to jump straight to the end of a book to see how it ends, then you can find the code on in my GitHub "Bridge.React" repo or you can add it to a Bridge project through NuGet (Bridge.React). But if you want to find out more of the details then keep reading! I'm not going to presume any prior knowledge from my previous post - so if you've read that, then I'm afraid I'm going to re-tread some of the same ground - however, I imagine that I don't have that many dedicated followers, so figure it makes more sense to make this entry nicely self-contained :)
In the past, I've also written about writing bindings for TypeScript (which is a language I liked.. but not as much as C#) and bindings for DuoCode (which is a project that seemed to have promise until they spent so longer thinking about their pricing model that I gave up on them) as well as a couple of posts about Bridge - and, often, I've got quite technical about how the bindings work under the hood. Today, though, I'm just going to deal with how to use the bindings. I'm happy that they're finally fully-populated and I've tried to make an effort to make them easy to consume, so let's just stick to getting Bridge apps talking to React and not worry about the magic behind the scenes!
I'm going to assume that you're familiar with React - though I won't be going into too much depth on it, so if you're not an expert then it shouldn't be any problem. I'm not going to assume that you have tried out Bridge yet, because it's so easy to presume that you haven't that it won't take us long to start from scratch!
So, let's really start from the basics. You need to create a new solution in Visual Studio - choose a C# Class Library. Now go to References / Manage NuGet Packages, search for "Bridge.React" online and install the package. This will automatically pull in the Bridge package as a dependency, and this sets up a "demo.html" file under the "Bridge/www" folder to make getting started as frictionless as possible. That file has the following content:
<!DOCTYPE html> <html lang="en" xmlns=""> <head> <meta charset="utf-8" /> <title>Bridge BridgeReactBlogPost</title> <script src="../output/bridge.js"></script> <script src="../output/BridgeReactBlogPost.js"></script> </head> <body> <!-- Right-Click on this file and select "View in Browser" --> </body> </html>
Note that the title and the JavaScript filename are taken from the project name. So the file above mentions "BridgeReactBlogPost" because that's the name of the project that I'm creating myself alongside writing this post (just to ensure that I don't miss any steps or present any dodgy demonstration code!).
We need to add a few more items now - the React library JavaScript, the Bridge.React JavaScript and an element for React to render inside. So change demo.html to something like the following:
<!DOCTYPE html> <html lang="en" xmlns=""> <head> <meta charset="utf-8" /> <title>Bridge BridgeReactBlogPost</title> <script src=""></script> <script src=""></script> <script src="../output/bridge.js"></script> <script src="../output/bridge.react.js"></script> <script src="../output/BridgeReactBlogPost.js"></script> </head> <body> <div id="main" /> </body> </html>
(Aside: If you want to, then you can add the line
"combineScripts": true
to your bridge.json file, which will cause ALL of the project JavaScript files to be built into a single file - including "bridge.js" and "bridge.react.js" - so, if you used this option, you would only need to include a single JavaScript file. In this example, it would be just "../output/BridgeReactBlogPost.js").
Now change the "Class1.cs" file (that was created automatically when you requested the new "Class Library" project) thusly:
using Bridge.Html5; using Bridge.React; namespace BridgeReactBlogPost { public class Class1 { [Ready] public static void Main() { React.Render( DOM.Div( new Attributes { ClassName = "wrapper" }, "Hiya!" ), Document.GetElementById("main") ); } } }
.. and then right-click on demo.html, click "View in Browser" and you should be greeted by some React-rendered content. Good start!
Update (2nd December 2015): I originally showed a non-static method above with a [Ready] attribute on it - this worked in earlier versions of Bridge but does not work any longer. In the examples in this post, using an instance method with the [Ready] attribute will result in the method NOT being called at DOM ready (it will appear to fail silently by doing no work but showing no warnings). Don't make my mistake, make [Ready] methods static!
Now, let's be slightly more ambitious -
[Ready] public static void Main() { React.Render( DOM.Div(new Attributes { ClassName = "wrapper" }, DOM.Input(new InputAttributes { OnChange = e => Window.Alert(e.CurrentTarget.Value), MaxLength = 3 }) ), Document.GetElementById("main") ); }
Re-build then use "View in Browser" again. Now each change to the input box is thrown back in your face in an alert. The type of "e.CurrentTarget" is "InputElement" and so there is a string "Value" property available. And the "InputAttributes" class allows the setting of all of the properties that are specific to an InputElement, such as "MaxLength". This is one of the great things about using a type system to document your API - you use types (such as requiring an InputAttributes instance when DOM.Input is called) to inform the user of the API; what can and can't be done. And, while I've got a lot of respect for the people maintaining the DefinitelyTyped TypeScript type definitions, you don't get as much detail in their React bindings as are available here!
In fairness, I should really give credit where it's due here - the "InputElement" type comes from the Bridge.Html5 namespace, so I haven't had to write all of those definitions myself. And the "InputAttributes" class was based upon the InputElement's source code; I only had to remove read-only properties (for example, the html "input" element has a "valueAsNumber" property - only applicable to input elements with type "number" - that is read-only and so it would not make sense for this to be settable as a React attribute). I also had to remove some unsupported functionality (for example, checkbox input elements support an "indeterminate" flag in browsers but this is not supported by React).
All of the element factory methods in React ("div", "span", "input", etc..) have corresponding methods in the bindings, with types that express any additional properties that should be available - eg. we have
ReactElement TD( TableCellAttributes properties, params Any<ReactElement, string>[] children );
where the "TableCellAttributes" introduces additional properties such as "int ColSpan" and "int RowSpan" (note that the bindings all use pascal-cased function and type names since this is what is more commonly seen in C# code - where the functions are translated into JavaScript they will automatically use the camel-cased JavaScript names, so "Div" becomes "div", for example).
But this is the boring stuff - as soon as you start using React, you want to create your own components!
React 0.14 introduced a concept, the "Stateless Component". In native JavaScript, this is just a function that takes a props reference and returns a React element. But to make it feel more natural in C#, the bindings have a base class which can effectively become a Stateless Component - eg.
public class MyLabel : StatelessComponent<MyLabel.Props> { public MyLabel(Props props) : base(props) { } public override ReactElement Render() { return DOM.Label( new LabelAttributes { ClassName = props.ClassName }, props.Value ); } public class Props { public string Value; public string ClassName; } }
The "StatelessComponent" base class takes a generic type parameter that describe the "props" reference type. Then, when "Render" is called, the "props" reference will be populated and ready to use within Render. If any other functions are declared within the class, they may be called from Render as you might expect (see further down). So we are able to write very simple custom components that React will treat as these special Stateless Components - about which, Facebook say:
In the future, we’ll also be able to make performance optimizations specific to these components
Creating one of these components is as easy as:
React.Render( new MyLabel(new MyLabel.Props { ClassName = "wrapper", Value = "Hi!" }), Document.GetElementById("main") );
It is important to note, however, that - due to the way that React creates components - the constructor of these classes must always be a no-op (it won't actually be called when React prepares the component) and the only data that the class can have passed in must be described in the props data. If you tried to do something like the following then it won't work -
public class MyLabel : StatelessComponent<MyLabel.Props> { private readonly int _index; public MyLabel(Props props, int index) : base(props) { // THIS WON'T WORK - the constructor is not processed _index = index; } public override ReactElement Render() { return DOM.Label( new LabelAttributes { ClassName = props.ClassName }, props.Value + " (index: " + _index + ")" ); } public class Props { public string Value; public string ClassName; } }
You can use instance members if you want to, you just can't rely on them being set in the constructor because the constructor is never called. Side note: I'm thinking about trying to write a C# Analyser to accompany these bindings so that any rules like this can be pointed out by the compiler, rather than you just having to remember them.
public class MyLabel : StatelessComponent<MyLabel.Props> { private int _index; public MyLabel(Props props) : base(props) { } public override ReactElement Render() { // Accessing instance fields and methods is fine, so long as it // isn't done in the constructor SetIndex(); return DOM.Label( new LabelAttributes { ClassName = props.ClassName }, props.Value + " (index: " + _index + ")" ); } private void SetIndex() { _index = MagicStaticIndexGenerator.GetNext(); } public class Props { public string Value; public string ClassName; } }
You can also create custom components that have child elements. Just like "DOM.Div" takes an attributes reference (its "Props", essentially) and then an array of child elements, the StatelessComponent class takes a params array after that first "props" argument.
This array has elements of type "Any<ReactElement, string>", which means that it can be the result of a React factory method (such as "Div") or it can be a string, so that text elements can be easily rendered. Or it can be any class that derives from StatelessComponent as StatelessComponent has an implicit cast operator to ReactElement.
(Note: There used to be a ReactElementOrText class mentioned here but it didn't offer any benefit over Bridge's generic Any<,> class, so I've changed the NuGet package - as of 1.3.0 / 27th September 2015 - and have updated this post accordingly).
So, we could create a simple "wrapper" component that renders a Div with a class and some children -
public class MyWrapper : StatelessComponent<MyWrapper.Props> { public MyWrapper(Props props, params Any<ReactElement, string>[] children) : base(props, children) { } public override ReactElement Render() { return DOM.Div( new Attributes { ClassName = props.ClassName }, Children ); } public class Props { public string ClassName; } }
And render it like this:
React.Render( new MyWrapper(new MyWrapper.Props { ClassName = "wrapper" }, DOM.Span(null, "Child1"), DOM.Span(null, "Child2"), DOM.Span(null, "Child3") ), Document.GetElementById("main") );
or even just like:
React.Render( new MyWrapper(new MyWrapper.Props { ClassName = "wrapper" }, "Child1", "Child2", "Child3" ), Document.GetElementById("main") );
The "Children" property accessed within MyWrapper is exposed through StatelessComponent and will echo back the child elements passed into the constructor when the component instance was declared. If there were no children specified then it will be an empty array.
This brings us on to the next topic - Keys for dynamic children. To aid React's reconciliation process in cases where dynamic children elements are specified, you should specify Key values for each item. Each Key should be consistent and unique within the parent component (for more details, read the "Keys / Reconciliation" section from the Facebook docs).
If you were declaring React components in vanilla JavaScript, then this would be as easy as including a "key" value in the props object. Using these Bridge bindings, it's almost as simple - if your component needs to support an optional "Key" property then its Props class should include a "Key" property. And that's all that's required! You don't need to set anything to that Key inside your component, you merely need to allow it to be set on the props. React will accept numeric or string keys, so I would recommend that you declare the "Key" property as either an int or a string or as an Any<int, string>, which is built-in Bridge class that allows either of the value types to be used. To illustrate:
public class MyListItem : StatelessComponent<MyListItem.Props> { public MyListItem(Props props) : base(props) { } public override ReactElement Render() { return DOM.Li(null, props.Value); } public class Props { public Any<int, string> Key; public string Value; } }
Note: In the earlier examples, the "Child{x}" elements were fixed at compile time and so didn't need Key properties to be set, but if you were displaying a list of search results that were based on data from an api call, for example, then these elements would NOT be fixed at compile time and so you should specify unique Key values for them.
So far, I've only talked about stateless components, which are like a slimmed-down version of full React components. But sometimes you need a stateful component, or one that supports the full React lifecycle.
For these times, there is another base class - simply called Component. This has two generic type parameters, one for the "props" data and for "state". However, the constructor signature is the same as the StatelessComponent; it takes a props reference and then any children element that the component instance has. The state reference is controlled by the two React component lifecycle functions "GetInitialState" and "SetState". "GetInitialState" is called when the component is first created and "SetState" can be used to not only update the internal "state" reference but also request that the component re-render.
The most basic example would be something like this:
// Note: I've not even declared a class fortthe State, I've just used // "string" since the state in this class is just a string value. But // that's because I'm lazy, the state was more complicated then it // could be a separate class, just like Props. public class StatefulControlledTextInput : Component<StatefulControlledTextInput.Props, string> { public StatefulControlledTextInput(Props props) : base(props) { } protected override string GetInitialState() { return ""; } public override ReactElement Render() { return DOM.Input(new InputAttributes { ClassName = props.ClassName, Type = InputType.Text, Value = state, OnChange = ev => SetState(ev.CurrentTarget.Value) }); } public class Props { public string ClassName; } }
Each time the input's value is changed, the component calls its own SetState function so that it can re-render with the new value (there's a good Facebook summary article if you've forgotten the difference between "controlled" and "uncontrolled" components; the gist is the controlled components only raise events when the user requests that their values change, they won't be redrawn unless React cause them to redraw).
This isn't all that the Component class allows, though, it has support for the other React component lifecycle methods - for example, sometimes the "OnChange" event of a text input is raised when the content hasn't really changed (if you put focus in a text input and [Ctrl]-[C] / copy whatever value is in it and then [Ctrl]-[V] / paste that value straight back in, the OnChange event will be raised even though the new value is exactly the same as the old value). You might consider this redraw to be unacceptable. In which case, you could take advantage of the "ShouldComponentUpdate" function like this:
public class StatefulControlledTextInput : Component<StatefulControlledTextInput.Props, string> { public StatefulControlledTextInput(Props props) : base(props) { } protected override string GetInitialState() { return ""; } protected override bool ShouldComponentUpdate( StatefulControlledTextInput.Props nextProps, string nextState) { return (props != nextProps) || (state != nextState); } public override ReactElement Render() { return DOM.Input(new InputAttributes { ClassName = props.ClassName, Type = InputType.Text, Value = state, OnChange = ev => SetState(ev.CurrentTarget.Value) }); } public class Props { public string ClassName; } }
Now, in the cases where the input's value doesn't really change, the component's "update" will be bypassed.
Clearly, this is a trival example, but it demonstrates how you could do something more complicated along these lines. All of the other functions "ComponentDidMount", "ComponentDidUpdate", "ComponentWillMount", "ComponentWillReceiveProps", "ComponentWillUnmount" and "ComponentWillUpdate" are also supported.
And, of course, the Component base class has the same "Children" integration that StatelessComponent has and the same support for specifying a "Key" props value.
There is one little oddity to be aware of, though: In React, "setState" has (in my opinion) a slightly odd behaviour in that it will accept a "partial state value" that it will then merge with the current state reference. So if you had a MyComponentState class with properties "Value1" and "Value2" then you could, in vanilla JavaScript React, call setState({ Value1: whatever }) and it would take that "Value1" and overwrite the current "Value1" in the current state reference, leaving any existing "Value2" untouched. In these bindings, you must specify an entire State reference and this merging does not occur - the old State reference is replaced entirely by the new. This is largely because the "SetState" function in the bindings takes a full "State" class reference (C# doesn't really have a concept of a part-of-this-class representation) but it's also because I think that it's clearer this way; I think that you should be explicit about what you're setting State to and having it be a-bit-of-what-was-there-before and a-bit-of-something-new is not as clear (if you ask me) as a complete here-is-the-new-state reference.
In React, it is strongly recommended that props and state be considered to be immutable references. In the examples here I've used immutability-by-convention; the "props" classes have not actually been immutable types. I'm intending to write a follow-up article or two because there is more that I want to explore, such as how to use these bindings to write React apps in a "Flux"-like manner and how to take more advantage of genuinely immutable types. But, hopefully, this has been a nice enough introduction into the bindings and got you thinking about trying to use C# to write some React apps! Because, if you're aiming to write a web application in a "Single Page Application" style, if your application is of any serious complexity then you're going to end up with quite a lot of code - and, while I have a real soft spot for JavaScript, if it comes to maintaining a large app that's written in JavaScript or that's written in C# then I know which way I would lean! Thank goodness Bridge.net has come along and let us combine JavaScript frameworks with C# :)
Posted at 23:29
Just
Dan is a big geek who likes making stuff with computers! He can be quite outspoken so clearly needs a blog :)
In the last few minutes he seems to have taken to referring to himself in the third person. He's quite enjoying it.
|
http://www.productiverage.com/Archive/11/2015
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
This post is about the second SWC of my “dreamed up” Flex SDK for JavaScript, browser.swc. In a nutshell, I want to put the main framework class, core JavaScript library class wrapper, and browser DOM API wrapper into browser.swc.
Framework class
When you start building a Flex SDK in ActionScript you will quickly realize that there are a bunch of utility functions that you will use over and over again. I have already shown you a few in this series about cross-compiling ActionScript to JavaScript:
- as3.getProperty/setProperty/callProperty
- as3.isProxy
- as3.instanceOf
- as3.addToUint
- as3.vectorFilter
- as3.implements
You might now recall that I put all of those utility functions into the as3 namespace. Instead of “as3” I am using “adobe” as my main framework class, which also contains those low-level utility functions. I have only one rule for the main framework class: all members and methods have to be static. But you can tell FalconJS to tell which framework class should be used.
My adobe framework class is not tied to a specific core JavaScript library like jQuery or Google Closure Library. Instead it uses a static member that points to an IFramework interface:
public static var m_framework : IFramework = null;
IFramework is my attempt to create an abstraction layer that works for most core JavaScript libraries.
IFramework
This is roughly in IFramework:
package browser { import org.w3c.dom.Element;public interface IFramework { function isFunction( obj:Object ) : Boolean; function isArray( val: * ) : Boolean; function bind( fn:Function, selfObj:Object ) : Function; function exportSymbol(publicPath:String, object : *, opt_objectToExportTo : Object = null ) : void;// Style interface function setStyle( element : Element, name : String, value : String ) : void; function getStyle( element : Element, name : String) : String;// Event interface function createEvent( type : String ) : Object; function listenToObject(src:Element, type:String, listener:Function, opt_capt:Boolean = false, opt_handler : Object = null ) : uint; function unlistenToObject(src:Element, type:String, listener:Function, opt_capt:Boolean = false, opt_handler : Object = null ) : Boolean; function dispatchEvent(eventTarget:Element, e:IEvent) : Boolean; } }
Most core JavaScript libraries come with a bunch of utility functions for compensating browser quirks, binding functions to instances, and event handling. For browser.swc I implemented JQueryFramework and ClosureFramework based on the IFramework interface above and that has worked fine for me.
I will explain later what org.w3c.dom.Element is all about.
Core JavaScript Library Classes
JQueryFramework implements IFramework but it uses jQuery functions. This is all done in ActionScript:
import com.jquery.jQuery;public class JQueryFramework implements IFramework { public function isFunction(obj:Object):Boolean { return jQuery.isFunction(obj); } ... }
Okay, the next question is: What’s in com.jquery.jQuery?
package com.jquery { public class jQuery implements IExtern { // public static native function isFunction( obj:Object ) : Boolean; } }
IExtern is something I came up in order to let FalconJS know that an interface, or class is representing a JavaScript implementation. I could have used metadata tags but at that time when I wrote those wrappers FalconJS was not able to support metadata tags. Below I will show you a cleaner declaration of external classes.
As you can see I use the same trick as Tamarin does for declaring atomic classes and functions. Declaring isFunction() as a native function makes sure that FalconJS’s MXMLC (the JavaScript application compiler) will assume that the host environment (in our case the browser) will provide those “native” implementations. That’s exactly what we want to do with all native JavaScript functions!
Let’s have a quick look at the emitted JavaScript for JQueryFramework.isFunction:
JQueryFramework.prototype.isFunction = function(obj) { return jQuery.isFunction(obj); // not com.jquery.jQuery.isFunction(obj); }
Wait a second, shouldn’t that be “return com.jquery.jQuery.isFunction(obj);”, because isFunction is a static method?
This is a little bit iffy, but because jQuery implements IExtern FalconJS knows that there is no real com.jquery package. This assumption works for most of the JavaScript libraries I know. A much cleaner solution would use metadata tags, perhaps like this:
package com.jquery {[Extern(name="jQuery")] public class jQuery { // public static native function isFunction( obj:Object ) : Boolean; ... } }
Switching over from IExtern to Extern metadata tag is one of the clean up tasks I have on my list for FalconJS.
Alternatively I could throw everything into the default package namespace just like the browser does. But I like using ActionScript’s package names. That way I can keep my projects better organized.
Browser DOM API
The jQuery example above used the “native” keyword for declaring functions that are part of external code that we expect the host environment to provide at runtime. There is a second way of declaring external functions that I prefer. In FlashRT most of the browser DOM APIs are defined as interfaces. This works pretty well, because in the browser you can get to all APIs through one root object called DOMWindow. For example from DOMWindow you can get the Document and from Document you can get or create other DOM elements etc.
In my adobe framework class I added a static variable pointing to a DOMWindow:
import org.w3c.dom.DOMWindow; ... public static var globals : DOMWindow = null;
The startup code will set DOMWindow, which you can use to retrieve other browser DOM interfaces:
// ActionScriptpackage org.w3c.dom { // map org.w3c.dom.DOMWindow to DOMWindow [Extern(name="DOMWindow")] public interface DOMWindow { ... function get document() : Document; function get console() : Console; function get XMLHttpRequest() : Class; function get navigator() : Navigator; function setTimeout(closure:Function, delay:uint, ...args) : uint; ... } }
In the code snippet above I am only showing a small section of what is in DOMWindow. For a more complete list please see Mozilla’s documentation, or this neat DOM Reference Manual. I don’t know why, but the W3C specs don’t seem to define DOMWindow. Other interfaces like Document are described in their own interface description language (IDL):); };
It’s tedious but pretty easy to create corresponding ActionScript interfaces for those IDL snippets manually. Alternatively you could write a custom IDL compiler (like Google’s Dart team seems to use). But I don’t find it necessary to develop an IDL compiler for W3C specs. I would change my mind if W3C started pumping out 300 important specs a year that I have to write wrappers for.
Without a trace
Let me show you how all those pieces come together in this implementation of trace(), which is also in browser.swc:
/** * Displays expressions, or writes to log files, while debugging. A single trace * statement can support multiple arguments. If any argument in a trace statement * includes a data type other than a String, the trace function invokes the associated * <code>toString()</code> method for that data type. For example, if the argument is * a Boolean value the trace function invokes * <code>Boolean.toString()</code> and displays the return value. * @param arguments One or more (comma separated) expressions to evaluate. * For multiple expressions, a space is inserted between each * expression in the output. * @playerversion Flash 9 * @langversion 3.0 * @includeExample examples\TraceExample.as -noswf * @playerversion Lite 4 */
package { import adobe; import org.w3c.dom.DOMWindow; import org.w3c.dom.Console;[DebugOnly]public function trace(...arguments) : void { const domWindow : DOMWindow = adobe.globals; const console : Console = domWindow.console; if( console != null ) { var s : String = ""; for(var i:uint =0; i < arguments.length; i++) s += arguments[i]; if( s.length > 0 ) console.info( s ); } } }
The [DebugOnly] metadata tag tells your cross-compiler that this function and any calls to it can be stripped out in release builds.
Who is in and who is not?
Here are a few files you would find in my browser.swc:
- adobe.as – main framework class.
- goog.as – root class with static native methods wrapping base.js functions.
- trace.as – package function that calls adobe.globals.console.info() .
- browser/IFramework.as – interface used by adobe framework.
- browser/JQueryFramework.as – implements IFramework in terms of jQuery.
- browser/ClosureFramework.as – implements IFramework in terms of Google’s base.js.
- com/jquery/$.as – wrapper for jQuery’s $ function.
- com/jquery/Event.as – wrapper for jQuery’s Event object.
- com/jquery/fn.as – wrapper for jQuery.fn.
- com/jquery/jQuery.as – wrapper for jQuery’s root object.
- goog/* – wrapper for Google’s Closure Library.
- org/w3c/dom/* – wrapper for the browser DOM API.
You could argue that the wrappers for jQuery, Google Closure Library, and perhaps even org.w3c.dom should go into their own separate SWCs. I wouldn’t disagree with you. The separation into browserglobal.swc, browser.swc, and flash.swc I have been describing so far just turned out to be most practical one for me. I did try to merge browserglobal.swc with browser.swc. But as mentioned in my previous post I have not been successful so far.
Wrapping everything up
browser.swc contains the main framework class, core JavaScript library class wrappers, and browser DOM API wrappers.
When creating wrapper classes and interfaces for JavaScript libraries you can either use the “native” keyword or interfaces. I prefer interfaces over classes with “native” functions. But sometimes “native” functions are unavoidable, because ActionScript interfaces don’t support static functions.
I also recommend taking advantage of ActionScript’s package namespace feature. This requires you to do a little extra work, because browsers usually declare all classes in the default package (i.e. Document instead of org.w3c.dom.Document).
It turns out that it is beneficial to add extra information to wrapper classes and interfaces for JavaScript libraries that indicate that those are implemented by external code. I propose adding Extern metadata tags to those wrapper classes and interfaces, which could also be used to map package names to names used by the host environment (i.e. [Extern(name=”jQuery”)] would map the native class “com.jquery.jQuery” to “jQuery”).
|
http://blogs.adobe.com/bparadie/2012/01/14/wrapping-native-javascript-libraries-in-actionscript/
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
Created on 2009-08-23 17:46 by carlosdf, last changed 2016-09-08 13:13 by berker.peksag. This issue is now closed.
It's not possible to modify a dict inside a dict using a manager from
multiprocessing.
Ex:
from multiprocessing import Process,Manager
def f(d):
d['1'] = '1'
d['2']['1'] = 'Try To Write'
if __name__ == '__main__':
manager = Manager()
d = manager.dict()
d['2'] = manager.dict()
print d
p = Process(target=f, args=(d,))
p.start()
p.join()
print d
d['2'] = 5
print d
The output Under Windows 7 (32 Bits) / Python 2.6.2 (32 Bits) is:
{'2': {}}
{'1': '1', '2': {}}
{'1': '1', '2': 5}
The output is the same if you change "d['2'] = manager.dict()" to
"d['2'] = dict()"
I get the same results on:
Python 2.6.2 (r262:71600, Sep 14 2009, 18:47:57)
[GCC 4.3.2] on linux2
I think this is the same issue I was seeing yesterday. You can exercise
the issue and cause an exception with just 6 lines:
##### CODE #####
from multiprocessing import Manager
manager = Manager()
ns_proxy = manager.Namespace()
evt_proxy = manager.Event()
ns_proxy.my_event_proxy = evt_proxy
print ns_proxy.my_event_proxy
##### TRACEBACK #####
Traceback (most recent call last):
File "test_nsproxy.py", line 39, in <module>
print ns_proxy.my_event_proxy
File "/usr/lib64/python2.6/multiprocessing/managers.py", line 989, in
__getattr__
return callmethod('__getattribute__', (key,))
File "/usr/lib64/python2.6/multiprocessing/managers.py", line 740, in
_callmethod
raise convert_to_error(kind, result)
multiprocessing.managers.RemoteError:
---------------------------------------------------------------------
Unserializable message: ('#RETURN', <threading._Event object at 0x1494790>)
---------------------------------------------------------------------
Storing a proxy into a proxied object and then accessing the proxy
returns a copy of the object itself and not the stored proxy. Thus,
updates to the nested dict are local and do not update the real object,
and proxies to unpicklable objects raise an exception when accessed.
When a manager receives a message, it unpickles the arguments; this
calls BaseProxy.__reduce__, which calls RebuildProxy. If we are in the
manager, this returns the actual object, otherwise it returns a new
proxy. If we naively disable the ability for proxied objects to be
unredirected in the manager, as in the attached svn diff, this solves
the problem that Carlos and I are seeing. Surprisingly, after applying
this change, the full multiprocessing regression test still runs fine.
I'm sure this change should have some greater impact, but I'm not sure
what. I would appreciate if someone more knowledgeable could comment.
Nothing jumps out to me off the top of my head - I can take a closer look
at this after my pycon planning duties finish up in a few weeks. I agree
this is unintended behavior. I'll need to audit the tests to make sure
that A> This is being tested, and B> Those tests are not disabled.
When we included multiprocessing, some tests were deemed too unstable at
the time, and we disabled. This was unfortunate, and I haven't been able
to circle back and spend the time needed to refactor the test suite.
The tests for the SyncManager are being automagically generated at
import time -- I was not quite able to follow that well enough to know
exactly what is getting tested, or if they are even enabled. It did not
appear to contain any recursion, however.
Yeah, the auto-generation is too clever and needs to be pulled out
entirely.
Even with the patch, I can not resolve this problem. I can reproduce the problem with the patched version with the following code. My system is:
Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
IPython 0.10
Platform is Mac OS X (10.5.8) Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009
import multiprocessing as mp
def f(d):
d['f'] = {}
d['f']['msg'] = 'I am here'
manager = mp.Manager()
d = manager.dict()
p = mp.Process(target=f, args=(d,))
p.start()
p.join()
print d
d = {}
f(d)
print d
Output:
{'f': {}}
{'f': {'msg': 'I am here'}}
Kaushik, in your example, d is a dict proxy, so assignment to d['f'] correctly ferries the assignment (a new normal dict) to the d['f'] in the original process. The new dict, however, is not a dict proxy, it's just a dict, so assignment of d['f']['msg'] goes nowhere. All hope is not lost, however, because the Manager can be forked to new processes. The slightly modified example below shows how this works:
from multiprocessing import Process, Manager
def f(m, d):
d['f'] = m.dict()
d['f']['msg'] = 'I am here'
m = Manager()
d = m.dict()
p = Process(target=f, args=(m,d))
p.start()
p.join()
print d
{'f': <DictProxy object, typeid 'dict' at 0x7f1517902810>}
print d['f']
{'msg': 'I am here'}
With the attached patch, the above works as shown, without, it gives the same output as your original example.
Hello,
Trying to share a dictionary of dictionaries of lists with a manager I get the same problem with the patch applied in Python 2.7 (r27:82500, Nov 24 2010, 18:24:29) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2.
The shared variable in results and what I'm trying to do is simultaneously parsing multiple files.
The quality of the code is not very good because I'm a newbie python programmer.
Best regards,
Darío
I'm getting these results on both:
Python 3.2.3 (default, Apr 10 2013, 06:11:55)
[GCC 4.6.3] on linux2
and
Python 2.7.3 (default, Apr 10 2013, 06:20:15)
[GCC 4.6.3] on linux2
The symptoms are exactly as Terrence described.
Nesting proxied containers is supposed to be a supported use case! From the documentation:
>>> a = manager.list()
>>> b = manager.list()
>>> a.append(b) # referent of a now contains referent of b
>>> print a, b
[[]] []
>>> b.append('hello')
>>> print a, b
[['hello']] ['hello']
The documented code works as expected, but:
>>> a[0].append('world') # Appends to b?
>>> print a, b
[['hello']] ['hello']
I've attached my reproduction as a script.
I'm still running into these issues with Python 2.7.10. I'm trying to find a way to share dynamically allocated sub-dictionaries through multiprocessing as well as dynamically allocated RLock and Value instances. I can use the manager to create them but when I put them in a managed dict the various issues related in this ticket happen.
Two core issues are compounding one another here:
1. An un-pythonic, inconsistent behavior currently exists with how managed lists and dicts return different types of values.
2. Confusion comes from reading what is currently in the docs regarding the expected behavior of nested managed objects (e.g. managed dict containing other managed dicts).
As Terrence described, it is RebuildProxy where the decision is made to not return a proxy object but a new local instance (copy) of the managed object from the Server. Unfortunately there are use cases where Terrence's proposed modification won't work such as a managed list that contains a reference to itself or more generally a managed list/dict that contains a reference to another managed list/dict when an attempt is made to delete the outer managed list/dict before the inner. The reference counting implementation in multiprocessing.managers.Server obtains a lock before decrementing reference counts and any deleting of objects whose count has dropped to zero. In fact, when an object's ref count drops to zero, it deletes the object synchronously and won't release the lock until it's done. If that object contains a reference to another proxy object (managed by the same Manager and Server), it will follow a code path that leads it to wait forever for that same lock to be released before it can decref that managed object.
I agree with Jesse's earlier assessment that the current behavior (returning a copy of the managed object and not a proxy) is unintended and has unintended consequences. There are hints in Richard's (sbt's) code that also suggest this is the case. Merely better documenting the current behavior does nothing to address the lack of or at least limited utility suggested in the comments here or the extra complications described in issue20854. As such, I believe this is behavior that should be addressed in 2.7 as well as 3.x.
My proposed patch makes the following changes:
1. Changes RebuildProxy to always return a proxy object (just like Terrence).
2. Changes Server's decref() to asynchronously delete objects after their ref counts drop to 0.
3. Updates the documentation to clarify the expected behavior and clean up the terminology to hopefully minimize potential for confusion or misinterpretation.
4. Adds tests to validate this expected behavior and verify no lock contention.
Concerned about performance, I've attempted applying the #2 change without the others and put it through stress tests on a 4.0GHz Core i7-4790K in a iMac-Retina5K-late2014 OS X system and discovered no degradation in execution speed or memory overhead. If anything with #2 applied it was slightly faster but the differences are too small to be regarded as anything more significant than noise.
In separate tests, applying the #1 and #2 changes together has no noteworthy impact when stress testing with non-nested managed objects but when stress testing the use of nested managed objects does result in a slowdown in execution speed corresponding to the number of nested managed objects and the requisite additional communication surrounding them.
These proposed changes enable the following code to execute and terminate cleanly:
import multiprocessing
m = multiprocessing.Manager()
a = m.list()
b = m.list([4, 5])
a.append(b)
print(str(a))
print(str(b))
print(repr(a[0]))
a[0].append(6)
print(str(b))
To produce the following output:
[<ListProxy object, typeid 'list' at 0x110b99260>]
[4, 5]
<ListProxy object, typeid 'list' at 0x110b7a538>
[4, 5, 6]
Justin: I've tested the RLock values I've gotten back from my managed lists too -- just didn't have that in the example above.
Patches to be attached shortly (after cleaning up a bit).
Attaching patch for default (3.6) branch which implements what was previously described and discussed, updates the documentation to explain this updated behavior, and includes new tests.
@yselivanov: Can you think of any edge cases that should be handled but we're missing?
Updating previously supplied patch for 3.6 to the right format.
Attaching updated patch to reflect Yury's suggested changes from review.
New changeset 39e7307f9aee by Davin Potts in branch 'default':
Fixes issue #6766: Updated multiprocessing Proxy Objects to support nesting
Fixed in upcoming 3.6.
|
https://bugs.python.org/issue6766
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
POSIX_TRACE_TRYGETNEXT_EVENT(3P)Programmer'sPManualRACE_TRYGETNEXT_EVENT(3P)
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
posix_trace_trygetnext_event — retrieve a trace event (TRACING)
#include <sys/types.h> #include <trace.h> int posix_trace_trygetnext_event(trace_id_t trid, struct posix_trace_event_info *restrict event, void *restrict data, size_t num_bytes, size_t *restrict data_len, int *restrict unavailable);
Refer to posix_trace_getnext_TRYGETNEXT_EVENT(3P)
|
http://man7.org/linux/man-pages/man3/posix_trace_trygetnext_event.3p.html
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
Hi,
Advertising
Recently, gateways have clamped down on malformed message bodies that contain single LF instead of the proper CF/LF mandated by RFCs: 2.1 "A line is a series of characters that is delimited with the two characters carriage-return and line-feed; that is, the carriage return (CR) character (ASCII value 13) followed immediately by the line feed (LF) character (ASCII value 10)." and it clarifies further: 2.3 "CR and LF MUST only occur together as CRLF; they MUST NOT appear independently in the body." I believe there is no ambiguity as to the ONLY acceptable line-ending anywhere in an Internet email? Historically though, many programmers who grew up in the Unix/Apple world are used to seeing “LF”-only line-ends in their text files, and (out of understandable) ignorance of the written standards, have used their regular programming technique in any form handlers and other applications that generated automated SMTP messages. The main source of these emails that I see being caught by gateways in hundreds every single day, are PHP-based form handlers, many of which are using the PHPmail extension. Of course, when programmers read the PHP official manual (the mail() function) they are event “educated” to ONLY use “LF” as the line-end – perpetuating this myth. I have attempted to point their standards-violation to the PHP and PHPmail folks – but when the open source community (who usually points to the big bad wolf “Microsoft” for ignoring standards) is called to follow RFCs, they suddenly are full of excuses themselves. I invite you to share your professional opinion: PHP Manual on mail() function: <> &edit=2 regarding: PHPmailer They actually fixed it – and then REVERSED that fix (probably because of a bunch of lazy/ignorant developers who feel that following RFCs is NOT desirable if they would have to follow the lead of Microsoft in this case – which is getting it RIGHT). Best Regards, Andy --- This E-mail came from the Declude.JunkMail mailing list. To unsubscribe, just send an E-mail to imail...@declude.com, and type "unsubscribe Declude.JunkMail". The archives can be found at.
|
http://www.mail-archive.com/declude.junkmail@declude.com/msg33647.html
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
Earlier this year I was introduced by someone I work with to AutoMapper. At a very convenient time it turned out since I was in the middle of a couple of projects that I had to do a lot of run-of-the-mill gluing together of request between web services where there were very similar object models in play but which came from different services - so I was looking at writing a load of code that basically took a request from one side and re-formed it into a very similar request to push elsewhere. Not particularly fun, and I find one of the places I'm most like to make stupid mistakes are when I'm not 100% mentally switched on because the task at hand makes me feel like I'm being a robot!
So, for one of these projects I was getting stuck into; AutoMapper to the rescue!
AutoMapper is an "object-to-object" mapper which, well.. maps from one object to another! :) If the source and destination objects have identical structure but different namespaces then most times AutoMapper will be able to translate from one to another as-if-by-magic, and there are several conventions that are applied by the default mapper that perform simple object flattening and other tricks.
There's loads of introductory tutorials out there for AutoMapper so this is just a dead simple example to get across the gist - I can use one call to a CreateMap method and use a nice fluent coding style to tweak it how I want, then conversion between lists or arrays or enumerables of mappable types are automatically handled:
var data = new Employee() { Name = new Employee.EmployeeName() { Title = "Mr", First = "Andrew", Last = "Test", }, DateOfBirth = new DateTime(1990, 6, 14) }; Mapper.CreateMap<Employee, Person>() .ForMember(d => d.Name, o => o.MapFrom(s => s.Name.Title + " " + s.Name.First + " " + s.Name.Last)); var dataList = new Employee[] { data }; var translated = Mapper.Map<Employee[], List<Person>>(dataList); public class Employee { public EmployeeName Name { get; set; } public DateTime DateOfBirth { get; set; } public class EmployeeName { public string Title { get; set; } public string First { get; set; } public string Last { get; set; } } } public class Person { public string Name { get; set; } public DateTime DateOfBirth { get; set; } }
This doesn't even scratch the surface; it can handle nested types and complex object models, you can define custom naming conventions for property mappings, specify properties to ignore or map other than to the conventions, map onto existing instances rather than creating new, create distinct configuration instances, .. loads and loads of stuff.
An example of its use out-in-the-field is in the MVC Nerd Dinner demo project and Jimmy Bogard (who wrote AutoMapper) mentions how he uses it in his article "How we do MVC" -.
.. which sounds like a very sensible application for it to me! (The rest of that article's definitely worth a read, btw).
There was one gotcha using it that caught me out, but it made perfect sense when I reasoned it through afterward.
I was mapping from one large, most-flat object into another where the first was a subset of the second; it was an old legacy webservice where the interface accepted every property for several types of bookings, where maybe 60% of the properties were shared between types and then the rest were specific to different booking types. So a booking made through the web interface resulted in an HotelBooking being instantiated, for example, and this was mapped onto the "super" booking object of the legacy service interface.
var source = new Hotel( Guid.NewGuid(), // .. other properties "Test" // .. other properties ); Mapper.CreateMap<Hotel, Booking>(); var dest = Mapper.Map<Hotel, Booking>(source); public class Hotel { public Hotel(Guid id, /* .. other properties .. */ string network) { if ((network ?? "").Trim() == "") throw new ArgumentException("Null/empty network specified"); // .. other validation .. Id = id; //.. other properties.. Network = network; //.. other properties.. } public Guid Id { get; private set; } // .. other properties .. /// <summary> /// This will never be null /// </summary> public string Network { get; private set; } // .. other properties .. } public class Booking { public Guid Id { get; set; } // .. other properties public string NetworkType { get; set; } // .. other properties }
On the translated "dest" instance, the NetworkType property is "System.String" - er, what??
Well it turns out that AutoMapper finds that there is no NetworkType property to map from Hotel to Booking but sees that there is a "Network" value. It then tries to see if it can perform some object flattening by checking whether the Network value has a Type property which, being a string, it doesn't. But it then consider a property retrieval method rather than a standard property getter so it looks for a GetType() method which, since string inherits from objects, it does! So it takes the .Network.GetType() value and assumes we want this for the Booking.NetworkType value!
Like I said, it all makes perfect sense but it took me a little while to work out what was happening in this case :)
Did I mention AutoMapper is open source? This is great cos it let me have a poke around the source code and get a feel for what magic seemed to be going on!
My biggest problem is with scenarios where I want to do the opposite of the above - instead of translating from an "always-valid" internal object to a webservice class I'd like to be able to instantiate a class through its constructor, using data from a source class.
Now, AutoMapper does have some sort of support for using constructors for mapping - eg.
Mapper.CreateMap<Booking, Hotel>() .ConstructUsing(src => new Hotel(src.Id, /* .. other properties .. */));
But here I've got to manually map all of the properties from the source to arguments in destination's constructor! What I really want is all of that clever name convention malarkey done in AutoMapper to be applied to constructor arguments of destination types. I mean, argument names are always present in compiled C# code so it's not like that data is unavailable for examination by AutoMapper. And having conversions like this would save me having to write a lot of boring code at webservice boundaries!
Now, since I seem to think it's so easy - How Hard Can It Be? :) - I'm going to have a bit of a play around and see if I can slap something together to do this. If I don't end up reduced to tears (and maybe even if I do!) I'll see what I can do about posting the results!
Posted at 21:38.
|
http://www.productiverage.com/Archive/3/2011
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
[8.0] Computed field with bulk write
In official documentation, we have the following example for computed fields :
total = fields.Float(compute='_compute_total')
@api.depends('value', 'tax')
def _compute_total(self):
for record in self:
record.total = record.value + record.value * record.tax
On the guidelines, we can read :
Be aware that this assignation will trigger a write into the database. If you need to do bulk change or must be careful about performance, you should do classic call to write
My question is how can we do the bulk change ? Is it valid to add the decorator @api.multi over the compute function and do something like self.write() ?
Hi Emanuel,
Yes by using decorator @api.multi you can write bulk record of same model.
If you are overriding write metho than you have to define decorator
@api.multi
This is the standard convention we always use multi for write because if write method is already overriden some where in custom module it will create singlton error if you not follow the multi api.
Suggestion is to always use api.multi when write come to picture.
Hope this will help.
Rgds,
Anil.
Sorry, my question was not very clear. I wanted to know what should we do specifically for computed fields. Can we decorate the compute functions used in fields with @api.multi ?
@Emanuel cino, Yes when you decorate your computational field with api.multi than it will auto trigger the that methods when the records will be loaded or any changes going to happen in any of record in the same model.
About This Community
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|
https://www.odoo.com/forum/help-1/question/8-0-computed-field-with-bulk-write-87506
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
#include <Pt/Unit/Test.h>
Inherits NonCopyable.
Inherited by Application
[private], TestCase, TestMethod, and TestSuite.
This is the base class for all types of tests that can be registered and run in a test application. It provides a virtual method run that is overriden by the derived classes and signals to inform about events that occur while the test is run.
Implemented in TestSuite, Application, and TestCase..
|
http://pt-framework.org/htdocs/classPt_1_1Unit_1_1Test.html
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
After adding the Structured Queries functionality to my Full Text Indexer project I've been looking back at the mechanism for matching runs of tokens - eg. matching
"penguins are the best"
not just to results that contain the words "penguins", "are", "the", "best" but results that contain them in a string, as a run of consecutive tokens.
I'd previously addressed this functionality with the ConsecutiveTokenCombiningTokenBreaker - this can wrap another token breaker so that during Index generation the Index will be populated with tokens that are not just individual words but also runs of words strung back together. (There's more details in the Token Breaker and String Normaliser variations post).
There are some issues that I've encountered with this when I've used it with real data, however. Firstly, the Index generation time expands greatly since so much more work is done in terms of generating the tokens and also building the Index with all of this additional token data. Secondly, all of this additional data takes up a lot more space (whether persisting the Index to disk or just maintaining it in memory). An Index generated with the use of a ConsecutiveTokenCombiningTokenBreaker will likely be several times larger, feasibly ten times as large. And finally, the token breaker takes a constructor argument "maxNumberOfTokens" which caps how many tokens will be strung together in any given run. This puts a limit on the length of input search strings, based on the number of tokens it would be broken down into ("penguins are the best" would be a run of four words. If a maxNumberOfTokens value of three was specified, then the string couldn't be matched in any content).
Something I've been thinking about adding is "Source Location" information to the match data. I believe that Lucene can be configured to record where in the source content that a particular token was extracted from, which can be used for search term highlighting. I've implemented search term highlighting on my blog but that tries to match search terms to content after the Index has identified which posts match the search. And it doesn't use the same string normaliser as the Index so it doesn't realise that "cat" and "cats" will be considered the same by the Index.
So in the back of my mind I've thought about adding this source location data to token matches so that I could use it to implement more consistent search term highlighting (consistent in that the same token matches identified by the Index will be considered by the search term highlighter).
But it struck me that I should be able to use the same data to search for consecutive runs of token matches after the Index has been generated, rather than requiring additional processing to generate the Index in the first place.
If all of the string data for a source data entry was extracted out into one long string then each "Source Location" instance would need a start index and a length for the segment of that string that was extracted for a particular token. However, this isn't how the string data is extracted for data types that have multiple properties to extract from, each is considered a separate field. So the source location would require a field index as well as the content start index and length. (If the source data type represents articles, for example, then different fields may be Title, Description, Author, etc..).
If, in addition to this, we record the "token index" for each source location then we would have the data required to identify consecutive runs. If a source data instance had a single text property with the content
"penguins are the best, penguins!"
this could be extracted into source locations with
{ 0, 0, 0, 8 }, // FieldIndex, TokenIndex, ContentIndex, ContentLength { 0, 1, 9, 3 }, // FieldIndex, TokenIndex, ContentIndex, ContentLength { 0, 2, 13, 3 }, // FieldIndex, TokenIndex, ContentIndex, ContentLength { 0, 3, 17, 4 }, // FieldIndex, TokenIndex, ContentIndex, ContentLength { 0, 4, 23, 8 } // FieldIndex, TokenIndex, ContentIndex, ContentLength
(They would all have FieldIndex zero since there is only a single field to extract from).
The search for "penguins are the best" could be performed by searching for each of the four words and then analysing the match data and its source locations to only consider token matches that are arranged in the content as part of a consecutive run. The second instance of "penguins" could be ignored as there is no match for the word "are" that has the same FieldIndex but a TokenIndex one greater.
This logic is incorporated into the new "GetConsecutiveMatches" extension method. Its signature is similar to "GetPartialMatches" - it takes a search term which is expected to be multiple tokens according to the token breaker which must also be provided. It then requires two weight combiners where GetPartialMatches only requires one.
// There are alternate signatures that take less arguments in favour of sensible defaults public static NonNullImmutableList<WeightedEntry<TKey>> GetConsecutiveMatches<TKey>( this IIndexData<TKey> index, string source, ITokenBreaker tokenBreaker, IndexGenerator.WeightedEntryCombiner weightCombinerForConsecutiveRuns, IndexGenerator.WeightedEntryCombiner weightCombinerForFinalMatches )
GetPartialMatches will combine matches for each of the individual words in the search term, regardless of where they appear in the source content. There is only one combination of match data for any given result. GetConsecutiveMatches has to break down the match data back into individual occurences in the source data because some occurences of a word may be valid for the returned data (if they are part of a consecutive run of search terms) while other occurences may not be valid (if they aren't part of a consecutive run). In the above example, the word "penguin" appears as a match with two source locations but only the first source location is valid as that is the only one that is part of a consecutive run of tokens that match "penguins are the best".
GetConsecutiveMatches will identify distinct runs of tokens represented by WeightedEntry instances with a single SourceLocation each. The first weight combiner will be called with these sets of tokens (where each set represents a single run that matches the entire search term) and must return a weight that represents the entire run. This run of tokens will be reduced to a single WeightedEntry instance with a single SourceLocation that spans from the start of the first token in the run to the end of the last one. A reasonable implementation of a weight combiner for this purpose would be one that sums together the weights of each token in the run and then applies a multiplier based on the length of the run (how many tokens are in it), this way longer token runs are awarded a greater match weight.
The second weight combiner is responsible for determing the final match weight for a result where the run of tokens is identified multiple times. If the source data in the earlier example had other data where the phrase "penguins are the best" appeared then a single WeightedEntry for that result for the string "penguins are the best" is required, its weight will be an aggregate of the weights of the individual matches. This process is exactly the same as that which takes place as part of the Index generation; when a token is found multiple times for the same result a combined weight for that token must be determined. The exact same delegate (the IndexGenerator.WeightedEntryCombiner) is used by the IndexGenerator's constructor and for the weight combiners for GetConsecutiveMatches.
That's the detail about the source locations data that enabled the GetConsecutiveMatches extension method to be written, and the detail about how to call it where you need to specify all of its behaviour. But following the convenience of the AutomatedIndexGeneratorFactory (see Automating Index Generation) I've included some method signatures which provide defaults for the weight combiners and the token breaker. So you can get results with the much simpler
var results = index.GetConsecutiveMatches("penguins are the best");
The default token breaker is a WhiteSpaceExtendingTokenBreaker that treats common puncuation characters as whitespace (such as square, round, curly or triangular brackets, commas, full stops, colons and some others). This is the same token breaker that the AutomatedIndexGeneratorFactory will use unless a token break override is specified.
The default weight-combiner-for-consecutive-runs will sum the weights of tokens in the consecutive run and then multiply by two to the power number-of-tokens-minus-one (so x2 if there are two tokens that make up the run, x4 if there are three, x8 if there are four, etc..). The default weight-combiner-for-all-of-a-results-consecutive-runs will sum the weights of the tokens (which is the default weight combiner used by the AutomatedIndexGeneratorFactoryBuilder).
While I was doing this, I added similar alternate method signatures to GetPartialMatches as well, so now the bare minimum it needs is
var results = index.GetPartialMatches("penguins are the best");
The default token break is the same as described above and the default weight combiner is one that sums the weights so long as all of the search terms are present for the result somewhere in its content. Any result that contains the words "penguins", "are" and "the" but not "best" would not be included in the results.
For my blog, I persist the search index data to disk so that it doesn't need to be rebuilt if the application is reset (it stores a last-modified date alongside the index data which can be compared to the last-modified date of any post, so it's rebuilt when the source data changes rather than when a memory cache entry arbitrarily expires).
I was concerned that this additional source location data would make a significant difference to the size of this stored data, which could be inconvenient because I tend to build it before uploading changes to the web server (so smaller is better). And, to be honest, I had already been somewhat surprised that the data I persist to disk was several megabytes. (Even though that also contains all of the raw Post contents, along with the AutoComplete content extracted from analysing the Posts, it was still larger than my gut instinct suspected it would be). So I didn't want to make it any worse!
I've used the bog standard BinaryFormatter to serialise the data and GZipStream to compress it. To see how much overhead was added by this approach compared to writing a custom serialisation method for the IndexData, I wrote the IndexDataSerialiser. This only works with IndexData (the specific implemenation of IIndexData rather than any IIndexData implementation) which means that there are assumptions that can be made (eg. that all of the source locations will be instances of the SourceFieldLocation class and not another class derived from it). And it's reduced the size of the data for the Index that my blog content generates to about 10% of what it was before. Win!
The IndexDataSerialiser is a static class with two methods:
void IndexDataSerialiser.Serialise(IndexData<TKey> source, Stream stream); IndexData<TKey> IndexDataSerialiser.Deserialise(Stream stream);
It doesn't compress the data at all, so there will be advantages to using a GZipStream. It uses the BinaryWriter to write out the bare minimum content required to describe the data when serialising and then the BinaryReader to read the data back out and instantiate a new IndexData from it. It has to rebuild the TernarySearchTreeDictionary that the IndexData takes as a constructor argument but my feeling is that the processing required to do this is less than deserialising an already-populated IndexData using the BinaryFormatter. (I've not compared them thorough but in preliminary testing it seemed to take longer to deserialise with the BinaryFormatter when the data was loaded into a MemoryStream than the IndexDataSerialiser deserialisation took when loading from disk).
I might write another day about how I implemented the search term highlighting on this blog but I think this post has already gone on long enough! Update (9th April): See Search Term Highlighting with Source Locations.
For more information on this project, see the Full Text Indexer Round-up.
Posted at 23:29
With
There is also a guid element in some versions of the RSS specification, and a mandatory id element in Atom, which should contain a unique identifier for each individual article or weblog post. In RSS the contents of the GUID can be any text, and in practice is typically a copy of the article URL. Atoms' IDs need to be valid URIs (usually URLs pointing to the entry, or URNs containing any other unique identifier).
I
A
Some time ago, I wrote some code that would generate a wrapper to apply a given interface to any object using reflection. The target object would need to expose the properties and methods of the interface but may not implement the interface itself. This was intended to wrap some old WSC components that I was having to work with but is just as easy to demonstrate with .Net classes:
using System; using COMInteraction.InterfaceApplication; using COMInteraction.InterfaceApplication.ReadValueConverters; namespace DemoApp { class Program { static void Main(string[] args) { // Warning: This code will not compile against the current code since the interface has changed // since the example was written but read on to find out how it's changed! // - Ok, ok, just replace "new InterfaceApplierFactory" with "new ReflectionInterfaceApplierFactory" // and "InterfaceApplierFactory.ComVisibilityOptions.Visible" with "ComVisibilityOptions.Visible" // :) var interfaceApplierFactory = new InterfaceApplierFactory( "DynamicAssembly", InterfaceApplierFactory.ComVisibilityOptions.Visible ); var interfaceApplier = interfaceApplierFactory.GenerateInterfaceApplier<IAmNamed>( new CachedReadValueConverter(interfaceApplierFactory) ); var person = new Person() { Id = 1, Name = "Teddy" }; var namedEntity = interfaceApplier.Apply(person); } } public interface IAmNamed { string Name { get; } } public class Person { public int Id { get; set; } public string Name { get; set; } } }
The "namedEntity" reference implements IAmNamed and passes the calls through to the wrapped "Person" instance through reflection (noting that Person does not implement IAmNamed). Of course, this will cause exceptions if an instance is wrapped that doesn't expose the properties or methods of the interface when those are called.
I wrote about the development of this across a few posts: Dynamically applying interfaces to objects, Part 2 and Part 3 (with the code available at the COMInteraction project on Bitbucket).
And this worked fine for the purpose at hand. To be completely frank, I'm not entirely sure how it worked when calling into the WSC components that expose a COM interface since I'm surprised the reflection calls are able to hook into the methods! It felt a bit hacky..
But just recently I've gotten into some of the nitty gritty of IDispatch (see IDispatch (IWastedTimeOnThis but ILearntLots)) and thought maybe I could bring this information to bear on this project.
The existing InterfaceApplierFactory class has been renamed to the ReflectionInterfaceApplierFactory and a new implementation of IInterfaceApplierFactory has been added: the IDispatchInterfaceApplierFactory. (Where do I come up with these catchy names?! :).
Where the existing (and now renamed) class generated IL to access the methods and properties through reflection, the new class generates IL to access the methods and properties using the code from my previous IDispatch post, handily wrapped up into a static IDispatchAccess class.
The code to do this wasn't too difficult to write, starting with the reflection-approach code as a template and writing the odd bit of test code to disassemble with ildasm if I found myself getting a bit lost.
While I was doing this, I changed the structure of the ReflectionInterfaceApplierFactory slightly - I had left a comment in the code explaining that properties would be defined for the type generated by the IL with getter and setter methods attached to it but that these methods would then be overwritten since the code that enumerates methods for the implemented interface(s) picks up "get_" and "set_" methods for each property. The comment goes on to say that this doesn't appear to have any negative effect and so hasn't been addressed. But with this revision I've gone a step further and removed the code the generates the properties entirely, relying solely on the "get_" and "set_" methods that are found in the interface methods as this seems to work without difficulty too! Even indexed properties continue to work as they get the methods "get_Item" and "set_Item" - if you have a class with an indexed property you may not also have a method named "Item" as you'll get a compilation error:
"The type 'Whatever' already contains a definition for 'Item'
I'm not 100% confident at this point that what I've done here is correct and whether or not I'm relying on some conventions that may not be guaranteed in the future. But I've just received a copy of "CLR via C#" in the post so maybe I'll get a better idea of what's going on and amend this in the future if required!
The types generated by the IDispatchInterfaceApplierFactory will not work if properties are not explicitly defined (and so IL is emitted to do this properly in this case).
Another new class is the CombinedInterfaceApplierFactory which is intended to take the decision-making out of the use of reflection / IDispatch. It will generate an IInterfaceApplier whose Apply method will apply an IDispatch wrapper if the object-to-wrap's type's IsCOMObject property is true. Otherwise it will use reflection. Actually, it performs a check before this to ensure that the specified object-to-wrap doesn't already implement the required interface - in which case it returns it straight back! (This was useful in some scenarios I was testing out and also makes sense; if the type doesn't require any manipulation then don't perform any).
I realised, going back to this project, that I'd got over-excited when I discovered the Lazy<T> class in .Net 4 and used it when there was some work in the code that I wanted to defer until it was definitely required. But this, of course, meant that the code had a dependency on .Net 4! Since I imagine that this could be useful in place of the "dynamic" keyword in some cases, I figured it would make sense to try to remove this dependency. (My over-excitement is probably visible when I wrote about it at Check, check it out).
I was using it with the "threadSafe" option set to true so that the work would only be executed once (at most). This is a fairly straight forward implemenation of the double-checked locking pattern (if there is such a thing! :) with a twist that if the work threw an exception then that exception should be thrown for not only the call on the thread that actually performed the work but also subsequent calls:
using System; namespace COMInteraction.Misc { /// <summary> /// This is similar to the .Net 4's Lazy class with the isThreadSafe argument set to true /// </summary> public class DelayedExecutor<T> where T : class { private readonly Func<T> _work; private readonly object _lock; private volatile Result _result; public DelayedExecutor(Func<T> work) { if (work == null) throw new ArgumentNullException("work"); _work = work; _lock = new object(); _result = null; } public T Value { get { if (_result == null) { lock (_lock) { if (_result == null) { try { _result = Result.Success(_work()); } catch(Exception e) { _result = Result.Failure(e); } } } } if (_result.Error != null) throw _result.Error; return _result.Value; } } private class Result { public static Result Success(T value) { return new Result(value, null); } public static Result Failure(Exception error) { if (error == null) throw new ArgumentNullException("error"); return new Result(null, error); } private Result(T value, Exception error) { Value = value; Error = error; } public T Value { get; private set; } public Exception Error { get; private set; } } } }
So finally, the project works with .Net 3.5 and can be used with only the following lines:
var interfaceApplierFactory = new CombinedInterfaceApplierFactory( new ReflectionInterfaceApplierFactory("DynamicAssembly", ComVisibilityOptions.Visible), new IDispatchInterfaceApplierFactory("DynamicAssembly", ComVisibilityOptions.Visible) ); var interfaceApplier = interfaceApplierFactory.GenerateInterfaceApplier<IWhatever>( new CachedReadValueConverter(interfaceApplierFactory) ); var wrappedInstance = interfaceApplier.Apply(obj);
In real use, you would want to share generated Interface Appliers rather than creating them each time a new instance needs wrapping up in an interface but how you decide to handle that is down to you!*
* (I've also added a CachingInterfaceApplierFactory class which can be handed to multiple places to easily enable the sharing of generated Interface Appliers - that may well be useful in preventing more dynamic types being generated than necessary).
Posted at 23:29
In the introductory Full Text Indexer post I showed how to build an Index Generator by defining "Content Retrievers" for each property of the source data type. I didn't think that, in itself, this was a huge amount of code to get started but it did have a generous spattering of potentially-cryptic class instantiations that implied a large assumed knowledge before you could use it.
With that in mind, I've added a project to the Full Text Indexer (Bitbucket) solution that can automate this step by applying a combination of reflection (to examine the source type) and default values for the various dependencies (eg. the string normaliser, token breaker, etc..).
This means that indexing data can now be as simple as:
var indexGenerator = (new AutomatedIndexGeneratorFactoryBuilder<Post, int>()).Get().Get(); var index = indexGenerator.Generate(posts.ToNonNullImmutableList());
where data is a set of Post instances (the ToNonNullImmutableList call is not required if the set is already a NonNullImmutableList<Post>).
public class Post { public int Id { get; set; } public string Title { get; set; } public string Content { get; set; } public IEnumerable<Comment> Comments { get; set; } } public class Comment { public string Author { get; set; } public string Content { get; set; } }
The two "Get" calls are because the example uses an AutomatedIndexGeneratorFactoryBuilder which is able to instantiate an AutomatedIndexGeneratorFactory using a handful of defaults (explained below). The AutomatedIndexGeneratorFactory is the class that processes the object model to determine how to extract text data. Essentially it runs through the object graph and looks for text properties, working down through nested types or sets of nested types (like the IEnumerable<Comment> in the Post class above).
So an AutomatedIndexGeneratorFactory is returned from the first "Get" call and this returns an IIndexGenerator<Post, int> from the second "Get".
// This means we can straight away query data like this! var results = index.GetMatches("potato");
(Note: Ignore the fact that I'm using mutable types for the source data here when I'm always banging on about immutability - it's just for brevity of example source code :)
This may be enough to get going - because once you have an IIndexGenerator you can start call GetMatches and retrieving search results straight away, and if your data changes then you can update the index reference with another call to
indexGenerator.Generate(posts.ToNonNullImmutableList());
But there are a few simple methods built in to adjust some of the common parameters - eg. to give greater weight to text matched in Post Titles I can specify:
var indexGenerator = (new AutomatedIndexGeneratorFactoryBuilder<Post, int>()) .SetWeightMultiplier("DemoApp.Post", "Title", 5) .Get() .Get();
If, for some reason, I decide that the Author field of the Comment type shouldn't be included in the index I can specify:
var indexGenerator = (new AutomatedIndexGeneratorFactoryBuilder<Post, int>()) .SetWeightMultiplier("DemoApp.Post.Title", 5) .Ignore("DemoApp.Comment.Author") .Get() .Get();
If I didn't want any comments content then I could ignore the Comments property of the Post object entirely:
var indexGenerator = (new AutomatedIndexGeneratorFactoryBuilder<Post, int>()) .SetWeightMultiplier("DemoApp.Post.Title", 5) .Ignore("DemoApp.Post.Comments") .Get() .Get();
(There are overloads for SetWeightMultiplier and Ignore that take a PropertyInfo argument instead of the strings if that's more appropriate for the case in hand).
The types that the AutomatedIndexGeneratorFactory requires are a Key Retriever, a Key Comparer, a String Normaliser, a Token Breaker, a Weighted Entry Combiner and a Token Weight Determiner.
The first is the most simple - it needs a way to extract a Key for each source data instance. In this example, that's the int "Id" field. We have to specify the type of the source data (Post) and type of Key (int) in the generic type parameters when instantiating the AutomatedIndexGeneratorFactoryBuilder. The default behaviour is to look for properties named "Key" or "Id" on the data type, whose property type is assignable to the type of the key. So in this example, it just grabs the "Id" field from each Post. If alternate behaviour was required then the SetKeyRetriever method may be called on the factory builder to explicitly define a Func<TSource, TKey> to do the job.
The default Key Comparer uses the DefaultEqualityComparer<TKey> class, which just checks for equality using the Equals class of TKey. If this needs overriding for any reason, then the SetKeyComparer method will take an IEqualityComparer<TKey> to do the job.
The String Normaliser used is the EnglishPluralityStringNormaliser, wrapping a DefaultStringNormaliser. I've written about these in detail before (see The Full Text Indexer - Token Breaker and String Normaliser variations). The gist is that punctuation, accented characters, character casing and pluralisation are all flattened so that common expected matches can be made. If this isn't desirable, there's a SetStringNormaliser method that takes an IStringNormaliser. There's a pattern developing here! :)
The Token Breaker dissects text content into individual tokens (normally individual words). The default will break on any whitespace, brackets (round, triangular, square or curly) and other punctuation that tends to define word breaks such as commas, colons, full stops, exclamation marks, etc.. (but not apostrophes, for example, which mightn't mark word breaks). There's a SetTokenBreaker which takes an ITokenBreak reference if you want it.
The Weighted Entry Combiner describes the calculation for combining match weight when multiple tokens for the same Key are found. If, for example, I have the word "article" once in the Title of a Post (with weight multiplier 5 for Title, as in the examples above) and the same word twice in the Content, then how should these be combined into the final match weight for that Post when "article" is searched for? Should it be the greatest value (5)? Should it be the sum of all of the weights (5 + 1 + 1 = 7)? The Weighted Entry Combiner takes a set of match weights and must return the final combined value. The default is to sum them together, but there's always the SetWeightedEntryCombiner method if you disagree!
Nearly there.. the Token Weight Determiner specifies what weight each token that is extracted from the text content should be given. By default, tokens are given a weight of 1 for each match unless they are from a property to ignore (in which they are skipped) or they are from a property that was specified by the SetWeightCombiner method, in which case they will take the value provided there. Any English stop words (common and generally irrelevant words such as "a", "an" and "the") have their weights divided by 100 (so they're not removed entirely, but matches against them count much less than matches for anything else). This entire process can be replaced by calling SetTokenWeightDeterminer with an alternate implementation (the property that the data has been extracted from will be provided so different behaviour per-source-property can be supported, if required).
Well done if you got drawn in with the introductory this-will-make-it-really-easy promise and then actually got through the detail as well! :)
I probably went deeper off into a tangent on the details than I really needed to for this post. But if you're somehow desperate for more then I compiled my previous posts on this topic into a Full Text Indexer Round-up where there's plenty more to be found!
Posted at 00:01
I have a CSS Minifier project hosted on Bitbucket which I've used for some time to compile and minify the stylesheet contents for this blog but I've recently extended its functionality after writing the Non-cascading CSS: A revolution! post.
The original, fairly basic capabilities were to flatten imports into a single request and then to remove comments and minify the content to reduce bandwidth requirements in delivery. The CSSMinifierDemo project in solution above also illustrated implementing support for 304 responses (for when the Client already has the latest content in their browser cache) and compression (gzip or deflate) handling. I wrote about this in the On-the-fly CSS Minification post.
Some time after that I incorporated LESS support by including a reference to dotLess.
However, now I think it has some features which aren't quite as bog standard and so it's worth talking about again!
One of the difficulties with "debugging" styles in large and complex sheets when they've been combined and minified (and compiled, in the case of LESS content) is tracking down precisely where a given still originated from when you're looking at it in Firebug or any of the other web developer tools in the browsers.
With javascript - whether it be minified, compiled from CoffeeScript or otherwise manipulated before being delivered the Client - there is support in modern browsers for "Source Mapping" where metadata is made available that can map anywhere in the processed content back to the original. Clever stuff. (There's a decent started article on HTML5 Rocks: Introduction to Javascript Source Maps).
However, there's (currently, if I'm being optimistic) no such support for CSS.
So I've come up with a workaround!
If I have a file Test1.css
@import "Test2.css"; body { margin: 0; padding: 0; }
and Test2.css
h2 { color: blue; a:hover { text-decoration: none; } }
then these would be compiled (since Test2.css uses LESS nested selectors) down to
body{margin:0;padding:0} h2{color:blue} h2 a:hover{text-decoration:none}
(I've added line breaks between style blocks for readability);
My approach is to inject additional pseudo selectors into the content that indicate which file and line number a style block came from in the pre-processed content. The selectors will be valid for CSS but shouldn't relate to any real elements in the markup.
#Test1.css_3,body{margin:0;padding:0} #Test2.css_1,h2{color:blue} #Test2.css_5,h2 a:hover{text-decoration:none}
Now, when you look at any given style in the web developer tools you can immediately tell where in the source content to look!
The LessCssLineNumberingTextFileLoader class takes two constructor arguments; one is the file loader reference to wrap and the second is a delegate which takes a relative path (string) and a line number (int) and returns a string that will be injected into the start of the selector.
This isn't quite without complications, unfortunately, when dealing with nested styles in LESS content. For example, since this
#Test2.css_1,h2 { color: blue; #Test2.css_5,a:hover { text-decoration: none; } }
is translated by the compiler into (disabling minification)
#Test2.css_1, h2 { color: blue; } #Test2.css_1 #Test2.css_5, #Test2.css_1 a:hover, h2 #Test2.css_5 h2 a:hover { text-decoration: none; }
The LESS translator has had to multiply out the comma separated selectors "#Test2.css_1" and "h2" across the nested selectors "#Test2.css_5" and "a:hover" since this is the only way it can be translated into CSS and be functionality equivalent.
But this isn't as helpful when it comes to examining the styles to trace back to the source. So additional work is required to add another processing step to remove any unnecessary markers. This can be dealt with by the InjectedIdTidyingTextFileLoader but it requires that you keep track of all of the markers inserted with the LessCssLineNumberingTextFileLoader (which isn't a massive deal if the delegate that is passed to the LessCssLineNumberingTextFileLoader also records the markers it has provided).
The good news is that the class CSSMinifier.FileLoaders.Factories.EnhancedNonCachedLessCssLoaderFactory in the CSS Minifier repo will instantiate a LESS file loader / processor that will apply all of the functionality that I'm going to cover in this post (including this source mapping) so if it's not clear from what I've described here how to implement it, you can either use that directly or look at the code to see how to configure it.
Rule 5 in Non-cascading CSS states that
All files other than the reset and theme sheets should be wrapped in a body "scope"
This is so that LESS values and mixins can be declared in self-contained files that can be safely included alongside other content, safe in the knowledge that the values and mixins are restricted in the scope to the containing file. (See that post for more details).
The disadvantage of this is the overhead of the additional body tag included in all of the resulting selectors. If we extend the earlier example
body { h2 { color: blue; a:hover { text-decoration: none; } } }
it will compile down to
body h2{color:blue} body h2 a:hover{text-decoration:none}
The LessCssOpeningBodyTagRenamer will parse the file's content to determine if it is wrapped in a body tag (meaning that the only content outside of the body tag is whitespace or comments) and replace the text "body" of the tag with a given value. So we may get it translated into
REPLACEME { h2 { color: blue; a:hover { text-decoration: none; } } }
and consequently
REPLACEME h2{color:blue} REPLACEME h2 a:hover{text-decoration:none}
This allows the ContentReplacingTextFileLoader to remove all references to "REPLACEME " when the LESS processing and minification has been completed. Leaving just
h2{color:blue} h2 a:hover{text-decoration:none}
The string "REPLACEME" and "REPLACEME " (with the trailing space) are specified as constructor arguments for the LessCssOpeningBodyTagRenamer and ContentReplacingTextFileLoader so different values may be used if you think something else would be more appropriate.
Update (4th June): I've replaced LessCssOpeningBodyTagRenamer with LessCssOpeningHtmlTagRenamer since trimming out the body tag will prevent stylesheets being written where selectors target classes on the body, which some designs I've worked with rely upon being able to do.
In order to follow Non-cascading CSS Rule 3
No bare selectors may occur in the non-reset-or-theme rules (a bare selector may occur within a nested selector so long as child selectors are strictly used)
media queries must be nested inside style blocks rather than existing in separate files that rearrange elements for different breakpoints (which is a common pattern I've seen used). This makes the maintenance of the styles much easier as the styles for a given element are arranged together but it means that there may end up being many media-query-wrapped sections in the final content where many sections have the same criteria (eg. "@media screen and (max-width:35em)").
I'm sure that I've read somewhere* that on some devices, having many such sections can be expensive since they all have to evaluated. I think it mentioned a particular iPhone model but I can't for the life of me find the article now! But if this is a concern then we can take all styles that are media-query-wrapped and merge any media queries whose criteria are identical using the MediaQueryGroupingCssLoader.
Note that this will move all of the media query sections to the end of the style content. If your styles rely on them appearing in the final output in the same order as they appear in the source then this may pose a problem. But this is one of the issues addressed by the Non-cascading CSS rules, so if they're followed then this manipulation will always be safe.
* Update (4th June): It finally found what I was thinking of but couldn't find - it was this comment on the artible Everyday I'm Bubbling. With Media Queries and LESS.
As part of this work, I've written a CSS / LESS parser which can be found on Bitbucket: CSS Parser. It will lazily evaluate the content, so if you only need to examine the first few style declarations of a file then only the work required to parse those styles will be performed. It's used by the LessCssOpeningBodyTagRenamer (4th June: Now the LessCssOpeningHtmlTagRenamer) and I intend to use it to write a validator that will check which of my Non-cascading CSS rules are or aren't followed by particular content. I might write more about the parser then.
In the meantime, if you want to give it a go for any reason then clone that repository and call
CSSParser.Parser.ParseLESS(content);
giving it a string of content and getting back an IEnumerable<CategorisedCharacterString>.
public class CategorisedCharacterString { public CategorisedCharacterString( string value, int indexInSource, CharacterCategorisationOptions characterCategorisation); public CharacterCategorisationOptions CharacterCategorisation { get; } // Summary: This is the location of the start of the string in the source data public int IndexInSource { get; } // Summary: This will never be null or an empty string public string Value { get; } } public enum CharacterCategorisationOptions { Comment, CloseBrace, OpenBrace, SemiColon, // Summary: Either a selector (eg. "#Header h2") or a style property (eg. "display") SelectorOrStyleProperty, // Summary: This is the colon between a Style Property and Value (not any colons that may exist in a // media query, for example) StylePropertyColon, Value, Whitespace }
The content is parsed as that enumerable set is iterated through, so when you stop enumerating it stops processing.
Update (12th March): I've posted a follow-up to this about various caching mechanism so that all of this processing need be performed as infrequently as possible! See CSS Minifier - Caching.
Update (4th June): I've also started writing up a bit about how I implemented the parsing, there's a few interesting turns (at least I think there are!) so check it out at Parsing CSS.
Posted at 15:02
This.
|
http://www.productiverage.com/Archive/3/2013
|
CC-MAIN-2017-13
|
en
|
refinedweb
|
.
@script RequireComponent(AudioSource)
public var clip : AudioClip; //make sure you assign an actual clip here in the inspector
function Start() { AudioSource.PlayClipAtPoint(clip, new Vector3 (5, 1, 2)); }
using UnityEngine; using System.Collections;
[RequireComponent(typeof(AudioSource))] public class ExampleClass : MonoBehaviour { public AudioClip clip; void Start() { AudioSource.PlayClipAtPoint(clip, new Vector3(5, 1, 2)); } }
|
https://docs.unity3d.com/ScriptReference/AudioSource.PlayClipAtPoint.html
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
java inheritance : example for overriding
what is the output of below Java program.
class Parent{
public void getBike(){
System.out.println("Suzuki bike");
}
}
class Child extends Parent{
public void getBike(){
System.out.println("Apache bike");
}
public void getCar(){
System.out.println("Swift car");
}
}
public class OverridingDemo {
public static void main(String[] args) {
Child c = new Child();
c.getBike();
c.getCar();
}
}
Apache bike
Swift car
Suzuki bike
Swift car
compile time error
run time exception.
Overriding : Having same function name with same signature in both base class and derived class.
If you override a function of base class in derived class, and when you try to access that function with derived class object, then it will call overridden function of derived class.
getBike() In this case it prints Apache bike.
getCar() is not overridden so it prints Swift car.
Hint: For overriding, it always depends on for which class you are creating object. JRE will call that object's function.
Child c = new Child(); Here we are creating object for Child class, so c.getBike() will call getBike() function of Child class.
Back To Top
|
http://skillgun.com/question/2889/java/inheritance/java-inheritance-example-for-overriding-what-is-the-output-of-below-java-program-class-parent-public-void-getbike-systemoutprintlnsuzuki-bike-class-child-extends-parent-public-void-getbike-systemoutprintlnapache-bike-public-void-getcar-systemoutprin
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
Microsoft promotes SQL Server as the database for your .NET applications, but with Oracle’s strong presence, you will undoubtedly need to utilize Oracle data in a .NET application. Oracle data was accessible in ADO.NET, using generic OLE-DB providers, but performance lagged behind that of SQL Server’s managed provider. Microsoft recognized the need for an Oracle-specific provider and released .NET Managed Provider For Oracle. Let's take a look at the ways you can take advantage of this connectivity to access important data.
Getting what you need
In the past, the term driver was often used to describe a tool allowing an application to access a database. This terminology has been replaced by the term managed provider in the .NET world. The .NET Managed Provider For Oracle is a .NET add-on, and it relies on the Oracle client software to interface with an Oracle database. So, in addition to having the .NET provider available, you’ll also have to install the Oracle client software.
You’ll need to add a reference to System.Data.OracleClient.dll to your project in Visual Studio .NET by right-clicking on the References list for the project or choosing Project | Add Reference from the menu bar. You’ll also probably want to import the System.Data.OracleClient namespace into your application.
Accessing the data
A very positive aspect of the .NET environment is the fact that database access code usually follows the same pattern regardless of backend database. First, you establish a connection, and then you configure the SQL statement or command. Finally, you execute the SQL and manipulate the results.
It stands to reason, then, that the code required for working with an Oracle database doesn't greatly differ from that used to access SQL Server. The object names are different. But the process is similar, as you can see from the VB.NET code in Listing A, which establishes a connection, creates a command object to return all the rows from a hypothetical PEOPLE table, and uses an OracleDataReader (analogous to the SqlDataReader and OleDbDataReader objects) to read the data.
If you've worked with SQL Server or another .NET provider, you will quickly notice the similarity of the class names used for Oracle. For instance, the SQL Server connection class is named SqlConnection, while the Oracle connection class is named OracleConnection.
Watch for errors
As with any .NET development, exceptions should be closely monitored to ensure proper code execution when accessing data. The OracleClient namespace includes an Oracle-specific exception class, OracleException, which may be used in a standard try…catch block. The code in Listing B takes advantage of this approach to catch any exceptions. Listing B presents an example of exception handling in action.
Although I utilized the OracleDataReader class within this article, the Oracle data provider includes versions of all of the standard ADO.NET classes like OracleDataSet and OracleDataAdapter. The .NET Managed Provider For Oracle from Microsoft provides the necessary tool to natively access Oracle data with performance boosts over OLE-DB access. And fortunately, the design pattern for the ADO.NET classes is such that accessing a database involves the same approach with similar objects, regardless of the type of database in use. This should make it easy to adapt any OLE-DB projects to use the Oracle provider.
|
http://www.techrepublic.com/article/access-oracle-data-with-nets-new-managed-provider/
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
Carsten Langgaard wrote:
> Ralf Baechle wrote:
>
> > On Mon, Aug 05, 2002 at 03:04:13PM +0200, Carsten Langgaard wrote:
> >
> > > Ok, I finally figured out what the problem is.
> > > The attached patch fix the problems, please apply.
> >
> > Applied, along with the 64-bit and 2.5 bits your patch was missing.
> >
>
Another reason why I didn't send the patch against the 64-bit is that the pci
handling is not completely
identical.
So the patch should actually look like this for things to work.
>
> I was waiting for you to fix the bus_to_baddr in the 64-bit, I can see
> you have have done something about it now, but I'm afraid you didn't get
> it quite right.
> Here is a patch to fix the typos.
>
> 06:36:35
> @@ 09:01:25
@@ );
}
/*
@@ -341,7 +341,7 @@
* returns, or alternatively stop on the first sg_dma_len(sg) which
* is 0.
*/
-#define sg_dma_address(sg) ((sg)->dma_address)
+#define sg_dma_address(sg) ((sg)->address)
#define sg_dma_len(sg) ((sg)->length)
#endif /* __KERNEL__ */
|
https://www.linux-mips.org/archives/linux-mips/2002-08/msg00040.html
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Multi-step relations in computed fields (v8)
I'm trying to add a field to stock.picking that would compute the set of packages created during the transfer operation.
stock.picking has a One2many relation to the package operations, and each package operation has a Many2one relation with the resulting package, so the relations might look like this:
Picking A is related to 3 Pack Ops: [1, 2, 3].
Pack Op 1 is related to Package x.
Pack Op 2 and 3 are both related to package y.
I want the set of packages [x, y]. However, if I loop through the packing operations, I will get [x, y, y]. I need this set in a QWeb template, so I don't have access to full Python functionality.
This is the code I have so far:
# -*- coding: utf-8 -*-
from openerp import models, fields, api
import logging
_logger = logging.getLogger(__name__)
class Picking(models.Model):
_inherit = 'stock.picking'
@api.depends('pack_operation_ids')
def _compute_result_packages(self):
self.result_packages = self.mapped('pack_operation_ids.result_package_id')
result_packages = fields.One2many(compute=_compute_result_packages, comodel_name='stock.quant.package')
However, updating the module where this Python file is imported does not change the model (checked via Settings -> Technical -> Database Structure -> Models and via erppeek 1.6.1).
There are other changes in the same file that are successfully applied, so it seems I must have defined the field incorrectly.
How do I set up a computed field for this kind of relation?
About This Community
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|
https://www.odoo.com/forum/help-1/question/multi-step-relations-in-computed-fields-v8-87062
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
I wanted to create something that took advantage of the 3d world available in Minecraft and decided to see if I could make some 3d fractals. Fractals are repeating patterns which when observed at different scales appear the same - I know that sounds like rubbish, but that's what they are!
These are the 3d fractal tree's I created in Minecraft:
This is what a 2d fractal tree looks like:
I found some python turtle code to create the 2d tree at interactivepython.org/runestone/static/pythonds/Recursion/graphical.html:
import turtle def tree(branchLen,t): if branchLen > 5: t.forward(branchLen) t.right(20) tree(branchLen-15,t) t.left(40) tree(branchLen-15,t) t.right(20) t.backward(branchLen) def main(): t = turtle.Turtle() myWin = turtle.Screen() t.left(90) t.up() t.backward(100) t.down() t.color("green") tree(75,t) myWin.exitonclick() main()
Its recursive, which means that a function calls itself, so in the example above the tree() function calls itself passing a smaller and smaller branch until the branch gets smaller than 5 and the function doesn't call itself any more and exits. Recursion is the basis of all fractals, its how you get the repeating patterns.
I modded this code to use my Minecraft Graphics Turtle and rather than create 2 branches each time the function is called it creates 4 branches - 2 facing north to south and 2 facing east to west.
#Minecraft Turtle Example import minecraftturtle import minecraft import block def tree(branchLen,t): if branchLen > 6: if branchLen > 10: t.penblock(block.WOOD) else: t.penblock(block.LEAVES) #for performance x,y,z = t.position.x, t.position.y, t.position.z #draw branch t.forward(branchLen) t.up(20) tree(branchLen-2, t) t.right(90) tree(branchLen-2, t) t.left(180) tree(branchLen-2, t) t.down(40) t.right(90) tree(branchLen-2, t) t.up(20) #go back #t.backward(branchLen) #for performance - rather than going back over every line t.setposition(x, y, z) #create connection to minecraft mc = minecraft.Minecraft.create() #get players position pos = mc.player.getPos() #create minecraft turtle steve = minecraftturtle.MinecraftTurtle(mc, pos) #point up steve.setverticalheading(90) #set speed steve.speed(0) #call the tree fractal tree(20, steve)
The other change I made was to change the block type so that the shorter branches (the ones at the top) are made of leaves and the ones at the bottom are made of wood.
I created these on the full version of Minecraft using Bukkit and Raspberry Juice, so I could take hi-def pictures but the same code works on the raspberry pi.
If you want to have a go, download the minecraft turtle code from github.com/martinohanlon/minecraft-turtle and run the example_3dfractaltree.py program:
sudo apt-get install git-core cd ~ git clone cd ~/minecraft-turtle python example_3dfractaltree.py
I also made a fractal tree made out of random colours, check out example_3dfractaltree_colors.py.
|
http://www.stuffaboutcode.com/2014/07/minecraft-fractal-trees.html
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
Hi
I have a sequence that I want to put into a seperate function:
The variables I want to take into that function and back to the main function are declared globally.
declaring the function and the testing variable:
void sanction (); int test[10];
my main function:
int main(int argc, char *argv[]) { test[10] = 10; printf ("in main: 10 = %d\n", test[10]); sanction (); printf ("in main after adding: 10 = %d\n", test[10]); return (0); }
the separate function:
void sanction( void ) { printf ("in sanction: 10 = %d\n", test[10]); test[10] = test[10] + 1; }
output:
in main: 10 = 10
in sanction: 10 = 10
in main after adding: 10 = 11
So everything works like it should, but why?
I thought the void ment no variable-values are taken to the separate function and none are returned.
I just want to be sure that when I use this with the actual code, I'm not making any mistakes.
thx
|
https://www.daniweb.com/programming/software-development/threads/71811/function-question
|
CC-MAIN-2017-17
|
en
|
refinedweb
|
Here is the code filling data with enterprise library.
First Create a Type dataset in the visual studio dataset called 'crystal'.
Then create a data table via right click add datatable called script.create
columns you require.
and then first import following name space using directives.
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary;
using System.Data;
using System.Data.Common;
Database db = DatabaseFactory.CreateDatabase("StockConnectionString");
private string _CommandName;
_CommandName = "sp_LoadScript";
DbCommand dbCommand = db.GetStoredProcCommand(_CommandName);
db.AddInParameter(dbCommand, "Name", DbType.String, "abc");
db.LoadDataSet(dbCommand, Crystal, "script");
here sp_Loadscript is a sql server 2005 stored procedure which load
script.
Thursday, March 1, 2007
Filling typed dataset with enterprise libary 2006-C#
Posted by jalpesh vadgama | March 01, 2007 | C#.NET | No comments
Your feedback is very important to me. Please provide your feedback via putting comments.
|
http://www.dotnetjalps.com/2007/03/filling-typed-dataset-with-enterprise.html
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
Nice.
It would be nice if we could just say systemctl start minidlna and have it work. Could you please drop the User= line from the service file or fix it some other way. E.g. the official minidlna package creates a new `minidlna` user. That code could just be copied wholesale to this package if desired.
Search Criteria
Package Details: readymedia-transcode-git 581.290ef09-1id3tag
- sqlite3 (sqlite)
- git (git-git) (make)
Required by (1)
- minidlnagui (requires minidlna)
Sources (4)
Latest Comments
jforberg commented on 2016-10-12 01:14
Nice.
Anonymous comment on 2013-08-14 05:12
Installing pkg-config solved my problems.
Anonymous comment on 2013-08-13 21:11
checking for sqlite3_prepare_v2 in -lsqlite3... yes
./configure: line 9454: syntax error near unexpected token `LIBAVFORMAT,'
./configure: line 9454: `PKG_CHECK_MODULES(LIBAVFORMAT, libavformat)'
After #'ing out the the PKG_CHECK_MODULES for LIBAVFORMAT, LIVAVUTIL, LIBAVCODEC, and MagickWand... it completes. Alas then upon make,
metadata.c:33:29: fatal error: wand/MagickWand.h: No such file or directory
#include <wand/MagickWand.h>.
In configure.ac, before building I tried directly #INCLUDE_DIR "/usr/include/ImageMagick-6", to no avail.
stativ commented on 2013-08-06 07:18
rndstr: x264 is a dependency of ffmpeg.
rndstr commented on 2013-08-04 10:40
the dependency `x264' is missing
/usr/bin/ld: warning: libx264.so.133, needed by /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../lib/libavcodec.so, not found (try using -rpath or -rpath-link)
after installing x264 it works.
stativ commented on 2013-07-05 08:33
You can try the standard "transcode_video" script. That one unfortunately has "DVD quality" output, but it is well tested.
The transcode_video-hq is a quick try on creating a script that tries to keep the quality as high as possible, but it is computationally intensive and it may require bandwidth too big for the TV to actually play some files. My Samsung TV refuses to play some files with this script too. The "client is full??" message in the log confirms it. I'm sure that someone with more experience in using ffmpeg would be able to come up with a better script, though.
tydell commented on 2013-07-04 22:50
It is very clearly what you wrote but I must say I have an issue with that. When I set container to all in minidlna.conf then I can't play any video on my tv (Sony Bravia kdl46nx720).
I try to play mp4 files (h264/aac) that my bravia supports very good. I need to transode this files to get subtitles in my movies (tv doesn't support external subs). I have:
transcode_video_containers=all
transcode_video_transcoder=/usr/share/minidlna/transcodescripts/transcode_video-hq
ffmpeg works with srt and ass subs (tested in terminal) so I edited properly transcode_video-hq to load subtitles.
Movie doesn't start, I get "Unable to play media" on my tv. In minidlna.log I get: ?
|
https://aur.archlinux.org/packages/readymedia-transcode-git/
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
Capturing the view close "x"
- polymerchm
So, can you capture the event of the "x" in the upper left hand corner of a presented ui.view being touched to allow for a cleanup before the whole script stops? I tried the obvious "finally", but that didn't fire, only the console upper right hand X did that.
Two techniques to look at:
while View.on_screen:and
View.wait_modal().
I assume this is a custom view, in which case, did you try
def will_close(self): # This will be called when a presented view is about to be dismissed. # You might want to save data here. pass
However, I vaguely recall this working for some types of presentation modes (say, popover), but not others, but I could be wrong about that.
Another alternative to the blocking options that ccc suggests would be a
threading.Threador
Timerthat polls the
on_screenat some reasonably slow interval (few seconds).
One other option... hide the title bar and provide your own "X". Doesn't protect against two finger swipes, but most people don't know about that anyway.
|
https://forum.omz-software.com/topic/1495/capturing-the-view-close-x
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
The String class represents character strings. A quoted string constant can be assigned to a String variable.
String literals in Java are specified by enclosing a sequence of characters between a pair of double quotes. In Java strings are actually object types.
The following code declares String type variable with Java String literal.
public class Main{ public static void main(String[] argv){ String str = "this is a test from java2s.com"; System.out.println(str); } }
The output:
You can use
+ operator to concatenate strings together.
For example, the following fragment concatenates three strings:
public class Main { public static void main(String[] argv) { String age = "9"; String s = "He is " + age + " years old."; System.out.println(s); } }
The following code uses string concatenation to create a very long string.
public class Main { public static void main(String args[]) { //from www. j a v a2 s.c om String longStr = "A java 2s. com" + "B j a v a 2 s . c o m " + "C java 2s.com" + "D java2s.com ."; System.out.println(longStr); } }
You can concatenate strings with other types of data.
public class Main { public static void main(String[] argv) { int age = 1; String s = "He is " + age + " years old."; System.out.println(s); } }
The output:
Be careful when you mix other types of operations with string concatenation. Consider the following:
public class Main { public static void main(String[] argv) { String s = "four: " + 2 + 2; System.out.println(s); } }
This fragment displays
rather than the
To complete the integer addition first, you must use parentheses, like this:
String s = "four: " + (2 + 2);
Now s contains the string "four: 4".
The escape sequences are used to enter impossible-to-enter-directly strings.
For example, "
\"" is for the double-quote character.
"
\n" for the newline string.
For octal notation, use the backslash followed by the three-digit number.
For example, "
\141" is the letter "a".
For hexadecimal, you enter a backslash-u (
\u), then exactly four hexadecimal digits.
For example, "
\u0061" is the ISO-Latin-1
"
a" because the top byte is zero.
"
\ua432" is a Japanese Katakana character.
The following table summarizes the Java String escape sequence.
Examples of string literals with escape are
"Hello World" "two\nlines" "\"This is in quotes\""
The following example escapes the new line string and double quotation string.
public class Main { public static void main(String[] argv) { String s = "java2s.com"; System.out.println("s is " + s); //w w w.j av a 2s .com s = "two\nlines"; System.out.println("s is " + s); s = "\"quotes\""; System.out.println("s is " + s); } }
The output generated by this program is shown here:
Java String literials must be begin and end on the same line. If your string is across several lines, the Java compiler will complain about it.
public class Main { public static void main(String[] argv){ String s = "line 1 line 2 "; } }
If you try to compile this program, the compiler will generate the following error message.
equals( ) method and the
== operator perform two different operations.
equals( ) method compares the characters inside a String object.
The
== operator compares two object references to see whether they refer to the same instance.
The following program shows the differences:
public class Main { public static void main(String args[]) { String s1 = "demo2s.com"; String s2 = new String(s1); System.out.println(s1 + " equals " + s2 + " -> " + s1.equals(s2)); System.out.println(s1 + " == " + s2 + " -> " + (s1 == s2)); } }
Here is the output of the preceding example:
|
http://www.java2s.com/Tutorials/Java/Java_Language/2050__Java_String.htm
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
I'm primarily a vanilla C programmer, so I never really thought about this before, but when programming in C++, should you attempt to remain as C++-only as possible? Or is the use of C functions in C++ perfectly ok?
For example, I'm rather used to explicitly declaring my char arrays and using strcpy etc on them, as opposed to using the C++ strings library, and have much disdain against the inefficiency of the IOStream namespace compared to the C Standard IO functions >_>
Anything I should note specifically?
|
https://cboard.cprogramming.com/cplusplus-programming/124442-mixing-c-cplusplus-code.html
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
Animation and Transitions in Qt Quick
Animation and Transitions Types
- Transition - Animates transitions during state changes
- SequentialAnimation - Runs animations sequentially
- ParallelAnimation - Runs animations in parallel
- Behavior - Specifies a default animation for property changes
- PropertyAction - Sets immediate property changes during animation
- PauseAnimation - Introduces a pause in an animation
- SmoothedAnimation - Allows a property to smoothly track a value
- SpringAnimation - Allows a property to track a value in a spring-like motion
- ScriptAction - Runs scripts during an animation
Types that animate properties based on data types
Animations are created by applying animation types to property values. Animation types will interpolate property values to create smooth transitions. As well, state transitions may assign animations to state changes.
To create an animation, use an appropriate animation type for the type of the property that is to be animated, and apply the animation depending on the type of behavior that is required.
Triggering Animations
There are several ways of setting animation to an object.
Direct Property Animation
Animations are created by applying animation objects to property values to gradually change the properties over time. These types have more efficient implementations than the PropertyAnimation type. They are for setting animations to different QML types such as
int,
color, and rotations. Similarly, the ParentAnimation can animate parent changes.
See the Controlling Animations section for more information about the different animation properties.
Using Predefined Targets and Properties
In the previous example, the PropertyAnimation and NumberAnimation objects needed to specify particular target and properties values to specify the objects and properties that should be animated. This can be avoided by using the <Animation> on <Property> syntax, which specifies the animation is to be applied as a property value source.
Below are two PropertyAnimation objects that are specified using this syntax:
import QtQuick 2.0 Rectangle { id: rect width: 100; height: 100 color: "red" PropertyAnimation on x { to: 100 } PropertyAnimation on y { to: 100 } }
The animation starts as soon as the rectangle is loaded, and will automatically be applied to its
x and
y values. Since the <Animation> on <Property> syntax has been used, it is not necessary to set the target value of the PropertyAnimation objects to
rect, and neither is it necessary to set the property values to
x and
y.
This can also be used by grouped animations to ensure that all animations within a group are applied to the same property. For example, the previous example could instead use SequentialAnimation to animate the rectangle's
color first to yellow, then to blue:
import QtQuick 2.0 Rectangle { width: 100; height: 100 color: "red" SequentialAnimation on color { ColorAnimation { to: "yellow"; duration: 1000 } ColorAnimation { to: "blue"; duration: 1000 } } }
Since the SequentialAnimation object has been specified on the
color property using the <Animation> on <Property> syntax, its child ColorAnimation objects are also automatically applied to this property and do not need to specify target or property animation values.
Transitions During State Changes
Qt Quick States are property configurations where a property may have different values to reflect different states. State changes introduce abrupt property changes; animations smooth transitions to produce visually appealing state changes.
The Transition type can contain animation types Animation as Behaviors
Default property animations are set using behavior animations. Animations declared in Behavior types apply to the property and animates any property value changes. However, Behavior types Qt Quick Examples - Animation for a demonstration of behavioral animations.
Playing Animations in Parallel or in Sequence type, the opacity animations will play after the preceding animation finishes. The ParallelAnimation type type is also useful for playing transition animations because animations are played in parallel inside transitions.
Controlling Animations
There are different methods to control animations.
Animation Playback
All animation types inherit from the Animation type. It is not possible to create Animation objects; instead, this type provides the essential properties and methods for animation types. Animation types have
start(),
stop(),
resume(),
pause(),
restart(), and
complete() -- all of these methods control the execution of animations.
Easing.
Other Animation Types
In addition, QML provides several other types useful for animation:
- PauseAnimation: enables pauses during animations
- ScriptAction: allows JavaScript to be executed during an animation, and can be used together with StateChangeScript to reused existing scripts
- PropertyAction: changes a property immediately during an animation, without animating the property change
These are specialized animation types that animate different property types
- SmoothedAnimation: a specialized NumberAnimation that provides smooth changes in animation when the target value changes
- SpringAnimation: provides a spring-like animation with specialized attributes such as mass, damping and epsilon
- ParentAnimation: used for animating a parent change (see ParentChange)
- AnchorAnimation: used for animating an anchor change (see AnchorChanges)
Sharing Animation Instances
Sharing animation instances between Transitions or Behaviors is not supported, and may lead to undefined behavior. In the following example, changes to the Rectangle's position will most likely not be correctly animated.
Rectangle { // NOT SUPPORTED: this will not work correctly as both Behaviors // try to control a single animation instance NumberAnimation { id: anim; duration: 300; easing.type: Easing.InBack } Behavior on x { animation: anim } Behavior on y { animation: anim } }
The easiest fix is to repeat the NumberAnimation for both Behaviors. If the repeated animation is rather complex, you might also consider creating a custom animation component and assigning an instance to each Behavior, for example:
// MyNumberAnimation.qml NumberAnimation { id: anim; duration: 300; easing.type: Easing.InBack }
See also Qt Quick Examples - Animation..
|
http://doc.qt.io/qt-5/qtquick-statesanimations-animations.html
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
So I’m upgrading my app from Rails 1.2.6 to Rails 2.1.2.
I have a complex find statement that worked in 1.2.6 and isn’t working
in 2.1.2. I think maybe this is a bug, although maybe there’s something
else I could be doing to work-around it?
My find statement involves:
- Models in a module for namespace purposes
- a join clause with raw SQL
- an includes clause with multiple levels (the hash syntax)
This worked in 1.2.6:
joins = " inner join AZ_LETTER_GROUP_VER3 as lg on
AZ_TITLE_VER3.AZ_TITLE_VER3_ID = lg.AZ_TITLE_VER3_ID"
conditions = ['lg.AZ_LETTER_GROUP_VER3_NAME = ?', 'A'] batch_size = 10 page = 1 az_titles = SfxDb::AzTitle.find(:all, :joins => joins, :conditions => conditions, :limit => batch_size, :offset=>batch_size*(page -1), :order=>'TITLE_SORT', :include=>[{:sfx_object => [:publishers, :titles] }])
However, in 2.1.2, it raises an error, ActiveRecord can’t find the
SfxObject model class anymore–probably because it’s in a module
namespace, SfxDb::SfxObject. It says:
uninitialized constant SfxObject
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:279:in
load_missing_constant' [...] /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/core_ext/string/inflections.rb:143:inconstantize’
[…]
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/associations.rb:1652:in
remove_duplicate_results!' [...] /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/associations.rb:1261:infind_with_associations’
Now, here’s the weird thing. If I remove that complex include
statement, and remove the extra levels, it works fine:
az_titles = SfxDb::AzTitle.find(:all, :joins => joins, :conditions => conditions, :limit => batch_size, :offset=>batch_size*(page -1), :order=>'TITLE_SORT', :include=>[:sfx_object])
So this smells like a bug to me. I need those extra levels for
efficiency!
Also, if I remove the models from a module namespace, it works fine.
So it seems to be a bug in the code for multi-level include and models
in modules.
Should I report this bug somewhere/somehow? Not sure of Rails bug
reporting standards.
I guess the workaround is to remove my models from a module namespace.
But that’s really unfortunate, it keeps things so much tidier to have
them there, they’re really a special purpose subset of my models. Can
anyone think of any other workaround?
|
https://www.ruby-forum.com/t/rails-2-1-2-complex-find-involving-complex-include-bug/152618
|
CC-MAIN-2018-47
|
en
|
refinedweb
|
Safely set bits in a variable
#include <atomic.h> void atomic_set( volatile unsigned * loc, unsigned bits );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically..
To safely set the 1 bit in a flag:
#include <atomic.h> … volatile unsigned flags; … atomic_set( &flags, 0x01 );
QNX Neutrino
atomic_add(), atomic_add_value(), atomic_clr(), atomic_clr_value(), atomic_sub(), atomic_sub_value(), atomic_toggle(), atomic_toggle_value()
|
https://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/a/atomic_set.html
|
CC-MAIN-2018-47
|
en
|
refinedweb
|
partial void CurveSetListDetail_Created() { var gdpChart = this.FindControl("CurveItemCollection1"); gdpChart.ControlAvailable += gdpChart_ControlAvailable; } public class CurveItem { public double Week { get; set; } public double Low { get; set; } public double High { get; set; } } void gdpChart_ControlAvailable(object sender, ControlAvailableEventArgs e) { var sfChart = (Syncfusion.UI.Xaml.Charts.SfChart)e.Control; if (sfChart != null && sfChart.Series != null) { RangeAreaSeries series1 = new RangeAreaSeries(); var Curve = new ObservableCollection<CurveItem> { new CurveItem() { Week = 1, Low = 5, High = 10 }, new CurveItem() { Week = 2, Low = 6, High = 11 }, new CurveItem() { Week = 3, Low = 7, High = 12 }, new CurveItem() { Week = 4, Low = 8, High = 13 }, new CurveItem() { Week = 5, Low = 9, High = 14 }, new CurveItem() { Week = 6, Low = 10, High = 15 }, new CurveItem() { Week = 10, Low = 15, High = 20 } }; series1.ItemsSource = Curve; series1.ShowTooltip = true; series1.Label = "Soll"; sfChart.Series.Add(series1); } }
Hi Alexander,
Thanks for contacting Syncfusion Support.
In your code sample, need to mention the property names which represents the axes values. Please find the following code sample for your reference.
Thanks,
Santhiya A
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
|
https://www.syncfusion.com/forums/123227/additional-data-in-lightswitch-silverlight-sfchart
|
CC-MAIN-2018-47
|
en
|
refinedweb
|
API Versioning in .NET Core
API Versioning in .NET Core
.NET Core is a great framework for building out front- and backend applications. Read on to learn how to version the APIs your app's call using this framework.
Join the DZone community and get the full member experience.Join For Free
Start coding something amazing with our library of open source Cloud code patterns. Content provided by IBM.
In this post, we will see how to use different options for versioning in .NET Core API projects. Versioning APIs is very important and it should be implemented in any API project. Let's see how to achieve this in .NET Core.
Prerequisites:
- Visual Studio 2017 community edition, download here.
- .NET Core 2.0 SDK from here (I have written a post to install SDK here).
Create the API App Using a .NET Core 2.0 Template in VS 2017
Once you have all these installed, open your Visual Studio 2017 -> Create New Project -> Select Core Web application:
Click on Ok and in the next window, select API as shown below:
Visual Studio will create a well-structured application for you.
Install the NuGet Package for API Versioning
The first step is to install the NuGet package for API Versioning.
Search with "Microsoft.AspNetCore.Mvc.Versioning" in the NuGet Package Manager and click on Install:
This NuGet package is a service API versioning library for Microsoft ASP.NET Core.
Changes in Startup Class
Once the NuGet package is installed, the next step is to add the API Versioning service in the
ConfigureService method as shown below:
services.AddApiVersioning(o => { o.ReportApiVersions = true; o.AssumeDefaultVersionWhenUnspecified = true; o.DefaultApiVersion = new ApiVersion(1, 0); });
Some points here:
The
ReportApiVersionsflag is used to add the API versions in the response header as shown below:
- The
AssumeDefaultVersionWhenUnspecifiedflag is used to set the default version when the client has not specified any versions. Without this flag, the
UnsupportedApiVersionexception will occur when the version is not specified by the client.
- The
DefaultApiVersionflag is used to set the default version count.
Create Multiple Versions of the Sample API
Once the API versioning service is added, the next step is to create multiple versions of our Values API.
For now, just keep the GET method and remove the rest of the methods and create version 2 of the same API, as shown below:
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; namespace ApiVersioningSampleApp.Controllers { [ApiVersion("1.0")] [Route("api/Values")] public class ValuesV1Controller: Controller { // GET api/values [HttpGet] public IEnumerable < string > Get() { return new string[] { "Value1 from Version 1", "value2 from Version 1" }; } } [ApiVersion("2.0")] [Route("api/Values")] public class ValuesV2Controller: Controller { // GET api/values [HttpGet] public IEnumerable < string > Get() { return new string[] { "value1 from Version 2", "value2 from Version 2" }; } } }
In the above code:
- We have applied the attribute [ApiVersion("1.0")] for Version 1.
- We have applied the attribute [ApiVersion("2.0")] for Version 2.
- Also changed the GET value to understand which version is getting called.
Just run your application and you will see the Version 1 API is getting called because we did not specify any specific version; thus the default version (1.0 in our case) will be called:
There are some ways by which you can specify the version of the API, we'll discuss below.
Query String-Based Versioning
In this, you can specify the version of the API in the query string. For example, to call version 2 of the Values API, the below call should work:
/api/values?api-version=2.0
URL-Based Versioning
There are many people who do not like query based patterns, in which case we can implement URL-based versioning by changing the route as shown below:
[Route("api/{v:apiVersion}/Values")]
In such a case, the below call will return the version 2 of the API:
/api/2.0/values
This approach is more readable.
HTTP Header-Based Versioning
If you do not wish to change the URL of the API then you can send the version of API in the HTTP header.
To enable this, the version reader needs to be added to the
ConfigureService method as shown below:
o.ApiVersionReader = new HeaderApiVersionReader("x-api-version");
Once you enable this, the query string approach will not work. If you wish to enable both of them then just use the below code:
o.ApiVersionReader = new QueryStringOrHeaderApiVersionReader("x-api-version");
Once the API Version reader is enabled, you can specify the API version while calling this particular API. For example, I have given Version 1 while calling the API from Postman:
Some Useful Features
Deprecating the Versions
Sometimes we need to deprecate some of the versions of the API, but we do not wish to completely remove that particular version of the API.
In such cases, we can set the
Deprecated flag to
true for that API, as shown below:
[ApiVersion("1.0", Deprecated = true)] [Route("api/Values")] public class ValuesV1Controller: Controller { //// Code }
It will not remove this version of the API, but it will return the list of deprecated versions in the header, api-deprecated-versions, as shown below:
Assign the Versions Using Conventions
If you have lots of versions of the API, instead of putting the
ApiVersion attribute on all the controllers, we can assign the versions using a conventions property.
In our case, we can add the convention for both the versions as shown below:
o.Conventions.Controller<ValuesV1Controller>().HasApiVersion(new ApiVersion(1, 0)); o.Conventions.Controller<ValuesV2Controller>().HasApiVersion(new ApiVersion(2, 0));
Which means that we are not required to put [ApiVersion] attributes above the controller
API Version Neutral
There might be a case when we need to opt out the version for some specific APIs.
For example, Health checking APIs which are used for pinging. In such cases, we can opt out of this API by adding the attribute
[ApiVersionNeutral] as shown below:
[ApiVersionNeutral] [RoutePrefix( "api/[controller]" )] public class HealthCheckController : Controller { ////Code }
Other Features to Consider:
Add
MapToApiVersionin the attribute if you wish to apply versioning only for specific action methods instead of the whole controller. For example:
[HttpGet, MapToApiVersion("2.0")] public IEnumerable<string> Get() { return new string[] { "value1 from Version 2", "value2 from Version 2" }; }
- We can get the version information from the method
HttpContext.GetRequestedApiVersion();, this is useful to check which version has been requested by the client.
- Version Advertisement can be used by each service to advertise the supported and deprecated API versions it knows about. This is generally used when the service API versions are split across hosted applications.
- We can allow clients to request a specific API version by media type. This option can be enabled by adding the below line in the API versioning options in the
ConfigureServicemethod:
options => options.ApiVersionReader = new MediaTypeApiVersionReader();
Hope this helps.
You can find my all .NET core posts here.
Code something amazing with the IBM library of open source blockchain patterns. Content provided by IBM.
Published at DZone with permission of Neel Bhatt , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}{{ parent.urlSource.name }}
|
https://dzone.com/articles/api-versioning-in-net-core
|
CC-MAIN-2018-47
|
en
|
refinedweb
|
How to Build a Custom Mule Connector in Java
How to Build a Custom Mule Connector in Java
Want to learn how to build a custom mule connector in Java? Check out this tutorial to learn how with the ConnectorConfig and SampleDynamicsConnector classes.
Join the DZone community and get the full member experience.Join For Free
How to Transform Your Business in the Digital Age: Learn how organizations are re-architecting their integration strategy with data-driven app integration for true digital transformation.
Before we get started, here are some helpful links from Mule Documentation to get you introduced to building mule connectors.
What is Anypoint Connector DevKit?
Creating an Anypoint Connector Project
In this article, we will take a deep dive into how to add additional functionality (tabs), like pooling profile, reconnection in connector configuration, operations (drop-down), and general tab in connector settings.
Building a custom connector involves two things. First, it involves understanding the underlying connectivity logic and operations (CRUD Operations are nothing but our connector functionality listed in the drop-down). If we are building a public cloud connector like Azure Storage services - Blob/Table/Queue, then all of the connectivity and operation functionality is ready offered by Microsoft. Anypoint Connector Devkit provides various annotations to make developer life easier to build and publish connectors faster and wraps the underlying connectivity logic into an intuitive, simple to use, drag and drop connector available in Anypoint Studio that anyone can use without the need to know all the underlying complexity written in Java. This improves user experience with seamless access to rich functionality offered by the connector.
I am going to use Dynamics365 for Operation as a reference to build this new connector. Building a full-fledged Mulesoft Connector is simple and straightforward by leveraging the annotations offered by Anypoint Connector DevKit. Primarily, there is only two classes that we need to focus on — (1) ConnectorConfig java class (2) <<Name of the Connector>>Connector java class.
Part One
Let’s start with the
ConnectorConfig Java class. This class is all about setting up the connection with the target system and managing the connection. It can be a SAAS product or cloud service, such as Azure Storage service (Blob, File, Queue) or any system for that matter.
The value we provide in the
friendlyName attribute in
@ConnectionManagement annotation gets displayed at the top of the connector configuration.
@ConnectionManagement(friendlyName = "OAuth 2.0 Username-Password") public class ConnectorConfig { /** The Constant CONNECTION_ID. */ private final static String CONNECTION_ID = "001";
Any point DevKit makes it easy to add Connection Management functionality to connectors by creating a new @ConnectionStrategy. You will need to create a new class and annotate it with @ConnectionManagement.
Connection Management DevKit Annotations
To use Connection Management in a connector, define and annotate the following methods in the @ConnectionManagement annotated class:
@Connect — Creates a connection
@Disconnect — Explicitly closes a connection
@ValidateConnection — Returns true if a connection is still valid, false otherwise
@ConnectionIdentifier — Returns a prefix used in generating unique identifiers for connector instances in the connection pool
Please refer to Mulesoft Documentation for connection management details.
Refer this link for connector code.
@Connect @TestConnectivity(active=false) public void getAccessToken( @Placement(group = "Connection") @FriendlyName("Token Request Endpoint") @ConnectionKey String tokenrequestendpoint, @Placement(group = "Connection") @FriendlyName("Resource") String resource, @Placement(group = "Connection") @FriendlyName("Client ID") String clientId, @Placement(group = "Connection") @FriendlyName("Client Secret") String clientsecret, @Placement(group = "Connection") @FriendlyName("Username") String userName, @Placement(group = "Connection") @FriendlyName("Password") @Password String password, @Placement(group = "Connection") @FriendlyName("Read Timeout") String readtimeout, @Placement(group = "Connection") @FriendlyName("Connection Timeout") String connectiontimeout ) throws ConnectionException { << Write required logic to establish the connection using above parameters >> }
@Placement — “Connection” is the group (table) name inside the General tab.
@FriendlyName — Is the textbox heading.
@ConnectionKey — Marks a parameter inside the connects method as part of the key for the connector lookup. This can only be used as part of the @Connect method.
@Disconnect public void disconnect() { DynamicsClient = null; } @ValidateConnection public boolean isConnected() { return DynamicsClient != null; } @ConnectionIdentifier public String connectionId() { return CONNECTION_ID; }
Part Two
Now, let’s take a look at the
SampleDynamicsConnector Java class. In this class, we define operations and write logic to perform those operations. Depending on the connector functionality, it could be anything from a CRUD operation to a more sophisticated functionality offering.
@Connector(name = "Dynamics365", friendlyName = "SampleDynamics", description = "Dynamics 365 for Operation Connector") public class SampleDynamicsConnector { @Config ConnectorConfig config;
Here,
friendlyName attribute value gets displayed in the connector details section,
@Processor(friendlyName = "import dynamic message") public void ImportMessage(@Placement(group = "General", order = 1) @FriendlyName("Uri Path") String uripath, @Placement(group = "General", order = 2) @FriendlyName("Activity ID") String activityid, @Placement(group = "General", order = 3) @FriendlyName("Entity Name") String entityname, @Placement(group = "General", order = 4) @FriendlyName("File Input (String)") String fileinput) throws Exception { << Write required logic to perform the defined Operation (drop-down) using above parameters > }
@Processor annotation — Marks a method as an operation in a connector.
@Placement annotation helps to create a group (table) with attributes to specify the order and the group name.
Example 2: How to Create a Tooltip (Descriptive Pop-up Message)
In the example shown below, we have used both annotations
@FriendlyName and
@Summary . Here,
@FriendlyName is used to define the name of the field that is displayed, and
@Summary is used for a descriptive pop-up message.
@Processor(friendlyName = "import dynamic message") public void ImportMessage(@Placement(group = "General", order = 1) @FriendlyName("Uri Path") String uripath, @Placement(group = "General", order = 2) @FriendlyName("Activity ID") @Summary("Activity ID from Dynamics 365") String activityid, @Placement(group = "General", order = 3) @FriendlyName("Entity Name") String entityname, @Placement(group = "General", order = 4) @FriendlyName("File Input (String)") String fileinput) throws Exception {
Example 3
Now, let’s take a look at creating a sophisticated operation:
@Processor(friendlyName = "export dynamic message") public void ExportMessage( @Placement(group = "Export Parameters", order = 1) @FriendlyName("Entity Name") String tableName, @Placement(group = "Export Parameters", order = 2) @FriendlyName("Create Entity If Not Exist") @Default("false") boolean createTableIfNotExist, @Placement(group = "Export Parameters", order = 3) @FriendlyName("Encrypt Entity While Export(Supports Only String DataType)") @Default("false") boolean encryptEntityWhileInsertion, @Placement(group = "Export Parameters", order = 4) @FriendlyName("POJO Entity(Define anyone value from below two options)") TestradioButton testradioButton) throws Exception {
@Summary annotation — Use this annotation to instance variables and method parameters to provide a way to override the default inferred description for a
@Configurable variable or a
@Processor,
@Source ,
@Transformer method parameter.
@FriendlyName annotation — Use this annotation to instance variables and method parameters to provide a way to override the default inferred nickname for a
@Configurable variable or a
@Processor ,
@Source ,
@Transformer method parameter.
public class TestradioButton { /** The Constant SUMMARY_JSON_ENTITY_PROPERTIES_AS_STRING. */ public static final String SUMMARY_JSON_ENTITY_PROPERTIES_AS_STRING = "JSON entity properties as String."; /** The Constant SUMMARY_JSON_ENTITY_PROPERTIES_AS_JSON_OBJECT. */ public static final String SUMMARY_JSON_ENTITY_PROPERTIES_AS_JSON_OBJECT = "JSON entity properties as org.codehaus.jettison.json.JSONObject."; @Configurable @Optional @FriendlyName(value = "JSON Entity Properties As String") @Summary(SUMMARY_JSON_ENTITY_PROPERTIES_AS_STRING) private String jsonEntityPropertiesAsString; /** The json entity properties as json object. */ @Configurable @Optional @FriendlyName(value = "JSON Entity Properties As org.codehaus.jettison.json.JSONObject") @Summary(SUMMARY_JSON_ENTITY_PROPERTIES_AS_JSON_OBJECT) private Object jsonEntityPropertiesAsJsonObject;
Here, in the TestradioButton class, the
@Summary annotation is used to provide a descriptive pop-up message.
You might wonder why we have two radio buttons, (1) Reference or expression (2) Define attributes. Here, the second radio button has two values that are coming from “TestradioButton” POJO class. First radio button means, we can give a reference to a relevant bean. In this case, we need to define TestradioButton as a bean and reference it in first radio button.
Connector Development }}
|
https://dzone.com/articles/building-a-custom-mule-connector
|
CC-MAIN-2018-47
|
en
|
refinedweb
|
Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
Human Development
China’s Pension System
A Vision
Mark C. Dorfman, Robert Holzmann, Philip O'Keefe, Dewen Wang, Yvonne Sin, and Richard Hinz
China’s Pension System
China’s Pension System
A Vision
Mark C. Dorfman, Robert Holzmann, Philip O’Keefe, Dewen Wang, Yvonne Sin, and Richard Hinz
© 2013 International Bank for Reconstruction and Development/ The World Bank 1818 H Street NW, Washington DC 20433 Telephone: 202-473-1000; Internet: Some rights reserved 1 2 3 4 16 15 14 13: Dorfman, Mark C., Robert Holzmann, Philip O’Keefe, Dewen Wang, Yvonne Sin, and Richard Hinz. 2013. China’s Pension System: A Vision. Washington, DC: World Bank. doi: 10.1596/978-0-8213-9540-0-9540-0 ISBN (electronic): 978-0-8213-9541-7 DOI: 10.1596/978-0-8213-9540-0 Cover photo: Alison Wright / National Geographic Stock. Library of Congress Cataloging-in-Publication data has been requested.
Contents
Preface and Acknowledgments About the Authors Abbreviations Overview Introduction Motivations for Pension Reform Pension System Design Proposal and Options Design Considerations Implementation Issues and Options Conclusion Notes China: A Vision for Pension Policy Reform Introduction Current and Future Trends Motivating Reform Proposed Design Financing Options A Reform Process: Cross-Cutting Analysis and Institutional Reform Issues
xi xiii xvii 1 1 2 4 9 10 13 14 15 15 17 23 59 65
v
vi
Contents
Conclusion Notes References Appendix A Pension Needs for Nonwage Rural and Urban Citizens Introduction Rationale and Expectations China’s Experience with Rural Pensions Looking Ahead—The New Rural Pension Scheme Pension System Design Principles Proposal for a National Pension System for Nonwage Populations Conclusions Notes References A Notional (Nonfinancial) Defined-Contribution Design for China’s Urban Old-Age Insurance System Rationale and Advantages of an NDC Scheme in China Proposed Technical Design for an NDC Scheme Lessons from Countries That Have Implemented NDC Schemes Notes References Evaluation of Legacy Costs Understanding the Liabilities Estimating the Liabilities of China’s Urban Old-Age Insurance System Estimating the Pay-as-You-Go Asset, Legacy Costs, and Phasing Financing Legacy Costs—Lessons from the Liaoning Pilot Broad Estimates of Legacy Costs, Their Phasing, and Suggested Financing References
69 72 75
81 81 82 90 103 111 112 138 139 143
Appendix B
147 148 152 160 164 165 167 167 173 176 178 180 194
Appendix C
Contents
vii
Appendix D
Aging, Retirement, and Labor Markets Aging, Migration, and Labor Markets Effects of an Increase in the Retirement Age on the Labor Market Effects of an Increase in the Retirement Age on the Urban Elderly Public Policy Implications of Increasing the Retirement Age Conclusions Notes References Voluntary Savings Arrangements The Objectives and Role of Voluntary Savings Arrangements in the Chinese Pension System Conditions Necessary to Fulfill These Objectives A Design Framework for Supplementary Pension Schemes The Path to Implementation References Glossary
197 197 203 209 210 213 214 214 217 217 220 222 231 235 237
Appendix E
Boxes
1 2 3 4 A.1 A.2 C.1 C.2 The Effect of the Minimum Retirement Age on Employment and Labor Markets Benefit Calculation and Illustrative Examples for the Proposed MORIS Proposed Pensions for Civil Servants and Employees of Public Service Units Rural-Urban Migrants and Informal Sector Workers Rajasthan’s Vishwakarma MDC Pension Scheme Alternative Benefit Designs to Protect the Elderly Poor Provisions under Document No. 26 of 1997 Provisions under Document No. 38 19 40 45 47 99 127 171 175
Figures
O.1 1 Current and Proposed Urban Old-Age Insurance Design China Population Projections: Growth in the Aged and Dependency Ratios 7 18
viii
Contents
2 3 4 5 6 7 8 9 10 A.1 A.2 A.3 A.4 A.5 A.6 A.7 A.8 A.9 A.10 A.11 A.12 A.13 A.14 C.1
Projected Size and Composition of the Working-Age Population Proposed Overall Design Primary Source of Support for Rural Elderly by Age Stylized Example of Rural CSP Benefit Levels and Composition Indicative Cost Projections for Urban and Rural Citizens’ Social Pensions Comparison of Rates of Inflation, Wage Growth, and One-Year Term Deposits Interest Rates Chinese Government Subsidies to Pensions, 2003–2007 Current Urban Old-Age Insurance and Proposed MORIS Design Stylized Example of Annuitized Monthly VIRIS Benefits Based on Different Contribution Histories Percentage of Poor Rural Households by Age of Household Head Trends of Population Aging in Rural and Urban China, 2008–2030 Old-Age Dependency Ratios in Rural and Urban China, 2008–2030 Rural Saving Rates by Income Quintile Pension Coverage Rate of Active Labor Force, Various Countries, Mid-2000s Pension Coverage in OECD Countries Coverage among the Economically Active Population, Latin America, 1990s–2000s Take-up Rate and Matching Contributions Stylized Example of Annuitized Monthly Benefits Based on Different Contribution Histories Stylized Example of CSP Pension Benefit Levels and Composition under Proposed Scheme Indicative Cost Projections for CSP Benefits Value of Social Pensions as a Percent of Average Earnings in OECD Countries Ratio of Social Pension to Per Capita Income Multiplied by Ratio of Number of Recipients to Number of Elderly Chile’s System of Solidarity Pensions Introduced 2008 China Urban Old-Age Insurance System: Categorization of Beneficiaries and Their Benefit Entitlements
22 23 27 29 30 36 36 37 51 84 84 85 87 88 89 90 116 119 129 131 134 136 137 169
Contents
ix
C.2 C.3 C.4 C.5 D.1 D.2 D.3 D.4 D.5 D.6 D.7 D.8 D.9 D.10
Phasing of Gross Annual Deficit under Different Degrees of Coverage Expansion and Contribution Rates Phasing of Gross Legacy Costs under Different Degrees of Coverage Expansion and Contribution Rates Phasing of Net Annual Deficit under Different Degrees of Cover Expansion and Contribution Rates Phasing of Net Legacy Costs under Different Degrees of Coverage Expansion and Contribution Rates Aged Populations in Rural and Urban China, 2010–75 Working-Age Populations in Rural and Urban China, 2010–75 Old-Age Dependency Ratios in Rural and Urban China, 2010–75 Employed Population, Urban and Rural Areas, 1990–2008 Trends and Shares of Rural-to-Urban Migration in China, 2000–08 Labor Supply Effects from an Increase in Retirement Age Labor Force Participation Rate in Urban China, 2005 Change in Employment Rates in OECD Countries by Age Group, 1997–2007 Labor Market Participation Rates of Older Workers in China, 2000–05 Retirement Incentives Matter: Implicit Tax on Remaining in Work
188 190 191 192 199 200 201 202 202 205 205 207 208 211
Tables
O.1 1 2 3 4 5 6 7 Summary of Proposed Pension Design (Architecture and Financing) Citizens’ Social Pensions (CSP)—Proposed Parameters Stylized Examples Comparing NRPS and CSP Benefits Comparison of Key Features of the Old-Age Insurance System and the Proposed MORIS Voluntary Individual Retirement Insurance Scheme (VIRIS)—Key Parameters Commonalities and Differences between the Proposed VIRIS Design and the NRPS and URPS Occupational and Personal Pension Arrangements Description of Pension Costs and Possible Financing 5 28 33 39 50 54 57 60
x
Contents
8 A.1 A.2 A.3 A.4 A.5 A.6 A.7 B.1 C.1
Summary of Proposed Design Parameters Measuring the Poverty of the Rural and Urban Elderly Primary Sources of Support for China’s Elderly Rural Pension Indicators, 1993–2007 Rates of Return on Accumulations and Bank Deposits versus Inflation Rate, Various Years Citizens’ Social Pensions—Proposed Parameters Social Pensions in OECD Countries Examples of Noncontributory Pension Programs in Developing Countries Key Design Features and Transition Modalities for NDC Schemes Estimates of Legacy Costs under an NDC Reform
70 83 86 93 95 128 132 135 161 184
Preface and Acknowledgements
This volume was prepared to develop a medium-term vision for strengthening old-age income protection in China. The manuscript originated as a World Bank report initiated in discussions beginning early in 2009. A key objective of the report was to develop a vision consistent with principles articulated by the Chinese authorities to bring together fragmented policy designs into a common framework, strengthen coverage of the elderly, and ensure flexibility to adapt to rapidly changing needs in the Chinese economy and society. Preparation of this report has been punctuated by important policy announcements. In mid-2009, the authorities announced a national pilot program for rural pensions. After a draft of this report was completed, the National Urban Residents Pension pilot program was announced in 2011. As a result of these announcements, this volume reconciles the policy designs suggested with these programs. This report was very much a team effort. The core team members and authors were Mark C. Dorfman, Robert Holzmann, Philip O’Keefe, Dewen Wang, Yvonne Sin, and Richard Hinz. Though not an author, Xiaoqing Yu was a key member of the core team providing essential guidance throughout the process. The volume was prepared under the direction of Xiaoqing Yu (sector director, Human Development Department, East Asia and Pacific Region), Emmanuel Jimenez (former sector director,
xi
xii
Preface and Acknowledgements
Human Development Department, East Asia and Pacific Region) and Klaus Rohland (China country director). Sergiy Biletskyy, Yu-Wei Hu, and Wei Zhang contributed to the volume by providing analytical inputs. Yuning Wu provided inputs for the evolution of rural pension system. We are grateful for the useful comments provided by peer reviewers of earlier versions of the volume: Robert Palacios, David Robalino, Lawrence Thompson, and Cai Fang. Useful comments were also provided by Ardo Hannson, Louis Kuijs, and John Giles. Logistics and production staff included Lansong Zhang, Limei Sun and Sabrina Terry. Paola Scalabin and Mark Ingebretsen of the World Bank’s Office of the Publisher managed the publication of the volume. We would also like to thank the Chinese Ministry of Finance, Ministry of Human Resources and Social Security, National Development and Reform Commission, Development Research Center of the State Council, and National Social Security Fund for providing very useful inputs and feedback in researching the volume.
About the Authors
Mark C. Dorfman is a senior economist with the World Bank’s Social Protection Team, where he works on pensions, social security, and contractual savings reform. Earlier he worked in the Bank’s Debt Department where he assessed debt sustainability and debt relief under the Heavily Indebted Poor Countries (HIPC) Initiative. Since 1999 he has prepared multiple reports and projects on the Chinese pension system. During his 24 years with the World Bank, he has worked on different areas of pensions and financial market reform in three of the Bank’s regions: Latin America and the Caribbean, Sub-Saharan Africa, and East Asia and the Pacific. Mr. Dorfman holds an MBA in finance from the Wharton School. Robert Holzmann is professor of economics and the director of the RH Institute for Economic Policy Analysis, Vienna, and holds the Old Age Financial Protection Chair at the University of Malaya, Kuala Lumpur, Malaysia. From mid-1997 to early 2011, he was director of the World Bank’s Social Protection Team and Labor Department and research director of the Marseille Center for Mediterranean Integration. Before joining the World Bank he was professor of economics at the Universities of Saarland (Germany) and Vienna (Austria) and a senior economist at the International Monetary Fund (IMF) and the Organisation for
xiii
xiv
About the Authors
Economic Co-operation and Development (OECD). He has published over 30 books and over 150 articles on social, fiscal, and financial policy issues. Philip O’Keefe is lead economist for the Human Development Sector for East Asia and Pacific, and was previously Human Development Sector coordinator for China and Mongolia, at the World Bank. He coordinates the Bank’s work on social protection issues, including social security, social assistance and welfare services, and labor markets. Prior to his China role, he was based in India as the social protection coordinator, following a decade of work on social security, labor market, and social services issues in Eastern Europe and the former Soviet Union. Prior to joining the World Bank in 1993, he was a university lecturer at the University of Warwick (Coventry, U.K.). He holds undergraduate degrees from the University of Sydney, Australia, and postgraduate degrees from the London School of Economics and Oxford University in economics and law. Dewen Wang is a social protection economist in the World Bank’s China Country office. He was professor and division chief of the Institute of Population and Labor Economics, Chinese Academy of Social Sciences (Beijing, China), before he joined the Word Bank’s Social Protection Team in the East Asia and Pacific region. He served as deputy division director of China’s Ministry of Agriculture and was a research fellow at the Ministry’s Research Center for Rural Economy. His work focuses on China’s pension and social protection programs, population aging, labor market dynamics, and economic reform and growth. Yvonne Sin is the general manager of Risk and Financial Services at Towers Watson, a global professional consultancy firm. Ms. Sin worked at the World Bank from 1993 to 2007 and was head of the Pensions Thematic Group of the Social Protection Team from 2005 to 2007. She is a research fellow of the China Centre for Insurance and Social Security Research at Peking University, a member of the Advisory Board of the Risk and Insurance Research Centre at National Chengchi University (Taiwan, China), and a board member of the Asia Pacific Risk and Insurance Association. She is also a member of the Society of Actuaries, the Canadian Institute of Actuaries, the American Academy of Actuaries, the Actuarial Society of Hong Kong, and the International Actuarial Association.
About the Authors
xv
Richard Hinz is a pension policy adviser to the Social Protection Team of the Human Development Network at the World Bank. Since joining the World Bank in 2003, his work has been focused on the reform of social security systems and the development, regulation, and supervision of funded pension arrangements—subjects on which he has authored and edited a number of articles and publications. Prior to this, he was the director of the Office of Policy and Research at what is now the Employee Benefits Security Administration (EBSA) of the U.S. Department of Labor, where he managed economic research and legislative analysis for the agency responsible for the regulation and supervision of private employer-sponsored health insurance and pension programs in the United States.
Abbreviations
CE CHNS CIRC CPI CSP CSRC CURES EA EET FA FDC GA GDP IA IBRD ILO IPD MDC MHRSS MOCA
coverage expansion China Health and Nutrition Survey China Insurance Regulatory Commission consumer price index Citizens’ Social Pension China Securities Regulatory Commission China Urban and Rural Elderly Survey Enterprise Annuity (scheme) exempt-exempt-taxable (tax treatment) financial asset Funded Defined Contribution (Scheme) pay-as-you-go asset gross domestic product individual account International Bank for Reconstruction and Development International Labour Organization implicit pension debt matching defined contribution (scheme) Ministry of Human Resources and Social Security Ministry of Civil Affairs
xvii
xviii
Abbreviations
MOLSS MORIS NBS NCMS NDC NDRC NRPP NRPS NSSF OA OECD PA PAYG PROST PSU RAW RMB RPPP SC SOE TBL TEE TTE URPS VAT VIRIS
Ministry of Labor and Social Security (later constituted under the MHRSS) Mandatory Occupational Retirement Insurance Scheme (proposed) National Bureau of Statistics new cooperative medical scheme notional or nonfinancial defined contribution (scheme) National Development Reform Commission New Rural Pension Pilot Program New Rural Pension Scheme National Social Security (Trust) Fund Occupational Annuity (scheme, proposed) Organization for Economic Cooperation and Development pension asset pay-as-you-go Pension Reform Options Simulation Toolkit public service (or sector) unit regional average wage renminbi (yuan) Rural Pension Pilot Program solidarity contribution state-owned enterprise target benefit level taxable-exempt-exempt (tax treatment) taxable-taxable-exempt (tax treatment) Urban Residents Pension Scheme value added tax Voluntary Individual Retirement Insurance Scheme (proposed)
Overview
Introduction
China is at a critical juncture in its economic transition. Comprehensive reform of its pension and social security systems is an essential element of a strategy aimed toward achieving a harmonious society and sustainable development. A widely held view among policy makers is that the current approach to pension provision is insufficient to enable China’s economy and population to realize its development objectives in the years ahead. The government has articulated principles for what it would like to achieve in a reformed pension system: an urban system that “has broad coverage, protects at the basic level, is multilayered and sustainable,” while for the rural system2 “has broad coverage, protects at the basic level, is flexible and sustainable.” This volume aims to articulate such an integrated holistic vision for strengthening old-age income protection in China consistent with the principles outlined. Over the last few years, the government has considered various options and initiated several significant measures. A major reform of the urban old-age insurance system was undertaken in 1997 and subsequently has had refinements. In 2009 the authorities established a national framework for rural pensions, the new Rural Pension Pilot Program (NRPP), which became the New Rural Pension Scheme (NRPS), and in mid-2011
1
2
China’s Pension System
announced a national pilot Urban Residents Pension Scheme (URPS), completing a national framework aimed at universal pension coverage. Although substantial reforms have been initiated, some policy makers have suggested that additional reforms are needed to meet the needs of China’s rapidly changing economy and society. Issues such as legacy costs, system fragmentation, and limited coverage have not been fully addressed. At the same time, many new challenges have emerged, such as rapid urbanization, income inequality, urban-rural disparities, informalization of the labor force, changes in family structure, and the effects of increased globalization. A reform vision needs to address policy issues that the current design does not sufficiently provide for, consider reform needs that have also emerged, and anticipate the future needs of China’s rapidly changing society. This volume is organized as follows: The main text outlines the vision. It focuses on summarizing the key features of a proposed medium-term pension system, and the appendixes provide the deeper analysis and context that underpins the recommendations of the main text. The main text first examines key trends motivating the need for reform then outlines the proposed three-pillar design and the rationale behind the design choices and moves on to examine financing options. The main text continues by introducing institutional reform issues, and the final section concludes. The appendixes provide additional analytical detail supporting the findings in the main text. Appendix A evaluates the pension needs of nonsalaried rural and urban citizens and outlines the rationale for the proposed instruments. Appendix B evaluates a notional or nonfinancial defined-contribution design applied to China’s urban old-age insurance system. Appendix C evaluates pension legacy costs and financing options for addressing them. Appendix D evaluates issues of aging, retirement, and labor markets in China in the context of old-age insurance provisions. Appendix E examines voluntary pension savings arrangements.
Motivations for Pension Reform
China is in the midst of a major demographic and economic transition, including the following changes: • China is facing a dramatic aging process and demographic transition as a result of declines in fertility combined with significant increases in longevity. Old-age dependency ratios are therefore projected to almost triple over three decades.
Overview
3
• The country’s rapid growth and economic transformation have increased the demand for a mobile and dynamic labor force that can effectively adjust to the pace of change. At the same time, demographic change will constrain the size of the working-age population. Fragmented pension provisions and limited portability of accrued benefits are just two of the barriers to labor mobility. Moreover, low urban retirement ages contribute to rigidities in the face of growing labor demand. • Although the authorities have placed a growing premium on more balanced growth between households, rural and urban areas, and different regions, to date the pension system has in some ways contributed to divergence. • As the authorities seek to rebalance the growth model toward greater reliance on domestic consumption, the lack of coverage and uncertainty with regard to financial protection secured with current pensions encourage overly high precautionary savings. The pension system design can play an important role in supporting or constraining such economic and demographic transitions: (1) fragmentation and lack of portability of rights hinder labor market efficiency and contribute to coverage gaps; (2) multiple schemes for salaried workers, PSU employees,. Although the government has undertaken important reforms, a holistic long-term vision is needed to guide future policies. The urban old-age insurance system has several positive design features but needs to better respond to the needs of China’s increasingly complex and mobile labor force. Although the authorities have introduced significant programs to cover rural and urban citizens, a long-term vision would recognize the integration of rural and urban economies. Second,
4
China’s Pension System
a framework is needed to serve workers inside and outside the formal sector who have until recently not been served, including nonsalaried, informal, self-employed, rural, and migrant workers. Finally, the scope of the Enterprise Annuity (EA) provides supplementary pension arrangements, but has focused on formal sector enterprises. The regulatory and supervisory framework needs substantial reform, as does the incentive framework, including tax treatment, in order to be broadened to provide supplementary pension arrangements for small companies and the self-employed and for other individual pension arrangements. The rationale behind the multipillar approach proposed in this volume is fully aligned with the government’s philosophy: (1) the pension system can redistribute income between individuals, income groups and cohorts to protect the elderly from poverty; (2) the pension system should provide an efficient form of retirement savings and risk pooling for different types of workers and income groups; and (3) regulated supplementary pension savings arrangements are needed to justify investments in human capital and preferences for additional retirement savings.
Pension System Design Proposal and Options
This volume proposes a three-pillar design consisting of the following components (see table O.1): (a) A basic benefit pillar providing minimum elderly poverty protection through urban and rural noncontributory Citizens’ Social Pension (CSP) benefits (b) A contributory pillar with a mandatory notional defined-contribution (NDC) scheme for salaried workers with labor contracts (modifying the current urban old-age insurance system) and a voluntary defined-contribution pension savings scheme for the urban and rural populations with nonwage incomes such as temporary workers, the self-employed, and farmers, and (c) A supplementary savings pillar for urban and rural residents providing voluntary occupational and individual pensions, which may supplement other pension benefits. This volume suggests a vision of a national pension system that no longer distinguishes along urban and rural locational or hukou lines yet takes account of the diverse nature of employment relations and capacity
Overview
5
Table O.1 Summary of Proposed Pension Design (Architecture and Financing) Pensions for Wage-Based Work Basic benefit pillar Pensions for Non-Wage Work
Citizens’ Social Pensions (CSP) • Benefit level linked to regional average wages (urban)/regional per capital incomes (rural) • Benefits adjusted when recipients receive alternative pension income • Noncontributory—financed from general revenues • Provincial and national subsidies to reduce regional benefit disparities Mandatory Occupational Retirement Insurance Scheme (MORIS) • Mandatory contributions linked to individual wages • Notional defined-contribution design • Applied to all workers with labor contracts, including migrants, public service units, and civil servants • Portable accumulations • Individual notional accumulation determines an annuitized benefit • Liquidity and buffer fund management at a provincial or national level • Legacy costs financed outside the pension system Voluntary Individual Retirement Insurance Scheme (VIRIS) • Voluntary, tiered contributions by nonwage residents • Funded defined-contribution design • Applied to all nonwage residents not covered by other schemes • Contributions matched with government subsidies • Portable accumulations • Individual accumulation determines an annuitized benefit • Reserve management at a provincial or national level
Contributory pillar
Supplementary savings pillar
Voluntary Occupational and Individual Annuities • Provide a common regulated, secure, and tax-neutral instrument for employer-based (occupational) and individual-based (personal) supplementary retirement savings • Defined contribution in design with annuitization options • Fully funded • Decentralized account and investment management under a unified framework • Strong regulatory framework and supervisory institutions
of individuals to make contributions. The proposed separation of mandatory salary-based and voluntary non-salary-based contributory schemes is intended as an interim measure until the overall tax collection and compliance framework can be extended to nonsalaried workers including the informal sector, the self-employed, and farmers. Over the very long term,
6
China’s Pension System
it is anticipated that the urban old-age insurance system will extend to all citizens, while the distinction between salary-based and non-salary-based incomes would likely remain.
The Basic Benefit Pillar
A Citizens’ Social Pension (CSP) is proposed to ensure a basic level of income support for the rural and urban elderly who are unable to meet basic subsistence needs from contributory pension sources. Such a benefit would be designed according to a national framework with structured regional variation. The benefit level would be based on a proportion of the regional average wage (in urban areas) or regional average per capita income (in rural areas) and would provide minimum income support higher than the per capita dibao or social assistance threshold. Individuals aged 65 and above would be entitled to a minimum CSP benefit with a pensions test applied that would reduce the benefit amount by a proportion of other pension benefits received for those aged 65–74. The extent of the reduction would be a policy choice guided by the relative emphasis on retirement savings incentives and fiscal costs. The benefit would be indexed on the same basis as are other proposed contributory benefits, that is, based on a mix of one-third wages (in urban areas) or per capita income (in rural areas) and two-thirds prices. Although financing the scheme would fall upon different levels of government, provincial and municipal authorities would be accountable for observance of the national framework.
The Contributory Pillar, Part 1: The Mandatory Occupational Retirement Insurance Scheme
The contributory pillar would consist of two instruments, the first of which would be a Mandatory Occupational Retirement Insurance Scheme (MORIS). The design of the MORIS would build upon the existing policy design and institutional structure for the urban old-age insurance system. The proposed scheme would be defined contribution in design, follow a notional financing approach, and provide an integrative framework across different types of employers. The scheme’s rights and responsibilities would therefore extend to all salaried employees regardless of sector, ownership structure, or location. In this way, in the medium term the MORIS would include civil servants and Public Sector Unit (PSU) workers. Although this volume does not advocate a particular target replacement rate, a replacement rate of about 45 percent of lifetime pre-retirement income could be provided by a contribution rate of about 16 percent of
Overview
7
wages on a sustainable basis. This range would be applicable under three conditions: (1) the retirement age would be increased to age 65 over time, (2) the benefit would be indexed one-third to wage increases and twothirds to price increases, and (3) legacy costs would be separately financed from outside the urban old-age insurance system. Figure O.1 compares current urban old-age insurance and proposed MORIS designs. Inclusion of civil servants and PSU workers in the proposed MORIS would undoubtedly create special financial and institutional challenges but could promote a less rigid labor market and a more integrated pension system. By combining benefits from the proposed MORIS NDC account and a supplemental benefit from a revised Occupational Annuity scheme, current levels of income replacement could be supported while also freeing workers to move in and out of positions in accordance with the demand for their skills. Transition challenges may justify postponing integration of civil servants and PSU workers into the MORIS while the necessary accounting, financial control, and remittance systems are developed. Key advantages of the proposed MORIS design include the following: • Strong labor market incentives: An NDC approach establishing a sound link between contributions and benefits. • Supporting labor mobility and competitiveness through a simple accounting framework.
Figure O.1 Current and Proposed Urban Old-Age Insurance
8
China’s Pension System
• Substantial reduction in contribution rates when compared with the current scheme. • Very limited transition costs as the NDC framework is financed on a pay-as-you-go basis. • Stronger old-age income protection for workers who do not meet current vesting requirements.
The Contributory Pillar, Part 2: The Voluntary Individual Retirement Insurance Scheme
The second instrument of the contributory pillar would be the Voluntary Individual Retirement Insurance Scheme (VIRIS). The VIRIS would establish a framework supportive of voluntary savings for retirement for nonwage residents of urban and rural areas. The VIRIS design has several similarities to the NRPS and URPS.4 The scheme would be voluntary, with individual contributions matched with a governmental subsidy reflected in individual account statements. The matching subsidy would be based on a national framework providing for a minimum match, which could be supplemented from provincial and local finances. The scheme would be fully funded, with a rate of return guaranteed by the central authorities to reduce the risk to contributors from empty accounts. The proposed scheme would provide an annuitized benefit at retirement based on a worker’s lifetime contributions, matching contributions provided by the local and central governments, and a rate of return applied to the individual’s retirement savings account. The approach to the VIRIS design has numerous advantages, most of which are shared by the NRPS and URPS: • The matching subsidy creates a strong incentive for worker participation and savings.5 • The minimum contribution design provides simplicity. • The defined-contribution design facilitates the consolidation of balances across both wage- and non-wage-based schemes. • The interest formula and investment management arrangements minimize the investment risks borne by contributors. • The funded design can mitigate worker uncertainty over potential risks to benefits.
The Supplementary Savings Pillar
Supplemental occupational and individual annuity schemes provide an essential part of the overall design for a multitiered pension system
Overview
9
architecture. The proposed Occupational and Personal Annuity scheme design could build upon the current Enterprise Annuity but would require substantial reform of the regulatory, supervisory, and incentive framework. Reformed tax treatment should provide incentives to save for retirement while limiting tax shields. The regulatory framework should address actual and perceived potential conflicts of interest. A framework for personal pension savings arrangements is needed to support the long-term individual savings needs of the self-employed, the unemployed, farmers, or other individuals without wages or institutional affiliations while in addition supporting supplemental savings options for those who participate in state-sponsored pension schemes but seek additional retirement income.
Design Considerations
The proposed design is motivated by key design principles to provide an integrated framework for all Chinese workers and retirees while allowing for diverse economic and demographic circumstances:6 • A reform vision should address current and long-term future needs under the assumption that reform should be infrequent. • Policies should have uniform national standards yet sufficient flexibility to accommodate China’s diverse regional needs and economic characteristics. • Reforms should reflect the decentralized nature of current policies and administration while at the same time seeking to achieve risk pooling at least at the provincial level and ultimately at the national level in the long term. • Pensions savings and insurance require sharing financing and risk management burdens at multiple levels, including the central government; provincial, municipal, county, and prefecture governments as well as between employers, workers, retirees, and families. The rationale behind the design choices includes the following: • Overall: The rationale for proposing a unified framework for all citizens while providing flexibility for local circumstances is to accommodate the diversity of economic circumstances and decentralized administrative structure, reduce the fragmentation and coverage gaps, provide portable instruments for labor mobility and ensure that elderly poverty protection as a policy objective is satisfied for all citizens.
10
China’s Pension System
• MORIS: An NDC design has been suggested for the mandatory contributory scheme: (a) This directly links contributions and benefits, thereby eliminating the need for periodic benefit adjustments in the face of aging and a demographic transition. (b) Benefits based on notional account accumulations can reduce labor market distortions and incentives for wage underreporting and noncompliance. (c) The NDC design provides a uniform basis for adding up pension entitlements for workers from different locations, sectors and types of employers. (d) A pay-asyou-go financing approach largely eliminates costly transition costs while minimizing the performance risk of reserve management. • VIRIS: (a) The design would apply to all nonsalaried workers addressing a coverage gap. (b) The matching subsidy provides a strong incentive to motivate those in the nonwage sector to save in long-term retirement accounts. (c) The proposed design provides a matching subsidy for nonwage workers to save for their own retirement. (d) A voluntary scheme was proposed in view of the difficulties suggested by international experience in achieving meaningful coverage of nonwage workers through mandatory contributory schemes. (e) The central and local financing of the VIRIS could ensure a more uniform set of contribution incentives nationwide by insulating the matching contributions from local fiscal conditions. • The Occupational and Individual Annuities Scheme: Broadening occupational and individual pension savings arrangements can provide a secure retirement savings vehicle for employers and workers seeking to supplement those benefits provided under the contributory pillar. The rationale for proposing a funded defined-contribution (FDC) design is: (a) to build upon the legal and institutional infrastructure for the EA scheme, (b) individual accounts under an FDC design can be transparent and portable and entitlements easily aggregated across places of employment, (c) fully funding benefit obligations and separating the management of assets eliminates the risk to the participant of sponsor bankruptcy or otherwise defaulting on obligations, and (d) placing additional savings in a separately managed fund diversifies the risk borne by participants.
Implementation Issues and Options
The authorities face several institutional, financing, and implementation challenges, regardless of the nature and extent of further reforms. Key
Overview
11
decisions include (1) target replacement rates across the pension system, (2) the degree of income redistribution that is desired in the system, (3) the approach to indexation, (4) the mechanisms for financing both legacy costs and future pension rights as the demographic transition matures, and (5) the promotion of a more robust institutional architecture and capacity to regulate the system. In taking these decisions, several key issues are the following: Improving the analytical base for ongoing pension reform: A more sustainable pension system will require policy development based on robust projections of system liabilities, monitoring and reporting of current performance, and more rigorous evaluation of current experience and emerging reforms. Financing current and future pension costs: Establishing the policy framework for financing past, present, and future pension rights is a core component of the proposed reform. The following elements need to be considered in the policy framework for pension financing: (1) the framework for financing of past and new legacy costs, (2) the financing plan for future benefit accruals for civil servants and PSU employees, (3) the subsidy framework for compensating those provinces that have demographic and economic conditions requiring additional fiscal subsidies, (4) the subsidy framework supporting the proposed VIRIS and CSP, and (5) the financing plan and anticipated prefunding of future pension liabilities via the National Social Security Fund or other reserve funds that may be established. Defining, estimating, planning for, and ultimately financing legacy costs are a key part of the proposed reform program even in the absence of further reforms. Legacy costs include: (1) those costs that exist in the unreformed system and reflect accrued rights in excess of those supported by a sustainable contribution rate and (2) those costs that are created by the reform if the sustainable contribution rate is lowered. Separating these costs for the different schemes that may be integrated in the proposed urban system is the first step toward fully understanding what has already been committed and must be delivered. Ongoing actuarial exercises are required to evaluate and adjust financing decisions for the best outcomes. Estimates of gross legacy costs depend, among other factors, upon the estimated existing implicit pension debt (IPD) and the expected steadystate contribution rate for the reformed scheme. So for example, initial estimates of legacy costs under a low IPD assumption range from 44 percent assuming a contribution rate of 25 percent to 89 percent assuming a
12
China’s Pension System
contribution rate of 15 percent. Similarly, legacy cost estimates under a high IPD assumption range from 56 percent assuming a contribution rate of 25 percent to 113 percent assuming a contribution rate of 15 percent (see main text and appendix C for a more detailed discussion). Such gross legacy costs would not fully translate into additional fiscal costs, even if they were made explicit. The existing old-age insurance system, as well as schemes for civil servants and PSUs, already receives government subsidies, which are included in these estimates. Up to three-quarters of legacy costs for the civil service and PSU schemes are, in any case, already financed by government revenues. Although individual acquired rights under preexisting schemes could, in principle, be translated into notional account balances any time before individual retirement, the sooner such rights can be quantified under a common accounting framework, the sooner public credibility could be strengthened and the challenges of portability addressed. Portable pension rights: Achieving national portability will require careful consideration of design and administrative policy options. Guidance from the State Council on the issue provides an important step forward in this regard. Key choices will include the framework for (1) record keeping and information flows across space, including when, where, and how data are consolidated for worker entitlements from several venues, urban and rural, intra- and inter-provincial, (2) pooling of contributions and reserves, (3) benefit calculation that accommodates China’s diverse conditions, and (4) reconciling differences in financial flows between cities and between provinces. Transition policies and institutional arrangements will be needed for multiple groups of workers, including: • Policy and administrative changes in the urban old-age insurance system to ensure its attractiveness for urban migrants; additional changes to effectively cover civil servants and PSU employees, and over the long term to extend coverage to include nonwage workers. • Transition arrangements applied to older cohorts in the urban old-age insurance system. The phasing and transition period for parametric changes is needed, such as changes in the minimum retirement age. • Transition arrangements supporting the integration of PSU employees and civil servants into the proposed MORIS scheme, with supplementary benefits provided to protect replacement rates as needed.
Overview
13
Investment management: Regulations, guidelines and strengthened supervision are needed for liquidity and reserve management for investment accumulations under the MORIS at the county, municipal, and provincial levels. Regulation and supervision of voluntary pension arrangements: A multiyear strategy will be needed to develop policies for such arrangements and establish the institutional capacity for supervising such policies. This will include regulations and guidelines for investment management, custodianship, trustee relationships and record keeping. It will also require substantial strengthening of supervision of voluntary pension arrangements, including financial market intermediaries and instruments. Developing and implementing the proposed vision will require additional study and consideration, including (1) quantifying individual rights for conversion to NDC account balances, (2) quantifying legacy costs, (3) establishing a detailed financing framework, (4) establishing and strengthening the framework for investment management, (5) establishing the legal and institutional framework for regulation and supervision, and (6) in the future refining pension policy provisions through systematic monitoring and evaluation.
Conclusion
This volume outlines a medium-term vision for strengthening old-age income protection. The proposed design provides a common framework for a minimum Citizens’ Social Pension (CSP) for all citizens and strengthening of the old-age insurance system, including the integration of all salaried workers, such as civil servants, PSU employees, and migrants. Furthermore, it proposes—in line with the NRPS and URPS—a Voluntary Individual Retirement Insurance Scheme (VIRIS)—that would provide state subsidies as incentives for individuals to save for retirement over and above those currently in place. Finally, it proposes a common framework for voluntary occupational and individual savings arrangements. The proposal builds on existing policies and institutional arrangements yet strengthens them to address key reform needs identified: (1) Contributory instruments are defined-contribution in design to adjust benefits in line with anticipated aging.
14
China’s Pension System
(2) Sustainability is achieved by aligning contributions and benefits, eliminating transition costs with the NDC design, and establishing a modest target benefit level and a factor reduction in the CSP benefit to constrain fiscal costs. (3) Coverage gaps are reduced through matching contribution incentives and a social pension for all elderly. (4) The design is aligned with China’s dynamic and changing labor markets supporting transparent and portable pension rights and providing a secure and uniform foundation for nationwide old-age income security.
Notes
1. 广覆盖、保基本、多层次、可持续. 2. 保基本、廣覆蓋、有彈性、可持續. 3. In addition, secondary objectives of the social security system would be to support labor market efficiency, business competitiveness, and financial market development. 4. 新型农村社会养老保险. 5. The VIRIS suggests a substantially higher matching subsidy of perhaps 1:1 compared with the minimum local matching subsidy of the NRPS of 0.3:1. 6. Additional common principles were suggested above, including broad coverage, protects at the basic level, is multilayered, flexible, and sustainable.
China: A Vision for Pension Policy Reform
Introduction
China is at a critical juncture in its economic transition. A comprehensive reform of its pension and social security systems is an essential element of a strategy aimed toward achieving a harmonious society and sustainable development. Among policy makers, a widely held view is that the approach to pension provision and reform efforts piloted over the last 10–15 years is insufficient to enable China’s economy and population to realize its development objectives in the years ahead. Over the last few years, the government has initiated several significant measures, considered various reform options, and articulated principles for what it would like to achieve in a reformed pension system. The principles (indicated by 12 Chinese characters)1 call for an urban system that “has broad coverage, protects at the basic level, is multilayered and sustainable,” while the principles articulated for the rural system2 are “broad coverage, protects at the basic level, is flexible, and sustainable.” Recognition is widespread among policy makers that an integrated approach toward pension provision and a medium-term vision consistent with such principles are necessary to realize China’s core objectives. This volume has been prepared to develop a long-term vision of a holistic framework for strengthening old-age income protection in China,
15
16
China’s Pension System
consistent with the principles outlined, that could be realized by 2040, and to propose design options toward achieving it. A well-functioning social security system is essential for sustained growth and for people-centered development in the context of China’s rapidly aging society. Investing in a well-functioning social security system is one of several measures supportive of the macroeconomic objectives of increasing domestic consumption and reducing precautionary household savings. It can also support labor markets conducive to growth while providing minimum old-age income protection and a framework for retirement savings. A national framework would remove barriers to labor mobility between both locations and professions and afford equal treatment as workers save toward retirement. A social security system that is affordable to businesses, workers, and the budget can strengthen incentives for business development and job creation and create a more equalized financial burden throughout China. Finally, a sustainable social security system can ensure sufficient resources to honor current and future pension commitments. Although substantial reforms have been undertaken over the last two decades, many policy makers believe that additional reforms are needed to meet the needs of China’s rapidly changing economy and society. Several reform issues previously raised by the authorities have not been fully addressed, such as legacy costs, fragmentation, and limited coverage. Simultaneously, many new challenges have emerged, such as rapid urbanization, income inequality, urban-rural disparities, informalization of the labor force, changes in the family structure and residence arrangements, and the increasing effects of globalization. The government is actively pursuing measures to further develop and improve the social security system for all of its citizens. It undertook a major reform of the urban enterprise pension system in 1997 and has refined the system since that time. Moreover, it has piloted pension reforms for Public Sector Units (PSUs) and for migrants and farmers. In 2009 the authorities established a national framework for rural pensions, the New Rural Pension Scheme (NRPS) and in mid-2011 announced an Urban Residents Pension Scheme (URPS) completing a national framework for expanding pension coverage and for eventual integration of rural and urban resident schemes. The plan enjoys political support, motivation of relevant agencies and local governments, and strong overall fiscal capacity. The country also has more than two decades of experience piloting different approaches to social security reform for different sectors of the Chinese population. Yet in spite of such strong motivation and
China: A Vision for Pension Policy Reform
17
experience, the government has found it difficult to identify a holistic vision to achieve a coherent and integrated pension system. As seen in the pronouncements of the 17th Congress of the Communist Party, it is recognized that an integrated reform effort is essential to avoid the longterm economic and social consequences of a fragmented and inefficient system. This volume aims to articulate such an integrated holistic vision. This volume suggests a national pension system that no longer distinguishes along urban and rural locational or hukou lines yet takes account of the diverse nature of employment relations and capacity of individuals to make contributions. The proposed separation of mandatory wage-based and voluntary nonwage-based contributory schemes is intended as an interim measure until the overall tax collection and compliance framework could be extended to the nonwage sector. Over the long term, it is anticipated that the urban old-age insurance system will extend to all citizens while the distinction between wage-based and nonwage-based incomes will remain.. Appendix A evaluates the pensions needs of nonwage rural and urban citizens and outlines the rationale for the instruments proposed. Appendix B evaluates a notional or nonfinancial defined-contribution design as applied to China’s urban old-age insurance system. Appendix C evaluates pension legacy costs and financing options for addressing them. Appendix D evaluates issues of aging, retirement, and labor markets in China in the context of old-age pension provisions. Appendix E examines voluntary pensions savings arrangements.
Current and Future Trends Motivating Reform Addressing the Demographic and Economic Transition
China is in the midst of a major demographic and economic transition, including aging, changes in the family structure, urbanization, labor mobility, informalization of the labor force, and high income inequality. China’s dramatic aging process and demographic transition have resulted
18
China’s Pension System
in part from the one-child family policy introduced in the late 1970s, combined with significant increases in longevity. Old-age dependency ratios are projected to rise from 13.5 percent and 9.0 percent in 2008 in rural and urban areas, respectively, to 34.4 percent and 21.1 percent by 2030 (figure 1). In the urban old-age insurance system, the system dependency rate, which was 34 percent in 2001, is projected to increase to 100 percent (one worker for each retiree) within 30 years.3 China will undergo this transition in approximately half the time of other countries while starting the transition with a per capita gross domestic product (GDP) roughly one-fifth that of the developed world. Just as old-age dependency ratios are increasing, the so-called 1-2-4 family pattern (1 child–2 parents–4 grandparents) has contributed to declining family
Figure 1 China Population Projections: Growth in the Aged and Dependency Ratios
1,600,000 1,400,000 1,200,000 1,000,000 800,000 600,000 400,000 200,000 0 population in thousands
under age 15
70 60 50 40 30 20 10 0
percent ratio
Source: Population Division of the Department of Economic and Social Affairs of the United Nations Secretariat, World Population Prospects: The 2008 Revision..
8 19 0 8 19 5 9 19 0 9 20 5 0 20 0 0 20 5 1 20 0 1 20 5 2 20 0 25 20 3 20 0 3 20 5 4 20 0 4 20 5 50
percent over age 60 old-age dependency ratio
19
19 8 19 0 85 19 9 19 0 95 20 0 20 0 0 20 5 1 20 0 1 20 5 2 20 0 2 20 5 3 20 0 3 20 5 4 20 0 4 20 5 50
age 15–59 over age 60 total
China: A Vision for Pension Policy Reform
19
resources to support the elderly. Moreover, changes in the family structure (including an increasing divorce rate) are creating new demands on the traditional old-age support arrangements. Aging and the demographic transition have been key factors in the projected financing gap for the urban old-age insurance system.4 Longterm actuarial projections suggested a financing gap (present value of projected yearly financial shortfalls) from 2002 to 2075 of 95 percent of China’s GDP for 2001. The same projections suggested marginal systemwide cash surpluses between 2009 and 2018 and then deficits thereafter, in spite of the maturation of “new men” with lower replacement rates.5 Faster coverage expansion would delay the turning point but make the negative cash flow larger thereafter. The country’s rapid growth and economic transformation have increased the demand for a dynamic labor force that can effectively adjust to the pace of change. Fragmented pension provisions create a barrier to labor mobility. Moreover, low urban retirement ages discourage participation of older workers in the labor force, thereby creating rigidities in the face of growing labor demand (see box 1 and appendix D). China’s urban retirement ages (60 for men and 50 or 55 for women) have remained unchanged since the 1950s, during which time the proportion
Box 1
The Effect of the Minimum Retirement Age on Employment and Labor Markets
Demographic trends and labor force shortage. Changes in China’s demographic structure have important implications for the labor supply, pension schemes, oldage income support, fiscal sustainability, and long-term growth (see appendix D). The size of China’s working-age population will peak in about 2015, and so continued growth will require both higher labor force expansion and skill development. Since 2003 the issue of labor shortages has emerged, with such shortages not limited to the coastal areas. Indeed, the transfer of labor-intensive industries into inland areas has also replicated similar shortages in those areas. Accelerated growth coupled with demographic conditions has led to growth of migration and in some cases labor scarcity. Increasing the minimum retirement age could be one of several options to simultaneously address the labor shortages and population aging. (continued next page)
20
China’s Pension System
Box 1 (continued)
The lump of labor fallacy assumes that the level of labor demand is fixed in the economy and that a substitution effect exists between older and younger workers, so that gradually raising the minimum retirement age will reduce the number of jobs for young workers entering the labor force. Such a view originated from the high and sustained unemployment in Europe in the 1980s and 1990s. It has been a widespread perception in China. Empirical evidence from 21 OECD countries, however, suggests that changes in employment of older workers aged 55–64 have small but positive effects on the employment of younger workers aged 16–24 and on prime-working-age people aged 25–54 because job-specific knowledge and differences in noncognitive skills that develop with age render such individuals useful complements to younger new workers, who often enter with different skill sets. In China, the modest and gradual increase of older workers’ participation suggested by an increase in the retirement age very likely will not worsen the situation of youth employment. Effects of employment and labor markets. Encouraging the elderly to stay longer in the labor market, and retool their skills will have a certain and (in most cases) gradual effect on the labor supply. Simulations illustrate that an increase in retirement age for women from 51 to 60 years old would increase the proportion of the population group between age 15 and retirement age by 0.5 percent in 2010, but this proportion is projected to keep increasing over time to about 10.0 percent after 2029. If the retirement age is further increased from 61 to 65 for both men and women, the proportion of the increased labor force will rise from 10.9 percent in 2029 to 18.4 percent in 2039, whereafter it is projected to remain constant. In practice, other factors that affect labor supply and labor demand should be considered, such as wages, wealth, preferences, skills, job opportunities, discrimination, and informalization. Therefore, the effect of an increase in retirement age could be marginally less than one-third of the supply of older workers aged 51–65. Effects of the minimum retirement age on the urban old-age insurance system. Increasing the minimum retirement age is one of several options to address the financial consequences of aging. The existing old-age insurance system will be financially unsustainable because of various factors, including legacy costs and aging. An increase in retirement age could materially affect the financial sustainability of the existing social pooling component, increase the benefit level from Individual Accounts and slow the growth of the system old-age dependency (continued next page)
China: A Vision for Pension Policy Reform
21
Box 1 (continued)
ratio, leaving more financial resources available to support the aging society. Increasing the retirement age has different effects on pension revenues and expenditures. Encouraging older workers to work longer means more pension contributors who otherwise would be retired, which increases pension revenues. In the meantime, social pooling expenditures are reduced because the number of years of benefits is reduced even though the annual benefit received at retirement would increase because of additional years of accrual.
of the population represented by the elderly, as well as life expectancy at the time of retirement, have both increased. Demands on the labor force will increase as the working-age population is projected to be stagnant and then decline in the coming years (figure 2). A national pension framework including the portability of pension rights is essential to remove barriers to China’s increasingly mobile labor force. Workers in China have become increasingly mobile in recent years, and such a trend will undoubtedly continue with projected urbanization (figure 2).6 Establishing a framework for the portability of urban and rural pension rights will strengthen old-age income security for a growing population with work histories that span locations in urban and rural areas. With fully portable pension rights, individuals can make labor market decisions without the distorting effects of losing accumulated rights because of changes in profession or location. High contribution rates to the urban old-age insurance scheme impact labor costs and competitiveness, thereby discouraging participation. China’s urban old-age insurance system contribution rates of 28 percent of covered wages are relatively high when compared with those of Organisation for Economic Co-operation and Development (OECD) countries.7 Such rates do not include other social security contributions, which together with pension contributions can total about 41 percent depending upon local regulations. Such high rates create strong incentives for evasion, distorting labor markets. Moreover, regional differences in contribution rates impact labor and business competitiveness. The authorities have placed a growing premium on more balanced growth between households, rural and urban areas, and different regions of the country. To date, the pension system has in some ways contributed to increased divergence. The divergence in urban old-age insurance contribution rates only narrowed over the last decade.
22
China’s Pension System
Figure 2 Projected Size and Composition of the Working-Age Population
1,200 120
1,000 working-age population (millions)
100 proportion of urban population (%)
800
80
600 400
60 40
200
20
0
0
10
20
25
35
40
rural
Source: World Bank estimates.
urban
There is a weak framework for voluntary pension savings, including occupational schemes. Enterprise Annuity (EA) schemes at year-end 2008 covered less than 5 percent of contributors to the urban old-age insurance system, and the EA framework has not been adapted to the special needs of PSUs or small enterprises. Structured instruments for voluntary pension savings are also increasingly important due to decreases in replacement rates from the urban old-age insurance system. A strengthened framework for occupational and personal pensions affords the opportunity for workers to improve the returns on funds saved as well as diversify the sources of old-age income protection. As the authorities seek to rebalance the growth model toward greater reliance on domestic consumption, limited coverage and uncertainty over income protection from current pensions discourage consumption and encourage precautionary savings. Strengthening the design and transparency of the old-age insurance system can reduce uncertainty, improving public confidence. Strengthening old-age income protection is one of several measures to improve social protection (such as also improving health and unemployment insurance and social assistance— dibao), which together can reduce vulnerability and thus support current consumption.
20
urbanization
50 20 55 20 60 20 65 20 70 20 75
15
30
20
20
20
20
20
20
20
20
45
China: A Vision for Pension Policy Reform
23
Proposed Design Summary Description and Principles behind Design Choices
This volume proposes a three-pillar design consisting of the following components (see figure 3): (a) A basic benefit pillar providing minimum elderly poverty protection through noncontributory Citizens’ Social Pension (CSP) benefits (b) A contributory pillar with a mandatory notional defined contribution (NDC) scheme for workers with labor contracts (modifying the current urban old-age insurance system) and a voluntary defined-contribution pension savings scheme for the urban and rural populations with nonwage incomes (for example temporary workers, migrants, the self-employed, and farmers) (c) A supplementary savings pillar for urban and rural residents providing voluntary occupational and personal pension savings options that may supplement other pension benefits. Maintaining separate wage and nonwage-based contributory schemes is intended as an interim measure for perhaps 30 years or more, after which provisions under the Mandatory Occupational Retirement Insurance Scheme (MORIS) potentially could absorb workers without labor contracts—the informal sector, self-employed, migrants, and farmers. The rationale behind this approach is that (1) the experience in developed countries suggests that extending coverage of mandatory contributory schemes to the rural and informal sectors generally is a prolonged process even with rapid and sustained high rates of growth and (2) the projected rural working population in 2040 will still be about 200 million (figure 3). Because the authorities have committed to providing old-age income protection for the largely uncovered rural and urban populations, an interim (30+ year) arrangement is necessary under
Figure 3 Proposed Overall Design
Basic benefit pillar Contributory pillar Supplementary savings pillar Citizens’ Social Pensions (CSP) Mandatory Occupational Retirement Insurance (MORIS) Voluntary Individual Retirement Insurance Scheme (VIRIS)
Supplemental occupational and individual annuities
24
China’s Pension System
the assumption that over time urbanization will make it easier to integrate the MORIS and the Voluntary Individual Retirement Insurance Scheme (VIRIS). The proposed design is motivated by principles of providing an integrated framework for all Chinese workers and retirees while allowing for diverse economic and demographic circumstances: (1) Reforms should address current and long-term future needs under the assumption that reform should be infrequent. (2) Policies should have uniform national standards yet sufficient flexibility to accommodate China’s diverse regional needs and economic characteristics. (3) Reforms should reflect the decentralized nature of current policies and administration while at the same time seeking to achieve risk pooling at least at the provincial level and ultimately at the national level in the long term. (4) Pension savings and insurance functions are collective responsibilities that require sharing the financing and risk management burden at multiple levels, including the central government; provincial, municipal, county, and prefecture governments; and among employers, workers, and families. The proposed design has been chosen to satisfy the principles articulated by the authorities. The proposed design should accomplish the following: (1) Provide broad coverage providing minimal elderly poverty protection. The CSP aims to cover all of the elderly with little or no pension income. The VIRIS provides strong incentives for coverage expansion to nonwage workers. (2) Target benefits at a basic level for all retirees and a retirement savings and insurance option for the vast majority of workers.8 The CSP benefit level is suggested to be a proportion of the individual consumption requirements for minimum subsistence as currently is the rationale behind the dibao. Although the authorities have not specified the targeted level of income replacement in old age, if mandatory contributions target only a modest proportion of income replacement then well-regulated occupational and personal pensions savings arrangements can supplement the mandatory scheme.
China: A Vision for Pension Policy Reform
25
(3) Be multilayered to diversify the risks and sources of income for China’s elderly. The three-pillar design has separate financing sources and risk characteristics for each instrument, which together diversify contributors’ and retirees’ sources of risk. (4) Be sustainable for contributors, the government, and the broader economy. The proposed NDC design and separate financing of legacy costs for the contributory pillar aims in part to satisfy the sustainability objective. The CSP would be fiscally sustainable in spite of demographic change provided that the benefit is established and maintained at a very modest level. The supplementary pillar has been proposed as a defined-contribution design in part to satisfy this sustainability criterion. (5) Be flexible not only for rural schemes but for all schemes. The design has been formulated according to national standards while allowing for adaptation to local circumstances. Further, the design and institutional configuration aim to ensure the portability of pension rights. An additional objective supported by this volume though not explicitly indicated by the authorities is affordability. Affordability refers to the cost to employers and employees of saving for a targeted income replacement in retirement. Moreover, fiscal affordability refers to the fiscal burden for providing a social pension, financing legacy costs, financing pension promises for government or PSU workers attributable to fiscal resources, and backstopping potential fiscal costs for the MORIS and VIRIS.
Basic Benefit Pillar—Citizens’ Social Pension (CSP)
Need and rationale for the CSP. The elderly are vulnerable to shocks and are likely to grow more vulnerable in the years ahead. Information on elderly poverty and sources of income suggests that the urban elderly are not uniformly at risk as a group; many of them rely on sources of support that are vulnerable to shocks or are dependent on family members who may be unable to provide adequate levels of support and may themselves be subject to shocks that reduce the level of support they can provide (see appendix D). The pressures on family support are likely to become more acute in coming decades as old-age dependency ratios rise. The old-age insurance system will also continue to have major gaps in coverage of the urban elderly for some time to come, and family support
26
China’s Pension System
will continue to be an important although not uniform source of support to fill the gap for the uncovered urban elderly, especially women. Although the elderly are growing more vulnerable, substantial weaknesses are seen in existing provision of poverty protection for the elderly poor: • Dibao assistance presently reaches less than half of the urban elderly poor. • Means-testing criteria for dibao programs have not been uniform. • A common framework for the dibao benefit level does not exist, and the benefit level and access criteria have been dependent upon local fiscal capacity. • Without some form of universality, an increasing number of elderly have been left vulnerable, though the NRPS and URPS should substantially increase the coverage of the elderly. Although the NRPS and URPS are important steps forward towards universal elderly coverage, some elderly may likely not satisfy the criteria to receive benefits under these programs. The poorest often have the least capacity to save for retirement and thus meet the savings or family binding criterion for the minimum basic benefit. Communities with weak fiscal capacity may also likely have insufficient matching resources to motivate savings for retirement by rural and informal sector workers, resulting in some of the elderly population left uncovered. In line with an assessment of vulnerability and weaknesses in existing policies, analysis of elderly poverty and vulnerability supports a solid rationale for greater public intervention in support for the rural elderly:9 (1) Historically, rural elderly have been consistently poorer, have been more vulnerable, and have suffered a higher incidence of chronic poverty than have both working-age households and the urban elderly in China. Households headed by older people are consistently the poorest in rural areas, even though rural poverty head counts have fallen sharply. (2) The demographic transition is accelerating with aging, and the increase in old-age dependency is far more pronounced in rural than in urban areas. (3) Rural elderly depend more on labor income and informal sources of support, which will come under increased pressure over time, particularly for the rural poor (figure 4). (4) Although savings rates are high across the income distribution in China and remain positive even in old age, they are strongly correlated with household income, and the rural poor are not
China: A Vision for Pension Policy Reform
27
saving on average.10 Concerns have also been expressed that people are saving too much as a precaution against old age, health costs, and other shocks, contributing to macroeconomic imbalances between saving and consumption. Proposed design. The objective of the proposed CSP is to ensure basic living subsistence for the elderly not covered by existing pension provisions or otherwise unable to generate an adequate retirement income from contributions during their working age.11 This could be for a variety of reasons, including sickness or disability or time out of the workforce for various reasons such as child rearing or acquiring an education (figure 4). The proposed benefit would have uniform design parameters nationwide, although the benefit level would reflect local characteristics (see table 1). Provincial authorities would be held accountable for observance of the national framework and its implementation at the city and county levels. The benefit level proposed for urban beneficiaries would be a proportion of the regional average wage, whereas that for rural beneficiaries would be a proportion of the regional average rural per capita income.12 Both benefits would aim to be higher than the per capita benefit under the existing dibao scheme. A “pensions test” would reduce the benefit by a proportion of benefits received under other pension arrangements. The factor reduction applied to the
Figure 4 Primary Source of Support for Rural Elderly by Age percentage of total individual incomes
90 80 70 60 50 % 40 30 20 10 0 60–61 62–63 labor income
Source: Cai and others 2012.
64–65 age
66–67 pension
68–69
70–71
family support
28
China’s Pension System
Table 1 Citizens’ Social Pensions (CSP)—Proposed Parameters Issue Applicability Eligible beneficiaries Provision/parameters • All urban and rural residents age 65 and over • Urban or rural elderly that apply and have other pension income lower than an applicable threshold for those aged 65–74 and any retiree aged 75 and above. • Percent of regional average wage (urban) or regional per capita income (rural) • Minimum benefit above dibao standard • Benefit partially offset by other pension income, factor reduction may be 40–60 percent depending upon desired incentives and fiscal constraints • Noncontributory • Financed from general revenues • Shared responsibility between central and subnational governments, with minimum benefit guarantee from the central government • Benefit included in family income for purposes of determining eligibility for dibao
Benefit level (before pension test reduction)
Financing
Interaction with dibao
CSP benefit needs to be designed to provide meaningful incentives for contributions to other pension schemes while at the same time targeting the benefit to those with the least source of income from other pensions benefits. Figures 5 and 10 illustrate the effect on a benefit of applying a pensions test in a stylized example. Given the intention to increase the MORIS retirement age to 65 over time for men and women, age 65 has been proposed for the minimum age necessary to qualify for the CSP. This would be important from a labor supply incentive viewpoint and to maintain the coherence of urban pensions policy. Such a benefit would be noncontributory and financed by national, provincial, municipal, and local resources. An important design parameter of the CSP would be the benefit’s relativity to the rural dibao threshold in counties. In this respect, the practice of most rural pension pilot schemes seems appropriate, that is, to set the benefit at a level above the rural dibao per capita threshold. It would be important for incentive reasons to be sufficiently above the dibao threshold, but for fiscal reasons not to be too far above it. If the CSP benefit is set too high, the incentives to contribute to the MORIS or VIRIS would be weak, while if it is set too low, the objective of mitigating old-age poverty through the pension system may be undermined. Under the NRPS, the central government has initiated a minimum flat benefit level at 55 renminbi (RMB) monthly, with additional funds that can be
China: A Vision for Pension Policy Reform
29
Figure 5 Stylized Example of Rural CSP Benefit Levels and Composition
total retirement benefit (RMB per year) 1,800 1,600 1,400 1,200 1,000 800 600 400 200 0
0
rural social pension
Source: World Bank simulations. Note: Assumes a CSP benefit of 788 RMB/year, which is the 2003 Ravallion-Chen rural consumption poverty level increased by the CPI from 2003 to 2009. In this example, the CSP benefit is reduced by 50 percent of the alternative pension income.
provided from subnational sources. This compares to an average annual rural dibao threshold of 988 RMB nationally in 2008, with a range from 26 to 267 RMB (about 6.6–67.3 percent of the national average net rural per capita income). The dibao threshold rates suggest that closer attention will be needed to the relative level of the CSP benefit “floor” to align protections and incentives appropriately. Finally, pensions from under the NRPS, URPS, and the proposed CSP would have no effect on the receipt of the supportive allowance for following the family planning policy, although some Chinese researchers have proposed integrating the programs through using the family planning subsidy as an additional subsidy toward individual pension contributions.13 Key open policy design decisions that need to be made include (1) a more detailed framework for the minimum benefit level, (2) the benefit reduction factor applied to other pension income, (3) qualifying conditions including age and residency, (4) central, provincial, and local financing arrangements (see discussion below), (5) linkages to the dibao, and (6) administrative arrangements. Projected costs. Indicative cost estimates suggest that a CSP benefit for both rural and urban elderly poor would cost about 0.24 percent of GDP
0 40 0 50 0 60 0 70 0 80 0 90 0 1, 00 0 1, 10 0 1, 20 0 1, 30 0 1, 40 0 1, 50 0
alternate pension income per year (RMB) other pension income during retirement
0 10
20
0
30
30
China’s Pension System
in 2010, rising to about 0.43 percent of GDP in 2040 (figure 6).14 A benefit at about the urban income poverty line would cost about 0.11 percent of 2010 GDP, rising to 0.31 percent of GDP in 2040 with the benefit level at about 4 percent of the urban average wage. Similar cost estimates suggest that a CSP for the rural elderly poor with a benefit at about the rural individual poverty consumption line would be about 0.13 percent of 2010 GDP, declining to about 0.12 percent of GDP in 2040 (figure 6). These estimates would vary substantially based on the benefit level, growth in the benefit level, level of urbanization, and observed benefit reductions arising from the “pensions test.” The cost increases reflect population aging and urbanization. By comparison, by adopting a benefit level of about 28 percent of the urban average wage (the OECD country average), the urban CSP cost would be 0.75 percent of GDP in 2010, rising to 2.1 percent of GDP by 2040.15 Comparison of proposed design with current arrangements and justification for policy changes. What are the differences in incentives
Figure 6 Indicative Cost Projections for Urban and Rural Citizens’ Social Pensions
0.45 0.40 0.35 percentage of GDP 0.30 0.25 0.20 0.15 0.10 0.05 0.00
Source: World Bank estimates. Note: This assumes median variant urbanization 2010–2040, total fertility rate 1.8, and age distribution for the beneficiary population over age 60 is the same as for the total population. Assumed rural factor reductions attributed to a pensions test as follows: 5 percent in 2011, rising by 3 percent each year up to a maximum of 50 percent. Assumed urban factor reductions attributed to a pensions test are as follows: 40 percent in 2010 rising by 1 percent each year up to a maximum of 60 percent. The benefit level is assumed to grow at the same rate as GDP.
10 20 12 20 14 20 16 20 18 20 20 20 22 20 24 20 26 20 28 20 30 20 32 20 34 20 36 20 38 20 40
year rural urban total
20
China: A Vision for Pension Policy Reform
31
created by the proposed CSP qualifying conditions and benefits compared with those of the NRPS and URPS? • Benefit level—Minimum national standards with scope for regional variation. The CSP has a similar design to the NRPS and URPS in that both establish a national basis for the benefit formula with the opportunity for localities to increase the benefit provided. Although the NRPS and URPS provide a minimum benefit of 55 RMB, the CSP has proposed a benefit that would uniformly be linked to a local rural per capita income or urban wage index with no minimum national benefit level. • Financing. The financing plans for the CSP, NRPS, and URPS are similar. The CSP suggests that the central government will guarantee a minimum benefit (linked to a local index), and the NRPS and URPS provide for central government financing of a minimum benefit in all but the eastern coastal provinces. • Qualifying conditions and incentives. The CSP establishes Chinese residency, age (65), and pension income (under a threshold to be determined) as the only qualifying conditions, whereas the NRPS and URPS have qualifying conditions of age (60), residency, and 15 years of contributions (or buyback or family binding provisions). Although the NRPS and URPS vesting or family binding provisions create strong incentives for participation by those approaching retirement age and their children, these incentives may also lead to elderly coverage gaps for those poor elderly not able to satisfy such conditions. The CSP proposal therefore does not include contribution or family binding conditions although it does reduce CSP benefits resulting from alternative pension income. In respect to the age requirement, a retirement age of 65 can not only align with the other contributory pension retirement age proposals but also create stronger incentives for individuals to work longer. • Work and savings incentives. This volume shares the authorities’ concern that a CSP may discourage incentives to work, save, and contribute to a pensions saving or old-age insurance scheme. The NRPS and URPS, on the other hand, have contribution or family binding requirements established as a savings incentive. Although the CSP benefit may discourage incentives for some to work and save for retirement, the primacy of the objective of ensuring full beneficiary coverage accepts this tradeoff.
32
China’s Pension System
• Targeting. The pensions test applied to the CSP would target benefits to those elderly with the limited alternative pension benefits while at the same time limiting program costs. The NRPS and URPS are also designed for those elderly without pension benefits but do not provide a supplement for those with very low pension benefit levels. • Needs of urban nonwage workers. Recognizing the changing nature of urban and rural residency distinctions in China and the vulnerability of the nonwage sector, this volume proposes the CSP to apply equally to urban and rural dwellers and therefore cover the informal sector, self-employed, and migrants that may not realize sufficient retirement income to prevent poverty in old age. If the differences between the CSP, on the one hand, and the NRPS and URPS, on the other, are only marginal, is the suggested policy change justified by the anticipated results? Overall, the basic benefit of the NRPS and URPS is similar to the CSP provisions proposed here. Table 2 provides stylized examples comparing the NRPS and CSP benefits. The differences in policy parameters (retirement age, pensions test, elimination of contribution requirements) would marginally improve the design of the NRPS and URPS. Of greater importance, however, is the suggestion to extend the CSP framework to include both rural and urban nonwage workers, and, in this way, the benefit would be much better aligned with China’s increasingly mobile workforce and the government’s desire to reduce the distinction between urban and rural residents. This would also create an alignment between the CSP and urban old-age insurance system. Reducing the risk of old-age poverty in China can therefore be much more effectively achieved by a CSP that is provided to all of the aged regardless of their rural or urban residency.
Contributory Pension Provisions
Motivations for reform of current urban old-age insurance. Urban oldage insurance provisions face various weaknesses that constrain China’s objectives of realizing sustained growth and a harmonious society:16 (a) Fragmentation and limited portability obstruct labor mobility. Maintaining separate schemes for civil servants, employees of PSUs, and other urban workers creates a barrier to labor mobility that impacts labor markets and the career choices of affected workers. The lack of portability of rights between schemes and between cities also inhibits labor mobility. Pension administration is also decentralized in most places,
Table 2 Stylized Examples Comparing NRPS and CSP Benefits NRPS benefits Retiree receives the minimum benefit of 55 RMB per month, and in this case there is no increase in the benefit level by the local government. Contributions of 100 RMB/ year are made by his or her relatives through the family binding requirement. Retiree receives the minimum benefit (percent of regional average per capita income to be determined). In this case there is no increase in the benefit provided by the local government. No contributions are required by family members. Retiree receives the minimum benefit. • Benefits under the CSP may be lower or higher than under the NRPS. • Under the CSP, no contributions are required by family members. CSP benefits Comparison
Example
Retiree characteristics
1. Rural retiree with no pension
Rural resident, 65 years old in 2011, has not contributed to the NRPS or any other pension plan and receives no other pension income.
2. Rural retiree with no pension and no children
Rural resident, 65 years old in 2011, has no other sources of pension income and has made no contributions to the NRPS. Retiree has no surviving children or any other pension income.
Retiree cannot qualify for benefits because he/she cannot meet the family binding requirement.
CSP removes a potential coverage gap by eliminating family binding or historical contribution requirements characteristic of the NRPS.
(continued next page)
33
34
Table 2 (continued) NRPS benefits Retiree receives minimum benefit of at least 55 RMB/ month in addition to the 50 RMB/month from the SOE for a total of 105 RMB/ month. Contributions of 100 RMB/year are made by his/her children through the family binding requirement. As an urban resident, retiree cannot qualify for NRPS benefits though he/she may qualify for a URPS benefit. Retiree receives the minimum benefit of at least 55 RMB/month subject to family binding requirements. Retiree does not meet the age requirement and does not qualify for a benefit. Retiree receives the minimum CSP benefit plus additional benefits as may be provided by the municipality. Both URPS and CSP ensures that a minimum benefit is provided for urban nonwage retirees. Retiree entitled to the minimum benefit (assumed 55 RMB/month) reduced by 40 percent of the SOE benefit (0.4 × 50 = 20). The CSP benefit is 35 RMB (in addition to the 50 RMB/ month from the SOE) for a total of 85 RMB/month. Benefit adjustment applied to the CSP reduces fiscal costs while providing an incentive for workers to find additional means of savings or mobilizing other retirement income. CSP benefits Comparison
Example
Retiree characteristics
3. Rural retiree with small urban pension
Rural resident, 65 years old in 2011, and receives a small pension of 50 RMB per month from years of work in an SOE.
4. Urban retiree with no pension income
Urban resident, 65 years old in 2011, has worked in the informal sector and has no other sources of pension income.
5. Rural retiree age 60
Rural resident, 60 years old in 2011 and has no other sources of pension income. Retiree has not contributed to the NRPS or any other pension plan and receives no other pension income.
CSP does not cover population aged 60–64 under the rationale that such individuals can work and find nonpension income sources.
Note: CSP = Citizens’ Social Pension; NRPS = New Rural Pension Scheme; SOE = state-owned enterprise; URPS = Urban Residents Pension Scheme.
China: A Vision for Pension Policy Reform
35
with collections, record keeping, account management, compliance monitoring, benefit calculation, and disbursement carried out at a county, prefecture, municipal, or city level. (b) Very limited risk pooling. The experience of the urban old-age insurance system in pooling of contributions, benefit disbursements, and reserves has been very limited since being established in the late 1990s.17 Such limited pooling creates fiscal stress for those cities and counties with the oldest covered populations and a risk that some beneficiaries receive eroded benefits. (c) Poor returns. The old-age insurance system’s individual accounts have yielded rates of return inferior to covered wage growth, resulting in replacement rates for new retirees well below what had been anticipated at the time of the reform in 1996–1997 (figure 7). Expectations that individual accounts could achieve market returns in excess of wage growth have not materialized. (d) A growing threat to sustainability. Although reforms to the urban oldage insurance system have improved projected sustainability in the long term, several factors, including population aging, have continued to pose important challenges. Although urban schemes as a whole have run cash-flow surpluses, many provinces and cities have been paying out more in benefits than they receive in contributions and are therefore running current deficits requiring increasing subsidies (see figure 8). Such future deficits are expected to substantially increase over the coming years as system dependency ratios increase before moderating over the long term.18 (e) Barriers to competitiveness and coverage. Combined employeremployee contribution rates of 28 percent present a burden on formal labor and enterprise competitiveness in those areas of China generally with the largest pension liabilities. Such contribution rates create incentives for weak labor force coverage, wage underreporting, and early exit from the labor force just as China’s labor markets become increasingly competitive (see appendix B and box 1). Weak compliance enforcement and high minimum contributions for low-income workers also contribute to poor coverage. Migrant and informal sector employees have generally not participated in the urban old-age insurance system, although pilot provisions for migrants have provided lower contribution rates.
36
China’s Pension System
Figure 7 Comparison of Rates of Inflation, Wage Growth, and One-Year Term Deposits Interest Rates
1,400 1,200 index (1990 = 100) 1,000 800 600 400 200 0
Sources: Sin 2008 and World Bank estimates.
Figure 8 Chinese Government Subsidies to Pensions, 2003–2007
6.0 5.0 4.0 % of GDP 3.0 2.0 1.0 0
Source: World Bank estimates.
Mandatory Occupational Retirement Insurance Scheme (MORIS) MORIS Description. An NDC design is proposed as a reform measure applied to the old-age insurance system—a Mandatory Occupational Retirement Insurance Scheme (MORIS) (see appendix B; see also figure 9
19 90 19 91 19 92 19 93 19 94 19 95 19 96 19 97 19 98 19 99 20 00 20 01 20 02 20 03 20 04 20 05 20 06 20 07 20 08
inflation wage growth growth of one-year term deposits 2003 2004 2005 2006 2007 2008 2009 local government subsidies central government subsidies central and local government subsidies
China: A Vision for Pension Policy Reform
37
and box 3). The proposed MORIS design would build on the existing oldage insurance design and institutional structure. The proposed scheme would be defined-contribution in design, follow a notional pay-as-you-go financing approach, and establish an integrated framework across different types of employers. The scheme’s rights and responsibilities would extend to all wage-based urban employers and workers—regardless of sector, ownership structure, or location—including civil servants and PSU workers in the medium term. The parameters of such a scheme— that is, the qualifying conditions, the contribution rate, the benefit formula, and the indexation and annuitization framework—should be uniform nationwide, although grounded in local indices. A key design issue is the target replacement rate and, therefore, the optimal contribution rate for the MORIS scheme. Target replacement rates generally reflect social policy choices of desired income replacement, elderly poverty protection, and redistribution. There is a trade-off between the adequacy of income replacement, the affordability of the contribution rate, and the retirement age. A modest target replacement rate would result in equally modest contributions for enterprises and individuals across China, limiting the contribution burden and leaving space for supplementary retirement savings or contributions to other forms of social insurance.
Figure 9 Current Urban Old-Age Insurance and Proposed MORIS
38
China’s Pension System
The proposed design of the MORIS scheme is indicated in figure 9, and table 3 provides a more in-depth comparison of key features of the old-age insurance system and the proposed MORIS. • Contribution rate. The contribution rate depends primarily on the target replacement rate, retirement age, indexation provisions, and income redistribution through the benefit formula. Contributions are determined by multiplying the contribution rate by the individual’s wage. By financing legacy costs outside the pension system and increasing the retirement age to 65, the total contribution rate could be reduced from the current 28 percent to between 14 percent and 22 percent for a 40–60 percent average target replacement rate.19 • Notional account accumulation. Wage-based NDC contributions would credit amounts to an individual’s notional account based on the contribution rate multiplied by his or her individual wage. To replicate some of the redistributive properties of the existing social pooling benefit formula, under the Social Pooling NDC, the contribution would be levied based on an individual’s wage, but the amount credited to the notional account would be calculated based on the contribution rate multiplied by the regional average wage. In this way, some of the income redistribution provided under the social pooling formula of the old-age insurance system would be achieved under the MORIS. The notional account balance would increase at the notional interest rate, which would include the national GDP growth plus a balancing mechanism (see appendix B). • Benefit formula. As suggested in box 2, benefits would be calculated at retirement based on the notional balance accumulated and the annuity factor, which includes the life expectancy at retirement and the prevailing notional interest rate (see box 2), similar to the benefit formulation under current individual accounts. • Retirement age. The urban old-age insurance system should gradually phase in a minimum retirement age of 65 for both men and women.20 Not only is increasing the retirement age essential to reducing contribution rates and improving benefits, it is also one of a series of measures needed to remove disincentives for workers to work longer (see box 1). • Indexation. In any pension system, the higher the indexation factor, the lower the initial pension. Although price indexation protects a retiree
Table 3 Comparison of Key Features of the Old-Age Insurance System and the Proposed MORIS Proposed MORIS All urban and rural wage-based workers (enterprises, PSUs, civil servants, urban migrants with labor contracts) Retirement age: 65 (men and women, gradually phased in) 30-day vesting
Current old-age insurance system
1. Coverage
Regular employees of registered enterprises
2. Qualifying conditions
3. Target replacement rate
According to objectives to be determined, possibly 40–60 percent.
4. Benefit
Retirement age: 60 for men; 55 for managerial women; 50 for women workers; earlier ages for hazardous professions 15-year vesting 58 percent (est. 1997), although currently replacement rates for new retirees estimated at 45–55 percent Social pooling—1 percent/year of service after 15 years Indexation: Individual Account—in accordance with accumulations and returns realized Annuity factor based on life expectancy at retirement and projected changes in life expectancy
5. Contribution rates 6. Contribution base 7. Portability
20 percent employer 8 percent employee Minimum: 60 percent of regional average wage Maximum: 300 percent of regional average wage Very limited
8. Management
Accounts managed by local social security bureaus Investment management managed by local finance bureaus according to national guidelines
Social pooling—A proportion of the contribution rate credited to the notional account based on the regional average wage Notional account formula = notional account, accumulation/projected life expectancy at retirement Indexation = minimum of CPI, mix of 2/3 CPI and 1/3 covered wage growth Notional interest rate = national GDP growth + balancing mechanism Annuity factor based on life expectancy at retirement and projected changes in life expectancy Total contribution rate depends upon target replacement rate (possibly 14–22 percent) redistribution, assuming legacy costs financed outside the pension system Base for calculating contributions: individual-covered wage Maximum: 300 percent of regional average wage; no minimum Notional accumulations can be transferred across localities and public and private sectors Target to achieve accounts and fund management at least at the provincial level, recognizing that city and county management may exist according to a unified provincial management framework
39
Note: CPI = consumer price index; GDP = gross domestic product; PSU = public sector unit.
40
China’s Pension System
Box 2
Benefit Calculation and Illustrative Examples for the Proposed MORIS
Design and financing. Under an NDC scheme, employers and employees make contributions to “notional” accounts, which are unique to each individual employee participant in the scheme. Accounting entries record such contributions, and “notional interest” is accrued and recorded on an ongoing basis. The cash contributions are used to pay the social insurance benefits of other retirees so that the account balance is “notional” or a pension promise based on an accounting entry. The notional interest rate is specified by law and is tied to an index and accrued on notional balances. In one sense, notional accounts are “empty” accounts by design and have an interest rate formula to ensure that the retiree is paid what he or she is promised, which also can be reviewed and accounted for. There often is also a “balancing mechanism,” an adjustment to the notional interest rate that aims to adjust for unanticipated long-term differences in the contributions made and benefits paid. In addition, a “buffer fund” is generally established to make sure that all retirees are paid even in the event of an unanticipated short-term shortfall in contributions. Benefit calculation. At retirement, benefits are calculated much in the same way that Individual Account benefits are calculated under the old-age insurance system. All of the retiree’s notional balances (and imputed notional interest) are added together from each of the places of work to create a total notional account balance. The individual receives an annuity computed on the basis of (1) projected cohort life expectancy at the individual’s age of retirement, (2) notional interest rates and (3) an applicable discount rate. If a retiree waits to retire, the benefit is proportionally greater because he or she has a shorter life expectancy than at the minimum retirement age. Each month a worker participates in the scheme, contributions by the employer and employee are made at a contribution rate to be determined. Such a contribution amount would be calculated as the contribution rate multiplied by the individual’s wage. The amount credited to his or her notional account would be divided into two parts as follows: 1. One part would be credited to the notional account an amount equal to a contribution rate (for example, 12 percent) multiplied by the individual’s wage; and 2. One part would be credited to the notional account an amount equal to a rate (for example, 3 percent) multiplied by the regional average wage. (continued next page)
China: A Vision for Pension Policy Reform
41
Box 2 (continued)
Illustrative examples. This can be illustrated as follows: Suppose that the NDC contribution rate is 12 percent, and the Social Pooling NDC contribution rate is 3 percent, and the individual’s monthly salary is 1,750 RMB or one-half of an average monthly salary of 3,500 RMB: Monthly contribution = (0.12 × 1,750) + (0.03 × 1,750) = 263. Monthly increase in notional account balance = (0.12 × 1,750) + (0.03 × 3,500) = 298. The final replacement rate at age 65 for a worker earning one-half of the average wage (assuming 30 years of work and contributions, real growth in wages of 4.5 percent, notional interest rate of 4.5 percent, and life expectancy at retirement age 65 of 17.8 years–men) would be 56 percent. Two more illustrations indicate the redistributive character of the benefit: Final replacement rate at age 65 for an average wage worker (men—same assumptions) = 46 percent. Final replacement rate at age 65 for worker earning two times the average wage (7,000 RMB—same assumptions) = 42 percent. Redistribution. The contribution to a Social Pooling NDC account would achieve redistribution through the pension system much in the same way as the Social Pooling basic benefit of the old-age insurance system.
against price inflation, because wages generally rise faster than prices, price indexation will result in a decrease in pension benefits after retirement relative to prevailing wages. This volume proposes that the indexation factor applied to notional account benefits be determined based on one-third from the growth in covered wages and two-thirds based on the growth in prices with the indexation not to be less than price growth.21 • Vesting and minimum benefits. A 30-day vesting period and no minimum benefit provision are proposed to justify the administrative costs of employee registration.22 Rationale behind MORIS design choice. What is the rationale behind the proposed NDC design in place of the existing Social Pooling and Individual Accounts of the current old-age insurance system?
42
China’s Pension System
• Aging and financial sustainability. The NDC design when compared to the defined-benefit Social Pooling benefit design has an automatic balancing mechanism to address the demographic effect of aging. In contrast, the Social Pooling defined-benefit design would require periodic adjustments to the contribution rate, accrual rate, and/or retirement age to maintain a balance between contributions and benefits in China’s aging society. • Coverage incentives. Benefit determination based on defined-contribution account accumulations establishes a sound link between contributions and benefits, eliminating many of the labor market distortions and incentives for wage underreporting and noncompliance under the current Social Pooling benefit formula. A notional interest rate of GDP growth also provides an attractive incentive to contribute when compared with the returns on Individual Accounts, which have been less than wage growth for more than a decade, and often less than price growth. • Accounting framework supportive of labor mobility. An NDC framework provides a uniform basis for adding up pension entitlements for work from different counties, cities, and provinces and in different sectors and types of employers such as PSUs and enterprises. In this way the NDC framework can remove a substantial barrier to labor mobility. Although in principle it is possible to add up entitlements under the Social Pooling and Individual Account benefit frameworks, an NDC framework offers a far more simple process. Individual Account balances under the current system can, in principle, be added together between employers. • Simplicity for fiscal accounting and transfers. An NDC framework provides a simple basis for transferring acquired rights at retirement although it does require that existing Social Pooling rights are translated into notional account balances. Interregional or interprovincial transfers can be calculated based on such notional account balances. Under the current Social Pooling arrangement, transferring acquired rights between locations requires proper actuarial valuation of these rights. • Transition costs and consistency with macroeconomic objectives. Consistent with China’s objective of consumption-driven growth, the NDC approach requires setting aside far less savings for future pension commitments when compared with the transition cost financing requirements for funding existing Individual Accounts. In this way, more resources can be made available for current consumption.
China: A Vision for Pension Policy Reform
43
• Enabling conditions and performance risks for current Individual Accounts. The governance and financial market requirements for the management of reserves in current Individual Accounts will grow over the coming years. Although many observers have suggested that over time China can develop the regulatory framework and governance capacity to ensure the proper management of such reserves, many have also pointed out the substantial risks posed by such a large concentration of resources that have been mandatorily contributed by employers and employees throughout China. The NDC design eliminates the need for workers to bear these performance risks by setting a formula for notional account returns. Moreover, reserves needed under the NDC design are limited to liquid resources to finance short-term disbursements and a buffer fund to cover potential cash flow imbalances from economic shocks (see appendix B). What are common design characteristics between the MORIS and the current Social Pooling and Individual Accounts in the old-age insurance system? • Target income replacement. The MORIS can be designed to target the same replacement rate for workers at different income levels as the old-age insurance system. • Redistribution. The existing Social Pooling benefit provides income redistribution by calculating the benefits based on a combination of one-half individual wages and one-half regional average wages. The same effect can be achieved by the Social Pooling NDC calculation, which credits some of the individual contribution to the notional account based on regional average wages instead of individual wages. • Annuity calculation and risks. The proposed benefit calculation under the MORIS is very similar to that of the existing Individual Account benefits. Can the advantages of the MORIS design be achieved without a major policy change? • It is possible to enact parametric adjustments to the current Social Pooling benefit to emulate an NDC scheme: (1) the wage base for benefit determination would need to be extended from a final wage
44
China’s Pension System
basis to lifetime wages and the reference wages indexed or “valorized” to take account of wage or GDP growth during an individual’s working life; (2) the accrual rate would need to be changed from the current 1 percent to reflect a projected long-term equilibrium between contributions and benefits; (3) the retirement age would need to be increased to 65 for men and women; and (4) an automatic stabilizer would need to be established to either increase the contribution rate, decrease the accrual rate, and/or increase the retirement age as the system dependency ratios increase in the future. • It is also possible to prescribe a fixed rate of return to current Individual Accounts, although a financing vehicle would need to cover the deficiency between the rate of return on reserves and such a prescribed interest rate. • Moving from a fully funded objective of the current Individual Accounts to an NDC framework would require a policy change as well as financial management and institutional arrangements to make such accounts “notional.” Those localities that have accumulated significant reserves could place such reserves in regional or national social security funds to achieve diversification and some level of uniformity in investment management. • Legacy costs could be calculated and separately financed from current revenues while retaining the current old-age insurance system policy design as has been suggested. Unifying pension provisions for wage-based workers. How does the MORIS design create a unifying framework for the diversity of wage-based workers in China? • Civil servants and PSU workers. The proposed MORIS design can readily accommodate PSU and civil servant employees (box 3), thereby facilitating labor mobility to and from the public sector. Past entitlements can be reflected in the notional balances transferred to participants’ notional accounts. Future benefit entitlements that exceed the anticipated replacement rate under the MORIS could be supported by additional benefits structured under the proposed Occupational Annuity (OA) scheme. Legacy costs associated with past entitlements would need to be explicitly financed in the MORIS.
China: A Vision for Pension Policy Reform
45
Box 3
Proposed Pensions for Civil Servants and Employees of Public Service Units
Obstacles to inclusion in the old-age insurance system. An obstacle to the inclusion of civil servant and PSU employees in the old-age insurance system has been the large disparity between the target replacement rates of PSUs (88–94 percent of the standard wage) compared with the old-age insurance system target of 40–60 percent of total wages. Financing arrangements in the existing old-age insurance system have also been in place since 1997 or before, while most PSUs and civil servants have not adopted contributory financing arrangements until more recently, if at all. Moving PSUs from being largely noncontributory to 28 percent combined contribution rates (or less, as proposed) has substantial implications for PSU workers’ financial position as well as net wages after employee contributions. Moreover, such contributions have fiscal implications because funds are supposed to be set aside on behalf of future pension liabilities in addition to paying current beneficiaries. Finally, provisions have yet to be finalized under the EA scheme so that PSU employees can have in place a means of covering all or part of the difference between their current target replacement rates and the income replacement provided under the old-age insurance system. Proposed approach. Both civil servant and PSU employers and workers alike would substantially benefit from modernizing the modalities by which such employees accrue pension benefits. This could happen by maintaining target replacement rates yet changing the modality from either the current noncontributory defined-benefit schemes or pilot PSU provisions, to a combination of (1) benefits from the proposed MORIS and (2) a supplemental benefit from a revised OA scheme. Together these arrangements could ensure promised income replacement while also freeing workers to move in and out of positions in the civil service and at PSUs in accordance with the demand for their skills while not sacrificing pension entitlements. Examples of treatment under the MORIS and OA arrangements. Under the proposed design, income replacement for PSU workers and civil servants could be structured between the MORIS and the OA scheme. For example, the government may decide that it wants to maintain a target replacement rate for all existing PSU workers in a given PSU sector or type. If one supposes the target replacement rate for such workers is 88 percent and if the MORIS would deliver (continued next page)
46
China’s Pension System
Box 3 (continued)
a 55 percent replacement rate, then the worker at retirement could receive the MORIS benefit as well as an OA benefit with a target replacement rate of 33 percent. Legacy costs and transitional arrangements. As discussed in appendix C and below, substantial legacy costs are associated with the past service liabilities of PSU workers and civil servants. Financing such costs will be required whether or not a reform program is undertaken and whether or not PSU workers and civil servants are integrated into the old-age insurance system under the proposed MORIS. Under the MORIS design, fully delivering on past pension promises of PSU workers and civil servants requires the recognition of past service liabilities by translating such benefit accruals into a notional balance, which would be recorded in such workers’ notional accounts (see appendix C). This recognition of past service would work in a way similar to that of other workers who entered the labor force before the establishment of the MORIS. The government would need to explicitly finance the legacy costs associated with past service for these workers. Institutional issues. Inclusion of civil servants and PSU workers into a reformed old-age insurance scheme poses institutional challenges. These include developing the collections, accounting, financial control, information, and remittance systems in government units and PSUs that are compatible with the proposed institutional requirement of the MORIS policy design. China may therefore seek to delay the incorporation of PSU employees and civil servants into the old-age insurance system until such time as the administrative policy and institutional conditions are in place to effectively support such measures.
• It is widely accepted that inclusion of civil servants and PSU workers in the MORIS or an otherwise reformed urban old-age insurance system poses substantial financial and institutional challenges. A key challenge would be to finance the legacy costs associated with past entitlements of these workers. Moreover, future entitlements which may exceed those provided under the MORIS or old-age insurance system would need to be prefinanced through a supplementary OA scheme. Finally, collections, accounting, financial control, and information and remittance systems would need to be established in government units and PSUs that are compatible with the institutional requirements of the MORIS policy design.
China: A Vision for Pension Policy Reform
47
• Migrants. Although efforts have been made to incorporate migrants into the current old-age insurance system, several deterrents to participation remain, namely, a relatively high contribution rate23 and the application of a minimum contribution requirement (see box 4).24 Moreover, the absence of portability results in practice (despite regulations which provide a framework for transfer of entitlements in the urban workers’ scheme) in migrants facing obstacles to fulfilling the 15-year vesting requirements making it difficult for them to collect benefits. Without urban residency, migrants also face uncertainty over whether they will be entitled to receive benefits toward which they may contribute. Most important, many employers and employees alike prefer to avoid the costs of social insurance contributions in an effort to have competitive wages. Together the MORIS and VIRIS would materially improve the participation incentives for migrants. The MORIS would eliminate an effective minimum contribution requirement (28 percent × 60 percent × the regional average wage), decrease vesting to 30 days, and materially reduce
Box 4
Rural-Urban Migrants and Informal Sector Workers
Migrants are a growing proportion of China’s labor force. This increases the importance of ensuring their old-age income security (see figure 3). The proposed policy design distinguishes between migrants with labor contracts who would be covered under the MORIS and those without such contracts who could contribute to the VIRIS and supplementary personal pension arrangements. Proposed urban old-age insurance reforms. Three policy design proposals should make it more attractive for employers to cover migrants with labor contracts under the MORIS when compared with the existing old-age insurance system: (1) financing legacy costs outside the pension system should materially reduce the current contribution rate for workers with employment contracts, including migrants, (2) the minimum wage subject to mandatory contributions should be materially reduced or eliminated (depending upon the size of the Social Pooling NDC), and (3) reduction in the vesting period would remove the disincentive for reporting for short-term workers close to retirement age. (continued next page)
48
China’s Pension System
Box 4 (continued)
Incentive issues. The 2008 labor law requires migrant workers to be included in urban social insurance programs. However, migrant workers apparently in many cases have preferred higher wages in lieu of social insurance contributions. Avoidance of such contributions is one source of labor competitiveness whereby migrants can compete based on lower all-in labor costs. Concerns about portability of pension entitlements also act as a disincentive for mobile workers. The effect can be seen in findings from the 2010 China Urban Labor Survey (CULS) in six provinces which found only around 20 percent participation in the urban workers’ pension scheme by migrants, against an average of around 80 percent for local hukou workers. Proposed VIRIS. Establishment of the proposed VIRIS should create a strong incentive for migrants without employment contracts to contribute toward retirement. Contributions under the VIRIS could be added to those accrued under the MORIS at retirement. It will be particularly important for migrants for the account accumulations from work in different locations to be portable and added together to determine a pension benefit. Institutional reforms are needed regardless of the policy design adopted. These include (1) establishment of a unified data management system that can consolidate benefit entitlements across localities and (2) continued measures to increase the efficiency of record keeping and contribution remittance to limit employer transaction costs.
contribution rates if legacy costs are financed outside the pension system. For migrants without labor contracts, the VIRIS would offer a substantial matching subsidy to encourage pension savings. Voluntary Individual Retirement Insurance Scheme (VIRIS) Motivations for the establishment of specialized retirement savings instruments for nonwage workers. A growing need is seen for pension savings instruments for nonwage urban and rural populations because of the increasing importance of the nonwage work in the Chinese economy. Rural-urban migration will change the demographic profile of rural areas and leave the elderly increasingly vulnerable (see appendix C). Relatively high rural household savings rates among all but the poorest rural households are held in short-term savings instruments, and a dearth of options
China: A Vision for Pension Policy Reform
49
are encountered for managing longevity risks. Although the NRPS and URPS include a savings component with a matching subsidy, additional specialized retirement savings instruments can improve long-term voluntary savings. VIRIS objectives and proposed design. The objectives of a Voluntary Individual Retirement Insurance Scheme (VIRIS) would be (1) to provide a uniform framework for pension savings for nonwage urban and rural residents, including temporary workers, the informal sector, the selfemployed, the unemployed, and farmers; (2) to subsidize a minimal savings level as a means of creating incentives for individuals to save for future retirement benefits; and (3) to support the labor mobility and efficiency through a uniform framework. More detailed design parameters are summarized in table 4, and a more detailed discussion of the rationale and proposed design is provided in appendix D. The VIRIS design is very much along the lines of the contribution provisions in the NRPS and URPS building upon the experience of earlier pilots.25 The scheme would be voluntary, with individual contributions “matched” with a governmental subsidy reflected in employees’ Individual Account statement.26 The matching subsidy would be based on a national framework allowing for a minimum match subsidized by the central government, which could be supplemented from local finances. The scheme would be fully funded, with a rate of return of national GDP growth guaranteed by the central authorities to reduce the risk to contributors from empty accounts. This would align the rate of return on such individual accounts with the notional interest rate applied to the proposed MORIS and facilitate account consolidation at retirement. The target benefit should be at least as great as the regional poverty line and the dibao threshold for individuals and preferably well above both. The purpose of such a minimum target benefit is to mobilize sufficient individual savings matched with government contributions to have a savings fund that protects against old-age poverty. This objective is also reinforced through the CSP which provides noncontributory payments during retirement. The minimum and matching contributions can then be determined based on the minimum targeted benefit level. It may also be useful to consider the target benefit as a proportion of regional per capita income, keeping in mind the trade-off between affordability of the contributions and adequacy of the benefits.27 The proposed scheme would provide an annuitized benefit at retirement based on a worker’s account accumulation. Payout options would
50
Table 4 Voluntary Individual Retirement Insurance Scheme (VIRIS)—Key Parameters
1. Participation and coverage 2. Qualifying conditions
• • • •
Participation voluntary for all nonwage workers not contributing to other pension schemes Actual participation and coverage will depend upon the matching subsidy and other incentives in the design Retirement age: 65 (men and women) Immediate vesting
3. Annuitized benefit
4. Contributions and subsidies
5. Portability
6. Financing, subsidies, and interest rates
7. Management, administration, and oversight
• Benefit formula = benefit level and amortization schedule determined by Individual Account accumulation, projected life expectancy at retirement, and projected indexation • Form of payment = annuitized at retirement • Benefit indexation = the higher of (1) 1/3 national GDP growth and 2/3 national growth of the CPI of the previous year or (2) CPI growth of the previous year • Minimum individual contribution level established by central authorities • Tiered contribution amounts (such as 100, 200, …, 500 RMB per year) • Multiple options for the frequency of contributions (monthly, quarterly, annually) • Matching contribution subsidies from central authorities and subnational authorities • Amount of marginal matching contribution reduced the greater the individual contribution • Account balances can be transferred across localities • Account balances can be transferred to the reformed urban old-age insurance system • Minimum matching contribution subsidies from central government to be established by the central authorities • Additional subnational matching contribution subsidies in accordance with local fiscal conditions • Accounts fully funded with interest rate of national GDP growth, guaranteed by the central authorities • Accounts and fund management responsibility at the provincial level • Central government (MHRSS) would establish an oversight framework to ensure that the scheme operates according to national guidelines
Note: CPI = consumer price index; GDP = gross domestic product; MHRSS = Minister of Human Resources and Social Security.
China: A Vision for Pension Policy Reform
51
depend on the size of the accumulation. Annuities would be computed according to national guidelines that specify the basis for computation of life expectancy at retirement, the projected benefit indexation, and the discount rate applied. An important transition design consideration would be how to handle those workers already at or approaching retirement who will have insufficient time as contributors to generate an adequate Individual Account balance. Figure 10 indicates a stylized annuitized benefit supported by annual contributions of 360 RMB (half presumably from workers and half from the government) for between 1 and 40 years. For older residents with insufficient remaining work years to accumulate an adequate VIRIS account balance, one option would be to provide additional matching contributions, although such subsidies may have adverse incentive effects. In any event, the proposed CSP could provide a safety net for the poorest elderly until such time as the VIRIS matures. Rationale for VIRIS design choices. The proposed matching contribution subsidy is based on Chinese and international experience that suggests that such a subsidy can mobilize long-term savings. Such a subsidy is already part of the NRPS and URPS and has been part of various pension
Figure 10 Stylized Example of Annuitized Monthly VIRIS Benefits Based on Different Contribution Histories
180 RMB benefit/month (2010 constant) 160 140 120 100 80 60 40 20 0
Source: World Bank estimates. Note: Assumes contributions of 30 RMB/month beginning in 2010, retirement age of 65, male life expectancy in 2008 remaining constant through the projection period, real interest rate on account balances 5.0 percent. Projections are in constant real terms.
20
18 20 20 20 22 20 24 20 26 20 28 20 30 20 32 20 34 20 36 20 38 20 40
10
12
14
20
20
20
20
16
52
China’s Pension System
pilots. The policy direction is also consistent with experience in some OECD countries and a new generation of rural pension and coverage expansion programs in middle-income countries. The VIRIS design aims to create strong incentives for retirement savings for nonwage workers. The design therefore aims to create incentives to reduce the coverage gap for urban nonwage, self-employed, or unemployed workers left out of the urban old-age insurance system, migrant workers with weak incentives to contribute to such a system, and rural dwellers who will not be covered under the NRPS. The combined central and local financing of the VIRIS can ensure a more uniform set of incentives nationwide because part of the matching contributions would not be subject to local fiscal conditions. The simplicity in the contribution and benefit design is intended to support the portability of pension savings. The employment of matching contributions (as under the NRPS and URPS) is motivated by several factors:28 (1) The nature of work among farmers, the self-employed, and the informal sector and the variability of employment relationships makes it difficult to mandate participation for these types of workers and suggests that an incentive to set aside their savings in a pension scheme during their working lives is likely to be necessary. (2) An individual account accumulation provides the possibility of crafting rules for selective borrowing of some of the accumulation during people’s working lives in the face of specified shocks.29 Finally, (3) keeping the design simple supports strong implementation, understanding among participants, fiscal planning, and allocation. Determining the appropriate rate of subsidized matching contributions (and hence the fiscal costs) should be based on the anticipated effect such matching contributions will have in mobilizing long-term savings. This will depend on several factors, including available fiscal resources, the elasticity of take-up against different rates of matching, and the interaction of the contributory scheme with other public transfers for the elderly. Almost no robust evidence is available to correlate rates of contribution matching with participation under varying scenarios. For simplicity, a 1:1 match on individual contributions is not uncommon and is proposed as a starting point here. A monitoring and evaluation process can then discern the basis for different levels of savings mobilization that will inevitably result. Table 5 summarizes commonalities and differences between the VIRIS and the NRPS/URPS. The combination of the VIRIS and CSP share many commonalities with the NRPS/URPS, including a shared view that workers are primarily responsible for assuring their old-age income security.
China: A Vision for Pension Policy Reform
53
Although the two proposals share many commonalities, some differences can be identified: (1) The matching subsidy proposed under the VIRIS (perhaps 100 percent of the minimum contribution amount) is higher than the minimum matching subsidy provided for under the NRPS/URPS (30 percent of the first 100 RMB/month). Although the VIRIS proposes a higher matching subsidy during an individual’s work life (compared to the NRPS/URPS), the CSP after retirement is subject to a pension test, thereby reducing the fiscal expenditures when compared to the NRPS/URPS. Such additional matching subsidies provide greater incentives to save when compared to the NRPS/URPS. Moreover, although the NRPS/URPS minimum 15-year vesting period provides savings incentives (to receive the basic benefit), the VIRIS has much stronger savings incentives beyond the 15-year period. (2) Providing an interest rate on VIRIS savings linked to a national index (of national GDP growth) and guaranteeing this rate by the central authorities mitigates the risks for savers and therefore contributes to long-term savings incentives. By contrast, the NRPS/URPS does not have such an interest rate guarantee or financing features. (3) Under the VIRIS, NRPS, and URPS, a key assumption is that a guaranteed minimum level of subsidized matching contribution is needed to establish a credible floor as an incentive for participation. The VIRIS design makes it the responsibility of the central authorities for assuring the minimum matching subsidy, whereas the NRPS and URPS establish the minimum subsidy but leave the financing to the local level. (4) The VIRIS design starts with a prevailing assumption that the nonwage sector should have the same pension savings incentives whether urban or rural. Applying a unified policy framework to everybody with only wage and nonwage distinctions is consistent with the objective of removing artificial differences between target groups (urban/rural). The NRPS/URPS, however, retains the rural and urban residency distinctions.
Occupational and Personal Savings Arrangements
Occupational and personal savings arrangements are an essential part of old-age income protection in China (see appendix E).30 The rationale behind these instruments includes the following: (1) the dramatic aging of the population and increases in old-age system dependency rates suggest that the urban old-age insurance system will be able to provide
54
Table 5 Commonalities and Differences between the Proposed VIRIS Design and the NRPS and URPS Rationale for differences
Fundamental principles
Individual contributions
Collective subsidy and support by local people’s governments
Proposed VIRIS design Same principles as NRPS/URPS and affordability and portability Level of minimum contribution should be calculated as either a proportion of per capita income (rural) or average wages (urban) Same The diversity of economic circumstances in China will make the 100 RMB contribution very low in some places
Central government subsidy: basic pension
Central government subsidy: matching contributions
NRPS/URPS Basic insurance, wide coverage, flexibility, and sustainability Five levels for the NRPS, 100–500 RMB, and local governments can add additional levels. The URPS has additional levels up to 1000 RMB. Village collectives can subsidize individual contributions. For disadvantaged groups in urban areas that have difficulty in paying contributions, local people’s governments should pay a part of their pension contributions or all of their minimum pension contributions. Central government pays full basic pension (central and western areas) and a 50 percent subsidy to eastern areas None A minimum CSP benefit is assured by the central government Central government subsidies are believed to be essential as incentives for contributions by low-income individuals in areas with low fiscal capacity
Subsidy no less than 30 RMB per person per year Same
Local government subsidy: matching contributions Local government subsidy: basic pension
The central government subsidy for matching contributions should be sufficient to finance an annuity for fullcareer contributors with a benefit in excess of that provided by the CSP Local government subsidy is not mandated by the central authorities
Local governments encouraged to increase the level according to the local situation
Individual Account records
Individual pension accounts to be set up for each new rural pension enrollee
Same + record system should be on a common platform with urban old-age insurance. A centralized data management system should manage benefit processing and disbursements.
Coordination of locally managed Individual Account record keeping has proven difficult in old-age insurance and will likely continue to be difficult in the future using that approach
Benefits Individual Account benefit calculation
Applying an annuity factor of 139
Inheritance rights
Indexation
Individual Account balance can be inherited “According to economic development and changing prices”
Retirement age Possibly additional matching contribution subsidies
60
Annuity factor should be periodically revised according to cohort-specific life expectancy rates Joint annuity providing spousal inheritance Proposed indexation formula: The maximum of: 2/3 changes in prices and 1/3 changes in per capita income; or price changes. 65
Formula aims both to ensure retirees against price increases while keeping benefits roughly consistent with prevailing per capita income To align with proposed MORIS and to support benefit adequacy
Transition arrangements: individuals near retirement age
Family binding and buyback arrangements
Fund management
Managed by counties with transfer to higher levels in places with required conditions.
Funds should aim to be managed at provincial level, with financial reporting to central government unified data management system
Note: CSP = Citizens’ Social Pension; MORIS = Mandatory Occupational Retirement Insurance Scheme; NRPS = New Rural Pension Scheme; URPS = Urban Residents Pension Scheme.
55
56
China’s Pension System
only about 40–60 percent of pre-retirement income in the long term; (2) changes in the traditional family structure result in an increasing number of people that need alternative savings opportunities for old-age income protection; (3) voluntary occupational schemes can provide a framework to compensate for the uneven level of benefits between different types of enterprises, PSUs, and civil servants; (4) occupational schemes can enhance the economic efficiency of enterprises and government employers because the structure of the benefits can be tailored to increase the willingness of employers to invest in training and skills development; (5) occupational schemes can create an incentive for labor force participation by older workers as China’s working-age population begins to decline from 2015; and (6) privately managed pension funds can support the development and stability of financial markets, which in turn can be supportive of overall economic development. Although the EA scheme is a notable initiative aimed at motivating voluntary enterprise-sponsored contractual savings, a broader framework is needed to serve the large number of workers inside and outside the formal sector that so far have not been served.31 The 2004 legislation and subsequent amendments provide a basic framework for the operation of enterprise-based occupational schemes but fall short of providing the scope of instruments needed for several reasons: (1) Employer participation and worker coverage remain low because of uncertainty about the design and security of the system and because the tax treatment of savings is uneven. (2) Additional populations that need voluntary savings arrangements include workers in small enterprises and informal, self-employed, rural, and migrant workers. (3) The legal framework for the system is not fully developed and cannot, in its current form, provide an adequate foundation to ensure that the system can be effectively regulated to provide the degree of security for an occupational pension system to flourish. (4) The supervision of the system is not developed, lacks an adequate institutional basis, and lacks sufficient resources. The regulatory and supervisory framework needs substantial strengthening as does the incentive framework to include the issue of tax treatment. The proposed design features for occupational and personal savings arrangements are summarized in table 6 and appendix D. Some of these features are the following: • The schemes should be defined contribution and fully funded to provide a framework for portability of benefits, as well as a transparent means of verifying pension entitlements through account accumulations. • Account accumulations should be fully portable.
China: A Vision for Pension Policy Reform
57
Table 6 Occupational and Personal Pension Arrangements Issue Architecture Funding Tax treatment • • • • • • • • • • • Supervision • Provision/parameters Defined contribution Fully funded Consistent tax treatment (such as EET or TEE see note 32) Tax deductibility up to a cap (percent of income and absolute amount cap) Through individual, employer, and/or employee contributions Withdrawal provisions (lump-sum, phased-withdrawal, and annuities) to be developed Withdrawal should be permitted at a retirement age close to that of social insurance Age of withdrawal linked to individual tax treatment Strengthened regulatory framework for investment management, custodianship, and account management Revision of role, responsibilities, and accountabilities of a trustee; provision of governing standards Regulatory framework and institutional infrastructure supporting a private annuity market to be developed Strengthened supervisory capacity
Financing Withdrawal and annuitization provisions
Regulation
• Account and investment management should be market based to maximize risk-adjusted returns and support essential risk management. • Taxation provisions should be consistent across time (for example, exempt-exempt-taxable (EET) or taxable-taxable-exempt (TEE)).32 • Account balances above a level to be determined should in principle be provided in an annuitized form so that individuals can have a means of managing longevity risks. • Occupational schemes should be positioned to support firms and organizations of all types, including PSUs and civil servants. • A strengthened regulatory framework and supervisory capacity is essential to ensure employer compliance with minimum standards and adequate consumer protection. The current EA provides some of the building blocks for a proposed OA, but substantial strengthening of the regulatory, supervisory, and incentive framework would be needed for the OA to realize its true potential in the reformed pension system. The following principles could be considered for the OA to realize such potential: • Permissible levels of income that can be contributed under the scheme need to be sufficient to provide for a meaningful savings for retirement.
58
China’s Pension System
• Tax incentives need to be clear and consistent across time and limited to mitigate potential regressive effects. • The benefit needs to be perceived as secure and fair by workers and employers, through a complete and coherent set of rules and regulations and effective and reliable supervision. • The design needs to be sufficiently flexible to adapt to varying needs of different enterprises and workers, such as providing more conservative investment portfolios for older workers and providing a framework for savings options for both large and small employers. • The OAs must operate with sufficiently low administrative costs and provide long-term investment returns consistent with alternative savings instruments. Realizing these principles will require various steps to develop both the policies and institutional oversight to support the development of this important instrument. Establishment of an OA framework can play a pivotal role in facilitating the integration of PSU and civil servant workers into a unified urban pension system. One means of such integration is to retain a target income replacement, through the MORIS and an OA. Together these instruments could offer a target income replacement similar to that currently provided. Moreover, although the MORIS would provide a framework for basic income replacement for wage-based workers, targeted income replacement could be adjusted to the compensation arrangements of specific industries and groups of workers. For example, the OA arrangement in the mining sector might target a relatively high replacement rate at a relatively early retirement age.
Overall Design Conclusions
The combination of proposed instruments would strengthen old-age income protection by improving incentives and addressing coverage gaps: (1) The CSP would apply to all qualifying citizens, urban or rural, removing an important level of insecurity and precautionary retirement savings for retirement for many workers. (2) Nonwage workers, farmers, the informal sector, and the self-employed would all have a much stronger incentive to set aside savings until retirement age (through VIRIS). (3) Workers with employment contracts would have a common platform for old-age pensions so that they could navigate between employers across space and time with minimal losses in benefits.
China: A Vision for Pension Policy Reform
59
(4) The instruments are grounded in a common defined-contribution architecture that provides a basis for compiling benefit entitlements across different pension instruments (MORIS, VIRIS, OA). This can provide a much clearer and more transparent idea to workers of their anticipated pension benefit so they can make more rational labor market decisions.
Financing Options Fiscal Costs and Financing Arrangements
Fiscal costs are associated with the current pension schemes as well as with the proposed reforms (see table 7, figure 8, and appendix C). The position of this volume is that the pension system and the broader economy will benefit from making such costs explicit and developing a viable and orderly financing strategy to cover them. Some costs, such as the proposed CSP, are additional for benefits not currently provided. So-called legacy costs (see below) will be incurred regardless of whether or not a reform is undertaken. These costs could be financed from within or outside the contributions to the pension system. Benefit promises for many PSU workers and civil servants are implicit, although not explicitly recognized and financed. Various sources can be identified for financing current or future pension costs. The options for financing different components of the proposed pension system are discussed in turn below. They include (1) contributions, returns on pension reserves, or drawing down reserve stocks; (2) other general revenue sources, such as asset sales, corporate, or individual income taxes (financed from general revenues); (3) dedicated revenue sources, such as a portion of the proceeds from share flotations, as is currently the practice for dedicated financing for the National Social Security Fund (NSSF); (4) prefinancing through alternative fiscal savings vehicles, such as the NSSF;34 or (5) partial financing by beneficiaries through the tax treatment of benefits.
Citizens’ Social Pension (CSP)
The central government could guarantee a minimum CSP benefit and subnational authorities provide additional financing to guarantee any additional benefits as is currently the case for the NRPS and URPS (see appendix A).35 Although the central government would guarantee a minimum benefit, it may finance only part of such a minimum for some provinces. The cost of CSP would depend on the benefit level and the application of a “pensions test” or benefit reduction from alternative
60
Table 7 Description of Pension Costs and Possible Financing Evolution of costs over 30+ years Proposed financing source(s) Central government to finance a guaranteed minimum with local and provincial authorities bearing the costs for benefits provided above the minimum Depends upon benefit level and income threshold applied. Elderly population will grow over time because of demographics, although the elderly poverty prevalence may decrease. Depends upon proportion of age cohorts required to enter into a reformed system Same • Costs incurred regardless of reform • Costs incurred regardless of reform • Proposed alternative source of financing Yes, though the NRPS and URPS have a basic benefit cost already incurred by the central government. Costs incurred only with reform?
Cost description
1. Citizens’ Social Pension
Fiscal costs of CSP (net of benefit reductions from applying a “Pensions Test”)
2. Urban old-age insurance system— MORIS—legacy costs
See text
Current (nonwage) tax revenues— national and provincial
3. PSU and civil servant legacy costs
Costs of accrued rights for PSU workers above the long-term benefit promises under the reformed urban system
For PSUs categorized as dependent upon government financing, the same financing source from which the PSU receives fiscal support; for civil servants, financing from general revenues
4. PSU contributions
For qualifying PSUs, future contributions to reform Costs move from long term to spread over time from short term, brought forward through MORIS and OA contributions. Costs will rise during an implementation period to gradually cover participants. Costs will level off and decline as the working-age population declines over time. In accordance with the worker profile Yes, although cost share between budget and enterprises for PSU workers uncertain Yes, but subsidies to finance matching contributions also reduce the later subsidy requirements for the CSP As for cost evolution Financed according to a similar formula as for civil servant wages
In accordance with the worker profile
Benefits are prefinanced through contributions resulting from the reform
See note 33
5. Civil servant contributions
• Contributions to reformed MORIS on behalf of civil servants • Contributions to an occupational annuity
6. Matching contributions— VIRIS
Costs of matching contributions for participants
Central government finances a guaranteed minimum with local and provincial authorities bearing the costs for benefits provided above the minimum.
7. Occupational scheme contributions
• Contributions on behalf of civil servants and PSU workers • Forgone tax revenue from tax exemption provided
For civil servants and PSUs, by the level of government and sectoral authority responsible
Note: CSP = Citizens’ Social Pension; MORIS = Mandatory Occupational Retirement Insurance Scheme; NRPS = New Rural Pension Scheme; PSU = public sector unit; URPS = Urban Residents Pension Scheme; VIRIS = Voluntary Individual Retirement Insurance Scheme.
61
62
China’s Pension System
income sources. As suggested above, indicative costs estimates in 2010 for a benefit level that provides just enough resources to cover the urban and rural elderly at age 65 in poverty were about 0.11 percent and 0.12 percent of GDP for urban and rural areas, respectively. By comparison, by adopting a benefit level of about 28 percent of the urban average wage (the OECD country average); the urban cost would be 0.75 percent of GDP in 2010, rising to 2.1 percent of GDP by 2040.
MORIS—Financing Legacy Costs
The MORIS design utilizes a pay-as-you-go financing approach, although it will require a fully funded buffer fund to accommodate unanticipated shocks. This compares with the pay-as-you-go financing approach of the social pooling basic benefit of the urban old-age insurance system while Individual Accounts have been partially funded. This volume proposes separately addressing legacy costs. Addressing legacy costs—defining, estimating and planning for their financing—is both an essential part of the proposed reform and worthy of consideration even if the broader reform program is not adopted (see appendix C). In any pension system, the accrued-to-date liabilities must at least be matched by corresponding assets to be financially sustainable. Such legacy costs can be broadly defined as the actuarial deficit of the reformed system and have two main sources: (1) the legacy cost of the unreformed system that would have to be financed in any case, resulting from prior reforms and the move from higher (for older and middle-aged men) to lower benefits for new entrants (new men) and (2) the legacy costs introduced by a new reform as the result of reducing contribution rates and benefit levels for future beneficiaries. To properly assess the scope of the legacy costs to design a viable long-term financing plan, one must be able to (a) estimate the accrued-to-date liabilities,36 (b) estimate the pay-as-you-go assets37 and measure the overall legacy costs that need to be financed against total liabilities, and (c) translate the overall legacy costs into annual financial transfers and establish a financing plan. This volume proposes that legacy costs be financed from general revenues rather than from pension contributions. The rationale behind such a recommendation is the following: • Separately financing legacy costs from general revenues is a means of transferring the financial burden from current contributors to broader sources of fiscal revenues, and because a considerable proportion of legacy costs are associated with benefit promises made before the 1997
China: A Vision for Pension Policy Reform
63
reforms, having current contributors pay for these costs amounts to a substantial intergenerational transfer, which can be moderated and phased through a well-considered financing plan over a period of about 30 years (see below). • Financing legacy costs from outside the pension system would materially reduce contribution rates, thereby substantially improving the affordability of the MORIS or old-age insurance system. • A manageable and fiscally sound plan for financing legacy costs from general revenues can be developed that gradually pays for such costs over a period roughly consistent with the period in which the costs will be borne through disbursement. • Legacy costs associated with earlier entitlements of PSU and civil servant workers would be a fiscal responsibility of the government authorities in any event, so justifiably the legacy costs should also be shouldered from general revenues. If it is assumed that legacy costs are about 80 percent of GDP,38 the initial annual costs would be 4 percent of GDP, declining to zero after about 40 years (see table C.1 in appendix C). The wide range of legacy costs estimates results from the equally wide range of assumed steady-state contribution rates for the new NDC scheme based on a similar range of target replacement rates. The lower the target replacement rate, the higher the legacy costs. Estimates of gross legacy costs depend upon, among other factors, the estimated existing implicit pension debt (IPD) and the expected steady-state contribution rate for the reformed scheme. So, for example, initial estimates of legacy costs under a low IPD assumption range from 44 percent assuming a contribution rate of 25 percent to 89 percent assuming a contribution rate of 15 percent. Similarly, legacy cost estimates under a high IPD assumption range from 56 percent assuming a contribution rate of 25 percent to 113 percent assuming a contribution rate of 15 percent (see appendix C). Such gross legacy costs do not fully translate into additional fiscal costs, even if they are made explicit. The current urban old-age insurance system, civil servants, and PSU schemes already receive government subsidies that are included in these estimates. These implicit and explicit subsidies are of particular importance for the public sector schemes that levied no contributions (state organs, that is, civil servants) or imposed low-contribution rates on participants (PSUs) to finance pension expenditures. As much as 75 percent of the legacy costs for the civil service and PSU schemes are already financed by government revenues.
64
China’s Pension System
The phasing of the legacy costs (how much the costs will be during which periods in the future) is determined by the transition from the old to the new scheme. If the transition is immediate (that is, all active workers are immediately transferred to the NDC scheme), then the legacy costs are front-loaded with the highest value in the first year gradually reduced to zero over approximately 40 years. If the NDC scheme is applied only to new entrants, then the legacy costs are back-loaded, rising initially from small amounts and peaking after about 40 years before gradually being reduced in another 40 years. Moving the entrance cohorts to the new scheme somewhere in the middle—for example, all below the age of 40—advances the peak to 20 years after the reform. The legacy costs can be financed by the government at different levels and could also be shared with workers and retirees. The central government could establish a framework by which it finances a minimum level of acquired rights, and the remainder could be financed by provinces and municipalities. Moreover, the indexation provisions adopted for future benefits will impact the size of the legacy cost and, implicitly, whether and how much current and future retirees bear the burden of financing. Another realistic possibility is an increase in urban old-age insurance coverage resulting from economic growth and better incentives. Such coverage growth can serve as a means of generating the contribution revenue to finance some of the legacy costs. From 1998 to 2008 coverage (measured as the proportion of the urban labor force contributing to the scheme) increased from 39.2 percent to 54.9 percent—that is, 15.4 percentage points. This helped increase the reserves of the urban old-age insurance system from 0.7 percent to 3.3 percent of GDP, or 2.6 percentage points. A rough calculation suggest that over the next 40 years of coverage expansion, additional cash reserves of about 40 percent of GDP or more could be achieved. Legacy costs may therefore be reduced by roughly one-half through anticipated coverage expansion and reform measures that reduce acquired rights. A net legacy cost of about 40–60 percent of GDP over a period of 40 years could be financed in various ways, with the annual fiscal impact posing what would appear to be a manageable fiscal burden.
Matching Contributions for the VIRIS
The cost of financing matching contributions under the proposed VIRIS depends on parameters established and participation in the scheme. Key parameters affecting financing include the match formula and cost sharing with provincial, municipal, and local governments. Furthermore, guaranteeing a rate of return of GDP growth when market instruments cannot yield
China: A Vision for Pension Policy Reform
65
such returns would require another subsidy. Finally, the volume of resources raised under the scheme will profoundly affect the costs of the scheme. It is proposed that the central government would finance a guaranteed minimum with subnational authorities financing the costs for matching contributions provided above the minimum. This approach would establish compatible incentives between the financing strategies of the VIRIS and CSP. The ratio between the minimum matching contribution and the worker contribution and the financing source for such matching contributions should be uniform nationwide (as under the NRPS). Above a minimum matching contribution, the provincial and municipal authorities could have a common framework for providing additional resources, fiscal resources permitting. Above a minimum guaranteed level, it would be up to the provincial and municipal authorities to determine the level of matched contributions. The higher the contribution, the lower the level of matched contribution that should be provided by the government. The matching contributions could be, for example, 100 RMB for the first 100 RMB individual contribution, 60 RMB match for the second 100 RMB individual contribution, and 30 RMB for the third 100 RMB individual contribution.
Occupational Schemes for PSUs and Civil Servants
Four sets of costs are found for PSUs and civil servants: (1) contributions to the MORIS, (2) contributions to supplemental OA schemes, (3) legacy costs associated with current workers, and (4) continuing pension disbursements. As suggested above, legacy costs are now implicit but would become explicit. Contributions to the MORIS scheme would likely be used to pay existing retirees, so those contributions would not have a direct fiscal impact. Finally, contributions to OA schemes would prefund future benefits. Tax receipts could also be affected under the OA schemes, depending on the tax treatment of OA contributions, accumulations, and benefits.
A Reform Process: Cross-Cutting Analysis and Institutional Reform Issues
Translating a broad vision into a policy reform program will require numerous decisions guided by further analysis. These include the following: • The target replacement rate from the mandatory old-age insurance system • The level of income redistribution that the authorities seek to achieve through pensions, including reduction in the geographical income dispersion
66
China’s Pension System
• The desired level of adequacy and affordability of elderly poverty and vulnerability protection in urban and rural areas, respectively • The approach to benefit indexation • A financing strategy, including the approach to legacy costs (see earlier discussion) • The desirability and feasibility of integrating all wage earners into a unified pension scheme and • The institutional framework for achieving the desired policy objectives. Improvements will be needed in the analytical base for ongoing pension reforms. A pension system that meets the criteria established by the authorities will require policy development based on a combination of robust projections of system liabilities, monitoring and reporting of current performance, and rigorous evaluation of current experience and emerging reforms. This could be facilitated through multiple processes, including the following: (1) The development of a more systematic process for monitoring and evaluating pension pilot programs (including, in particular, the NRPS and URPS) and emerging reforms in areas such as portability. A key step to piloting a new policy design or institutional setup is to establish the monitoring framework and evaluation criteria that will determine how successful the design is as well as lead to useful outputs to determine how to adjust or fine-tune the design in accordance with unfolding experience. (2) Strengthening the capacity for actuarial projections to measure longterm financial impacts of pension provisions and evaluate potential refinements to pension parameters. (3) Strengthening the process for data collection and measurement, including data on mortality essential for life expectancy and benefit calculation. (4) Integrating analysis of the impact of pension provisions on labor and financial markets. Such analysis should draw on related recent and ongoing research in China. Achieving national portability will require careful consideration of design and institutional policy options and phasing of the reform process. The 2009 circular from the State Council on the issue provides an important step in this regard. A key choice will be the framework for record keeping and information flows across space, including when, where, and
China: A Vision for Pension Policy Reform
67
how data are consolidated for worker entitlements from several venues: urban and rural, intra- and interprovincial. Facilitation of the policies and institutional requirements for portability include reconciling rights accumulations across space and communicating such entitlements to members. A framework is needed for benefits processing and disbursement at retirement to facilitate portability regardless of whether a central or parallel processing approach is adopted.39 One option that should be considered is the establishment of a central clearinghouse responsible for compiling member contribution and account balance data, thereby aggregating entitlements across space and time. Such a national clearinghouse could act as the channel for data exchange across provinces, provided that a common data model can be implemented nationally and data exchange protocols enforced. It may also be possible in the longer term to centralize benefit processing and disbursements. As an intermediate step, such a consolidated data management system following common national data standards is a pressing need at the provincial level. A framework for pooling contributions and reserves is needed. Pooling contributions and reserves establishes a means of smoothing inevitable disparities in demographic and economic conditions across communities as well as diversifying the risks to members. Provincial pooling is an essential part of the medium-term reform process, as recognized in the 1990s with the establishment of the urban old-age insurance system. Although the NDC design places less urgency on pooling than the current definedbenefit urban pension design, such pooling is nonetheless an important objective to be realized over time. Realizing the insurance benefits of a pooled buffer fund will necessitate guidelines that ensure a fair distribution according to transparent parameters that provide strong incentives for widespread participation. Several conditions must be satisfied to support the integration of PSU workers and civil servants into a reformed old-age insurance system. These include (1) the categorization of PSUs establishing their level of fiscal autonomy,40 (2) establishment of the legal framework for a more robust occupational annuity savings scheme as a means of topping up PSU and civil servant workers’ benefits, (3) creation of a financing framework for past and future benefit entitlements of PSU workers and civil servants, and (4) satisfaction of institutional and operational requirements for integrating with the old-age urban system.41 These financial and institutional challenges may justify postponing the integration of PSU workers and civil servants until conditions are ripe. To promote a smooth transition of PSU workers and civil servants into an
68
China’s Pension System
integrated urban workers’ pension scheme, three options could be considered: (1) phased harmonization of the benefit structure with that of the old-age insurance system before integration, (2) piloting of specific classes of civil servants or other public sector workers for harmonization and/or integration, and (3) only integrating new entrants or younger cohorts or new employees into the integrated urban old-age insurance system. Three areas require improvements in the policy and institutional arrangements for investment management and regulation: (1) short-term liquidity, buffer fund, and medium-term reserve management guidelines and processes at the county, municipal, and provincial levels; (2) investment management, custodianship, trustee relationships, and recordkeeping requirements for management of supplemental occupational annuity and personal savings arrangements; and (3) strengthening the clarity of the mandate of the NSSF to enhance the financing of mediumterm urban pension requirements to enable the NSSF to better structure its investments to match the profile of its anticipated obligations. Establishment of a CSP could proceed relatively expeditiously, provided that financing responsibilities are agreed among the national and subnational authorities. At the same time, reform would need to consider existing and future policies, including (1) the basic benefit provisions of the NRPS and/or the URPS where they are operating, (2) the impact of the minimum target benefit on the VIRIS design, and (3) minimum vesting provisions and redistributive characteristics of the social pooling benefit in the urban old-age insurance system. As the importance of voluntary savings arrangements for old-age income protection increases, so too should the robustness of the regulatory framework and institutional infrastructure for them. This will require a multiyear strategy aimed at development of policies for such arrangements while simultaneously establishing the institutional capacity for supervising such policies. Because voluntary pensions savings arrangements are and will be undertaken by financial intermediaries under other supervisory authorities, the Ministry of Human Resources and Social Security (MHRSS) will need to interface with these authorities. Over the long term, coordinating and potentially integrating income tax and social security contribution collections systems are supportive of achieving the universality of coverage desired. Although many provincial and municipal authorities have already integrated collections, reconciliation of individual income tax and social insurance contributions could also improve compliance over time as more people come into the income tax net. A first step toward this will be ensuring
China: A Vision for Pension Policy Reform
69
a completely smooth interface between the management information systems of the tax and social security authorities. The shift to budgetary management of public pension funds from 2010 is a positive step in this direction.
Conclusion
This volume has assessed the key objectives articulated by the authorities and suggested a design for a medium-term vision of a mandatory and voluntary pension program that seems appropriate to China’s needs and enabling conditions. In developing such a vision, it has paid particular attention to both the principles articulated by the authorities (broad coverage, at a basic level, multileveled, sustainable, and flexible) as well as additional criteria suggested of affordability, predictability, and equity. As China’s economy becomes increasingly developed and integrated, its pension system will play an increasingly important role in providing strong labor market incentives, including the portability of rights. The proposed design is a multipillar approach that essentially provides a basic benefit to ensure against poverty in old age, a mandatory contributory scheme for those with wage incomes, a voluntary retirement savings vehicle for the nonwage sector that provides subsidized matching contributions, and a strengthened framework for voluntary occupational and individual pension savings arrangements to supplement retirement benefits from state-sponsored sources. This is summarized in table 8. The proposed design addresses key reform needs that have been identified: (1) Contributory instruments proposed have automatic mechanisms that adjust benefits in line with anticipated aging, thereby explicitly confronting China’s aging challenge; (2) Sustainability is achieved by (a) proposed reforms that align contributions and benefits, (b) eliminating transition costs with the NDC design, and (c) moderating the target benefit and establishing a pensions test in the CSP to constrain fiscal costs; (3) Coverage gaps resulting in elderly poverty and vulnerability are eliminated through both contribution incentives in the VIRIS and a CSP for all elderly; and (4) The design is aligned with China’s dynamic and changing labor markets by facilitating transparent and portable pension rights and providing a secure and uniform foundation for old-age income security nationwide.
Table 8 Summary of Proposed Design Parameters
70
Target benefit
Rate of return on individual funded or notional accounts Benefit calculation and form Annuitized benefit depending upon individual notional account balance, life expectancy at retirement, notional interest rate; phased withdrawal or lump sums depending upon notional account balance None
Citizens’ Social Pension (CSP) To be determined by the authorities Suggest a minimum benefit of at least the regional poverty line Benefit should be a proportion of the rural per capita income or urban regional average wage Minimum benefit should be greater than the individual dibao benefit Not applicable Annual growth rate of national GDP Annual growth rate of national GDP Annuitized benefit depending upon Individual Account balance, life expectancy at retirement, and notional interest rate; phased-withdrawal or lump sums depending upon account balance None In accordance with the portfolio return
Mandatory Occupational Retirement Insurance Scheme (MORIS) To be determined by the authorities Could be in the range of 40–60 percent
Voluntary Individual Retirement Insurance Scheme Occupational annuity/ (VIRIS) Individual savings product As determined by individual Target benefit should be a sectors, employers, and proportion of the rural per individual contributors capita income or urban regional average wage
Monthly benefit based on national framework; benefit reduced by an adjustment factor for other pension benefits received
Lump sum, phased withdrawal, or annuity according to retiree preferences and account balance at retirement
Pensions testing
Benefit reduced by an adjustment factor multiplied by the monthly pension benefit received from other sources for those aged 65–74 and no reduction for those aged 75 and above.
None
Contributions
None
Based on the target replacement rate—assuming a retirement age 65, in the range 14–22 percent
No limit, but tax deductibility would be limited to an absolute cap and a percentage
Mandatory or voluntary Indexation Minimum (CPI, mix of 2/3 CPI and 1/3 covered wage growth)
n.a.
Mandatory
• Flat minimum amount per year, matched by government contribution • Matching could be scaled to different contribution levels Voluntary Voluntary According to the specifications of the individual product
New and existing benefits would adjust in accordance with a percent of regional average wages (urban) or regional per capita incomes (rural)
Retirement age None Funded
65 for men and women
The higher of (1) 1/3 national GDP growth and 2/3 national growth of the CPI of the previous year; or (2) CPI growth of the previous year 65 for men and women
Vesting period Notional • To be determined by the authorities • Should be consistent (EET or TEE) By MHRSS bureaus at a county, city, and provincial level
None
65 for men and women, phased in over time 1 month
Funding
Noncontributory-budget transfers
Tax treatment
Tax exempt
• To be determined by the authorities • Should be consistent (EET or TEE) By MHRSS bureaus at a county level
Eligibility age lower than for mandatory schemes According to sponsor guidelines Fully funded Individual Accounts To be determined, should be on a consistent basis (EET or TEE) By enterprises and account administrators
Record keeping
By MHRSS bureaus at a county level
71
Note: CPI = consumer price index; GDP = gross domestic product; MHRSS = Minister of Human Resources and Social Security; n.a. = not applicable; TBD = to be determined; see note 36 for an explanation of EET and TTE.
72
China’s Pension System
Although the proposed vision provides a design to work toward for a future pension system, multiple transition paths can be taken toward achieving it; developing and implementing the proposed vision proposed will require additional study and consideration. The following areas have been identified for additional study: (1) quantifying individual rights for NDC Individual Accounts; (2) quantifying legacy costs; (3) establishing a detailed financing framework; (4) establishing a framework and institutional agreement on the portability of rights, including the approach toward data management; (5) establishing transition provisions for specific classes of workers; (6) establishing and strengthening the framework for investment management; (7) establishing the legal and institutional framework for regulation and supervision; and (8) refining pension policy provisions through systematic monitoring and evaluation.
Notes
1. 广覆盖、保基本、多层次、可持续 (Broad coverage, basic protection, mutiple-layer, and sustainable). 2. 保基本、廣覆蓋、有彈性、可持續 (Basic protection, broad coverage, flexible, and sustainable). 3. See Sin (2005, 36). 4. Ibid. 5. The Chinese nomenclature refers to those workers entering the labor force after the introduction of changes to the urban old-age insurance scheme in the late 1990s as “new men,” those workers that have started work prior to the reform but will retire after it is implemented as “middle men,” and those workers that have retired before the introduction of such reform as “old men.” 6. The estimated number of migrants (including family migrants) by the National Bureau of Statistics Rural Household Surveys was over 150 million in 2011, almost doubling the number a decade earlier. See World Bank (2009, 93). Growth in the urban and migratory labor force requires pension policies that can provide old-age income security for China’s increasingly mobile urban population. 7. Although the national guidelines are for combined employer and employee contribution rates not to exceed 28 percent, contribution rates in some municipalities have ranged up to 31 percent. Some municipalities and provinces, however, have lower contribution rates. 8. Provision of benefits at a basic level appears to be consistent with the principle of adequacy in the World Bank’s conceptual framework.
China: A Vision for Pension Policy Reform
73
9. See Cai and others (2012). 10. Ibid. 11. There is widespread international experience with noncontributory social pensions at all levels of country incomes, and the experience in reducing old-age poverty is generally found to be positive. Consistent with the coverage objectives in China, social pensions are an increasingly popular method for helping address the old-age coverage gap in pension systems. Schemes in countries such as Brazil, Bolivia, South Africa, Mauritius, Botswana, and Namibia have been shown to reduce old-age poverty significantly, while supplementary schemes have varied more widely in their targeting and poverty reduction outcomes. See Kakwani and Subbarao (2005) on African schemes; Barrientos (2009) on four developing countries, and Palacios and Sluchynsky (2006) for an international overview. See also Holzmann and others (2009). 12. These benefit levels would apply to both new and existing beneficiaries so that the benefit level would be implicitly indexed to the two respective indices. 13. See Yang, J. (2007), Mi (2007), and Yang, C. (2007). 14. These figures assume a benefit level of 1,200 RMB per year beginning in 2010, or about 4.1 percent of the projected urban average wage. 15. For the purposes of comparison, the reduction was left due to the application of the “pensions test” the same in the two scenarios. Realistically, the cost reduction to the application of the pensions test should be greater in this second scenario because the benefit before reduction is far higher. 16. This includes the urban old-age insurance system, pensions for PSUs, pensions for civil servants, and pilot programs for migrants to urban areas. 17. The 2011 decision by the Ministry of Finance is important in this regard. 18. The simulated results show that the projected pension liability of the baseline scheme is equivalent to 141 percent of 2001 GDP. The system dependency ratio is projected to increase from 16 percent to over 50 percent in about seven years and increase further to 100 percent over a 30-year time span under the pension policy framework adopted in 1997. See Sin (2005). 19. This assumes, however, that the retirement age is increased to age 65 over time for both men and women, and the benefit is indexed at one-third of the growth in regional average wages and two-thirds of the growth in regional average prices and provided that all “legacy costs” are separately financed from resources other than pension contributions. 20. An increase in the retirement age could be phased in at a rate of a six-month increase each year so that women who currently retire at age 50 would retire at age 65 in 30 years’ time. This phased approach to increasing the retirement age eliminates an abrupt impact on specific cohorts.
74
China’s Pension System
21. By comparison, the State Council guidelines for indexation of current old-age insurance benefits are 40–60 percent of regional average wages. 22. A 30-day vesting period is necessary to reduce administrative/transaction costs by employers and by the social security departments. By comparison, although there is no minimum benefit under the current old-age insurance system, the minimum vesting period is 15 years, and the minimum covered wage is 60 percent of the regional average wage. This therefore effectively results in a minimum social pooling benefit of 15 (years) × 1 percent (the social pooling accrual rate) × 60 percent of the regional average wage, or about 9 percent of the regional average wage at retirement. 23. Twenty-eight percent not including other social insurance contributions. The 2008 labor law requires migrant workers to be included in urban social insurance programs. 24. This is generally the applicable minimum wage × the employer and employee contribution rates in a given locality. 25. 新型农村社会养老保险 (The New Rural Pension Scheme). 26. Voluntary participation is essential given the nature of the income volatility for rural workers targeted by VIRIS. This is also supported by international experience, which generally has been poor with respect to coverage of rural workers in contributory schemes in low- or middle-income countries. It would be advisable to have flexibility on the periodicity of contributions within a year to allow for the specificities of rural incomes and access. Such an incentive-based approach (rather than mandated participation) has resulted in high coverage in numerous rural pension pilots in China in recent years. See Palacios and Robalino (2009). 27. For example, if one assumes contributions of 15 RMB per person per month and a one-for-one matching by the government, 3 percent real return on assets, this is projected to yield an annuitized benefit of about 85 RMB per month at age 65 after 40 years of contributions (in present-value terms). Real GDP growth (which could be the basis for the rate of return) has been much higher than this in recent years, so the annuitized benefit could be greater if the notional accounts grow at the rate of GDP growth. A remuneration that is one percentage point higher over 40 years increases benefits by almost 20 percent. 28. See Palacios and Robalino (2009) for a discussion of matching definedcontribution schemes, demonstrating the model and design questions, empirical evidence, and theoretical framework. 29. Some areas of China in existing pilot schemes also allow use of the accumulation as collateral on loans for business activities. Although this is an interesting approach, it carries obvious risks if the share of accumulations pledged is not capped at a reasonable level and is not common practice internationally.
China: A Vision for Pension Policy Reform
75
30. Such thinking dates back to 1991 when the first arrangements for voluntary occupational pension savings were put in place. See Hinz (2007). 31. At the year end 2006, an estimated 24,000 employers and 9.64 million workers (about 6.0 percent of participants in the old-age insurance system) were covered under the EA scheme. See Sin and Mao (2007). Also see Cui (2007) and Chen (2007). 32. “Exempt-exempt-taxable” (EET) means that contributions (up to a ceiling) are exempt from corporate and/or personal income taxation, account accumulations (interest, dividends, and capital gains) are exempt from tax, and distributions during retirement are taxable as personal income at the personal income tax rate applicable. “Taxable-exempt-exempt” (TEE) means that contributions are subject to tax while account accumulations are exempt, and distributions during retirement are exempt from personal income tax. 33. PSU financing is a broader issue of which PSU pension financing is only a part. 34. The mandate of the NSSF is to finance some of the pension liabilities for China’s aging population. 35. This is the framework adopted for the Basic Benefit in the 2009 NRPS. 36. This is a complex task because the accrued rights not yet in disbursement reflect a variety of prior reforms as well as special ad hoc provisions. 37. The pay-as-you-go asset is defined as the present value of future contributions minus pension rights accruing to these contributions. 38. Net of ongoing existing government transfers already in the system. 39. In principle, a retiree could receive a benefit from each of the locations where he or she has worked. With central processing an individual receives a single benefit based on rights entitlements from various locations during his or her work life. Central processing would necessarily require a framework for data sharing, consolidation, and reconciliation. 40. It is useful to note that the five PSU pension reform pilot provinces had faced difficulties in such a categorization, thereby making integration very challenging to date. 41. Institutional needs include the accounting, financial control, and recordkeeping systems associated with moving to become contributory schemes and the institutional foundations for data submission and reconciliation.
References
Asher, M. 2009. “Social Pensions in Four Middle-Income Countries.” In Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers, ed. R. Holzmann, D. Robalino, and N. Takayama, chap. 6. Washington, DC: World Bank.
76
China’s Pension System
Asian Development Bank. 2002. Rural Pension Reform in China. Manila: Asian Development Bank. Barrientos, A. 2009. “Social Pensions in Low-Income Countries.” In Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers, ed. R. Holzmann, D. Robalino, and N. Takayama, chap. 5. Washington, DC: World Bank. Cai, F., J. Giles, P. O’Keefe, and D. Wang. 2012. The Elderly and Old Age Support in Rural China: Challenges and Prospects. Directions in Development Series. Washington, DC: World Bank. Chen, L. 2007. “A Preliminary Analysis on Enterprise Pension and Multiple-Layer Pension System.”. China Economic Research and Advisory Program. 2005. Social Security Reform in China: Issues and Options. Beijing.. Cui, S. 2007. Keynote Speech at Asian Investor Summit. May, Hong Kong. Dollar, D. 2007. Poverty, Inequality and Social Disparities during China’s Economic Reform. Policy Research Working Paper 4253, World Bank, Washington, DC. Dorfman, M., D. Wang, P. O’Keefe and J. Cheng. 2013. “China’s Pension Schemes for Rural and Urban Residents.” In Matching Contributions for Pensions, edited by R. Hinz, R. Holzmann, D. Tuesta and N. Takayama. chapter 11. Washington, DC: World Bank. Drouin, A., and L. Thompson. 2006. “Perspectives on the Social Security System of China.” ESS Extension of Social Security Paper No. 25, International Labour Organization, Geneva. Dunaway, S., and V. Arora. 2007. “Pension Reform in China: The Need for a New Approach.” IMF Working Paper, Asia and Pacific Department, International Monetary Fund, Washington, DC. Frazier, M. 2004. “After Pension Reform: Navigating the ‘Third Rail’ in China.” Studies in Comparative International Development 39 (2): 43–68. Ge, Y., ed. 2002. Research into the Reform of the Pension System in State Institutions and Public Service Units in China. Beijing: Foreign Language Press. Grosh, M., and P. Leite. 2009. “Defining Eligibility for Social Pensions: A View from a Social Assistance Perspective.” In Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers, ed. R. Holzmann, D. Robalino, and N. Takayama, chap. 12. Washington, DC: World Bank. He, J., and L. Kuijs. 2007. “Rebalancing China’s Economy—Modeling a Policy Package.” World Bank China Research Paper No. 7, World Bank, Washington, DC. Hinz, R. 2007. “The New Enterprise Annuities: The Need to Strengthen a Key Element of the Chinese Pension System.” Mimeo, World Bank, Washington, DC.
China: A Vision for Pension Policy Reform
77
Hinz, R., R. Holzmann, D. Tuesta, and N. Takayama. 2013. Matching Contributions for Pensions: A Review of International Experience. Washington, DC: World Bank. Holzmann, R., and R. Hinz. 2005. Old Age Income Support in the 21st Century. Washington, DC: World Bank. Holzmann, R., and E. Palmer. 2006. Pension Reform: Issues and Prospects for Nonfinancial Defined Contribution Schemes. Washington, DC: World Bank. Holzmann, R., E. Palmer, and D. Robalino, eds. 2012. Nonfinancial Defined Contribution Pension Schemes in a Changing Pension World: Progress, Lessons, and Implementation (vol. 1) and Gender, Politics, and Financial Stability (vol. 2). Washington, DC: World Bank. Holzmann, R., D. Robalino, and N. Takayama, eds. 2009. Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers. Washington, DC: World Bank. Hu, Y.-W., C. Pugh., F. Stewart, and J. Yermo. 2007. Collective Pension Funds— International Evidence and Implications for China’s Enterprise Annuities Reform. OECD Working Papers on Insurance and Private Pensions No. 9. Paris: OECD. Jackson, R., and N. Howe. 2004. The Graying of the Middle Kingdom: The Demographics and Economics of Retirement Policy in China. Washington, DC: Center for Strategic and International Studies. Jackson, R., K. Nakashima, and N. Howe. 2009. China’s Long March to Retirement Reform: The Graying of the Middle Kingdom Revisited. Washington, DC: Center for Strategic and International Studies. Jiang, L. 2008. Aging China, Who Pays? Caijing Annual Edition. Jiang, L., M. Dorfman, and W. Yan. 2007. Notional Defined-Contribution Accounts: A Pension Reform Model Worth Considering. Fiscal Reform in China. Kakwani, N., and K. Subbarao. 2005. “Aging and Poverty in Africa and the Role of Social Pensions.” Social Protection Discussion Paper No. 0521, World Bank, Washington, DC. McKinsey Global Institute. 2009. “Preparing for China’s Urban Billion.” Executive Summary. McKinsey Global Institute, Shanghai, China. Mi, H., and C. Yang. 2008. “Basic Theoretic Framework Research on Rural Pension System.” [In Chinese.] Shanghai: Guang Ming Publishing House. Organisation for Economic Co-operation and Development (OECD). 2009. Pensions at a Glance. Retirement-Income Systems in OECD Countries. Paris: OECD. ———. 2011. Pensions at a Glance. Retirement-Income Systems in OECD Countries. Paris: OECD. Palacios, R., and D. Robalino. 2009. “Matching Defined Contributions: A Way to Increase Pension Coverage.” In Closing the Coverage Gap: The Role of Social
78
China’s Pension System
Pensions and Other Retirement Income Transfers, ed. R. Holzmann, D. Robalino, and N. Takayama, chap. 13. Washington, DC: World Bank. Palacios, R., and O. Sluchynsky. 2006. “Social Pensions Part I: Their Role in the Overall Pension System.” Social Protection Discussion Paper No. 0601, World Bank, Washington, DC. Reutersward, A. 2007. “Labour Protection in China: Challenges Facing Labour Offices and Social Insurance.” OECD Social Employment and Migration Working Papers No. 30, OECD, Paris. Salditt, F., P. Whiteford, and W. Adema. 2007. Pension Reform in China: Progress and Prospects. OECD Social Employment and Migration Working Papers No. 53, OECD, Paris. Sin, Y. 2005. “China Pension Liabilities and Reform Options for Old Age Insurance.” Working Paper 2005-1, World Bank, Washington, DC. Sin, Y., and L. Mao. 2007. China Pensions: Hidden Pot of Gold, CLSA Speaker Series. n.p.: Watson Wyatt. ———. 2008. Understanding China’s Pension System—Yesterday, Today and Tomorrow. n.p.: Watson Wyatt. Song, L., and S. Appleton. 2008. “Social Protection and Migration in China: What Can Protect Migrants from Economic Uncertainty?” Institute for the Study of Labor (IZA) Discussion Paper No. 3594, IZA, Hamburg. State Council of the People’s Republic of China. 2008. “Circular of the State Council concerning the Printing and Distributing of the Pilot Reform Plan of the Pension System for Public Service Units Employees.” Guofa No. 10. ———. 2009. “Guiding Suggestions of State Council on Developing New Rural Social Pension Scheme Pilot.” Guofa No. 32, September 4. ———. 2011. “The Guiding Opinions of the State Council on Piloting Social Pension Insurance for Urban Residents.” Guofa No. 18, June 7. Trinh, T. 2006. China’s Pension System: Caught between Mounting Legacies and Unfavourable Demographics. Frankfurt: Deutsche Bank Research. United Nations Population Fund (UNFPA). 2006. Population Aging in China: Facts and Figures. New York: UNFPA. United Nations. 2010. “Population Estimates and Projections.” Population Division, Department of Economic and Social Affairs, United Nations, New York. Wang, D. 2006. “China’s Urban and Rural Old Age Security System: Challenges and Options.” China & World Economy 14 (1): 102–16. Whitehouse, E. 2007. Pensions Panorama: Retirement-Income Systems in 53 Countries. Washington, DC: World Bank. World Bank. 1997. Old Age Security: Pension System Reform in China. Washington, DC: World Bank.
China: A Vision for Pension Policy Reform
79
———. 2005. “Evaluation of the Liaoning Province Social Security Reform Pilot Analysis of Pension Liabilities and Fiscal Implications under Reform Scenarios,” China and Mongolia Department, World Bank, Washington, DC. ———. 2007a. “Urban Dibao in China: Building upon Success,” Human Development Unit, World Bank, Washington, DC. ———. 2007b. “China’s Modernizing Labor Market: Trends and Emerging Challenges,” Human Development Unit, World Bank, Washington, DC. ———. 2009. From Poor Areas to Poor People: China’s Evolving Poverty Reduction Agenda—An Assessment of Poverty and Inequality in China. Washington, DC: World Bank. Yang, C. 2007. “Studies on Rural Social Pension Insurance System in China: Practice, Theory, and Policy.” [In Chinese.] Hangzhou: Zhejiang da xue chu ban she. Yang, J. 2007. “Innovation and Selection of Financing Sources of Rural Social Security.” Developing Research 2. Yu, X., and Y. M. Sin. 2005. “Labor Market and Pension Reform Issues of PSU Reform.” Study on Public Service Unit Reform Background Note No. 2, mimeo. Yuebin, X. 2007. Social Assistance in China: The Minimum Living Standards Guarantee Scheme. Beijing: Institute of Social Development and Public Policy, Beijing Normal University, Beijing.
APPENDIX A
Pension Needs for Nonwage Rural and Urban Citizens
Introduction
This appendix outlines an approach to promoting widespread pension coverage for rural and urban residents who are outside the wage employment sector. It first discusses the development of the Chinese rural pension system to date, including major new initiatives, and then provides a proposal for a national pension scheme for rural and urban nonwage residents that draws from ongoing experience in China and internationally. The New Rural Pension Scheme (NRPS) program announced by the State Council in 2009 (and operational in over 60 percent of rural counties by early 2012) represents a major and welcome push toward the rapid expansion of pension coverage with the aim of full geographic coverage by 2013.1 The approval of a national scheme for urban residents in mid-2011 designed along similar lines to NRPS completes the national framework for expanding pension coverage and for eventual integration of rural and urban resident schemes. Many of the design features of the new schemes reflect lessons from China and other countries. Together, they form a solid base for further development—not only for rural citizens but also for uncovered segments of the urban population. The proposal in this appendix is consistent with the principles of the new schemes as outlined by the State Council.
81
82
China’s Pension System
This appendix is divided into six sections. It first discusses the rationale for a pension system that covers the rural and urban nonwage population; this discussion was informed by an analysis of elderly poverty and sources of support, and demographic trends, as well as international experience with pension expansion. The next section provides a brief summary of the history and lessons from experience with rural pensions in China, followed by a discussion of the 2009 NRPS and the 2011 Urban Residents Pension Scheme (URPS). The appendix then outlines the basic principles that should guide pension scheme design and briefly discusses the integration of urban and rural residents under a single residents’ scheme.2 The following section provides a proposal based on a longerterm vision for a national pension system for the nonwage rural and urban population with two main elements—voluntary individual accounts, in which participation is incentivized through a matching contribution from the government, and a Citizens’ Social Pension (CSP) providing minimum subsistence to all uncovered elderly. This proposal draws closely from the design of the NRPS and URPS programs, although it has distinguishing features that seem worthy of consideration as the Chinese authorities continue to develop their pension system. Both programs and the proposed schemes are discussed in light of relevant international experience. The discussion then moves to transitional issues in the proposed pension system for the rural and urban nonwage population, including the interaction between individual accounts and the social pension. The final section provides conclusions.
Rationale and Expectations
Existing analysis on China provides a solid rationale for greater public intervention in support for the elderly, particularly among the rural population. Table A.1 shows poverty rates by income and consumption measures between rural and urban elderly households. Poverty among the elderly is a much greater problem in rural than in urban areas. The China Urban and Rural Elderly Survey (CURES [2006]), which is a nationally representative sample of elderly, suggests that 19 percent of the rural elderly had consumption levels below the official poverty line, and 29 percent were below the higher “basic needs” line; meanwhile, only 6 percent of the urban elderly are below the “basic needs” line. The poverty gap measure, which provides a measure of the depth of poor households below the poverty line, also suggests a more severe problem in rural areas than in urban areas. Finally, the poverty severity measure picks up the
Pension Needs for Nonwage Rural and Urban Citizens
83
Table A.1 Measuring the Poverty of the Rural and Urban Elderly share of population under the poverty line (percent) Income poverty Head-count Poverty Poverty index gap severity Rural elderly Official poverty line Basic needs line One-dollar-aday line Urban elderly Basic needs line One-dollar-aday line Consumption poverty Head-count Poverty Poverty index gap severity
19.6 28.7 30.3 5.4 3.4
8.3 12.7 13.1 2.0 1.7
4.4 7.3 7.6 1.3 1.2
19.2 28.7 29.2 5.8 5.5
7.5 11.8 12.3 2.7 2.5
4.0 6.7 7.0 1.8 1.6
Source: Cai and others 2012.
effects of inequality among the poor and suggests that severe poverty is also a more serious problem in rural than urban areas.3 Given the access that segments of urban elderly have to pension income as well as family support, it is not surprising that poverty is much higher among the rural elderly. However, it is important to note that more analysis is needed to disaggregate those segments of the urban population presently without pension support. It would be reasonable to expect that they may have a considerably lower welfare level than the average urban elderly citizen. The rationale for public support for the rural elderly is particularly strong. Several factors underlie this rationale.4 First, the rural elderly have been consistently poorer, suffered a higher incidence of chronic poverty, and have been more vulnerable than both working-age households and the urban elderly in China over time. Figure A.1 shows the incidence of poverty among rural households from the early 1990s to the mid-2000s. Households headed by older people are consistently the poorest in rural areas even as poverty head counts among all rural households have fallen sharply. Second, projections for China show that (1) the demographic transition is accelerating and (2) aging and the growth of old-age dependency will be rapid and far more pronounced in rural than in urban areas.5 Figure A.2 illustrates just how significantly the Chinese population will age between 2008 and 2030. The share of population over 60 years of age will double during this period. Moreover, the elderly population as a share of the population starts off higher in rural areas than it does in urban areas, and the gap only widens by 2030. Similarly, the old-age
84
China’s Pension System
Figure A.1 Percentage of Poor Rural Households by Age of Household Head
80
percent of elderly in poverty
1991
1993
1997
60 40 20 0 80 60 40 20 0 25–60 years old 71–80 years old 60–70 years old 80 and above 2000 2004
Source: CHNS various years. Poverty incidence is shown by age of the head of household.
Figure A.2 Trends of Population Aging in Rural and Urban China, 2008–2030
percent of total population over age 60 25
20
15
10 low TFR, medium urbanization 5
Source: Cai and others 2012. Note: TFR = total fertility rate.
dependency ratio will more than double over the projection period, with the gap between urban and rural areas also growing wider by 2030 (see figure A.3). Third, the sources of support for the elderly are highly dependent on families and labor income for those without pension support in rural and urban areas. Sources of support are also very different both between rural
20 0 20 8 0 20 9 1 20 0 1 20 1 1 20 2 13 20 1 20 4 1 20 5 1 20 6 17 20 1 20 8 1 20 9 2 20 0 21 20 2 20 2 23 20 2 20 4 2 20 5 26 20 2 20 7 2 20 8 2 20 9 30
year rural urban
Pension Needs for Nonwage Rural and Urban Citizens
85
Figure A.3 Old-Age Dependency Ratios in Rural and Urban China, 2008–2030 percent
ratio of those age 60+ to those aged 15–59, percent 40
30
20
10
low TFR, medium urbanization
0
Source: Cai and others 2012. Note: TFR = total fertility rate.
and urban elderly and between men and women. Although pensions are the single most significant source of support for the urban elderly, they remain a minor source of support for the rural elderly and are almost entirely confined to former civil servants, military, and village cadres. Even among the urban elderly, less than half cite pensions as their primary source of income; this share is just over a third for elderly urban women. In contrast, labor income is a much more significant source of support for the rural elderly and is the primary source of support for almost 38 percent of the rural elderly (see table A.2). The primary source of support changes sharply among the rural elderly during their sixties. Although informal sources of support will remain important, they will come under increased pressure, particularly for the rural poor. The demand for family support is likely to become acute in coming decades as the old-age dependency ratio rises rapidly. Working-age adults will be under increasing pressure to support a growing population of urban elderly. Thus, the positive effects of rapid growth and rising incomes will be offset significantly by the growing resources required to provide for elderly well-being. In urban areas, analysis suggests that (1) private transfers are indeed responsive to elderly poverty in extended families but (2) the
0 20 8 0 20 9 1 20 0 11 20 1 20 2 13 20 1 20 4 15 20 1 20 6 17 20 1 20 8 1 20 9 2 20 0 2 20 1 22 20 2 20 3 24 20 2 20 5 2 20 6 2 20 7 28 20 2 20 9 30
year rural urban
20
86
China’s Pension System
Table A.2 Primary Sources of Support for China’s Elderly percent Average Labor income Pensions Dibao Insurance and subsidy Property income Family support Other 13.0 45.4 2.4 0.3 0.5 37.0 1.5 Urban Male 18.4 56.9 1.8 0.3 0.5 20.7 1.4 Female 7.9 34.6 2.9 0.2 0.5 52.3 1.6 Average 37.9 4.6 1.3 0.1 0.2 54.1 1.8 Rural Male 48.5 8.1 1.8 0.2 0.2 39.3 2.0 Female 27.5 1.3 0.9 0.0 0.1 68.5 1.7
Sources: National Bureau of Statistics 2005. Percentages indicate share reporting specified income sources as the most significant source of support.
private transfer response is insufficient to prevent elderly poverty where no or very low pension entitlements are obtained from the system and generally low retirement incomes.6 Available evidence from rural areas also suggests that the risks of public transfers crowding out private transfers from family members are not as significant as is sometimes feared.7 Both analyses provide a rationale for public sector intervention to support the elderly not already covered by pension arrangements. Fourth, although savings patterns across China are generally high and remain positive even in old age, they are strongly correlated with household income; the rural poor, on average, are not saving.8 Moreover, concerns have been expressed that many people are saving too much as a precaution against old age, health, and other shocks, thereby contributing to macroeconomic imbalances between saving and consumption. Figure A.4 shows savings rates of rural households across the income distribution in 2003 and 2007. Another comparison of interest is with urban savings behavior. Over the period 1978–2007, the rural household savings rate has been higher in most years than the urban rate, rising from 13 percent to 22 percent over the period and peaking at almost 29 percent in 1999. More volatility is seen around the trend in rural savings rates than for urban households, reflecting the greater variability of incomes in rural areas. In the early reform period, the rural saving rate rose to 22.9 percent in 1984 after successful implementation of the household responsibility system but dropped sharply with the economic recession in the late 1980s to the early 1990s. The savings rate then returned to an upward trend between 1995 and 1999 before leveling out at above 25 percent for four years and then dropping again between 2003 and 2006. The urban savings rate has fluctuated less around a
Pension Needs for Nonwage Rural and Urban Citizens
87
Figure A.4 Rural Saving Rates by Income Quintile
50 40 household saving rates, percent 30 20 10 0 Lowest Second Third Fourth Highest
–10 –20 –30 –40
2003
2007
Source: China Rural Household Survey Yearbooks 2005 and 2008. Saving equals net income minus consumption expenditure.
consistent upward trend since the early 1990s and in recent years, has been higher than the rural savings rate. What is not yet known, in both cases, is the impact of the 2008–09 financial crisis on savings behavior. In light of international experience, the government’s plan to achieve full pension coverage by 2020 is ambitious, though its target of full geographic coverage for voluntary schemes by 2013 appears to be being realized.9 Historically, pension coverage has tended to be closely correlated with a country’s per capita GDP, largely because per capita GDP is correlated with the proportion of the labor force in the formal sector, overall levels of income, urbanization, and the shares of services and agriculture in GDP. Other factors include a history of state socialism, which, in some parts of the world, has left a legacy of relatively high coverage rates. Figure A.5 demonstrates the relationship between the coverage rates of contributory pension schemes and per capita income. Overall, less than 20 percent of the global labor force is covered by pensions—an average that masks massive variation. The rates of coverage in the former command economies are higher than global averages (based on their GDP per capita) as a result of the state’s historical role as an employer. By comparison, China’s coverage prior to the advent of the NRPS and URPS schemes was notably lower than one might have expected based on its per capita income. An important factor to consider
88
China’s Pension System
Figure A.5 Pension Coverage Rate of Active Labor Force, Various Countries, Mid-2000s
120 active members or contributors, percentage of labor force 100 Hungary 80 60 40 20 0 0 Lebanon Ecuador China Maldives Thailand Uganda 10,000 Italy Australia
y = –8E–10x2 + 5E–05x + 0.0337 R2 = 0.7962
20,000 40,000 30,000 income per capita, US$ thousands PPP
50,000
60,000
Source: World Bank forthcoming. China’s coverage rate is for 2008. Note: Coverage rate = contributing or participating members of working age as a percent of the employed labor force.
when weighing the evidence from international experience, however, is the historically low incidence in developing countries of state-subsidized social pension schemes and/or matching defined-contribution schemes (an issue that is discussed later in this appendix). When setting goals for pension coverage expansion, another reference point is the status of coverage among OECD countries, the majority of which have had pension systems for decades, some dating to the nineteenth century. Despite this, very few have attained full coverage (see figure A.6), and the trend has been toward reduced coverage since the 1980s as rates of informal employment have grown. As another point of reference, figure A.7 shows pension coverage rates among the economically active population in Latin America in the 1990s and 2000s. Coverage rates—even in solidly middle-income countries with mature pension systems—generally remain below 60 percent. A second important observation is that pension coverage among the economically active population does not always expand over time but can slip back (as in Ecuador and Costa Rica) or stagnate (as in Chile, Brazil, and Argentina). Experience in Latin America may point to the limitations in expanding pension coverage through funded defined-contribution schemes(which are popular in the region) in the absence of other incentives for informal sector workers to participate. Although a country’s circumstances, administrative capacity, and other factors are undoubtedly important, international evidence suggests that
Figure A.6 Pension Coverage in OECD Countries
100
90
80
70
60
percent
50
40
30
20
10
-
. s a e s a a ico ey ep lic nd ece ry lic nd ny nd nd c d d ay ain en al aly te ali om um ark an tri rg nd ex urk a, R pub ola re nga pub ela rma nla ela Fran rlan ana orw Sp wed rtug It Sta str gd lgi nm Jap us bou rla A m ze M T re e P G u e Ir e Fi Ic e C N d Au Kin Be De S Po H R G th ite xe wit K o ak R h d Ne Lu S v ec Un nite z lo C S U
Source: Forteza and others (2009).
89
90
China’s Pension System
Figure A.7 Coverage among the Economically Active Population, Latin America, 1990s–2000s
80 70 60 percent 50 40 30 20 10 0
Source: Rofman and others 2008. Argentina 1995–2006; Bolivia 1999–2005; Brazil 1995–2006; Chile 1996–2006; Colombia 1996–1996; Costa Rica 1995–2006; Dominican Republic 2006; Ecuador 1995–2006; Guatemala 1998–2006; Honduras 2006; Mexico 1998–2006; Nicaragua 1998–2005; Paraguay 1999–2006; Peru 1999–2006; El Salvador 1995–2005; Uruguay 1995–2006; Venezuela, RB 1995–2006.
achieving wide pension coverage at China’s level of income is possible but will prove challenging and take time. In particular, agricultural and informal sector workers in low- to middle-income countries have historically been unusually difficult to bring into pension systems using the approaches employed in many developing countries. Many common factors contribute to the challenge, including (1) the administrative difficulty of reaching rural workers in low-capacity environments where work is often informal; (2) a lack of understanding and demand among rural and informal workers for pensions due to myopia, low financial literacy, and other factors; and (3) a general lack of financial incentives from governments to induce participation. This underscores the need for innovative approaches that focus on participation incentives for informal and rural sector workers.
China’s Experience with Rural Pensions
This section outlines the evolution of the Chinese rural pension system over the last two decades with a particular focus on recent provincial pilot schemes that have informed the design of the NRPS.10 This evolution
Pa ra Ni gua ca y ra Do g m Ho ua in i c a nd n ura Re s pu bl B ic Co oliv lo i a m bi a Pe Ec ru u Gu ado at r e El mal a Sa Ve l ne vad zu or el a, R M B ex Ar ico ge nt in a Br az Ur il ug Co ua st y aR ic a Ch ile
1990s 2000s
Pension Needs for Nonwage Rural and Urban Citizens
91
can be categorized into three main phases (1) an initiation and expansion phase from 1986 to 1998, (2) a contraction and stagnation phase from 1999 to 2002, and (3) a renewal phase from 2003 to 2009. A new and exciting phase began in 2009 with the initiation and rapid expansion of the NRPS. Each phase is discussed in turn below.
Initiation and Expansion of Rural Pensions: 1986–1998
The initial exploration of rural pensions was set out in the 7th Five Year Plan (1986–1990), which noted that “efforts should be made to study how to establish a rural pension system, launch and gradually expand pilot schemes in line with economic development.” (State Council 1986). This was built upon through county-level pilots led by the Ministry of Civil Affairs (MOCA) in the Beijing and Shanxi provinces, which emphasized mixed financing responsibility between government, collectives, and individuals, with most of the responsibility falling on individuals. This was followed in 1991 by (1) the State Council issuing Document No. 33, Decision on Establishing a Unified Basic Old Age Insurance for Enterprise Employees, which designated MOCA to take the lead on rural pensions and (2) MOCA launching pilots in five counties of Shandong province. There was a clear policy push in the early 1990s to expand rural pension schemes. The various pilots contributed to a major policy document in 1992 from MOCA: Basic Scheme for Rural Pension at County Level (referred to hereafter as Basic Scheme). This was elaborated in a subsequent policy document in 1995,11 which outlined a set of basic principles for rural pension schemes while allowing for variations in specifics by localities: • Schemes were to be voluntary, mainly financed from individual contributions, supported by contributions from collectives at the level of villages and townships, and supported by preferential government policies (for example, tax relief for collectives on contributions). The Basic Scheme set retirement ages at 60 for both men and women, although it was not uncommon in the practices that emerged to set 55 as the retirement age for women. • Following the lead of the urban pension system reform, schemes were to be based on funded individual accounts. • Individual contributions were to range from 2–20 RMB monthly with a matching of 2 RMB by the collective. • Elderly farmers were entitled to receive a pension until death. In cases where they lived less than 10 years after retiring, any balances remaining in their individual accounts could be inherited.12
92
China’s Pension System
• Investments of accumulated contributions were to be placed in bank deposits and national bonds; no direct investments were otherwise allowed. Although portfolio rules mandated investment in low-return investments, the system in practice also committed to a guaranteed rate of return. • Administration was to be by the local bureau of Civil Affairs, and administrative costs would be covered from contributions (with a cap of 3 percent set subsequently). • The oversight and regulation of the scheme was to sit largely with the implementing agency (that is, the MOCA at the county level), subject to the internal controls of the MOF and internal auditing. As a result of this policy initiative, coverage of rural pensions expanded significantly during the 1990s with programs established by the end of 1998 in 31 provinces and 2,123 counties (just under three-quarters of all rural counties). This was also the high point of coverage prior to the 2009 national pilot, with 80.25 million rural workers participating and more than 600,000 pension beneficiaries. However, concerns soon began to emerge about the operation of local schemes and the lack of a sound governance framework; the Asian financial crisis in 1997 served to underscore the need to rethink the program.13 Responsibility for rural pensions was subsequently switched from MOCA to the then Ministry of Labor and Social Security (MOLSS—now MHRSS) in the 1998 administrative restructuring.
Contraction and Stagnation: 1999–2002
As a result of concerns about the effectiveness and sustainability of rural pension schemes, a sharp policy shift occurred in the late 1990s to limit their expansion. The change in the official position on rural pensions was reflected in the 1999 State Council declaration that China was not yet ready for universal rural pensions and that counties should (1) cease expansion of schemes; (2) rectify the operations of existing schemes; and, where possible; (3) transfer schemes to the management of commercial insurers. By 2001, the shift in policy stance contributed to a sharp decline in coverage to just under 60 million participants, with the number stabilizing in the low to mid-50 millions through 2007 in roughly 1,900 counties. Despite this contraction, new participants continued to enter the system and accumulated funds from existing schemes continued to increase, more than doubling from 2000 to more than 41 billion RMB in
Pension Needs for Nonwage Rural and Urban Citizens
93
2007. The number of pension beneficiaries approached 4 million by 2007 as existing schemes matured (see table A.3). The variability of indicators over time is noteworthy, especially during the 1990s. The development of the rural pension system during this phase was characterized by deficiencies that undermined the achievement of policy objectives, including the following: • Coverage was highly imbalanced geographically, with four coastal provinces (Jiangsu, Shanghai, Shandong, and Zhejiang) accounting for approximately 45 percent of total participation and 64 percent of total accumulations. Poorer regions, in contrast, generally failed to attain significant penetration. • Although the policy indicated that participation was voluntary, local level authorities in many cases mandated participation in the face of disinterest from farmers.
Table A.3 Rural Pension Indicators, 1993–2007 No. participants (million) New participants employed in township Total New enterprises year end participants 34.84 51.43 65.94 74.52 80.25 80.00 61.72 59.95 54.62 54.28 53.78 54.42 53.73 51.71
Year 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007
Counties 1,100
Accumulated No. recipients fund (million) (billion RMB) 0.17 0.27 0.32 0.61 1.48 2.70 5.95 9.95 13.92 16.62 19.55 21.61 23.32 25.93 28.50 31.00 35.40 41.20
2,100 2,123 1.84 3.12 4.13 2.24 3.97 2.34 3.06 1.51 0.92 0.67 1.40 0.37 0.29 0.19 2,052 2,045 1,955 1,870 1,887 1,990 1,905
0.98 1.08 1.23 1.98 2.05 3.02 3.55 3.91
Sources: Bulletins of Ministry of Civil Affairs (1993–1997); Ministry of Labor and Social Security (1998–2007); Yearbook of Labor and Social Security (2001–2008).
94
China’s Pension System
• Matching contributions from collectives were often not made and their incidence was highly skewed toward a small number of richer provinces. The privatization of Town and Village Enterprises in the 1990s contributed to the lack of employer matching. As a result, 98.5 percent of matching contributions were concentrated in only five provinces (the four coastal provinces noted above, plus Beijing). • At the local level, concerns were expressed about the concentration of matching funds for cadre members rather than for all scheme members.14 • Compared to the urban scheme, where administrative costs are borne by the government, the 3 percent administrative fee on rural schemes was deducted from farmer contributions, which was considered inequitable. • In many schemes, benefits were unable to be paid in full, with at least 200 counties canceling schemes and contributors being unable to recoup their contributions. Even when benefits continued to be paid, they were frequently significantly lower than expected due to low returns on accumulations. Low returns were partly due to a preponderance of investments in bank deposits with very low rates of interest. The reluctance to invest in higher-return government securities was exacerbated by localized problems with fund management. As examples, Beijing and Hebei lost significant amounts of invested accumulations through the bankruptcy of fund management companies entrusted to invest in government securities. • Supervision of schemes was weak. The MOLSS figures for the end of 2000 indicate about 20 percent of accumulations had been invested in unauthorized assets, including real estate, stocks, enterprise bonds, and nonbank financial agencies. Although the intent of local implementers may have been to increase returns and meet guaranteed return directives, their failure to abide by investment guidelines indicates significant issues in regulation. This was in part a structural problem because local implementers were under the direct authority of local governments, but the scheme, in principle, was under the bureau at a higher level. • Significant volatility was seen in the ratio of guaranteed rates of return, interest rates on investments, and inflation; this contributed to
Pension Needs for Nonwage Rural and Urban Citizens
95
significant negative real returns on accumulations in some periods and the reverse in others (see table A.4). • Pension benefits were very low, with average pension at about 85 RMB per month in 2007. Moreover, benefits were highly variable across provinces and individuals. A general lack of confidence in schemes also resulted in very low contributions in excess of the minimum by farmers. For example, where farmers chose to contribute 2 RMB per month, their estimated pension after 15 years in nominal terms would have amounted to about 10 RMB per month.15 Taking into account inflation and administrative costs, their real benefits would have been even lower. • The planned transfer of administration to labor bureaus was not undertaken in a timely manner (or at all in some areas) with 350 counties not having transferred management by 2007.
Renewal: 2003–2009
Renewed impetus toward a new rural pension system emerged in late 2002 with the CPC Congress, which resulted in new guidelines from MOLSS in 2003.16 This was followed by (1) opinions of the Central Party Committee (CPC) and the State Council at the end of 2005, which were part of the wider commitment on “Building a New Socialist Countryside,” and (2) the 2006 plenary meeting of the 16th CPC, which committed to universal social insurance coverage by 2020. This was enshrined in the new Law on Social Insurance, which underwent two readings in 2009 and was approved in 2010. Between 2003 and 2009, some growth of rural pension schemes was seen, with more than 300 counties in 25 provinces establishing new schemes by the end of 2008.
Table A.4 Rates of Return on Accumulations and Bank Deposits versus Inflation Rate, Various Years percent Indicator (%) Interest rate for accumulation Interest rate: one-year bank deposit in bank Inflation rate
Source: Wu 2009.
1991.1 8.80 8.64
1993.5 8.80 9.18 (10.98 at July) 14.70
1994.1 1997.1 1998.1 1998.7 1999.7 12.00 10.98 8.80 7.47 6.80 5.67 5.00 4.77 2.50 2.25
2007.1 3.15 2.52 (4.14 year end) 4.80
3.40
24.10
2.80
−0.80
−0.80
−1.40
96
China’s Pension System
The rural pension schemes established during this period fall broadly into three types: (1) social pooling plus individual accounts, (2) flat universal pensions in combination with individual accounts, and (3) individual accounts only. In addition, the schemes differed in terms of the financing role of government at the accumulation and payout stages. As a result, effectively five variants were in existence by 2009 when the national rural pension pilot program was announced (and into which such schemes should eventually be merged):17 • Flat pensions plus individual accounts with government financing at the payout stage only. Under this variant, individual contributions went to individual accounts while the government financed flat pensions from general revenues. The most notable example of this model was Beijing after 2005. This was taken a step further in 2009 with revision of the scheme to expand coverage of the rural pension to urban residents not covered by work-related urban schemes.18 • Flat pensions plus individual accounts with government financing: (1) by matching contributions to individual accounts and (2) at the payout stage through the financing of flat pensions from general revenues. This model was seen, for example, in Baoji in Shaanxi province after 2007 (a city where 74 percent of the population are farmers) and in Qian’an in Hebei province. In large measure, this model was the precursor to the new national rural pilot design. • Individual accounts with social pooling, with government financing during the accumulation phase. This model is similar to the urban employee pension system but with lower contributions and lower benefits. This model was typically implemented in regions with high urbanization rates and good fiscal positions, such as Suzhou in Jiangsu province after 2003 and in Qingdao in Shandong province.19 • Individual accounts combined with social pooling with government financing: (1) by matching contributions to individual accounts and (2) during the payout phase. This model was implemented in richer prefectures such as Zhongshan and Dongguan. • Individual accounts only with government matching for contributions to such accounts. This is the simplest design, although it lacks risk pooling
Pension Needs for Nonwage Rural and Urban Citizens
97
of any form. This model was implemented in Yantai in Shandong province after 2005 (a city where 58 percent of the population are farmers) and in Hangshou in Zhejiang province.20 In addition to the above common models, other experiments with rural pensions were conducted, including the “land for pensions” schemes. Wen Jiang county of Chengdu city, for example, allowed farmers to enter the urban pension system under the so-called two give-ups approach, whereby farmers relinquish the management rights on their land and the use of the land on which they dwell in exchange for a pension. Similar approaches were taken in Chongqing and within Guangdong province prior to the expansion of the national pilot. Finally, schemes even in 2012 continue to be under implementation for specific subgroups of farmers, particularly farmers whose land has been expropriated and migrant workers in urban areas. This approach is common in areas experiencing rapid urbanization (even in less developed provinces such as Ningxia) and offers entitlements in the urban system as partial compensation for expropriated land. The discussion above suggests that there was a rich history of experimentation with rural pensions in China in the lead-up to the 2009 national pilot. This is not surprising given the wider commitment of the Chinese authorities to balanced development and development of a rural social protection system. From this experience, various patterns and issues emerge, as is discussed below. (1) Voluntary with incentives. In policy terms, all schemes were voluntary, relying on a mixture of incentives to encourage participation. At the same time, a feature in some schemes (for example, Suzhou and Baoji) was the system of so-called family binding whereby the pension eligibility of older contributors close to retirement age is determined by whether his or her spouse and all adult children contribute to the new system. Opinions differ among local commentators on the merits of this feature, though it has been adopted in the national pilot.21 Apart from this feature, the local rural pension schemes in the 2000s were incentive-driven through the subsidy mechanism although the extent to which any program with sufficiently strong support from the local administration is truly “voluntary,” has been debated. The incentive-based approach resulted in high coverage in various pilots. For example, Beijing’s participation rate rose from 37 percent to 85 percent following an increase in the local subsidy level, while in Suzhou—where government contributions constitute 60 percent of
98
China’s Pension System
the combined total—participation reached 99 percent. The experience in Baoji was a 68 percent participation rate among all farmers, rising to 92 percent for farmers over the age of 45. (2) Retirement ages and contribution requirements. As noted, the prescribed retirement age under the former Basic Scheme was 60 for both sexes, and participation started at age 20. This varied at both ends under the local pilot schemes—with the entry age for participation as low as 16 in Beijing and 18 in Baoji (although it remained 20 in places such as Yantai), and the retirement age set at 55 for women and 60 for men in Beijing, at 59 for both sexes in Yantai, and with no upper-age limit in Baoji. A clear issue here for localities seeking to integrate urban and rural systems was the retirement ages in urban systems, which are typically 55 for women and 60 for men. Widespread practice in local pilots was that 15 years of contribution history were needed to qualify for full benefits (similar to the urban old-age insurance scheme), with the obvious exception of individual account-only schemes where minimum contribution periods are irrelevant. However, some schemes recognized the transition issue and had special treatment for those above age 45. For example, Baoji allowed those over 45 to have a full pension if they contributed until age 60; those over 60 were also entitled, subject to “family binding” (a feature adopted in the NRPS). Some schemes also made provisions for the lump-sum payment of contributions by those without a full contribution history—in some cases at the point of retirement (for example, Beijing and Zhuhai) and in others during the accumulation phase. Other schemes allowed older cohorts to continue to make contributions for up to five years after reaching the normal retirement age. (3) Financing models and sustainability. A key feature of all the local pilot schemes in the 2000s was significant public subsidies, either on contributions to individual accounts, or during the payout phase, or both. This represented a major shift and recognition by central and local authorities that some form of matching was necessary to incentivize participation by rural populations.22 Box A.1 provides information on the experience of India in this regard. This experience has also been addressed in part in the Chinese literature, and
Pension Needs for Nonwage Rural and Urban Citizens
99
Box A.1
Rajasthan’s Vishwakarma MDC Pension Scheme In 2007 the government of Rajasthan, India, introduced an MDC scheme for 20 categories of low-income workers, almost all of them in the informal sector. To be eligible, workers must be residents of Rajasthan, aged between 18 and 50, and not covered by any other provident fund arrangement supported by the government or an employer. Workers who contribute 100 rupees (just over $2) per month for at least 10 months each year will be provided a 1,000 rupee annual match on their contribution, financed by the state government. An annual interest rate is paid on the combined accumulation, which is announced each year and equivalent to the rate of return on the formal sector provident fund (about 8 percent per annum in 2008). This has been designed to provide a benefit at retirement just above the poverty line. At 2010 interest rates, a 30-year-old worker who contributes for 30 years would receive a monthly pension of about 2,000 rupees at retirement at age 60. The scheme does not allow early withdrawals of accumulations. Account holders are provided with an annual account statement. Internet-based individual accounts are opened for each worker in the scheme, and a computer-generated passbook is provided within 30 days, which contains a scanned photo image and the enrollment form of the account holder. The individual is issued a unique identifier at the point of registration using an application called the Social Security Solution (sCube), which allows for portability of the account and for the worker to make contributions at any point in the state. sCube allows online and offline data entry using a variety of options and requires only a half day of training to operate. A strong emphasis is placed on raising awareness of members before and following enrollment using short films, pension comics, interactive pension calculators, and other approaches.
Source:.
general recognition exists of the need for public subsidies to support rural pension schemes.23 Although the large majority of public subsidies have come from general revenues, experiments have also taken place with partial funding from dedicated revenue streams. Zhuhai city pioneered this approach beginning in 2006 by allocating land transaction revenues to total no less than 15 percent of overall contributions to finance a reserve fund
100
China’s Pension System
for incremental pensions and for those who had exhausted their individual account accumulations.24 A major and still unresolved issue was the fiscal sustainability of different local scheme designs. Looking at a national scheme, simulations based on government spending ranging from 1 percent to 2.5 percent of general revenues have been conducted using different system parameters. These analyses indicate that a broad-based rural pension system should be fiscally affordable and sustainable in the aggregate.25 Earlier reports using the government’s own projections indicated a cost of 1.8 percent of fiscal expenditures (about 66 billion RMB) in 2008 for the central government’s portion. However, more work is needed. For example, rural mortality tables on a sufficiently disaggregated basis are needed and can be generated from census data. More importantly, clarity is needed on the financing responsibilities of different levels of government and the variable capacity of subnational levels to meet them.26 (4) Contribution rates and benefit levels. As one would expect, there was substantial variation in local pilots in their structure, absolute levels of contributions, and benefit levels. Most local schemes designated a range on the contribution rate made to individual accounts, often linked to average wages or rural incomes. Baoji had a range of 10–30 percent of average rural income (and planned to lower the base to 5 percent), whereas Beijing had a much wider range—from 9 percent of average rural incomes to 30 percent of average urban wages. Suzhou appears to have been an exception in this regard, with a flat contribution rate and base for all contributors (10 percent of either the rural average income or one-half of the average urban income). Interestingly, at least one Chinese scholar has raised the idea of farmers being allowed to make some contributions in grain—although no such example was found in research for this report—while others have proposed allocating grain subsidies paid to farmers to rural pension schemes.27 With respect to benefits, the practice is emerging of paying close attention to the dibao level and fiscal sustainability when setting benefits for the flat pension portion of schemes. The general rule of thumb appears to be that flat pension benefits should be at or slightly above the average dibao threshold in the locality. Adding
Pension Needs for Nonwage Rural and Urban Citizens
101
funded benefits is anticipated to take total pensions notably above the dibao level. This may vary upward according to local fiscal capacity (for example, Beijing set its flat pension portion at 35 percent of rural average income). For the individual account portion of schemes, the calculation of the payout in local schemes varied. For Beijing and Baoji, for example, the individual account benefit was calculated by dividing the amount in the account at retirement by 139 (the same method used in their urban schemes—which reflects the combined assumptions of a notional life expectancy at age 60 and an assumed drawdown interest rate of 4 percent; this has also been adopted by the new national rural and urban pilots). Although the approach has been similar elsewhere, the actuarial factor used in the calculation has varied (for example, Zhuhai used a factor of 180, whereas in Suzhou it was 120). Such variable practice strongly suggests a need for work on rural mortality tables, ideally at a disaggregated level, to ensure that this portion of the benefit is not exhausted too early or, more likely, if urban mortality rates are being used, exhausted too late. (5) Institutional issues. The experience of local pilots in the 2000s with respect to both scheme administration and fund management demonstrated a degree of continuity, but also the shortcomings in scheme regulation. Overall administration of local schemes remained with the Social Security Bureau, with roles also for villages (collection of contributions and in many cases payment of benefits), townships (consolidation of collections, approval of benefits, and registration), and counties (for general oversight and scheme design). A general improvement also appears to have taken place in computerization of scheme information systems. Within this general administrative structure, a variety of local innovations in administration were found. For example, Suzhou farmers have been able to make contributions directly through banks rather than village officials, and post offices (including mobile facilities) have been used in areas with lower banking penetration. Allowance has also been made in some schemes for the seasonality of farmer incomes, so that schemes such as Baoji made collections only once a year in July or August. With respect to fund management, the Basic Scheme resources had been managed at the county level; local pilots after 2003 have remained similarly managed. Some researchers have suggested the
102
China’s Pension System
city level as the appropriate level for fund management; others have proposed the provincial or even national levels.28 What is clear is that portfolio rules have continued to be very conservative and remain so in the national pilots. Some researchers have proposed establishing reserve funds to cover low rates of return although such funds are more typically used to address fluctuations in returns or the exhaustion of benefits due to longevity in funded systems. The concept of a reserve fund is, in principle, attractive, and actual practice, in places such as Zhuhai, suggests interest.29 The more significant concern going forward is the regulation of the funded portion of the new national schemes. As seen, this was a significant weakness of the old schemes, and even in the mature urban schemes regulation continues to be an area where the capacity of the system remains stretched. (6) Portability between schemes. A range of transition policies existed for local schemes initiated in the 2000s. The first type of transition is from old to new schemes in the same locality. Local practice differed, with areas such as Beijing allowing portability of funded accumulations from old to the new schemes, and others, like the province of Hunan, stipulating that participants must close their accounts in old schemes before starting afresh in new pilot schemes. The second (and ultimately more important) issue is portability between rural and urban schemes (or migrant worker schemes located in urban areas where these exist). This will be critical to reaching the government’s stated goal of an integrated social security system by 2020. The ease with which this can be done has varied according to scheme design and the compatibility of rural pilots with existing urban schemes. In Suzhou, for example, there was a simple 2:1 rule for farmers wishing to transfer their social pooling rights from the rural to urban scheme; this was easily done in Suzhou because the rural contribution base was exactly half that of the urban system. In Beijing, provisions were also made for portability, although this is only done at the point of retirement. If a former farmer accumulated enough years in the urban system at retirement, he or she would enjoy an urban pension (with an allowance for lower rural contributions), whereas his or her urban contributions would be credited to the rural pension scheme if the accumulation period in the urban system was less than 15 years. In principle in all schemes, the funded portion of schemes is easily made portable.
Pension Needs for Nonwage Rural and Urban Citizens
103
(7) Interface of pensions and social assistance. The relationship of local rural pension schemes to various social assistance benefits also merits consideration. The most interesting example is wubao, a social welfare benefit that guarantees an “average” standard of living for people in the so-called three no’s category (no income, no labor capacity, no sources of family support) in which the elderly appear to be significantly overrepresented.30 In some areas, such as Suzhou, wubao recipients had their individual account contributions refunded. For rural dibao, there can be receipt of both pension and wubao because dibao is a household level benefit, which can result in total household income falling below the local dibao line even if a pensioner is in a new scheme. Finally, pensions from local schemes have had no effect on the receipt of the supportive allowance for following family planning policy, although some Chinese researchers have proposed integrating the programs through the use of the family planning subsidy as an additional subsidy toward individual pension contributions (once participants are past child-bearing age).31
Looking Ahead—The New Rural Pension Scheme
Renewed attention to rural pensions has shifted to high gear with the announcement in 2009 of a national New Rural Pension Scheme, which started in late 2009 and aims to achieve full geographic coverage, originally no later than 2020 but in more recent government pronouncements by 2013.32 The diverse experience with rural pension schemes at the subnational level outlined above has offered important lessons for policy makers at the national level, which are reflected in significant measure in the design of the national pilot. The guiding principle of the pilot is basic insurance and wide coverage with flexibility and sustainability. The pilot started in 10 percent of counties nationwide in late 2009, with an initial aim of full geographic coverage in rural areas by 2020. However, the schedule has already been accelerated with a target of 23 percent of counties to be included by the end of 2010, over 60 percent of counties covered by early 2012, and the expectation that all counties will covered by 2013. Initial experience with take-up has been positive, with more than 36 million contributors enrolled in the first few months of implementation by the Chinese New Year 2010 and about 13.4 million people already receiving pensions. This gives an estimated national participation rate of about 50 percent with local participation rates as high as 80–90 percent in some areas, particularly those such as Baoji that already had
104
China’s Pension System
more mature preexisting pilots. Participation has continued to expand rapidly, with around 250 million contributors by early 2012 and around 100 million people receiving pensions under the new scheme. Some key features of the design are the following: • Participation by rural workers is voluntary. • All rural residents over 16 years of age are eligible to participate if they are not already covered in a basic urban scheme. • Participants become eligible for a pension at age 60. • The scheme provides for individual pension accounts with matching contributions and a basic flat pension for workers who, in the mature system, will have contributed for 15 years. The initial value of the basic pension under the scheme is 55 RMB per month, which can be topped up by local governments at their discretion from their own revenues. Individual accounts have a rate of return equal to the one-year deposit interest rate of the People’s Bank of China; benefits are computed by dividing the accumulation at age 60 by 139 (as is done in the urban scheme). The indexation procedure for the basic pension is somewhat vague—to be set in accordance with “economic development and changing prices.” • For those over age 60 at the time the scheme is introduced, they can receive the basic pension benefit provided their children are contributing to the scheme (that is, “family binding”). For those with less than 15 years left before reaching age 60, they should contribute during their working lives and can then make lump-sum contributions to make up any shortfall of contributions for the vesting requirement of 15 years of contributions. • Financing of the scheme comes from a combination of (1) central subsidies to support the basic pension (in full for central and western regions and 50 percent for eastern regions); (2) individual contributions (ranging from 100 to 500 RMB annually at the choice of the worker); (3) a partial match on the individual contribution by local governments of at least 30 RMB per year (independent of the contribution level chosen by the worker) or at a higher rate as shall be determined; and (4) collective subsidies, which are encouraged but not mandated, with no level specified. During the first months of implementation, the practice of
Pension Needs for Nonwage Rural and Urban Citizens
105
contributors was most commonly to choose the 100 or the 500 RMB contribution levels. At the same time, some provinces and counties have allowed for considerably higher contribution levels of up to 2,500 RMB from farmers in some coastal areas. • Fund management for individual account accumulations will begin at the county level, with the aim to shift this to the provincial level as quickly as is feasible. Supervision of funds would be by local offices of the MHRSS. The overall approach of the new pension pilot reflects lessons from international experience and significantly improves on earlier rural pension schemes. The matching of individual account contributions—the so-called matching defined-contribution (MDC) approach—sensibly recognizes the need for incentives for rural workers to participate in pension schemes. In addition, the introduction of a basic minimum benefit echoes the practice of various developed and developing countries that have introduced social pensions for the elderly although the linking of eligibility for the basic benefit to individual account contributions represents an important difference in approach. Finally, the role of central financing reflects lessons from other areas of social policy in China, including health insurance and dibao, which have clearly demonstrated the need for central subsidies to lagging regions if the equity objectives of coverage expansion are to be realized. Although the objectives and broad design features of the rural pilot program have much to recommend them, various issues in the program’s design may benefit from further consideration and closer evaluation as the scheme is implemented. Addressing these issues could help improve incentives, equity, portability, and fund management. The following four issues are discussed further below: • Contribution levels, the degree of subsidy, and participation incentives • Benefit eligibility and levels • Fund management for the individual account part of the scheme • Portability of benefits and system “dovetailing.” With respect to subsidies to incentivize participation, the current match of 30 RMB against the minimum 100 RMB annual contribution is low when compared to emerging practices for MDCs in developing countries (where a 1:1 match is more common). The flat match also acts as a weak incentive for making contributions above the 100 RMB minimum,
106
China’s Pension System
although it has merit from an equity perspective. A further complicating factor is that the assurance of a basic pension after the vesting period of contributions acts as a significant incentive to participate. Overall, there is no international consensus on the appropriate matching rate in MDC schemes. Thus, it will be important to monitor the pilot to see whether the 30 RMB match is sufficient, both in incentivizing participation at the basic 100 RMB contribution level and in terms of incentivizing higher individual contributions. This is a question that can only be answered empirically. The initial limited evidence from survey data suggests that there is significant concentration at the lowest contribution rate. According to a 2010 survey in Chengdu, for example, 46 percent of participants from pilot counties chose the lowest contribution rate of 100 RMB/year while only 8 percent chose the highest rate of 500 RMB/year (Wang and others 2011). A survey on pilot counties in Anhui Province also shows that more than two-thirds of participants chose the lowest contribution rate (Luo 2011) The discussion of subsidies and incentives also raises the issue of the appropriate balance between ex ante subsidies (the matching of individual account contributions) and ex post subsidies (the provision of a basic pension benefit) in the program. Although the current emphasis on the ex post subsidy has the advantage of simplicity, it is less attractive in terms of a mobile rural population. Once the system matures, rural workers who enroll in an urban scheme upon migration would not benefit as greatly from the incentive effect of the ex post subsidy under the current design, where portability of the basic benefit entitlement remains unclear. This may be an important consideration with an increasingly mobile and urbanizing population. Increasing the ex ante subsidy by increasing matching would lessen this possible disincentive effect. An obvious question raised by a shift in the balance of public subsidies from ex post to ex ante is its impact on the poverty alleviation objective of the basic rural pension. If greater public subsidies were shifted ex ante, maintaining a neutral fiscal impact would require a lower basic pension in a situation where the 55 RMB benefit is already below the rural poverty line and could reduce the basic benefit below the average dibao level, which has additional negative incentive effects. This could be dealt with in at least two ways. First, it may be possible to effect a partial benefit reduction of the basic benefit for individuals above a certain income threshold in order to protect the benefit level for poorer elderly people.33 Second, the local level may be able to top up the basic benefit to ensure that it exceeds the local dibao level, though this could not be assured in areas that are fiscally strapped.
Pension Needs for Nonwage Rural and Urban Citizens
107
A second issue that merits consideration relates to fund management. The initial approach of allowing fund management at the county level has a range of drawbacks, including investment risk and the risk that funds are used for other pressing purposes, leaving accounts that are in practice “empty.” Such localized management complicates the provision of portability of account balances for rural workers who move beyond their home counties. In addition, the demographic trends in rural areas suggest that a sizeable reserve fund will likely be necessary in the rural system, the management of which is best done at higher levels. In addition to the drawbacks of subprovincial fund management, the use of the one-year deposit rate of interest as the rate of return for individual accounts is likely to prove problematic over time (as has been the case for urban schemes). Although very secure, such a low rate virtually guarantees a low individual account balance at retirement and thus weakens participation incentives for rural workers. Even given the appropriate desire to limit investment risk, other approaches which better balance risk and return on individual accounts would be worth exploring further (as, for example, Guangdong has started to do on a pilot basis with some of its urban system pension accumulations). The following specific elements of eligibility for the scheme should be monitored and reviewed over time: • Retirement age of 60 years. For the present, this is sensible in its alignment with the urban scheme. At the same time, the aging of China’s population will demand the upward adjustment of retirement ages over time; this should be considered sooner rather than later by both rural and urban systems. A pressing need exists for reliable—and periodically updated—rural mortality tables to assess the appropriateness of the coefficient of 139 in the drawdown phase of individual account balances. The coefficient is aligned with that used by the urban system but should, in principle, be fine-tuned in line with rural mortality trends. Unisex life expectancy tables published by the World Health Organization for China indicate that life expectancy at age 60 is 19.1 years or 229 months, suggesting that the 139 figure is significantly too low.34 This indicates that there is a substantial subsidy embedded in the annuity factor for the individual account pension of about 65 percent of the benefit amount. • Policies for vulnerable groups for whom local governments are expected to pay partial or full individual account contributions. The State Council document leaves this issue open, referring to groups “with paying
108
China’s Pension System
difficulties . . . like those with serious disabilities.” Given the importance of the principle of equity underlying this provision, it would be useful to develop a better defined common policy for persons for whom contributions should be made (and in what amounts). Apart from people with disabilities, for example, would adults in dibao households be included in this provision? Practice appears mixed, with some areas contributing on behalf of dibao households, in whole or in part, while other areas have adopted narrower categories of eligibility (though being in a dibao household appears to be the default trigger for the individual full subsidy in most areas visited by the authors).35 It would also be useful to consider whether the central government should fund—or partly fund—such contributions, perhaps together with local authorities. Although central funding risks local level authorities gaming the system, it could presumably be controlled through clear guidelines on eligible populations and would obviate the risk that poor people in fiscally constrained localities are excluded. • Eligibility of workers with rural hukou who are resident in urban areas but not enrolled in the urban pension system. In principle, the new scheme allows them to participate and to receive local and central subsidies even when resident in cities. It will be useful in monitoring implementation to see how this plays out and to study the policy interactions with emerging URPS schemes. There is some evidence of such behavior from urban household surveys in major capitals in 2010 (Giles and others 2011). Although the central subsidy should, of course, not be affected by the current residence of workers (rather than hukou), the incentives are questionable for local authorities to (1) match individual account contributions and (2) top up the basic pension benefit for workers with local rural hukou who are not currently resident in the rural locality. • The policy anticipates but does not clearly address the portability of pension rights under the new scheme. This is an important issue and should be addressed soon. Portability of vested rights and individual account balances—both across rural areas and between rural and urban schemes—is important given China’s increasingly mobile labor force. The recent national document on the portability of rights within the urban old-age insurance system suggests that the issue has been recognized. Ensuring that portability (both in policy and in practice) in the new rural scheme is aligned with emerging practices in the urban
Pension Needs for Nonwage Rural and Urban Citizens
109
scheme is essential if the new scheme is to achieve its social security and labor market objectives. In practical terms, this will require the rapid development of systems to reliably transfer information and funds across localities. The implementation of the scheme will face four key challenges (on which MHRSS is already focusing) (Dorfman and others 2012): • The first relates to capacity at local levels, particularly at the county level and below. The massive and very rapid expansion of the system will place demands on local-level implementation and delivery capacity. These demands will present real challenges in many areas, particularly in terms of service delivery for participants and beneficiaries. The intention of the government is to introduce rural social security service centers at least down to (and ideally below) the county level. However, existing staffing ratios imply service loads in an expanding system well above those that one would typically observe internationally for similar schemes. At the same time, interesting experiences are emerging from initial partnerships with the banking sector that are helping to spread the administrative burden of managing client contributions and basic recordkeeping (for example, Guangdong province has a general service agreement with the Postal Savings Bank, which collects contributions, maintains individual pension accounts, and is the vehicle for direct payment of pensions). • The second relates to the information systems required to support the new program and to link it to related programs such as New Cooperative Medical Scheme and other localities. The government’s stated intention is to extend the systems to grassroots levels, although this presents challenges for both the capacities of the systems and the training of personnel. Moreover, it risks fragmentation of information systems if not closely managed (although the standardized software from MHRSS should help in promoting greater coherence than has been observed in urban schemes). The standard software has allowed in some provinces the direct management of system-wide recordkeeping at the provincial level by the Social Insurance Administration under MHRSS. • The third relates to the penetration of financial and banking services in rural areas and the impact of implementing the scheme on payment systems
110
China’s Pension System
and the systems of collections for contributions. MHRSS is working actively on this issue in cooperation with national banks for better rural coverage (one example of such a partnership is with the Postal Savings Bank noted above), but even banks with wide coverage do not presently have branches at all townships (an estimated 7 percent of townships did not yet have a bank in 2009). This may be an area where exploring roles for nonbank financial institutions and relying on mobile banking merit further exploration.36 • The fourth relates to the question of being struck. In some provinces (for example, Inner Mongolia and Ningxia), the province has been financing the match, whereas in others (for example, Shandong), the aim is to have matching entirely financed by counties. As stated earlier, the NRPS has many positive and innovative features. At the same time, although the scheme relies on a broadly sensible design and represents a milestone in social policy in China, the issues discussed above identify scope for improvement and further refinement of policy parameters if China’s objectives are to be fully attained. In addition to the NRPS, the national government introduced a URPS in mid-2011 (State Council 2011). The URPS shares almost the same design as the NRPS, with exactly same basic pension level determined by the central government, the same financing design, and the same matching contribution provided by local authorities. The scheme aims to provide minimum voluntary pension savings arrangements to cover the unemployed, other urban workers without employment contracts, and urban retirees without alternative sources of retirement income. Significantly, it is only open to those with local urban hukou, so that migrant workers from rural or other urban areas are not eligible to participate in their city of residence but only their area of hukou registration (whether rural or urban). Survey evidence from selected major cities in China for 2010 confirmed that a proportion of migrant workers reporting participation in pension schemes were in fact contributing to schemes in locations other than that of their surveyed residence (Giles and others 2011). One characteristic that is
Pension Needs for Nonwage Rural and Urban Citizens
111
distinct for the urban scheme is that contribution tiers can range up to 1,000 RMB/year. As with the rural scheme, the URPS comes on the back of considerable experimentation with urban residents’ schemes at the sub-national level during the 2000s. In cities with sufficient fiscal capacity, the expansion in local schemes was based on a design with a combination of an individual account and a basic pension. In some cases (for example, Hangzhou), individual account contributions were matched by local authorities, whereas in others (for example, Beijing), no such match was used. In richer areas, such schemes had often already been merged with ongoing rural schemes to achieve an integrated residents’ pension scheme, in numerous cases with benefit levels that are equivalent between participants with urban hukou and those with rural hukou from the prefecture. Like the NRPS, such initiatives seem to offer promise as vehicles for expanding pension coverage to the nonwage sector and for promoting the vision laid out by policy makers of rural-urban integration. In light of emerging experience with rural and urban residents’ pensions, the following section reviews some core design principles. The section that follows outlines a proposal for pensions for rural and urban nonwage populations, which shares both the goals of the NRPS and the URPS and some of their key features while offering some points of variation in policy parameters that may be worth considering as China continues its efforts to achieve rapid coverage expansion.
Pension System Design Principles
Both in China and internationally, there is consensus that a pension scheme should satisfy the following criteria: • Adequacy—The benefit levels it provides should be sufficient to perform the most basic function of promoting security in old age. • Broad coverage—The system should provide basic protection to the vast majority of workers and retirees, offering the possibility of saving for retirement and life-cycle consumption smoothing, including for those without stable incomes. • Sustainability—The system needs to be designed to make it robust in the face of shocks and demographic trends (the latter is of special concern in China, as was noted earlier). • Affordability—The system should be affordable by the government, individuals, and employers, both in a strict financial sense and, more
112
China’s Pension System
broadly, at a level that does not inhibit labor market efficiency and the economic competitiveness of enterprises. • Multilayered—While perhaps not as axiomatic as the principles above, international experience strongly points to the benefits of diversification of risks during the accumulation and decumulation phases of a pension system, thereby contributing to benefit predictability. Apart from these principles, a further consideration for a pension system for rural and urban nonwage populations is the future integration between urban and rural pension systems and the issue of portability. Although “integration” is unlikely, at least in the foreseeable future, a common design framework is useful to facilitate portability between systems. Equalization of benefits between rural and urban areas is one principle worth pursuing. As has been well documented, mass migration to urban centers has taken place in recent decades, with estimates of the so-called floating population at about 150 million workers, of whom roughly two-thirds were migrant workers from rural areas.37 In recent years, these workers have also tended to stay for longer periods in their destination location, with about two-thirds of migrant workers remaining resident for three or more years. This reflects the long-term trend in the labor market toward greater urbanization; in 2011, China became more than 50 percent urban. In such cases, the need for workers to have their pension accumulations and entitlements move with them—or be “totalized” between different locations so that they enjoy their cumulative benefits from different locations at retirement—is increasingly important.
Proposal for a National Pension System for Nonwage Populations
This section proposes an integrated basic two-pillar pension system for rural and urban nonwage populations that borrows significantly from the design of the current rural and urban residents’ pilots, while suggesting some adaptations that may increase the strengths of the system over time. The two pillars proposed are the following: • A Voluntary Individual Retirement Insurance Scheme (VIRIS) along the lines of the national NRPS and URPS. It would be an integrated scheme covering rural nonwage workers and urban residents. The VIRIS scheme would be voluntary, with contributions made on a monthly,
Pension Needs for Nonwage Rural and Urban Citizens
113
quarterly, biannual, or annual basis. Individual contributions would be matched with a governmental subsidy. The matching subsidy would be based on a national framework allowing for a minimum match, which could be supplemented from local finances. The scheme would be fully funded, with a rate of return guaranteed by the central authorities to reduce the risk to contributors of having “empty” accounts. • A Citizens’ Social Pension (CSP) to ensure a basic level of income support for the rural and urban elderly who are unable to meet basic subsistence needs from contributory pension sources. A key principle of such a benefit would be that it should be set nationally in a common way based on a proportion of the regional average wage (for urban residents) or the regional average per capita income (for rural residents), thus providing a comparable level of income support above a basic subsistence level (proxied by the dibao threshold or poverty line in rural areas). The combination of these two pillars shares a similar set of objectives with the current NRPS and URPS, although with less stringent eligibility criteria for the CSP relative to the basic pension in NRPS and URPS. The proposed structure would primarily seek to provide an enhanced safety net for the elderly with inadequate or no participation in the urban oldage insurance scheme at a stage in their lives when they will have decreasing capacity to generate income and, hence, to mitigate old-age poverty. Second, it would provide incentives for nonwage rural and urban people to save during their working lives for their retirement. Third, it would provide greater uniformity of pension arrangements across space, thereby facilitating the aggregation of pension savings and labor mobility between rural and urban areas. A key starting point for design of any pension system is the target benefit level that the system would aim to provide retirees after a lifetime of work and long period of contributions. The target benefit level should consider the combined pension from both an individual’s account and the social pension, as well as anticipated voluntary family savings. Policy makers should consider how the target benefit level might vary across cohorts and among persons with different contribution histories. The target benefit level could be the poverty line or some other threshold, such as the dibao threshold or the dibao threshold plus some amount, to ensure incentives to contribute. The target benefit level should in principle be indexed or set relative to per capita income. Options for the relative contribution of
114
China’s Pension System
the VIRIS and the CSP to achieving this targeted level of income replacement are discussed later. Following the lead of the individual account design in the NRPS and URPS, the proposed model for the VIRIS is an MDC scheme whereby nonwage rural and urban worker contributions to individual accounts are incentivized by a matching contribution from government.38 The contributions would be voluntary and flat, as in the NRPS and URPS, but benchmarked against average urban wages and rural incomes in the area. Benefits would take the form of an annuity for those with adequate accumulations. As with the NRPS and URPS, the objectives of the VIRIS would be to (1) provide a uniform framework for pension savings for people in the nonwage sector in rural and urban areas, including those migrating to urban areas and rural areas where they do not have hukou, (2) subsidize a minimum savings level as a means of prefunding future retirement benefits, and (3) support labor mobility through a uniform framework. The proposed approach is motivated by the same concerns as the current individual account portion of the NRPS and URPS. First, the nature of work for nonwage and variable employment relationships makes it difficult to mandate participation. Second, the uncertainties and volatility of nonwage income generates high levels of precautionary savings among households primarily dependent on such income. Thus, creating incentives for such workers to lock up their savings in a pension scheme is likely to be necessary. Third, an individual account accumulation creates the opportunity to craft rules for selectively using accumulations during people’s working lives in the face of specified shocks.39 Finally, keeping the design simple—a flat rate contribution and a 1:1 match with a standard subsidy from the central government to provinces, for example—facilitates implementation, is easily understood by farmers and informal sector workers, and supports fiscal planning and allocation. The following paragraphs discuss the design issues of the VIRIS in more detail.
Design Issues in the VIRIS
Voluntary participation. Given the nature of nonwage employment, making the VIRIS voluntary is sensible for a variety of reasons, including (1) the volatility of nonwage incomes, (2) high discount rates among rural and urban self-employed and informal sector workers, (3) traditional mistrust of government savings schemes, and (4) a history of low or negative real rates of return on savings. In addition, it would seem advisable
Pension Needs for Nonwage Rural and Urban Citizens
115
to have flexibility on the periodicity of contributions within a year to allow for the specificities of rural and informal incomes and to facilitate access. Such an incentive-based approach (rather than mandated participation) has resulted in high coverage in the NRPS and URPS in recent years. A voluntary approach is also consistent with international practice. Matching subsidy. Offering a matching subsidy in the NRPS and URPS represents a major shift and recognition by authorities that incentives are needed to attract the participation of rural and urban nonwage populations. The policy direction is also consistent with experience in many OECD countries and in middle-income countries such as Brazil and Mexico, as will be discussed further later. The need for incentives has been addressed in the Chinese literature, and the move toward public subsidies for rural pensions has generally been supported.40 Determining the appropriate rate of matching subsidies by the public sector (and, hence, the fiscal cost of the match) is not straightforward; the performance of the new schemes should be closely monitored to select the most appropriate match in the medium term. This will depend on several factors including available resources, the elasticity of take-up against different rates of matching (see figure A.8 for illustration of this relationship), and the interaction of the contributory system with other forms of public transfers for the elderly. Despite the widespread existence of matching fully funded pension schemes, virtually no robust evidence relates rates of matching with participation in different settings. Too low a match will create insufficient incentive for participation. Too high a match will create a fiscal burden that is larger than necessary. A related question is whether the match should vary as a function of the level of individual contributions or should be flat, perhaps based on some share of average rural income or urban wages in the area. This involves a trade-off between equity and fiscal concerns, on one hand, and the relative strength of incentives to contribute above the minimum rate, on the other. The evidence on savings behavior in China suggests that concerns about incentivizing savings for retirement may be less acute than they are in many countries, thus strengthening the justification for focusing on the lower end of the income distribution that may be vulnerable in retirement. Although no strong evidence exists to suggest an optimal MDC matching rate, simulations are instructive. Palacios and Robalino (2009) estimate that an MDC approach can be cost effective provided that (1) the take-up
116
China’s Pension System
Figure A.8 Take-up Rate and Matching Contributions
1 take-up rate (fraction of targeted group) 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.5 1 1.5 2 2.5 3 matching level (proportion of individual contribution)
Source: Palacios and Robalino 2009. The take-up rate is defined by TR=exp(z)/(1−exp(z)), where z=−3.45+b×(0.05×m)/0.5, where b/100 is the take-up rate matching elasticity and m is the level of matching. In this example, 0.05 refers to the contribution rate expressed as a share of average earnings and 0.5 is the income of the plan member relative to average earnings. The parameter −3.45 was calibrated to reproduce a take-up rate of 3 percent when m=0.
elasticity = 0.35
elasticity = 0.15
elasticity = 0.025
rate/matching elasticity is not too low (below about 0.15) and (2) individual contribution rates are not too low (below about 5 percent of average earnings). Overall, this study suggests that matching rates should not be below 0.5 and could aim to match 1.0 in contributions.41 These findings must be interpreted with caution, however, as much of the evidence on matching comes from voluntary urban enterprise occupational schemes and the 401(k) experience in the United States, which may have limited international applicability. General revenues are generally the preferred source of funding for the matching subsidy (and are the financing source for the NRPS and URPS) although experience exists in China and internationally of using earmarked revenues to provide partial funding. Brazil’s rural social pension program, for example, is funded from an earmarked rural employer tax of 2 percent. In China, Zhuhai city pioneered the use of land transaction revenues, beginning in 2006, to finance a reserve fund for incremental pensions and for those who have exhausted the accumulations of their individual account.42
Pension Needs for Nonwage Rural and Urban Citizens
117
A clear decision should be taken on which level(s) of government (national, provincial, municipal or county) should finance matching contributions for individual accounts. The higher the level of financing, the lower is the risk that the matching contribution could be reduced or limited because of local fiscal circumstances. However, this must be balanced against the practicalities of matching in an environment where contributions will vary across and within provinces (and hence be potentially complex for the national government either to determine the matching funds, or to provide a flat match that would result in variable relative incentives across space). In an effort to finance a uniform national subsidy, the central government may place more weight on the flat portion of a future integrated scheme. In this light, it is recommended that matching funds come from the provincial level or below, with the central government contributing a minimum matching contribution. Another important question is whether to mandate employers and collectives to contribute to matching individual contributions in cases where such an employment relationship exists. Although this may well be desirable in principle—and would provide closer parallels with the urban old-age insurance scheme—the experience of previous rural schemes suggests that it may not be realistic.43 The NRPS allows for such contributions but does not rely on them to the degree that some schemes did in the past. A final important question is how to set the level of contribution. Based on experience with the NRPS and the desirability of establishing a common social policy framework, it would be sensible to set contributions at a uniform percentage of the regional average rural income (for rural populations) and the regional average wage (for urban workers), subject to a national floor to ensure some minimum protection in old age. This already appears to be happening to some extent in the national rural pilot counties and urban resident schemes, although average contribution levels vary widely. These percentages should be based on simulations where contributions and retirement ages are varied, benefits are assumed to be indexed to inflation in retirement, and separate mortality tables are applied to rural and urban populations. The values chosen should be set such that they generate levels of income replacement that satisfy the social policy targets established by the authorities. Benefit amounts and payout. Vesting requirements for individual accounts are probably unnecessary if such accounts are delinked from
118
China’s Pension System
receipt of a basic benefit as suggested by this report.44 However, the question remains whether a maximum age should be set at which people can begin to participate in the VIRIS. The arrangements used by previous local schemes are not particularly informative in this regard. Given this, the authorities might consider giving persons with small account balances at retirement a lump-sum payout rather than an annuity. More broadly, important questions exist regarding how to treat those who will not contribute long enough to generate a reasonable pension from their individual account and, hence, regarding the interaction between the individual account and the CSP (discussed further below). As is the case for the NRPS and URPS, the benefit amount generated from individual accounts should be determined based on an individual’s account balance at retirement. The formula for computing benefits for those who are in the scheme long enough to generate a reasonable pension must be determined. Of key importance are having current and accurate rural and urban mortality tables, preferably based on the 2010 census and on disaggregated data at least to the provincial level. As discussed earlier, significant variation has been observed in how benefits have been computed under previous rural pension schemes in China. Beijing and Baoji divided individual account balances at retirement by 139 for those retiring at regular age, Zhuhai used a factor of 180, and Suzhou a factor of only 120. Although 139 has been adopted by the NRPS and URPS (resulting from the combination of a conditional life expectancy at age 60 and an assumed drawdown period interest rate of 4 percent), this may need closer review as the schemes achieve wider coverage and mature. Currently the average mortality figures for China discussed above suggest that there is a substantial implicit subsidy in the current schemes. This could be addressed by use of updated and separate urban and rural mortality tables. As is the case for any funded scheme, the retirement age should be left to individual choice, although the age of eligibility for the CSP will influence individual decisions. The key determinant of the real value of the VIRIS pension will be the rate of return earned on contributions during the accumulation phase. Figure A.9 presents a simulation of the benefit level from an individual account based on a total annual contribution of 360 RMB in present-value terms (just under three times the current minimum combined contribution from the individual plus a government match) and based on the assumptions that (1) the scheme is launched in 2010, (2) rural mortality remains unchanged, (3) the retirement age is increased (to age 65), (4) benefits are price indexed, and (5) other assumptions as
Pension Needs for Nonwage Rural and Urban Citizens
119
Figure A.9 Stylized Example of Annuitized Monthly Benefits Based on Different Contribution Histories
180 160
RMB benefit/month
140 120 100 80 60 40 20 0
Source: World Bank estimates. Note: Projections are in constant real terms. Key assumptions: (1) contributions of 30 RMB/month beginning in 2010, (2) retirement age of 65, male life expectancy (2008) remaining constant through the projection period, (3) real interest rate on account balances 5.0 percent, (4) price indexation, (5) the wedge between real rate of return and real wage growth is −1 percent over the first 10 years and 1 percent afterwards, and (6) the scheme begins in 2010.
described below the figure. The figure underscores the relatively modest individual account accumulation that will likely result under this set of plausible assumptions with a retirement age that is notably higher than that presently used in the NRPS and URPS. Of course, the national pilots’ total replacement rates will not be based solely on benefits paid from individual accounts, but the example underscores the importance of ongoing consideration of the total replacement rates that the authorities will seek from their rural and urban residents’ schemes and the contribution toward this level of income replacement that can realistically be expected from individual accounts under the current minimum required contributions and government match. The other crucial determinant of benefits from the VIRIS is the assumed retirement age. In principle, any age could be chosen in a new scheme, but it is important not to make the age too low because doing so will reduce the levels of income replacement it can provide. To this end— and consistent with proposals for the urban scheme—an age of 65 years old has been assumed. A gradual transition to this retirement age should be undertaken over time, as is proposed in the other appendixes for the urban workers’ scheme.
1 20 0 1 20 2 1 20 4 1 20 6 1 20 8 2 20 0 2 20 2 2 20 4 2 20 6 2 20 8 3 20 0 3 20 2 3 20 4 3 20 6 3 20 8 40
20
120
China’s Pension System
It may also be desirable in the medium term to permit account holders to borrow a portion of their VIRIS account accumulations at a specified interest rate and with legally binding repayment conditions. Eligible conditions might include the purchase of a home, certain types of health care costs, or educational costs for children. In some systems, including 401(k) accounts in the United States, such “borrowings” are repaid at a designated interest rate by the individual. In other schemes, loans simply reduce the total accumulated balance. Given the volatility of nonwage incomes and the economic conditions of residents who work outside the formal sector, the opportunity to borrow from one’s individual accounts would be an attractive feature of the scheme; consideration should be given to how such a feature would be structured. Rules for payouts would also need to be developed. The options include annuitization, phased withdrawal, and lump-sum payouts. Previous rural schemes have used phased withdrawal; this would be adequate for the foreseeable future, but authorities should look toward eventually providing annuities instead. The lump-sum option, however, is likely to be important for the transitional generation (as is discussed further below). Some previous rural schemes in China provided for the lump-sum repayment of contributions to those without full contribution histories. In some cases, the repayment was made at the point of retirement (for example, in Beijing and Zhuhai), and in others, during the accumulation phase. Others have also given older cohorts the option of continuing to make contributions for up to five years after reaching the normal retirement age. Notional or fully funded accounts for VIRIS? A bigger picture question on the proposed VIRIS is whether the funding of public subsidies for individual accounts should be actual or notional.45 The issue of investment rules for the VIRIS is not simply one of likely rates of return. If investment of accumulations is restricted to bank deposits at fixed interest rates—as has been the case in urban and most pilot rural schemes to date—the more fundamental question becomes whether funded individual accounts or notional accounts are the preferred funding approach. The relative attraction of actual versus notional funding depends on a few key factors. The first is the investment rules (to include consideration of possible guarantees for rates of return) for the VIRIS. If investments are constrained to fixed interest deposits in public sector banks, the difference in risks between funded and NDC accounts is
Pension Needs for Nonwage Rural and Urban Citizens
121
significantly reduced, yet the return may be insufficient for benefit adequacy. Second, the policy choices for the future of the urban system may be relevant, given the government’s desire for greater harmonization of urban and rural pension systems over time. If the urban system moves to an NDC design in the future, the attraction of notional funding for subsidies on individual accounts is increased. Counterbalancing these factors, however, are two significant issues that are specific to the proposed VIRIS. First, one finds a lack of awareness among farmers and urban nonwage populations of the NDC concept and natural skepticism given past scheme performance on the promises of pension schemes that are not funded—“real money” would be a more intuitive concept for farmers and urban nonwage populations. Second, and even more importantly from a structural viewpoint, the demographic transition in urban and more particularly rural areas in the coming decades would argue against an NDC approach. On balance, therefore, it makes sense to pursue a fully funded approach to VIRIS. Investment rules, management, and the regulation of contributions. The rules governing the investment of accumulations will have important repercussions for the level of income replacement the VIRIS will provide. Experience thus far with rural and urban pension schemes in China suggests that this is a key vulnerability in terms of a scheme’s ability to provide adequate benefits at retirement. At this point an appropriate governance and investment management framework for rural or urban residents’ pensions is lacking. Low and volatile returns on contributions in rural pension schemes have been one of their greatest weaknesses to date, a vulnerability shared by China’s funded urban schemes. The People’s Bank of China requires investments to be made in one-year time deposits, which have generated low real returns over the past decade (on the order of 1–2 percent in the urban individual account system), far below both rural and urban income growth. At the same time, understandable reluctance is found on the part of policy makers to expose rural and urban nonwage populations to significant investment risk, given their general lack of financial sophistication and the underdeveloped state of governance. An alternative—and in the view of this report preferred—approach would be for the central government to guarantee rate of return on the VIRIS accounts. This guaranteed rate could be set at the equivalent of the NDC rate of return in the proposed MORIS (that is, national GDP growth). This would offer a workable compromise between the competing objectives of security and the adequacy of returns.
122
China’s Pension System
Although it may be too complicated at this stage, an option for the future is to allow for different investment rules for different cohorts of workers participating in the VIRIS scheme. For older workers, having conservative investment rules make sense in terms of limiting exposure to market risk and volatility and their lower degree of financial literacy. However, for younger workers, the compounded effects of low rates of return on conservative investments rules are likely to be large, and their extended contribution histories will allow for the averaging of market volatility across their life cycle. The authorities might consider using agebased portfolio default rules that provide for more aggressive investment for younger contributors that gradually become more conservative over the life cycle to focus on preserving the value of accumulations at retirement. Another question that merits consideration is whether a reserve fund is desirable. Such funds are more typically used to address fluctuations in returns or the exhaustion of benefits due to longevity. In principle, the concept of a reserve fund is attractive, and practice in places such as Zhuhai indicates interest within China.46 The management of funds in individual accounts and the appropriate level of the system for doing this merit consideration. Current pilot schemes and past practice have generally involved management at the county level. However, there are clear advantages in combining funds from localities into a single pot of money that can be managed at higher levels to generate economies of scale in fund management. Experience with rural pensions thus far cautions against localized management and investment of accumulations. A sensible option would be to have funds in rural individual accounts managed by the National Social Security Fund (NSSF), although considerable preparation would be required for the infrastructure to record and remit balances to NSSF and make transfers back to paying authorities as the system matures. More specifically, the new scheme could put the public subsidy for individual accounts into the NSSF and contributions in the Agricultural Bank of China, the Postal Savings Bank, or other suitable financial institutions, with a uniform interest rate announced nationally and recorded into individual account passbooks. Although the option of contracting out fund management to authorized asset managers might be considered in the longer run, this would require a much stronger regulatory and accountability framework than exists presently.47 With respect to the regulation of VIRIS, presently there is inadequate capacity; this has been an ongoing weakness of rural schemes in China.48 In addition, existing capacity to regulate even urban schemes is stretched.
Pension Needs for Nonwage Rural and Urban Citizens
123
Thus, it would seem desirable to not create new institutions for regulating VIRIS, but rather to build upon and strengthen capacity in the existing urban old-age insurance institutions to expand to non-wage workers in rural and urban areas. This also raises the issue of critical mass in regulatory capacity. Portability between schemes. Transition issues will become important as the NRPS and URPS schemes mature. The first type of transition is from old to new rural and urban resident pension schemes within the same locality. Practices in China have varied, with areas such as Beijing allowing portability of funded accumulations from old to new schemes, and others like the province of Hunan stipulating that participants must close out their accounts in old schemes before starting afresh in new pilots.49 The national schemes appear to allow transfers of balances from prior schemes. The second (and ultimately more important) issue is portability between rural and urban schemes. This will be critical to reaching the government’s stated goal of an integrated social security system by 2020. The ease with which this can be done has varied according to scheme design and the compatibility of the national rural and urban residents’ pilots with existing urban schemes. If a former farmer has accumulated enough years in the urban residents’ or workers’ systems at retirement, he or she will enjoy an urban pension (with an allowance for lower rural contributions), whereas his or her urban contributions will be credited to the rural pension scheme if the accumulation period in the urban system is less than 15 years. In principle the funded portion of all schemes is easily made portable. The MDC design adopted in the NRPS and URPS schemes—and also proposed here—has no social pooling in a strict sense, though how to allow for the totalization of contribution histories across space in the case of the NRPS and URPS would need further attention. Having a funded portion in the VIRIS scheme may play a useful role for workers who move either to areas where they do not have hukou and/ or across rural and urban areas. In principle, it should be straightforward to transfer balances from one scheme to another in the funded portion through totalization agreements between schemes. This raises the question, however, of whether to also consider the option of pooling VIRIS accumulations in the provinces and to combine fund management. Such an approach has merit, although it may require greater coordination than is possible in the short run. The issue of portability raises a host of design and implementation questions that will need to be closely considered during the pilot phase
124
China’s Pension System
of the VIRIS. sorts of practical questions raise issues for recordkeeping, communication and information exchange between systems, and the exchange of account information. In principle, such practical questions should be capable of being addressed by standardized record-keeping and reporting formats for the NRPS and URPS schemes (which have been developed and is being disseminated by MHRSS). It would also require the harmonization of fund transfer and pension disbursement procedures. Again, some degree of centralization would be desirable to lessen administrative demands at the lower levels, although this might be at provincial level within national guidelines. These are issues on which elaborated guidance from the central authorities will be necessary over time. Although many open questions remain—and will doubtlessly be revisited in light of implementation experience with the ongoing NRPS and URPS schemes—below is a summary of the proposed key features of the VIRIS (see figure 9): • • • • Voluntary, flat contributions by nonwage urban and rural residents Funded defined-contribution design Applied to all nonwage residents not covered by other schemes Contributions based on a percentage of regional rural per capita income and urban average wages matched with government subsidies with the option of making higher individual contributions above a minimum level. Where appropriate, the contribution benchmarks may be fully harmonized between rural and urban resident schemes where prefectures deem it desirable. Rate of return on accumulations = national GDP growth rate, with the interest rate guaranteed by the central government Portable accumulations Individual accumulation paid out as an annuitized benefit Reserve investment management at a provincial or national level.
• • • •
International Experience with MDCs
The proposed matching defined-contribution approach under the VIRIS is relatively new but is being explored in some developing countries.50 Many OECD countries provide tax incentives to encourage workers and
Pension Needs for Nonwage Rural and Urban Citizens
125
employers to contribute to voluntary private pension schemes. Most OECD countries provide incentives for employer matching contributions by allowing tax deductions for employers on such contributions up to specified limits. In the United States, for example, the value of foregone tax revenue for such deductions is estimated to be about 1 percent of GDP. Evidence suggests that such programs increase participation, although the impact on savings is on its composition rather than its overall level. What seems clearer is that tax exemptions increase savings among low-income people and others with low savings rates.51 However, given progressive tax scales in most OECD countries, subsidies tend to disproportionately benefit better-off workers. In any event, using tax exemption to subsidize pension contributions would likely prove less effective in developing countries where the poor are less likely to be in the tax net in the first place and where distributional concerns on the use of public subsidies may be more pressing. In China a tax exemption would be meaningless for the large majority of rural and urban nonwage workers because their incomes are below the minimum personal income tax threshold. This is the reason for preferring a direct match approach. This is precisely the option chosen by the Chinese authorities in NRPS and URPS and seems appropriate. Experience with MDCs in developing countries is more limited, as suggested earlier. Noteworthy examples come from the Indian states of Rajasthan and Madhya Pradesh, both of which have MDC pension schemes in operation for certain categories of informal sector workers. The authorities provide a 1:1 match on contributions from the state governments under the schemes. Funds are invested by contracted asset managers with no guaranteed rate of return for contributors. The state of Andhra Pradesh started a similar scheme in 2009 targeted to women in self-help groups with a subsidy of about $10 equivalent per annum per person, which is expected to produce a pension just above the poverty line. The oldest such MDC scheme in India is in West Bengal, which has provided a 1:1 match for roughly 60 categories of informal sector workers since the early 2000s. As is the case for all defined-contribution schemes, the design of MDCs requires two policy issues to be addressed: (1) how to handle the death or disability of contributors and (2) managing financial risk for contributors. With respect to the former, pure defined-contribution schemes do not, by construction, provide insurance against premature death or disability during the accumulation phase. As a result, it is common to purchase group life and disability insurance policies for contributors in the
126
China’s Pension System
scheme. Such policies would cover the difference between the individual’s account accumulation at the point of death or disability and the benefits paid under the policy in the event of death or disability. The premium is calculated based on actuarial statistics for the group. Managing financial risk is handled differently in different countries ranging from the imposition of conservative portfolio rules (as is the case in China presently) to guaranteed rates of return to transferring all risk to contributors (as is the case in the Indian schemes described above). Given the likely degree of risk aversion on the part of rural workers in China and its underdeveloped regulatory framework, offering a guaranteed rate of return, as suggested above, seems the preferred option for the medium term. Such guarantees, however, create an open-ended fiscal burden because of the indeterminate size of the contingent liability they create.
Citizens’ Social Pension
The CSP is proposed as an essential instrument for those workers under the MORIS or VIRIS schemes with insufficient work histories and account accumulations to support a basic level of subsistence in old age. The objective of the proposed CSP would be to ensure basic living subsistence for those elderly who are not covered by existing pension provisions or are unable to generate adequate retirement income from their contributions during their working age. This could be for a variety of reasons, including sickness, disability, or time out of the workforce (for example, for child rearing or study). The rationale for a CSP is to (1) provide a low level of support for the growing number of elderly with minimal resources to prevent them from falling into poverty in their old age and (2) reduce incentives for overly high precautionary savings before retirement. While an alternative option of an enhanced dibao benefit for the elderly poor was considered, the CSP approach was felt to be preferred for several reasons (see box A.2). The proposed CSP would follow uniform design parameters nationwide, although benefits would reflect local characteristics (see table A.5). Provincial authorities would be held accountable for observance of the national framework. The amount of the benefit would be set as a percentage of the regional average wage in urban areas and rural per capita income in rural areas, with the objective of exceeding the per capita benefit under the existing dibao scheme. A “pensions test” would reduce the benefit by a proportion of benefits received from other pension arrangements for those aged 65 to 74. The pensions test would need to be designed to reward those who contributed to other pension schemes
Pension Needs for Nonwage Rural and Urban Citizens
127
Box A.2
Alternative Benefit Designs to Protect the Elderly Poor Policy makers need to decide whether a benefit to protect elderly poor would be best delivered as (1) a dibao supplement within the existing dibao program or (2) a new standalone social pension.a Variants of the former approach can already be seen in some parts of China, either in the form of top-ups on dibao benefits for poor elderly people or the more generous interpretation of dibao thresholds. Two alternatives were considered, including a dibao supplement (an “enhanced dibao”) and a new standalone social pension (a “Citizens’ Social Pension”). Both are discussed below. As discussed further, this report argues that the standalone approach may better accommodate China’s specific requirements and institutional setting. • An enhanced dibao for the elderly poor. This could be designed in one of two ways: (1) providing dibao households with elderly members a supplement to their dibao benefit for individual elderly members (probably a flat supplement for simplicity)b or (2) increasing the per capita dibao threshold for the elderly so that the amount of dibao benefits is increased. The first approach would offer the benefit of concentrating incremental resources on the poorest elderly, whereas the second approach would widen dibao coverage among the elderly poor. A Citizens’ Social Pension for the elderly. Analysis of the current system suggests that undercoverage of the poor is a significant issue in dibao.c Given the importance of a universal basic income support, this report concludes that a separate old-age income allowance is justified. Such a benefit would be noncontributory, most likely with distinct administration. As with the dibao supplement, design questions exist that must be addressed, particularly with respect to means-testing (for example, which age groups should be subject to means-testing, what criteria should be used, and how the test should be structured and administered).
•
Means-testing could be applied to either alternative, and options include (1) verified means- testing, (2) proxy mean-testing, and (3) pensions testing, which considers only the value of pension income when determining eligibility. Variants of these three basic options are also possible (for example, verified or proxy means-testing from ages 65 to 70 and a pension test thereafter). (continued next page)
128
China’s Pension System
Box A.2 (continued)
Deciding whether to modify the existing dibao system or to introduce a Social Pension as a mechanism for preventing poverty among China’s elderly should take into account the following considerations: • • • • • • The administrative challenges of program delivery The complexity of the social protection system for applicants and beneficiaries The potential fiscal implications of the two approaches The issue of horizontal equity between the elderly poor and other groups of poor The implications for longer-run integration of the overall pension and social assistance systems between urban and rural areas and for migrant workers and Social acceptability.
In light of these criteria, this report proposes the creation of a CSP with uniform design parameters nationwide, although benefit levels and financing should be locally determined based on regional average wages and living standards (as is currently the case for the urban dibao) (see table A.5).
a. For a general discussion of the issues involved in using social pensions versus social assistance programs to address poverty among the elderly and for a simulation of the two approaches using data sets from selected developing countries, see Grosh and Leite (2009). b. Policy makers would have to decide whether the supplement should be uniform at the national, provincial, or subprovincial level. c. See Chen and others (2006).
Table A.5 Citizens’ Social Pensions—Proposed Parameters Issue Applicability Eligibility Benefit level (before pension test reduction) Provision/parameters All urban and rural residents Urban or rural elderly aged 65 and higher; for persons aged 65 to 74, pension income must not be in excess of an applicable threshold Benefit set as percent of regional average wage (urban areas) or rural per capita income (rural areas) Benefit set above dibao standard Partially reduced for other pensionable income (aged 65–74) No reduction for those aged 75+ Benefit indexation: two-thirds to prices and one-third to wages Noncontributory Financed from general revenues Shared responsibility between central and subnational governments Social pension to be included in family income for purposes of determining eligibility for dibao
Financing
Interaction with dibao
Source: Author’s compilation.
Pension Needs for Nonwage Rural and Urban Citizens
129
while simultaneously targeting those with the least income from all sources, to include other pension benefits. Given the objective of eventually increasing the retirement age to 65 for men and women under the proposed Mandatory Occupational Retirement Insurance Scheme (MORIS), this report recommends setting 65 as the minimum age for both men and women to qualify for the CSP. This is important from a labor supply incentive viewpoint and to maintain consistency with the proposed future urban pension policy. Such a benefit would be noncontributory and financed by some combination of national, provincial, municipal, and local resources. The proposed CSP is broadly consistent with the design of the basic benefit provision under the NRPS and URPS. The adjustment factor for the pensions test could be set as high as 50 percent initially (to provide a strong incentive to contribute to the VIRIS) but if this is too high it will more than offset the match in the VIRIS. The actual adjustment factor should be adjusted on the basis of actual experience. A stylized example is provided in figure A.10 using a benefit level linked to rural individual minimum consumption and applying a 50 percent adjustment factor.
Figure A.10 Stylized Example of CSP Pension Benefit Levels and Composition under Proposed Scheme
1,800 total retirement benefit (RMB/year) 1,600 1,400 1,200 1,000 800 600 400 200 0
rural social pension
Source: World Bank estimates. Note: Assumes CSP benefit of 788 RMB/year (2003 Ravallion-Chen rural consumption poverty level increased by the CPI from 2003 to 2009). In this example, CSP benefit is reduced by 50 percent of alternative pension income.
0 40 0 50 0 60 0 70 0 80 0 90 0 1, 00 0 1, 10 0 1, 20 0 1, 30 0 1, 40 0 1, 50 0
alternate pension income per year (RMB/year) other pension income during retirement
10
20
30
0
0
0
130
China’s Pension System
The CSP’s value relative to the dibao threshold in different localities is an important design parameter. In this regard, the practice of the NRPS and URPS seems appropriate (that is, setting the CSP at a level above the dibao per capita threshold). This is important for incentive reasons, but— for fiscal reasons—it should not to be substantially higher. If the CSP is set too high, the incentive to contribute to the VIRIS will be weaker; if it is set too low, its poverty alleviation objective may be undermined. Under the NRPS, the central government has set the minimum flat benefit at 55 RMB monthly while allowing additional funds to be provided from subnational sources. This compares to a national average rural dibao threshold of 82 RMB in 2008, with a range from minimum of 26 to 267 RMB (or 11–41 percent of the national rural average wage). The dibao threshold rates suggest that closer attention is needed to the relative level of the CSP floor to align protections and incentives appropriately. Finally, pensions from NRPS and URPS and from the proposed CSP should not impact the receipt of the allowance for following family planning policies, although some Chinese researchers have proposed integrating the programs by using the family planning subsidy as an additional subsidy toward individual pension contributions.52 Key policy decisions that must be made include (1) the framework for the minimum CSP benefit level, (2) the benefit reduction applied to other pension income, (3) the approach to benefit indexation, (4) the qualifying conditions (to include age and residency), (5) the central, provincial, and local financing arrangements, and (6) the linkages to dibao. Indicative cost estimates suggest that a CSP with a benefit set around the urban income poverty line would cost about 0.11 percent of 2010 GDP, rising to 0.31 percent of GDP by 2040 (see figure A.11). A rural CSP using the rural poverty line would cost around 0.11 percent of GDP in 2010 and stay relatively stable over time as a result of urbanization. These estimates will vary substantially with the benefit level, the growth in the benefit level, the level of urbanization, and the observed benefit reductions arising from the pensions test. The upward trend in cost projections reflects population aging and urbanization.53 By comparison, by adopting a benefit level of about 28 percent of the urban average wage (the OECD average), the cost of the urban CSP would be 0.75 percent of GDP in 2010 rising to 2.1 percent of GDP by 2040 (see figure A.11). The costs presented above are indicative only; actual costs will reflect the specific parameters chosen. The fiscal burden would be quite manageable, assuming a modest supplement. For example, assuming an individual supplement of about half the average monthly dibao household benefit in
Pension Needs for Nonwage Rural and Urban Citizens
131
Figure A.11 Indicative Cost Projections for CSP Benefits
45 40 35 percentage of GDP 30 25 20 15 10 5 0
Source: World Bank estimates. Assumes (1) median variant urbanization 2010–2040, (2) total fertility rate of 1.8, and (3) the age distribution for the population over age 60 is the same as for the total population. The rural reduction due to pensions test and transition introduction is 5 percent in 2011, rising by 3 percent each year up to a maximum of 50 percent. The urban reduction due to pensions test is 40 percent in 2010, rising by 1 percent each year up to a maximum of 60 percent. The benefit level is assumed to grow at the rate of GDP.
2008 (or 70 RMB given that the average monthly benefit was 141 RMB), the incremental fiscal cost would be about 1.78 billion RMB, which is under 5 percent of total spending on urban dibao in 2008.54 The biggest potential cost difference between the dibao supplement and a CSP would be if the benefit were to be made universal after a certain age. The cost of both approaches would rise as the population ages, but the fiscal burden of aging would be far greater for a CSP if it provided universal coverage beyond a certain age.
International Experience with Social and Citizens’ Pensions
Widespread experience is found with noncontributory social pensions in countries at all levels of income. The experience with reducing old-age poverty is generally positive, although issues of fiscal sustainability have arisen in lower-income settings. However, social pensions are providing to be an increasingly popular method for bridging the old-age coverage gap in pension systems.55
10 20 12 20 14 20 16 20 18 20 20 20 22 20 24 20 26 20 28 20 30 20 32 20 34 20 36 20 38 20 40
year rural urban total
20
132
China’s Pension System
OECD countries have different approaches to social pensions, as is seen in table A.6.56 About half of countries rely on a single approach to social pensions, the remainder rely on combinations of three basic approaches. The first is a basic pension—often called a demogrant—which is a flat benefit for the elderly awarded independent of income. Countries with basic pensions usually have some qualifying provisions, such as residency or contribution tests. A second approach is to provide a means or “resource” tested social pension, either through a separate program for the elderly or as part of a general social assistance scheme. Eligibility is subject to some form of means-testing, which can include income or income plus assets. The third approach is to establish a minimum pension, which is effectively similar to providing a resource tested pension in that it targets older people with lower incomes. The key difference is that only income from pension schemes is considered when calculating entitlement to a minimum pension. Consequently, someone with substantial income from nonpension sources can still qualify. In countries where a contribution history is required to qualify for social pensions, periods of unemployment and disability in many cases can be counted toward the qualifying period. Among OECD countries, the replacement rate from social pensions ranges from 20 percent to 40 percent of average economy-wide earnings,
Table A.6 Social Pensions in OECD Countries Resource tested Australia Austria Belgium Canada Czech Republic Denmark Finland France Germany Greece Hungary Iceland Ireland Italy Japan
Source: OECD 2007.
Basic
Minimum Korea, Rep. Luxembourg Mexico Netherlands New Zealand Norway Poland Portugal Slovak Republic Spain Sweden Switzerland Turkey United Kingdom United States
Resource tested Basic X X X X X X X X X X X X
Minimum X X
X X X X
X X X X X X X X X X X X
X X X X X X X
X
X X X X X X X X X
Pension Needs for Nonwage Rural and Urban Citizens
133
with a cross-country average of just under 30 percent (see figure A.12). In Japan, for example, the rate is as low as 16 percent, and in Portugal, it is well over 40 percent. Comparisons are complicated by the availability of general social assistance programs for the elderly. Over the last decade, various OECD countries have significantly reformed their social pension programs, although no clear directional trend is found. Some countries— including France, Ireland, Mexico, and the Republic of Korea—have introduced (or increased the basis for) minimum pensions. Others— including Germany, Japan, and New Zealand—have cut earnings-related pensions with little impact on social pensions. Still others—including several Eastern European countries and Italy—have abolished minimum pensions altogether.57 As can be seen from table A.7, the most significant difference in design is whether noncontributory social pensions are universal, means-tested, or categorical in coverage. No definitive pattern by level of income exists in this respect. The broad distinction is sometimes drawn between social pension systems that are core elements of old-age security and those that are supplementary (either to contributory systems or to informal support systems). This can be shown in a shorthand manner by comparing the combination of coverage rates among the elderly and benefit levels relative to country income as is shown for selected developing countries in figure A.13. With respect to the age of eligibility, experience also differs, but ages of between 65 and 70 are most common, as is shown in table A.7. The financing source for social pensions also varies across countries, although general revenues are most common. Brazil, in contrast, funds its social pension scheme from a 2 percent contribution from rural employers. The impact of social pension schemes on alleviating old-age poverty in developing countries is generally positive although evidence is limited. Core schemes (found in Brazil, Bolivia, South Africa, Mauritius, Botswana, and Namibia) have been shown to reduce old-age poverty significantly while supplementary schemes have varied more widely in their targeting and their outcomes in terms of poverty reduction.58 Evidence for other impacts from social pension schemes is even more limited, coming primarily from South Africa, Brazil, and Bolivia. The effects seem to be mixed. Positive effects may include permanent increases in income due to the investment of transfers, better health indicators, and higher school enrollment rates for children from pensioner households. Negative effects may include a reduction in labor supply on the part of other household members. The evidence is mixed on the reduction of family support to the elderly.
Percent
134 CZE AUS MEX AUT IRL ISL TUR KOR ESP GBR CAN NLD FRA NOR BEL GRC SWE DNK LUX NZL PRT
Figure A.12 Value of Social Pensions as a Percent of Average Earnings in OECD Countries
50
45
40
35
30
OECD average
25
20
15
10
5
0
JPN
DEU
ITA
USA
CHE
FIN
HUN
SVK
POL
Source: OECD (2007). Note: JPN, Japan; DEU, Germany; ITA, Italy; USA, United States; CHE, Switzerland; CZE, Czech Republic; ISL, Iceland; TUR, Turkey; KOR, Korea, Rep.; GBR, United Kingdom; NLD, Netherlands; NOR, Norway; GRC, Greece; DNK, Denmark; NZL, New Zealand; FIN, Finland; HUN, Hungary; SVK, Slovakia; POL, Poland; AUS, Australia; MEX, Mexico; AUT, Austria; IRL, Ireland; ESP, Spain; CAN, Canada; FRA, France; BEL, Belgium; SWE, Sweden; LUX, Luxembourg; PRT, Portugal.
Table A.7 Examples of Noncontributory Pension Programs in Developing Countries Type Ministry of Social Development Ministry of Social Welfare Ministry of Economic Development Department of Labor and Social Security National Social Security Institute (INSS) 65 67 70 57 65 Administration Eligible at age
Country
Recent law
Argentina Bangladesh Bolivia
1993 1998 1993
1996 (1974) 1993
Means test Means test Universal, but cohort restricted Universal Means test
Botswana Brazil Social Assistance Brazil RMC/BPC Rural Pension Chile Costa Rica India Mauritius Namibia Nepal Samoa Means test, basic contributory record Means test Means test Means test Universal Universal Universal Universal Means test Means test Means test
1992
1980 and 1981 1995 1995 1976 1990 1995-6 1990
60 for men, 55 for women 70 65 65 60 60 75 65 65 for men, 60 for women 70
South Africa
1992 (amended in 1997)
Sri Lanka Uruguay
1939 1995
Ministry of Development and Planning Costa Rican Social Insurance Fund Ministry of Labor Ministry of Social Security and National Solidarity Government Pension Fund (GIFF) Ministry of Local Development Labor Department and Accident Compensation Board National and Provincial Departments of Social Development Provincial Department of Social Services Ministry of Labor and Social Security and Social Welfare Fund
Source: World Bank estimates.
135
136
China’s Pension System
Figure A.13 Ratio of Social Pension to Per Capita Income Multiplied by Ratio of Number of Recipients to Number of Elderly
30
25
20 percent
15
10
5
0
Source: Palacios and Sluchynskyy 2006.
Countries have also managed the interaction between social pension schemes and defined-contribution schemes in different ways. Chile serves as an interesting example. In its 2008 reform, Chile introduced a new solidarity pension with the objectives of (1) achieving universal pension coverage and (2) more effectively reducing old-age poverty. The solidarity pension also aims to better integrate the country’s contributory system and the noncontributory system. The solidarity pension is targeted to men and women over age 65 (who are among the poorest 60 percent of the population) and is subject to a national residence requirement. For persons with no individual account accumulations, a universal basic pension is available. Those with a contribution history and individual account accumulations, however, are eligible for a top-up of their funded pension benefit subject to a ceiling on the
ut h M Afr au ic ri a Bo tius Na liv m ia ib Bo Br ia Eg ts azi w l yp t, N ana Ar e ab pa Re l Co Tur p. s ke Co ta R y lo ica m b Ba ng Ch ia la ile Ru de ss s ia U In h n ru di Fe g a de u Ar rat ay ge io Do n n m Es tina in to ica n Alg nia Re er pu ia bl ic
So
Pension Needs for Nonwage Rural and Urban Citizens
137
combined amount. As a result, the top-up (known as the solidarity contribution) shrinks for persons with higher account balances. The withdrawal of the solidarity pension is designed to retain incentives to sustain higher contributions to the funded portion of the scheme. For those with higher income levels, they are permitted to supplement their individual account balances with voluntary contributions. Figure A.14 shows the scheme in graphical form. From a design viewpoint, the system strikes a useful balance between creating incentives to contribute and providing basic old-age protection for those with low or no contribution history (although concerns have been raised with the respect to its projected fiscal cost).
The Interaction between Individual Accounts and the Social Pension and the Transitional Generation
A key policy decision relates to whether individual accounts and the CSP should be combined over time as the contributory system matures. The two broad options are (1) to retain the CSP for persons over a certain age to provide an income floor that is supplemented by benefits from individual accounts (if chosen, then questions must be addressed regarding the interaction between the CSP level and eligibility criteria and the contributory pension, as was illustrated in the case of Chile above) or (2) to gradually phase out the CSP as the contributory system matures, thereby having elderly poverty addressed through the regular social assistance program (perhaps, as is the case in some urban areas already, with an
Figure A.14 Chile’s System of Solidarity Pensions Introduced 2008
voluntary pillar
mandatory contributions solidarity pillar
Source: Fajnzylber 2008.
138
China’s Pension System
elderly supplement on the dibao threshold or benefit level). This report recommends that the CSP should be retained even in the longer run although such a decision involves a pragmatic judgment of the social assistance delivery system and its ability to ensure that the elderly poor are protected. In either case, a targeted benefit level from the combination of the CSP and individual accounts must be established, ideally falling between the poverty line and the average wage. The specific target should depend on the fiscal envelope and social policy decisions relating to work incentives as people age. The target should be indexed over time against prices or per capita incomes (or some combination of the two). This report recommends that indexation policies be aligned with those proposed for the urban oldage insurance scheme (two-thirds price indexation and one-third wages). This should be sufficient to meet poverty alleviation objectives. Policy makers must decide how to handle those approaching retirement who will have insufficient time to contribute enough to their accounts to earn a reasonable pension. Special treatment is needed to manage this transition. The issue has been dealt with in a variety of ways under previous rural pension pilots in China, and various schemes have special treatment for persons above age 45. Baoji, for example, allowed persons over age 45 to receive a full pension if they contributed until reaching age 60; those over 60 were also entitled, subject to “family binding.” This is the same approach adopted in the NRPS and URPS. Some schemes also have provisions for the lump-sum payment of contributions by those without a full contribution history, in some cases at the point of retirement (for example, Beijing and Zhuhai) and in others during the accumulation phase. Others have older cohorts continue to make contributions for up to five years after reaching the normal retirement age. One option for dealing with the transitional generation (defined, for example, as persons over age 50 in the year they start contributing) is to notionally credit their accounts with full individual and matched contributions for all the years in which they did not contribute assuming a standard age of entry into the scheme of somewhere between 20 and 25 years old.
Conclusions
The proposal outlined above clearly borrows significantly from the design of the current NRPS and URPS, while suggesting adaptations that may increase the strengths of the system over time. It could be used either as (1) the architecture for a future integrated national pension system for
Pension Needs for Nonwage Rural and Urban Citizens
139
nonwage populations in rural and urban areas in China or (2) a list of issues and options that the government should consider as it expands the current schemes for rural and urban workers over time. In either case, the proposal provides only a general framework that would need to be elaborated to be operationalized. However, it does strike a reasonable balance between concerns for elderly welfare, fiscal demands, and labor market impacts. The discussion above is preliminary in nature and intended to provide a big picture overview of what a national policy framework might look like. How some of its proposed parameters and features might sensibly evolve from the national NRPS and the URPS is a subject for further discussion. However, a compelling rationale is seen for public intervention in the welfare of the elderly not already covered by urban pension systems, and the national NRPS and URPS demonstrate the commitment of the authorities to achieving their goal of universal social security coverage this decade.
Notes
1. See Guiding Suggestions of the State Council on Developing New Rural Pension Scheme Pilot, Document No. 32 of the State Council, September 2009. 2. The term “residents” in China has a specific meaning in the context of social insurance, because of how being a “resident” is defined in reference to a person’s hukou (household registration) status and type of employment. In this report the term “residents” refers to all rural workers (except local officials) and nonworking population, and to self-employed, informally employed, and nonworking populations with local hukou in urban areas. Residents are contrasted with “workers,” who would be covered within the urban workers’ old-age insurance scheme. 3. The poverty severity index relies on the Foster and others (1984) measure of poverty using a sensitivity parameter of two. 4. See Cai and others (2012) for a detailed empirical analysis of the welfare of rural elderly. 5. Ibid. 6. See Cai and others (2012) for a detailed analysis of these issues using the China Urban Labor Survey carried out by CASS in 2001 and 2002. 7. See Cai and others (2012) for an analysis of private transfers to the elderly in rural areas. 8. See Cai and others (2012). 9. See Forteza and others (2009).
140
China’s Pension System
10. This section draws from the World Bank Policy Note on rural elderly welfare (Giles, Park, and Wang 2012) and a background paper written for that report (Wu 2009). 11. In October 1995, the State Council redistributed a circular of MOCA on “Further Improving the Rural Pension Insurance.” 12. The pension benefit calculation formula was (0.008631526) × (accumulation in individual account). 13. See Liang (1999), Ma (1999), Ping (2002), and Shi (2007) for a discussion of the shortcomings of previous rural pension schemes. 14. See Peng (1996) for examples of massive differences in the matching of cadre and farmer contributions under local schemes. 15. See Wang (2000). 16. See MOLSS, “Notice on Seriously Improving Work on Current Rural Pensions.” 17. For detailed descriptions of the systems of Beijing, Baoji, Yantai, and Suzhou, see Wu (2009). For a detailed discussion of the Baoji pilot rural pension experience, see Zhang and Tang (2009). 18. See “Notice of Guide on Construction of Rural Social Pension of Beijing Government,” “Provisional Method for New Rural Social Pension,” and “2009 New Pension Scheme for Both Rural and Urban Residents.” 19. See Suzhou, “Provisional Methods for Rural Pension” (2003). 20. See Yantai Municipal Government, “Provisional Method on New Rural Pension Insurance” (2007). 21. See Zhang and Tang (2009) who argue that such a system will encourage family disputes, whereas Sun (2006) considers such a system to be a pragmatic and innovative approach to addressing persons with short contribution histories. 22. For a comprehensive discussion of recent experiences with “closing the coverage gap” through the extension of pension systems to rural and informal sector populations, see Holzmann and others (2009) and Palacios and Robalino (2009) on the framework for matching defined-contribution schemes. 23. See Lin (2006) for European, Commonwealth, and low-income countries; Gong (2006) for Japan; Su (2007) for Korea, Rep.; and Zheng (2007) and Leisering and Gong (2002) for a general discussion of the subsidy approach. 24. See Zhuhai City, “Transitional Pension Method for Farmers and LandExpropriated Farmers,” as is described in Wu (2009). On similar lines, Wang (2006) has suggested that income from the auction of land use rights and resources from state-owned assets should also be used for such purposes. 25. See Dong (2008) and Chen (2004). The assumptions underlying these simulations merit note. For example, Chen, used a projection model based on data
Pension Needs for Nonwage Rural and Urban Citizens
141
from Jiangsu province and assumes that one-quarter of the increase in general revenues would be needed for rural pension subsidies to support a universal pension for men and women at age 60 and 55, respectively. Assuming this represents 2.5 percent of general revenues, a universal farmers’ pension of 825 RMB annually could have been provided in 2010. 26. See Chen (2004) and Qin (2007) for approaches for allocating financing responsibility among levels. 27. See Mi and Yang (2008) on the grain payment proposal, supported by a survey in Anhui province that found that about one-fifth of rural respondents would prefer to make contributions in grain. See Zhan (2004) and Lu (2004) for proposals for the allocation of farmer grain subsidies. 28. See Lv (2005), Liu (2003, 2007), and Wang (2004). 29. See Zhang (2006) regarding a reserve fund proposal. See Lv (2005) for proposals for higher return portfolio options. 30. See World Bank (forthcoming) for a discussion of social assistance benefits in rural areas. There were roughly 5.3 million wu bao recipients nationwide in 2007. 31. See Yang (2007), Mi and Yang (2008), and Yang, C. (2007). 32. See “Guiding Suggestions of the State Council on Developing New Rural Pension Scheme Pilot,” Document No. 32 of the State Council, September 2009. 33. An illustration of this approach from Chile is provided in the section that follows on international experience. 34. See. 35. The possible coverage of dibao household contributions raises second-order questions for. 36. See Pickens and others (2009). 37. See World Bank (2009). 38. See Palacios and Robalino (2009) for a discussion of MDCs, model and design questions, empirical evidence, and theoretical framework. 39. In some areas of China, existing pilot schemes also allow use of the accumulation as collateral for loans for business activities. Although this is an interesting approach, it suffers from obvious social policy risks if the share of accumulations pledged is not capped at a reasonable level. Moreover, such an approach is not common internationally. 40. See note 23 above. 41. See Palacios and Robalino (2009).
142
China’s Pension System
42. See Zhuhai City, “Transitional Pension Method for Farmers and LandExpropriated Farmers,” as described in Wu (2009). On similar lines, Wang (2006) has suggested that income from the auction of land use rights and resources from state-owned assets should also be used for such purposes. 43. Localized examples can be found of collectives in urban areas that have solid revenue bases from the rental of collective land to factories or for other users that may be able to provide significant matching. 44. The urban scheme does have a 15-year vesting period, which should be considered. 45. See Holzmann and Palmer (2006) for a comprehensive review of NDCs. 46. See Zhang (2008) regarding a reserve fund proposal. See Lv (2005) for proposals for higher return portfolio options. 47. Examples from other countries are found of contracting arrangements that offer the benefits of competition among asset managers while limiting the number of asset managers to ensure a critical mass of funds and generate economies of scale in fund management (for example, the Indian New Pension Scheme and a handful of funded pillar schemes in Latin American, Europe, and Central Asia). However, most of these countries have more developed regulatory and accountability frameworks than exist at present in China. 48. See Wu (2009) and Cai and others (2012). 49. See. 50. This section draws on Palacios and Robalino (2009). 51. See Engen and Gale (2000) and Benjamin (2003). 52. See Yang, J. (2007) and Mi and Yang (2008). 53. These figures assume a benefit level of 1,200 RMB per year (about 4.1 percent of the projected urban average wage) beginning in 2010. 54. See Liu (2009) for expenditure and benefit figures for dibao. 55. See Palacios and Sluchynskyy (2005), Asher for middle-income countries, and Barrientos for on lower-income countries in Holzmann and others (2009). The terms “social” and “citizens’” pensions are used interchangeably in the discussion that follows. 56. See Pearson and Whitehouse (2009) for a discussion of social pensions in high-income countries. 57. See ibid. details of the effect of these pension reforms on net replacement rates by earnings level. 58. See Kakwani and Subbarao (2005) on African schemes, Barrientos on four developing countries, and Palacios and Sluchynskyy (2006) for an international overview.
Pension Needs for Nonwage Rural and Urban Citizens
143
References
Benjamin, D. J. 2003. “Does 401(k) Eligibility Increase Saving? Evidence from Propensity Score Subclassification.” Journal of Public Economics 87: 1259–90. Cai, F., J. Giles, P. O’Keefe, and D. Wang. 2012. The Well-being of China’s Rural Elderly and Old Age Support: Challenges and Prospects. Directions in Development Series. Washington, DC: World Bank. Chen, Y. 2004. “Rural Pension: Design and Argument for a New Scheme.” Academic World 5. Chen, S., M. Ravallion, and Y. Wang. 2006. “Dibao: A Guaranteed Minimum Income in China’s Cities?” Policy Research Working Paper 3805, World Bank, Washington, DC. China Health and Nutrition Survey (CHNS). Various years. China Center for Disease Control and Prevention and the Carolina Population Center, University of North Carolina at Chapel Hill. http:. China Urban and Rural Elderly Survey (CURES). 2006. “China Urban and Rural Elderly Survey Micro-Data.” Unpublished report, China Research Center on Aging, Beijing. Dong, K. 2008. “Establishing a Universal Pension Scheme in Rural Areas.” China Youth News, July 16. Dorfman, M., D. Wang, P. O’Keefe, J. Cheng. 2013. “China’s Pension Schemes for Rural and Urban Residents,” in Matching Contributions for Pensions: A Review of International Experience, edited by R. Hinz, R. Holzmann, D. Tuesta, N. Takayama. Washington, DC: World Bank. Engen, E., and W. Gale. 2000. “The Effect of 401(k) Plans on Housheold Wealth: Differences across Earning Groups.” NBER Working Paper No. 8032, National Bureau of Economic Research, Cambridge, MA. Fajnzylber, E. 2008. “Extending Pension Coverage: The Chilean Perspective.” Presentation to World Bank Pension Core Course, Washington, DC. Forteza, A., L. Lucchetti, and M. Pallares-Miralles. 2009. “Measuring the Coverage Gap.” In Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers, ed. R. Holzmann, D. Robalino, and N. Takayama. Washington, DC: World Bank. Foster, J., J. Greer, and E. Thorbecke. 1984. “A Class of Decomposable Poverty Measures.” Econometrica 52 (3): 761–66. Giles, J., A. Park, and D. Wang. 2012. “Expanding Social Insurance Coverage in Urban China.” World Bank Policy Note. World Bank, Washington, DC. Gong, X. 2006. “Rural Pension System and Its Lessons in Developed Countries.” Journal of Central Finance University 6: 6–9.
144
China’s Pension System
Grosh, M., and P. Leite. 2009. “Defining Eligibility for Social Pensions: A View from a Social Assistance Perspective.” In The Role of Social Pensions and Other Retirement Income Transfers: Closing the Coverage Gap, ed. R. Holzmann, D. Robalino, and N. Takayama. Washington, DC: World Bank. Holzmann, R., and E. Palmer. 2006. Pension Reform: Issues and Prospects for Nonfinancial Defined Contribution Schemes. Washington, DC: World Bank. Holzmann, R., D. Robalino, and N. Takayama. 2009. Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers. Washington, DC: World Bank. Kakwani, N., and K. Subbarao. 2005. “Aging and Poverty in Africa: The Role of Social Pensions.” World Bank Social Protection Discussion Paper Series. No. 521, World Bank, Washington, DC. Leisering, L., and S. Gong. 2002. “Policy Support for Social Security Reform under the Tenth Five Year Plan: Old-Age Pensions for the Rural Areas—From Land Reform to Globalization.” PRC_Old_Age_Pensions/default.asp. Liang, H. 1999. “Economic Analysis of Current Rural Community Security of China.” Dissertation, University of Fudan. Lin, Y. 2006. Research on International Comparison of Rural Social Security and Its Lessons. Beijing: China Labor and Social Security Publishing House. Liu, C. 2007. “Improving Rural Pension Scheme Design.” China Finance 6: 68–70. Liu, X. 2009. Presentation to Chengdu Social Assistance Conference, Chengdu, 2009. Liu, Z. 2003. “Reflection and Reconstruction of China Rural Pension.” Hunan Business School of Hunan Normal University. Management World 8: 46–56. Lu, H. 2004. “Innovation of Rural Social Pension Scheme: Produce for Social Security.” Seeking Truth 3: 62. Luo, Xia, 2011. “Empirical Study on the RPPP—Case Study on Sixian City of Anhui Province.” Social Security Studies 1: 67–73. Lv, J. 2005. “Current Situation of Rural Social Security and Analysis of Its Development Path.” Journal of Ningxia Communist School 6: 47–49. Ma, L. 1999. “Slowing Down Rural Pension.” Exploration and Debate 7: 11–12. Mi, H., and C. Yang. 2008. Basic Theoretic Framework Research on Rural Pension System. Beijing: Bright Post Publishing House. Ministry of Labor and Social Security. Various years. Yearbooks of Labor and Social Security (2001–2008). Beijing: Ministry of Labor and Social Security. National Bureau of Statistics (NBS). 2005. “One Percent Population Sample, Micro-Data.” Unpublished report, NBS, Beijing.
Pension Needs for Nonwage Rural and Urban Citizens
145
Organisation for Economic Co-operation and Development (OECD). 2007. Pensions at a Glance. Paris: Organisation for Economic Co-operation and Development. Palacios, R., and D. Robalino. 2009. “Matching Defined Contributions: A Way to Increase Pension Coverage.” In Closing the Coverage Gap: The Role of Social Pensions and Other Retirement Income Transfers, ed. R. Holzmann, D. Robalino, and N. Takayama, chap. 13. Washington, DC: World Bank. Palacios, R., and O. Sluchynskyy. 2006. “Social Pensions Part I: Their Role in the Overall Pension System.” Social Protection Discussion Paper No. 0601, World Bank, Washington, DC. Pearson, M. A., and E. R. Whitehouse. 2009. “Social Pensions in High-Income Countries.” In Closing the Coverage Gap: The Role of Social Pensions, ed. R. Holzmann, D. Robalino, and N. Takayama. Washington, DC: World Bank. Peng, X. 1996. “Township and Village Enterprises and Rural Social Security in the South of Jiangsu Province.” Shanghai Finance 6: 31–32. Pickens, M., D. Porteous, and S. Rotman. 2009. “Banking the Poor via G2P Payments.” CGAP/DFID Focus Note No. 58, CGAP, Washington, DC. Ping., C. 2002. “Establishing a Unified Social Security System Is a Shortsighted Policy.” China Reform 4: 16–17. Qin, Z. 2007. “The Urgency, Current Situation and Policy Recommendation on Building Rural Pension System.” China Economic Times.. people.com.cn/nc/GB/61159/5611208.html. Rofman, R., L. Lucchetti, and G. Ourens. 2008. “Pension Systems in Latin America: Concepts and Measurement of Coverage.” World Bank Social Protection Working Paper Series No. 0616, World Bank, Washington, DC. Rural Household Survey Yearbooks. Various years. China Statistical Yearbook. Beijing: China Statistics Press. Shi, Y. 2007. “Analysis of Conditions for Establishing Rural Pension System in China.” Group Economics 4. State Council. 1986. “The 7th Five Year Plan for National Economic and Social Development of the People’s Republic of China, 1986–1990.” Document submitted to the Fourth Session of the Sixth National People’s Congress, Beijing. ———. 2011. “Guiding Opinions on Piloting Social Pension Insurance for Urban Residents.” State Council, Beijing, June 7. Su, B. 2007. “Rural Pension Systems of Western Developed Countries and Its Lessons.” Current Economy 12. Sun, W. 2006. Building and Perfecting the Institution of Social Security in Rural Areas. Beijing: Social Science Academic Press. Wang, D. 2006. “Construction of Pension System in Context of Coordinating Rural and Urban Development.” Theoretic Frontier 15.
146
China’s Pension System
Wang, D., J. Chen, and W. Gao, 2011. “Social Security Integration: The Case of Rural and Urban Resident Pension Pilot in Chengdu.” Mimeo, World Bank, Washington, DC. Wang, G. 2000. “Defects of Current Rural Pension System and Reform Thinking.” Quarterly of Shanghai Academy of Social Science 1: 120–27. Wang, Z. 2004. “Preliminary Study on Rural Pension System.” Enterprises Economy 9. World Bank. Forthcoming. Social Assistance in Rural China: Tackling Poverty through Rural Dibao. Beijing: World Bank. Wu, Y. 2009. “Rural Pensions Background Paper for World Bank Rural Elderly Report.” Mimeo, World Bank, Washington, DC. Yang, J. 2007. “Innovation and Selection of Financing Sources of Rural Social Security.” Developing Research 2. Yantai Municipal Government. 2007. “Provisional Method on New Rural Pension Insurance.” Yantai, Shandong province, China. Zhan, Z. 2004. “Feasibility Analysis of Utilizing Grain Subsidy to Build Rural Social Security.” Survey World 2. Zhang, L. 2006. “Issues of Rural Pension Fund Management and Its Policy Recommendation.” Rural Finance and Accounting 7. Zhang, S. 2008. “Making Best Use of Rural Pension Fund.” China Rural Credit Cooperation 9: 20–21. Zheng, W. 2007. “Reflections on the Dilemma of China Rural Pension System.” Insurance Research 11. Zhang, W., and D. Tang. 2009. “The New Rural Social Pension Insurance Program of Baoji City Shaanxi Province, China.”.
APPENDIX B
A Notional (Nonfinancial) DefinedContribution Design for China’s Urban Old-Age Insurance System
Notional or nonfinancial defined-contribution (NDC) schemes have been adopted by various countries over the last decade and a half, with Italy, Latvia, Poland, and Sweden broadly following the same design but with some distinct features. Norway introduced an NDC-type scheme in 2011 and Egypt enacted an NDC scheme in 2010 with implementation envisaged for 2013, while Belarus is considering such a design. A full evaluation of the various experiences with NDC and similar schemes has recently been published (see Holzmann, Palmer, and Robalino 2012, 2013). This section summarizes the characteristics of these NDC schemes and the lessons learned thus far (see table B.1 for a summary of key features of country schemes). NDC design architecture offers several attractive features including (1) a direct link between contributions and benefits and hence a reduction in labor market distortions, (2) strong incentives to work longer and retire later as life expectancy increases, and (3) a framework that provides easy portability of accrued benefit rights. Moreover, for countries with pay-asyou-go (PAYG) pension schemes, the introduction of an NDC scheme does not impose the high transition costs that result from moving to a funded system.1 Together with the other elements of the proposed pension
147
148
China’s Pension System
design architecture for China (which are discussed later in this report), the NDC design offers an attractive benefit and financing structure toward which the current and proposed pension schemes can converge. This chapter discusses (1) the rationale for adopting the NDC structure in the proposed wage employment pension scheme in China, (2) the key design features that must be considered when introducing an NDC scheme, and (3) lessons from international experience.
Rationale and Advantages of an NDC Scheme in China
The NDC design is an excellent mechanism for strengthening the linkage between individual contributions and benefits. It is an individual account system that operates on a PAYG basis and under the principle that what you paid in you get out, but not more; solvency is achieved by crediting only a notional interest rate that is line with the internal rate of return an unfunded system can afford to pay. The benefits are directly correlated with contributions, and so the system creates strong incentive to contribute and eliminates the temptation to shift the burden of pension promises to future generations by making the magnitude of those promises fully transparent. To operate effectively, however, an NDC scheme must be designed with respect for a handful of key principles, which are discussed later in this section (see also Palmer 2006a, b). The NDC design is attractive for the following key reasons: • NDC schemes tie benefits to contributions. An NDC scheme directly links the contributions made by an individual (and those made on his or her behalf by employers) to the benefits he or she ultimately receives. Contributions accumulate in a notional account that grows at a notional interest rate consistent with financial sustainability. At retirement, the individual receives an annuity computed on the basis of (1) projected cohort life expectancy at the individual’s age of retirement and (2) anticipated notional interest rates. The resulting direct correlation between contributions and benefits minimizes the incentive for workers to avoid formal sector employment and to retire early, which can be a problem in conventional defined-benefit schemes. • NDC schemes do not create hidden intergenerational subsidies. Unlike traditional defined-benefit schemes—which often affect intergenerational transfers that can be difficult to value—the liabilities associated with NDC schemes are transparent and easy for policy makers to
A Notional (Nonfinancial) Defined-Contribution Design
149
evaluate. Moreover, if the legacy costs associated with pension entitlements for current retirees and accrued rights of workers are financed from outside NDC schemes, contributors are not burdened with financing the accrued rights of earlier generations. • NDC schemes are financially sound and sustainable by design. An NDC structure is financially sustainable even when a population is aging because benefits are calculated on the basis of an individual’s notional account balance and remaining life expectancy. Given that NDC schemes are financed on a PAYG basis (that is, revenues from current contributions are used to pay benefits to current beneficiaries), the financial soundness relies on the following two additional features: (1) a balancing mechanism accommodates deviations between assets and liabilities created by long-term demographic and other changes while (2) a buffer fund provides liquidity to accommodate sudden exogenous shocks and temporary demographic shifts (for example, baby booms or busts, as discussed below). • NDC schemes do not create transition costs associated with a shift toward funded systems. For countries with PAYG pension schemes, introducing an NDC scheme does not create transition costs (that is, the need to finance both the benefits paid to current retirees and to prefund the accounts of workers who have yet to retire). This double burden is faced by countries that have elected to move from unfunded to fully funded pension schemes. NDC schemes thus offer many of the advantages of funded defined-contribution (FDC) schemes thus while eliminating the need to finance such transition costs. Moreover, if the contribution rate set to generate a targeted level of income replacement is below the steady-state contribution rate for the unreformed scheme, reform-induced transition costs will be much smaller than those involved in transitioning to a funded scheme. • Benefits under an NDC scheme automatically adjust in response to increasing life expectancy and other social-economic changes. Increasing life expectancy is one of the key motivations for pension reform. NDC schemes offer several compelling strategies for addressing such changes. First, NDC schemes create an incentive for individuals to work longer and retire later as their life expectancy increases and the population ages. Second, NDC schemes enable the full separation of old-age risks from disability risks (which can—and should—be
150
China’s Pension System
separately priced). Third, NDC schemes accommodate increases in female labor force participation and rising divorce rates by providing individual pensionable rights. By using a defined-contribution structure, traditional spousal survivor pensions can be accommodated under NDC schemes through higher individual account values and annuitized benefits, and the balances in accounts can be split as part of a divorce settlement. • NDC schemes are less dependent on capital markets than are funded schemes. Although NDC schemes do depend on functioning and efficient capital markets in which to invest the assets of their buffer funds, the level of capital market development required to support an NDC scheme is substantially less than that required to support an FDC scheme, which depends on the capital markets to intermediate all of its assets. These advantages notwithstanding, the NDC design does not obviate the need to finance the legacy costs associated with the unreformed scheme when moving to the new scheme (discussed below). Beyond these advantages, other compelling reasons exist for adopting NDC schemes in light of the special needs and characteristics of China: • NDC schemes can accommodate regional heterogeneity and support portability. The NDC framework accommodates variation in contribution rates across individual pension schemes while still providing full portability of accrued rights (which are represented by the value of notional account balances) across geographic areas (that is, among counties, cities, and provinces). Full portability of accrued pension rights for migrating workers can be achieved by creating a framework for combining notional account balances in different locations across an individual’s working life. • NDC schemes provide a convenient framework for converting existing schemes. The NDC framework provides a mechanism for valuing pension rights from diverse schemes on a common basis. For example, one can calculate the value of accrued pensionable rights for active workers in the urban old-age insurance system (be it middle men or new men; see figure C.1 for an explanation of these terms), civil servants, and PSU workers and then credit this (notional) value to the initial balance of each individual’s notional account. Once introduced, the rules of a new
A Notional (Nonfinancial) Defined-Contribution Design
151
NDC scheme would apply to all future earnings. Past service credit is thus captured using standardized rules through the calculation of notional account equivalents. Differences in benefit accruals among public sector institutions or other entities before the implementation of the reform would thus be fully reflected in individual account balances at the time of conversion. Such an approach can even be applied to workers close to retirement because accrued rights can always be converted into initial notional account balances, regardless of the nature of those rights. • NDC schemes support current consumption, labor, and enterprise competitiveness. By reducing contribution rates, the total cost of labor is reduced, and that supports business and labor competitiveness. At a household level, the resulting reduction in the amount of income that must be set aside as savings for retirement can then support additional current consumption. • NDC schemes can support redistribution. Redistributive features of the current basic scheme (Social Pooling) can be replicated under an NDC scheme by allocating a share of contributions with the same nominal amount credited equally to all notional accounts. Combined with the contributions based on the individual wages, this will effectively increase replacement rates for lower-income workers without sacrificing portability. • NDC schemes can support the gradual integration of urban and rural schemes. NDC schemes can support the integration of definedcontribution rights accrued by rural workers and migrants at any point. Contributions and accumulations under the NRPS and URPS, for example, could be aggregated with notional accumulations under the proposed MORIS. This could be particularly useful for migrant workers. • NDC schemes in emerging economies may offer higher returns (and, therefore, benefits) than equivalent funded defined-contribution schemes. In China, as in several other emerging economies, wages have historically grown at a rate that has greatly exceeded the rate of return earned on investment portfolios, particularly those invested primarily in low-risk, fixed-income securities. Low financial account remuneration leads to low benefits and replacement rates. As has been the case for China’s funded individual accounts in its urban old-age insurance system, when
152
China’s Pension System
the rate of return on individual accounts is lower than the rate of wage growth, individual replacement rates grow more slowly, resulting in low effective rates of accrual. A key advantage of NDCs is that the return on contributions is established under a framework at the outset, and workers are not subject to market risks (as is the case with FDC schemes). Because the notional interest rate is linked to GDP and, hence, to real wage growth, reasonable levels of income can be expected for a given contribution rate. • NDC schemes are consistent with China’s macroeconomic developmental objectives. Although an FDC design requires that contributions be made both to pay current retirees and to invest to fund the cost of future benefits, NDC schemes would not channel contributions to increased national savings. Furthermore, reducing the contribution rate by explicitly financing legacy costs outside the pension system will support business and labor competitiveness. At a household level, reducing the income that must be set aside as savings for retirement would support additional consumption. • NDC schemes can accommodate the eventual introduction of funding. An NDC scheme, once implemented, permits the easy conversion to partial or full funding once (1) the financial markets are capable of providing adequate returns at reasonable risk to investors and (2) the budgetary and macroeconomic preconditions for financing transition costs have been met. Once these conditions have been satisfied, a share of contributions can simply be diverted from individual notional accounts to individual financial accounts and invested.
Proposed Technical Design for an NDC Scheme
Five technical issues demand special attention when designing and implementing an NDC scheme in China. NDCs are a relatively new approach to pension design. Consequently, countries that have implemented NDC schemes are still refining their technical features (for a discussion of international experience; see the next section). The World Bank recommends that the design of a Chinese NDC scheme follow the conceptual spirit of the NDC design paradigm but select technical parameters that are (1) tailored to China’s special needs and circumstances and (2) capable of supporting experimentation and subsequent refinement.
A Notional (Nonfinancial) Defined-Contribution Design
153
The Notional Interest Rate
The notional interest rate is the rate applied to remunerate notional account balances during the accumulation phase and often co-determines the annuitized benefit at retirement along with life expectancy. It is also often used as the basis for indexing benefits in disbursement while maintaining long-term financial equilibrium.2 The basic principle that determines the notional interest rate—and drives its subsequent adjustment—starts with the balancing condition that applies to any pension scheme translated into the NDC framework. This principle can be stated as follows: Pension liabilities must be less than or equal to the pension assets to ensure financial sustainability: pension liabilities (PL) ≤ pension assets (PA) pension liabilities (PL) = balance of the notional accounts + present value of benefits in payment (disbursement) (B.1) pension assets (PA) = financial assets (FA) + pay-as-you-go PAYG assets (GA) where financial assets (FA) = the market value of any investments held by the pension fund and PAYG assets (GA) = the present value of future contributions minus pension rights accruing to these contributions (that is, for a positive PAYG asset the implicit remuneration of contributions must be below the market rate of interest/marginal product of capital). To guarantee equilibrium, the following condition must hold: PLt (1 + i*) = FAt (1 + r) + GAt (1 + a) (B.2)
with i* representing the internal rate of return (or notional interest rate), r = the market interest rate, and a = the growth rate of the financial asset. Solving for i* and simplifying: FAt GAt FAt + GAt − PLt r+ a+ PLt PLt PLt
i* =
(B.3)
where i* is the sustainable growth rate of liabilities; that is, the rate at which the individual account balances and the pensions in payment
154
China’s Pension System
can grow while keeping the system financially sustainable. Changes in the PAYG asset and financial asset (GA and FA) and their growth rates (r and a) need to be reflected in i*. No straightforward mechanism is available for estimating a sustainable notional interest rate over multiple generations, and so a proxy notional rate is required—such as the growth rate of the contribution base, wage base, or GDP—and a balancing mechanism is needed to correct for deviations.3 If one assumes steady-state conditions and overlapping generations, the notional interest rate (i*) would represent the internal rate of return that an unfunded scheme can deliver. Although such an internal rate of return should approximate the growth of the covered labor force and labor productivity, empirically the growth rate of the covered labor force and labor productivity does not guarantee financial sustainability. Thus, the use of both a proxy notional interest rate (such as the national growth rate of GDP) and a balancing mechanism are recommended.4 Two elements of population aging are treated differently under the proposed NDC framework: • Aging from below is the process by which decreasing fertility rates gradually increase the proportion of the aged relative to the rest of the population (as is the case in China). Aging from below manifests in lower labor force growth over time as smaller numbers of children age and enter the labor force. However, over the same multigenerational period, the number of current and future retirees has already been established by patterns of fertility in generations past. Any pension system, including one with an NDC design, needs to be sustainable across all generations—even in the face of rapidly declining labor force growth and expanding elderly populations. As such, financial sustainability in China will require the adjustment of the notional interest rate through a balancing mechanism to accommodate this long-term pattern of aging from below. • Aging from above refers to growth in the elderly population resulting from increases in life expectancy. This leads to an increase in labor force growth to the extent that withdrawal from the labor market is delayed. If individuals live longer but continue to retire at the same age, of course, then aging from above will have no impact on the labor force. The most important financial consequence of aging from above is the duration of retirement benefits resulting from increased life expectancy at retirement. Aging from above needs to be addressed through the best possible
A Notional (Nonfinancial) Defined-Contribution Design
155
estimation of conditional cohort life expectancies at retirement. Of course, such estimates will inevitably be inaccurate ex post. Addressing such inaccuracies forces two policy options: (1) retirees can bear the risk of changes in mortality at retirement (in which case, the annuity factor should be periodically revised—most likely reducing benefits by the degree to which projected life expectancy increased faster than anticipated) or (2) workers and retirees can share the risk by adjusting the balancing mechanism applied to the notional interest rate and annual indexation. China’s current and projected real wage growth and anticipated coverage growth suggest that the rate of growth in covered wages and the rate of growth of GDP will diverge. Hence, the choice of the notional rate of return that best approximates the most sustainable internal rate of return (that is, the choice that will require the smallest balancing mechanism) should be determined through simulation that captures the most likely scenario of future development.5 The availability and reliability of data should also be considered when determining the basis for the notional interest rate.
Life Expectancy at Retirement
An accurate estimate of life expectancy at retirement is crucial in determining the annuity factor under an NDC scheme to ensure that the payout during the withdrawal phase approximates the notional account accumulation at retirement. It is essential to attain actuarial balance both for individuals and for the system as a whole. Life expectancy at retirement, along with projected notional interest rates, is used as the basis to translate accumulated (notional) account balances into an annuitized benefit stream payable until beneficiaries die. If projected life expectancies are too low, pension benefits will be too high relative to accumulated contributions. This distorts retirement decisions and jeopardizes system sustainability. If projected life expectancies are too high, pension benefits will be too low. This reduces social welfare. Life expectancies at different retirement ages (that is, conditional life expectancies) are based on mortality rates estimated for every cohort in a particular region in a particular year. As life expectancy for almost all cohorts is increasing throughout China (as it is throughout most of the world as a consequence of generally decreasing mortality rates at all ages), conditional life expectancies tend to underestimate how long individuals at retirement age can actually be expected to draw a pension because their life expectancy does not
156
China’s Pension System
reflect further increases in life expectancy that might occur after they retire.6 This suggests that the annuity factors used to compute benefits should employ cohort estimates of remaining life expectancy based on projected survival probabilities that take into account projected improvements in mortality at ages above the retirement age. Because there is lack of international consensus surrounding projected mortality improvements (see Alho and others 2013), the World Bank suggests that conditional life expectancies should reflect past improvements in life expectancy for each cohort that retires. If in the future greater consensus is found over the pace of future improvements in mortality, the methodology should be adjusted accordingly. Another important institutional question for China is whether estimates for life expectancy should be based on national or provincial data, and urban or rural data. Material differences exist in life expectancy at retirement between different provinces and between urban and rural areas. These differences would materially impact benefit levels. Moreover, if benefits were to be calculated using different annuity factors from different life expectancies in different provinces, individuals would have an incentive to relocate to locations with lower life expectancies to maximize their benefits. Finally, material institutional challenges are encountered in acquiring robust life expectancy data on a provincial level in China. Because of these factors, the World Bank recommends the use of one life expectancy for all rural and urban schemes using conditional life expectancies that incorporate projected improvements in mortality, as was discussed earlier.
Balancing Mechanism
The objective of the balancing mechanism is to ensure solvency of the scheme (that is, that projected long-term revenues are adequate to cover long-term expenditures over a period of, for example, 80 years). The balancing mechanism serves to preserve long-term financial sustainability of the NDC system. Because the contribution rate is fixed, ensuring longterm actuarial balance can only be achieved by (1) adjusting the notional interest rate, (2) adjusting the indexation of benefits in disbursement, or (3) providing government or other subsidies. The balancing mechanism should follow a methodology codified in the design of the scheme and should automatically adjust the notional interest rate, the indexation of benefits in disbursement, or both. Adjusting the notional interest rate through a balancing mechanism reduces future initial benefits and thus improves long-term sustainability.
A Notional (Nonfinancial) Defined-Contribution Design
157
Because it has little short-term impact, it cannot correct for an imbalance between revenues and disbursements. This must be remedied through a buffer fund (as is discussed below). Adjusting benefit indexation has an immediate impact on cash flows but is more limited in terms of restoring long-term sustainability. Critical to the efficacy of the balancing mechanism is the methodology for estimating the PAYG asset (GA) and for addressing short-term fluctuations in the financial asset (FA). The PAYG asset should be estimated periodically (at least initially every two to three years) using established actuarial methods that reflect long-term trends inter alia in covered employment, wages, and GDP growth. Once methodologies have been established and all variables have been estimated—to include the PAYG asset (GA),7 the value of the pension liabilities (PL), and the value of the financial asset (FA)—the implicit rate of return can be estimated directly, thereby avoiding the use of GDP growth as a proxy for the sustainable notional interest rate. The better the estimator, the lower the probability of recourse to the balancing mechanism. Short-term fluctuations in the financial assets demand a judgment call and the development of clear valuation procedures for assets to avoid having short-term market fluctuations trigger the balancing mechanism. The balancing mechanism must be supported by very clear rules regarding the level of deviation from financial balance that triggers adjustment. For example, the trigger for applying the balancing mechanism might be a deviation of the estimated pension liabilities (PL) from estimated total assets (FA+GA) by, for example, 10 percent in either direction. The rules must also address the phasing and timing of the adjustment. For example, they might be designed to reduce the liabilityasset discrepancy to within 5 percent in five years. The parameters for such rules should be informed by stochastic simulation.
Buffer Fund
Although the balancing mechanism ensures the long-term solvency of the scheme, it cannot guarantee short-term liquidity. Short-term liquidity requires a buffer fund with liquid assets to pay benefits even in the event of (1) a protracted reduction in contribution revenues and (2) an increase in benefit expenditures. Additionally, such a buffer fund may also be used for medium-term smoothing of the notional interest rate (that is, to prefinance an anticipated period of expenditures exceeding revenues due to a temporary demographic disequilibrium that might otherwise trigger a transitory application of the balancing mechanism).
158
China’s Pension System
Bridging a temporary reduction in contribution revenues—which generally results from a reduction in output, employment, or wages—while expenditures are maintained or even increased is crucial for any pension scheme. Reducing benefit levels in the face of a decline in contribution revenues is politically difficult, is suboptimal in terms of maximizing welfare, threatens the credibility of the system, and does not further the basic social policy objective of smoothing consumption over time. The size of a buffer fund needed to absorb exogenous shocks depends on three factors: (1) the projected frequency and maximum depth of temporary declines in future contribution revenues, (2) the benefit protection objective in the face of revenue shortfalls (for example, to avoid cuts in nominal benefits or in real benefits), and (3) the government’s degree of risk aversion (such as the probability that the benefit protection objective is not met should be less than, for example, 5 percent). A rule of thumb based on international experience suggests that a buffer fund should have 6 to 24 months of total expenditures of the pension scheme; the higher end of this range reflects the recent experience of countries in the wake of the recent global financial crisis.8 Although a buffer fund to bridge short-term liquidity requirements is an essential part of any NDC scheme, smoothing temporary demographic spikes—such as the aging bulge (as is being observed currently in the United States and, to a lesser extent, in Europe) or the effects of the onechild policy in China—is a choice. Sweden, for example, inherited a substantial reserve fund of over 30 percent of GDP from its legacy scheme and intends to use it for demographic smoothing for the aging bulge and beyond. The methodology required for setting the parameters of the balancing mechanism, the indexation of benefits, and the size of the buffer fund will require considerable analysis, supported by long-term projections that anticipate a range of developmental scenarios and outcomes.
Financing of Legacy Costs
Legacy costs refer to the cost of financing the implicit debt (that is, the present value of benefit promises to current beneficiaries and current workers before the implementation of the reform) over and above (1) the value of the PAYG asset (under the new contribution rate) and (2) the financial assets set aside to prefinance accrued rights. Legacy costs arise from three main sources: (1) old legacy costs due to prior reforms of the scheme (for example, from old and middle men), (2) new legacy costs attributable to reform (to include the shift toward a lower sustainable
A Notional (Nonfinancial) Defined-Contribution Design
159
contribution rate), and (3) any accrued liabilities to date due to the inclusion of other schemes with cost-covering contribution rates above the sustainable new rate (see Holzmann and Jousten 2013 for details). Under NDC schemes, explicit financing for legacy costs from outside the pension system becomes a necessity because the contribution rate is fixed against a target replacement rate and an average retirement age. Additional resources, therefore, are needed to cover those pension promises beyond those directly supported by the NDC scheme. Although it is possible to retain a cost-covering contribution rate (for example, 30 percent) and to credit only a portion of collected contributions to the notional accounts of the reformed scheme, this would likely appear to participants to be an explicit tax and discredit the reform. The sources of revenues selected to finance legacy costs should depend on their magnitude and timing. Very rough estimates presented in appendix C estimate (gross) legacy costs to be between 89 percent and 113 percent of GDP (for a chosen new contribution rate of 15 percent) and between 44 percent and 56 percent (for a chosen new contribution rate of 25 percent). The lower the contribution rate, the higher the legacy costs. The estimated legacy costs are attributable with a share of threefourths to one-fourth to the urban old-age insurance system and schemes for PSU employees and civil servants, respectively. However, only about three-fourths of these (gross) legacy costs are additional budget outlays because most of the costs for civil servants and PSU are already borne by the budget. Very rough calculations suggest that a significant share of the legacy costs (net of government sector schemes) may be financeable by coverage expansion even if a low contribution of 15 percent is chosen. Even in such a scenario, however, the budget would need to cover initial financing requirements before the revenue effects of coverage expansion can be fully realized. To summarize: Based on conceptual considerations and the experience of other countries with NDC schemes, if China were to adopt an NDC design for its urban old age insurance system, it is recommended that China take the following steps: (1) Establish an explicit balancing mechanism to adjust the notional interest rate to ensure long-term stable structures and parameters (2) Index benefits on the basis of both the consumer price and GDP indexes (subject to limits); this will result in smaller initial benefits but will offer room for reducing indexation without cutting benefits in real terms, if needed
160
China’s Pension System
(3) Establish a buffer fund with an explicit financing strategy to absorb short-term exogenous shocks and the medium-term effects of cash flow imbalances due to demographic spikes and (4) Estimate the legacy costs of reform and establish an explicit strategy for financing them; over the long term, expanding coverage may substantially help reduce legacy costs, but fiscal support, such as transfers from the general government, will be required in the short term.
Lessons from Countries That Have Implemented NDC Schemes
Four countries have thus far implemented NDC schemes (Italy, Latvia, Poland, and Sweden). In addition, Egypt enacted an NDC scheme in 2010 and Norway introduced an NDC-type scheme in 2011, while Belarus is considering the design. Other countries have either adopted main elements of the NDC design or have adjusted their own schemes to mimic those key elements. This section summarizes the characteristics of these NDC schemes and the lessons learned thus far (see table B.1 for a summary of key features of country schemes).
Structure: Commonalities and Differences
Context. Three of the four countries that have introduced NDC schemes have also established some form of an FDC scheme and a noncontributory social pension scheme. In Italy, contributions to the FDC scheme are voluntary, whereas in Latvia, Poland, and Sweden they are mandatory. Contribution rates. The total combined employer and employee contribution rates of funded and NDC schemes in Latvia, Poland, and Sweden are 20 percent, 19.52 percent, and 18.5 percent respectively, of which 14 percent, 12.22 percent, and 16.0 percent go to the NDC scheme, and 6.0 percent, 7.3 percent, and 2.5 percent go to the FDC scheme.9 In Italy the rate is 33 percent (for employees), 20 percent (for self-employed), and 24 percent (for atypical contracts). Notional interest rate. The choice of interest rate applied to the notional accounts and the annuity (benefit indexation) varies across countries and includes (1) the rate of growth of the covered wage bill, (2) per capita wage growth, and (3) GDP growth. Each country uses a different proxy for measuring the sustainable internal rate of return and for indexing benefits in disbursement.
Table B.1 Key Design Features and Transition Modalities for NDC Schemes
Country (year of establishment) Initial capital Price indexation No No
Contribution rate (%)
Notional rate of return during accumula- Post-retirement tion phase indexation Reserve buffer fund Explicit balancing mechanism
Italy (1999)
GDP growth
Latvia (1996)
For employees: 33 14 from 2012
Poland (1997)
12.22
Growth in covered wage bill Growth in covered wage bill Inherited from prior system Yes: compares liabilities and assets
Gradually through surpluses Gradually through surpluses
No: through indexation choice No: through indexation choice
No initial capital: combination of old and new system Initial capital determined using service years and national and individual wages Initial capital: present value of acquired rights as of December 31, 1997
Sweden (1999)
16.0
Growth in per capita covered wages
Price indexation from 2011 growth Price indexation including at least 20% of real wage Price indexation + difference between real per capita wage growth and 1.6% rate of return
Initial capital using earnings history from 1960 when born 1938+
Sources: Chlon-Dominszak and others 2012; Palmer 2006b; World Bank pension database. Note: DB = defined benefit; DC = defined contribution; GDP = gross domestic product; NDC = notional defined contribution.
161
162
China’s Pension System
Buffer fund. Two of the four countries have a buffer fund. Sweden inherited a major buffer fund from its pre-reformed scheme (over 30 percent of GDP at the time of reform). Poland has established a reserve fund through transfers from privatization assets and budgetary transfers that was used during the financial crisis to finance liquidity requirements of the pension system and for other purposes. Balancing mechanisms. Only Sweden has an explicit balancing mechanism, but all countries have, in principle, balancing that adjusts the notional interest and annuity conversion factor to disequilibria of pensions assets and liabilities and changes in life expectancy. Recognition of acquired rights. When moving to the new NDC scheme, three countries (Latvia, Poland, and Sweden) transformed acquired rights/contributions under the old scheme into an initial (notional) account balance that enables all active workers to be covered under the NDC scheme at the start of the reform. In Italy, only new entrants to the labor market after the reform was introduced are covered by the NDC scheme—individuals with 18 or more years of service credit at the time of reform remain under the old system. Workers who started contributing before the introduction of the NDC scheme in Italy will get benefits from both the old and new schemes.
Preliminary Lessons
Overall, the introduction of NDC schemes has generally gone smoothly, and the schemes all enjoy strong political support more than 10 years after their introduction. The current crisis has created stress for all pension systems, and NDC schemes in these countries have similarly been affected. A recent stocktaking exercise for Italy, Latvia, Poland, and Sweden offers the following tentative lessons (see also table B.1): • Sustainability and labor market incentives. Overall, the NDC schemes seem to meet expectations for financial sustainability and provide desired incentives for worker decisions regarding labor supply and retirement timing. Of course, significant differences are seen in the incentives in different countries that have established such NDC schemes depending upon the credibility of their reform efforts and the soundness of their implementation.
A Notional (Nonfinancial) Defined-Contribution Design
163
• Political dimensions. An NDC scheme is not a fool-proof approach and, therefore, needs to be carefully managed politically. As with other reforms, communication of the reform with stakeholders is as important in establishing political support as is the soundness of design, implementation, and administrative preparedness. • Recognition of acquired rights. When moving toward an NDC scheme, it is important to place all active workers on a level playing field by transforming acquired rights into an initial notional account balance in the NDC scheme. • Target replacement rates. The projected benefit levels of the reformed NDC schemes are lower than the schemes they replaced; however, they are still adequate by many accounts (for example, International Labour Organization standards). Overall, the mandatory system of these countries provides gross income replacement rates for persons with average incomes of 60–64 percent and net replacement rates of 75 percent in Italy, Latvia, and Poland. In Sweden, net replacement rates are approximately equal to gross replacement rates. • Financing of legacy costs. Carefully considering the legacy problem and how to finance it is essential. Lacking an explicit financing mechanism and taxing the current generations of contributors and retirees, in addition to unspecified budgetary transfers, weakens the link between contributions and benefits and undermines the credibility of the scheme. The recent financial crisis forcefully underscores the importance of having both a buffer fund and a well-designed explicit balancing mechanism, and subjecting both to comprehensive stress testing. All NDC countries without an explicit and built-up buffer fund (for example, all except Sweden) have been (or soon will be) obliged to take emergency measures to address crisis-induced fiscal shortfalls. In Latvia, measures include a temporary reduction of the contributions of the funded pillar to make room for the unfunded one; after a protracted debate, in Poland the contribution rate to the funded pillar was reduced from 7.3 to 2.3 percent in 2011, with a plan to raise it to 3.5 percent by 2018. It should be noted, of course, that such emergency measures were necessary for essentially all of the reformed pension systems in the former transition economies in Europe and Central Asia countries (see World Bank 2009). Even Sweden
164
China’s Pension System
may need to revise its current balancing mechanism, which relies on a nonactuarial estimator for the PAYG asset, which is heavily influenced by the financial crisis and not long-term developments. In its current formulation it does not allow digging into the (huge) buffer fund, which has primarily demographic smoothing objectives and thus enforced a reduction in the annual benefit indexation in 2010.
Notes
1. The introduction of a funded pension scheme in countries that have PAYG pension schemes results in transition costs as contributions from current contributors are diverted to funding and are, therefore, no longer available to pay benefits to current beneficiaries. 2. For the withdrawal phase, benefits can be indexed to changes in prices, to changes in wages, to the notional interest rate, or to some combination thereof. As a general rule, the higher the rate of indexation, the lower the initial benefit at retirement, and vice versa. If benefits are indexed at the notional interest rate, then both contributors and retirees are effectively sharing the burden (or the benefit) of a change in the notional interest rate. If another rate is selected, then typically benefits are readjusted periodically in accordance with an actuarial valuation reflecting changes in prices, wages, discount rates, and life expectancies. The current funded individual accounts use a common annuity factor of 139. Although this value was based on an assessment of these same variables, it should be periodically revised to reflect changing conditions. 3. An alternative—and technically more demanding—mechanism would be to immediately calculate the notional interest rate as the allowable growth of liabilities (this is the maximum rate at which the balance in individual accounts and pensions in payment can grow). Comparing total liabilities to total assets requires an approximation for the latter and an estimate of “contribution assets.” Although such an approach is technically demanding, it is conceptually promising (see Robalino and Bodor 2009). 4. Under steady-state conditions, the notional interest rate will equal the growth rate of the contribution base (gcb), the growth rate of wage sum (gws), and the growth rate of GDP (ggdp). Under real-world conditions, however, these rates will diverge, at least temporarily, as a result of (1) the maturation of pension schemes that leads for many decades to an expansion in the number contributors (which results in gcb being higher than gws, which will happen in China as a consequence of coverage expansion); (2) economic development, which typically leads to an increase in wages as a share of GDP (which results in gws being higher than ggdp, which appears to be starting in China after a
A Notional (Nonfinancial) Defined-Contribution Design
165
sharp fall in wage/GDP share in the 2000s in the face of mass rural to urban migration); and (3) economic and demographic shocks, which can and do lead to material deviations from steady-state conditions for relatively long periods. Economic shocks that translate into changes in wages and employment are reflected in all three growth rates but in a manner that results in differentiated outcomes for contributors and beneficiaries as well as differentiated outcomes for short- and long-term financial sustainability. Demographic shocks, such as population aging, are also reflected in the rates but only partially and in a differentiated manner. 5. For a stochastic simulation comparing different proxies for the notional interest rate and the related stability of the balancing mechanism, see Robalino and Bodor (2009). 6. In high-income countries, life expectancy at birth has been increasing over the last few decades at approximately 30 months per decade. Life expectancy at age 60, however, has increased at about half this value. Consequently, the actual number of years someone aged 60 can be expected to live is underestimated by about two to three years (or 10–15 percent) when life expectancy at age 60 is applied at retirement and not subsequently adjusted over time. 7. See Robalino and Bodor (2009). 8. This rule-of-thumb is consistent with recent estimates generated by “stress tests” of the impact of the economic crisis on the pension scheme under alternative crisis scenarios using the World Bank’s PROST (Policy Reform Options Simulation Toolkit) model for a synthetic European transition economy. Under a relatively rapid recovery scenario, the aggregated deficit of the pension scheme is four to five months of expenditures. Under a severe crisis scenario, the aggregated deficit is some 16 percent of GDP, or roughly two years of annual expenditures (see Hinz and others 2009). 9. The contribution rates for the funded scheme have been temporarily adjusted to create budgetary room in response to the financial and economic crisis (see Chlon-Dominszak and others 2012).
References
Alho, J., J. M. Bravo, and E. Palmer. 2013 “Annuities and Life Expectancy in NDC.” In Nonfinancial Defined Contribution Pension Schemes in a Changing Pension World: Gender, Politics and Financial Stability, vol. 2, ed. R. Holzmann, E. Palmer, and D. A. Robalino, ch. 22. Washington, DC: World Bank and Swedish Social Insurance Agency. Chlon-Dominszak, A., D. Franco, and E. Palmer. 2012. “The First Wave of NDC Reforms: The Experiences of Italy, Latvia, Poland and Sweden.” In Nonfinancial
166
China’s Pension System
Defined Contribution Pension Schemes in a Changing Pension World: Progress, Lessons and Implementation, vol. 1, ed. R. Holzmann, E. Palmer, and D. A. Robalino, ch. 2. Washington, DC: World Bank and Swedish Social Insurance Agency. Hinz, R., A. Zviniene, S. Biletsky, and T. Bogomolova. 2009. “The Impact of the Financial Crisis on Public Pension Systems: Stress Testing Models of Mandatory Pension Systems in Middle Income and Developing Countries.” Social Protection and Labor Department, World Bank, Washington, DC.. Palmer, E. 2006a. “What Is NDC? to NDCs—Issues and Models.” In Pension Reform: Issues and Prospects for Nonfinancial Defined Contribution (NDC) Schemes, ed. R. Holzmann and E. Palmer, 17–33.Washington, DC: World Bank. ———. 2006b. “Conversion to NDCs—Issues and Models.” In Pension Reform: Issues and Prospects for Nonfinancial Defined Contribution (NDC) Schemes, ed. R. Holzmann and E. Palmer, 169–202. Washington, DC: World Bank. Robalino, D., and A. Bodor. 2009. “On the Financial Sustainability of the Pay-asYou-Go Systems and the Role of Government Indexed Bonds.” Journal of Pension Economics and Finance 8 (2): 153–87. World Bank. 2009. “Pensions in Crisis: Europe and Central Asia Regional Policy Note.” Human Development Sector Unit, World Bank, Washington, DC.
APPENDIX C
Evaluation of Legacy Costs
Understanding the Liabilities
Defining, forecasting, and planning for the financing of legacy costs for urban pension schemes in China is essential regardless of whether or not they are reformed. In any pension system, accrued-to-date liabilities should be matched by corresponding assets if the system is to be sustainable. The options for restoring sustainability include lowering benefits, delaying retirement, reducing the generosity of indexation policies, increasing contributions, and effecting budgetary transfers. In most countries, neither parametric nor structural reforms generally can reduce accrued-to-date liabilities significantly without reducing the accrued rights of current workers. Instead, reforms typically focus on shifting schemes toward financial sustainability in the future (that is, to reducing the actuarial deficit for future generations). This leaves an uncovered liability—generally referred to as the legacy cost—that must be financed regardless of reform. Legacy costs can be broadly defined as the actuarial deficit of a reformed pension scheme. They arise from two sources, namely (1) costs associated with the unreformed scheme (which must be financed regardless of reform) and (2) costs created by the reform, such as reduced contribution rates. Examples of the former type in China include the
167
168
China’s Pension System
move from higher benefits (for old men and middle men) to lower benefits for new entrants since 1997 (new men). (See figure C.1 for a definition of these terms.) The financing approach adopted has been to essentially retain the pre-1997 contribution rate, thereby burdening new men and some middle men with higher contribution rates than are necessary to finance their own benefits. Defined-contribution schemes tie future benefits to future contributions so that even though the resources contributed may be diverted to pay existing or future beneficiaries, a long-term balance between contributions and benefits is still required for sustainability. Under FDC and NDC schemes, contribution rates are fixed, and, by design, entitlements in individual accounts cannot be less than what is contributed without undermining the credibility of the scheme. The significance of legacy costs for countries with large and growing elderly dependency ratios—including China—is that, unless these costs are adequately estimated and prudently financed, they can undermine fiscal stability and public credibility, the very purpose of reform. This chapter provides a conceptual framework for understanding legacy costs, then discusses the estimation of the liabilities of China’s urban old-age pension system, and proceeds to estimate the pay-as-you-go asset, legacy costs, and phasing. It then explores the issue of financing legacy costs and the lessons of the Liaoning pilot and concludes by providing broad estimates and recommendations for financing legacy costs. To design a viable long-term financing plan for legacy costs, the following steps are necessary: • Estimate accrued-to-date liabilities of the reformed system; in China, this is complex because accrued rights reflect a variety of prior reforms as well as special ad hoc provisions • Estimate pay-as-you-go assets and any financial assets and compute overall legacy costs as the difference from the total accrued liabilities • Translate estimates for total legacy costs into annual cash flow requirements • Establish a financing plan and identify budgetary and nonbudgetary resources to pay for the costs over time. Reasonable but rigorous estimates of pension scheme liabilities, based on a clear understanding of their underlying composition, are essential to financing them. In China, estimating legacy costs is particularly complex because different categories of entitlements already exist as a result of the provisions of pilot systems and transition arrangements established over
Figure C.1 China Urban Old-Age Insurance System: Categorization of Beneficiaries and Their Benefit Entitlements
2006 2010
1997
Old Men–those who retired prior to 1997; entitled to receive benefits under Doc. no. 26 provisions Middle men–those who were employed prior to 1997 and retired between 2006 and 2010; entitled to benefits under Doc. no. 38 provisions including transitional pension
Middle Men–those who were employed prior to 1997 and retired before 2006; entitled to benefits under Doc. no. 26 provisions including transitional pension
Middle Men–those who were employed prior to 1997 and continued working through 2006; accrual of benefits under Doc. no. 38 provisions including transitional pension up to 2010 New Men–those who started employment after 1997; accrual of benefits under Doc. no. 38 with no transitional arrangements up to 2010
Active workers employed prior to 2010; entitled to notional deposits based on Doc. no. 38 accrual; future accruals based on newly reformed provisions New entrants after 2010; accrual of benefits based on newly reformed provisions
Retired workers from PSUs and civil servants continue to receive benefits under existing provisions Employees of PSUs and civil servants who were employed prior to 2010; accrual of benefits under their respective relevant provisions up to 2010
Source: World Bank compilation from relevant policy documents. Note: PSU = public sector unit.
169
170
China’s Pension System
the last 15 years. If a different policy design were to be established, the liabilities associated with all entitlements accrued to the effective date of the new regime must be aggregated and treated as potential liabilities that must be financed. Regardless of how these liabilities are defined, the key is to formulate a methodology that is transparent and unbiased with estimates of magnitude based on generally accepted actuarial principles and consistent with macroeconomic forecasts. It is equally important that explicit decisions be made to ensure that any financing arrangement that emerges reflects a systematic process rather than the ad hoc negotiation with individual provinces. If the authorities elect to introduce an NDC-based design for the old-age insurance system, it will be necessary to compute benefit entitlements based on past structural reforms and subsequent policy revisions and then translate such entitlements into initial NDC capital in accordance with internally consistent assumptions. Because of the highly decentralized nature of the existing urban old-age insurance system, a decade of different pilot provisions, varying degrees of economic development, and changing demographic conditions, it would be unrealistic to expect that any reformed regime could simply assume the burden of legacy liabilities without substantial computational analysis. To appreciate the underlying complexity, it is first necessary to appreciate the historical development of the urban old-age insurance scheme in China, including the key provisions of the 1997 reform and the policy changes initiated in 2005. The 1997 reform (promulgated by Document No. 26) created distinct groups of beneficiaries—old men, middle men, and new men—with different benefit entitlements. In 2005, Document No. 38 preserved the entitlements of those who had already retired as of 2005 but made further amendments to how benefits would be determined for middle men and new men, who would still be contributing to the system. With the reforms proposed in this report, the acquired rights of all three groups of beneficiaries would be preserved up to the effective date of the reform, and future service accruals would comply with the reformed provisions. Given this complexity, the liabilities established under the provisions of Document No. 26 and subsequently revised by Document No. 38 must be accounted for and financed separately to avoid undermining the sustainability of the proposed reforms. Figure C.1 provides a schematic representation of the timeline, the categories of beneficiaries, and the basis of their entitlements. Boxes C.1 and C.2 provide a brief description of the key provisions of Documents
Evaluation of Legacy Costs
171
Box C.1
Provisions under Document No. 26 of 1997
The following is a summary of provisions under the status quo as per Document No. 26: • Coverage. Coverage under the old-age insurance program is applicable to all types of enterprises and their employees as well as to individual workers in urban areas. • Contribution rates. Total contributions by enterprises are not supposed to exceed 20 percent of the contributory wage bill. Total contributions to individual accounts are set at 11 percent of wages. From a rate of at least 4 percent of wages in 1997, individual employee contributions were set to increase by 1 percent every two years thereafter until the contribution rate reaches 8 percent. Although the employee contribution rate was specified to increase to 8 percent of wages, the enterprise contribution rate was specified to decrease to 3 percent. • Contributory wage. Employee contributions are subject to a minimum of 60 percent and a maximum of 300 percent of the local average wage. Those who earn less than 60 percent of the local average wage must contribute on the basis of an earnings level equal to 60 percent of the local average wage. • Retirement benefits. Retirement benefits are determined based on each worker’s status as of December 31, 1996. Workers who were already retired and were receiving pension payments in 1996 are referred to as old men, who continue to receive their pension entitlements in accordance with the preexisting definedbenefit formula in effect prior to the reform. Workers who started contributing after 1996 are referred to as new men. Their pension benefits consists of two parts: (1) a monthly basic pension equal to 20 percent of the last year’s local average wage and (2) a monthly pension payable from the individual account derived by dividing the accumulated account balance at retirement by 120. Workers who were not yet retired in 1996 but were already contributing to the old-age insurance system in 1996 are referred to as middle men. Their pension benefits were to be determined on the same basis as the new men, but they were to be entitled to a transition pension based on the following formula: (P × A × Q × M) + K, (C.1) (continued next page)
172
China’s Pension System
Box C.1 (continued)
where P = the accrual factor (typically ranging from 1 percent to 1.4 percent) A = local average wage for the year before retirement Q = an index of average contributory wage and calculated as (X1/A1 + X2 /A2 + X3 /A3 +…+ Xn /An)/n, where X1, X2, X3, …, Xn represent the individual’s contributory wage levels for the years 1996, 1997, 1998 through the year before retirement, and A1, A2, A3, …, An represent the average local wage for the same years; and n is the length of contributory service, that is, the years between the time individual accounts were first established (assumed to be 1996) through the year before retirement M = length of service before the establishment of the individual account; for the purpose of this projection, 1996 is assumed to be the year when individual accounts were established K = fixed amount of supplement (this amount varies by province and municipality and can range from 0 to 120 RMB per month); for the purpose of these projections, a monthly amount of 75 RMB was assumed. In many provinces and municipalities, it is common practice to provide middle men who retired after 1996 with pension benefits that are the higher of (1) a pension determined using the calculation described above and (2) a pension based on the defined-benefit formula prior to the reform. Pensionable wage. The reference wage used in determining the basic pension is defined as the local average wage, including the wages of the xia gang workers in the year before retirement (xia gang workers—literally “step down from the post”— were those retained with partial or no pay in the process of SOE restructuring). Normal retirement age. Age 60 for men and age 50 for women in general (but age 55 for women who are in managerial positions). Termination benefits. Workers with less than 15 years of contributory service will not be entitled to receive any basic pension. Accumulations under the individual accounts will be refunded as a single lump sum. Indexation of benefits. Although Document No. 26 did not indicate a specific level of postretirement indexation, other State Council documents made reference to indexation based on some percentage of the increase in the nominal wage. However, Document No. 26 did not specify whether the pension amounts derived from the individual accounts would be subject to the same level of post-retirement indexation.
•
• •
•
Evaluation of Legacy Costs
173
Nos. 26 and 38. To develop a viable financing plan, reasonable assumptions for determining previous entitlements to be applied towards the proposed NDC scheme need to be made with the following principles: (1) workers who are currently members of the urban old-age insurance system should receive all of their accrued past service as a notional deposit to their individual accounts, (2) civil servants and PSU employees should receive the same treatment, regardless of their past contributions, (3) workers entering the urban retirement system in the future should be subject to the newly reformed conditions and benefit formulas (although the retirement age would only gradually be increased to age 65 for men and women), and (4) the urban old-age insurance system should apply the same provisions throughout China, regardless of location. The basis for these constraints reflects many other contextual factors that lie outside the realm of this discussion on legacy costs. Past policy decisions contributed significantly to the current problem of legacy costs in ways that could not have been anticipated by policy makers when the policies were designed. Provisions made before 1997, for example, made possible the liberal allowance of early retirement as a way to facilitate the reform of state-owned enterprises and to compensate for lower levels of income associated with hazardous occupations. This practice came to be seen as a convenient way of meeting the requirement to pay transition pensions to those with insufficient time to accumulate adequate accumulations in their individual accounts under the provisions made after 1997. These indirect consequences have greatly compounded the challenges created by the legal entitlements allowed in the past.
Estimating the Liabilities of China’s Urban Old-Age Insurance System
The aggregate liabilities accrued to date—which is the relevant measure of China’s implicit pension debt for its urban old-age insurance system— is equal to the present value of pensions in disbursement and the present value of any acquired rights to future benefits. Although the liabilities of benefits in disbursement are typically simple to calculate, although in China, estimates must take into account various special provisions that will likely increase their cost. Likewise, under steady-state conditions, the present value of acquired rights is typically easy to estimate. In China, however, estimates are complicated by the fact that rights arise from three distinct groups and benefits.
174
China’s Pension System
Special provisions for old-age pensions were established to compensate low-income earners engaged in hazardous occupations and to honor the previous cradle-to-grave promises made to older workers who contributed during China’s economic reform years. The retrenchment and restructuring of state-owned enterprises during economic reform contributed heavily to unfavorable pension system demographics. Pension funds traditionally relied on employment in state-owned enterprises for the bulk of their contributions. However, since the early 1990s, growth of employment in state-owned enterprises has fallen and has continued to lag behind employment in urban enterprises. This was accompanied by waves of early retirement as workers in their forties and fifties—who were unable, unwilling, or without the means to continue meaningful employment—were gradually displaced. In the absence of an adequate social safety net, this trend continued as workers opted for early retirement as a means to replace their lost income. Over time, early-retirement entitlements came to be seen as a kind of substitute for other forms of social benefits such as unemployment support, severance pay, and compensation for employees in bankrupt companies, as well as social subsidies for disabled workers and workers in hazardous occupations. Consequently the liabilities associated with paying for the benefits of these early retirees—many of whom are below the statutory retirement age—have come to be borne by existing and future generations of contributors in the form of higher contribution rates (in excess of what is required to pay for their own pensions). The acquired rights of three distinct groups must be differentiated when estimating their related liabilities: (1) Rights acquired for new men reflect, in principle, the pre-reform steady-state, so the computation of their associated liability should be straightforward (see box C.1). Provincial pilots, provincial differentiation, and changes in regulation, however, do not allow a simple application of homogenous rules but require a more differentiated approach (see box C.2). (2) Rights acquired under the transition rules and grandfathered benefits for old and middle men. The liabilities associated with pension benefits committed to old men should be largely in disbursement and, hence, relatively easy to estimate. It will probably be more difficult to do this, however, for middle men, for whom special transition rules have been
Evaluation of Legacy Costs
175
Box C.2
Provisions under Document No. 38
Subsequent to the conclusion of the Liaoning pilot program as guided by under Document No. 42, the State Council modified key provisions of Document No. 26 of 1997 by introducing Document No. 38 in December 2005, summarized as follows: • The basic pension is determined at the rate of 1.0 percent for each year of contributory service (minimum of 15 years required) to be applied against the average of the last year’s local wage and an index of an individual’s average contributory wage over the contributory period. • The new formula for determining the basic pension will help to reduce the incentive for workers to quit the system prematurely or to underreport their contributory wages. • Individual accounts will be disbursed monthly based on the accumulated balance divided by the prescribed age-specific annuity factor at time of retirement. • The actuarially imbalanced amortization factor of 120 for individual accounts has been eliminated and age-specific factors introduced that are now much closer to an actuarial equivalent factor (although there is room for improvement). • As in the case of the Liaoning pilot, the total contribution rate to individual accounts was reduced to 8 percent of payroll. However, the account was to be gradually funded, starting from funding 3 percent of payroll from January 2006. Contributions to individual accounts were to be segregated from the social pooling component. • The level of funding of individual accounts was to be gradual, beginning with a few relatively well-off provinces in 2006. By mid-2009, 13 provinces had migrated toward a partially funded individual account system. • Future pensions were to be indexed to a certain percentage of average wage growth in the local economy over the last few years; pension adjustments have largely been provided as flat amounts depending on the existing level of pension payments. • Specifics pertaining to the level of funding, financing responsibilities, the model of fund management, as well as the rights of provinces to introduce partial funding were not specified.
176
China’s Pension System
established. The accrued benefits for middle men from the 1997 reform up to the date when a new reform might be introduced follow closely those of new men. (3) Rights acquired by newly covered groups such as employees of PSUs and civil servants, who are entitled to receive credit for past service. Under the reform proposed in this report, the definition of liabilities will also have to be extended to include past service liabilities for newly covered groups. Such past service entitlements would be determined based on past benefit provisions, years of service up to the conversion date to the newly reformed system, and wages effective at the time of conversion (regardless of whether prior contributions had been made). Because these liabilities are already financed through the general budget, however, estimating them only makes them explicit; they may not require an explicit source of financing. Reconciling the accrued liability with the determination of initial capital. Although traditional actuarial methods can be used to calculate the acquired rights for each of these three groups for the purpose of computing their related accrued-to-date liability, the amount relevant for the legacy cost calculation will depend on the principles and timing ultimately used to commute these acquired rights into the initial capital that will be recorded in the individual accounts of the proposed NDC scheme. Different approaches can be taken, including (1) calculating initial capital based on the balances that would have accrued as a function of an individual’s past wages and the notional interest rate as if the individual had been in the NDC scheme from his or her entry into the workforce (that is, estimation from below), (2) applying actuarial principles to determine the benefit to which an individual was entitled based on the rules of the prior scheme (that is, estimation from above), or (3) some combination of these two approaches. Once the process of commutation has been determined and initial capital has been awarded, the aggregate value of this initial capital plus the present value of benefits in disbursement constitute the overall relevant liability of the pension scheme—and the only computation that matters for the determination of the legacy costs.
Estimating the Pay-as-You-Go Asset, Legacy Costs, and Phasing
The concept of a pay-as-you-go (PAYG) asset is a new but powerful tool for pension analysis. It is an integral component of a new conceptual
Evaluation of Legacy Costs
177
framework that establishes a balance sheet for PAYG schemes in much the same way as is done for partially and fully funded schemes, thereby allowing the straightforward determination of a scheme’s solvency. The asset side of the scheme balance sheet includes the PAYG asset, defined as the net lifetime tax of the current and all future generations (in other words, the present value of cash flows collected by the pension institution) plus any financial assets associated with the scheme. This net lifetime tax is the difference between the present value of contributions that this and all future generations will be expected to pay and the present value of benefits that it and future generations can expect to receive. If total assets (computed as the sum of the PAYG asset and any financial assets) are smaller than total liabilities (computed as the present value of all accrued to date pension rights of pensioners and workers), the scheme is insolvent, and the difference between the two represents an implicit unfunded liability that needs to be financed. Although conceptually straightforward, it is less obvious how to accurately estimate the value of the PAYG asset, and so various options have been proposed. For systems near steady-state conditions (for example, the Swedish NDC scheme), the pay-as-you-go asset (GA) is estimated as period contribution revenues (Ct) times the turnover duration (DTt), the latter of which is approximated by the money-weighted average age of a retiree minus the money-weighted average age of a contributor (see Settegreen and Mikula 2009): GAt = Ct × DTt (C.2)
Another steady-state approach approximates the net assets of each cohort Z(a, t) at age a at time t and aggregates net assets across current workers and future entrants (see Robalino and Bodor 2009). This estimate (in expectation value E) is then used to calculate the notional interest rate (that is, the implicit rate of return [IRR]). This approach performs better in stochastic simulations of the stability of the balancing mechanism compared with other approximations, such as average wage growth and GDP growth. E( PAt ) =
∑
a= f
L
N ( a , t )Z ( a , t ) +
k =t +1 b = f
∑ ∑ ΔN(b, k )Z(b, k ),
T
L
(C.3)
where N(a,t) are the contributors of age a at time t, ΔN(b,k) represents new entrants to the scheme of age b at time k, L is the length of contribution, and T is the planning horizon.
178
China’s Pension System
Although such calculations under steady-state assumptions provide useful benchmarks for the PAYG asset, they are too crude for application to China given expected demographic changes, growth of the urban labor force, improvements in coverage, and changes in the relationship of (covered) wage growth and GDP growth over the coming decades. Such dynamic changes can be reasonably captured only by an actuarially based projection model that has the capacity to handle differences in benefit levels for various subgroups. One obvious choice would be the World Bank’s Pension Reform Options Simulation Toolkit (PROST) model. Calculating the PAYG asset for an NDC scheme is easier than calculating one for a defined-benefit scheme. For each individual and benefit cohort, the present value of contributions will, by definition, equal the present value of pension benefits if the notional interest rate is used as the discount rate. Hence, the key driver for computing the PAYG asset is the proper selection of notional interest rate, which depends on projected demographic development, coverage, patterns of wage growth, and the assumed discount rate. For China (as for other emerging economies), key assumptions for this sort of projection should be derived from a macroeconomic model that considers the transitional path of covered wage growth relative to GDP growth until a steady-state share of wages in GDP is ultimately attained. Computing the PAYG asset from such a projection model has the great advantage that the results can be crosschecked, because total legacy costs must be equal to the actuarial deficit (that is, the present value of future annual cash flow deficits) of the reformed system. If this is the case (presumably after some adjustments and recalibration), the resulting annual cash flow deficits represent the scheme’s estimated annual financing needs (that is, the phasing of annual legacy costs). Given that the reform proposed herein assumes that the provincial authorities will bear responsibility for financing legacy costs, at least until national pooling can be implemented, the estimation of liabilities, the PAYG asset, legacy costs, and their annual phasing would need to be done for each of the provinces using a consistent macroeconomic framework and methodology. This is an ambitious but not impossible task.
Financing Legacy Costs—Lessons from the Liaoning Pilot
The World Bank’s evaluation of the Liaoning pilot provides an instructive example of how this process of estimating and financing legacy costs can be handled (World Bank 2004). For several years after the Liaoning pilot
Evaluation of Legacy Costs
179
began, budgetary support was deemed adequate to cover the cost of high replacement rates from the old system, early-retirement pensions, as well as part of the transition costs. Contribution revenues were also used to pay for the cost of systemic design flaws. This led to higher than required contribution rates, which resulted in higher labor costs. Further analysis revealed that Liaoning’s total implicit pension debt amounted to a staggering 153 percent of regional GDP in 2001 values, of which only 56 percent was the liability associated with the steady-state system, whereas 17 percent was due to systemic flaws, 4.3 percent was due to early retirement, and 23 percent was due to the transition benefit provision. If the system had been in steady state, it could have maintained positive net cash flow throughout the projection with a sustainable contribution rate of about 48 percent of payroll. The total financing gap was projected to be 206 percent of the 2001 GDP. From an evaluation of the Liaoning pilot, it became clear that in the absence of a reduction in pension benefit payments, the shift to fully fund the individual accounts would result in an enormous funding gap in the social pooling portion of the system. During the pilot phase, Liaoning’s pension expenditures were financed partly by the central government and partly by the local government. Budgetary transfers equivalent to between 1.0 percent and 1.4 percent of Liaoning’s GDP allowed the accumulation of individual accounts to grow as designed and kept the pension system’s overall budget balanced from 2001 to 2004. It appears that the financing requirement was made according to a clearly identified rule specifying the responsibilities of various levels of government. With the aim of covering the financing gap created by the diversion of contributions to individual accounts, the authority’s plan was for the central and provincial governments to finance 3.75 percent and 1.25 percent of the estimated contributory wage bill, respectively. In reality, however, between 2001 and 2004, transfers were made in annual flat amounts. Although the overall budgetary transfer was significantly higher than the cost attributed to changing over to the reformed system, the method used for establishing the levels was unclear. Within the province, redistribution across municipalities was, in principle, facilitated by the Provincial Adjustment Fund according to a redistribution formula. Still, some of the main elements of the formula were not explicitly spelled out, thus leaving room for discretion. For the period of the pilot that was evaluated, it was clear that the huge financial outlay created was largely due to the need to make up the difference between the replacement rates that the steady-state
180
China’s Pension System
system could be expected to support and the replacement rates actually in place when the pilot was being implemented. Specifically, it was noted that although the proposed scheme’s total replacement rate for a male worker at age 65 was estimated to be 48 percent (and that for a female worker at age 65 to be 43 percent), this was significantly lower than the average replacement rate of 88 percent observed in Liaoning in 2001. It should be emphasized that the focus here is not on how the Liaoning experiment went or to make a case for reproducing the Liaoning experience in other provinces. In fact, the final chapters on Liaoning’s initiative to finance its pension reform have yet to be written. Nevertheless, a comprehensive and carefully documented study carried out by the World Bank provides valuable lessons learned for other pension financing initiatives that must deal with significant legacy costs. Tackling legacy costs is not a theoretical exercise. Up to a point, the concepts and approaches presented in this document can help with the systematic preparation of a financing plan by pointing out important issues to consider, as well as by providing practical suggestions on how legacy costs can be addressed based on empirical studies. Yet, as this document has tried to show, most of the real work begins only once certain parameters have been defined and specific assumptions made. In other words, as much as the principles and frameworks can be used for reference, no substitute is available for high-quality actuarial projections and informed calculations for generating solid estimates and for contextualizing their requirements to guide decisions by policy makers.
Broad Estimates of Legacy Costs, Their Phasing, and Suggested Financing
This section provides a simplified methodology for estimating the legacy costs of an NDC reform both for the urban old-age insurance system as well as for civil servant and PSU schemes effective January 1, 2008 (the date of the most recently available annual data).
Legacy Cost Estimation Methodology
The starting point for the estimation is the pension system balancing condition suggested: PL ≤ PA. (C.4)
Evaluation of Legacy Costs
181
Equation (C.4) suggests that the present value of pension liabilities (PL) must be less than or equal to the present value of pension assets. Postreform, pension liabilities consist of the present value of pension benefits in disbursement (PB) and initial capital (IK) for all active workers (that is, the present value of accrued rights under the old system) for all schemes that are consolidated and integrated into the new scheme to include the urban scheme (us), schemes for civil servants (cs), and schemes for PSUs (psu): PL = PB + IK with and PB = PBus + PBcs + PBpsu IK = IKus + IKcs + IKpsu Postreform, pension assets (PA) consist of financial assets (FA), the PAYG asset (GA), and legacy costs (LC) for each of the systems, which have been integrated with legacy costs as the residual. Written in the aggregate: PA = FA + GA + LC (C.6) Solving for legacy costs (LC) delivers an equation that can be used to estimate legacy costs for all three integrated systems separately or on an aggregated basis. To this end, a decomposition of changes in legacy costs from the unreformed scheme is employed because this generates insight into how to reduce legacy costs beyond explicit financing (see Holzmann and Jousten 2013). LC = LCu + ΔLC = LCu + ΔPB + ΔIK − ΔFA − ΔGA LCu = legacy costs of unreformed scheme (C.7) (C.5)
Preliminary Cost Estimates
A decomposition of equation (C.7) can used to estimate legacy costs by applying actuarial techniques and estimating the actuarial value of the unreformed and reformed components. This section proceeds using a simplified approach that requires only a few assumptions and proxies. The reform should leave the financial assets and—with full commutation of acquired rights—the liabilities as well unchanged (that is, ΔFA, ΔPB, and ΔIK are all zero). In reality, of course, room is available to reduce legacy costs by reducing the liability (that is, by making ΔPB and ΔIK negative), for example, by changing indexation rules or by manipulating the discount rate when transforming acquired rights into initial NDC
182
China’s Pension System
capital. The unreformed system also had positive legacy costs (that is, LCu>0) resulting from early-retirement rules and the commitments to old and middle men not covered under the steady-state contribution rate before reform. In our approach these old legacy costs are captured by applying the full cost covering contribution rate to the calculation of the (old) PAYG asset and its changes. To estimate (gross) legacy costs, one needs (1) the cost-covering contribution rates for all three unreformed schemes (CRu), (2) the sustainable new contribution rate (CRr) that is chosen by the authorities in line with their targeted replacement rate, and (3) an estimate for the level of the PAYG asset for the unreformed scheme. For the latter, the balancing condition (of liabilities equal to assets) is used to estimate the implicit pension debt (IPD) of the unreformed scheme. Under these simplifications, the following estimator for the legacy costs is obtained: LC = ΔLC = ΔGA = IPDu × (CRu − CRr)/CRu (C.8)
No recent estimates have been made for the implicit pension debt of the urban scheme, much less for that of civil servant and PSU schemes. However, one can use the relationship between implicit pension debt (IPD) and the annual expenditure (PEX). Under steady-state conditions, the ratio of IPD and PEX should be constant (about 30 to 35), whereas in maturing schemes the ratio can be much higher (even infinite). The magnitude of this ratio can be motivated by the average number of years a retiree receives a pension (for example, 15) plus the average number of years the average worker has accrued rights (for example, 20 out of 40 years working) and cross-checked against estimated ratios of mature and immature schemes (see Holzmann and others 2004). The estimated ratio in 2001 was roughly 60 for the urban old-age insurance system (this is the last available IPD estimate for the urban system as is discussed in Sin 2005 and World Bank 2006). The estimated ratio for a more mature system in Liaoning would be 48. This provides a range of ratios with which to estimate the annual expenditure. The analysis below uses a range of 40 to 60 for the urban scheme, and 35 to 48 for civil servant and PSU schemes (which are believed to be more mature). For the cost-covering contribution rate of the schemes, an older estimate of 35 percent for the urban scheme has been used (see World Bank 2006); the rate for civil servants (their scheme is noncontributory) and
Evaluation of Legacy Costs
183
PSUs has been estimated from their pension expenditures and overall wage bill providing similar levels. Applying these contribution rates to the low and high estimates of IPD gives us estimates for the legacy costs in table C.1. The estimates vary, of course, as a function of contribution rate chosen for the new NDC scheme (15 percent, 20 percent, or 25 percent). Table C.1 suggests the following: • The IPD estimates for all three schemes amount to between 155 percent of GDP (low estimate) and 199 percent of GDP (high estimate). Although the expenditure share of state organ workers is somewhat larger, the assumed higher maturity of their schemes translates in a lower IPD share of roughly one-fourth of total IPD. This is translated into the legacy costs as the estimated cost covering contribution rates are broadly similar. • The wide range of estimated legacy costs results from the equally wide scenarios of steady-state contribution rates for the new NDC scheme based on a similar range of target replacement rates. The lower the chosen contribution rate, the higher the legacy costs; but the absolute size of legacy costs under all rates is noteworthy. Choosing a contribution rate of 15 percent (which would result in an estimated replacement rate of about 40 percent at age 65 for men and women) would result in aggregate legacy costs of 89 percent (on the low end) or 113 percent of GDP (on the high end), respectively. These estimated costs are split between private and public sector schemes roughly by 3 to 1. In the case where a new contribution rate of 25 percent were to chosen (close to the estimated steady-state rate of the unreformed urban scheme of 27 percent) the total legacy costs would fall into the range of 44–56 percent of GDP. • These gross legacy costs do not fully translate into additional fiscal costs even if they were to be made explicit. The current urban old-age insurance system, civil servants, and PSU schemes already receive government subsidies that are included in these estimates. These implicit and explicit subsidies are of particular importance for the public sector schemes that have not imposed contributions on participants (that is, civil servants) or imposed low rates of contributions to finance pension expenditures (PSUs). Perhaps as much as three-quarters of legacy costs for the civil service and PSU schemes are already financed by government
184
Table C.1 Estimates of Legacy Costs under an NDC Reform Costcovering contribution rate (%) 35 36 34 15% 67 7 15 89 20% 50 5 11 66 25% 34 4 7 44 Legacy costs (low IPD estimate): new contribution rate % of GDP Legacy costs (high IPD estimate): new contribution rate % of GDP 15% 84 9 20 113 20% 63 7 15 85 25% 42 5 9 56
Implicit pension debt (% of GDP) High estimate 147 16 36 199
Estimates 2008
Pension expenditure (% of GDP)
Low estimate
Contribution rate Urban system State organs PSU Total
2.46 0.34 0.75 3.54
118 12 26 155
Source: World Bank estimates.
Evaluation of Legacy Costs
185
revenues. More data would be needed improve the precision of the estimates. What is clear, however, is that delaying reforms of public sector pension schemes will not save fiscal resources; rather, it would make the costs more expensive on a present-value basis. • The estimated legacy costs for the urban old-age insurance system have a transitory and a transitional element. The transitory element is the result of the 1997 reform that reduced benefits for new men (compared to middle and old men); this must be paid in any event. Currently it is financed through higher contributions by all workers (compared to what the new men can expect to receive in benefits). The transitional element will result from moving from a future (and higher) steadystate contribution rate under the unreformed scheme to the new (and lower) rate under the proposed NDC scheme. These additional costs are transition costs similar to those that result from moving from an unfunded to a partially or fully funded scheme. Hence a change from a 35 percent contribution rate to a 27 percent rate (the estimated steadystate contribution rate of the unreformed scheme) creates legacy costs already incurred by the system. A reduction of the contribution rate below 27 percent would create additional new and reform-induced legacy costs. The (average) estimated implicit pension debt of the urban system of 75 percent of GDP amounts to a very rough estimation of an inherited legacy cost of 30 percent of GDP and an estimated reforminduced legacy cost of 45 percent of GDP, assuming a new contribution rate of 15 percent is used.
Anticipated Phasing of Legacy Cost Expenditures
Establishing the magnitude of legacy costs for a scheme and making them explicit is only the first step in estimating when costs will actually come due and how they should be financed. The shape of legacy costs over time (that is, costs by year) is determined by the mechanism of transition employed from the old to the new schemes. If the transition is immediate (that is, all active workers are immediately transferred to the proposed new NDC scheme), then the legacy costs are front-loaded. The highest value will occur in the first year, gradually falling to zero and exhibiting a slightly convex curvature (see Holzmann 1998, figure 3.b). If the proposed new NDC scheme is restricted to new entrants only, then the legacy costs are back-loaded, rising from small values and peaking after roughly 40 years before gradually
186
China’s Pension System
falling over the next 40 years (Holzmann 1999, figure 4.b). Shifting some current workers into the new scheme (for example, everyone below the age of 40) shifts the peak costs 20 years after implementation (Holzmann 1999, figure 5.b). Starting the reform from an actuarially balanced scheme, one obtains aggregate legacy costs that are the same in present value whether the move is slow or fast. However, if the unreformed system is actuarially unsustainable, then a delay in moving to the new scheme adds greatly to the overall fiscal costs. If one supposes that legacy costs, net of existing ongoing existing government transfers, are, for example, 75 percent of GDP under a steadystate contribution rate of 15 percent, the initial annual costs would be slightly above 2 percent of GDP per year, declining to zero after all retirees with old commitments have exited the system (that is, potentially in 80 years or more). Most of the transition costs, however, would be disbursed in half this time. Legacy costs need not be entirely financed by the government through general revenues. Partially reneging on acquired rights through the design of transition rules is one option for reducing legacy cost, and the magnitudes of savings are far from negligible. For example, under a 4 percent real wage growth assumption, moving from full to partial wage indexation can reduce implicit pension debt (and, hence, legacy costs) by a sixth. The other promising (and realistic) option for China is to increase system coverage as a result of the better incentives offered by NDCs to join the formal sector, continued income growth as a proxy for increasing formalization, better enforcement, and further urbanization and growth of the urban labor force. From 1998 to 2008, coverage measured as a proportion of the urban labor force that contributes to the pension system increased from 39.2 percent to 54.9 percent (15.4 percentage points). This helped increase the reserves of the urban scheme from 0.7 percent to 3.3 percent of GDP (2.6 percentage points). Achieving a coverage rate of 90 percent by 2050 seems possible—and in line with international trends given the relationship between per capita income and coverage (see World Bank 2006). The increase in the urban labor force due to continued rural migration plus the increase in the coverage overall labor force should create a sizable cash flow because coverage increases reduce system dependency ratios below the old-age dependency ratios observed in the economy as a whole. If an increase in the retirement age takes place to hold the old-age dependency ratio constant, cash surpluses would be even larger.
Evaluation of Legacy Costs
187
A rough calculation suggests that system cash flows can co-finance the legacy costs by expanding coverage if a not too low new contribution rate is selected. To illustrate the magnitudes involved, a modeling exercise was performed that replicates the starting values of expenditures and revenues for 2008 for all three groups (employees of urban enterprises, civil servants, and employees of PSUs) integrated into an NDC scheme as well as their estimated legacy costs over a period of 80 years. The new NDC scheme is assumed to have a contribution rate of 15 percent or 20 percent, and various scenarios of coverage expansion are then simulated over the coming 40 years. Doubling coverage would result in full coverage under the urban scheme for a given labor force. An increase by 200 percent of contributors could result from an increase in the size of the labor force through further rural-urban migration and higher labor force participation. To keep things simple, demographic changes are ignored (de facto assuming that their impact is offset by high retirement ages and/or lower benefit levels). Figures C.2 to C.5 present the results for two contribution scenarios (15 percent and 20 percent) for both the gross annual deficit and legacy costs as well as their net values. For the latter, all legacy costs for government sector schemes are assumed to be already covered in the public finance domain. Figure C.2 shows the gross annual deficits (that is, the annual cash flows of gross legacy costs) of the reformed scheme under different scenarios of coverage expansion for selected new contribution rates of 15 percent (figure C.2, top panel) and 20 percent (figure C.2, bottom panel). The kinks in the plots reflect the assumptions of the model with regard to the phasing of the legacy costs, the timing of coverage expansion, and its impact on revenues, but not on the overall size of the legacy costs. Smoother transitions would somewhat impact the curvature but would not change the overall magnitudes of the plots. The initial deficit of 2 percent and 1.5 percent of GDP, respectively, reflects the drop in contribution revenues from cost-covering rates of about 35–15 percent and 20 percent, respectively. The gradual fall (under constant coverage rates) reflect the phasing out of the inherited legacy and reform-induced legacy costs over an assumed period of 80 years in addition to financing the inherited legacy costs that are the same under both contribution rate scenarios. Increasing coverage leads to a much sharper fall as revenues increase but initially without related expenditures. Once this happens (after assumed 20 years), the decrease flattens out. Once coverage increase is stopped (after assumed 40 years), the deficit increases again till the
188
China’s Pension System
Figure C.2 Phasing of Gross Annual Deficit under Different Degrees of Coverage Expansion and Contribution Rates
2.00 a. 15 percent
gross annual deficit (percent of GDP)
1.50
1.00
0.50
0
–0.50
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform b. 20 percent
2.50
gross annual deficit (percent of GDP)
2.00
1.50
1.00
0.50
0
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform AD-G (CE 0%) AD-G (CE 150%) AD-G (CE 50%) AD-G (CE 200%) AD-G (CE 100%)
Source: World Bank estimates. Note: AD-G = gross annual deficit; CE = coverage expansion.
Evaluation of Legacy Costs
189
common deficit line is reach (after 60 years). From that point onward, any additional revenues are fully matched by additional expenditure so that the deficit time line is only driven by remaining legacy costs. The effect of the selected new contribution rate on the deficit profile is only on level, not on shape. With a selected contribution rate of 15 percent the gross deficit never turns negative; with the higher selected contribution of 20 percent, the gross deficit profile turns negative only under the highest coverage expansion scenario. Figure C.3 translates these gross annual deficits into cumulative legacy costs in each year after the start of the reform. After 80 years, aggregated legacy costs stabilize for the baseline scenario because all inherited commitments will have been discharged. The aggregate amount is at 100 percent and 75 percent of GDP, respectively, depending on the contribution rate. The gross legacy costs, however, can get as low as 60 percent and 34 percent, respectively, for the highest coverage scenarios. The variations in the increases in coverage affect the magnitude of the gain in the reduction of gross legacy costs, amounting to about 10 percentage points of GDP for each 50 percentage point coverage increase under the lower contribution rate (15 percent) and about 13.3 percentage points of GDP for each 50 percentage point of coverage increase under the 20 percent contribution rate. A higher contribution rate has mechanically more leverage on coverage increase, but economically a higher contribution rate may not realize the same level of coverage expansion. Figures C.4 and C.5 show the phasing of net annual deficits and net legacy costs. The net values assume that expenditures and revenues for government sector schemes are already in the budget. Hence, from a fiscal viewpoint, only the reform costs for the urban pension scheme will create new fiscal liabilities that must be covered. In the proposed NDC scheme, the new contributions and new expenditures for the now integrated government sector employees fully balance because neither legacy costs nor coverage expansion are assumed. In figure C.4, the net deficit starts out at 1.4 percent and 1.05 percent of GDP, respectively; the time profile under a different expenditure scenario follows the logic of the gross deficit. As under the latter, with the lower contribution rate (15 percent) the deficit never becomes negative but does so even under less drastic coverage expansion scenarios with a higher contribution rate (20 percent). Aggregating net annual deficits into net legacy costs, the plots in figure C.5 exhibit much lower overall costs and even result temporarily in cumulative surpluses under the scenario of 200 percent coverage expansion and with a selected contribution rate of 20 percent. Even
190
China’s Pension System
Figure C.3 Phasing of Gross Legacy Costs under Different Degrees of Coverage Expansion and Contribution Rates
a. 15 percent 80 70 gross legacy costs (percent of GDP) 60 50 40 30 20 10 0
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform b. 20 percent
120
100 gross legacy costs (percent of GDP)
80
60
40
20
0
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform LC-G (CE: 0%) LC-G (CE: 150%) LC-G (CE: 50%) LC-G (CE: 200%) LC-G (CE: 100%)
Source: World Bank estimates. Note: LC-G = gross legacy costs; CE = coverage expansion.
Evaluation of Legacy Costs
191
Figure C.4 Phasing of Net Annual Deficit under Different Degrees of Cover Expansion and Contribution Rates
1.60 1.40 net annual deficit (percent of GDP) 1.20 1.00 0.80 0.60 0.40 0.20 0 a. 15 percent
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform b. 20 percent
1.20 1.00 net annual deficit (percent of GDP) 0.80 0.60 0.40 0.20 0 –0.20 –0.40 –0.60 –0.80 1 5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform AD-N (CE 0%) AD-N (CE 150%) AD-N (CE 50%) AD-N(CE 200%) AD-N(CE 100%)
Source: World Bank estimates. Note: AD-N = net annual deficit; CE = coverage expansion.
192
China’s Pension System
Figure C.5 Phasing of Net Legacy Costs under Different Degrees of Coverage Expansion and Contribution Rates
80 70 net legacy costs (percent of GDP) 60 50 40 30 20 10 0 a. 15 percent
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform b. 20 percent
60
50 net legacy costs (percent of GDP)
40
30
20
10
0
–10
1
5
9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 years after reform LC-N (CE: 0%) LC-N (CE: 150%) LC-N (CE: 50%) LC-N (CE: 200%) LC-N (CE: 100%)
Source: World Bank estimates. Note: LC-N = net legacy costs; CE = coverage expansion.
Evaluation of Legacy Costs
193
if this optimistic level of coverage expansion were to be attained, some transitory financing of the costs may still be needed (as is discussed below). For policy makers, the crucial conclusion that emerges from this analysis is the following: Reform measures that reduce acquired rights and contribute to the expansion of coverage may reduce legacy costs substantially. Doubling contributors alone over 40 years may more than halve the fiscally relevant net legacy costs to about 20–35 percent of GDP. Financing some 0.5–1 percent of GDP per annum over a period of 40 years from general revenues seems a surmountable fiscal burden. Of course, these estimates must be validated by actuarial study, but their broad magnitudes are unlikely to change significantly.
Financing Strategies for Legacy Costs
The financing of legacy costs using general revenues transferred to the proposed NDC scheme raises numerous issues that merit further study. Below we give preliminary thoughts on the issue of estimation and disbursement and on budgetary financing: • Conceptually, the use of budgetary transfers (on a monthly or annual basis) to the proposed NDC scheme should compensate the scheme for the lost revenues that will result from lowering the contribution rate to its equilibrium level and for honoring past commitments. Budgetary transfers should, of course, flow to the social security institution where revenue pooling takes place. If, initially, this is at provincial level, then estimations of legacy costs and transfers should be performed there. Although it is already methodologically complex to generate such estimates at the outset of reform, the challenge will become only more difficult as time passes and the counterfactual becomes increasingly blurred. Delay could create an incentive for the provincial authorities to game the process of estimation to maximize the size of the budgetary transfers irrespective of their underlying merit. This suggests that an initial estimation of the overall amount of provincial legacy costs should be conducted at the outset of the reform and a disbursement schedule should be established that extends, for example, for 40 years. The problem with such an approach is that the amount of budgetary support should logically fall over time if targets for coverage expansion are actually met. To sidestep this quandary, accelerated achievement of the government’s stated goal of national pooling would be advisable.
194
China’s Pension System
• The fiscal resources for budgetary transfers to finance legacy costs must be identified. Some are already in place (for example, the payment of pensions from the general budget for retirees from the civil servant and PSU schemes). Most others will need to be financed through reduced public expenditures or higher general revenues. For the latter, choices are limited and should respect efficiency and equity considerations. Tax theory (as well as ex ante simulations and econometric studies) suggests that capital taxation is not a good solution because it risks reducing the long-term growth rate. Income taxes are also generally thought to be more distortional than consumption taxes (for example, value-added taxes). Although the use of a robust and simple value-added tax has proven viable in many countries of varying levels of per capita income (and is conjectured to be less distortive in terms of individual labor supply and savings decisions than, say, income taxes), some studies call for caution (see Holzmann and Jousten 2013 for additional references). For China, currently underexplored revenue sources include property taxes, environmental and “sin” taxes, and SOE dividends.
References
Holzmann, R. 1998. “Financing the Transition to Multipillar.” Social Protection Discussion Paper Series No. 9808, World Bank, Washington, DC. December.., R. Palacios, and A. Zviniene. 2004. “Implicit Pension Debt: Issues, Measurement and Scope in International Perspective.” Social Protection Discussion Paper Series No. 0403, World Bank, Washington, DC.. Robalino, D., and A. Bodor. 2009. “On the Financial Sustainability of EarningsRelated Pension Schemes with ‘Pay-as-You-Go’ Financing and the Role of Government-Indexed Bonds.” Journal of Pension Economics and Finance 8 (2): 153–87.
Evaluation of Legacy Costs
195
Settegreen, O., and B. Mikula. 2009. “The Rate of Return of Pay-as-You-Go Pension Systems.” In Pension Reform: Issues and Prospects for Nonfinancial Defined Contribution (NDC) Schemes, ed. R. Holzmann and E. Palmer, 117–42. Washington, DC: World Bank. Sin, Y. 2005. “China: Pension Liabilities and Reform Options.” Working Paper Series on China, World Bank, Washington, DC. World Bank. 2004. “Liaoning Pension System Assessment Report.” Unpublished report, World Bank, Beijing. ———. 2006. China: Evaluation of the Liaoning Social Security Reform Pilot. Human Development Sector Unit East Asia and Pacific Region, Report No. 38183-CN, World Bank, Washington, DC.
APPENDIX D
Aging, Retirement, and Labor Markets
Aging, Migration, and Labor Markets
The rapid aging of the population in China has raised concerns for elderly well-being, labor market participation, and old-age support, while, at the same time, (1) traditional familial support for the elderly has been declining and (2) the formal pension system is undergoing substantial transformation. Unlike many developed economies transforming into an aged society over a long time horizon, the pace of aging in China is so fast that its demographic transition will be complete in less than 40 years, but its income level is still low. China will, therefore, grow old before it becomes rich. Changes in demographic structure have important implications for the labor supply, pension schemes, old-age income support, fiscal sustainability, and long-term growth. The shrinking of China’s working-age population will pose numerous important challenges for the economy, two of which are (1) the need for a growing and increasingly skilled labor force in the face of a growing proportion of the population being lost to retirement and fewer new entrants because of declines in fertility and (2) the imposition of stress on the defined-benefit instruments in the urban old-age insurance system, which will face growing benefit expenditures amid slowing growth of contributions. This appendix proposes the following three measures to
197
198
China’s Pension System
address both challenges: (1) modify those pensions and labor market policies that discourage individuals from working longer, (2) remove financial incentives for early retirement, and (3) support policies that enable workers to strengthen their skills through a lifelong learning process. For countries with partially funded defined benefit mandatory pension schemes, one means of addressing the trade-off between fiscal sustainability and benefit adequacy in the face of population aging is to allocate a larger share of the increase in life expectancy to time spent working than to time spent in retirement by increasing the age at which individuals depart the labor market. This is a rational choice for individuals faced with the expectation of living longer and not being able to externalize the higher cost of their retirement. It is also the policy approach that guarantees the best actuarial balance between accumulated funds and accrued benefits under the given pension schemes. Other options—such as encouraging greater migration, higher fertility, and faster productivity growth—that are frequently proposed to address the negative consequences of population aging for pension systems help on the margin, but by themselves are generally insufficient to restore sustainability in the face of a rapidly aging population. In China the existence of large-scale rural-to-urban migration and the extension of coverage to this working population will, to some extent, reduce the projected burden of old-age support and offset the effects of population aging in urban areas, but it will leave more serious aging problems in rural areas when young adults migrate to cities. Moreover, in the long run, the burden of urban old-age income support will increase when those covered young migrants reach their retirement age and begin claiming pension benefits. This appendix examines the impact of population aging on labor markets and pension systems in China. It first investigates urban demographic trends by considering projected rural-to-urban migration. Second, it analyzes the effects of an increase in the retirement age on labor supply and dispels some of the myths surrounding labor market outcomes. Third, it explores the effects of an increase in the retirement age on the urban pension system. Finally, it proposes policy interventions to improve labor markets and pension systems in the face of population aging. The World Bank’s projections show the trend of China’s overall population and illuminate the differences in the size of the aged populations in rural and urban areas, respectively (see figure D.1). In 2010 the total elderly population aged 65 and above was around 112 million. By 2020 this number will more than double. Between 2010 and 2040, the growth rate of the elderly population is projected to be 3.56 percent—a rate far
Aging, Retirement, and Labor Markets
199
Figure D.1 Aged Populations in Rural and Urban China, 2010–75
400
aged population 65+ (millions)
40 35 30 25 20 15 10 5 0
50 55 60 70 15 20 25 30 40 10 35 45 65 20 20 20 20 20 20 20 20 20 20 20 20 20 75
aged proportion 65+ (%)
350 300 250 200 150 100 50 0
20
rural
urban
aged proportion 65+
Source: World Bank estimates. Note: A fertility rate of 1.85 is used, the same as the medium variant of the UN population projection. The migration data are from a CASS–World Bank joint study.
higher than the growth rate for the overall population. This will result in a rapid increase in the proportion of the aged population (aged 65 and above) from 8.4 percent of the total to 22.4 percent. This proportion will level off after 2040 if policy measures are taken to increase and then maintain China’s fertility. The size of the rural elderly population is projected to peak by 2040 and then to decline continuously. The urban elderly population, however, will continue to increase over time. Rapid urbanization will drive changes in the spatial distribution of the working-age population between rural and urban areas. The Chinese government has made the decision to accelerate urbanization by 2020 by deepening the hukou system reform to encourage rural migrants to leave medium and small cities permanently.1 Assuming a rapid urbanization scenario,2 the World Bank’s projections suggest that the total working-age population will increase from 944 million in 2010 to 964 million by 2015, after which it will gradually decline to 929 million by 2030 and 847 million by 2050 (see figure D.2). Patterns of change in the sizes of working-age populations differ between rural and urban areas as a result of rapid urbanization and migration. Rural-to-urban migration is generally driven by demand according to age, gender, education, and the skills of migrants.
200
China’s Pension System
Figure D.2 Working-Age Populations in Rural and Urban China, 2010–75
1,200 working-age population (millions) 1,000 800 600 400 200 0 120 100 80 60 40 20 0 proportion of urban population (%)
Source: World Bank estimates.
Migration, however, is constrained by policy and institutional factors. The majority of rural migrants are young, with an average age of 29 years (NBS 2010). With the inflow of substantial numbers of young adults into cities, the size of the working-age population in urban areas will continue to increase in the short term, while that in rural areas will continue to decline and will do so at a precipitous rate. Migration has different implications for the burden of old-age income support in rural and urban areas. The projected flow of young adults from rural to urban areas will partially offset the effects of population aging and dampen the growth of old-age dependency ratios in urban areas. In the countryside, however, old-age dependency ratios are projected to rise dramatically. Figure D.3 demonstrates the projected pattern of old-age dependency ratios in rural and urban areas. From 2010 to 2040, the old-age dependency ratio in urban areas is projected to increase from 12.2 percent to 30.7 percent, while in rural areas it is projected to jump from 11.6 percent to 56.9 percent. From 2040 to 2065, old-age dependency ratios in rural areas are expected to remain high (but fluctuate). After 2065 old-age dependency ratios should decline as the elderly remaining in rural areas gradually pass away. Industrialization combined with urbanization in China has indeed shifted millions in the rural labor force into nonagricultural sectors in
10 20 15 20 20 20 25 20 30 20 35 20 40 20 45 20 50 20 55 20 60 20 65 20 70 20 75
rural urban urbanization
20
Aging, Retirement, and Labor Markets
201
Figure D.3 Old-Age Dependency Ratios in Rural and Urban China, 2010–75
70.0 60.0 old-age dependency ratio (%) 50.0 40.0 30.0 20.0 10.0 0.0
Source: World Bank estimates.
urban areas. At the beginning of reform and the period of opening up, agriculture was the dominant sector in the economy and absorbed a huge proportion the country’s surplus labor. In 1978 agricultural employment accounted for nearly 70 percent of total employment. Rapid economic growth created millions of nonagricultural jobs and transformed the country’s economic structure. By 2008 agricultural employment had dropped to just 39.6 percent of total employment and accounted for less than 12 percent of GDP. With this massive rural-to-urban migration, rural employment leveled off and then began to decline while urban employment has increased substantially. As shown in figure D.4, total employment rose from 647 million in 1990 to 775 million in 2008. Over this period, urban employment increased by more than 100 million while rural employment rose slightly and then began to decline from 491 million in 2001 to 473 million in 2008. China’s internal migration is the largest peacetime migration observed in human history. Starting in the mid-1980s, the volume of rural migration has sustained an upward trend. The number of rural migrants amounted to 78.5 million in 2000, rising to 140.4 million by 2008 (see figure D.5). Compared with total urban employment, the share of rural migrants increased from 33.9 percent in 2000 to 46.5 percent by
20 10 20 15 20 20 20 25 20 30 20 35 20 40 20 45 20 50 20 55 20 60 20 65 20 70 20 75
rural urban
202
China’s Pension System
Figure D.4 Employed Population, Urban and Rural Areas, 1990–2008
900 number of employment (millions) 800 700 600 500 400 300 200 100 0
Source: NBS 2009.
Figure D.5 Trends and Shares of Rural-to-Urban Migration in China, 2000–08
160 number of rural migrants (millions) 50
140 40 share (%) 120 30 100 20
80
60
20 05
20 03
number (millions) migrants as share of urban employment migrants as share of rural employment
Source: NBS 2009.
20 04
20
20
20 06
20 07
20
20 08
01
00
02
91 92 19 93 19 94 19 95 19 96 19 97 19 98 19 99 20 00 20 01 20 02 20 03 20 04 20 05 20 06 20 07 20 08 19
total urban rural 10
19
19
90
Aging, Retirement, and Labor Markets
203
2008—nearly half the total. The number of rural migrants accounted for 16.0 percent of the rural labor force in 2000 but rose to 29.7 percent by 2008. With the expansion of nonagricultural sectors and urban economies, the number of persons counted as surplus rural labor in China has declined as rural migrants have increasingly entered nonagricultural sectors. The strong demand for rural migrants generated by rapid growth has resulted in the emergence of labor shortages beginning in 2003. Although the global financial crisis inflicted a temporary shock to employment, the problem of labor shortages reemerged as the economy recovered, and are increasingly visible in urban labor markets. The rate of wage growth of rural migrants has remained in the double digits since 2003. Empirical evidence suggests that China’s labor market has reached a Lewisian turning point: a transition from unlimited surplus labor to limited surplus labor (see Cai and Wang 2009). This will have important policy implications for China’s economic growth and socioeconomic transformation. The supply of labor is a critical ingredient for economic output and growth. As labor supply increases, so does capital accumulation until a new output equilibrium is reached. With the projected shrinking of the labor force in China, postponing retirement by raising the retirement age could be one option for increasing the labor supply and mitigating the challenges of population aging. The following two sections discuss the effects of an increase in the retirement age on labor supply and the pension system. A sound pension system, especially in rural areas, offers another mechanism for coping with demographic and socioeconomic change. This appendix does not discuss the rural pension scheme but instead focuses on understanding the effects of an increase in the retirement age on the urban labor supply and the urban pension system.
Effects of an Increase in the Retirement Age on the Labor Market
At present, labor shortages are not confined to coastal areas. In fact, the transfer of labor-intensive industries into inland areas has caused labor shortages in those regions as well. The widespread problem of labor shortages suggests that labor has become scarce as China’s economy modernizes, a pattern of development that has also been observed in Japan, the Republic of Korea, and Taiwan, China. Increasing the labor supply is clearly one of options for addressing the problem of labor shortages.
204
China’s Pension System
Increasing the labor supply by encouraging older workers to remain in the labor market and to retool their skills will have a certain and, in most cases, gradual impact. Such a process of encouraging people to work longer would coincide with when labor force growth is expected to be low or stagnant in urban areas and shrinking in rural areas as a result of declining fertility in prior decades as well as recent migration. To illustrate the labor supply effects of an increase in the retirement age in urban areas, two scenarios have been modeled. First, we have modeled an increase in the retirement age for women from 51 to 60 years (the same as for men). According to China’s labor regulation, female officials and white collar workers retire at age 55 while the rest retire at age 50; thus, it is reasonable to select age 51 as a starting point. Assuming a gradual increase in the retirement age at a rate of six months per year, the increase in the retirement age from 51 to 60 years will take 20 years, or by the end of 2029 if begun in early 2010. Second, we have modeled an increase in the retirement age for both men and women to 65 years. After the retirement age for women reaches 60 years (the same as for men) in 2029, the simulations assumed that the retirement age would be increased at the same rate of six months per year until the age for both men and women reaches 65. Figure D.6 shows the projected impact of these changes on the labor supply. An increase in the retirement age for women from 51 years to 60 years old would increase the proportion of the working-age population (defined as persons aged 15 to the retirement age) by about 10.9 percent by 2029. If the retirement age were to be further increased further from 61 to 65 for both men and women, the working-age population would increase by 18.4 percent by 2039 before leveling off. The incremental effect of an increase in the retirement age on the labor supply will also be determined by other factors that impact the supply and demand for labor. From the perspective of labor supply, individual participation in labor market is determined by variables of wage, individual wealth, and preference for leisure. On the demand side, individual skills and productivity will be the key to meeting the job requirements of enterprises. Figure D.7 shows that labor market participation rates vary significantly by age and gender. In the urban labor market, older workers tend to have lower rates of labor market participation than do younger workers, and men have higher rates of labor market participation and withdraw from the labor market later than do women. In 2005 in the urban labor market, women aged 51–60 years have a participation rate of 33.2 percent, while both men and women aged 61–65 years old have a rate of 23.2 percent. Thus, the actual marginal impact
Aging, Retirement, and Labor Markets
205
Figure D.6 Labor Supply Effects from an Increase in Retirement Age
25 proportion of increased labor force (%)
20
15
10
5
0
Source: World Bank estimates.
Figure D.7 Labor Force Participation Rate in Urban China, 2005
120 labor market participation rate (%) 100 80 60 40 20 0
Source: NBS 2005.
16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78
age men women average
20 20 25 20 30 20 35 20 40 20 45 20 50 20 55 20 60 20 65 20 70 20 75
women 51–65, men 61–65 women 51–60
10 20
20
15
20
206
China’s Pension System
of an increase in the retirement age would be less than one-third the supply of older workers aged 51–65 years. Certainly, changes in the legal retirement age would significantly affect labor supply decisions by these cohorts who would have been eligible for benefits sooner but now have to work longer. The impact of an increase in the retirement age also reflects such factors as job opportunities, discrimination, and the informalization of the economy. At a given wage level, job opportunities are one of the important factors that affect individual behavior regarding labor force participation. When an economy is in recession, job opportunities are limited. Such adverse labor market conditions will discourage some older workers from working and encourage them to depart the labor market permanently. Discrimination against older workers would exacerbate this pattern. The degree of informalization in the urban labor market has been increasing during China’s economic transformation, though the share of informal sector has stabilized in recent years. In the formal sector, workers generally have better working conditions, higher salaries, and better protection under the law. If an increase in retirement age is mandatory, the enforcement of the law is easily implemented. Thus, older workers can, in principle, work longer if they so choose. But workers in the informal sector will be hired and fired regardless of their age because the labor law and laws regarding pension participation are often not applied to these workers anyway. The impact of an increase in the retirement age on youth employment has been an ongoing concern in China. Some observers argue that increasing the retirement age will reduce the number of jobs for younger workers entering the labor force. This argument—referred to by economists as the lump of labor fallacy—is based on an erroneous assumption of substitution between older and younger workers under a fixed level of labor demand. In the 1980s and 1990s, many OECD countries had experienced high and sustained unemployment, which was believed to reflect the existence of a fixed number of jobs in their economies. Several of these countries, therefore, enacted policies aimed at increasing the demand for the unemployed such as work-sharing arrangements, weekly limits on hours, and early-retirement programs. Empirical evidence, however, suggests that such policies were ineffective in reducing unemployment. Rather, they resulted in higher real wage rates and, consequently, reduced rather than increased total employment (see Kapteyn and others 2004). Analysis of OECD countries suggests that little empirical evidence exists that older and younger workers are input substitutes. On the
Aging, Retirement, and Labor Markets
207
contrary, the evidence points toward their being complementary (see figure D.8). This conclusion is strengthened by a recent study of 21 OECD countries between 1960 and 2004, which suggests that changes in the rates of employment among older workers (aged 55–64) have small but positive effects on the employment of younger workers (aged 16–24) and on those in between (aged 25–54) (see Kalwij and others 2009). As economies grow and evolve (and as technologies change), the skills required of new workers also change. As a result, when someone retires from a particular position, it is unlikely that exactly the same skills will be required of his or her successor. Similarly, as workers spend time accumulating experience in a particular profession, job-specific knowledge, skills, and judgment make older individuals useful even when younger new workers begin their careers with new and different skills that older workers are unlikely to develop. In China the modest and gradual increase in the labor force participation among older workers that would result from an increase in the retirement age would not decrease prospects for youth employment. From 2000 to 2005, labor market participation rates increased for most older
Figure D.8 Change in Employment Rates in OECD Countries by Age Group, 1997–2007 percentage points
20 15 10 aged 50–64 5 0 –5 –10 –15 –10 TR HU NL IE FI NZ SK BE CA AU IT AI FR PT UK GR CZ SE DK CH US MX IS JP NO KR PL DE
ES
–5
0
5 aged 25–29
10
15
20
Source: OECD (via direct communication). Note: OECD = Organisation for Economic Co-operation and Development.
208
China’s Pension System
workers (see figure D.9) despite there being no changes in the retirement age. In fact, nothing prohibits individuals from retiring from formal sector employment and rejoining the formal sector as a contract employee or simply moving to employment in the informal sector. The unemployment rate among youth dropped from 16.1 percent to 9.1 percent over the same period. This can be attributed largely to rapid economic growth, which generated millions of new jobs. In the late 1990s, most laid-off and unemployed urban workers were unskilled, female, or older workers laid off during the painful period when state-owned enterprises were reformed. In spite of declining unemployment, youth unemployment has gradually become a more pressing issue in China. As is the case in a number of other countries, youth unemployment is more than twice that of adults. In the context of the global financial crisis, youth workers, including migrants and college graduates, have faced challenges in the urban labor market and suffered from rising rates of unemployment. Cai and Wang (2009) show that youth unemployment is a structural issue in China and that substitution between young and old workers is weak or nonexistent. In the context of rapid growth, the excess demand for labor resulting from growing urban
Figure D.9 Labor Market Participation Rates of Older Workers in China, 2000–05
70 60 labor market participation rates (%) 50 40 30 20 10 0 50 52 54 56 58 60 62 64 age 66 68 70 72 74 76 78
2000
Sources: NBS 2000 and 2005.
2005
Aging, Retirement, and Labor Markets
209
economic output more than outstrips the substitution effect that would result from increasing labor participation among older workers. In the meantime, technological advances change the skills required of the workforce. Although older unproductive factories may have been able to employ many unskilled workers, newer, more technologically driven factories need workers with stronger technical skills. This means that as China’s economy changes, its demand for skills also changes.
Effects of an Increase in the Retirement Age on the Urban Elderly Old-Age Insurance System
Increasing the legal retirement age is one of several options to address the dramatic consequences of aging worldwide. In China this option is still under discussion. In addition to the lump of labor fallacy (discussed above), another reason for concern over increasing the retirement age might be that the average retirement age is actually lower than the minimum age at which workers become eligible for a full pension. In the late 1990s, early retirement was prevalent because of widespread enterprise restructuring and retrenchment. At that time, the discussion of increasing the legal retirement age was sensitive, particularly because many enterprises had large numbers of workers who were not employable after restructuring. As a result, justifiable concern was expressed that increasing the retirement age could contribute to rising unemployment and early retirement, particularly in some regions of the country. With enterprise restructuring largely completed and tightening urban labor markets in many cities in China, policy concerns over increasing the retirement age may not be as prevalent as they were previously. Some local authorities, such as those in Shanghai,3 have experimented with a flexible system of retirement ages and with deferring retirement for senior managers, technicians, and skilled workers. In coastal areas, a few provinces have significantly increased local minimum wages and improved welfare to attract new workers to mitigate labor shortages. An increase in retirement age could both materially improve the financial sustainability of the existing social pooling component in China and increase the benefits provided from the current Individual Accounts or NDC balances. Increasing the retirement age will slow the growth of the system’s old-age dependency ratio, leaving more financial resources available to support China’s aging society. Raising the retirement age has opposite effect on revenues and expenditures: Encouraging older workers
210
China’s Pension System
to work longer will result in more contributors who would otherwise have retired, thus increasing revenues; meanwhile, social pooling expenditures would fall because benefits are paid for fewer years even though annual benefits at retirement are higher as a result of additional years of service credit. In the case of Individual Accounts or NDC benefits, expenditures are simply deferred; their lifetime cost is unchanged. The effects of increasing the retirement age will also depend on any design changes adopted for the urban old-age insurance scheme. The existing scheme is financially unsustainable as a consequence of several factors, including legacy costs and aging. Simulations estimate the projected liabilities of the baseline scheme to be the equivalent to 141 percent of 2001 GDP (see Sin 2005). The system dependency ratio (that is, the number of beneficiaries supported by each worker) is projected to increase from 16 percent to over 50 percent in about seven years and to increase further to 100 percent over a 30-year period under the pension policy framework adopted in 1997. If an NDC scheme were adopted, legacy costs separately financed, and the retirement age increased, the projected medium-term cash flow imbalances driven by rising system dependency ratios would be far easier to manage.
Public Policy Implications of Increasing the Retirement Age
As discussed above, encouraging older workers to remain in the labor market promises substantial economic benefits. For these benefits to be realized, older workers must have incentives to stay in the labor force, and structural barriers to their continued employment must be reduced. For example, individuals will make decisions about their participation in the labor force in response to tax incentives, particularly when wage taxes reduce their compensation for each additional year of work and retirement benefits do not materially increase as a result of working longer. Figure D.10 depicts the relationship in 12 study countries between unused labor capacity (that is, the share of workers retired among the elderly population) and the tax foregone to retirement (that is, a measure of income loss for continued labor force participation). Clearly, decisions regarding retirement timing reflect the incentives in place for continued employment. Burtless (2009) demonstrates further that the level of net replacement rates impacts departure rates from the labor force for persons between 60 and 64 years of age. Existing incentives for early retirement as well as disincentives for delayed retirement, therefore, must be considered when making changes to the statutory minimum retirement age.4
Aging, Retirement, and Labor Markets
211
Figure D.10 Retirement Incentives Matter: Implicit Tax on Remaining in Work
70 unused labor capacity (% of retired workers among elderly population) 60 50 40 30 20 0 1 2 3 4 5 6 7 8 9 10 tax pressure to retire
Sources: Gruber and Wise 1999; Hofer and Koman 2001. Note: The unused labor capacity is the percent of retired workers among elderly population. The tax pressure to retire is an index 1 of 10 where 1 is the lowest level of induced pressure to retire due to the tax system and 10 is the highest level of pressure.
Austria France United Kingdom
Belgium Italy Netherlands
Spain Canada United States Sweden Japan Germany
Pension benefit design and qualification criteria often create strong incentives for early retirement, including the following: • Insufficient (or nonactuarially determined) adjustments for early or late retirement5 • Earnings tests that reduce benefits because an individual continues working (the use of such tests is often justified by the nonactuarial nature of the benefit calculation) • Tax exemption of benefits that create high net replacement rates • High net-benefit levels that are typical of unsustainable schemes • Low minimum retirement ages linked with social pressures to retire to “make room” for the younger workers (as was discussed earlier) and • Special early-retirement provision in many countries (including China) for workers in hazardous professions as well as generous benefits for disability. Encouraging older workers to work longer will require the government to address the gaps between worker wages and productivity, institutional and policy barriers, and age and gender discrimination. In China’s urban labor market, older workers are less likely to be working part-time or be self-employed and are at greater risk of becoming economically inactive
212
China’s Pension System
beyond the age of 50. This is especially true for women. Therefore, policies are needed to provide a supportive environment and to remove existing obstacles to working longer. Keeping the elderly in the labor market, as well as creating sustained demand for elderly workers, will require a major rethinking of labor market institutions and practices, three of which are highlighted below.
Addressing the Productivity-Wage Gap
Addressing the productivity-wage gap for elderly workers is necessary to promote efficient employment. The productivity-wage gap means that workers at all ages should be compensated in accordance with their productivity. If work rules prohibit lateral assignments or demotions when an individual’s productivity falls below his or her compensation (as can be the case when productivity declines among older workers), employers will attempt to lay off elderly workers and will be reluctant to hire older workers even when they are well qualified. Cross-country empirical evidence suggests that worker productivity grows during midcareer but may begin to decline when approaching the retirement age. If seniority rules or wage restrictions prohibit less productive older workers from receiving lower compensation, employers have an incentive to let such workers go. This leaves policy makers with two options: upwardly adjust the productivity profile or downwardly adjust wages. The resistance to the latter is often reenforced by pension rules such as those that exist in China that calculate pension benefits based on wages earned in the final years before retirement.
Strengthening Lifelong Learning
Strengthening lifelong learning is crucial in a world of changing technologies, knowledge, and increasing life expectancy, and it is especially important in China, where the profile of labor market skills requirements is changing—and will continue to change rapidly with the continued evolution and transformation of the economy. As suggested above, individuals during their lifetime have to be trained and educated in such a way as to position themselves for rapidly evolving and changing demands in the labor market. Although the importance of lifelong learning is widely recognized internationally, its actual implementation is generally lacking, and discussions of how to best finance it are ongoing. Governments and employers should contribute to the financing of lifelong learning (because both profit from an up-to-date and educated workforce), but
Aging, Retirement, and Labor Markets
213
most financing will have to come from workers themselves because they profit directly from developing sustained and higher skills.
Policies Supporting Labor Mobility
Policies to support labor mobility are equally important for older workers in China. Policy measures that support labor mobility include the following: (1) eliminating the fragmentation of pension and other social insurance provisions, (2) supporting the portability of accrued pensionable and other rights, (3) gradually eliminating hukou residency requirements, and (4) processing work permits without regard to an individual’s place of origin. In addition (as was discussed above), lifelong learning is essential to mobility as economies evolve. Social policies and labor laws can support mobility as individuals age and undergo changes in their family structure (such as raising children and getting divorced). As people live longer and are able to work longer, they are typically not as productive later in life. Not only enterprises but individuals and families as well will have to accept the cultural changes driven by population aging.
Conclusions
This appendix examined the impacts of population aging on labor markets and pension systems in light of China’s great rural-to-urban migration. It has provided empirical evidence to dispel the myth that delaying retirement and encouraging older workers to remain in the labor force will adversely affect employment, particularly for younger workers, and it suggested that public policies that reduce incentives for older workers to exit the labor market can still be supportive of economic growth and the sustainability of the pension scheme. The following recommendations emerge from this appendix: • An increase in the retirement age could improve the sustainability of the pension system and increase levels of income replacement • China’s growing demand for labor will be partially met by migration and would benefit from encouraging older workers to remain in the workforce longer • An increase in the retirement age would need to be accompanied by other reforms if anticipated gains in labor market efficiency are to be attained.
214
China’s Pension System
Notes
1. See Wen Jiabao’s Report on the Work of the Government (2010), delivered on March 5, 2010. 2. According to the World Bank’s projections, the proportion of the urban population to the total population will rise from 46.6 percent in 2008 to 64.9 percent in 2030, almost 5 percentage points higher than what was projected by the United Nations Population Division (2009). In 2008, the China Statistical Yearbook showed that the proportion of the urban population was 45.7 percent. The 2010 census found an urban population share of fractionally under 50 percent, and in 2011 China crossed the 50 percent urban mark for the first time in its history. The World Bank’s projections can, therefore, reasonably be used as an upper bound of China’s population changes in the future. 3. In February 2010, a news report stated that Shanghai plans to establish a flexible system of retirement ages for three categories of workers (senior management personnel, technical personnel, and skilled personnel). These workers can postpone their retirement age if approved by their working units. See details at. 4. An OECD publication provides a comparative view of early-retirement incentives in its member countries (see OECD 2009). 5. For a definition and discussion of actuarial fairness, see Queisser and Whitehouse (2006).
References
Burtless, G. 2009. “Preparing the Labor Markets for an Aging Population: Designing Public Policy to Increased Labor Force Participation.” In Pension Reform in Southeastern Europe: Linking to Labor and Financial Market Reforms, ed. Robert Holzmann, Landis MacKellar, and Jana Repansek, 127–48. Washington, DC: World Bank. Cai, F., and M. Wang. 2009. “Employment Shock of the Financial Crisis and Its Countermeasures.” Academic Updates 20: 16–31. Gruber, J., and D. A. Wise, eds. 1999. Social Security and Retirement around the World. Chicago: University of Chicago Press. Hofer, H., and R. Koman. 2001. Social Security and Retirement in Austria. Vienna: Institute for Advanced Studies. Kalwij, A. S., A. Kapteyn, and K. De Vos. 2009. “Early Retirement and Employment of the Young.” RAND Working Paper Series WR-679. March. abstract=1371889.
Aging, Retirement, and Labor Markets
215
Kapteyn, A., A. S. Kalwij, and A. Zaidi. 2004. “The Myth of Worksharing.” Labour Economics 11: 293–313. National Bureau of Statistics (NBS). 2000. “Population Census, Micro-Data.” Unpublished report, NBS, Beijing. ———. 2005. “One Percent Population Sample, Micro-Data.” Unpublished report, NBS, Beijing. ———. 2009. China Statistical Yearbook. Beijing: China Statistics Press. ———. 2010. “The 2009 Monitoring Report of Rural Migrant Workers.” http://. OECD (Organisation for Economic Co-operation and Development). 2009. Pensions at a Glance. Retirement-Income Systems in OECD Countries. Paris: OECD. Queisser, M., and E. Whitehouse. 2006. “Neutral or Fair? Actuarial Concepts and Pension-System Design.” OECD Social, Employment and Migration Working Papers No. 4, OECD, Paris. Sin, Y. 2005. “China Pension Liabilities and Reform Options for Old Age Insurance.” Working Paper 2005-1, World Bank, Washington, DC. United Nations Population Division (UNPD). 2009. World Population Prospects: The 2008 Revision. New York: United Nations..
APPENDIX E
Voluntary Savings Arrangements
The Objectives and Role of Voluntary Savings Arrangements in the Chinese Pension System
Effective multipillar pension systems in all countries undergoing population aging must rely significantly on voluntary retirement savings to supplement the benefits paid from mandatory pillars. For supplemental savings schemes to address the limitations of public systems, they require (1) group arrangements organized on the basis of employment—such as the current Enterprise Annuities (EAs)—sponsored by individual employers, (2) the extension of this concept for groups of workers within a common industry or for all the members of a trade union or worker organization, or (3) individual arrangements that provide retirement savings products on a retail basis. Supplemental elements of the pension system should be designed to fulfill several interrelated purposes, including the following: • Supplementing the limited income replacement capacity of mandatory pillars. The mandatory elements of pension systems operate most efficiently when they provide only a basic level of income replacement for
This chapter draws from Hinz (2007). 217
218
China’s Pension System
average participants. The replacement rates required to prevent poverty in old age and achieve effective consumption smoothing over the life cycle will vary considerably across individuals because of differences in income, patterns of earnings, and the need for income replacement (which varies with income). To operate efficiently, basic pension pillars should be relatively simple in design and modest in size. Imposing very high contribution rates serves only to distort decisions within the labor market. This suggests that basic pillars should be designed to ensure a minimum level of income for all workers (for poverty prevention) and provide only limited income replacement beyond this minimum income level for others. The design of the urban old-age insurance scheme in China is already consistent with this principle: It replaces under half of lifetime income for a typical worker and a generally lower percentage for workers earning more than the average (this is particularly true for persons who experience rising levels of earnings over their working life). To adequately smooth consumption from work to retirement, total replacement rates from all sources of between 60 percent and 80 percent of pre-retirement earnings are often required. Achieving these levels of total income replacement will require significant supplementary retirement savings for all but the lowest-income workers. Saving 10 percent of wages and investing them in long-term financial products specifically designed to achieve returns closely correlated with the long-term growth of wages should provide the additional 20–30 percent of income replacement required to smooth income adequately for most workers. This would most efficiently be achieved by supplementary Occupational Annuities (OAs) and Individual Annuities (IAs) that can be tailored to the varying circumstances and preferences of China’s rapidly evolving labor force. • Improving the efficiency of consumption and savings decisions. One of the core macroeconomic challenges facing China in the coming decades is the establishment of an efficient long-term balance between consumption and savings. One of the primary motivations for retirement savings is to spread consumption over the life cycle. In the absence of a well-designed retirement savings scheme, however, individuals cannot efficiently manage the various costs and risks of saving to include longevity risk (that is, that one will outlive one’s savings) as well as investment risk. In response, many individuals will engage in high levels of “precautionary saving.” This results in overall levels of savings that are
Voluntary Savings Arrangements
219
higher than what is collectively necessary as individuals separately seek to manage their risks. A well-designed and supervised supplemental pension system can improve the efficiency of consumption and facilitate rational savings behavior by (1) providing savers with a supply of appropriate investment instruments specifically designed for long-term pension savings, (2) achieving economies of scale in the administration of a retirement savings scheme to lower investment costs, and (3) pooling mortality risks during the payment of benefits when individuals reach retirement and begin to draw on their supplemental savings accounts. • Facilitating the efficient operation of labor markets and promoting enterprise development. China continues to move toward more open and competitive labor markets. This requires employers to have the means to attract and retain workers with the attributes and skills appropriate for their respective industries. For this to happen, it will be important to establish an environment in which employers benefit from investing in the human capital of their workers through training and other skills development. Employers must have the means to create appropriate market incentives to retain the highly skilled workers they have trained. Otherwise, competitors will simply hire workers trained by other employers at marginally higher wages, thereby exploiting the value of the other employer’s investment. Supplemental OAs can provide employers with the means to retain workers by offering the promise of future benefits and by giving them access to lower-cost investment vehicles, the efficiency of a collective savings regime, and the support of expertise in the management of their savings. The specific characteristics of a particular employer-based pension scheme may have different appeal to workers with different characteristics, thereby improving the efficiency of allocation of labor. • Promoting the depth, breadth, liquidity, and development of domestic capital markets. Funded occupational and individual annuities can provide a large source of long-term savings and capital formation. In many countries with well-developed supplemental private pension systems, accumulated assets exceed 100 percent of GDP. These assets provide the underlying capital to facilitate the development and operation of the institutions that support capital market development, including asset managers, custodians, and brokerage and trading houses. Savings that are channeled into investment vehicles specifically designed to
220
China’s Pension System
support retirement income production create the demand for longterm instruments and improve the quality of asset management services. This increases the depth of capital markets and facilitates the development of long-term instruments. • Contributing constructively to the management of population aging. The decline in the working-age population in China, projected to begin about 2015, will impose significant challenges for the maintenance of economic growth. The most direct way of addressing this problem is to develop a means to encourage workers to remain in the labor force at older ages. Supplementary pension systems can be designed to help address this problem by creating additional incentives for continued work. Each year of additional work and contributions will provide a commensurately greater level of retirement income that can help offset incentives to retire at the earliest age of eligibility under the public system.
Conditions Necessary to Fulfill These Objectives
To achieve the objectives discussed above, a system of supplementary pension savings must fulfill several conditions: • Broad access on an equitable basis to savings instruments. Supplemental OAs and IAs should be easily accessible on equivalent terms for all economically active individuals. For those employed in the formal sector, this can be best accomplished through the promotion of employmentbased schemes such as the existing EAs. These schemes, however, have reached only about 6 percent of the workers in the formal sector because many are employed by enterprises that are too small for such a scheme to be cost effective or that possess characteristics, such as very low earnings, that do not make it attractive or feasible. Moreover, more than half of the labor force is not engaged in formal sector employment and would not have access to employer-based schemes anyway. A fully effective supplemental system will need to provide all workers access to savings instruments designed to provide secure retirement income at a reasonable cost. This could be accomplished by designing products available at an individual retail level on terms similar to those covered by EAs. • Meaningful and consistent incentives to save within the scheme. Pension savings need to be distinguished from other types of savings and treated
Voluntary Savings Arrangements
221
appropriately as long-term deferred consumption. Achieving the right level of saving requires providing the proper implicit signals regarding the required level of savings needed to reach targeted levels of income replacement. Although overall savings in China remain high, savings are not uniformly distributed. Some share of individuals, especially those of moderate income, may require meaningful economic incentives (or explicit subsidies) to stimulate them to save more. In most countries this is achieved by affording supplementary retirement savings special tax treatment in which income taxes are deferred for funds contributed to designated retirement savings schemes. Low-income individuals, who do not pay much in the way of income taxes, often require additional incentives, such as matching contributions or other credits. For the system to operate successfully, incentives should be provided in a similar form and level throughout the economy. • Investment instruments specifically designed for retirement savings. Pension savings schemes have specific characteristics that must be addressed during their design. First, they operate over a very long time horizon. Second, because they are designed to provide income to individuals who have left the workforce, they should be invested with low tolerance for risk. Levels of risk tolerance, however, vary across individual circumstances and across any given individual’s life cycle, typically diminishing in direct proportion to the individual’s proximity to retirement. Providing the necessary financial incentives and creating the capacity to effectively supervise retirement savings schemes requires that funds afforded preferential tax treatment be segregated and identifiable. International experience strongly suggests that most individuals lack the skill and knowledge required to make optimal decisions regarding their investments for retirement, and many do not wish to make such decisions. This suggests that the pension scheme should be designed to provide a relatively small number of products to fulfill the most common risk, return, and holding period characteristics. Investment choices within a scheme are then limited to these alternatives as is the eligibility for preferential tax treatment. • Low-cost operations to preserve savings during accumulation. The long-term nature of pension savings and limited capacity of individuals to defer income makes supplemental funded pension schemes extremely cost sensitive. Generally, a one percentage point increase in administrative costs reduces retirement income by 15–20 percent. Thus, supplemental
222
China’s Pension System
pension schemes must be designed to keep operating costs as low as possible. This can be achieved through the imposition of restrictions on fees and expenses and by facilitating competition within the retirement savings market. • Cost-effective and reliable mechanisms for converting savings into postretirement income. Transforming individual pension savings into retirement income requires a means of converting the balances of individual savings accounts into a secure income stream. At retirement, the design challenge for supplemental pension schemes shifts from providing access to a broad segment of the working population and managing investment risk to providing a mechanism for individuals to manage the uncertainty surrounding how long they might live. This requires the pooling of mortality risk into large pools backed by low-risk assets that enable individuals to convert the funds in their accounts into a secure income stream at retirement. • In addition, supplementary pension schemes must be perceived by participants as being secure and reliable. The success of any pension system is strongly influenced by the behavior of its participants in response to their perceptions about its security and reliability. Most individuals will never be capable of making independent judgments about the quality of asset management or the security of the institutions in which their savings are invested. This requires strong market regulation and oversight. Otherwise, workers will be reluctant to participate or will engage in inefficient levels of precautionary savings to compensate for their perceptions of risk.
A Design Framework for Supplementary Pension Schemes
The proposed supplemental OAs and IAs need to be designed in accordance with the core principles below to (1) have the capacity to provide a substantial level of income replacement for a broad segment of China’s population and (2) be consistent with the objectives and attributes outlined above.
Investment Products Should Be Tailored Specifically for the Needs of the Scheme
Saving for retirement in an efficient and secure manner requires investments to be aligned with the needs of the scheme. The vast majority of
Voluntary Savings Arrangements
223
individuals lack the knowledge and capacity to formulate and implement an appropriate investment plan and to exercise prudent judgment when choosing among a complex array of investment alternatives. Participants in retirement savings plans worldwide have a well-documented propensity to avoid making choices and to exhibit considerable inertia once a decision among investment alternatives has been made. This makes the allocation of their investment assets inefficient because the risk and return characteristics appropriate to pension savings change considerably as individuals age. In theory, investors should seek higher returns by exploiting risk premiums for longer-term investments when they are younger and should accept lower potential returns in exchange for greater security as they become older. In China savings at the household level (in part because the investment markets remain at an early stage of development) have been concentrated either in very low-yielding bank deposits that produce returns well below average wage growth or in what have proven to be extremely volatile equity markets. Neither is consistent with the needs of long-term savings schemes. Unfortunately, the kind of investment products that are needed—longterm and low-cost products that can gradually offer lower levels of risk as individuals approach retirement—are not necessarily the products that financial service providers have an incentive to develop and sell. This is especially the case when it is more profitable to sell short-term and higher-risk alternatives. Creating efficient markets for supplementary pension products, therefore, requires the establishment of a set of permissible products and the careful oversight of the markets in which those products are sold. This requires achieving a balance between (1) limiting choices and steering individuals toward options that are most appropriate for their circumstances and (2) offering a sufficient range of options to accommodate individual degrees of risk tolerance while still facilitating market competition to keep the cost of investment products low. Achieving the necessary balance while enabling the investment markets to develop and operate efficiently will require careful design and effective market oversight. This can be achieved by dividing allowable savings products into two groups. The first would be arrangements under which sellers agree to deliver a defined level of post-retirement income in return for a stream of payments made up to retirement. Such an arrangement is generally referred to as an annuity contract and is typically sold by insurance companies that underwrite both investment and mortality risk. These arrangements are most efficient when a large pool of contracts is pooled to
224
China’s Pension System
manage the unknown life expectancy of any one individual. The second group would be investment management contracts, under which sellers agree to manage accumulated savings within an established set of parameters in return for a fee. Under such an arrangement, the investment risk is borne entirely by the individual. On reaching retirement, he or she must then decide how to best convert accumulated savings into an income stream during his or her retirement. Both of these types of savings products should be permitted, but their permissible characteristics should be carefully restricted. At the most basic level, this can be achieved by simply restricting the use of the term pension savings product to specifically designed and licensed products available to supplementary pension scheme participants. In addition, access to tax preferences or other subsidies should be restricted to licensed pension savings products to provide the necessary incentives and to distinguish them from other investment products. Annuity products should be licensed and sold as group products for employer-sponsored schemes or directly to individuals. The pricing and terms of group contracts should be regulated by the China Insurance Regulatory Commission (CIRC) following a general set of parameters, although pricing could be reviewed on an individual contract basis. IA contracts should be specified by age groups (this is most easily done by birth year) and be required to be marketed in easily comparable units, for example, by presenting the cost in relation to a specified payout unit (such as per 1,000 RMB per year). The pricing, fees, and underlying investments for each age band should be defined and regulated by the CIRC.
Investment Products Must Have Appropriate Risk and Return Characteristics
Pension investment products should likewise be limited to a set of defined products with risk and return characteristics appropriate to the nature of pension savings and offered at reasonable cost. International experience strongly suggests that individuals in general make poor decisions regarding the investment of their retirement savings. This underscores the importance of restricting licensed products to channel savings to a limited set of appropriate choices. The best way to achieve this objective is by using what are known as life-cycle portfolios. These are products that vary the composition of underlying securities to create portfolios with risk and return characteristics appropriate for savers of different ages. The central principle is that an individual’s capacity (and willingness) to
Voluntary Savings Arrangements
225
assume risk gradually diminishes as retirement approaches. Such products are now becoming prevalent in many international markets. By making such products the default option (to which individuals are assigned on the basis of their age if they do not affirmatively select another option), the decision process would be far easier and would channel retirement savings into reasonably constructed portfolios that would not require adjustment as individuals age. A limited number of alternatives could be phased in at a later date to allow flexibility to those who wish to opt out of the basic life-cycle framework. The evidence from developed financial markets indicates that most variation across investment portfolios is the result of how investments are allocated across broad classes of assets. Life-cycle portfolios can, therefore, be effectively defined using relatively narrow ranges of acceptable allocation among major asset classes deemed appropriate for differing stages of the life cycle. In this way assets can be gradually shifted from more volatile but higher-earning investments to more predictable but lower yielding investments as cohorts near the retirement age. The basic parameters governing asset allocation should be supplemented by additional limits to constrain underlying portfolios within an overall risk parameter. Limits must be designed specifically for the Chinese market and should evolve in response to market development as new products are introduced and experienced is gained. Within such a framework, individual savings would be assigned to an investment option as a function of the individual’s birth year. Cohortspecific products should adjust as the cohort ages, gradually progressing through asset allocation and risk standards that decrease permissible risk as the retirement age nears. These could be defined within five-year age bands. Permissible fees and expenses for licensed products must be defined through regulation. A reference benchmark for each age grouping, derived from the asset allocation rules and permissible risk parameters, should be created and published by the regulatory authority along with a comparison of performance of individual products against the benchmark. This would provide an easily interpretable mechanism for evaluating the performance of a given investment product and would facilitate competition in the market on the basis of performance against a common standard. Such an approach has been implemented successfully in several countries. Age-related portfolios based on long-term strategic asset allocation standards should become the default investment product for all supplementary pension schemes to include employer-sponsored arrangements
226
China’s Pension System
(such as the proposed OAs) and those provided in the individual retail market. Both employer arrangements and retail schemes should offer annuity and managed products on equivalent terms. Investment products could be provided by any licensed financial institution (such as banks, investment companies, or insurance companies) capable of meeting the licensing criteria established by the supervisory authority. Creating a transparent and easily understood performance metric in the form of benchmarks for age-related products will encourage performance based on competition in the market. Competition on equal terms across products and type of providers will help keep costs low. Market participants will have to be rigorously supervised based on a common set of standards developed by the authorities. Coordinating supervision of financial markets is a crucially important challenge—but one that must be addressed in any event. Making life-cycle products the default option will channel a large portion of voluntary retirement savings into long-term instruments. Initially, this will direct funds into more stable long-term equities capable of utilizing long horizons to seek growth opportunities, but it will also stimulate demand for longer-term debt instruments, thereby gradually extending the maturity of fixed-income products in China and facilitating the development of a longer yield curve for interest rates. Such an outcome has been observed in other countries and offers secondary developmental benefits for the economy. Imposing parameters to manage portfolio risk will require the development of risk management expertise by institutional investors and will facilitate their introduction of risk management instruments. This, too, will benefit the markets and, ultimately, the economy.
Supplemental Pension Schemes Must Be Supported by Appropriate Tax Policies
At present, the tax treatment of supplementary pension savings remains uneven and insufficient to direct savings into pension-specific products. Ministry of Finance Document 34, issued in February 2008, appears to limit contributions to supplementary pensions that are excluded from the taxable income of sponsoring employers to 4 percent of total wages, a level that is unlikely to generate enough additional income to adequately supplement the reformed system of Basic Pensions. Before the issuance of this document, tax preferences were set at the provincial and municipal levels and varied widely by jurisdiction. No exclusion from income taxation is provided for contributions from workers or for individual savings
Voluntary Savings Arrangements
227
outside the EA system. One municipal government has undertaken a pilot to allow the exclusion of some group pension insurance products at a cost of up to 8 percent of employer payroll. Elsewhere, no direct economic incentives are given for the purchase of annuity products for retirement. To foster a robust supplementary savings scheme, a uniform national policy on the tax treatment of supplemental pension savings is needed. Most importantly, tax incentives need to be accessible to all, regardless of an individual’s source of earnings. A permissible ceiling of income that can be excluded from taxation should be at least as large as the (roughly) 8 percent of individual earnings now allowed under the EA scheme, provided that funds are contributed to standardized and licensed pension savings products. For an average full career worker, this would generate a benefit sufficient to provide an additional 20 percent of income replacement if investments earn a rate of return slightly higher than economywide wage growth. The availability of tax preferences should be constrained by a ceiling to prevent very high-income individuals (who are not at risk of poverty in their old age) from unduly benefiting from the exclusion. Investment earnings from licensed pension products should be exempt from all taxation until they are taken as income in retirement. Benefits received in retirement (and any pre-retirement withdrawals) should be taxed as regular income. This is needed to recapture some of the foregone tax value and to avoid providing an unduly large tax benefit to higherincome individuals. Such an approach to the tax treatment of pension savings would be in line with prevailing international practice and would create incentives for retirement savings by treating it as deferred consumption for tax purposes. Favorable tax treatment should be accessible to all individuals who want to save for retirement, including those who purchase products at the retail level as well as groups of workers who earn benefits through an OA or similar employment-based arrangement. Workers covered by an employer scheme should not be permitted to make additional individual tax-deferred savings in excess of the limits imposed for individual schemes. Preferential tax treatment should be limited to savings invested in one of the licensed pension savings products outlined above. Linking favorable tax treatment and licensed pension savings products is crucial to the development of a consistent and secure investment framework in which products are licensed and properly regulated and supervised.
228
China’s Pension System
Favorable tax treatment should be applied on an equivalent basis to purchases of annuity contracts and to investment management products, provided that contracts and products are properly licensed. Although withdrawals before retirement should not be strictly prohibited, tax subsidies should be recaptured by imposing a special tax or other penalty on such withdrawals. Transfers among pension providers should be permitted, of course, so that workers leaving an employer-sponsored scheme can transfer their savings to a retail or insurance product without incurring additional costs.
Supplemental Pensions Schemes Should Be Accessible to All
Supplemental retirement savings products should accessible to all individuals and employees of small and medium enterprises (SMEs). Reaching the self-employed, persons working in the informal sector, and those employed in SMEs is essential to achieving the full potential of a supplemental retirement savings system. This challenge is made more difficult because these individuals tend to have less capacity to save as a result of lower incomes and less stable and shorter-term working arrangements. This limitation can be partially addressed through access to favorable tax treatment and to a program of matching contributions, as outlined above, but it also requires access to a retail market for pension savings products sold at reasonable costs. Because of the small size of such accounts and the fixed costs of administering them, such a market typically does not develop rapidly on its own. The process can be accelerated by making participation in this market a precondition for licensing any pension savings product, thereby forcing providers to offer the same products at the retail level that they offer to more profitable employer-based schemes. Inevitably, this will result in cross-subsidies that favor the retail market— both for investment management products and for annuity contracts—as a result of economies of scale in administration and the potential for adverse selection with respect to mortality in the individual annuity market. Such cross-subsidies should be carefully evaluated, and adjustments in the rules may be required in the future. Initially, however, they are justified to create the perception that the system is fair and equitable and to overcome the challenges inherent in reaching the informal and lowwage sector. Reaching workers in SMEs will require adjustments in the current EA framework to create a structure for worker organizations or groups of small employers to sponsor pension schemes. This could take several potential forms, including the creation of a collective investment product
Voluntary Savings Arrangements
229
that might be offered to smaller employers and the development of multiple employer arrangements based on a common industry or workers organization. The Ministry of Human Resources and Social Security (MHRSS) has been considering these alternatives for several years but has yet to put forward a proposal. The promulgation of a legal and regulatory framework to (1) extend the EA system to workers associations and groups of employers and (2) create collective investment arrangements should be a priority for both the MHRSS and the China Securities Regulatory Commission (CSRC).
Structures Are Needed to Efficiently Convert Savings into Retirement Income
It is important to create a structure to convert pension savings into retirement income. One of the most difficult challenges that supplementary pension systems face is how to manage the conversion of accumulated retirement savings into a stream of reliable post-retirement income. Individuals have uncertain and variable life expectancies following retirement and typically lack the analytical skills and self-discipline to effectively manage the drawdown of their savings. The presence and perception of risk will decrease the efficiency of savings as individuals engage in precautionary behavior. An optimal solution to this problem is the purchase of an annuity contract that pools mortality risk. Experience has demonstrated that this is difficult to achieve in private insurance markets because individuals are better able to assess their own life expectancy than can annuity providers. When conversion of account balances is optional, a strong tendency is seen for only those with above average longevity to make such a purchase. In addition, individual annuity sellers—who underwrite both the investment and mortality risk of these contracts—have a strong financial incentive to select lower-cost customers (that is, those with shorter life expectancies) and to avoid those with statistically greater longevity. These challenges can be partly addressed by channeling as large a share of supplementary savings as possible into the annuity market and by collectivizing the risk. Similar to improving investment decisions by exploiting the tendency of inertia in making financial decisions, the purchase of annuities should be made the default payout from supplementary pension schemes. On reaching a specified age, coordinated with the projected transition from work to retirement on which the investment parameters are established, individual account balances should be automatically converted into an annuity contract. Individuals who have sufficient credits
230
China’s Pension System
within the basic pension system—or have adequate savings to produce a prescribed level of retirement income—could be given the choice to take a phased withdrawal of funds or to continue to invest them in an alternative product. This transition from savings to income is likely to be most efficient when the default standard is a phased conversion of account balances into annuity contracts over a 10-year period around the assumed retirement date. This limits exposure to short-term fluctuations in asset values and interest rates. Annuity contracts should also be required to be inflation indexed to protect the purchasing power of benefits. This is likely to require public intervention in the development of annuity markets, because China currently lacks such instruments in its private insurance market. The provision of long-term government-backed debt instruments to support the efficient underwriting of annuity contracts will likely become necessary for these instruments to develop, although they will not be required on a large scale for many years. Several approaches to organizing an annuity market merit consideration. One would be to require all annuity conversions to be aggregated in a publicly managed pool from which private vendors would bid to underwrite a randomly selected portion of contracts, thereby benefiting from large groups and avoiding adverse selection. Another would be to simply combine supplemental savings with the mechanism used to pay benefits from the old-age insurance system. If an NDC architecture is adopted for the public system, this would provide important liquidity to the system during the early stages of benefit payouts.
Supplemental Pension Schemes Should Promote Investment in Human Capital
An essential challenge for any market economy is to create incentives for enterprises to invest in the human capital of their workers. Concurrent with the challenge of managing population aging, China will also need to transition from an economy based on low-cost commodity labor to one where value is created from intellectual capital and higher skilled and higher value-added labor. This demands market mechanisms that (1) can effectively match skills with demands and (2) create incentives for employers to invest in the development of their employees. The former can be facilitated by standardizing retirement savings products and enabling the portability of pension assets across schemes. This will require the same products to be available in the retail market as are available in employer-sponsored schemes, as well as uniform tax treatment so that
Voluntary Savings Arrangements
231
workers can transition from one plan to another on identical terms. To achieve the latter, the current limit of 4 percent of the total wage bill that may be charged against expenses and exempted from tax should be retained for employers that sponsor an OA. (This 4 percent allowance would be in addition to the 8 percent of earnings that can be excluded by individuals contributing to supplemental pension schemes.) Employers should be permitted to impose eligibility conditions on their contributions, such as vesting requirements. In doing so, employers will have the tools they need to attract and retain workers in a competitive market and the incentive they need to invest in the training and development of their workforce. The current provision that permits employers to allocate contributions among workers on the basis of objective criteria such as length of service or performance would also help achieve this objective.
The Path to Implementation
Establishing a supplemental retirement savings system that fulfills the goals and principles outlined above will require (1) creating a new legal and institutional framework for standardized pension savings products and (2) building on the existing foundation of the EAs and current insurance market to align them with the new policy framework and enhance their security.
Creating a New Legal and Institutional Foundation
The market for supplemental retirement savings products should not be segmented (as is currently the case) on the basis of issuers of the products (which are currently differentiated as licensed EA scheme investment managers, insurance companies, and investment funds) but on the basis of a common set of permissible characteristics. A central authority that can define the various products and develop their parameters will be required. Given the linkage with tax policy, it would seem logical that this underlying framework be established under the auspices of the Ministry of Finance. A specialized unit within the ministry should be established for this purpose to promulgate standards and provide guidance and oversight to the respective regulatory authorities. Common standards that should be established by this unit include the following: • Permissible asset classes and asset allocation parameters by age band • Metrics for risk measurement and risk standards by product
232
China’s Pension System
• A methodology for establishing benchmarks for performance measurement and standards for a common performance reporting system • Marketing limitations and standards • Requirements for the segregation and custody of assets • A common framework for prudential conduct, to address such issues as conflicts of interest, that would be applied across all institutions that offer licensed pension savings products • Accounting requirements to include a common framework for the valuation of assets • Requirements for independent financial audits and compliance audits • Minimum funding requirements (that is, asset/liability standards) for annuity products and minimum capital and reserve requirements for investment products. Once the standards for products have been established, their oversight and supervision can then be delegated to the respective authorities to include CIRC (for insurance products), CSRC (for investment companies and other asset managers), and the People’s Bank of China (for banks which wish to offer the products). Although in the abstract it might be theoretically attractive to consolidate supervisory responsibility for licensed pension products under a single authority, this would create major organizational and jurisdictional conflicts given the current allocation of regulatory authority by the type of financial institutions. To provide consistency and security for retirement savings products, the development of an overall coordination body, probably best located in the Ministry of Finance, will also be needed. An open question relates to the role of the MHRSS with respect to the oversight of employer-based OAs. Under current provisions pertaining to the EA, its supervisory authority currently extends to the licensing of investment managers and the establishment of quantitative limits on portfolio composition, as is contained in MHRSS Document No. 23, promulgated in 2004. The World Bank recommends replacing current portfolio limits and the licensing process with the requirement that EA scheme assets be invested in standardized new supplemental retirement savings products. These new products would be more directly aligned with the need to align savings by age rather than the current practice of pooling all workers from a given sponsor into a common portfolio. This would free the MHRSS to focus its oversight effort on issues relating to the performance of trustees, the governance process, the integrity of
Voluntary Savings Arrangements
233
record keeping, and other issues related to the agency risks inherent in employer-sponsored schemes. Creating a uniform and appropriate tax framework would need to be handled at a national level through the Ministry of Finance. A legal framework for establishing national tax policies may be required to supersede provincial and municipal authority with respect to supplemental retirement savings. Establishing a defined set of standardized products should facilitate the differentiation of authority between local and national levels, provided that the legal basis for taxation is amended as necessary to reserve authority over the treatment of such entities for national authorities. Existing provincial tax limits that differ from national standards as well as other conflicting initiatives would need to be preempted by national standards. Establishing a means to convert supplemental retirement savings into reliable annuity payments will require a strategic decision whether to rely on a public clearinghouse with managed competition or to integrate the provision of annuities with the basic pension scheme.
Enhance the EA System and Insurance Products to Support Wider Participation
A well-designed and efficiently functioning employer-sponsored system provides an important foundation of supplemental savings. By virtue of possessing the capacity to facilitate savings through payroll deduction, employer-based schemes have proven to be highly effective in increasing pension savings. To be effective, they must be perceived as fair and reliable. This demands effective supervision. The current EA scheme remains in a formative stage. Defining standard investment products to replace the current MHRSS investment framework and assigning responsibility for the licensing and oversight of financial institutions to their respective specialized authorities will reduce the demands on the MHRSS and enable it to focus on a narrower range of issues more consistent with its comparative expertise. The following additional steps are recommended: • Separate the responsibility for overseeing supplemental pension schemes from the very different job of supervising social security institutions by creating a specialized unit for this purpose with resources consistent with its scope of responsibilities • Develop a comprehensive oversight strategy grounded in risk assessment of the programs of individual EA scheme sponsors and licensed institutions
234
China’s Pension System
• Raise the level of legal authority above MHRSS circulars by establishing a national law and refocus the authority and mandate of the MHRSS on such issues as the role of employers and other licensed intermediaries in managing contribution flows and ensuring the integrity of individual savings accounts • Develop a comprehensive framework for prudential regulation that addresses potential conflicts of interest among parties (sponsors, trustees, and asset managers) involved in the administration of the system • Distinguish clearly the roles and responsibilities of the MHRSS in relation to the provincial labor authorities to ensure that oversight of the system is undertaken in a consistent manner • Develop a system of reporting that provides participants in EA schemes with reliable information on their savings and the performance of their investments in relation to benchmarks.
Create an Institutional Framework for SMEs
Two possible approaches are seen to extend the occupational pension system to smaller entities. The first is to allow the marketing of pension products to multiple employers within a common administrative structure organized by a licensed service provider. The second is to allow multiple employers and groups of worker associations to sponsor an EA scheme. Together, these would provide the legal basis for smaller enterprises to cost effectively offer workers the opportunity to participate in supplemental pension schemes. The first approach merely requires allowing the basic EA scheme framework to be extended to establish a means for licensed trustees to market a bundled product of custody, record keeping, and asset management to smaller entities rather than requiring them to formally sponsor an EA scheme and engage service providers separately. This would result in what is known as a master trust type of arrangement. The second approach would require the establishment of a carefully constructed governance structure—although this challenge would be considerably diminished if investment management was strictly controlled through licensing and the oversight of pension products by financial services authorities. The required governance structure would perform the same functions of the Pension Councils created under existing EA scheme regulations. A stronger set of rules that impose “fit and proper” standards and an overall set of prudential standards should be established to fill a critical gap in the current regulatory structure.
Voluntary Savings Arrangements
235
References
Hinz, R. 2007. “The New Enterprise Annuities: The Need to Strengthen a Key Element of the Chinese Pension System.” Mimeo, World Bank, Washington, DC. Holzmann, R., and R. Hinz. 2005. Old Age Income Support in the 21st Century. Washington, DC: World Bank. Jackson, R., and N. Howe. 2004. The Graying of the Middle Kingdom. Washington, DC: Center for Strategic and International Studies. Organisation for Economic Co-operation and Development (OECD). 2002. Supervisory Structures for Private Pension Funds: Survey Analysis. Paris: OECD. Sin, Y. 2005. “China: Pension Liabilities and Reform Options for Old Age Insurance.” World Bank Research Working Paper 2005–1, World Bank, Washington, DC. Trinh, T. 2006. China’s Pension System: Caught between Mounting Legacies and Unfavourable Demographics. Frankfurt: Deutsche Bank Research. Whitehouse, E. 2007. Pensions at a Glance. Paris: Organisation for Economic Co-operation and Development. ———. 2009. Pensions at a Glance. Paris: Organisation for Economic Co-operation and Development. World Bank. 2005. “Evaluation of the Liaoning Pension Reform Pilot.” Working Paper 38183, World Bank, Washington, DC.
Glossary
Accrual rate. The rate at which pension entitlement is built up relative to earnings per year of service in a defined-benefit scheme, for example, 1.0 percent of the salary basis per year of applicable service. Accrued pension (benefit). The value of the pension to a member at any point before retirement, which can be calculated on the basis of current earnings or also include projections of future increases in earnings. Actuarial fairness. A method of setting insurance premiums according to the true risks involved. Additional voluntary contributions. Contributions to a pension scheme over and above the employee’s mandatory contribution rate. Administration. The operation and oversight of a pension fund. Adverse selection. A problem stemming from an insurer’s inability to distinguish between high- and low-risk individuals. The price for insurance then reflects the average risk level, which leads low-risk individuals to opt out and drives the price of insurance higher until insurance markets break down.
This glossary is drawn from Robert Holzmann and Richard Hinz, Old Age Income Support in the 21st Century (Washington, DC: World Bank, 2006), and OECD, Private Pensions: OECD Classification and Glossary (Paris: OECD, 2005), used with permission. Terms indicated in parentheses are synonymous with the terms listed. 237
238
China’s Pension System
Aging from above. Growth in the elderly population resulting from increases in life expectancy. Aging from below. Process by which decreasing fertility rates gradually lead to an increase in the proportion of the aged relative to the working age population as the working age population grows more slowly than the elderly population. Annuity. A stream of payments at a specified rate, which may have some provision for inflation proofing, payable until some contingency occurs, usually the death of the beneficiary or a surviving dependent. Annuity factor. The net present value of a stream of pension or annuity benefits. Average effective retirement age. The actual average retirement age, taking into account early retirement and special regimes. Balancing mechanism. Adjustment to a notional interest rate that accommodates deviations between assets and liabilities created by long-term demographic and other changes to preserve long-term financial sustainability of the pension fund. Beneficiary. An individual who is entitled to a benefit (including plan members and dependents). Benefit. Payment made to a pension fund member (or dependents) after retirement. Buffer fund. Fund established to provide liquidity to accommodate sudden exogenous shocks and temporary demographic shifts affecting pension system finances. Contribution base. The reference salary used to calculate the contribution. Contribution ceiling. A limit on the amount of earnings subject to contributions. Contributory pension scheme. A pension scheme where both the employers and the members have to pay into the scheme. Custodian. The entity responsible, as a minimum, for holding the pension fund assets and for ensuring their safekeeping. Defined benefit. A pension plan with a guarantee by the insurer or pension agency that a benefit based on a prescribed formula will be paid. Defined contribution. A pension plan in which the periodic contribution is prescribed and the benefit depends on the contribution plus the investment return. Demographic transition. The historical process of changing demographic structure that takes place as fertility and mortality rates decline, resulting in an increasing ratio of older to younger persons. Dependent. An individual who is financially dependent on a (passive or active) member of a pension scheme.
Glossary
239
Disclosure. Statutory regulations requiring the communication of information regarding pension schemes, funds, and benefits to pensioners and employees. Discretionary increase. An increase in a pension payment not specified by the pension scheme rules. Early leaver. A person who leaves an occupational pension scheme without receiving an immediate benefit. Early retirement. In a state-sponsored scheme, retirement before reaching the state’s pensionable age for receipt of full benefits. Earnings cap (ceiling). A limit on the amount of earnings subject to contributions. EET system. A form of taxation of pension plans, whereby contributions are exempt, investment income and capital gains of the pension fund are also exempt, and benefits are taxed from personal income taxation. ETE system. A form of taxation whereby contributions are exempt, investment income and capital gains of the pension fund are taxed, and benefits are also exempt from personal income taxation. Final average earnings (final reference wage). The fund member’s earnings that are used to calculate the pension benefit in a defined-benefit plan; it is typically the earnings of the last few years before retirement. Financial asset. The market value of any investments held by a pension fund. Full funding. The accumulation of pension reserves that total 100 percent of the present value of all pension liabilities owed to current members. Funding. Accumulation of assets in advance to meet future pension liabilities. Funding plan. The timing of payments of contributions with the aim of meeting the cost of a given set of benefits under a defined-benefit scheme. Implicit pension debt (net). The value of outstanding pension claims on the public sector minus accumulated pension reserves. Indexation. Increases in benefits by reference to an index, usually of consumer prices, although in some cases of average covered wage growth. Individual account. An accounting entry that specifies accumulated contributions and other accumulations in the case of defined-contribution schemes and contribution histories in the case of defined-benefit schemes. Individual accounts can also be individual asset accumulations in the case of funded schemes. Individual pension plans (personal pension plans, voluntary personal pension plans). Access to these plans does not have to be linked to an employment relationship. The plans are established and administered directly by a pension fund or a financial institution acting as pension provider without any intervention of employers. Individuals independently purchase and select
240
China’s Pension System
material aspects of the arrangements. The employer may nonetheless make contributions to individual pension plans. Some individual plans may have restricted membership. Intergenerational distribution. Income transfers between different age cohorts of persons. Intragenerational distribution. Income transfers within a certain age cohort of persons. Legacy costs. Cost of financing the implicit debt (that is, the present value of benefit promises to current beneficiaries and current workers before the implementation of the reform) over and above (a) the value of the pay-as-you-go asset (under a new contribution rate) and (b) the financial assets set aside to prefinance accrued rights. Legal retirement age (normal retirement age). The normal retirement age written into pension statutes at which employees become eligible for pension benefits, excluding early-retirement provisions. Mandatory contribution. The level of contribution the member (or an entity on behalf of the member) is required to pay according to scheme rules. Marginal pension. The change in the accrued pension between two periods. Matching defined-contribution (MDC) approach. An approach whereby worker pension contributions are matched by contributions made by an employer or by a state subsidy. Means-tested benefit. A benefit that is paid only if the recipient meets qualifying conditions, such as income falling below a certain level. Minimum pension (guarantee). The minimum level of pension benefits the plan pays out in all circumstances. A guarantee can also be provided by the government to bring pensions to some minimum level, possibly by “topping up” the capital accumulation needed to fund the pensions. Moral hazard. A situation in which insured people do not protect themselves from risk as much as they would have if they were not insured. For example, in the case of old-age risk, people might not save sufficiently for themselves if they expect the public system to come to their aid. Noncontributory pension scheme. A pension scheme where the members do not have to pay into the scheme. Nonfinancial (or notional) defined-contribution (plan). A defined-benefit pension plan that mimics the structure of (funded) defined-contribution plans but remains unfunded (except for a potential reserve fund). Normal retirement age. See legal retirement age. Notional (or nonfinancial) accounts. Individual accounts where the notional contributions plus notional interest rates accrued are credited and determine the notional capital.
Glossary
241
Notional (or nonfinancial) capital. The value of an individual account at a given moment that determines the value of annuity at retirement or the transfer value in case of the transfer of accrued pension rights from another scheme. Notional (or nonfinancial) interest rate. The rate at which the notional accounts of notional defined-contribution plans are annually credited. It should be consistent with the financial sustainability of the unfunded scheme (potentially the growth rate of the contribution base). Occupational pension scheme. An arrangement by which an employer provides retirement benefits to employees. Old-age dependency ratio. The ratio of older persons to working-age individuals. The old-age dependency ratio may refer to the number of persons over age 60 divided by, for example, the number of persons aged 15–59, the number of persons over 60 divided by the number of persons aged 20–59, and so forth. Pay-as-you-go. In its strictest sense, a method of financing whereby current outlays on pension benefits are paid out of current revenues from an earmarked tax, often a payroll tax. Pay-as-you-go assets. The present value of future contributions minus pension rights accruing to these contributions. Pension coverage rate. The number of workers actively contributing to a publicly mandated contributory or retirement scheme, divided by the estimated labor force or by the working-age population. Pension liabilities. Balance of the obligations to current workers and retirees at a point in time. Pension lump sum. A cash withdrawal from a pension plan. Pension spending. Usually defined as old-age retirement, survivor, death, and invalidity-disability payments based on past contribution records plus noncontributory, flat universal, or means-tested programs specifically targeting the old. Pensionable earnings. The portion of remuneration on which pension benefits and contributions are calculated. Portability. The ability to transfer accrued pension rights between plans. Price indexation. The method with which pension benefits are adjusted taking into account changes in prices. Replacement rate. The value of a pension as a proportion of a worker’s wage during a base period, such as the last year or two before retirement or the entire lifetime average wage. Also denotes the average pension of a group of pensioners as a proportion of the average wage of the group. Retirement age. See legal retirement age. Supplementary pensions. Pension provision beyond the basic state pension on a voluntary basis.
242
China’s Pension System
Support ratio. The opposite of the system dependency ratio: the number of workers required to support each pensioner. Swiss indexation (mixed indexation). A method with which pension benefits are adjusted taking into account changes in both wages and prices. System dependency ratio. The ratio of persons receiving pensions from a certain pension scheme divided by the number of workers contributing to the same scheme in the same period. System maturation. The process by which a pension system moves from being immature, with young workers contributing to the system, but with few benefits being paid out because the initial elderly have not contributed and thus are not eligible for benefits, to being mature, with the proportion of elderly receiving pensions relatively equivalent to their proportion of the population. Target replacement rate. The targeted level of wage replacement at retirement for an average wage worker. TEE system. A form of taxation of pension plans whereby contributions are taxed, investment income and capital gains of the pension fund are exempt, and benefits are also exempt from personal income taxation. Transition costs. Costs of financing finance both the benefits paid to current retirees and to prefund the accounts of workers who have yet to retire. Trust. A legal scheme, whereby named people (termed trustees) hold property on behalf of other people (termed beneficiaries). Trustee. A person or a company appointed to carry out the tasks of the trust. Universal flat benefit. Pensions paid solely on the basis of age and citizenship, without regard to work or contribution records. Valorization of earnings. A method of revaluing earnings by predetermined factors such as total or average wage growth to adjust for changes in prices, wage levels, or economic growth. In pay-as-you-go systems, pensions are usually based on some percentage of average wages. This average wage is calculated over some period of time, ranging from full-career average to last salary. If the period for which earnings history enters into the benefit formula is longer than the last salary, the actual wages earned are usually revalued to adjust for these types of changes. Vesting period. The minimum amount of time required to qualify for full and irrevocable ownership of pension benefits. Voluntary contributions. An extra contribution paid in addition to the mandatory contribution a member can pay to the pension fund to increase the future pension benefits. Voluntary occupational pension plans. The establishment of these plans is voluntary for employers (including those in which there is automatic enrolment as part
Glossary
243
of an employment contract or where the law requires employees to join plans set up on a voluntary basis by their employers). Voluntary personal pension plans. See individual pension plans. Wage indexation. The method with which pension benefits are adjusted taking into account changes in wages.
China is at a critical juncture in its economic transition. Comprehensive reform of its pension and social security systems is an essential element of a strategy aimed toward achieving a harmonious society and sustainable development. Despite recent reforms to expand pension coverage, a widely held view among policy makers is that the current approach to pension provision and reform efforts piloted over the last 15 years may be insufficient to enable China’s economy and population to realize sustainable and broadbased old-age income protection in the years ahead. Issues such as legacy costs, system fragmentation, the retirement age and some remaining gaps in worker coverage in the current system have not yet been fully addressed. At the same time, new challenges have emerged, such as rapid aging, substantial internal migration, increased income inequality and urban-rural disparities, informalization of the labor force, and changes in family structure. A reform vision for China’s pension system should address policy issues in the current system design, consider reform needs that have emerged, and anticipate the future needs of China’s rapidly changing society. China’s Pension System: A Vision offers a proposal for strengthening old-age income protection in China and suggests design options to achieve it. The book examines key trends motivating the need for reform then outlines a pension system design vision for the long term. Such a vision includes stronger instruments to achieve universal elderly coverage and greater portability between pension schemes. It also suggests financing options for current and future pensions and institutional reforms. Technical appendices provide additional analysis supporting the findings and recommendations.
ISBN 978-0-8213-9540-0
SKU 19540
|
https://www.scribd.com/doc/127535186/China-s-Pension-System
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
hi,
I don't how to generate applet window in wed. This applet window have File to save/load. Would you give me source code or related java class to let me see API please?????
thanks
wilson^^
i wrote this in JCreator LE:
import java.applet.*;
public class title extends Applet
{
public void paint(Grahpics screen)
{
//code in here
}
}
umm once you get used to that you can add on features to interact with the mouse..make sure in your html (because applets run in html) that you have the code
<applet code="filename.class" width=400 height=400></applet>
It helps if you write your html file in the same file that your .class file is in
IM me on aim if you have any questions - Sportsdude11751
They say if you play a Microsoft Windows CD backwards it will play satanic messages. But thats nothing, if you play it forwards it installs Windows.
Originally posted by Sportsdude11751
i wrote this in JCreator LE:
import java.applet.*;
public class title extends Applet
{
public void paint(Grahpics screen)
{
//code in here
}
}
JCreator must be a crock of censored then, because i've never seen an object in the class hierarchy called Grahpics
i dont know what WED is.. wednesday? hmm
anyways.. i odnt know how much you know about applets, but i'll tell you for free that they cant save or load anything - that would be a security risk.. so creating a save and load menu in an applet, youre only going to have to grey it out anyway, because it wont
|
http://forums.devx.com/showthread.php?139972-how-to-generate-applet-window&p=414304
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
Impossible to Possible
2008 Edition
Published by
Korean Culture and Information Service
Ministry of Culture, Sports and Tourism
15, Hyojaro, Jongno-gu, Seoul, Republic of Korea
Telephone: 82-2-398-1910-9
Printed in Seoul
ISBN 978-89-7375-043-6 03340
Korean Government Publication Number
11-1371030-000015-01
For further information about Korea,
please visit:
K O R E A
Impossible to Possible
The history of human beings has been based on different people's
encounters and conversations. Exchanges between different people enriched
cultures and developed civilization worldwide. Korea has long cultivated rich and
peaceful relations with other countries, awarding itself the nickname the Land of
the Morning Calm.
The early 20th century, however, shattered the peaceful culture of Korea.
Japan's imperialist occupation of the Korean peninsula tortured our people and
left wounds on our history. Even after Koreas liberation in 1945, the countrys
recovery process from the destruction of its culture and institutions was long
and painful. Still worse, only five years after liberation from Japan, the country
suffered the heartbreak of the Korean War, which left the peninsula divided into
north and south. The state of war persists even through today.
In the ashes of the war, Korea completely recreated itself to overcome its
tortured history. The nation ran forward, through political whirlwinds and
economic slumps. The unprecedented miracle of the Han River led to economic
development and industrialization. Many Korean people sacrificed their lives to
usher in an era of democracy.
In the 21st century, Korean people have been charged with the mission to
continue to move ahead. Our neighbors ask us to contribute to world peace and
prosperity through dialogue and exchange. Korea's development is largely
F O R E W O R D
attributable to learning from the experience of other countries. Now, it is high
time that we pay back what we owe our allies.
"Korea: Impossible to Possible," a collection of well-known international
authors writing about Korea's development over the past 60 years, is part of the
Korean government's efforts to listen to outside perceptions and opinions about
my country. Through their contributions, Ive seen that these authors havent
shied away from using tough words when they felt it necessary to describe
Koreas development. This is something that I appreciated very much.
Third-party perspectives oftentimes help us to recognize overlooked
details. We will sincerely listen to the authorsvaluable advice contained herein
and try harder to open up Korean society to the outside world.
I believe the authors could not wholly express all their thoughts about
Korea in the limited space provided. However, this book will work as an initiative.
We hope to see Korea approaching a wider range of its neighbors in the near
future. Thank you very much.
October 2008 Minister of Culture, Sports and Tourism
008 I. The Changing Face of the Republic of Korea
044 II. Views from Abroad
046 The Republic at Sixty
Guy Sorman
_
South Korea at Sixty
M. S. Gorbachev
_
Republic of Korea: An Important Partner to Russia
in Southeast Asia
Zhang Yunling
_
A Miraculous Six Decades
Kazuo Ogoura
_
Korea: Past, Present and Future
082 Still Growing
Peter J. Katzenstein
_
Advantages of Adversity: South Korea at Sixty
Jeffrey D. Jones
_
Korea-U.S. Economic Cooperation: 60 Years of Passion,
Conflict & Profit
Shi Yuanhua
_
Heading Towards a New Miracle Creation and Glory:
In Celebration of 60th Anniversary of Korea
Sandip Kumar Mishra
_
Service Sector of Korea in Global Knowledge
Economy: Challenges and Prospects
118 A Changing Society
Carter J. Echkert
_
Seoul in the 1970s
Michael Breen
_
New Country, New Lives: How Life Has Changed for Koreans
in the Past Sixty Years
C O N T E N T S
144 Education, Culture and the Arts
Horace H. Underwood
_
Teaching the World: Korean Education Becomes
Global Education
Melissa Chiu
_
Korean Fine Arts
Roger Garcia
_
Korean Cinema
174 International Relations
Donald P. Gregg
_
Ties with the Eastern Bloc: The Presidency of Roh Tae-woo
(1988-1993)
Kishore Mahbubani
_
The Paradox of Korea: Strong Yet Vulnerable
Fen Osler Hampson
_
Global Order and the Future of Regional Security
Louis T. Dechert
_
Korea’s Growth Seen from Abroad: Successful Nation-
Building
220 North and South, 60 Years On
Marcus Noland
_
Inter-Korean Economic Relations at 60
Selig S. Harrison
_
Towards a Stable Confederacy
John Rich
_
Beyond All Expectations
Andrei Lankov
_
Exclusive Dreams: Two Koreas in Search of Unification
KOREA
Impossible to
Possible
I
The Changing Face
of the Republic of Korea
11
1 •
The foundation of the Republic of Korea. (Aug. 15, 1948)
2 •
Korean Citizens celebrate the country's independence on August 15 from its
Japanese colonial rulers. (Aug. 15, 1945)
3 •
The country’s first democratic elections are held. (May 10, 1948)
1
2
3
12
13
1 •
U.S. sailors unload presents that will
be given to orphans.(May 5, 1953)
2 •
Refugees use an ox cart to carry
their belongings.
3 •
War refugees suffering from hunger.
4 •
A U.S. soldier chats with elderly
Koreans and some children during
the war.
3
4
1
2
14
15
1 •
Soldiers hoist the Korean national
flag after retaking Seoul.(Sept. 28,
1950)
2 •
Soldiers heading to the frontline pass
refugees from across the border.
3 •
Elementary students during the
Korean War
2
1
3
16
17
1 •
The construction of the Gyeongbu
Expressway, which started on Feb.1,
1968, connecting Seoul and Busan,
was completed on July 7, 1970.
2 •
After the war, wigs became a major
industry well into the 1960s.
3 •
Workers try to restore the Han River
Bridge after the Korean War.
1
2
3
18
The Saemaeul Movement, or New
Community Movement, is launched.
(Sept. 1971)
19
20
21
1 •
The textile industry became the
country's main light industry in the
1970s.
2 •
Young people play guitar on a train in
the 1970s.
3 •
A view of Posco Steel mill in the
1970s. Posco Steel is responsible for
making Korea a leader in the global
steel market.
2
1
3
22
1 •
Gwangju Pro-Democracy uprising,
1980.
2 •
Large ships under construction in the
Daewoo shipyard in the 1980s.
3 •
Samsung Electronics first full-color
TV factory in 1980.
4 •
Doosung, an oil prospecting ship built
by Korea National Oil Corp. in 1983.
3
1
2
4
23
24
25
Opening ceremony of the
1988 Seoul Olympics.
26
27
1
2
3
1 •
Bulguksa, the Temple of the Land
Buddha, sits mid-slope on Mt.
Tohamsan. UNESCO designated
the temple as a world heritage
site in 1995.
2 •
South and North Korea officially
joined the United Nations in 1991.
3 •
A counter in January 1998 for
buying gold as the country tries to
recover from the Asian financial
crisis of 1997.
28
29
1
1 •
The first inter Korean summit
meeting between former South
Korean President Kim Dae-jung
and the North’s leader Kim Jong-il
on June 15, 2000.
2 •
North Korean Workers at the
Gaeseong Industrial Complex.
3 •
The Mt. Geumgangsan tour started
in 1998. The picture is the scene of
Bodeokam temple in the mountain.
4 •
The Gaeseong tour, which started
in 2007, is a one-day overland
tour. The picture is the scene of
Seonjukgyo bridge.
2
3
4
30
31
1
2
3
4
1 •
Citizens cheer the national team at
the 2002 World Cup in front of Seoul
City Hall.
2 •
The mother and the son who cheer
the Korean soccer team.
3 •
The Red Devils, the official cheering
squad of South Korea's national
football team.
4 •
Koreans still like to recall the
victorious moment of the 2002
Korea-Japan FIFA World Cup when
the Korean national team advanced
to the semi-final
32
33
1 •
Semiconductor Research Center of
Samsung Electronics.
Samsung's 64 Gigabyte NAND Flash
memory.
2 •
Korea’s next generation nuclear
fusion facility KSTAR (Korea
Superconducting Tokamak Advanced
Reactor).
3 •
Gwangyang Port, a logistics hub for
Northeast Asia in southwest Korea.
4 •
The Gyeongbu and Honam lines of
the KTX, Korea’s high-speed train
that was launched on April 30, 2004,
after 12 years of construction work.
5 •
LG Electronics developed and
launched the world’s biggest liquid-
crystal display, or LCD, television on
Sept. 6, 2004.
1
3
4
5
2
34
35
1
2
3
1 •
Jeju Volcanic Island and Lava Tubes
have been registered as a UNESCO
World Heritage sites in 2007.
2 •
A foreigner learns how to make
pottery at the world ceramic
Biennale held in Gyeonggi province.
3 •
“The More the Better” by Korean
video artist Paik Nam-june.
36
37
1
2
3
4
1 •
Cheonggye stream, which
was restored and opened to
the public for the first time
in 47 years, attracted 10
million visitors in its first two
months.(Oct. 1, 2005)
2 •
The 4th Green Energy Expo held
in Daegu, Korea.
3 •
Wind power generators on
Mt. Taebaek. Wind power is
in the spotlight because of
the low carbon, green growth
movement.
4 •
The hydrogen automobile
which becomes known as the
environmental automobile.
38
39
1 •
UN Secretary-General Ban
Ki-moon gives a lecture in front of
a plaque of UN flags.
2 •
The country’s first astronaut Yi
So-yeon inside the space shuttle
before launch in April 2008.
3 •
Seven-hundred gamers from
73 countries participate at the
2007 World Cyber Games, an
international e-sports event.
4 •
A performance of a Korean B-boy
in 2008 - Korean B-boys are
known for mixing breakdance
routines with different art genres
like ballet and musical.
5 •
Nanta, Korea’s first non-verbal
stage show that features a
mixture of traditional Korean
percussion and dance.
1
3
4
5
2
40
41
3
4
5
1 •
A summit meeting at the Asia-
Pacific Economic Cooperation in
Busan.(Nov. 12, 2005)
2 •
The 17th president, Lee Myung-
bak waves after taking the oath of
office.(Feb. 25, 2008)
3 •
South Korea's Kim Yu-na
performs during the women's
short program at the World Figure
Skating Championships in Tokyo
March 23, 2007.
4 •
Korean swimmer Park Tae-hwan,
who won the gold medal in the
men’s 400-meter freestyle swim
at the 2008 Beijing Olympics.
5 •
Korean weightlifter Jang Mi-ran
sets world records by winning the
gold medal at the + 73-kilogram
class at the 2008 Beijing Olympics.
1
2
42
43
Children run along the garden square
located in front of City Hall during the
Seoul Festival in May 2008.
KOREA
Impossible to
Possible
II
Views from Abroad
The Republic at Sixty Guy Sorman
M. S. Gorbachev
Zhang Yunling
Kazuo Ogoura
Still Growing Peter J. Katzenstein
Jeffrey D. Jones
Shi Yuanhua
Sandip Kumar Mishra
A Changing Society Carter J. Echkert
Michael Breen
Education, Culture and the Arts Horace H. Underwood
Melissa Chiu
Roger Garcia
International Relations Donald P. Gregg
Kishore Mahbubani
Fen Osler Hampson
Louis T. Dechert
North and South, 60 Years On Marcus Noland
Selig S. Harrison
John Rich
Andrei Lankov
46
S
outh Korea at sixty in the Western eye has an image
probl em due to the Bengal i Nobel pri ze wi nner,
Rabindranath Tagore, an influential poet and a world traveler.
After he visited Seoul in the early twentieth century, Tagore
wrote a poem called “The Land of the Morning Calm”. The poem
became famous the world over and the name took. South Korea
became known globally as Morning Calm and the West still
perceives the country this way. These days, the name feels
inaccurate, to say the least. This motivated former President
Kim Dae-jung to rekindle the country’s reputation, not as calm
but as dynamic, so far with limited success: dynamism lacks any
specific Korean flavor.
Calm or dynamic
Within South Korea, the debate still lingers as how best to
represent the country on the international stage. South Korean
officials and their public relations advisers can often be heard
complaining that they lack the equivalent of the Japanese Fuji
mountain, the French Eiffel Tower or the American Statue of
Liberty. Whenever consulted on this matter, I suggest the well
known crossed-legged Boddhisatva, which can be admired in the
National Museum of Korea , as the South Korean logo and icon.
This Buddha, reminiscent of the Thinker by the French sculptor
Rodin, has no competitor; I think that through its unique
aesthetics and transcendental strength it could convey the spirit
of the nation. My suggestion, however, has never been taken into
consideration. Isn’t it dynamic enough? Or is it too Buddhist in a
South Korea at Sixty
T
H
E
R
E
P
U
B
L
I
C
A
T
S
I
X
T
Y
KOREA
Impossible to Possible
47
country where religions are so diverse? So far, the logo problem
for South Korea remains unsolved; probably it cannot be solved
easily while Korean identity is not that easy to describe nor to
understand, at least for non-Koreans.
It cannot be denied that in spite of the outstanding global
success of South Korean brands, many buyers of these brands
hardly know they are made in Korea.. South Korea
as a trademark, in spite of recent progress due to its leading
export companies, is still moderately acknowledged. Is this weak
brand recognition due to insufficient efforts to promote South
Korea as such? To a certai n extent, yes, South Korean
governments never packaged the Korean identity as a clear
message nor promoted it in a systematic way, as Japan did in the
60s and still does. True enough, the message escapes easy
definition. How to promote Korea when the country itself is
divided? How to promote modern South Korea alone as it is so
different from ancient Korea? How to send a unifying message
when the South Korean people are so greatly diversified by
region and religion?
The solution to these dilemmas could very well emerge
from the artistic world. South Korea now is popular abroad not
only thanks to its industrial exports; artists do play a decisive
Guy Sorman is a French
journalist, economist,
philosopher. He was appointed by
President Lee Myung-bak as
a member of the Global
Advisors and Friends of
Korea in June 2008.
Guy Sorman.
48
role. Beware of the ambiguities however. The so-called Korean
Wave is carrying American rock music to an enthusiastic Chinese
audience: the music is played by Koreans but it is hardly related
to Pansori. Korean television sitcoms may be closer to the true
Korean soul; we know how they have been useful in bringing
together the Japanese and the South Koreans in a more thorough
way than many years of diligent diplomacy. Eventually, I consider
that to really understand the South Korean identity, the South
Korean movies and contemporary art have been more revealing
than pop entertainment.
Im Kwon-taek’s “Painted Fire”, Kim Jee-woon’s “A Tale of
Two Sisters”, Park Chan-wook’s, “Old Boy”, have brought to an
international audience a unique civilization, Asian but definitely
not Chinese and definitely not Japanese. These movies have
produced in the West a culture shock comparable to the
European discovery of Japanese prints in the late 19th century. In
fine arts, similarly, the video art pioneer Paik Nam June and his
follower Jheon Soo-cheon have opened the eyes of art lovers
everywhere; thanks to these artists, South Korea has been
discovered as if it were a new continent. Korea was there but we,
Korea needs a new national
symbol. Pictured is UNESCO
World Heritage site,
Seokguram, located in
Gyeongju, Gyeongsangbuk-do
Province.
49
in the West, could hardly see it.
Can these artists, to whom I shall add the writer I Mun-
yeol, help us understand who is South Korea at sixty? It is the
Morning Calm and Dynamism simultaneously. When Jheon Soo-
cheon displays his installations in Seoul , Venice , Paris or New
York, ancient funeral statuettes in a contemporary light, he
connects the oldest tradition with cutting edge modernity: like I
Mun-yeol’s novel , “Hail to the Emperor”, he makes evident the
continuity from Shamanism to Confucianism, Buddhism,
Christianity and the postmodern nihilism of Old Boy.
Because of this outstanding continuity, we celebrate South
Korea’s sixtieth birthday today as well as its 3000-year-old
civilization. This is a reason why, when visiting the National
Museum of Korea in Seoul, I regret that it does not incorporate
the most recent creation of contemporary artists: the continuity
would be for all to see. It would make clear that South Korea
does not lack identity but does suffer from a still weak identity
promotion policy.
What use would be such a policy? It would convey some
economi c benef i ts. Strong nati onal brands sel l : worl d
consumers buy French perfumes because they are French,
Germans cars because they are German, Japanese technology
because it is Japanese. Korean products sell for many reasons
but rarely because they are Korean. Among industrial advanced
nations, South Korea, so far, has not yet built a decisive
cultural advantage.
Rising expectations
In sixty years, however, South Korea went from one of the
poorest countries on earth to one of the most successful. Its
civilization alone would not have permitted such progress if the
right strategy had not been followed, a free market economy and
a progressive shift from enlightened despotism to full-blown
democracy. For the younger generation who takes South Korea’s
50
present status for granted, it is difficult to imagine a different
evolution. But a glance at the neighboring countries which
benefit from superior basic resources show how communism
could bring nations to their knees. History has thus proven that
South Korean leaders made the right choices at an early stage
when liberal democracy did not necessarily look like a winning
choice: whatever the rational (resist North Korea? emulate
Japan? follow the United States?), South Korea had it right. This
needs to be reaffirmed as Korean society at sixty doesn’t escape
the turmoil which goes with maturity. Is South Korea in a crisis?
Of course it is; only stagnant nations mired in poverty, under
despotic regimes, ignore crisis. Because it is an actual democracy,
and a modern economy, South Korea has entered into the cycle
of rising expectation: only when life is improving do you start
wondering why it is not improving more rapidly. When free
speech is allowed, why not become vociferous? As seen from
abroad, especi al l y from Western Europe, the street
demonstrations and strikes which take place in South Korea do
no surprise us: we have lived through those kind of events before
and we still live with them. In democratic countries, elections
never fully solve social conflicts; the purpose of elections is to
quiet those conflicts so that they would not degenerate into civil
war. What we now see in South Korea is business as usual in
Western democracies. Are South Koreans disappointed with
democracy? This is common as well: democracy is always
disappointing while people expect too much of it. It is an
imperfect regime but it is non-violent and it doesn’t pretend to
dictate individual life. Maybe South Koreans are not yet
accustomed to the inherent modesty of democratic institutions.
They also are not fully reconciled no nation is with the
imperfections of the free market economy. Free market economy
brought South Koreans out of poverty; this was hardly debated
when the growth rate hovered around ten percent. When the
growth rate plummets to four percent, enthusiasm for the
51
market tends to decline. The very high growth rate could absorb
many imperfections of the system such as required long work
hours, unequal redistribution, brutal exodus from traditional
activities to mass industry. But a slower growth rate underlines
these imperfections : hard work is less well-tolerated, the gap
between rich and poor, between regular and irregular workers fall
under harsher scrutiny. A slower growth rate generates social
frustration from the less educated toward the better educated,
from the less paid toward the wealthy entrepreneurs. The search
for scapegoats (the Americans, the chaebols), and a fiery
nati onal i sm, cl ose to j i ngoi sm, take root easi l y when
expectations are not met. Shall we conclude that South Korea is
in a crisis, or in a transition? It seems to me as a transition
travails to the next stage when South Korea will become a major
global player on the world scene.
Global player
South Korea at sixty has unique resources that remain untapped:
its civilization as mentioned above is the most evident. By
promoting its cultural resources, from its museums to its cuisine,
by pursuing the globalization of its economy, South Korea could
be better recognized as a global player. A stronger economy,
more cultural value would bring a stronger diplomatic position;
South Korea does not need to remain dwarfed between China
and Japan. More global clout would make reunification easier
against those who do not want it. Not only against North Korea,
A slower growth rate generates social frustration
from the less educated toward the better educated,
from the less paid toward the wealthy entrepreneurs.
The search for scapegoats (the Americans, the
chaebols), and a fiery nationalism, close to jingoism,
take root easily when expectations are not met.
52
which is an economic midget but against China and Japan as
well; those two countries are not enthusiastic about Korea’s
reunification.
The goal of a unified Korea, which is now closer than ever,
could be the ambition of a new generation, the success of the
present administration and a tremendous booster for the Korean
economy. How will it happen? It is anybody’s guess but , based
on my knowledge of North Korea and my memories of Russia , I
bet on an implosion of North Korea under the stress of mass
poverty . The North Korean people are no longer ignorant of the
global reality . Many in South Korea fear the cost of this
reunification; but the benefits in terms of market opportunities,
and new work force, would rapidly offset the costs. Moreover it
would bring peace in North East Asia, which remains unstable
and very much depending on the good will of the U.S. military. A
stronger and larger Korea could balance its influence between
Japan and China with the ultimate goal of a North East Asian
economic zone, following the lines of the European Union. Such a
grand design could become the new national ambition of the
South Koreans and overcome short-term domestic conflicts or
short-sighted nationalism.
This grand design should not exclude some significant
changes within South Korean society. Among those, education
Paik Nam-june’s video artwork
on display at the
Gwangmyeong Cycle Race
Dome Stadium in
Gwangmyeong, Gyeonggi-do
Province.
53
comes first. South Korean schools, colleges and universities are
still very much in the grip of a traditional system which goes
back to the Confucianist rote. This authoritarian pedagogy was
perhaps wel l -geared to the fi rst stage of South Korean
industrialization when it required an obedient workforce. But in
a transition toward a more high-tech and service-oriented
economy, South Korea needs a more initiative-based workforce
and more entrepreneurship-minded individuals; this requires a
fundamental shift in the education style, toward a more
individualistic and less Confucianist type of students-teachers
relationship.
A more open education would be able to retain in South
Korea many of its best students who now emigrate to the United
States; it would also attract students and scholars from other
parts of the world, not only from the Asia Pacific region. A whiff
of cosmopolitism would enhance the creativity of the Korean
education and its Rand’s performance. More and better educated,
Koreans would produce less “irregular” workers, while most of
the these “irregular” workers presently suffer from a lack of
proper education. Better educated Koreans will be more ready to
understand the harsh process of destructive creation, which is
the core of rapid economic development: adaptation through
education should be the Korean answer to the challenges of
globalization.
This adaptation will not be a smooth nor an instantaneous
process; no country so far has been able to strike an easy balance
between the flexibility requirements of the global market and the
collective desire for stability. Some turmoil will happen that
cannot be avoided, but more open political debates, better public
explanations, better education and constant negotiations should
lead to more consensual solutions. To achieve such a delicate
balance between competition and social stability, South Korea
should not necessarily follow other models, be it Japan, the
United States or Europe. There is room for creativity in a still
54
young State: South Korean economists, state officials, union
leaders, and entrepreneurs could experiment with new solutions
such as a competitive welfare system, permanent training,
negative income tax for the poorest, and social flexisecurity
(flexibility for the employers, security for the employees)
mechanisms as now practiced in Scandinavia.
Beyond these still to be created public institutions,
governments, at the national and local levels, should focus on the
quality of life in Korea. The Korean people have worked, and still
work, hard; they deserve reliable health care, special attention to
the old and retired, safety and a more beautiful environment.
The beautification of Seoul under the leadership of former mayor
and now President Lee Myung-bak and his successor Oh Se-hoon
has demonstrated that government officials can make a
difference in the daily life of the Korean people. This is a model
to be followed.
Korea in sixty years
I have no doubt about Korea’s economic or diplomatic status in
sixty years from now. But I wonder what Korean will mean then?
All nations today are torn apart between their ancestors’ roots
and fusion into a global melting pot. Most probably, the recent
nationalistic outbursts among young Koreans express a disarray
towards these contradictory trends. The tension between local
and global will only increase as more Koreans will live abroad or
be exposed to diverse cultural experiences. Moreover, more
foreigners will come and live in Korea; Korea cannot escape
Koreans who always defined themselves through
their bloodline and family history, will then be
compelled to change their self definition:
a Korean in the future could well be Korean by its
culture without being Korean by its genetic origin.
55
immigration and its developing economy will need immigrant
workers, at the top as well as at the bottom of the economic
scale. Will this confrontation between Koreans and foreigners,
abroad and at home, be smooth and easy? Will xenophobia
prevail, or intermarriages? Probably, both will happen, like in the
rest of the world.
Koreans who always defined themselves through their
bloodline and family history, will then be compelled to change
their self definition: a Korean in the future could well be Korean
by its culture without being Korean by its genetic origin.
Moreover, a Korean could be Korean and something else
simultaneously. This is not to be feared: we are all shifting from a
world dominated by the cult of our ancestors, to a world based
on shared identity. Many Koreans will remain Korean and
become global citizens as well; and many global citizens could
become Korean by choice.
56
S
ixty years may seem like a short period of time compared to
the vast history of the world. But for the Republic of Korea
and for its citizens, it has been full of meaningful events.
In the late 1940s and the early 1950s, the Republic of
Korea was the center of the Cold War dispute between two great
nations resulting in great bloodshed between its own citizens.
The final result was the division of a once unified nation into two
separate nations; one to a nation called the Republic of Korea,
and one to a nation called the Democratic People’s Republic of
Korea. It was not easy to settl e thi s pol i ti cal cl ash, and
consequently, it took considerable time for these two nations to
move on to the next round.
Despite these hardships, despite the remaining influence of
the Japanese dictatorial occupation; and even despite the
disastrous ruins remaining from bloody war, the Republic of
Korea found strength in itself and took a relatively short period
of time to escape from the third world label to what can now be
called a contemporary economy and a developed social-political
system. Heading towards this new label brought results that
were admirable even to itself. These admirable results include the
country’s rise to an important position in the world economy and
the rise to higher level of influence in international relations
between other countries.
The reconstruction of the Soviet Union and the end of the
Cold War created an atmosphere that made a pathway to a deep
relationship with our nation. I remember June 1990, when in a
hotel called Vermont in San Francisco near the end of my visit to
Republic of Korea:
An Important Partner to
Russia in Southeast Asia
KOREA
Impossible to Possible
T
H
E
R
E
P
U
B
L
I
C
A
T
S
I
X
T
Y
57
the U.S., we met with the president of the Republic of Korea, Roh
Tae-woo. He had come from South Korea with the sole purpose
of meeting us. We discussed all of the problems associated with
the Korean Peninsula, and came to an agreed conclusion to
engage in a diplomatic relationship, which was carried out
effectively in a speedy manner.
Soon after, I had the privilege of meeting with President
Roh Tae-woo two more times; once in December in Moscow,
when the South Korean president officially visited our country,
and once in April 1991 in the exotic Island of Jeju in the
southeastern part of Korea. During our stay, the president invited
me to visit the Korean Peninsula once again on my return flight
from Japan.
While looking over East Asia’s situation at the time, and
the position Korea had inside of this East Asian pool of countries,
we decided that the agreement we had made was beneficial for
both countries. During this visit, I had a chance to marvel at
President Roh Tae-woo’s immense political capabilities to steer
the Republic of Korea in such a crucial time of its history.
The exchange we had with the Republic of South Korea
duri ng thi s ti me had a deep effect on al l the countri es
surrounding the Korean Peninsula. After this followed the
establishment of Korea’s relations with China, the acceptance of
both Koreas to the UN, and other important roads such as the
possibility for South Korea to push forward in a peaceful
democratic union with North Korea and an enabling of a direct
dialogue between the two governments were opened.
Mikhail Sergeyevich
Gorbachev U.S.
President Ronald Reagan,
contributed to the end of the
Cold War. The summit
meeting between Gorbachev
and Roh Tae-woo, the-then
president of the Republic of
Korea, in 1990 in San
Francisco paved the way for
the establishment of
diplomatic relations between
the two countries. He was
awarded the Nobel Peace
Prize in 1990. Gorbachev is
currently the leader of the
Union of Social-Democrats.
Mikhail
Sergeyevich
Gorbachev
Despite these hardships, despite the remaining influence of the
Japanese dictatorial occupation; and even despite of the disastrous
ruins remaining from bloody war, the Republic of Korea found
strength in itself and took a relatively short period of time to escape
from the third world label to what can now be called as a
contemporary economy and a developed social-political system.
58
The road ahead was not a simple one; many serious rows
of obstacles were required to be overcome, the biggest of which
was the nuclear missile ambition of North Korea. This ambition
drew the interest of many powerful nations into East Asia. The
final proposed solution was the six-party talks (the two Korean
governments, China, U.S., Russia, and Japan) which allowed for a
neat compromise that took consideration of all sides. Russia, in
my opinion, was different somewhat from the rest of the
powerful nations in that its interest solely lay in the formation of
a united, democratic, and peaceful Korea that would play its own
rightful role in international relations.
It is inevitable to talk about Russia and Korea in terms of
culture and economy. Even before the diplomatic establishment,
we had a positive outlook in these areas. For example, the Soviet
Union, ignoring the counteractive position that North Korea had
to the Olympic Games held in Seoul, took a broad stance by
taking part in the event. To add to this, the representatives from
our trade union were already successfully carrying out their
business affairs in Seoul. From the South Korean side, a great
active interest in economic relations with our country was
working with Hyundai and its CEO Chung Ju-young. I met with
him in Moscow, where he came several times with a helper by
Summit meeting between
President Roh Tae-woo and
Mikhail Gorbachev, former
General Secretary of the
Communist Party of the Soviet
Union.
59
the name of Lee Myung-bak, who at that time was still a young
man. He would later become the future president of South
Korea. His excellent abilities in matters of grand business affairs,
his accumulated experiences in politics in the National Assembly,
and the awareness of his responsibilities as a mayor of Seoul
brought him the trust and respect from all levels of the Korean
Republic. The results from last year’s presidential election reflect
this truth.
A
fter the establishment of diplomatic relations, trade
between our countries grew exponentially. Brand names
such as Samsung, LG, Hyundai, and Daewoo found prominence
in our markets and became known to all Russians. This lively
trade between our countries synthesized a strong tie in the
cultural sphere and also influenced our scientific/technological
spheres. For example, enormous three-sided projects were
carried out in the areas of transportation, electricity, and market
infrastructures. The foundations that made these projects
possible were the awareness of the scientific/technological
potential and the natural resources of Russia combined with the
dynami c and vast busi ness experi ences of the Korean
entrepreneurs. Although the economic crisis of Russia in the
1990s interrupted its actualization, today, the economical
foundation and cooperation of both countries is far in its process
toward materialization. It is a very crucial time where not a
moment can be wasted.
In relation to myself, after the fall of the USSR and the
Soviet Union, my relationship with South Korea did not
deteriorate. In short, I have been invited several times to Korea
by my friends, have met with its leaders and with the members
of the parliament, and have consulted with the representatives of
gigantic corporations with a wide amount of communication.
I had a very close relationship with the previous president
of South Korea, the man that was awarded the Nobel Peace Prize
60
Kim Dae-jung. With him in June of the year 2006, we
attended a forum in the city of Gwangju. The forum was held for
former Nobel Peace Prize winners both in honor of the 30th
anniversary of the May 15th Democratic Uprising and for a
peaceful Korean Peninsula. The introductory speech for the
attendees of the forum was held by the UN Secretary General of
that time, Kofi Annan, while the opening ceremony was
officiated by the President of South Korea Roh Moo-hyun.
The Korean problem takes an important place both in the
activity and future value of socio-economic funds and in
politological research. In the last years, with the support of
After the establishment of diplomatic relations, trade
between our countries grew exponentially. Brand
names such as Samsung, LG, Hyundai, and Daewoo
found prominence in our markets and became known
to all Russians.
Construction is under way for
a planned East Siberia-Pacific
Ocean oil pipeline (4,700 km).
61
Korean funds and the participation of leaders in the Russian-
Korean field, two projects were completed: “The Relationship
between Russian and Korea” (2003) and “The Question of Korea
in the Inter-racial Atmosphere of East Asia” (2005). In these
projects we were firmly able to visualize through solidly
documented back-up files, the historical root cause of the current
problem and the future solution of the Korean Peninsula and of
East Asia.
All of the experiences that I had with the enhancement of
our relations with South Korea equal with that of our technical
analysis, and without a doubt, South Korea takes an important
place as our valuable partner in East Asia.
I hope that Korea will have big successes in all areas,
especially in socio-economic development. I also hope that Korea
will solve its national problems and come to a unified and
peaceful conclusion that will bring the divided peninsula to an
agreed union.
62
W
hereas ancient Korea was established several thousand
years ago, the Republic of Korea was established just 60
years ago. The Peninsula was split after the World War II. The
Republ i c of Korea was establ i shed i n the south and the
Democratic People’s Republic of Korea was set up in the north.
The South Korea became a newly born country thereafter.
Whenever South Korea is mentioned, people show their
respect to this country. South Korea worked a miracle in its
development process and changed into a modern and developed
country, from a poor and laggard one. The South Korean
experience of modernization attracted the eyes and praise of the
whole world.
Under the new situation, South Korea has set up a new
development goal and is trying to achieve an upgrade. Can South
Korea achieve its new goal? Koreans are a people of great
enterprise, with an innovative spirit and lofty goals. Although the
Koreans’ new journey is full of challenges, we still have reasons
to bel i eve that South Korea wi l l make more i mpressi ve
achievements in its new development.
A brilliant achievement in four strides
The realization of economic modernization is an important goal
for the construction of South Korea. South Korea's modernization
process, which lasted from early 1960s to the late 1990s, took
four great strides.
The first stride was to achieve wealth and get rid of
poverty. The government played a significant role in this process.
KOREA
Impossible to Possible
A Miraculous Six Decades
T
H
E
R
E
P
U
B
L
I
C
A
T
S
I
X
T
Y
63
President Park Chung Hee built up a government leadership
system similar to a military headquarters. This government
directly designed, organized and operated the economic
development; organized and mobilized the necessary resources in
the economic development and promoted the implementation
of the economic plans and projects.
South Korea established the strategies of industrialization
development and export orientation, and carried out its
economic development from the low end, i.e. to develop a labor-
intensive export processing industry by using cheap labor
resources. South Korea not only created employment, but also
increased foreign exchange earnings, and realized the initial
capital accumulation in its modern industry development.
After several years of development, South Korea's labor-
intensive products, such as wigs, luggage, clothing, plywood and
so on, entered the international market and became brand goods
which are popular world-wide today. By 1970, South Korea's
national income per capita grew from 60 U.S. dollars to 250 U.S.
dollars. The per capita income quadrupled.
The second stride was to develop modern large-scale
industries, develop the export vigorously and achieve a good
standard of living. On the basis of the first stride of successful
development, South Korea further set new development goals,
i.e. developing the capital intensive industry, laying solid
foundations for industrial modernization, enhancing the
international competitiveness of products, quadrupling the per
capita income again, and realizing that good standard of living.
Zhang Yunling, born on May
8, 1945, is the Director of
Academy Division of
International Studies,
Chinese Academy of Social
Sciences (CASS) and
Professor of International
Economics. He was the
Director of the Institute of
Asia Pacific Studies, CASS
and a member of Foreign
Relations Committee,
National Committee of
Chinese People’s Political
Consultative Conference.
His major books include:
International Environment
for China in the Coming 10-
15 years (2003), East Asian
Cooperation: Searching for
an Integrated Approach
(2004). East Asian
Regionalism and China
(2006).
Zhang Yunling.
64
During this period, the government continued to play a
leading role in economic development and gave strong support
to the development of big industries. After 10 years’ effort,
South Korea made prominent progress in the development of
heavy chemical, steel, shipbuilding and other heavy industries.
The automobile industry was also built up.
During this period, South Korea achieved a fast growth in
its foreign trade and became very competitive in the areas of
steel, shipbuilding, chemical or even automobile industries. In 10
years, South Korea's gross domestic production increased by
nearly 7.5 times and per capita national income grew by 6.7
times. Thus South Korea entered the ranks of middle-income
countries and achieved a decent standard of living.
The third stride was to achieve steady economic growth,
reduce direct government intervention, carry out reform of the
economi c system, and devel op marketabi l i ty and i nter-
nationalization. After economic development achieved a certain
foundation, how to make further enhancements was a new
situation that South Korean encountered. In this case, further
insistence on excessive government intervention in the economy
would become an obstacle to future economic development.
Therefore, since the 1990s, the government has carried out
The Hyundai shipyard, the
biggest in the world, produces
40 to 60 ships a year.
65
marketability, privatization and internationalization reform. The
enterprises began to carry out structural adjustment and
substantially to increase foreign investment. Although such an
adjustment was painful, South Korea was successful.
The fourth stride was to promote innovation, strengthen
internationalization strategies and step into the ranks of
developed countries. The South Korean economy entered a new
period of development on the basis of marketability, privatization
and internationalization adjustment from the 1990s.
South Korean Enterpri ses i ncreased the i nnovati on
dynamics in electronics and telecommunications, while large
scale development of foreign investment, industrial restructuring
and transfer was carri ed out to open up new space for
development..
South Korea's economic modernization is a success and its
rapid economic growth has been described as "the Han River
miracle". As a rising leader in the emerging economies, South
Korea helped formed Asia's "four little dragons" together with
Singapore, China's Hong Kong and Taiwan. Today, the Korean
people are ambitious and want to be ranked among the
developed economies in the world.
The experiences and lessons
South Korea, once a backward country which obtained such a
great success in a short time, has had a lot of experiences and
has learned some important lessons during the development
process.
The major experience is its scientific planning and its
determination to stick to economic modernization. Outsiders
66
thought that South Korea’s political situation was too unstable
for its economy to take off. The coup, the murdering of leaders,
large-scale mass demonstrations and so on took place during this
period.
However, one thing is very clear. Despite the changing of
regimes, each Korean government regarded the realization of
modernization and national rejuvenation as its goal. The
government carried out its five-year plan from the 1960s up to
the mid-1990s, when the industrialization was completed.
The early 60s to the late 70s was a period of industrial-
ization and the establishment of a modern industrial foundation.
Park Chung Hee was in power during this period and political
stability was easily maintained.
A coup took place in the early 1980s. The political situation
was basically stable for more than 10 years thereafter. So South
Korea could develop large-scale industries that were more
competi ti ve. Duri ng thi s peri od, South Korea pursued a
government-led economic model and the government played an
important role in the entire process. The government's scientific
planning and a strong organization were a vital guarantee for the
establishment of a modern industrial system within a very short
period of time.
Of course, there were contradictions between South
Korea's authoritarian political system and the modernization of
the development process. The government-led management
would also result in serious intervention, causing system
corruptions that were the main causes of Korean political turmoil
and mass movements.
For example, Park Chung Hee employed “constitutional
reform and restoration” to stop the activities of political parties
and suppressed mass movements to safeguard his centralized
power system when he was in power. The said measures resulted
in a confrontation between the government and society,
produced contradictions among political interest groups and
67
brought about the tragedy of political change.
Moreover, some large industrial groups which grew up with
the support of the government colluded with senior government
officials and banks in making credit fraud, transferring funds and
carrying out illegal activities. In the fast-growing period, Koreans
usually valued the speed and underestimated the quality. Many
roads and bridges suffered quality problems. Many big potatoes
in Daewoo, Hyundai, Samsung and GoldStar groups had been
sentenced to jail for transferring funds illegally.
It now appears that there would be less social turmoil if
South Korea' s pol i ti cal reform and economi c structural
adjustment would have been carried out earlier, and if some
proper reform adj ustment were empl oyed rather than
suppressing measures to solve the problems in its high-speed
economic growth. Of course, South Korea enjoyed a peaceful
transition from an authoritarian system to a democratic system
and did not experience serious social turmoil. However, the long
delayed and unsolved political and social division and their
tremendous cost were also considerable.
The second experience of South Korea's development is to
develop a major strategy and to form large industrial groups.
There are two pillars of modern industry. The first is the large
enterprise groups and the second is the small and medium
enterprises. Large enterprise groups are the backbones of
developing large-scale industries and major products. But the
development of large enterprise groups is not an easy thing. It
In the fast-growing period, Koreans usually valued the
speed and underestimated the quality. Many roads
and bridges suffered quality problems. Many big
potatoes in Daewoo, Hyundai, Samsung and GoldStar
groups had been sentenced to jail for transferring
funds illegally.
68
needs capital, technology and time.
Without direct and strong government support, the large
enterprise groups are very difficult to develop in developing
countries like South Korea which began from a very low starting
point. There would be no South Korean rapid take-off of steel,
shipbuilding, automobile, electric appliance and electronic
industry if there were no large enterprises like “aircraft carriers".
These large "aircraft carriers" became the backbone industries in
upgrading the level of South Korean industries and made South
Korea stand in the front row in the world in the areas of steel
production, shipbuilding, telecommunications and electronic
products.
However, the large enterprises strategy has a lot of
problems. First of all, they excessively rely on policy in the
development of enterprises, for they can get full policy support
and enough credit funds. The large enterprises use government's
policy support and the trust to carry on expanding, and thus
cause a credit crisis. For example, during the Asian financial crisis
of 1997, a chain of huge bad debts drew South Korea into a
serious crisis and South Korea's economy was severely damaged.
As large enterprise groups resided in the monopolistic position,
the policy favored large enterprise groups, small and medium
enterprises’ development was slow, and the operation of market
mechanism was hampered. South Korea’s marketability and
Korea’s first hypersonic speed
airplane released at Korea
Aerospace Industries in
Sacheon, Gyeongsangnam-do
Province.
69
internationalization strategy, which started in the 1990s, made
painstaking efforts to resolve this problem, but the price was also
huge. Modern large enterprise groups have strong control ability.
If there is no perfect supervision system, it will lead to their
monopoly in the market and corruption in their systems. Now,
the South Korean government has made new efforts regarding
these problems and has achieved progress.
The thi rd experi ence of South Korea' s economi c
development is vigorously promoting technological innovation.
Business vitality and competitiveness come from constant
innovation. South Korea is successful in promoting economic
innovation. The most important in enterprise innovation is the
people. A backward country usually has less talent. In order to
produce and introduce innovative talent, South Korea has taken a
strategy of attracting overseas personnel.
From the beginning of the 1960s, the government has
adopted preferential policies to the introduction of modern
technology professionals, and management personnel. Due to a
series of comprehensive measures, a large number of South
Koreans studying abroad returned home. They were given
important positions and assigned to important posts in the
government and companies. These people brought South Korea
advanced technical knowledge and new management concepts
and methods, which played a key role in the promotion of South
Korean scientific technology and management.
At the same ti me, the South Korean government
formulated preferential policies to raise large amounts of money,
and actively supported the government and university research
institutions, and the group of companies engaged in researching
and developing. The government encouraged companies to
promote new technology innovation through the development of
scientific and technological innovation and take the innovation
as the core method to enhance the international competitiveness
of Korean products. Through unremitting efforts, South Korea
70
has become a powerful scientific and technological country from
a country which mainly depended on production of low-end
products.
South Korea sei zed the opportuni ti es of the worl d
el ectroni cs i ndustry and became a maj or provi der of
semiconductors, storages, flat-panel TVs and network mobile
phones. South Korea produced competitive cars, high-speed
trains and so on by importing technology and by becoming
independent. Up to the late 1990s, South Korea's research and
development accounted for 3 percent of its gross domestic
product, reaching the level of developed countries.
Of course, the scientific and technological innovation
system led by the government and large groups has some
shortcomings, i.e. large investment, low efficiency, quick success,
false research results, big group monopoly and a lack of
innovation. South Korea's experience indicated that although the
government played the vital role in the support of research
innovation organization, the government's support must be able
to encourage open competition and build a vigorous innovation
system.
Large groups are the core forces in innovation, especially
for high-tech, which needs huge investment and research forces.
However, innovation is stifled if it is monopolized by large
groups. SMEs are the most dynamic components in technological
innovation and reform. The innovation of small and medium
enterprises will be suppressed and the economy will lack in
flexibility if there is no competition or open markets.
China and South Korea relations
For complex reasons, China and South Korea hadn’t established
diplomatic relations until 1992. However, during the short period
of 16 years, the trade and economic relationship between two
countries has greatly developed. At present, China is the largest
trade partner of South Korea, and also the largest investment
71
market. At present, trade between China and South Korea has
passed 150 billion U.S. dollars and expected to reach 200 billion
U.S. dollars. Actually, this will be attained by 2010.
As a neighbor, the development of China’s market has a
special meaning to Korea. In early 1994, many companies
noticed the importance of the market of China and began to
invest in large quantities. After the economic crisis in 1997, the
adjustment of the industrial structure became an important
strategy for getting over the crisis and rejuvenated its economy.
The economic crisis didn’t spread to China directly and the
economy was still growing. And it definitely became the
dreamland for the South Korean companies to transform
production and expand industry. Therefore, the investment of
South Korea in China expanded dramatically. After China’s entry
i nto the WTO, South Korea’ s i nvestment i n Chi na kept
expanding due to the prospects of China’s economy. Some big
companies, like Hyundai, expanded its capability of producing in
China.
The Chinese and South Korean economies complement
each other. The fast growing trade investment played an active
role in the economic development of the two countries.
Especially, the economic ties on the basis of investment-trade
share the cl ose i nternal connecti on for the economi c
devel opment of the two countri es. Noti ceabl y, Chi na’ s
investment in South Korea has also been increasing in recent
years. Although the absolute amount of the investment is small,
it has increased rapidly. China ranks No.3 in foreign direct
At present, China is the largest trade partner of
South Korea, and also the largest investment market.
At present, trade between China and South Korea
had passed 150 billion U.S. dollars
and expected to reach 200 billion U.S. dollars.
72
investment in South Korea. It is estimated that the China’s
investment will grow more rapidly with the strategy of “go-out
policy” of China.
China has a large amount of deficit in the trade with
South Korea. Now, China is the largest country of foreign trade
surplus origin, and South Korea is China's second largest source
of trade deficit after Taiwan. This situation is mainly caused by
the unbalanced structure of the investment and trade. Statistics
show that the South Korea’s investments in China have mutual
promoti on ti es. South Korea’ s i nvestments drove the
development of exports, including chemistry, plastics, chemical
fiber, electrons, electric devices, cars and machines. Of course,
South Korea’s investments in China dramatically promoted
China’s exports. Especially in the labor intensive industrial
investment, the rate of export is very high and it will be of great
advantage to China to make its exports more competitive.
At present time, the South Korean companies investing in
China are facing a new challenge. Due to the increasing cost of
labor in China, as well as the local companies’ higher competition
and the change of the export environment of market, they face
the pressure of technological innovation. But this is inevitable,
Korea-China summit meeting.
73
and it is good for the South Korean companies to restructure.
There is enormous room for economic development and
cooperation between China and South Korea. China’s great
potentiality in development and active creativity in the
technol ogy are the advantage for the two countri es to
strengthen economic and trade ties. Of course, in order to lay
the foundation for long-term development, the two countries
need to strengthen the system of cooperation. For example, the
governments and companies should further strengthen the
cooperation mechanisms between the two countries and speed
up preparations for a bilateral free-trade zone process in
particular.
Reviewing the past 60 years, the Korean people deserve to
be proud of their achievements; and to look forward to the
future. The Korean people are ambitious to achieve new
development blueprints. To quote former President Kim Young-
sam, who opened South Korea democratization process, to finish
this article: “In the hope of a beautiful dream and an ideal future,
we will create a new Korea.”
74
Korea as a Model of Economic Development
Korea, with its distinguished pattern of economic development,
has proved itself a good model for many developing countries.
Apart from Japan, Korea is indeed a unique example of a non-
Western country becoming a member of the OECD as a major
trading nation. What, then, are the principal factors contributing
to this success in Korean economics?
The most predominant factor was the effectiveness of the
“triangle” formed by the government, industries and financial
i nsti tuti ons. The Chaebol s, the banki ng sector, and the
government formed a solid triangle of economic development.
This triangle would not have led to shining results however, had
it not been for certain favourable external factors.
The rapid economic development of Japan as well as
Japanese economic and technical cooperation contributed
si gni fi cantl y to the earl y stages of Korean economi c
development. Then came the waves of globalization. The export-
led pattern of growth of the Korean economy rode successfully
on the waves of globalization and Korean development was, in
turn, an aspect of the globalization (in the sense of growing
interdependence)of the world economy.
The Korean economy based on this triangle, however,
became the victim of its own success. This was witnessed very
clearly during the so-called Asian economic crisis of the late
1990’s. The solid triangle had led to the excessive dependence on
the short-term capital from abroad and had left intact the
structural rigidity of the economy.
KOREA
Impossible to Possible
Korea: Past, Present
and Future
T
H
E
R
E
P
U
B
L
I
C
A
T
S
I
X
T
Y
75
Here again, however, Korea demonstrated itself to be a
good example of a developing country overcoming external
financial difficulties combined with internal rigidities. The
courageous openi ng of the Korean fi nanci al as wel l as
commodity markets to foreign investors and traders, coupled
with the restructuring of Chaebols and of the labour market,
contributed a great deal to Korea’s efforts to overcome the crisis.
More than the introduction of various new economic
measures, however, what should be emulated by developing
countries is the political skill of appealing to national solidarity
and the determination to restore international credibility by
faithfully observing the IMF’s “conditionalities”.
Looki ng back at the hi story of Korean economi c
development over the last thirty years or so, one might today
wonder whether Korea can become another model of economic
progress in the coming decade and, in that connection, what
major tasks remain ahead.
If Korea can become, for the third time, a good model of
development for other similarly placed economies of the world,
it appears that Korea should, at least, be able to deal successfully
with the following problems or tasks.
The first is the growing income gap between the rich and
the poor, not only inside the Korean society itself, but all around
the world. To what extent the Korean government will be able to
provide an effective safety-net to the underprivileged is a serious
probl em to be tackl ed, parti cul arl y i n vi ew of the rapi d
demographic changes of the Korean society.
Kazuo Ogoura is president of
the Japan Foundation, and a
former Ambassador to
Vietnam, Korea, and France.
Graduated from the
University of Tokyo’s Faculty
of Law and the University of
Cambridge’s Faculty of
Economics, he joined the
Ministry of Foreign Affairs,
where he served in various
positions, including Director-
General of Cultural Affairs
Department (1989-92),
Director-General of
Economic Affairs Bureau
(1992-94), Deputy Vice-
Minister for Foreign Affairs
and Japanese G7/G8 Sherpa
(1995-97).
He is also an Invited
Professor of International
Politics in the Economics and
Business Department of
Aoyama Gakuin University
(2003-).
Kazuo Ogoura
The Chaebols, the banking sector, and the government formed
a solid triangle of economic development.
This triangle would not have led to shining results however,
had it not been for certain favourable external factors.
76
Second is the question of agriculture. It is likely that the
farm subsidies and the international competitiveness of Korean
agriculture could become serious obstacles for Korea in its efforts
to promote free trade agreements with its trading partners. In
other words, Korea, instead of asking for various types of
exceptions for its agriculture, can make use of the opportunities
of free trade negotiations as an instrument to carry out the
structural reform of its own agriculture.
The third task will be the dismantling of its developing
country status. Korea has, so far, in various trade and other
areas-such as the imports of rice or green house emission
control-advanced the argument that Korea still remains a
developing country. In view of Korea’s latest economic progress,
this argument has increasingly been viewed in the international
community as more or less outdated.
One might argue in this connection, that Korea wanted to
retain its developing country status in preparation for the
reintegration of the much poorer North Korea. Though politically
understandable, this argument is likely to be viewed in the
international community as an excuse to avoid shouldering more
international responsibilities and may weaken international
financial support for reintegration.
All in all, what lies now before Korea as the great task for
the future is the de-Koreanization of its own economy, in the
sense of further integrating its economy with that of the rest of
the world, thereby contributing significantly to the sustainable
growth of the world economy.
Korean Political Development
After the presidency of Syngman Rhee Korea experienced for a
long period of time, military, authoritarian governments. How
should we assess such regimes in the light of the contemporary
political situation in Korea?
The military shouldered political responsibility due to the
77
need for a government-initiated development strategy and to
the security requirement in face of the threat from the North.
Here again, however, the Korean political process was linked to
i nternati onal ci rcumstances, parti cul arl y the East-West
confrontation. The prolongation of the military regimes was,
therefore, linked both to domestic and international factors.
Strategic consideration, both economic and politico-military,
weighed heavily on the political process in Korea.
One should not, however, lose sight of the activities of the
democratic forces which were not negligible even under the
military governments. Student movements, labour union
activities and the political opposition of Kim Dae-jung and other
political personalities, however troublesome they may have been
to the successive military governments, paved the way for
transition from military to civil governments. In other words, the
democratic forces that survived the Park government, checked
the pattern of the Chun Doo Hwan presidency which ended after
one term, and it paved the way for the presidency of Roh Tae-
woo, who came from the military but became president by being
elected through proper process. In other words, both the Chun
and Roh regi mes coul d be consi dered as transi ti onal
governments which paved the way for a more democratic
political process.
The Kim Young-sam government can be remembered as
one that played a decisive role in cracking the fusion of politics
and economics. During this period, the roles of political parties
were consolidated and, in the true sense of the word, democratic
forces were integrated into the institutionalized political process.
The military shouldered political responsibility due to
the need for a government-initiated development
strategy and to the security requirement in face of
the threat from the North.
78
This process was completed when Kim Dae-jung, long
considered the symbol of opposition, was elected president. His
presidency was also significant, as people from the Jeollanam-do
region, traditionally viewed as “outsiders” in the political process,
took over the centre stage of Korean politics.
Kim Dae-jung’s presidency, however, did not destroy the
traditional respect for authority, whether it may be political or
academic. Active for a long time as an outsider politician, Kim
and his group of politicians tried to project the image of
responsible politicians as soon as they took over the helm of the
presidency. In this process they relied upon, rather than
destroyed, the traditional aura of authority attached to the
position of presidency, ministership, or professorship.
Thi s aura of tradi ti onal authori ty attached to the
presidency, and other “titles” or positions was politically targeted
during the Roh Moo-hyun presidency. In fact, Roh’s presidency
was a quiet revolution, in the sense of destroying the traditional
authority attached to the various political positions. The thread
of populism that ran deep and wide during the period of Roh’s
presidency cannot entirely be attributed to the Internet
psychology of the people. The trend of such populism should be
understood in the wider historical context of Korean politics,
namely, the degree of the maturity of the democratic process.
This implies that the immediate national task in Korean
politics can be said to lie in the growth of healthy, sound
opposition parties which can present practical alternatives
instead of having recourse to regionalism or populism.
Korean Diplomacy
The most important diplomatic issue for Korea after the “Korean
War”, has been the international aspect of the North Korean
problem: namely, how to secure international support for Korean
security and, at the same time, obtain the blessings of the major
powers for easing tension with the North.
79
These two objectives have to be pursued with careful
balance, particularly after the dissolution of the Soviet Union.
The creation of the six-party conference is an important device
to “internationalize” the North Korean problem, thereby securing
the delicate balance between containment of the North and
rapprochement with it. Despite occasional frictions with the U.S.,
the Republic of Korea has, in general, deployed skillful diplomacy
through whi ch the Korean government has obtai ned
international support both for its “soft” policy towards the North
and “pressure diplomacy” against it.
There are some signs, however, that may disturb the
delicate balance of soft and hard policies towards the North. This
is related to growing nationalism (in the ethnic sense)in Korea.
The revi val of a strong ethni c i denti ty wi th the North
(particularly among young people)presents the risk of giving rise
to frustration over American policies towards the Far East as well
as its troop presence. There is also the danger that such
nati onal i sm be canal i zed or di verted, consci ousl y or
inadvertently, toward an anti-Japanese movement.
The U. S. and Japan shoul d vi ew the ri se of Korean
nationalism with cool but sympathetic eyes, because Korea,
which faces the gigantic task of reunification, has a strong need
of ethnic nationalism. The U.S. and Japan should stay “cool” at
the time of occasional eruptions of such Korean nationalism. At
the same time, the Korean government should refrain from
canalizing or diverting the anti-government sentiment of the
people towards outside targets such as the U.S. or Japan.
The promotion of the free trade agreement or new
economic accords with these two countries may help mitigate
such risks of political diversion. In relation to the free trade
agreements, there is the issue of building an East Asian
Association or Community. One has to note, above everything
else, that an East Asian Community is already in the making in
the “functi onal ” sense of the word. The degree of the
80
interdependence of trade among East Asian countries (Korea,
Japan, China, Taiwan, and the ASEAN nations)has already
exceeded the degree of i nterdependence among NAFTA
countries and has, more or less, reached the level of the
European Union at the beginning of the1970’s.
In addition to trade relations, East Asian countries (Korea,
Japan and China)have expanded tourism among themselves and
have also rapidly increased student exchanges. The life-styles of
the young people in Korea, Japan, Taiwan, and the coastal areas
of China have witnessed a certain “cultural” affinity, as evidenced
by the popularity of Korean TV dramas and Japanese fashions.
Such trends towards an East Asian Community should be
welcomed and encouraged by Korea for several reasons. Firstly,
moves towards building an East Asian Community will help hold
i n check the ri se of Chi na-central i sm and the parochi al
nationalism of East Asian nations.
Secondly, it can help strengthen the sense of international
responsibility for China to act as a responsible major power in
the world.
Finally, efforts to build an East Asian Community will help
form a vision of a stable, peaceful East Asian politico-military
Automobile exports.
81
geography after the Korean reintegration.
There are, however, a few tasks that Korea must deal with
in the process of forming an East Asian Community. First of all,
Korea must soften the “colonial” mentality of fanning anti-
Japanese sentiment, for the sake of consolidating national unity
or identity. As Korean society becomes more and more mature
both politically and economically, freedom of expression, even
on the issues concerning Japan, is expected to be secured socially
and politically, not to mention legally.
In this connection it should be pointed out that “protest
diplomacy” (to sever the channel of communication itself as a
means of manifesting protest) should not be utilized except in an
emergency, as lack of communication increases the risk of
misunderstanding and gives rise to the sense of detachment in
the minds of potential friends.
82
I
t is a great honor to be invited to contribute a short paper to
this commemorative volume marking a milestone in Korean
history. But how should we judge a span of six decades? South
Korea is one year older than my country of birth, West Germany,
and three years younger than I am. Not long ago reaching sixty
yeas of age was for an individual the mark of having reached a
ripe old age. Adapting a quip from American song writer and
satirist Tom Lehrer it is true that “at my age Mozart had been
dead for 28 years.” Today for an individual sixty lies in that
undefined zone of middle and old age.
Not for Korea. Korea is Asia’s Poland. Lodged between two
ancient civilizational states, and forever fiercely protective of its
autonomy and endowed with a clear sense of self, Korea marks
its national history in long centuries not short decades.
Koreans have suffered more than most other people during
the second half of the 20th century. The suffering during the
Korean war made headlines all over the world. After the war
ended in a stalemate peace, Koreans suffered through the trauma
of national partition, as did Vietnam and Germany which are
now reunited. South Korea’s economic miracle was not made by
efficient markets operating in peace. The South Korean story
over the last six decades reminds us instead of the advantages of
adversity.
Vulnerability was the central condition which set South
Korea onto the course of making one of the most remarkable
economic runs in the history of capitalism. Looking at the
photographs of the South Korean countryside and of Seoul at the
KOREA
Impossible to Possible
Advantages of Adversity:
South Korea at Sixty
S
T
I
L
L
G
R
O
W
I
N
G
83
end of the Korean war, and traveling by bus through the South
Korean countryside and walking around downtown Seoul, as I did
earlier this year, leaves an indelible impression of the indomitable
will of the South Korean people to better their once miserable
lives and of the efficaciousness of South Korean institutions of
making the escape from poverty possible. War it turned out was
both, a source of terrible human suffering and an incubator for
something dramatically new in Korea’s history and in the history
of capitalism.
South Korea’s phenomenal accomplishments are worth
noting. But they are not unique. Taiwan became South Korea’s
twin at least in the eyes of scholars studying the process of rapid
economic advancement in East Asia. And Taiwan, like South
Korea, was also extremely vulnerable. Vietnam took a somewhat
different path, through many decades of a prolonged war of
national liberation, against France first and then against the U.S.,
before experiencing unification under Communist rule, followed
soon by the Sino-Vietnam border war of 1979 and eventual
living under China’s growing economic shadow. Although
Vietnam’s move to rapid economic take-off is occurring only
now, in the wake of China’s economic ascendancy, the long run-
up is marked by at times extreme vulnerability to that nation’s
survival.
These economic miracles are thus rooted in one common
condition, often extreme vulnerability, and show one common
institutional feature, the existence of a strong, developmental
state, intent on leading the nation rapidly to high and self-
Peter J. Katzenstein is the
Walter S. Carpenter, Jr.
Professor of International
Studies at Cornell University.
Katzenstein is President-
elect of the American
Political Science Association
(2008-09). In 1987 he was
elected to the American
Academy of Arts and Science.
He was the recipient of the
1974 Helen Dwight Reid
Award of the American
Political Science Association
for the best dissertation in
international relations; and of
the American Political
Science Association's 1986
Woodrow Wilson prize for the
best book published in the
United States on
international affairs.
Peter J.
Katzenstein
And I remember South Korean journalists angrily
and politely posing tough questions to
a top IMF official at a meeting at the Smithsonian Institution
that I had a chance to attend in
the winter of 1997 in Washington, D.C.
84
sustaining economic growth. Variations in the character of the
state and state-economy linkages are considerable. This is
illustrated well by South Korea’s more centralized and Taiwan’s
more decentralized pattern of organization and development. But
in all cases the underlying condition of vulnerability and a strong
developmental state gave the initial impetus to different ways of
coping with adversity.
One should not think of the underlying condition of
vulnerability and developmental statism as something that
economic advancement of the 1960s and 1970s eliminated. In
the South Korean case, it is true of course that the freezing of the
military situation along the DMZ into a permanent stalemate
eventually led to a normalization of South Korean life and a
diminution of the sense of vulnerability. Yet South Korea
remained exposed to typically venomous threats shouted from
up North and six thousand North Korean pieces of artillery
trained on Seoul. And a new kind of vulnerability came with the
embracing of export-led growth as the guiding doctrine for the
South Korean economy starting in the early 1960s.
Although for several decades world markets were kind to
South Korea, world markets can create their own tsunamis as
financial markets did in 1997. An IMF bail-out of historic
proportion saved South Korea but at what, initially, looked like
Workers weld metal beams at
a construction site at Incheon
International Airport.
85
intolerable foreign interference. I remember seeing newspaper
pictures of South Korean housewives donating their jewelry at
street corners to help raise capital to pay for the melt down in
South Korean reserves. And I remember South Korean journalists
angrily and politely posing tough questions to a top IMF official
at a meeting at the Smithsonian Institution that I had a chance
to attend in the winter of 1997 in Washington DC. That self-
sacrifice and that anger were tokens of an economic nationalism
that defeated handily any attempt of Wall Street bankers eager
to finally buy into South Korean industry on a large scale. South
Korea was rocked by the crisis. But vulnerability galvanized an
underl yi ng economi c nati onal i sm that became a cruci al
ingredient in the defense of South Korean autonomy.
I
n Western Europe, under less harsh conditions, vulnerability
helped produce similarly beneficial outcomes. If one arrays
countries by their quality of life, based on about 200 indicators
of well-being, most of the small European states Scandinavia,
the Low Countries, Austria and Switzerland, and recently also
Ireland and Finland typically show up in the top ten. The
secret of their success lies in a perception of vulnerability to
outside influence. That vulnerability has taken different forms
market disruptions brought about by economic collapse in the
1930s, the experience or threat of Nazi occupation, the threat of
Communist aggression, Findlandization, or in the case of Ireland
British neglect followed by the subsidies that accompanied EU
membership. The social, political, institutional and policy
consequences of vulnerability differed from those we see in East
and Southeast Asia. Instead of developmental states, in Western
Europe it was democratic corporatism that came to express and
shape the collective power and will of the people. Vulnerability
was a crucial factor to generate an ideology of social partnership
that brought the owners of capital, workers and farmers into the
same national boat. And it taught the different and normally
86
quarreling political parties and factions that pulling on the same
oar was going to be more advantageous in the end than fighting
over the spoi l s of capi tal i sm i n a dog-eat-dog form of
distributional struggle.
O
ne obvious difference between the West European and
East Asian pattern is the fact that the small European
states of North West Europe were democratic throughout the
second half of the twentieth century. This was not true of the
succession of developmental states that stepped onto the stage
of regional and global capitalism in Asia: South Korea and
Taiwan, most of the Southeast Asian Newly Industrializing
Countries (NICs), China, and now Vietnam. The latter two remain
firmly committed, at least for now, to a Leninist form of
capitalism. They are unwilling to cede authoritarian political
control to match the liberalizing impetus of their economic
policies. In sharp contrast, South Korea, Taiwan and many,
though by no means all, of the NICs have made remarkably
peaceful pol i ti cal transi ti ons from authori tari ani sm to
democracy.
In the case of South Korea, democracy is rambunctious and
noisy. Democratic politics in Seoul is not a sport for the faint-
hearted. But during the last two decades South Korea has
undeniably become democratic, with vigorously contested
elections and a vibrant civil society and social movement politics.
While liberal theory and policy prescriptions that seek to advance
a liberal agenda are bound to be disappointed in the short-term,
in the long-run, the South Korean case suggests, setting markets
free and making space for economic advancement will create a
middle class that eventually will demand more than a good
paycheck. This is both the promise that South Korea holds and
the threat that South Korean history poses to its big Chinese
“brother” in the North.
South Korea’s economic take-off to long-term, sustained
87
economic growth fits into a pattern of delayed industrialization
with distinctive characteristics not anticipated by liberal theory.
It was an economic historian, Alexander Gerschenkron, who
observed that delayed industrialization was marked by specific
institutional characteristic. Compared to the British economy
which was the first to industrialize, the continental economies
which came later had to compete on different terms. Markets
were no longer as free as they had had been when Britain
entered on the stage. Instead the late comers had less time and
less freedom to find their way.
Concentration of industrial and financial capital and
protectionism were the result. Late European industrializers,
starting with France and continuing with Germany, Italy, other
countries and eventually Russia, evolved different types of
capitalisms than the one that had emerged initially on the British
isles. Late-late industrializers, starting with Japan and later
encompassing in succession the economies of East and Southeast
Asia were operating under still different sets of rules. While it is
true that the initial cohort of late and late-late industrializers
concentrated economic and political power to compensate for
their vulnerability in freely operating markets, somewhere along
the way the Gerschenkronian model stopped working. Instead of
late-late development contemporary capitalism is looking for a
new label to characterize the great transformation that we are
witnessing in East Asia.
Compressed industrialization differs from South Korea’s
late-late development pattern by one basic condition the
disjointed co-occurrence of the old and decrepit with the new
Technological shortcuts, juxtaposition of opposites
and political contradictions create
a potential for enormous political volatility
as a concomitant of compressed development.
88
and super modern. Donkeys pull their carts in front of gleaming
skyscrapers. Beggars can be found nappi ng i n front of
sumptuously luxurious villas. Ancient machinery sits under one
roof with the most advanced computer controlled machining
center. Doctors attend to the hungry and the obese. The young
are beholden to tradition-bound ways and mores and fully
engaged with a free-wheeling transnational consumption culture.
The rapidity of late-late development has given way to the
simultaneity of compressed development. Technological
shortcuts, juxtaposition of opposites and political contradictions
create a potenti al for enormous pol i ti cal vol ati l i ty as a
concomitant of compressed development. It is true that South
Korea’s late-late industrialization patterns no longer provides
many navigational tools that might help China, Vietnam or India
to sail in new, uncharted waters.
B
ut South Korea’s history teaches an enduring lesson of a
different sort how to live with great vulnerabilities. For
six decades now it has danced on the top of a volcano, marked
by periods of calm and quiet as well as periodic, unpredictable
eruptions. Compressed development, especially in China, creates
enormous opportunities. But it will undoubtedly also create
The Korea Stock Exchange
building in Yeouido, Seoul.
89
violent eruptions.
South Korea is condemned to live dangerously, as it has in
the more recent past and throughout history. Vulnerability is not
an exceptional but a habitual condition. In the last six decades
South Korea has made the most of it. This is not a unique gift of
the Korean nation. It is a condition that many nation states have
no choice but to accept and live with. South Korea’s economic
evolution thus fits into a broader pattern in world politics. As
South Koreans look back at the last six decades, they have much
to be proud of. And as they look around the world, they can see
many nati onal experi ments from whi ch they can l earn.
Vulnerability and the possibility to learn from others augur well
for the next 60 years of exploiting the advantages of adversity.
90
T
he economic relationship between Korea and the U.S. has
been one marked by compassion, neglect, reliance, passion,
controversy, frustration and profit. Like the personality of both
nations, it has been emotionally driven, not always based on
economi c consi derati ons and to a very l arge extent
overshadowed by a U.S. obsession for Japan and China, two
markets which dwarf Korea, but which are rarely as profitable for
U.S. companies.
The Beginning
The economic relationship with Korea really began during and
immediately after the Korean War. The earliest memories of
Korea and America had its roots in chocolate bars, milk and flour.
U.S. aid flooded into Korea in the form of food supplies thanks in
large part to large U.S. surpluses with nowhere to go. America’s
farmers profited from large doses of aid that poured into Korea
often making it difficult for Korean farmers to compete, but
making food supplies for Koreans relatively easy to obtain under
the circumstances of war and devastation. Once the immediate
crisis of food was resolved, the large amounts of food aid
discontinued, but economic planning and strategic investments
continued through U.S. aid programs. The remnants of these
programs are still evident in the twin buildings now occupied by
the Ministry of Culture and Tourism and the U.S. Embassy which
were the previous headquarters of the U.S. Aid Program which
hel ped Korea wi th basi c economi c pl anni ng and the
establishment of strategic industries needed to get Korea’s
KOREA
Impossible to Possible
Korea-U.S. Economic Cooperation:
60 Years of Passion,
Conflict &Profit
S
T
I
L
L
G
R
O
W
I
N
G
91
economy moving.
This early beginning is responsible in large part for the
gratitude Korea’s older generation feel toward American
generosity. It is difficult to forget the hand that feeds and
protects, notwithstanding that a certain amount of resentment
builds because of this dependence. Subsequent generations of
Korea did not experience this direct aid from America that had
immediate visible results and they are able to look more
objectively at the U.S. economic relationship analyzing it with a
greater need for mutuality and benefit for Korea. Given the size
and dominance of the U.S. economy, there is a healthy dose of
cynicism in the “mutual benefit” analysis with an assumption
that as the historically weaker of the two, Korea always ended up
with the short side.
As the Korean economy grew in the 70’s and 80’s so did
U.S. investment in important industries for Korea in the form of
joint ventures and the licensing of critical technology. The U.S.
remained the largest foreign investor in Korea throughout this
period investing in important projects which boosted economic
performance, international competitiveness and exports. Yet
Japan and subsequently China always were the recipients of
much bigger investments given the size and potential of their
economies. It was difficult for U.S. managers located in or
responsible for Korea to capture the attention of corporate
leaders to increase investment in Korea.
Profitability has always been relatively good for U.S.
companies in Korea, but the hope of bigger profits in Japan and
Jeffrey D. Jones served five
terms as President of the
American Chamber of
Commerce in Korea and
three terms as President of
the Seoul Club. He organized
and presently serves as
chairman of a nonprofit
foundation, Partners for the
Future, providing
scholarships, job training, aid
and other assistance to the
unemployed and their
families in Korea. Jones
serves as advisor to several
organizations and
government agencies in
Korea including the Foreign
Investment Advisory Council
of Seoul City and the
International Advisory Board
of the Federation of Korean
Industries.
Jeffrey D. Jones
As the Korean economy grew in the 70’s and 80’s
so did U.S. investment in important industries for Korea
in the form of joint ventures
and the licensing of critical technology.
92
China often overshadowed the real profitability of Korea. This
remains true today.
Trade Frictions
There was continuous pressure from the U.S. to open and
liberalize Korea’s markets, which went largely ignored until the
early 90’s when true liberalization of Korea’s economy began and
for the first time it became possible for foreign companies to
have wholly owned subsidiaries in Korea. This continuous trade
pressure or trade frictions as they were often referred to created
some resentment in the minds of the public and many officials
and was often the source of confl i ct between the two
governments.
Throughout the 70’s, 80’s and early 90’s, however, the
military and strategic alliance between Korea and the U.S. was
the primary focus of the two governments and to a certain
extent the general public of both nations often leaving the
economic potential between the two countries ignored. The
requirement that U.S. companies had to enter the Korea market
as joint venture partners with Korea firms also acted as a serious
impediment to significant investment and building stronger
economic ties with Korea.
An exclusive port for Hanjin
Shipping near Long Beach Port
in California, U.S..
93
The Opening
Once joint ventures with local partners were no longer the
required form of doing business in Korea, U.S. companies began
to look more seriously at Korea’s market with much greater
potential. The post economic boom of the ‘88 Olympics was
taking affect and U.S. companies began to take Korea much
more seriously. Korea was beginning to shed its “Mash” image
deeply embedded in the minds of the U.S. public from the
extremely popular U.S. television series about the Korean War.
Just as this activity was beginning to take serious hold, Korea
entered the financial crisis in late 1997 which came to be known
as the “IMF” crisis and this marked the beginning of significant
investment in Korea by U.S. companies.
Failing Korean companies with significant assets and
sparkling new factories caught the eye of U.S. investors and U.S.
companies began flooding into Korea. This era also marked the
beginning of private equity investments in Korea in addition to
the traditional strategic investment that heretofore had been
Korea’s sole source of investment. The beginnings of private
equity investment following the IMF crisis also sparked a new
round of criticism and resentment from the Korean public toward
U.S. investment. The public and press criticized such groups for
their excessive profits taking advantage of companies that faced
difficulty. Profits became labeled as inappropriate and excessive
as the economy recovered.
Representative of the “evil” of private equity has been the
very successful Lone Star Funds who have come to symbolize all
of the bad that is conceivable of private equity. To this day, Lone
Star struggles in Korea to liquidate a significant investment while
NGOs and other groups seek to prevent Lone Star from taking
any profits outside of Korea. This incident has unfortunately
dampened the investment environment in Korea and has resulted
in a significant decrease in U.S. investments coming to Korea.
94
Economic Integration
The integration of the U.S. and Korean economies began very
early in the 60’s and 70’s by an early reliance in the U.S. on
cheap imports from Korea and on Korea’s reliance on financing
provided by U.S. financial institutions. This initially started with
U.S. imports of garments and then shifted to electronics and
other consumer i tems. It was not unusual to fi nd retai l
establishments such as K-Mart and other mass marketers in the
U.S. with stores filled with Made in Korea labels. As Korea
continued to improve, wage levels eroded the competiveness of
these products, which migrated to China, but still with the
previous Korean owners. U.S. financial firms financed the
burgeoning investment by Korean firms in semiconductors,
shipbuilding, steel, automobiles and overseas construction.
Over the years, Korean products improved in quality and
image such that today, Samsung and LG have replaced Sony as
the television of choice for U.S. consumers. Hyundai and Kia are
making inroads into the U.S. market capturing a large slice of U.S.
car sal es and openi ng pl ants i n Al abama and Georgi a.
Chipmakers have similarly established large facilities in the U.S.
and with the passage of the North American Free Trade
Agreement (“NAFTA”), Korean firms began securing an increasing
share of the U.S. market by putting plants in Mexico generating
increased sales in the U.S.
Immigrants
This integration of the U.S. and Korean economies is also very
apparent in the larger cities in the U.S. Korean immigrants to Los
Angeles and New York began to have a significant impact on the
quality of life in these cities through their hard work and
sacrifices, particularly in the inner cities which were deteriorating
as suburban flight was leaving the inner city to the very poor
with little or no services. Korean immigrants braved the difficult
95
conditions and began to invest in small businesses in these inner
cities which helped to generate much needed activity and a
renewal of hope for the inner city. The Korean immigrants were
an example of thrift and hard work to not only other immigrants,
but to the original inhabitants, and while some resentment of
the Korean profit taking was generated, their enthusiasm and
example was also infectious on the residents who were also
inspired to work harder and invest in their communities.
The Korean laundry, gas station or deli have become
fixtures of cities in America and with their success, the Korean
operators are now being replaced by newer waves of immigrants
as the second generation of Korean immigrants move on to
investment banking and other more profitable occupations in the
U.S.
In addition to immigrants, foreign student populations
have also had a positive economic impact across a wide swath of
America. The Koreans have the largest population of foreign
students in the U.S. following closely behind China and India
despite having a population a fraction of either China or India.
Korean students have infiltrated both the public and private
school system i n the U. S. , whi ch has contri buted to an
improvement in the quality of education for U.S. students
because of the increased competition. The number of Korean
students in America and their tremendous study habits have
helped to keep these institutions academically progressing and
also kept them financially healthy. It is not unusual to find the
Dean’s Roll at most top universities filled with Kims, Lees and
The Koreans have the largest population of
foreign students in the U.S. following closely
behind China and India despite having
a population a fraction of either China or India.
96
Parks. The large number of Korean doctorates and significant
population of Korean students studying in the U.S. have created
a common bond between Korea and U.S. investors and this large
student population has had a tremendous impact in helping
Korea understand U.S. culture much better than American
understanding Korean culture, which has made economic
cooperation much easier for Americans in Korea.
KORUS FTA
Both countries now face a tremendous opportunity to further
improve the integration and cooperation of their economic
activity with the ratification of the Korea U.S. Free Trade
Agreement (KORUS FTA). The KORUS FTA is the most significant
trade agreement for the U.S. since NAFTA and is clearly a real
positive for the Korean economy that will lead to greater
prosperity for Korea. The KORUS FTA will eventually be ratified
by both countries despite the politics that surround the
agreement in an election year. Once the treaty is ratified by the
legislatures of both countries, a significant and new chapter of
economic cooperation will become possible. Leading financial
firms are predicting that within 30 years, the U.S. and Korea will
Kim Jong-hoon, the Minister
for Trade, shaking hands with
Wendy Cutler, the chief U.S.
negotiator for the Korea-U.S.
free trade agreement in Seoul.
97
be number one and number two on the globe in per capita gross
domestic production. This is a dream that most Koreas today can
not accept as a probable reality. It can and will occur with the
KORUS FTA and we must hope that the legislatures of both
countries have the wisdom and maturity to do the right thing for
the citizens of their respective countries.
98
T
he Republic of Korea met its 60th anniversary this year. For
60 years, Korea went through a major historical change and
the Koreans who survived the hardship created the term “the
miracle of Han River” which drew the world’s attention. Korea as
a nation started the “collecting gold” campaign and the people
who survived the “banking crisis” drew attention from all over
the world. Korea’s past 60 years were years of success as well as
development and miracles. The economic development of Korea
laid the foundation for China’s economic development.
For 36 years since 1910, Korea, under the control of Japan,
went through an extreme time of hardship and difficulty.
However, the Korean people did not give in to Japan’s bloody
oppression and persistently pursued independence. Most
particularly, a large part of the independence took place in China
and therefore had the support of China. The 3.1 campaign and
April of 1919 had a profound effect on enabling Korean
governors to establish a temporary government in Shanghai, and
this had an important effect on the relationship between Korea
and China for three reasons.
From a democrati c perspecti ve, i t was a symbol , a
personification, and a standard for Korea’s anti-Japanese
independence campaign. From a democratic perspective, this was
an attempt by the Koreans to escape the oppression and try to
establ i sh a Republ i c. From a Chi na-Korea rel ati onshi p
perspective, this became evidence of the development of a
friendship between Korea and China. The combatitive mind and
the accomplishments that the temporary Korean government
KOREA
Impossible to Possible
Heading Towards a New
Miracle Creation and Glory:
In Celebration of 60th Anniversary of
Korea
S
T
I
L
L
G
R
O
W
I
N
G
99
showed to China for 27 years became the innate basis in
establ i shi ng today’ s Korean government and ci ti zens.
Furthermore, it became the central political basis for the friendly
relationship between Korea and China.
Thereafter, Korea experienced hardship in the separation of
its nation when it was divided by the U.S. and the Soviet Union
and even now, the Korean Peninsula is still divided. However,
within 60 years, through the experience of hardship and
persistent effort, South Korea developed from a literally non-
existent, indigent, poor country to a leading developed country.
It has developed into a country with economic, political, and
cultural strengths. Recently, Korean movies, dramas, music and
dance centralized as the “Korean wave” have spread throughout
the world and reflected a beautiful image of Korea to the world.
Based on the statistics, Korea has undergone many
historical changes over the past 60 years. Korea now has
developed into a lead trader in exporting mobile phones, motor
vehicles and chips. The GNI per person and GDP from 1953 to
2007 increased from U.S.$ 67 to U.S.$ 20,045 (300 times) and
U.S.$ 1.3billion to U.S.$ 969.9 billion respectively (750 times).
Total exports increased from 1948 to 2007 of U.S.$ 20million to
371.4 billion (17,000times) while imports increased from U.S.$
280 million to U.S.$ 356.8 billion (1,715 times).
The rapid economic development in Korea had a profound
effect on the quality of life of the Korean citizens. The birth rate
decreased from 4.53 in 1970 to 1.26 in 2007. In 1949, 2 people
out of every thousand owned a mobile phone, but in 2007, 9 out
Shi Yuanhua
The GNI per person and GDP from 1953 to 2007 increased
from U.S.$ 67 to U.S.$ 20,045 (300 times)
and U.S.$ 1.3billion to U.S.$ 969.9 billion respectively
(750 times).
Born in Wuxi city of Jiangsu
Province in 1949, Shi Yuan-
hua is the professor of the
School of International
Relations and Public Affairs
of Fudan University. He is
also the director of Center
for Korean Studies at the
university. Shi is the author
of a number of books on
China’s diplomatic history,
Korea’s independence
movement and other
Northeast Asia issues
including The Diplomatic
History of the Republic of
China, Korean Independence
movement and China, and
etc. He has also published
hundreds of papers on
academic journals in
domestic and abroad.
100
of 10 people owned a mobile phone. The vehicle industry which
previously did not focus on motor vehicles, buses, and freight
cars developed into focusing on cars. And the 44,000 cars owned
in 1974 increased to 15.496 million cars, which reflects one car
per household.
These statistics reflect the amazing speed that Korea has
developed within the last 60 years. The Koreans were able to
achieve the nation’s independence and strength through
persistence and effort, and as a result, was able to receive
people’s praise and respect from all over the world.
Currently, Korea is experiencing a historical change which
can be described as a “fourth change.” The first was changing
from a developing country to a leading developed country;
second was changing from an unstable republic to a stable
republic; third was changing from a nation that depended on the
U.S. to an independent self-standing country; fourth involves
changing from a separated country into a united country. The
newly elected President Lee Myung-bak is focusing on this issue
in search of establishing a “new Han River miracle.”
Economi cal l y, Korea i s i n a changi ng phase from a
developing country into a developed country; however, the
income per capita is progressing from U.S.$ 20,000 to U.S.$
40,000. Unlike the previous political, elite, military, and common
presidents, President Lee is what can be referred to as a “CEO
Korean factory in China.
101
President.” With a nickname of “Bulldozer” and “The Myth of
Salaryman,” President Lee has established policies and goals
focused on economic development. President Lee established a
“747 policy” which means that each year, the Korean economy
would increase by 7% and increase the Korean people’s income
to U.S.$ 40,000 within 10 years and make Korea the 7th ranking
economic country (currently 11th). By enabling the diffusion
ratio of house to 115%, he promised an area of two houses per
household. President Lee stated, “The developed country that we
dream of is a country that achieves a balance between individual
happiness and the nation’s development, a country that achieves
a balance between material wealth and innate development, a
country that has wealthy citizens, encompassing society, strong
nation, and receives respect from all over the world.
I
n order to achieve such goal, President Lee set “low carbon
green growth” as the center of the vision and established
strategies in order to establish a miracle on the peninsula,
following a Han River miracle. It was an attempt to establish a
paradigm for the nation’s development focused on creating more
jobs through green technology and energy. In order to avoid the
energy crisis and set a foundation for green growth, President Lee
promised that he would “raise the remaining 5% energy
development rate up to 18% throughout his term and at least to
50% by 2050 therefore creating a country independent of
energy.
Furthermore, he promised to increase the renewable
energy rate from the current 2% to at least 11% by 2030, 20%
by 2050. Increase the investment into research and development
for greenery technology by twice as much, and ultimately aim to
become the leading developed country in the green technology
market with 3 quadrillion worth by 2020. In other words, even if
the price of oil falls in the future, there is a necessity to separate
the country from the oil dependent era.
102
P
olitically, Korea is entering a new era of democratic progress
after a process of popular election for three generations.
President Lee stated, “If the past 60 years have been a time
which involved basic freedom, the next 60 years should be a time
to achi eve devel oped freedom, and onl y then wi l l the
establishment of the Republic of Korea be complete.”
In order to become a leading developed country, President
Lee stated that “first and formerly, the basics need to be
observed.” In other words, it is important to ensure that the gaps
are filled, which may have been overlooked in the fast-paced
development stage. President Lee’s political development goals
are as follows:
“Global Korea”: President Lee stated that Korea has the
resources for a leading country and for the next 10 years will
make a “Universal Korea” and a “country that will be active and
recognized globally.” Additionally, he stated that policies will be
developed to enable easier access into and out of Korea in order
to allow global people to work in Korea, and added that although
the land is small, the soul of Korea will be large.
“A Leading Korea”: President Lee announced to make Korea
one of the top leaders. The first step will include law and rules, as
the major key to a leading country is in its law and rules, with no
exceptions, even to the president.
“Balanced Korea” President Lee announced “a change
within balance” and emphasized the importance of Korea’s long
lost values and the need to re-find them. He also emphasized
that providing trust is a society’s capital and there will be a need
to raise the trust of the Korean society to the standards of a
developed country. Additionally, by focusing on “individual
happiness”, he promised to increase the standards of living by
developing education, culture, social security, etc, in order to give
a chance for peopl e to fi nd the opportuni ty to devel op
themselves in Korea.
“Highly efficient Korea”: Making an efficient government is
103
one of President Lee’s top priorities. President Lee announced a
new re-organi zati on i n government to ensure the new
government would be efficient by “starting off with a thin
organizational structure.”
In regards to foreign policy, Korea has been regarded as a
co-follower to the U.S., therefore often did not have a separate
foreign policy. With the basis of a developing economy and
increasing comprehensive national power, Korea has commenced
a “autonomous balanced” diplomacy in the inter-state relations
and the Korean-U.S. alliance has started to alter from an
asymmetric relation to an equal and mutual benefit relation.
Korea is currently facing a historic mission of establishing
an independent and autonomous state, and therefore President
Lee Myung-bak cannot cease or give up his diplomatic efforts to
improve upon a new alliance relation in the 21st century, by the
means of altering from an asymmetric relation to an equal and
mutual benefit relation. Furthermore, between Northeast Asia’s
multilateral alliance system and the U.S. based alliance system,
Korea is at a neutral stance. And it is discreet by not joining the
Korean-U.S. missile defense system and the U.S.-Japan-Australia-
India’s Asian-pacific security system within the Northeast Asia
international relations. President Lee stated that importance will
be added in rebuilding the relationship with the U.S. as well as
developing relations with China, Japan, and Russia.
President Lee plans to focus on developing Korea and
China relations. Last April when President Lee visited China, he
was able to raise the relationship of the two countries by
He also emphasized that providing trust is
a society’s capital and there will be a need to raise
the trust of the Korean society to the standards
of a developed country.
104
establishing a strategic conversation system and a strategic
cooperative partnership.
During the Olympics, President Lee visited China and Hu
Jintao, the head of state, paid a visit to Korea. Frequent talks and
a joint cooperative relation between the two summits will clarify
the strategic cooperative partnership, and through specific
measures the likelihood of implementation will increase.
In regards to the North-South issue, Korea is currently
facing a possible transition from a divided country into a united
country. Ensuring smoother North-South relations and ultimately
unity is the government’s goal. President Lee has continuously
showed kindness and generosity to the North, attended a six-
party meeting in order to communicate with the North more
effectively and to discourage the use of the nuclear weapons.
Furthermore, he emphasized that disabling nuclear weapons was
the main focus and differed from former president Roh by
adjusting and researching the North-South economic assistance
program, previously established by President Roh’s government.
He also addressed the “disarming nuclear weapons,
independence, 3000. ” This meant that only if the North
renounces its nuclear weapons will the large scale economic
provision for the North starts, thereby helping the income per
person to increase up to U.S.$ 3000, and developing and
moderni zi ng hi ghways, rai l roads, provi di ng access to
international financial institutions, etc through provision of U.S.$
40 billion from development funds.
I
n celebration of the 60th anniversary, President Lee stated that
80 million Koreans in the North and South need to be united.
He went on to state that the future belongs to the dreamer, and
that a dream by an individual may only be a dream, but a dream
led by 80 million people can be reality. President Lee stated if
Korea is united, the blocked roads will be opened, and imported
goods from Busan can be transported through rail to Europe,
105
Russia, and the Mediterranean. Additionally, he stated that
“through the six-party meetings and international help, they will
establish a North Korea economic aid program that will start
achieving a universal economic society in Korea.”
Korea which is currently facing a historical change is facing
the challenge of creating a new glory and making new initiatives.
The Korean government is facing major responsibilities from
various areas. President Lee emphasized that Korea must not lose
the current opportunity to become a leading country.
A space rocket uses 90% of the fuel when it is launched,
and once in space, hardly any fuel is used. President Lee stated
that if we exceed the U.S.$ 30,000 line, it will be easier to reach
the U.S.$ 40,000 and U.S.$ 50,000 line. Under President Lee’s
effective guidance, the Korean citizens will be able to make Korea
into a much stronger, more beautiful, and a North-South united
country.
106
Knowledge Economy and Service Sector:
In the modern era, the global economy has strong orientation
toward becoming a knowledge economy. Knowledge economy
does not mean narrowly high-technologies or Information and
Communication Technologies (ICTs) only. In a broader sense, it
means how effectively an economy is able to tap and use the
potential of the growing stock of knowledge and advances in
ICTs. At more definitional level, the knowledge economy means a
knowledge is created, acquired, transmitted and used more
effectively by enterprises, organizations, individuals and
communities for greater economic and social development. The
new era of knowledge economy substantially depends on
favorable economic incentive and institutional regime as well as
educational system geared up to encourage creativity, risk taking
and innovation.
Al though, al l the sectors of an economy shoul d be
enriched, improvised and transformed to play a critical role in the
era of knowledge economy, the service sector is more directly
linked with the emergence of global knowledge economy. In the
new era, the service sector has become the main engine of
economic growth across the world. In the age of information
revolution, around 67 percent of global output is now driven by
the service sector. The countries which have been global leader in
manufacturing era have been gradually but decisively orienting
their economies towards more competitiveness in the service
sector. Average contribution of services sector in the economies
of the OECD countries is 73 percent, whereas it is 77 percent in
S
T
I
L
L
G
R
O
W
I
N
G
KOREA
Impossible to Possible
Service Sector of Korea in Global
Knowledge Economy:
Challenges and Prospects
107
the case of the U.S.. The service sector has not only emerged as
the highest contributor to the GDP of these economies but also a
source of higher employment generation.
Service Sector in Korea:
The performance of service sector of Korea in the age of global
knowl edge economy has not been very sati sfactory i n
comparison to its contribution in economies of other OECD
countries. The service sector in Korean economy contributes only
around 55-60 percent i n the GDP of the country and
unfortunately the growth in the sector has been sluggish in the
last decade. The average real growth rate of the manufacturing
sector in Korea between 2000 and 2007 has been 8.17 percent,
whereas corresponding figure for the service sector has been 4.33
percent.
The productivity of the Korean service sector has also been
low in comparison to other OECD countries. It has been far more
serious problem as service sector productivity of Korea has been
around half of the United States or Britain. In some services,
Korea’s productivity has been only one-fourth of that of the
OECD countries. The low productivity is a problem which affects
not only service sector of Korea but has also been a big challenge
for the manufacturing sector. In a report of the Ministry of
Strategy and Finance and the OECD, Korea’s overall labor
productivity per hour stood at $20.4 in 2006, substantially lower
than the $50.4 for the U.S. and the OECD average of $38.
Basically, Korea was ranked 4th lowest among the 30 member
Sandip Kumar Mishra is an
Assistant Professor of
Korean Studies at the
Department of East Asian
Studies, University of Delhi,
India. He specialized in
Korean Studies at the
Jawaharlal Nehru University,
India, and went through
Korean language training at
the Yonsei University. He has
been a visiting scholar at the
Institute for Fast Eastern
Studies, Kyungnam
University and Kim Dae-jung
Presidential Library and
Museum.
Sandip Kumar
Mishra
The performance of the service sector of Korea
in the age of global knowledge economy
has not been very satisfactory in comparison to
its contribution in economies of other OECD countries.
108
OECD countries.
However, the labor productivity in the service industries
has been much lower. According to the Statistics Research
Institute (RSI), “Using labor productivity, value created by one
employee during a one-year period, in the manufacturing
industry with the baseline set at 100 in 1985, the services sector
efficiency stood at 378 in 2005, substantially lower than the U.S.
figure of 1,014.” It is important to note that service sector labor
productivity of Japan and average of Britain, France and other
European countries have been 1,083 and 928, respectively. There
are studies saying that the low productivity of the service sector
of Koreans might bring down the productivity of the entire
economy, a phenomenon which is called ‘Baumol’s disease’.
Although there are significant problem areas in the service
sector of Korean economy, it contributes enormously to the
employment generation in the country. In 2007, around 75.2
percent labor force in Korea was employed in the service sector.
Korean IT sector has also been a very important silver line while
interrogating status of service sector in Korea. Korea is known to
be an IT superpower with high internet penetration and
Samsung Electronics releases
Europe’s first terrestrial DMB,
or Digital Mobile Broadcasting
mobile phones.
109
advanced IT technology. More than three quarters of all
households in Korea have high-speed Internet connections, which
is higher than any other country in the world. As one of the
major components of service sector, IT accounts for 15 percent
of GDP and 39 percent of total exports. Korea’ s strong
manufacturing sector is also significant as it provides a solid
foundation to Korean efforts to excel in the service sector as
well. It provides a strong possibility for a manufacturing-service
sector continuum, which would be beneficial for both the sectors.
Challenges and Prospects
The Korean development strategy has been so far a spectacular
success story of economic growth led by the manufacturing
sector and the policy of export-led growth. However, in recent
years it is being threatened by increased competition from low-
wage economies as well as the fast rise of knowledge as the
principal source of competitiveness and economic growth. Korea
needs to concentrate on the service sector and try to integrate it
with its success in manufacturing sector. Korea needs to focus on
improving productivity of its service sector by raising the
effecti veness of i nvestment i n educati on, i nformati on,
infrastructure and R&D. Korea’s investment in these sectors has
been one of the highest as percentage of GDP among all the
OECD countries. However, the country is not able to get full
advantage of it, because of lack of economic incentive and
insufficient or misplaced institutional regimes. Korea needs to
improve conditions for generation and exploitation of knowledge
and information such as intellectual property rights and the
regulatory framework about IT to emerge as a key player in the
new era of the global economy. Another area which needs
attention is to ensure sufficient competition, flexibility and
diversity of economic activities which sometimes do not happen
because of the dominance of big Chaebols in the country. Korea
could also work on more proper allocation of investment in the
110
R&D and education and streamline them to make them more
productive.
The next challenge for the Korean service sector would be
its seamless integration with the global system. Although, it is
important to think about inviting more trade and foreign
investment in Korean service sector, equally important is to go
beyond by its integration with the world knowledge pool and
services. In this regard, it would be important for Korea to
venture into joint research projects with foreign research
institutions and universities. The process would also lead to more
exchanges of researchers and professors of Korea with the
outside world. Korea should also attempt to improve its
participation in the international organizations and institutions,
especially those which are playing the key roles in setting up
rules and norms of international business and trade, such as
World Trade Organization (WTO), International Standards
Association (ISA) and OECD. In this regard, role of English
language should also be underlined along with other foreign
languages.
The Korean service sector is also marred by its limitation to
offer its service products to a wider range of consumers in
English. It is important to accept that English language has
become the main language of global trade and business in
present era. If Korea strives to become an important source of
exports in not only manufacturing goods but also services, it is
essential to overcome language barriers. The exports of Korean
manufactured goods have strong presence in the world market
because these exports are less affected by the language skills of
producers but a service exporter has to be more careful about
the language skills to reach in every nook and corner of the
world.
The two main pillars for achieving the goal of Dynamic
Korea in the service sector are innovation and integration with
global knowledge economy in future. On both the fronts, it
111
would be important to acquire and improve English and other
foreign language skills. Many of the Korean service sector
products such as IT, Internet games, movies and dramas are at
par or sometimes better than their foreign counterparts, but they
have not been able to reach to a wider consumers because they
could not be accessed in English. For example, Daum or Naver
provide, arguably, better services than Yahoo or Hotmail, but
they could not be accessed in English and it becomes their
limitation in realizing their vast potential business prospects.
Similarly, the English language could also play a vital role in
integrating Korean R&D with outside world. Korea which
invested 27.3 trillion won or 3 percent of GDP in R&D in 2006
plans to further increase it up to 5 percent of its GDP by 2012.
But the R&D of Korea should necessarily have close cooperation,
coordination and integration with the world knowledge pool to
provide optimum results.
The role of state in the Korean economic success has been
very pivotal in past and it would again be critical in transforming
Korean economy in the new era by strengthening service sector
and i ntroduci ng structural reform requi red for the
manufacturing-service continuum. By unleashing the creative
power of markets and ensuring rule of law, transparency,
accountability, and a conducive legal and financial system, state
can provi de better envi ronment for i nnovati on and
entrepreneurship in Korea. The first phase of Korean economic
success in manufacturing era was led by huge Chaebols but in
second phase the key players would be small and medium
At present Korea spends around 14 percent of GDP
on education which is relatively quite high.
However, there is need to more focused
approach emphasizing educational quality, creativity
and integration with larger world knowledge pool.
112
enterprises (SMEs). These SMEs are, if not more, equally
significant for providing boost to the service sector.
These SMEs could complement the large Korean Chaebols
and provide them productive innovation and supporting services
in the process of Korea diversifying toward a more knowledge-
based and service-oriented economy. Although, R&D expenditure
in Korea is high, private sector contribution in overall R&D
spending is around 75 percent and the government share is
merely 23 percent. Since the government share is less in overall
R&D, private sectors’ share is monopolized by big business
houses Chaebols and SMEs find it very difficult to get benefit
from overall R&D spending in the country. To help SMEs,
government needs to give them a more flexible bankruptcy law,
development of financial infrastructure to support their credit
and more importantly have better provision for their venture
capital.
Around 34 percent of the venture capital industry in Korea
Professor Oh Jun-ho of the
Korea Institute of Science and
Technology with his humanoid
robot “Albert Hubo” on ABC’s
“Good Morning America”.
113
is funded by the government and around 10 percent by foreign
venture capitals. By having easy access to credit especially by
defining collateral while lending them, government could help
SMEs to prosper and as in most of the advanced economies of
the world, they would play an important role in deepening the
process of creation and diversifying of service sector in the
country.
The service sector in Korea has not only to balance
between big business houses and SMEs but also needs to be
more inclusive. The nature of knowledge economy makes it more
challenging for government to restrict ‘digital divide’ which is
more prone to take place when knowledge and information
become the key variables for success in business and which could
be more easily monopolized by a small section of the country.
Furthermore, Korea has to keep the possibility open by its
proactive polity that a new kind of entrepreneurship comes out
from the all strata of the society by minimizing the digital divide.
Korea needs to concentrate on the few other key areas also
and should adopt a comprehensive structural reform package on
the line of needs of knowledge economy such as flexible,
inclusive, transparent and market-driven economy which would
ensure support for i nnovati on at the i ndi vi dual as wel l
institutional levels. The new structure of economy would provide
better level-playing field to participants without discriminating
them on the basis of their size, capital or orientation. Education
would also be important in enabling people to venture into more
innovative arena of economy.
At present Korea spends around 14 percent of GDP on
education which is relatively quite high. However, there is need
to more focused approach emphasizing educational quality,
creativity and integration with larger world knowledge pool. The
goal of education should be focused on inculcating innovation
and entrepreneurship skill in individuals which would be the main
engine of growth of service sector in the country. Moreover the
114
reform should be based on better coordination among state,
business and society.
Role of Government:
Considering the significance of the service sector in the entire
economy, Korean government has already taken steps to
overcome sluggishness of the sector and to ensure the country’s
sustainability in growth and employment. Government has taken
various policy measures to promote service sector of economy.
The Korean government ventured into the ‘Brain Korea-21’
project to provide a concentrated fund and help a specific center
of higher learning to invest in cutting-edge research and
improvisation. Korea also started a ‘three-year strategy, to
promote knowledge-based economy in the country. The previous
government of Korea also began a comprehensive three-phase
plans to upgrade competitiveness service sector and there have
been some positive assessments of these efforts. Joseph E.
Stiglitz, a renowned economist, wrote in 2002 that Korean
efforts to become a hub of global knowledge economy has been
paying off and “Korea is on its way to become a high-tech
service sector economy”. However, improvement in the service
sector of Korea has not been satisfactory in terms of its pace and
extent. As mentioned in the beginning of the article, it still
suffers from low productivity and low competitiveness.
The new government in Korea under the leadership of Lee
Myung-bak has taken a more fundamental and comprehensive
approach to catapult Korean service sector in the age of global
knowledge economy. With the establishment of a new ministry
by the name of Ministry of Knowledge Economy, Korea has made
a serious attempt to have some structural change in the Korean
economy by having coordination and integration in steps related
to new knowledge economy. It would also facilitate the service
sector by making it more business-friendly and open-market
oriented. Under the aegis of the Ministry, Korea plans to develop
115
a comprehensive mid-to-long term vision to identify as well as
strengthen new engines of economic growth. In the vision, search
and support to the next-generation industries and strengthening
of the service sector are the two areas which have been rightly
highlighted. It is important that SMEs have been recognized by
the new government as the backbone of the economy and
government has promised to assist entrepreneurs in starting up
as well as operating these SMEs. Korea has also been negotiating
FTAs with the U.S. and EU and envisioned to have similar FTAs
with China, Japan, ASEAN and other emerging economic
countries such as BRIC (Brazil, Russia, India and China) countries.
Korea is also working on its financial sector reforms and making
efforts to invite investment banking in the country. Korea wants
to become a l eader i n the Bi o-Nano-I nformati on (BNI )
technologies and government has launched ‘New IT Strategy’ in
which 280 billion won would be spent in training of qualified
experts in the field, in addition to overall 3.5 trillion won
earmarked for the new strategy.
In August 2008, the National Science and Technology
Committee outlined initiative named ‘577 initiative’. In the
initiative, government would spend 5 percent of GDP in R&D
from 2008 to 2012 and the fund would be provided to the top
seven science and technology areas on priority basis which would
result into making Korea one of the seven leaders in the field of
science and technology in the world. More specifically, the new
administration has disclosed the first phase of its plan to advance
the service sector on April 28, 2008 and announce the second
and third phases in September and December this year which
would be addressing most of the challenges and opportunities of
It is not a linear process for a country which has been
a leader in manufacturing era of economy to
overnight transform itself into a service sector giant.
116
the service sector of Korea in the global knowledge economy.
Concluding Remarks
The question is not whether Korea can, but rather how Korea
would be able to strengthen its position in the global knowledge
economy on the basis of reform in the economy to build a more
vibrant, competitive and proactive service sector. Korea has done
it once and there is no doubt that Korea can do it again by its
drive to innovate and move up in the value chain.
A sustained Korean endeavor to perform well in the
upcoming sectors of the global economy would gradually pull
Korea again as one of the leaders of these sectors. Korean service
sector has rightly got strong governmental support from the new
admi ni strati on whi ch i s commi tted to i mprove Korean
productivity and competitiveness in the global knowledge
economy.
However, the improvement of the Korean performance in
the service sector of economy would be a process in which not
only government initiatives but also strong willingness on the
part of business, role of individual and societal supports, all them
would be crucial. It is not a linear process for a country which has
been a leader in manufacturing era of economy to overnight
Visitors test the LG laptop and
PDA mobile phones with
WiMAX technology at an LG
kiosk.
117
transform itself into a service sector giant. However, sustained
efforts on the part of state, business, individual and society
would definitely make it possible in the case of Korea. Moreover,
it is also very much possible for Korea to work on evolving a
manufacturi ng-servi ce sector conti nuum and thei r
complementarities could help each other to evolve to their
potential in the new age of global economy.
118
S
everal years ago I had an occasion to visit North Korea for
the first time. I entered the country from China, crossing the
Tuman River, and spent a couple of days in the city of Rajin,
where the North Koreans were trying at that time to develop an
international free-trade zone. I have many indelible memories of
that trip, but one of the things that initially struck me was how
similar in many ways the country seemed to South Korea in the
late 1960s and 1970s, when I had lived in Seoul. The poverty in
both cases was palpable, and there was a certain shabby, gray,
improvised quality to the dress of the people and architecture,
which often looked broken down or half-finished.. Indeed, Seoul in the late 1960s
still had the feeling of a city that was trying to recover from the
ravages of the devastating war that had ended in 1953. Jeeps left
over from the war were in fact still being used for private
transportation, and beggars, some with maimed or missing limbs,
visible victims of the war, were not uncommon sights on the
streets in those days.
Despite such similarities, the two places were actually very
different. In the north the economic crises of the 1990s had
taken their toll, and Rajin was a grim, almost somnolent city. The
local factories were for the most part closed, and there was little
human activity of any kind, economic or otherwise. In the center
of town a motley collection of people, mainly old men and
A
C
H
A
N
G
I
N
G
S
O
C
I
E
T
Y
KOREA
Impossible to Possible
Seoul in the 1970s
119
soldiers apparently on leave, sat quietly and expressionless on
benches warming themselves in the spring sun. Off to the side a
makeshift (and technically illegal) market that had sprung up in
the wake of economic problems and failures in the official food
distribution system seemed relatively subdued as markets go.
One had the sense of a people with little to look forward to and
little enthusiasm or energy to tackle even the routine aspects of
daily life. The general impoverishment appeared deadening and
hopeless, a depressing, pitiful sight to behold.
Seoul in the 1960s and 1970s also had a decidedly
impoverished look. And of course the whole country, especially
after 1972 and the establishment of the Yusin state, toiled under
the weight of a strict, authoritarian government that brooked
little political dissent. But the poverty of the south never seemed
deadening or hopeless. Quite the opposite. For the vast majority
of the people who were not directly engaged in the political
struggles of the period, the 1960s and 1970s offered new
opportunities and enticements. Hope and change were in the air.
Except from 4 a.m. to midnight, when a security curfew was in
effect, Seoul was a dynamic, bustling city, its streets literally
teeming with people actively pursuing their interests and
pleasures. Even after the midnight curfew, Seoul’s nightlife often
continued behind shuttered storefronts in numerous (and illegal)
bars and restaurants.
The fact is that Seoul, as well as the rest of South Korea,
was undergoing a profound transformation in the 1970s. Indeed,
it would not be an exaggeration to say that the country was
Carter J. Eckert is Yoon Se
Young Professor of Korean
history at Harvard University.
For eleven years, from 1993
to 2004, Eckert served as the
director of the Korea Institute
at Harvard..
Carter J. Eckert.
120
experi enci ng the most far-reachi ng soci oeconomi c
transformation in its long history, and one of the greatest
socioeconomic changes in the history of the world itself. The
contours and statistics of this great transformation have been
studied by many scholars and are well known. Here in what
follows I will only briefly note the impact of some of these
changes on the landscape and everyday life of the capital city, as
I personally experienced them between 1969 and 1977.
The look of Seoul in the 1960s and 1970s was actually very
different from what it is today. Before the late 1970s, Seoul’s
everyday life was concentrated north of the Han River. The area
we know as Gangnam today was to a great extent sti l l
countryside, composed largely of fields and paddies. The main
business district was centered in Mugyodong, with many bars
and restaurants catering to the business community running
along the Cheonggyecheon street, where today the beautifully
restored Cheonggye stream begins its eastward flow. Groups of
students from the major universities flocked to Jongno 2-ga in
the evenings, where they drank makkeolli at long, low tables and
sang to the rhythmic tapping of chopsticks. Often short of
Seoul in the 1970s.
121
money to pay the bill, one of the students in the group invariably
left his watch, a prized possession in those days, with the
manager of the drinking establishment, to be reclaimed at a later
date when he could return with the necessary cash. Myeong
dong, as it had been for decades reaching back even into the
colonial era, was the main gathering place for intellectuals and
arti sts of many stri pes, as wel l as for the ci ty’ s most
sophisticated residents. Here, spreading out in all directions from
what was then the Nati onal Theatre, one coul d trace a
fascinating network of small streets, in some cases barely wide
enough for two people to pass each other.
On these streets one found a wide assortment of small
shops, restaurants, and watering holes, including the second-floor
OB Cabin, where virtually all the popular singers of that day
performed live at one time or another. Today, with the city
having expanded not only south of the river but virtually all the
way to the port of Incheon, it is hard to grasp how small and
compact the city of the early 1970s was. All the areas mentioned
above are roughly contiguous with each other, and one could
without too much effort traverse the whole center of the city in
a single long walk.
Only the few and the wealthy had private cars, and there
were as yet no subways, so for longer distances within the city
most people relied on the bus system or shared taxis with others
going in roughly the same direction (hapseong). Getting from
one place to another, especially by bus, could be a daunting and
messy business. The various buses tended to arrive in waves, all
belching out large gusts of polluting exhaust fumes that were
impossible to avoid inhaling, but that was only the first hurdle
faced by would-be passengers. Bus and taxi queues did not exist,
and the appearance of a bus or taxi often unleashed a stampede
of social Darwinian proportions, as everyone rushed and
struggled to board at the same time.
Once the harried and exhausted young bus girls who were
122
in those days responsible for collecting the fares finally managed
to pull the doors shut and the bus took off, one often found
oneself standing in an overstuffed space, holding on for dear life
to the hand-straps hanging from the ceiling or even on to other
nearby passengers, as the bus rattled and shook its way to the
next stop at breakneck speed.
One finally tumbled out of the bus at one’s destination
feeling squeezed, disheveled and lucky to have survived. During
the summer rainy season bus rides became even more of a
challenge. As one moved away from the center of the city, many
streets in those days were still unpaved, and both buses and
passengers had to contend not only with pounding rains but with
streets that were thick with mud. Considering the ordeal that a
bus ride entailed in those years, it is remarkable how matter-of-
factly, even good-naturedly, people accepted it as a regular part
of everyday urban life, and how, even given all the hassle and
chaotic competition for a seat, people often showed great
kindness and generosity to fellow passengers who were too old
or too weak to stand, or who needed assistance of some kind.
U
npaved streets were not a problem in the city’s center, but
lighting was another matter. Seoul in the 1970s was still a
relatively dark city at night. To conserve electricity, the larger
office buildings turned off most of their lights at night, and neon
signs were scarce. On the outer margins of the city, as in much
of the deep countryside, one found places with virtually no lights
at all, where candles were still used in place of electricity.
Only when a North Korean Red Cross delegation made a
historic visit to Seoul in the early 1970s were all the lights of the
city, including all the central office buildings, left on at night as
part of an official strategy to impress the North Koreans with the
South’s high level of economic development. Even though the
lighting was contrived and temporary, at the time it was
astonishing to see the city so brightly lit. Today, of course, even
123
that level of urban brightness would pale in comparison to the
glittering night lights of contemporary Seoul.
There are many other aspects of Seoul in the 1970s that
one might cite to highlight the great transformation of the city
that has since taken place. Seoul in those days, like the country
as a whole, had few trees and green areas to clean the air and
add color to what was essentially a black and grey city. This
monochromatic landscape was reinforced by the ubiquitous
black suits of the city’s politicians and professional classes, the
black uniforms worn by middle- and high-school students, and
the chauffeured black sedans used by the city’s elite. It was also
reinforced by the pervasive militarism of the time, which was
punctuated by periodic air-raid drills and anti-communist
banners strung across the streets, and exemplified by the
ubiquitous presence of uniformed soldiers on duty or on leave in
the streets and students in military drill clothes.
Women were by no means absent from the city scene, but
their roles were far more limited than today, and relations
between the sexes were also considerably more formal and
restricted. The easy familiarity, displays of affection, and public
dating one sees on the streets of Seoul today between young
men and women was the exception, not the rule. Seoul was then
very much a city of men, and a city for the benefit and pleasure
of men, with women remaining largely in the background in
subordinate or service roles of one kind or another.
Foreigners were even more difficult to find than women on
the streets of Seoul in the late 1960s and early 1970s. Like today,
This monochromatic landscape was reinforced by the
ubiquitous black suits of the city’s politicians and
professional classes, the black uniforms worn by
middle- and high-school students, and the
chauffeured black sedans used by the city’s elite.
124
the large American military presence at Yongsan was seldom
seen or felt in the city’s center, and there were at that time still
few foreign tourists or businessmen coming into South Korea on
a regular basis. Japanese visitors, so common a sight today, were
particularly rare because of the strained relations that existed
between the two countries at that time. I remember once seeing
in the early 1970s a Japanese businessmen emerge from his hotel
in traditional Japanese dress for an evening stroll in Myeongdong.
Almost immediately an unfriendly crowd began to gather around
him, and he quickly scooted back inside his hotel, not to appear
again.
In 1970 the old colonial Chosun Hotel, originally opened in
1914, was renovated and re-opened as Seoul’s first international
luxury hotel. Its opening was a grand affair, presided over by
President Park Chung Hee and First Lady Yuk Young-soo, and it
was a watershed event with respect to South Korea’s growing
internationalization. At the time, however, the new Chosun stood
out from its humble surroundings like an alien spacecraft that
had happened to land in the middle of Seoul, and the renovation
project itself had required strong government support even to
get off the ground. In retrospect, of course, the Chosun can now
be seen as one of the earliest symbols of a future South Korea
that would come to be one of major powerhouses of the world
economy and a magnet for international corporations.
I
nside the Chosun Hotel in 1970 one found many of the goods
and conveniences of modern life that were for the most part
still not available to most South Koreans, including such things as
telephones, air-conditioning, refrigerators, music systems, and
private baths. Public baths in those days, for example, were for
most Seoulites a necessity, not the optional and luxurious
health-spas they are today, and they also provided beginning
jobs for poor and relatively uneducated young Koreans from the
countryside seeking employment in the capital. Despite their
125
deep love for music, few South Koreans could also in those days
afford to pay for the technology to listen to music in their
homes..
Korean-made commodities were only just starting to
appear in stores, and still had none of the appeal or status for
Korean consumers that foreign-made products (especially
American or Japanese) held. American goods that had found their
way from the Yongsan army exchange (PX) into the Korean black
market were much in demand, especially among city’s elite, and
one could find numerous places throughout the city, including
the great markets of Namdaemun and Dongdaemun and the side
alleys of Myeongdong, where such items could be purchased at a
premium from very savvy, grandmother-like ladies, who
invariably drove a hard bargain. Even today on certain side
streets one can occasionally still encounter these entrepreneurial
grandmothers selling their PX wares, including on one of the
same streets in Myeongdong where they had flourished in the
1970s. But in a world where South Korea ranks as the 12th
largest economy, such scenes today seem little more than quaint
residues of a bygone era.
It is impossible to pinpoint a precise moment of change in
the 1970s that marked the development of what we know today
as the modern, contemporary city of Seoul. The changes were all
too numerous, swift, and simultaneous. But the movement in
population from the center of the city to the areas south of the
Han river in the mid-late 1970s seems in retrospect a clear
harbinger of things to come. The development of Gangnam
coincided with the growth not only of the economy per se but
also of a new, increasingly affluent middle class that would, a
126
decade later, also help transform the authoritarian political
landscape and secure South Korean democracy. Some of the first
new middle-class apartment complexes to arise were on the islet
of Yeouido in the middle of the Han River, and living there in the
1970s one could see before one’s eyes the socioeconomic
transformation that was taking place.
As the apartment compl exes devel oped and the
apartments began to fill rapidly with more and more Korean-
made goods and appliances, so too did new communities
develop with their own shops and stores, including what were
Seoul’s first supermarkets. For the first time one began to see
large numbers of children who could be described as chubby, and
leisure activities and fads such as bicycling, swimming, and
bowling began to proliferate in quick succession within the new
communities. By the time I returned to the United States in
1977, the new communities were spreading rapidly south of the
river, and their residents were just beginning to acquire their own
Korean-made Hyundai cars for personal use.
T
he changes of course have continued, not only in the
Gangnam area but in the old center of the city as well.
Occasionally on trips back to Seoul, I find myself in the Chinese
restaurant on the top floor of the Chosun Hotel, whose great
glass windows look out across the city, as they did in the 1970s.
But the view before me is now utterly different. The basic.
127
gridlines of the old city are still there, marked by the ancient
palaces and old neighborhoods. But the skyline has been totally
altered by gleaming towers of steel and glass, and the stark
ambience of the 1970s city has been softened by affluence,
colors, greenery, and a more open political atmosphere. The
hotel itself, which once dominated the landscape around it, now
seems almost quietly tucked away, one of countless great hotels
and buildings in the city.
Looking out the windows, I am able for a fleeting moment
to recapture in my mind’s eye the cityscape I remember from the
1970s, but it quickly dissolves before the overwhelming reality of
the present. I feel humbled by the power of time, but also
grateful to be able to feel that power and to be able to chronicle
it as a historian of this remarkable country.
128
O
ne day in the early autumn of 1945, in the uncertain
period between the end of World War Two and the formal
establishment of North and South Korea as separate countries,
24-year-old Lee Kie-hong, then unemployed, was strolling past
Ewha Girl’s High School, near the modern-day location of the
U.S. ambassador’s residence, when someone called out to him.
“Hey, man. “Do you speak English?” An American soldier
billeted at the school had noticed the English-language tabloid
under his arm.
“Yes,” he said. “I can speak English.” Actually, he could read
English but had never experienced conversation with a native
speaker. A group of ten young soldiers surrounded him and
excitedly peppered him with questions.
“What is your name?” one asked.
“Where do you come from?” said another.
“How come you speak English?” A brilliant student from a
poor Cholla village, Lee had studied English at a prestigious
school in Hiroshima.
“Hiroshima? Wow! How did you escape the atomic
bomb?” Towards the end of the war, Lee and his fellow students
were doing more work in a nearby munitions plant than in the
classroom. Lee had sneaked away to avoid air raids, protected
from police scrutiny by the prestige that went with his school ID.
He didn’t know an atomic bomb had landed on the city.
A few days l ater, his l imited conversational abil ity
notwithstanding, Lee’s new friends arranged for him to be hired
as an interpreter. He became the only Korean on the personal
A
C
H
A
N
G
I
N
G
S
O
C
I
E
T
Y
KOREA
Impossible to Possible
New Country, New Lives:
How Life Has Changed for Koreans
in the Past Sixty Years
129
staff of the American military governor. During the power
transfer conferences, he relayed a request from the departing
Japanese administrators for safe passage for hundreds of
thousands of Japanese, which was granted. He later went on to
study in the United States and returned to Seoul to work in
government, where he became the planning director responsible
for distributing U.S. aid and later the author of Korea’s First Five-
Year Plan. In May 1961, when the military staged a takeover, he
was in Washington preparing a state visit for the ousted Prime
Minister, John M. Chang. In a White House meeting with
President John F. Kennedy’s national security advisor, McGeorge
Bundy, Lee asked if the U.S. could use troops to stop the coup.
Bundy said they could not act without a formal request from the
Korean government. With the premier hiding in a convent and
his cabinet scattered, no such appeal came. Lee and a colleague
kept this conversation secret when they returned to Korea to find
that they were among a handful of bureaucrats the new junta
considered competent enough to retain their jobs.
His experience reflected the uncertainty of the time sixty
years ago when the Republic of Korea was founded. “Just think of
it,” he said, reflecting decades later, in the summer of 2008, on the
chance encounter with American GIs. “There I was walking down
the street and I step unexpectedly into an extraordinary life.”
With Japanese no longer useful, the rare facility with
English helped Lee and others like him. But fortune also shone on
the uneducated, like Chung Ju-young, a peasant boy who went
on to found the nation-building Hyundai Group. Other business
Michael Breen is the
Chairman of Insight
Communications, a PR
consulting firm which he
founded in Seoul in 2005. He
first came to Korea in 1982
as a foreign correspondent.
He was the Seoul
correspondent for The
Washington Times for eight
years, and for The Guardian
for four years. He left
journalism to start
consulting on North Korea
and later went into in public
relations. He is the author of
The Koreans (St. Martin’s
Press, 1999) and Kim Jong-il:
North Korea’s Dear Leader
(John Wiley & Sons, 2004).
Michael Breen
“Just think of it,” he said, reflecting decades later, in the
summer of 2008, on the chance encounter with American GIs.
“There I was walking down the street and I step unexpectedly
into an extraordinary life.”
130
people were handed companies owned by departing Japanese.
For the 20 million Koreans in the South, including several
millions recently returned from overseas exile or forced labor,
luck went both ways in such unstable times. Many young
Koreans, both those who had succeeded in Japanese schooling
and others whose anti-Japanese parents had either refused or
been too poor to send them to school, were drawn to leftist
ideas and suffered when the anti-communist right took power.
Those who had benefitted during Japanese rule such as business
people and bureaucrats, both the diligent who sought to get on
and the less scrupulous such as police and others who preyed on
Koreans, for example, torturing men suspected of dissent, and
rounding up girls for Japanese military brothels, risked being
branded as collaborators. Such was the uncertainty that
permeated every household about the precarious situation of the
country and their own circumstances.
We may imagine elderly Koreans at that time, conducting
a similar exercise as the one we are doing and looking back to
1888 and their youth. He would have remembered a different
Korea, one less developed for Korea by the end of the
Japanese rule would have appeared in many regards as modern
and industrialized and wobbling towards the 20th century, but
socially more stable.
D
espite centuries of buffeting between its larger neighbors,
Koreans had remained a distinct people. In part they
remained so because of language, theirs, with its roots in the
Altaic linguistic family of inner Asia, differing from those of their
neighbors. It was rendered in Chinese characters, but its spoken
form was unintelligible to Chinese and Japanese. For centuries, a
rigid caste system headed by scholarly gentlemen schooled in
Confucian ethics, who considered keeping up appearances more
important than actual work, had stifled the populace. Education
provided the only way out from the middle to upper class in the
131
form of the government service examination. Each family
carefully preserved its genealogical chart, which traced male
offspring only, hence the preference for boys. The upper class
yangban read books on ethics and fancied themselves as artists,
amateur, mind you, because being a professional musician,
dancer or painter was the job of lower class “performers.” Poetry
was also important. If yours was bad, your chances of becoming
a bureaucrat were almost nil. Some local literature had protest
themes as did some pansori balladry, Korea’s version of the blues.
The Confucian principles of righteousness, service to the king,
filial piety, deference to elders and social superiors, and
benevolence to those younger and inferior underscored social
behavior in Korean society. The people believed that the king
ruled through the mandate of heaven. Instability in the form of
political upheaval and natural disasters suggested that heaven
was unhappy. With modern science and medicine yet to reach
Korean shores, the people were also suspicious and employed
peculiar remedies for illness.
Many elements in this thumbnail description of Korea over
a century ago years may resonate with outsiders who are
A panoramic view of the area
around the Han River.
132
familiar with Koreans today. But if these patterns remain, they
do so in moral echoes. For example, modern Koreans still have
excessive expectation of leadership and disruption casts a moral
shadow. In 1995, when a bridge over the Han River and a
luxurious department store collapsed within weeks of each other,
killing hundreds, then-President Kim Young-sam made a
television apology for his “moral failings.” Also, Koreans remain
hierarchical. They have an instinct for someone’s social position
relative to their own because the language requires it. They use
different verb forms and even nouns depending whether the
person is above or below.
But in substance, change has been enormous. Through the
Japanese rule, there was a social revolution. The caste system
was overturned, with butchers, previously untouchable, now, for
example, able to send their children to school. The royal family
and aristocracy, who had stood by limp-wristed as the country
was signed over to foreign control, lost their claim to superiority.
People looked to religious figures, and in particular to Christians
for leadership.
As the Americans withdrew after the established of the
Republic, the prospects for South Koreans looked bleak. Per
capita income in 1948 was $86, on a par with Sudan. In his book
Troubled Tiger about Korean development, author Mark Clifford
cites this assessment by a U.S. military official: “There are
virtually no Koreans with the technical training and experience
required to take advantage of Korea’s resources and effect an
improvement over its rice-economy status.” He reckoned the
Despite centuries of buffeting between its larger
neighbors, Koreans had remained a distinct people. In
part they remained so because of language, theirs,
with its roots in the Altaic linguistic family of inner
Asia, differing from those of their neighbors.
133
country would become a “bull-cart economy” and that the non-
farming half of the population would face famine.
Then came war and things got much worse.
The new South Korean army often fought courageously,
but it suffered from inexperience and corruption. Cadets at the
military academy, poor boys destined for a bright future, were
bussed to the front and ordered by incompetent senior officers
to rush at hills. Their ranks were decimated within days, depriving
the army of hundreds of young officers.
T
he war immediately brought the Americans back, supported
by a number of other non-communist nations fighting under
the flag of the United Nations Command. These forces saved
South Korea. Refugees poured south and didn’t stop until they
reached Busan, where they piled into squalid refugee camps and
built shacks on the hillsides with stones and flattened American
army oil drums. But amid chaos, South Koreans, whose country
at one point was reduced to greater Busan, recovered their
dignity. Schools started quickly and commerce began from the
streets. Perhaps the most telling symbol of their hopeful
dependence was the construction along the airport road in Busan
of hoardings to conceal the squalor of the refugee camps from
the view of visiting dignitaries. Officials didn’t want to make
visiting foreigners, who held the key to their survival, feel sick.
As many as three million North Koreans and 500,000
South Koreans are believed to have died from causes related to
the war. In addition, there were 900,000 Chinese dead and
wounded. Over 33,000 Americans, 1,000 British and 4,000 other
nationalities were killed. According to South Korean figures,
129,000 civilians were killed during the North Korean occupation
of the South, 84,000 kidnapped, and 200,000 press-ganged into
the northern military. (It is possible that some of these people
went voluntarily, but their families may believe, or have found it
wiser to assume, that they were unwilling.) The economies of
134
both sides were pulverized. The North was flattened by U.S.
bombing and industry everywhere was wrecked.
Of those who survived in South Korea, some five million
were homeless, 300, 000 women were widowed, 100, 000
children orphaned, millions of families separated. One million
North Korean refugees added to the pressure. Tens of thousands
of schools and other buildings were destroyed. Damage was
assessed at $3 billion which in 1953 was a considerable sum.
Over forty percent of manufacturing facilities and fifty percent of
mines had been damaged or destroyed. Inflation was rampant.
Taking 1947 as the base of one hundred, the wholesale price
index grew from 334 in 1950 to 5,951 in 1953. The retail price
index similarly rose from 331 in 1950 to 4,329 in 1953.
A
mid the violence of the civil war and the reprisals as one
side and then the other took control, any lingering ideas of
Korean brotherhood disappeared. Even today, most Koreans who
experienced the war are firm in their hatred of the other side.
Life for most Koreans in the 1950s was a struggle for
survival. “Have you eaten rice?” became the common greeting.
An increasing number of people wore western suits, but many
still wore traditional white cotton clothes. The country was
sustained by U.S. economic aid. Over two million tons of wheat
and barley each year helped save Koreans from starvation and
cotton, sugar, and wool boosted manufacturing industries
sufficiently to supply consumer goods, laying a foundation for
the rapi d i ndustri al i zati on throughout the 1970s. The
government muddled through. Its leaders focused on how to
raise funds for the ruling party, and its bureaucrats, whose
salaries covered about 20 percent of basic living expenses, looked
for handouts and the next meal.
The Americans came to rely on a small group of officials
from wealthy families who did not worry about their salaries and
resisted using their positions to enrich themselves. They tried to
135
interest colleagues and ministers in forward-looking plans, but
were met with cynicism it’s hard to consider a growth plan
for beyond next week when you’re worried where dinner is going
to come from until U.S. officials warned that aid might be
reduced if there was no evidence of long-term planning. In 1957,
four cabinet members jointly presented the idea of a Five-Year
Plan to President Syngman Rhee. After listening for an hour, the
crusty old independence activist said, “You ministers are talking
about five-year plans. That sounds like Stalin’s idea.” From then,
the concept was taboo.
If leadership held the country back, people still managed to
move forward. By the end of the 1950s, the measure of progress
was that people only went seriously hungry in the late spring
before the barley harvest.
Then, in 1960, the Rhee government collapsed in the face
of protests following a rigged election. The country was ruled for
nine months by a democratic government headed by Prime
Minister John M. Chang. But this administration lacked real
strength and was replaced in May 1961 by the military regime of
Park Chung Hee, an army general. Park and his fellow coup-
makers mostly came from peasant backgrounds. They were an
unusual group of men who had been trained as young officers in
People enjoy the slopes of
“High 1” Resort in Gangwon-
do Province.
136
the Japanese military. Theirs was in some regards a Marxist
outlook. Indeed, as Park Chung Hee’s brother had been executed
as a communist, the U.S. government first feared that there had
been a communist coup in Korea. As nationalistic Koreans, they
had a vision of a strong military-led country in which business
and labor served the interests of the state. They were suspicious
of capitalism and of the rich, and contemptuous of civilian
politicians. On taking power, Park passed a law that allowed him
to effectively punish anyone who had become rich since the end
of the war. A few days later, the chairman of the Samsung
Group, Lee Byung-chul, who Park regarded as the country’s
leading businessmen, announced he was donating his wealth to
the government. Other business figures followed suit. Over 4,000
alleged criminals were rounded up by the military and under a
new morality campaign alleged smugglers of banned items such
as foreign cigarettes and coffee. A short while later, Park unveiled
the country’s First Five-Year Plan.
Thus Koreans were ushered into a new era, one in which,
they were made to sacrifice and suffer. But such was the promise
of development that, if they resisted without good moral cause,
such as that provided by religion or political dissent, they risked
guilt and social condemnation, for the prevailing ethic was that
their blood, sweat and tears was in the service, not of an
authoritarian regime, but of nation-building. They also risked
punishment and failure. The executive branch was able to wreck
or take over businesses whose leaders upset it and manipulate
the media and judiciary to ruin careers and lives.
Of those who survived in South Korea, some five
million were homeless, 300,000 women were
widowed, 100,000 children orphaned, millions of
families separated. One million North Korean
refugees added to the pressure.
137
South Korea’s vigorous anti-communism was instilled
through educati on and rei nforced by propaganda and
information control and a total ban on all Marxist literature or
study. The irony is that its own growth was centrally controlled
and very socialist in nature.
At this time per capita income was still the same as the
Sudan and behind India and Pakistan. The homeless still slept in
the streets, beggars still operated, and people starved to death
each spring. Most vehicles on the street were official cars,
military jeeps and delivery trucks. Only a handful of rich people
had private cars. Few houses had running water and electricity.
T
hat is took a hard nut like Park, cracking the whip, to kick-
start economic growth is not surprising. It is anyone’s guess
where the republ i c woul d be today wi thout hi s type of
leadership. But it is clear that the dramatic growth that took
place, and with it the transformation in the lives and experience
of Koreans, would not have happened at that time without such
a strongman directing it. Viewed close up, the story of this
development was not one of Japanese-style decisions based on
consensus. Rather it was one of struggle both within and
between the various key sectors of society. If the business people
battl ed among themsel ves, they al so battl ed wi th the
bureaucrats, and so on. Such is the fractious nature of Koreans
that such battles still seem to be a part of the fabric today. It no
longer takes a strongman to pull everybody together in a
common endeavor. As society becomes more sophisticated, law
plays an ever more important role. But that fractiousness and
mistrust remains. But, in another irony, this quality lies behind
the vibrancy of modern Korea democracy. Already, in just five
democratic presidential elections in the last twenty years,
oppositionists have won twice.
Since the war, Koreans have moved off the farms and
become city dwellers. During the war, the main cities swelled
138
with the influx of refugees from North Korea. These new South
Koreans had come with nothing and started completely anew.
Many worked in markets. Seoul’s Dongdaemun Market, for
example, was dominated by North Koreans. From the start of
Park’s rule, as manufacturing industries grew, people moved into
the cities looking for jobs and to attend colleges, leaving their
parents in the villages and their older brothers to manage the
farms. In many ways, they brought the ways of the village with
them, giving many city neighborhoods a rural feel. People sold
their wares on the pavement. They wandered across the roads
without a thought for traffic. The accident rate was predictably
high. As indication of the level of education, the government ran
advertisements teaching housewives to turn off taps after they
had finished washing vegetables.
Meanwhile, most people, with the exception of democratic
activists, appear to have accepted the course the country was
taking. It was a tough approach to rapid economic development
with the objective being to build up a strong industrial base so
that the country may defend itself against North Korea. The
objective, we should note, was not the happiness of the citizenry.
South Koreans would have to wait for the 20th century before
the country began to make that subtle shift. Under Park, his
successor Chun Doo Hwan(1981-88), and even the fi rst
democrati cal l y el ected presi dents from 1988 onwards,
improvement in the lives of the citizenry, both material and in
terms of rights, were, one could argue, a by-product, rather than
the purpose of Korea’s growth policies.
But the citizenry recognized the benefits of growth.
Organi zati ons that coul d have cri ti ci zed and pressured
government tended to fall into line. Media, for example, took a
top-down approach to their readers, seeing their role as to
educate rather than reflect their views. The first consumer
groups, which grew out of women’s organizations, did not focus
on the variety, safety, quality and price of products, but rather on
139
perceived national interest, promoting, for example, resistance to
foreign products in order to support Korean companies.
T
he dislocation caused by the migration into cities and by the
rapid disappearance of old ways made Koreans open to new
communities and sources of comfort. There was organization
down to the block level and even today in apartment complexes,
there are annual elections to choose block leaders. Now, of
course, rather than delivering policy from on high, their role is to
keep their constituents happy by coming up with better ways to
dispose of garbage and how to lobby to get an ATM machine in
the local supermarket. Announcements are frequently made
through the speakers in each apartment, a level of intrusion that
most citizens appear to take for granted.
But the di sl ocati on gap was pri mari l y fi l l ed by the
country’s Protestant churches who stepped into this gap with
extraordinary zeal. Wherever churches operated, in rented floors
of commercial buildings, in makeshift premises, and in converted
homes, they placed a cross on the roof that was lit up in red at
night, creating vibrant evidence in the night-time cityscape of
their growing influence. As apartment complexes spread across
cities, so churchgoers would proudly put stickers on their doors
of their respective churches. The founding pastor of the Full
Students of L’Ecole de Seoul
participate in a parade in an
assortment of masks and
costumes.
140
Gospel Church, on Yeouido Islet in Seoul decided against creating
new churches in neighborhoods, preferring instead to expand his
one church and hold services through the day on Sunday to
accommodate the growing congregation. The numbers swelled in
home groups, mostly composed of housewives, who met once a
week to study a Bible text and pray for sick members and for
their husbands’ promotions. When the numbers approached
twenty, a cell split into two. In the days before most Seoulites
had their own cars, cell groups would buy their own van and, on
Sundays, an army of vans would deliver group members to the
church which was eventually rebuilt to resemble an indoor
stadium. By the time it reached half a million members, the
church was boasting the largest single congregation in the
history of Christendom.
T
he other side of this story, the emptying out of the
countryside, would have enormous implications for the
villages and farms of Korea, where for centuries people had
developed their values and work habits. Extended families often
lived in the same village. Each had its small school where children
were taught Confucian ethics. The patterns of bursts of activity
at planting and harvest and periods of inactivity, when the men
drank and gambled, as well as the joyous moments of group
activity and the willingness to be told what to do, such as when
everyone piled in to re-thatch one family’s roof. Such patterns, if
you look, remain with Koreans today.
Consider the statistics. In 1960, some 63 percent of
Koreans lived in the countryside with 28 percent in cities and 9
percent in towns. By the end of the decade, that combined
number in cities and towns was already 50 percent. By 2005,
only 10.2 percent of the population remained in the villages. But
there was concern at the time that while the country remained
committed to industrialization, it was losing its traditions. But, if
there is a sentimental concern for the farmer (expressed in
141
opposition to foreign agricultural imports even if it does mean
Koreans pay high prices for their food), there was no romance
about rural life in the hearts of them men driving the economic
miracle. Indeed, it was because they knew the reality of the
farmer’s lot, that the new leadership was bent on improving it.
Park Chung Hee created the Saemaul (New Village) Movement
to modernize agriculture and raise rural living standards through
a combination of self-help projects and government funding. This
program began with a cement surplus in 1970. Park ordered that
every village be given 335 free bags. The following year, villages
which were deemed to have used them well (about half), were
given another five hundred bags and a ton of steel.
The biggest visible change in the countryside, and indeed in
the cities, was the removal of the traditional thatched roofs.
Although they kept homes cool in summer and warm in winter,
Park considered them a symbol of backwardness. He ordered
them replaced with corrugated metal, and later with tiles. This
coercive program officials would forcibly remove the roofs
from the homes of people who resisted changed the face of
Korea forever, and to date there has been almost zero interest in
reviving it.
Today the villages of Korea are going through a new type
of revolution, one that challenges the historical homogeneity of
Koreans and their view of the significance of ethnicity. Young
bachelors and not-so-young bachelors have found in recent years
that women were not enthusiastic about a life on the farm. In
The first consumer groups, which grew out of
women’s organizations, did not focus on the variety,
safety, quality and price of products, but rather on
perceived national interest, promoting, for example,
resistance to foreign products in order to support
Korean companies.
142
search of brides, farmers have turned to China and southeast
Asi a wi th the resul t that now one i n ei ght marri ages i s
international.
The change which economic development has wrought in
the lives of Koreans is truly remarkable. Koreans are healthier
than ever before in their history. If a Korean from sixty years ago
stepped into a modern apartment, she would not know what
most of the everyday items were for, let alone how to use them.
Baby strollers have replaced the old blankets mothers used to
carry their babies. Koreans once slept on mattresses on the floor.
Now most have beds. Even the kitchen sink would be a novelty,
having made its appearance for ordinary Koreans in the ‘60s.
“Where’s the kimchi?” she might ask. It’s now stored in special
freezers, rather than in the old earthenware pots buried in the
frozen ground.
The biggest surprises would come in the bathroom. In the
first wave of modernization, if you bathed at home you did so in
a bathroom with walls and floor tiled in porcelain, which had
various sized bowls, some for washing clothes, a tap and a
shower attachment or hose. For that reason, many people went
to wash in communal bathhouses. Now many apartments have
two bathrooms, one with a bath and the other with a shower
cubicle. Most homes now also have sit-down toilets, a Western
import that was once so foreign to Koreans that they would
sometimes climb up on the seat and squat over the bowl.
The diet has also changed. Many people, especially the
young, opt for cereal and toast for breakfast instead of rice and
kimchi. A varied diet means that people are much taller than
they used to be. Parents have full wardrobes, separately his and
hers. Even in the ‘80s, Korean men would wear work suits if they
went out with their family on Sunday because it was all they
had. Now they’re in fashionable-length shorts and sandals and
the suits are for work only.
Where once their grandparents were concerned with the
143
next meal, modern Koreans are concerned with wellbeing,
looking at ways to quit smoking, exercise more, and eat what is
good for them. At the same time, they are still heavy social
drinkers, with the middle class having moved on from beer and
the local liquor, soju, to Chilean, Australian and French wine. The
lifestyle has moved in the span of two generations from pre- to
post-industrialization with all the anxieties and concerns, once
buried, ignored, or non-existent that such change entails.
In acknowledging the 60th birthday of a country like
South Korea, it is appropriate to draw attention most of all to its
people. This is not a country that prided itself on ideology or
system. It was not guided by a Constitution created by Founding
Fathers. Nor was it able to depend on oil, gold, or sheer size. In
fact, the country is small, over-crowded and devoid of resources.
The acknowledgement, from today’s Koreans and from outside
observers, must be to those hard-working, badgered people
whose dreams and loyalties, and whose sweat and tears drove
Korea’s economic growth in the Park era and its democratic
development in later years.
In the long history of the Korean people, they are the
greatest generation, and in the short history of the Republic of
Korea, their country’s most magnificent resource. Throughout
their working lives, among the burdens they faced was insecurity
about their country and their own worth. This was variously
expressed in nationalistic outbursts, which still occur, and in
withdrawal and self-criticism. It is something that is hard to
capture and define, but it is something that young Koreans do
not feel. They stand on the willing shoulders of the growth
generation and, for that reason alone, are able to look the world
in the face and say with pride, “I am a Korean.”
144
Introduction:
For the first fifty years of its existence, the Republic of Korea was
in the role of "student," learning from the world, sending its best
and brightest people overseas to study and return. True, Korea
learned from the world very well, bringing home economic
development, political democracy, and high technology. But
Korea's position was that of a country learning from others.
In the past ten years Korea has changed its position in
global education and has begun to take the role of teacher as
well as learner. While the process is incomplete, and one can
hope that Korea will never cease to learn the best that the world
has to offer, learning is no longer just a one-way street, with
foreign knowledge coming into the "hermit kingdom." Korea has
had two decades of favorable world publicity, including the
democracy movement of 1987, the 1988 Olympics, OPEC
membership, the 2002 World Cup, and the cultural impact of the
Korean Wave. Students of the world are coming to Korea to learn
the l atest technol ogy, successful business methods, art,
architecture and culture. The Republic of Korea in the 21st
century, 60 years after i ts establ i shment as a poor and
undeveloped country, is now a well-known and well-respected
member of the international community of nations and is truly
beginning to "teach the world."
Beginnings: The frog in the well
Korea is proud of its 5000 years of history; it is not surprising
that this long history continues to influence Korean life.
KOREA
Impossible to Possible
Teaching the World:
Korean Education Becomes Global
Education
E
D
U
C
A
T
I
O
N
,
C
U
L
T
U
R
E
A
N
D
T
H
E
A
R
T
S
145
Education has its own tradition, and Korea's educational system
has reflected Korean geography, Korean culture, and Korean
history.
Centuries ago in the Unified Silla Dynasty, Korea was
thoroughly internationalized and integrated into the Chinese
world culture of Tang China. Leading Korean scholars and poets
communicated with and traveled to Tang China and considered
themselves part of the Chinese cultural and educational world.
Later, in the Goryeo Dynasty that harmonious relationship was
disrupted by the military power of the Mongol occupation. The
Joseon Dynasty from its beginnings in 1392 sought to cut off
foreign political and military influence in Korea by cutting off all
contact with the outside world; thus began 500 years of the
"Hermit Kingdom." This period solidified the importance of the
Korean nation, the homogeneity of the Korean people, and the
necessity of resistance to foreigners. During the Joseon Dynasty
Confucianism and the Chinese classics became the fundamental
basis of education, but such dominance of a foreign (Chinese)
philosophy was not accompanied by any openness to other
foreign ideas or people.
When Korea was finally "opened" to the west in the 1880s,
Korean culture received a great shock which resulted in the
opening of Korean education as well. That opening from the very
beginning took the form of Korean students going out of Korea
to study. As early as 1885, Seo Jai-pil (who used the English
name Philip Jaisohn) became the first "study abroad" student,
goi ng eventual l y to George Washi ngton Uni versi ty i n
Horace H. Underwood served
six years as Executive
Director of the Fulbright
program in Korea prior to his
retirement in 2004.
Previously Dean of the
Graduate School of
International Studies at
Yonsei University, Underwood
spent most of his
professional life working in
Korea and in international
education. The son of
missionary parents, he grew
up in Korea and, after
earning his Ph.D. in English
literature from the State
University of New York
(SUNY) at Buffalo, he
returned to Korea to teach.
From 1971 to 2004 he was on
the faculty of the Department
of English Language and
Literature at Yonsei
University.
Horace H.
Underwood.
146
Washington, DC. He was followed by a long series of famous
individuals, including Syngman Rhee, Paik Nak-jun (L. George
Paik, later president of Yonsei University), and a host of other
students starting in the 1890s. They attended institutions such as
Roanoke College and Randolph-Macon University, smaller
institutions which welcomed Korean students, as well as more
well-known places such as Harvard, Yale, and Princeton.
Education had been supremely important in Korea for at
least 500 years, of course, as the Confucian ideology and civilian
politics of Korea had combined to make education the primary
means of advancement and success in society. The Confucian
emphasis on education continued after the opening of Korea
(and in fact continues to this very day) and led to a strong desire
to acquire the new knowledge demonstrated by the more
powerful nati ons of the west. Thus, Korean students
demonstrated their adherence to Korea and to Korean ideology
by the very fact of their seeking to study abroad.
The number of Koreans studying abroad remained quite
small, however, until after the establishment of the Republic of
Korea in 1948. As the new Republic of Korea poured scarce
resources into education for all citizens at the elementary level,
so also at a higher level students sought the best education
possible, which at that time was overseas..
The number of Koreans studying abroad continued to grow
throughout the following decades, reaching 39,000 degree-
seeking students in the U.S. alone as early as 1990, according to
"Open Doors," the annual U.S. statistical book of international
students in America. Including language study, short-term study,
and study in other countries, the number of Korean students
147
abroad may have been as high as 100,000 even then. More
recently, Korea has been listed in Open Doors as third in
university enrollment in the U.S., just behind China and India
(which have immensely larger populations.) If pre-university
education is included, the Republic of Korea has more foreign
students in the United States than any other country in the
world. In addition, unlike the early years when Korea was
desperately poor, most of these students choose to return to
Korea on completion of their studies. Certainly this has raised the
level of internationalization in Korea and has helped create
personal links between Koreans and people and countries around
the world.
Nonetheless, all this internationalization of education took
place in a manner that is uniquely Korean. This immense flood of
internationalization for Korea was entirely a one-way process -
students went OUT of Korea, but few international students
came into Korea. Korean internationalization was a one-way
process, outbound only.
Foreign students enrolled at
Yonsei University's Korean
language program learn,
traditional memorial service
for ancestors.
148
This situation was, as mentioned above, a reflection of
history, economics, and culture. Korea's profound belief in a
homogeneous Korean nation had discouraged any belief that
forei gners shoul d be encouraged to study i n Korea. The
economics of a poor war-ravaged country were such that few
foreigners considered Korea to have much worth studying. The
culture of Korean isolation meant that Koreans considered
themselves to be like "A Frog in a Well." This well-known Korean
image is clear and emotionally satisfying; Koreans automatically
"know" that the solution for the frog's problem (the problem of
seeing only a small patch of water and a small patch of sky) is to
go out of the well. Thinking of the problem of Korean education
as a "frog in a well" effectively prevented Koreans from thinking
that another solution for the frog is to invite other frogs into the
well. Thus Korean students (the "frogs") went out of the well
(Korea) in immense numbers, but at first very few Korean
educators thought it important to establish programs to invite
foreign people to learn from or in Korea.
There are many examples of the imbalance of "one-way
internationalization." For instance, there were 39,000 Koreans
studying in the U.S. in 1990, yes, but there were only 410
Americans studying in Korea that year, only 1% as many. As late
as 1998, while 87% of the non-medical faculty of Yonsei
University had doctorates from outside of Korea, only two of the
600 tenured faculty were non-Korean. Exchange programs
throughout Korea were imbalanced, as more Korean students
wanted to study overseas than there were foreign students who
wanted to study in Korea. Despite fear of an "invasion" of foreign
The internationalization of education in the Republic
of Korea is turning out to be a remarkable
modification of 500 years of history and culture in
just 10 years.
149
universities, in fact no branch campus of any non-Korean
university was able to establish itself in Korea. There had always
been a small trickle of foreigners who wanted to learn about
Korea - missionaries, U.S. Army veterans, Peace Corps volunteers
- but their numbers were always small, very small. Korean
internationalization was "one-way" internationalization.
Beginning to teach the world
The process whereby Korea has come to "teach the world" began
with that small trickle of missionaries, military, and peace corps
alumni. A few Korean universities in Seoul, typically private
universities with Christian backgrounds, began soon after the
Korean War to open programs for international students. Yonsei
University's "Korean Language Institute" opened in 1959,
originally to teach the Korean language to foreign missionaries,
but soon growing into an important early institution for
foreigners to learn about Korea. In 1966 Yonsei began an
"International Division" for incoming exchange students, though
the number of students was very small (never more than 10 per
year for the first 20 years).
In the 1970s the leader in receiving international students
was Ewha Womans University, partially because Ewha had a
small international dormitory which could provide housing for
i ncomi ng students (the i ssue of housi ng for i ncomi ng
international students and scholars has continued to be a major
i ssue to the present day, parti cul arl y for programs and
universities located in a crowded city like Seoul.) In 1985 Yonsei
University greatly expanded its international program, beginning
a Summer Program which had 61 students the very first year (six
times as many as ever before). Though at that time Yonsei was
the clear leader in international education, similar programs were
also being started by other universities (Sogang University, Korea
University) and those early institutions were joined by many
other summer and academic year programs for international
150
students.
In the meantime, while most international scholarship
programs focused on providing funds for Korean students to
study overseas (largely in the United States), a few programs
such as the Fulbright program also provided funds for American
students coming to Korea for research. Fulbright Korea's goal has
long been to achieve a rough balance between the flow of
Korean grantees going to the U.S. and U.S. grantees coming to
Korea. The list of American scholars of Korean studies who have
benefited from Fulbright grants is a roll call of the leading
academics in the field, and Fulbright continues to this day to
provide funding for Americans who want to learn from Korea.
In 1987 Yonsei University began the first full academic
degree program in Korea with instruction in English, the master's
programs of the Graduate School of International Studies. As it
turns out, I was the first Associate Dean of the Yonsei GSIS.
Enrollment in the GSIS at first was mostly Koreans (the GSIS had
a student enrollment quota from the Ministry of Education) but
the availability of graduate education in English drew more and
Fifty-five Saudi students on
scholarships provided by the
Saudi Arabian government
pose during an orientation at
Kyung Hee University.
151
more students until soon the number of international students
was equal to the number of Korean students.
By the late 1980s Korea's economic miracle had become
widely known throughout the world, and so the number of
international students wishing to study Korean business and
economics easily exceeded the number studying Korean history
and culture. In 1996 the Republic of Korea Ministry of Education
made substantial grants to universities for the development of
"international human resources," and another seven Graduate
Schools of International Studies were opened in Korea, attracting
more international graduate students. Throughout Korea,
uni versi ti es were wel comi ng i nternati onal students by
establishing special summer programs, academic year exchange
programs, and graduate programs. By 1998, ten years ago, Korea
had begun to teach the world.
Korea internationalizes
A number of Korean presidents have spoken of the importance of
internationalization, but often the concept appeared to be more
words than action. The emphasis of President Kim Young-sam on
"globalization" was never put into practice on the governmental
level, and when President Kim Dae-jung included "openness to
foreign culture" as one of Korea's goals for the new millennium in
2000, many people looked at the goal critically. But even though
it is easy to become critical of "one-way" internationalization
and of the "words-only" nature of goals, in fact over the decade
si nce 1998 there has been a genui ne change i n Korean
universities. Indeed, Korean universities seem to be changing
faster than Korean society as a whole.
These changes have been taki ng pl ace i n Korean
universities without much public fanfare, debate, or consensus.
The number of international students, international agreements,
and genuine international programs has quietly grown and
influenced all of academe. The internationalization of education
152
in the Republic of Korea is turning out to be a remarkable
modification of 500 years of history and culture in just 10 years.
Perhaps the most remarkabl e devel opment i n the
internationalization of Korean education, the change easiest to
see on Korean campuses, has been the growth in the number of
international students in Korea. While American universities have
been holding "study abroad" fairs in Korea for many years,
hoping to attract some of the excellent Korean students to study
in the U.S., Korea has begun holding its own "study abroad" fairs
in recent years, particularly in China and Vietnam, recruiting
international students to come learn in Korea, as well as
recruiting and welcoming students from countries around the
world. As a result, there is no longer any Korean university
wi thout a conti ngent of forei gn students, a si tuati on
unimaginable in previous years. The number of international
students in Korea has grown from only a few hundred ten years
ago (and most of them in short-term study such as exchange
programs or language study) to a situation where there are
thousands of international students in Korea, mostly in graduate
degree programs.
International students in Korea are not limited to the
major "SKY" universities (Yonsei now has several thousand
international students in a dozen different programs) or even
other Seoul universities like Sogang University (803 international
students) or the University of Seoul (178 international students)
but are found in provincial universities as well, with large groups
of international students now attending universities such as
Kyungpook National University (1103 international students),
Pusan University of Foreign Studies (456 international students),
Dong-Eui University (330 international students), and the
University of Ulsan (242 international students). Even a smaller
provincial university opened at the behest of President Chun Doo
-hwan i n the 1980s, Daej eon Uni versi ty, now has 109
international students. This June when a group of American
153
international educators visited KAIST, the Korean Advanced
Institute of Science and Technology, the university emphasized
the value of the excellent international students who are enrolled
in the degree programs of KAIST, learning about Korea' s
advanced science and technology. Indeed, with the decline of the
college-age population in Korea and the tendency of Koreans to
go overseas for graduate study, many Korean institutions are
discovering (as U.S. universities have discovered before them)
that international graduate students, particularly in science and
engineering, make the difference between a weak department
and a strong graduate program.
Government policy has also played an important role in
increasing the number of international students. While most of
the actual program management is handled by the individual
universities, changes in government attitude have had a major
effect on the campus atmosphere toward international education
and have given encouragement to campus initiatives for the
growth in the number of international students. In 2004 the
Ministry of Education and Human Resources Development
promulgated the "Study Korea Project," which signaled a
fundamental change in many decades of Korean government
policy towards international education. The Study Korea Project
sai d speci fi cal l y and emphati cal l y, "the focus of Korean
governmental policies regarding international education is geared
to 'recruiting foreign students to Korea,' rather than sending
Korean students abroad." As part of this new model of in-bound
international education, the Ministry set a goal of having 50,000
With the growth in the number of international
students in Korea there has been a matching and
equally important growth in the profession of
"international educational administrator" in Korean
universities.
154
international students in Korea by the year 2010.
In August, 2008, what is now the Ministry of Education,
Science and Technology had to set a new goal of 100,000
international students by the year 2012, because the old goal of
50,000 had already been met in 2007, three years ahead of
schedule. The Republic of Korea government has not only made a
dramatic change in policy regarding international education, it is
backing up the new policies with funding. Korean universities are
to be given grants to help them in offering more courses taught
in English and more Korean-language preparatory programs for
international students. Government scholarships are to be
increased again, from a low level of 50 per year before the Study
Korea Program began in 2004 to as many as 3000 by the year
2012. Korean Education Centers to encourage "Study in Korea"
are being opened in China, Vietnam, and the Philippines.
With the growth in the number of international students in
Korea there has been a matching and equally important growth
in the profession of "international educational administrator" in
Korean universities. Ten years ago the "international" function of
many Korean universities was handled by a single staff member
at a desk in the university planning office, functioning as
international secretary and protocol officer for the university
president. Now every Korean university has a real international
office with staff. Because of the Korean administrative system,
the majority of the policy-makers in such international offices
are faculty members who are serving only two-year terms while
remaining in their academic departments.
These faculty members have universally received their
doctoral degrees from overseas universities and are therefore
sometimes quite comfortable internationally, but their limited
two-year commitment to international education makes it
difficult for international programs in Korean universities to
maintain continuity or achieve professionalism. Since most
Korean government ministers serve in their positions even less
155
than a year, the government is in no position to offer such
continuity or international professionalism on behalf of the
universities.
Professionalism is found instead at the university staff
level, the non-teaching staff who do the majority of the day-to-
day management and program administration for international
offi ces. Ten years ago i t was extremel y di ffi cul t to fi nd
competent international people who were fluent in a foreign
language and who could serve at the staff level. Today such
people are on the staff of every Korean university, mostly young
staff members (though some are already in their 40's) who have
studied foreign languages, traveled overseas, learned the needs of
international students, and grown in their specialized profession
as international administrators.
Fulbright Korea has promoted the growth of such staff by
its support of the "International Education Administrator" (IEA)
program, which each year sends a small number of Korean
international office staff members to visit American universities
and learn from their American international office counterparts.
International students
experiment in the “Auto ID
Lab,” a high-speed data
transmission lab at the
Information and
Communications University.
156
Such staff members return to help their universities do a better
job in recruiting, orienting, retaining, and helping international
students. They also form the core of KAIE (Korean Association of
International Educators), a professional group of international
staff members in Korean university international offices. The
several hundred members of KAIE provide each other with
training in international program administration, orientation, visa
processes, study abroad issues, housing, communications, and all
the myriad other issues that must be solved for any country to
receive international students.
There are many other examples of internationalization that
could not have been found ten years ago. For example, one
major conference for international education is the annual
"NAFSA" conference in the U.S., where over 8000 people,
representatives of international offices of universities around the
world, gather to meet and learn from each other and arrange
study abroad programs. In 1990 there was not a single Korean at
the NAFSA annual conference, and even in 1998 there were only
a few Korean educators in attendance.
At the 2008 conference the number of Koreans at the
NAFSA conference had grown to over 100, with more than 40
separate Korean universities sending representatives or staffing a
booth in the conference exhibition hall in Washington, D.C.
Koreans now attend other educational conferences around the
worl d, i ncl udi ng KASCON (Korean Ameri can Student
Convention), EAIE (European Association of International
Educators) and the Study Korea recruiting fairs held throughout
Southeast Asia.
Particularly in the last decade, Korea has begun in a
serious way to welcome the world's frogs, to recruit
and teach international students and to develop a
broad range of two-way international programs.
157
An excellent example of the complete role reversal of
Korea from a learning country to a teaching country can be seen
in the number of Christian missionaries going in and out of
Korea. For a century, foreign missionaries came to Korea to
teach, and Korean Christians learned. As the Korean church grew
under the religious freedoms of the Republic of Korea, the
number of foreign missionaries declined dramatically. As the
Korean economy grew under the economic freedoms of the
Republic of Korea, the ability of the Korean church to support
Korean missionaries grew dramatically. Now Korea is a country
sending 15,000 missionaries overseas, second only to the United
States as a sending country. Not all learning is in an academic
context, and again in this case people around the world are
learning from Korea.
As a further indicator of Korea teaching the world, Korean
faculty teach at a great number of major educational institutions
around the world. I used to visit universities in the United States
to arrange exchange programs for Korean students. I found that
every college and university I visited in America had Korean
professors on the faculty, not only teaching Korean culture and
language, but in business, science, engineering and other fields.
While some of those Korean faculty had lived in the U.S. for
years, in the last decade there has been a dramatic growth in
requests from American and world universities for Korean faculty
to teach in their growing Korean studies programs. Korean
studies as an academic field has become important around the
world, and the need for professors of Korean studies has
outgrown the supply.
In a final example of "learning from Korea," consider one
small program of Fulbright Korea. The Fulbright program in Korea
has for many years sent Korean scholars to the U.S. for study and
research, and brought American scholars to Korea to teach, but
that somewhat "developing nation" model has in recent years
given way to a balanced model where not only do American
158
students and scholars come to Korea to learn, but Korean
professors are sent by Fulbright to American universities to
teach. Korea has much to teach, and the world has discovered
that there is much to learn from Korea.
Conclusion:
It is always satisfying to see Korea's development and economic
growth; Korea is a rich country now, within the ranks of "rich
countries" by every guideline including the United Nations'
ranking of national economies. As Korea is now a rich country, it
is symbolic and appropriate that the international relationships
of its university education system should change from an
emphasis on one-way study abroad to a two-way mutual
exchange of learning, an exchange of people and ideas with other
countries to the benefit of both. Many Koreans will no doubt still,
like the frog in the well, leave Korea to see and learn from what
the world has to offer. But Korea also has much to offer the
world. Particularly in the last decade, Korea has begun in a
serious way to welcome the world's frogs, to recruit and teach
international students and to develop a broad range of two-way
international programs.
The Korean economy has been successful internationally
for many years; Korea's higher education institutions are now
Foreign exchange students
and Korean students study in a
library in Yeungnam
University.
159
becoming successful internationally as well. The success of
Korean students in world universities, the success of Korean
faculty teaching in world universities, the success of Korean
professional international staff in managing international
programs, the success of Korean universities in attracting
international students, all these mean that Korea is in the process
of aligning its international educational practices with world
needs and standards. With such alignment and development,
Korea can indeed, now and in the future, teach the world.
160
I
n the last sixty years, Korean artists have made an important
contribution to our understanding of art and culture in a
changing world. Today, perhaps more than ever before, these
artists are receiving the international attention they deserve.
They have been able to achieve this due to their own individual
creati vi ty but al so because of the i nfrastructure for
contemporary art in Korea one of the most extensive in the
region. This includes 25,000 students enrolled at art schools, 12
museums showing contemporary art, 30 contemporary art
spaces, 3 biennials and 300 commercial galleries. This ecology of
arts organizations supported by the public and private sector has
provided a substantial platform for Korean artists.
When we think of important Korean artists it is always a
difficult task to single out some over others. However, two artists
who immediately come to mind as having enormous influence
over their generation are Nam Jun Paik (b.1932-2006) and Lee U
Fan (b.1936). Both forged their careers in Korea and abroad
beginning in the 1960s and are considered key art historical
figures. Few other artists in Asia have benefited from this
recognition. They paved the way for a younger crop of artists
who burst onto the international stage in the late 1990s when
the art world became more internationalized. Artists Kim Sooja,
Lee Bul , Atta Ki m and Do Ho Suh have become regul ar
participants in the increasingly complex international art circuit.
Korea’s international presence was forged with the
establishment of a national pavilion at the Venice Biennale
thirteen years ago. This provided a significant opportunity for
E
D
U
C
A
T
I
O
N
,
C
U
L
T
U
R
E
A
N
D
T
H
E
A
R
T
S
KOREA
Impossible to Possible
Korean Fine Arts
161
international audiences to see Korean art in an international
context. These exhibitions have included works by Michael Joo
and Bahc Yiso. The development of home-grown biennials in
Busan, Gwangju and Seoul where international art is imported
for l ocal audi ences has been si gni fi cant to a domesti c
understanding of contemporary art. For some years, Korea
played host to the most biennials in any Asian nation.
Korea has long been known as one of the most “wired”
countries in the world. With access to new technologies, artists
are able to play one of the leading roles in creating art that
forges a relationship with technology. Media City Seoul allows us
to see this first hand while individual artists, U Ram Choe, Jun
Bum Park, Jung Yeondoo and Young-Hae Chang are gaining an
increasing amount of international attention for their work in
this field. Contemporary alternative art spaces are also more
numerous in Seoul than in any other Asian city. Spaces such as
Ssamzie, Pool and Loop have played a role as incubators for
artistic experimentation for over a decade now.
A
sia Society’s first exhibition of Korean art was in 1968 and
we have continued to show traditional and contemporary
Korean art over the decades. Recognizing the importance of
Korea within the region, Asia Society launched a center in Seoul
this year-- one of ten centers in the United States and Asia. We
are looking forward to developing a presence in Korea that allows
us to discuss both Korea and Asia’s importance in the twenty-
first century.
Melissa Chiu is Museum
Director of the Asia Society in
New York where she has
worked since 2001.
Previously, she was Founding
Director of the Asia-Australia
Arts Centre in Sydney,
Australia(1996-2001).
As a leading authority on
Asian contemporary art, she
has curated nearly 30
exhibitions and has published
extensively in the field.
Her recent book is Breakout:
Chinese Art Outside China,
Charta, 2007. She has been a
visiting professor at the
Graduate Center, CUNY and
Rhode Island School of
Design as well as lecturing at
numerous American
universities including
Harvard University.
Melissa Chiu
Korea’s international presence was forged with the
establishment of a national pavilion at the Venice Biennale
thirteen years ago.
This provided a significant opportunity for international
audiences to see Korean art in an international context.
162
T
he rise of Asia in the late 20th century has been seen mostly
in economic terms the strength of its manufacturing
industries, a demand for infrastructure development, the
emergence of a middle class, increasing disposable incomes, vast
consumer markets and greater trade flows. These factors have all
characterised Asia as the continent of the 21st Century. (think Pokemon for starters); Hong
Kong action films (Jackie Chan, John Woo, Jet Li among others);
and Korean TV soap operas have all found international
audiences. More recently Hong Kong movie stars have been
followed to Hollywood by Korean stars like Rain (in Speed Racer)
and Yunjin Kim (in the very popular Lost television series).
“Asian faces have been on the rise for awhile,” notes Chris
Lee, previously president of Sony’s Tristar Studio and producer of
Superman Returns (2007) and the Tom Cruise film, Valkyrie
(2008). “I actually believe video games with their largely
Asian looking character faces have changed the perception of
what the hero and heroine are supposed to look like. Hollywood
is increasingly looking for stars who matter in foreign territories
to put in their movies.”
Hong Kong cinema dominated the Asian industry in the
1980s but when its markets declined in the 1990s, its talent
E
D
U
C
A
T
I
O
N
,
C
U
L
T
U
R
E
A
N
D
T
H
E
A
R
T
S
KOREA
Impossible to Possible
Korean Cinema
163
either went to Hollywood or the industry re-invented itself using
the mainland Chinese hinterland to go global, a process that took
almost a decade to succeed (largely with Hong Kong producer
Bill Kong initiating a series of historical action epics with
Crouching Tiger, Hidden Dragon, Hero and others). As Hong
Kong cinema re-strategized, a “new” Asian film industry emerged
Korea.
Korea has a long and rich tradition of filmmaking, notably
with Na Woon-gyu's Arirang that initiated the “golden age of
silent cinema” in the late 1920s; and between 1955-1969 when
the filmmaking center of Chungmuro was vibrant, and movie
companies and stars drove the industry. These were the years of
the “greats” Kim Ki-young ised, cosmopolitan society. Their
filmographies, like the studio directors of Hollywood, Hong Kong
and Japan, are prolific. Im Kwon-taek for example, completed his
one hundredth film last year.
While the foundations laid by this “golden age” were
eroded by stricter government requirements in the 1970s, the
ground was cleared for a new cinema during the reforms of the
1980s. The censorship system was liberalized to gradually
Roger Garcia was director of
the Hong Kong International
Film Festival and is now a
writer, producer and film
festival consultant. He has
been published by Variety,
Far East Economic Review,
Film Comment, Cahiers du
Cinema and the British Film
Institute among many others.
As producer he has worked
in Hollywood, U.S. television,
and on independent films in
Asia. He is program
consultant for film festivals
in the United States and
Europe.
Roger Garcia
The years 1996 - 2000 cannot be underestimated in their
importance. From the establishment of the Pusan International
Film Festival in 1996 (now the major film festival in Asia), to the
first films by a battalion of young directors,
Korean cinema has been in the ascendant.
164
remove strictures on political expression, and the closed
distribution system was opened up to more foreign imports
while retaining a screen quota system for local products. During
this decade, Korean cinema began to attract notice on the
international scene. For example, Im Kwon-taek’s Mandala
(1981) and other films were shown at international film festivals
throughout the 1980s.
In the transitional era of the late 1980s and early 1990s,
filmmakers like Jang Sun-woo and Park Kwang-su provided the
first step towards the new Korean cinema. Park’s Chilsu and
Mansu (1988) expressed frustrations with contemporary society
and its references to political prisoners and arranged marriages
were ground-breaking.
Just one decade separates Chilsu and Mansu from Shiri but
the difference seems like light years. In Shiri the depiction of
North Korean terrorists departed from the usual stereotypes and
reflected the new freedom to discuss sensitive political issues.
Equally important, Kang Je-gyu’s film proved that the local
industry could produce a well-made action thriller comparable to
some Hollywood products. In 1999, Shiri was the biggest box
office hit to date with 6.2 million admissions nationwide. This
A crowd of people mill around
the stage at Haeundae Beach
in Busan for the 11th Pusan
International Film Festival.
165
was well above the previous local and foreign box office record
holders, Im Kwon-taek’s Sopyonje (one million) and Titanic (4.7
million). With Shiri we witness the maturing of an ambitous
industry.
T
he road to Shi ri had i ts ups and downs, but what i s
remarkable in this journey through the 1990s was the
industry’s resilience. It rebounded from an all-time low of 16% of has
been in the ascendant.
Tom Quinn, Senior Vice President of New York-based
Magnolia Pictures (U.S. distributor of several landmark Asian
films including Thai actioner Ong Bak and Bong Joon-ho’s all-
time Korean hit The Host) believes, “The real watershed moment
for Korean cinema was at the turn of the millennium when four
unique and different filmmakers emerged as major talents. They
were Lee Chang-dong with Peppermint Candy, Kang Je-gyu with
Shiri, Park Chan-wook with JSA, and Kim Ki-duk with The Isle.
Within a two year period each of these films found both critical
and financial success domestically, as well as abroad. While other
territories such as Denmark have managed similar feats in recent
memory, Korea’s success was something far more stellar.
Overnight it had become a self sustaining territory with the kind
of box office that could maintain a multi faceted industry with
166
an ability to cater to the mainstream, as well as push the
aesthetic envelope. It was an entire industry with stars, auteurs,
themes, genres.”
Unlike their immediate predecessors, these filmmakers
were striving to make personally ambitious films with a
commerci al appeal . Mark Si egmund of the Seoul Fi l m.” A new society was
emerging in Korea, one that had been through the IMF crisis
and its cinema was now focused not so much on the past as on
the future.
Maggie Lee, Asia Chief Critic at the respected trade journal
Hollywood Reporter looks at the regional popularity of Korean
cinema at this time in the perspective of Hong Kong cinema.
“Most pioneers of the Korean Wave grew up watching Hong
Kong films of the golden ‘80s, so there are actually recognizable
elements in those films that the Hong Kong and Taiwanese
audience could identify with. At the same time, Hong Kong was
Kim Ki-duk’s film, “Spring,
Summer, Fall, Winter and
Spring” (2003), opens the
Gwangju International Film
Festival.
167
only making safe bets like triad and cop films, so the variety of
Korean genres filled a vacuum. Korean lifestyle and youth culture
as seen through the movies seemed so fresh and cute. Korean
romantic comedies like My Sassy Girl, Bungee Jumping Of Their
Own and love stories with a fantasy twist, like Il Mare, Ditto
were very popular. There are many reasons for this. The scripts
were real l y ori gi nal , and the budgets were much hi gher
compared to what Hong Kong companies would spend on
romance or melodrama. Korean stars were not only gorgeous,
they really had charisma and acting chops.”
As interest in these high quality productions increased,
local sales companies such as Mirovision sprung up. Korean films
could now be aggressively marketed as distinct product rather
than sold through foreign intermediaries. At the same time the
Korean Motion Picture Promotion Corporation which had been in
operation since 1973 was re-structured and re-named the
Korean Film Council..
The years between 2001 and 2006 are marked by films
that broke box office records and expansion into regional
markets. Kwak Jae-yong’s My Sassy Girl (2001) was a romantic.
168
comedy based on an internet novel. It recorded a high 4.9 million
admissions at home and then became a very big hit around Asia,
catching a craze for all things Korean in the region and a total
box office of U.S.$26 million, including U.S.$14 million in Hong
Kong, a staggering amount for the small territory. That same
year, Friend recorded 8.2 million admissions and a total
box office revenue of U.S.$44 million, a record until The
Host in 2006.
The blockbuster hits made the Korean cinema seem
unstoppable. Silmido (2003), a thriller about the training of a
group to assassinate North Korean president Kim Il-sung in the
1960s was the first film to cross 10 million admissions. In early
2004, it vied with Kang Je-gyu’s Korean War actioner, Tae Guk
Gi. Stars and advanced special effects helped bring its total ticket
sales to almost 12 million.
S
uccess
U.S.$10 million overseas, an international record until The Host.
The industry hit its high point in 2005 and 2006. 2005 is
remembered for the record volume of foreign sales as film
exports totalled some U.S.$76 million. Japan accounted for
U.S.$60 million of those sales and Korean films came only second
Korean films for most of these years had now
captured 50% to 60% of the local market, beating
Hollywood for the first time in decades. Helped by
the new multiplexes that had been built around the
country, revenues between 1999 and 2003 more than
doubled from U.S.$276 million in 1999 to U.S.$671
million in 2003.
169
to Hollywood in the number of foreign films released. The
dramas A Time to Remember (2005) and Hur Jin-ho’s April Snow
(2006) each earned U.S.$26 million at the box office in Japan.
Maggie Lee of The Hollywood Reporter distinguishes
between audiences in Japan and the rest of the region, and
emphasizes the importance of Korean TV dramas. “While
supporters of the Korean Wave all over Asia were young
audiences, in Japan it is predominantly middle-aged housewives
who were and are still hooked on Korean (TV) drama. The films
that did well in Japan were usually ones which starred their
favorite soap heroes, like Bae Yong-jun or Lee Byun-hyun or
Won Bin.”
Could 2006 top even the balmy days of 2005? The answer
came early in the year with gay menage-à-trois period costumer
The King and The Clown which set a record of 12.3 million
admissions. However that record did not last long when the
summer release of Bong Joon-ho’s mutant monster movie The
Host set a new record of 13 million tickets. At this point, Korean
films commanded a box office share of around 65% of the
domestic market, one of the highest in the world.
Korean films for most of these years had now captured
50% to 60% of the local market, beating Hollywood for the first
Movie poster of The Host and
Secret Sunshine.
170
time in decades. Helped by the new multiplexes that had been
built around the country, revenues between 1999 and 2003
more than doubled from U.S.$276 million in 1999 to U.S.$671
million in 2003.
There seemed to be no end to the creativity of the
industry’s talents. Stars like Jeon Do-yeon, Bae Yong-joon and
Lee Byung-hun were established in their careers and their
popularity was spreading. Moon So-ri won a best actress award
at the Venice Film Festival for her stunning portrayal of a woman
with cerebral palsy in Lee Chang-dong’s Oasis (2002). Korean
films were also doing well on the international film festival
circuit. Bong Joon-ho’s police procedural Memories of Murder
announced a distinctive talent., vi sual l y exci ti ng wi th an i coni c
performance by Choi Min-sik, the film was at that time the most
talked about Korean film around the world.
Despite these successes however, the downturn began in
2007. The inflow of capital into the film industry led to higher
production but lower returns as more films competed for
exhi bi ti on space. Japanese ci nema had al so ramped up
production, making some 600 films in 2006. With so many local
films looking for release in Japan, there was little space for
To date The Host remains
the most successful Korean film
ever with a box office gross of around U.S.$90 million
of which about one-third is from international.
171
Korean films and the bottom fell out of that market. To cap it all,
the screen quota system was reduced from 106-146 to 73 days a
year for local films. The downbeat mood was compounded by
the 2007 release of the English language monster movie shot in
Los Angeles and Seoul, D War (aka Dragon Wars). Though
successful at home, its performance overseas was disappointing.
But there is still good cause for optimism. The 2008 release
of Kim Ji-woon’s The Good The Bad and The Weird could be seen
as one step out of the doldrums. Its updating of a 1960s’ Korean
sub-genre of Manchurian westerns is a smart move to create a
fast moving, witty action film that could appeal to commercial
Western audiences (whose taste in Asian cinema is mostly
action) but whose main target is the Asian region. With its China
locations, mix of Hong Kong action style and Italian spaghetti
western rambunctiousness, and popular stars, it exists as
exciting a piece of filmmaking as anything done in the world of
cinema today.
Korea’s impressive track record on the international film
festival circuit continues. In 2008 for example, Hong Sang-soo’
Night and Day competed in the Berlin international film festival,
while Lee Chang-dong’s Secret Sunshine won best actress award
for Jeon Do-yeon at the Cannes International Film Festival.
O
verseas, The Host did well in the most difficult market, the
U.S.. Tom Quinn of Magnolia Pictures had to face the
conundrum that as a foreign film with subtitles, The Host was in
the art house category where the audience is averse to genre
fare. And young genre movie fans in the U.S. rarely watch foreign
subtitled films. “So instead of trying to sell the most valuable
genre element the monster to what would’ve been an
unreceptive theatrical audience,” Quinn explains, “we focused
most of our campaign on the critical acclaim and a story about
family. So we were actually able to sell the film theatrically as an
art film. Consequently it performed like an art film, almost out
172
grossing Kim Ki-duk’s Spring, Summer, Fall, Winter and Spring
for the top North American spot for any Korean film of all time.
Because of the solid theatrical gross we were then able to
position the DVD across all major retailers and solicit a younger
audience who buys DVDs. It was essentially a two-prong sell.” To
date The Host remains the most successful Korean film ever with
a box office gross of around U.S.$90 million of which about one-
third is from international.
Moreover, the intrinsic values of Korea’s films and industry
bode.
Chris Lee explains, "It has not been lost on Hollywood that
Korea is now the Number Five territory in the world in terms of
box office. When you compare the kind of returns seen by local
Director Park Chan-wook wins
the Grand Prix award for "Old
Boy" at the Cannes
International Film Festival.
173
movi es l i ke The Host and Ki ng and the Cl own, Korean
productions whether they become remakes or are made as
co-productions are just part of Hollywood's relentless pursuit of
emerging markets."
The Korean film industry has indeed come a long way. The
advances of the past decade in particular have given the nation
an industry whose business and creativity have earned the
respect and recognition of the international community. The
Korean film industry is on.
174
O
ne of the joys of living in a democracy derives from the
fact that all citizens have the ability to look back at their
country’s history and render their personal verdicts on what have
been the successes and failures of past leaders, both civilian and
military. Of all the countries in Asia, citizens of the Republic of
Korea do this most freely and fully. This is a healthy and
constructive process, and collective judgments on past leaders
tend to change with the passage of time, the accumulation of
factual knowledge, and the gradual fading of prejudice or bias.
Having been invited to write an article on some aspect of
the Republic of Korea’s first 60 years, I have chosen to write on
the presidency of Roh Tae-woo, because from my foreign
perspective he deserves a more sympathetic and positive
evaluation than he has thus far received from his fellow citizens.
In 1987, the heavy-handed presidency of Chun Doo Hwan
was coming to an end. Violent street demonstrations took place
demanding that future presidents be elected directly by popular
vote. The country wanted an end to military leadership and
manipulated elections. President Chun arranged for Roh Tae-
Woo, a former general, to be the nominee of the ruling party.
Shortly thereafter, in late June 1987, Roh made a speech that
signaled the end of authoritarian rule in Korea. Roh stated that
the Korean people, for the first time since the presidential
election of 1972, would be able to vote directly for their
candidate of choice.
As a presidential candidate, Roh was opposed by Kim Dae-
jung and Kim Young-sam, both popular civilian leaders. Neither
I
N
T
E
R
N
A
T
I
O
N
A
L
R
E
L
A
T
I
O
N
S
KOREA
Impossible to Possible
Ties with the Eastern Bloc:
The Presidency of Roh Tae-woo
(1988-1993)
175
of these opponents was willing to support the other’s candidacy,
and so a close, three-way election took place. Roh won by a very
narrow margin, gaining only 36.6 percent of the total popular
votes. Roh’s election in the fall of 1987 was thus not particularly
popular the stream of public sentiment was running rapidly
toward full civilian leadership but here was one last general to
be contended with for five years.
As president, Roh moved quickly to change the atmosphere
in South Korea. Press censorship diminished rapidly, and the
national focus shifted to the 1988 Olympic Games, which ran
peacefully and efficiently in a variety of handsome sites along
the Han River. South Korea’s international image suddenly
changed from that of a country constantly threatened by war to
a place where major international conferences and festivals could
be successfully planned and executed.
In establishing his administration at the Blue House, Roh
made a key decision that was central to many of the successes
he achieved in his presidency. He appointed as his national
security advisor Kim Chong-hwi, an American-educated professor
at Korea’ s Nati onal Defense Uni versi ty. Ki m was hi ghl y
intelligent, an astute observer of the international scene, and a
man who had the full confidence of his president. President Roh
kept Kim in place for his entire five year term. This gave Roh’s
foreign policy a sense of direction and continuity that has not
been matched by some of Korea’s other presidents.
The highly successful 1988 Olympic Games brought home
to the Roh administration a deep anomaly in South Korea’s
Donald Phinney Gregg served
as the U.S. Ambassador to
Korea from September 1989
to 1993. While ambassador,
his efforts were directed
toward helping the U.S.-
Korea relationship mature
from a military alliance into
an economic and political
partnership. Gregg was also
active in support of U.S.-
Korea business activities. In
August 1982, he was asked
by then Vice President
George Bush to become his
National Security Advisor,
supporting the Vice President
in the areas of foreign policy,
defense and intelligence.
During his service with Vice
President Bush, Gregg
traveled to 65 countries
including Korea. . In March
1993, Gregg retired from a
43-year career in the United
States government to
become the president and
chairman of The Korea
Society.
Donald P. Gregg
Roh decided to make central objectives of his presidency the
establishment of diplomatic relations with all his neighbors,
entry into the United Nations, and the start of some sort of
dialogue with North Korea.
176
international position. Many of the countries that were happy to
send their athletes to compete in Seoul did not recognize South
Korea diplomatically. Neither China nor the then-Soviet Union
recognized Seoul, and only one country from Eastern Europe had
an embassy in that city. South Korea was not a member of the
United Nations, nor was North Korea, and China had been
adamantly opposed to Seoul’s entry into UN membership.
Roh decided to make central objectives of his presidency
the establishment of diplomatic relations with all his neighbors,
entry into the United Nations, and the start of some sort of
dialogue with North Korea. Former German chancellor Willy
Brandt was a greatly admired figure in South Korea, and his
astute diplomatic maneuvers in bringing about the establishment
of diplomatic ties between East and West Germany had been
closely observed. Brandt had called his diplomacy “Ostpolitic,”
and Roh, tipping his hat to Brandt, called his plan “Nordpolitic.”
In October 1989, former chancellor Brandt paid his first
and only visit to South Korea. As a German he was deeply
interested in South Korea’s status as part of a divided people. He
spoke freely and fully about his policy of “Ostpolitic,” in which he
sought to establish relations with members of the Warsaw Pact,
before directly reaching out to East Germany. I am certain that
Brandt’s visit was a real inspiration to President Roh and his key
Roh Tae-woo and Boris
Yeltsin, former presidents of
Korea and Russia, during a
Korea-Russia Joint
Conference.
177
advisors as they sought to gain recognition from North Korea’s
neighbors and supporters, just as Brandt had done in seeking to
establish better relations with East Germany.
Brandt visited the DMZ on the last full day of his visit, and
at dinner that night was visibly shocked by what he had seen
earlier in the day. Describing the DMZ as “a time warp,” Brandt
said he felt that it was a far worse barrier than the Berlin Wall.
He said, “we hate the wall, and draw graffiti on it, but at least we
can pass through its gates, and television and telephone lines are
not blocked.” Brandt was of the opinion that Korean unification
would be a more difficult and demanding process because the
DMZ was such a hermeti c barri er than the German
reunification process would be after the removal of the Berlin
Wall. Brandt was immediately asked when he thought the Berlin
Wall would come down. His response was short and direct: “not
in my lifetime,” he replied. In fact the Berlin Wall came down less
than 60 days later. I believe that seminal event also contributed
to President Roh’s determination to pursue “Nordpolitic” with
the greatest possible speed.
A
key ingredient in implementing “Nordpolitic” was the
strong support President Roh received from U.S. President
George H.W. Bush. The two presidents first met in October 1989
in Washington, D.C., and their relationship got off to a strong
start. Roh was anxious to gain diplomatic recognition from the
USSR and China, and important groundwork was laid during that
October meeting. President Bush had met Soviet President
Gorbachev several years earlier and had a well-established
relationship with him. He was also fully familiar with the Chinese
leadership, due to his previous service in Beijing and later trips he
had made while serving as vice president. Bush was fully
supportive of Roh’s objectives. The two presidents respected
each other and also enjoyed playing tennis together.
On June 4th 1990, President Roh met President Gorbachev
178
in San Francisco, at a meeting that President Bush had helped to
arrange. Two days later, Roh met with Bush in Washington to
discuss further diplomatic steps to be taken. As a result, Seoul
and Moscow announced formal di pl omati c rel ati ons on
December 30, 1990. Chinese recognition of South Korea followed
in 1992, again with strong American support. Washington also
worked to get the Chinese to drop their long-standing opposition
to either North or South Korea joining the United Nations. Both
Koreas are now active UN members.
M
y term as U.S. ambassador to Seoul started in September
1989. One month after my arrival, six Korean college
students broke into the embassy residence, and did extensive
damage before being arrested by Korean police. The students
were acting in protest against American pressure to open the
Korean beef market to foreign imports. (This is still a difficult
issue 19 years later.) This incident sensitized me to the volatility
of student protests in Korea, as did the fact that the threat of
student ri ots prevented me from ever maki ng a publ i c
appearance on a Korean university campus during my entire tour
of duty as ambassador. This volatility was attributed by many to
North Korean influence among radical student groups.
I n 1989, South Korea and the U. S. were becomi ng
increasingly concerned about a nascent nuclear weapons
program in North Korea. In discussions with national security
advisor Kim Chong-hwi, it became clear to us both that the
unacknowledged but widely known presence of U.S. tactical
nuclear weapons in South Korea would make it very difficult to
pursue a policy of denuclearization in North Korea. We both
recognized that as soon as pressure was applied to North Korea
about its secret nuclear weapons program, the presence of U.S.
weapons in the South would become an issue. The U.S. had a
long-standing policy of “neither confirm nor deny” (NCND)
regarding all nuclear deployments, but this would have been
179
utterly useless in the face of the determined student protests
that would be certain to arise. I knew, from long association with
the U.S. military, that we would not move any weapons system
under pressure from a foreign country, and informally asked Kim
if he thought that his government might agree to the idea of
removing the U.S. weapons before they became an issue. After
suitable checking at Blue House, Kim replied, equally informally,
that he thought such an idea could be discussed.
A hi ghl y sensi ti ve but extremel y sensi bl e seri es of
discussions then took place over the next several months
i nvol vi ng Bl ue House, the U. S. Embassy, two successi ve
commanders of U.S. Forces Korea, and the Department of State.
All concerned saw the wisdom of removing the weapons ‘ahead
of necessity,’ and all recognized and respected the pragmatism of
their counterparts. The constructive tone of these discussions
was particularly striking to me, as in the mid-1970s I had served
as CIA station chief in Seoul. At that time, Park Chung Hee was
president, and he was losing faith in the U.S.-ROK alliance. Park
had sent over 300,000 South Korean troops to help America in
Vietnam, only to see us withdraw from that tragic war in defeat.
He had real doubts as to our ‘staying power’ in Asia, and as a
consequence had started a secret nuclear weapons program of
his own. It would have been unthinkable at that time to have
even considered discussing the removal of any U.S. weapons
system from South Korea. Park would have taken such an idea as
evidence of the weakness of the U.S. as an ally.
In striking contrast to what Park’s attitude would have
Korea was the most generous Asian supporter of the
Desert Shield/Desert Storm operation, far surpassing
Japan. President Bush extended his personal thanks to
President Roh for extending this vital support to
Desert Storm during a visit to Seoul in early 1992.
180
been, President Roh Tae-woo recognized that our willingness to
discuss with him the issue of nuclear weapons on the peninsula
was a reflection of the strength of the U.S. ROK alliance and an
indication of our trust and confidence in him.
In the fall of 1990, I was able to send a message to
Washi ngton sayi ng that the presi dent of Korea and the
commander of U.S. forces in Korea both recommended the
removal of tactical nuclear weapons from Korea. About twelve
months later, President George H.W. Bush announced that all
U.S. tactical nuclear weapons were being withdrawn from
deployment outside the continental limits of the U.S.
On December 18, 1991, President Roh announced that
there were no nucl ear weapons i n South Korea. Thi s
announcement was made at the same time that North and
South Korea were signing two major agreements; a “Basic
Agreement” designed to open the way to “reconciliation,
nonaggression, exchanges and cooperation,” and a “Joint
Declaration” calling for the denuclearization of the Korean
peninsula.
Inter Korean prime minister
meeting.
181
These two agreements, though neither has been fully
implemented, are still significant parts of the process of healing
between Seoul and Pyongyang and stand as monuments to the
effectiveness and sagacity of Roh Tae-woo’s presidency. During
his tenure, eight inter-Korean prime ministerial meetings were
held, and the prospects of significant North-South reconciliation
reached a higher level than ever before.
P
resident Roh also demonstrated his commitment to the U.S.-
ROK alliance by the strong support he extended to the U.S.
as it prepared to expel Iraq from Kuwait in 1990. During “Desert
Shield,” the long logistical build-up to the U.S. attack on Iraq,
Korea was the first foreign nation to offer a commercial airliner
to be used in transporting U.S. troops to the battle zone. Korea
also offered generous financial support to the costly U.S.
operation and sent a significant detachment of non-combat
troops once the actual fighting (“Desert Storm”) began in
January 1991. Korea was the most generous Asian supporter of
the Desert Shield/Desert Storm operation, far surpassing Japan.
President Bush extended his personal thanks to President Roh for
extending this vital support to Desert Storm during a visit to
Seoul in early 1992. The two presidents showed great respect
and affection for each other in their final meeting as presidents
of their countries.
By the end of Presi dent Roh’ s term as presi dent,
Nordpolitic had succeeded beyond all expectations. Russia, China
and virtually every country in Eastern Europe had recognized
Seoul. Russian President Boris Yeltsin came to Seoul shortly after
President Bush’s visit and opened a new era in relations between
Seoul and Moscow. Just before he left office, President Roh
convened a Blue House meeting for all of the newly-arrived
ambassadors. He was generous enough to include me in what
was a very gracious and substantive meeting that typified to me
President Roh’s highly effective presidential style.
182
When one thinks over the Republic of Korea’s first sixty
years, it is striking to calculate the number of key events that
took place during President Roh’s term in office. The Olympics
were successfully conducted and vastly enhanced Korea’s
international reputation. American tactical nuclear weapons were
quietly removed from South Korea, enhancing the chances for
improved North-South dialogue. Russia, China and many Eastern
European countries established embassies in Seoul. Both North
and South Korea joined the United Nations. Relations between
North and South Korea achieved new levels of mutual agreement
that was translated into exchanges. Lastly, Korea enhanced its
standing as a strong U.S. ally by its exemplary support to Desert
Shield/Desert Storm.
Why then, is president Roh held in such low esteem today
by the South Korean people?
A major contributing factor is that both president Roh, and
his predecessor, Chun Doo Hwan, were jailed during the
presidency of Kim Young-sam for financial irregularities
particularly the accumulation of huge ‘slush funds’ during
their presidencies. Roh was far more contrite than Chun when he
went to jail, which may contribute to the general feeling among
Koreans I have talked to that he was weak or indecisive. Chun,
who remains in vigorous good health, and moves around the
country with a large entourage, tipping lavishly, and acting
presidential, remains a far more popular figure than Roh, who has
not been in good health for the past several years.
It is very difficult for a foreigner to completely fathom why
Koreans feel as they do about their presidents. The answer lies in
While I am not at all confident in assessing why Roh
Tae-woo is not more respected than he is, I feel quite
confident in asserting that over time his standing in
the history of modern Korea will rise significantly.
183
the hearts and minds of the Korean people, and they have never
been asked in a systematic way to express their feelings. My
central speculation about Roh’s lack of popularity centers on the
fact that the Korean people find him to be an anomalous figure.
He was a general, elected at a time when Koreans were yearning
for civilian rule. This placed a cloud over Roh’s presidency from
its very beginning. But then, Roh did not act like a general. He did
not shout or bluster, and stressed the powers of diplomacy in his
Nordpolitic Policy. There were no major crises during Roh’s
presidency. Relations with Washington were excellent, and
Korea’s economy continued to expand. The election of Kim
Young-sam, in late 1992, ran smoothly, and the transition from
mil itary to civil ian rul e in South Korea was successful l y
completed.
O
ne of Roh’s major achievements as president was the
progress made toward reconciliation with North Korea,
which had reached a high water mark at the end of 1991.
Tragically this progress was not maintained. The key to the
been the cancellation of the 1992 Team Spirit training exercise.
This annual spring exercise, which the North Koreans feared and
resented, involved sending thousands of U.S. troops to South
Korea where training exercises were held to repel a simulated
North Korean attack on the South. At the annual Security
Consultation Meeting held at the Pentagon in the fall of 1992,
the Team Spirit exercise was reinstated for March 1993. This
decision was immediately denounced by North Korea, and the
pace of North-South contacts slowed dramatically. Kim Young
Sam, inaugurated in February 1993, quickly gave indications that
he would take a somewhat harder line toward North Korea than
had President Roh. The following month, North Korea went on a
‘semi-war’ footing when Team Spirit was held, and on March 13,
1993, Pyongyang announced that it was withdrawing from the
184
Nuclear Nonproliferation Treaty. North-South relations steadily
worsened until mid-1994, when only the emergency visit of
former President Jimmy Carter to Pyongyang averted a major
military crisis. North Korean leader Kim Il Sung died shortly after
Carter’s visit, and Kim Jong-il’s accession to power ushered in a
new chapter of North-South relations with which President Roh
had no direct connection.
I believe that these events now serve to obscure from
Koreans’ collective memory the great progress that was made
between Seoul and Pyongyang during President Roh’s presidency.
Koreans now remember the ‘Sunshine policy’ of Kim Dae-jung,
and the first North-South summit meeting held in June 2000.
While I am not at all confident in assessing why Roh Tae-
woo is not more respected than he is, I feel quite confident in
asserting that over time his standing in the history of modern
Korea will rise significantly. South Korea’s rise from ‘economic
basket case’ to one of the top-dozen economies in the world has
come so quickly that it is still difficult to sort out the policies and
South and North Korean
players hold a unification flag
after a scoreless exhibition
match in Seoul.
185
people who have made the most significant contributions to this
astonishing process. As time passes, and perspectives lengthen, I
am sure that Roh Tae-woo will come to be seen as a quietly
effective president who smoothly sheparded Korea from military
to civilian rule, strengthened the U.S.-ROK alliance and left his
country in far better shape than it was when he took office.
As an admiring foreigner who has been in contact with
Koreans since 1952, I believe that the three presidents who have
done most to bring South Korea to its present powerful position
are Park Chung Hee, Kim Dae-jung and Roh Tae-woo.
186
T
he Republic of Korea was born as an unlucky country. After
the brutal Japanese occupation, which lasted from 1910 to
1945
1
and the immensely destructive Korean War, few would
have expected South Korea to emerge as an economic miracle.
But it did and is now widely admired and respected all over the
world for its economic achievements. However, the paradox of
South Korea is that it is both one of the strongest and also one of
the most vulnerable countries in the world. The goal of this essay
is to try and understand this paradox and to suggest how Korea
might overcome this paradox.
The overwhelming strength of South Korea is in the
economic field. One of the comparisons I frequently make is
between the Philippines and South Korea. In the 1950s, the
Philippines was seen as the great hope of Asia. It had a close
relationship with America, access to American markets and a well
educated elite. By contrast, South Korea was seen as a basket
case and doomed to eternal poverty. Hence, the conventional
wisdom of that era predicted that Philippines would emerge as
an economic success story.
Instead, the exact opposite happened. Some simple
statistics illustrate well how dramatically the fortunes of South
Korea and the Philippines have reversed. In 1960, the GDP of
Philippines was U.S.$6.9 billion while that of South Korea was
U.S.$1.5 billion. The GDP of the Philippines was almost five times
larger. By 2007, the respective figures were U.S.$ 144.1 billion
and U.S.$969.8 billion. The South Korean GDP had become
almost seven times larger. What happened? Why did South
I
N
T
E
R
N
A
T
I
O
N
A
L
R
E
L
A
T
I
O
N
S
KOREA
Impossible to Possible
The Paradox of Korea:
Strong Yet Vulnerable
187
Korea succeed when the Philippines failed? The reasons are too
complex to be explored in a brief essay like this but a few
examples can be mentioned. South Korea had to fight for its
survival while the Philippines did not have to. South Korea faced
the constant threat of a North Korean invasion. But there were
also deeper reasons. The Philippines’ elite which controlled most
of the land and wealth, was more interested in protecting its own
welfare rather than the welfare of the population. By contrast,
South Korea undertook key land reform programs in 1945 and
1950
2
and in doing so created an economy that benefited both
the elite and the masses. In addition, as the distinguished
Harvard scholar, Ezra Vogel, pointed out in his famous study of
the four tigers,
After World War II, only the governments of South Korea
and Singapore consciously studied the Japanese experience in
detail, but the main outlines of the Japanese strategy were well
understood by all four of the little dragons. They all knew that
Japan began with labor-intensive industries and used the income
from exports in this sector to purchase new equipment, while
upgradi ng i ts trai ni ng and technol ogy i n sectors where
productivity gains would allow higher wages. They all saw the
crucial role of government in guiding these changes. Having the
Japanese model provided both the confidence that they too
Kishore Mahbubani was
appointed the first Dean of
the Lee Kuan Yew School of
Public Policy on 16 August
2004. Currently, he is the
Dean and Professor in the
Practice of Public Policy at
the Lee Kuan Yew School of
Public Policy (LKY SPP) of
the National University of
Singapore. He served in the
Singapore Foreign Service
from 1971 to 2004. He was
Permanent Secretary at the
Foreign Ministry from 1993 to
1998 and he also served
twice as Singapore’s
Ambassador to the UN.
Kishore
Mahbubani
By contrast, South Korea was seen as a basket case and
doomed to eternal poverty.
Hence, the conventional wisdom of that era predicted
that Philippines would emerge as an economic success story.
1
Source:
2
Source:
188
could succeed and a perspective on how to proceed. (Vogel 1991,
91)
3
Leadership was also a key factor. While South Korea is
understandingly questioning the legacy of President Park Chung
Hee it is also clear that a lot of the rapid growth took place under
his stewardship. The Korean economy grew at an average of 9.3
per cent per annum
4
during the period of his presidency from
1962 to 1979. By contrast, his equivalent in the Philippines,
President Ferdinand Marcos, emerged as a powerful symbol of
what incompetent rule looks like. Both he and his wife were
reported to have amassed huge fortunes which were kept
overseas and never invested in the Philippines.
With hindsight, the rapid economic development of South
Korea seems almost inevitable. But it is vital to remember how
weak and vulnerable Korea seemed in the early years. In The
Koreans, Michael Breen describes a foreign scholar’s conversation
with Korean students in the 1980s: “There weren’t many
foreigners on campus and people always asked me where I was
from and what I was studying. I’d say, ‘I’m studying Korean
thought’ and they’d give me a puzzled look and say, ‘But we have
no thought.’”
I was personally present and indeed fought for South
Korea’s cause when South Korea was diplomatically weak and
experienced one of its most humiliating diplomatic defeats. This
happened at the Summit Meeting of the Non-Aligned Movement
(NAM) in Sri Lanka in August 1976. The Cold War was then at its
peak. Both the United States and the Soviet Union were
competing for global influence. NAM, whose membership
With hindsight,the rapid economic development of
South Korea seems almost inevitable.
But it is vital to remember how weak
and vulnerable Korea seemed in the early years.
189
comprised most third world countries, was one vital arena where
the competition took place. As part of the Cold War competition,
both South and North Korea sought membership in NAM.
After protracted negotiations, NAM reached a consensus
that both North and South Korea should be admitted in Sri
Lanka. However, the pro-Soviet members of the movement were
cleverer than the pro-American members of the movement. They
sai d that both shoul d be admi tted sequenti al l y and not
simultaneously, and in alphabetical order, namely Democratic
People’s Republic of Korea (DPRK) followed by the Republic of
Korea (ROK).
In good faith, the pro-American members accepted the
compromise. Hence, DPRK was admitted as a member first.
However, as soon as it was admitted, DPRK (as a member)
immediately objected to ROK’s admission. This was a clear act of
duplicity. When Singapore tried to protest loudly against this
duplicity, a senior Tanzanian official who chaired the meeting
(and who may have been an accomplice to this duplicity),
refused to even allow Singapore to protest. Others tried to
protest also and failed. Some day, South Korea should try to
recall and remember those who tried to help it when it was
relatively weak. Gratitude is not the norm in international affairs
but South Korea could try to defy the norm.
Fortunately, South Korea had the last laugh in international
recognition in standing and prestige. The country that was
refused entry into NAM became the second East Asian country
to be admitted into the Organization for Economic Cooperation
and Development (OECD) in 1996. The OECD does not really do
that much but admission into its ranks is nonetheless a global
3
Vogel, Ezra F. 1991. The Four Little Dragons: The Spread of
Industrialization in East Asia. Cambridge, MA: Harvard University Press.
4 Source:
190
recognition that the country has arrived. Very few countries
today can ever dream of being admitted into the OECD. The fact
that South Korea was admi tted was i ndeed a maj or
accomplishment.
S
imilarly, South Korea’s ability to become the second Asian
country to host the prestigious Olympics in September-
October 1988
5
was also a clear signal that South Korea had
arrived as a member of the first league in international rankings.
The games were a great success. With all these international
accomplishments, it is not surprising that South Korea is
recognized as one of the strongest countries in the world. How
then can it be perceived as one of the most vulnerable countries
of the world?
The meaning of this paradox may become clearer when
one looks at South Korea’s most recent major international
accomplishment: the election of Ban Ki-moon as the UN
Secretary-General in 2006. The UN made an excellent choice in
choosing him. He is a brilliant and accomplished diplomat.
A cultural promotion project
between Korea and the
Association of Southeast Asian
Nations (ASEAN).
191
However, having served as Ambassador to the UN for over ten
years, I also know that permanent members of the UN Security
Council have a firm policy of never electing UN Secretary-
Generals from strong countries as a representative from a strong
country could be less pliable to their dictates.
This international weakness of South Korea springs from
the geopolitical constraints it faces. The continued division of the
Korean peninsula represents probably the last living legacy of the
Cold War era. Many expected that with the collapse of the Berlin
Wall and reunification of Germany, Korea would also be reunified
soon. However, after almost two decades, the reunification of
Korea seems less and less imminent. It is true that having
watched the costs of German reunification, South Korea is also
worried about the financial costs of reunification. But even if
South Korea decided today that reunification was desirable, it is
not certain that it would happen soon.
The Korean Peninsula, which was a geopolitical pawn for
most of the 20th Century, continues to remain a geopolitical
pawn even though the geopolitical context has changed
significantly. In the early phase of the Cold War, the Soviet
Union and China supported North Korea and America supported
South Korea. Things changed after the Sino-Soviet split emerged
but during the Cold War, this gave North Korea an additional
advantage as it could play the Soviet Union off against China.
Fortunately, all the great powers wanted stability on the Korean
peninsula. This allowed South Korea to enjoy rapid economic
growth under a stable geopolitical architecture.
In the post Cold War era, North Korea should have
emerged as a loser. It lost one patron, the Soviet Union. Then, in
a humiliating blow to North Korea, China established diplomatic
5
1988
192
relations with South Korea on 24th August 1992 while North
Korea failed to gain a similar breakthrough with America.
However, the isolation of North Korea also forced it to turn to
desperate measures, including exploring the nuclear option. In
1994, the U.S. came close to bombing North Korea. This could
have sparked a major war in the Korean peninsula. Fortunately,
wiser heads prevailed in Washington D.C.
There is no doubt that South Korea enjoys enormous
respect and standing in Washington D.C. Its success is also
greatly admired. But it is also true that no great power puts the
interest of its smaller ally ahead of its own interests. Indeed, the
strategic concerns of small allies are often ignored. The Bush
Administration demonstrated this clearly on 29th January 2002
when President Bush made his famous speech about the “axis of
evil”. Initially, he wanted to name three Islamic countries in this
axis, namely Iran, Iraq and Syria. But he was advised to include a
non-Islamic country. Hence, as an afterthought, North Korea was
included in the axis of evil and Syria was dropped.
S
ome day, South Koreans should do some intensive research
to find out whether any policymaker in Washington D.C.
seriously thought of the implications for South Korea when
President Bush decided to mention North Korea. Did anyone
mention to him that he could endanger South Korea? It is likely
that no one did. If so, it illustrates well how South Korea can
become an inadvertent geopolitical pawn because the remark
triggered a new crisis in the Korean Peninsula without South
Korea being consulted.
There is also no doubt that in the geopolitical contest
between South and North Korea, South Korea is far more
powerful. Many view North Korea as a potential failed state. Yet,
with very few diplomatic cards, North Korea has often played its
cards brilliantly and occasionally it has made Washington D.C.
dance to its tune. This takes great skill. What is remarkable is
193
how the Bush administration, which adopted a belligerent
attitude toward North Korea, began to realize that its only
options were diplomatic after North Korea detonated a small
nuclear device on 9th October 2006.
The new geopolitical contest developing in the world will
be between China and America. No one can tell how this contest
will play out. Will America allow China to emerge peacefully (as
Germany and Japan did after World War II) or will it try to
contain China (as it did with the Soviet Union)? The likelihood is
that it will be a mix of both elements. When this happens, the
Korean Peninsula will occupy a permanent place in the new Sino-
American geopolitical chessboard.
Fortunately, some geopolitical events have also worked to
the benefit of South Korea. The biggest recent geopolitical
accident was the 9/11 attack on America. When that happened,
America shifted its strategic sights to the Islamic world and
China became a huge geopolitical winner. But China also used
this geopolitical window brilliantly to prove its usefulness and
relevance to America. One key area where the Bush Administ-
ration has truly appreciated the help of Beijing was on the
Korean Peninsula. Many senior American figures recognize that
the recent breakthroughs in the discussions with North Korea
could not have happened without China’s help. To reciprocate
the goodwill, Washington D.C. was happy to apply pressure on
President Chen Shui Bian of Taiwan who was aggravating Beijing
with his pro-independence tendencies.
Hence so far, the recent positive trends in Sino-American
Some day, South Koreans should do some intensive
research to find out whether any policymaker in
Washington D.C. seriously thought of
the implications for South Korea when President Bush
decided to mention North Korea.
194
relations have been beneficial to the Korean Peninsula. After the
crises in 1994 and 2006, the situation on the Korean Peninsula
looks relatively stable. But there is a lot of wisdom contained in
an ancient Sri Lankan proverb: “when the elephants fight, the
grass suffers but when the elephants make love, the grass also
suffers.” As the Korean Peninsula represents some valuable grass
in the current geopolitical competition, it is vital for South Korea
to pay careful attenti on to every twi st and turn i n the
geopolitical games involving America, China, Japan and lately,
Russia again. In the economic field, South Korea remains strong
but in the geopolitical sphere, it remains vulnerable. The
challenge for South Korea in the future is to manage this
paradox.
South Korea will have to continue its recent record of
ski l l ed di pl omacy as a new geopol i ti cal game emerges.
Fortunately, South Korea enjoys good relations with both
Washington D.C. and Beijing. The good relationships enabled
South Korea to pull one of its successful diplomatic coups: the
simultaneous admission of China, Taiwan and Hong Kong during
South Korea’s chairmanship of APEC in 1991. As an APEC senior
official then, I remember being amazed that South Korea could
pull this off.
One of the cardinal rules of good diplomacy is that it is
good to have maximum number of options. This should be one
of South Korea’s key goals to help compensate for its geopolitical
vulnerability. Hence, despite the troubled history of Japan-Korea
relations, it would be wise for South Korea to keep relations with
Japan on an even keel. This creates an additional diplomatic
option. ASEAN provides another equally valuable diplomatic
option.
Many Koreans are puzzled by ASEAN’s diplomatic success
and pay far less attention to ASEAN than they do to European
Union. In doing so, the Koreans fail to understand that ASEAN
can be far more valuable to South Korea than the EU can be. The
195
EU is an economic giant but it is a geopolitical dwarf. Witness
the failed record of the EU in North Africa, the Middle East, the
Balkans and the Caucasus. By contrast, ASEAN is an economic
dwarf but a major geopolitical actor. Since South Korea’s
vulnerabilities are in the geopolitical and not economic areas,
ASEAN can be more useful to South Korea than the EU.
S
outh Korea has paid some attention to ASEAN but it has
never ranked it as a major diplomatic priority. By nature, the
Koreans respect strength, not weakness. Hence, they find it
difficult to respect ASEAN. But the paradox here is that ASEAN’s
strength lies in its weakness. ASEAN’s relative weakness enables
it to be seen as a non-threatening partner by all major powers,
including America, China, India and Japan. Hence, all the major
rising powers are happy that ASEAN provides the only credible
diplomatic platform for all great powers to meet in the Asia-
Pacific regions.
China is clearly the most powerful skilled geopolitical actor
in the world today. It runs circles around the other great powers.
Participants at the ASEAN Plus
Three (Japan-China-Korea)
forum pose for a photograph.
196
One sign of its geopolitical competence was its early recognition
of the strategic value of ASEAN. Hence, China became the first
great power to propose, negotiate and conclude a Free Trade
Agreement with ASEAN. All this was done in record time.
Japanese diplomats told me that this stunning diplomatic
achievement by China came as a “bolt from the blue” to Japan.
South Korea could also try to match China’s geopolitical record
by working for an equally close relationship with ASEAN.
Recently, Australia made a foolish proposal to bypass ASEAN in a
new Asia-Pacific arrangement. This demonstrated how poor the
geopolitical thinking is in Canberra as compared to Beijing.
The poor geopolitical thinking in Canberra also illustrates
well another geopolitical challenge that South Korea faces. With
its membership of OECD, South Korea has also become a virtual
member of the Western community. This membership brings
many global rewards but it also brings geopolitical risks. The
geopolitical thinking in the West ignores one major reality: we
South Korea’s main challenge is to display
the same exceptional skill in the geopolitical arena
that it has demonstrated in the economic sphere.
Korean enterprise in China.
197
are reaching the end of the era of Western domination in history.
Hence, there have been many Western geopolitical failures, in
Afghanistan and Iraq, the Middle East and Georgia. There will be
significant cultural pressures upon South Korea to follow the
Western lead on many geopolitical issues. But in geopolitics,
geography trumps culture. One of the delicate balancing acts
that South Korea will have to manage is between the cultural
pulls of the west and the geographical pulls of the east.
Despite these many challenges, I remain confident that
South Korea will do well. By any standards, South Korea has
emerged as one of the most successful countries in the world.
Success does not come easily. It is a result of hard work and
exceptional skills. South Korea’s main challenge is to display the
same exceptional skill in the geopolitical arena that it has
demonstrated in the economic sphere.
198
T
he people of South Korea are not alone in believing that
perceptions of global security have changed radically over
the past 20 years.
1
The Cold War bipolar system gave way to an
early post-Cold War upsurge in both internal conflicts and in
attention to conflict management. In the immediate post-Cold
War peri od, the worl d’s attenti on shi fted from tracki ng
superpower rivalry, counting nuclear warheads and arguing over
“Star Wars” (as U.S. President Ronald Reagan’s Strategic Defense
Initiative was called in the press) to witnessing regular outbreaks
of civil war on nearly every continent. Global security was
redefined in regional, local or functional terms, and the tasks
undertaken to provide security widened to protecting civilians
from massacre from their own governments as well as shoring up
weak or failing states. Security became increasingly divisible. This
period was followed in turn by a short interval of successful
international peacemaking just prior to the events of 9-11. The
experiences in Mozambique, Cambodia, Bosnia, and Northern
Ireland seemed to argue for a strong role for outside third parties,
often identified simply as the “international community,” in
helping to settle internal conflicts and to guarantee settlements
between states as well.
After the 9/11 attacks on the United States, and the
ensuing reprisal against Afghanistan and the invasion of Iraq by
the U.S. and its allies, there was a partial return to the concept of
global security focused on counter-terrorism and coping with
failed (or failing) states, which were viewed by many as breeding
grounds for terrorists, dealers in weapons and drugs, and other
I
N
T
E
R
N
A
T
I
O
N
A
L
R
E
L
A
T
I
O
N
S
KOREA
Impossible to Possible
Global Order and the
Future of Regional
Security
199
international miscreants. At the same time, there was a growing
awareness of the potentially destabilizing effects of poverty,
trade and investment, nation-building, disease, climate change,
and loss of biodiversity, and increasing support for including
these issues, as well as issues affecting human security, as factors
in global security. For Asia’s leaders, including Korea’s own
leadership, many of these broader security issues have long been
a continuing source of preoccupation and concern alongside
more “traditional” kinds of security threats.
With these changes has come lively debate about the locus
of capacity and legitimacy in global security affairs. Given an
environment of ever-broadening security challenges as well as
fresh questi ons about the sustai nabi l i ty of successful
peacemaking, there is mounting concern about the availability of
leadership and resources to counteract and manage conflict at
the regional as wel l as national and gl obal l evel s in the
international system. This issue is especially pertinent at a time
of preoccupation and reappraisals in the U.S., Canada, Britain,
Australia, and other global security providers as a result of the
heavy costs of the Iraq and Afghanistan conflicts and related
instability in Lebanon, the Palestinian territories, and Pakistan. In
Fen Osler Hampson is a
professor at the Norman
Paterson School of
International Affairs at
Carleton University in
Canada. Hampson has
taught academic courses on
international affairs at
Harvard, Georgetown and
Carleton Universities. He has
also served as a fellow at the
United States Institute of
Peace, Carnegie Endowment
for International Peace and
done consultancy work on
the War-torn Societies
Project for the United
Nations.
Fen Osler
Hampson
For Asia’s leaders, including Korea’s own leadership,
many of these broader security issues
have long been a continuing source of preoccupation
and concern alongside more “traditional” kinds of security
threats.
1 This discussion paper is based on the work of an ongoing research project
on Regional Security Capacity and Global Conflict Management, which is
supported by the Norman Paterson School of International Affairs,
Carleton University, the International Development Research Centre in
Ottawa, and the United States Institute of Peace in Washington, D.C.
200
particular, the prospect of a U.S. reassessment of its priorities and
potential retrenchment from overseas burdens under a new U.S.
administration, which will take office in January 2009, raises the
question of what alternative sources of leadership may assert
themselves at the global, regional and sub-regional levels. Such
alternatives could potentially take advantage of potential
security vacuums that might emerge or, more likely, simply
develop their own trajectories independent of and without
reference to the values and preferences of the leading nations of
the Atlantic Alliance. Russia’s recent invasion of the territory of
Georgia/South Ossetia is a case in point. The Western alliance
can no longer take its primacy for granted as great power politics
reasserts itself in Russia’s relations with its immediate neighbors.
At the same time, the global ‘order’ based on key bodies
such as the UN system and the Bretton Woods institutions is
challenged by old charters, outdated leadership roles, normative
disharmony, and lumbering bureaucracies. These bodies face
existential challenges to their authority and even survival while
the global security field is increasingly crowded with other actors
so-called coalitions of the willing, new collective defense and
collective security bodies, non-official actors, private security
companies, and long-standing regional organizations focused on
The Six-Party Talks
(2008.7.12). Envoys to the
North Korean nuclear talks
meet in Beijing.
201
economi c i ntegrati on, securi ty cooperati on and confl i ct
management. Several recent reports have noted the downward
trend in the outbreak and lethality of warfare.
2
As welcome as
these trends are, they may obscure another circumstance: the
persistence of conflicts some quite low-level in various
parts of the world, for instance Afghanistan-Pakistan, Sudan and
its neighbors, Iraq, Iran, the Great Lakes region of Africa, and the
ongoing tensions (albeit somewhat reduced as a result of recent
progress in the six party talks) in the Korean Peninsula.
For several decades now, the Korean conflict has been
characterized by what some call a “cold peace.” At one level, the
key interests of North and South Korea are not as contradictory as
they once were and the risks of war have been substantially
reduced by improving relations between the two countries. For
many outsiders, however, the reality of a peaceful vision of the
future continues to remain elusive and many aspects of the
conflict largely remain “intractable.” The problem is not simply one
of settling the current conflict or addressing “legacy” issues of the
past, but also of determining North Korea’s own future, how to
check the proliferation of weapons of mass destruction, and chart
a course towards a new regional security order meets a number of
core objectives: the prevention of future crises that could lead to
war on the Korean Peninsula, the prevention of the instabilities
resulting from the collapse of the North Korean regime, and the
prevention of nuclear proliferation on the Korean Peninsula.
Towards the end of the 1990s, U.S. and South Korean
policies appeared to move generally in the same direction as the
Clinton Administration tried to engage North Korea’s leaders in
dialogue and diplomacy. However, there was a clear divergence
2
Mack, Andrew, ed., Human Security Report 2005 (New York, Oxford:
Oxford University Press, 2005). Hewitt, Joseph, John Wilkenfeld, and Ted
Robert Gurr, Peace and Conflict 2008 (Boulder, CO: Paradigm Publishers,
2007).
202
in policies during the early years of the administration of
President George W. Bush. President Bush went out of his way to
di stance hi msel f from pol i ci es of the previ ous Cl i nton
administration which had worked closely with South Korean’s
leaders to engage North Korea. In labeling North Korea’s regime
as part of an “axis of evil” alongside Iraq and Iran, U.S. relations
reached an all time low. But the deep chill in U.S.-North Korean
relations moved closer to room temperature towards the end of
the Bush presidency as the six party talks with North Korea
gained momentum and North Korea agreed to freeze its nuclear
program. However, U.S. demands that Pyongyang verify its
commitments to suspend plutonium reprocessing remain a
serious point of contention and there is always the risk that
relations could quickly deteriorate if either side fumbles.
U
nlike some other parts of the globe, the continued U.S.
military presence and strategic alliances with key countries
in the region, like South Korea and Japan, are positive and
stabilizing and generally seen to be so. The United States is an
important counterweight to China’s rapidly growing military and
economic clout and muscle. And if Russia, which is clearly
beginning to flex its own muscles, starts to play a greater
geostrategic role in northeast Asia, including on the Korean
Peninsula, the U.S. presence is likely to be even more critical to
regional stability. Even so, there will continue to be some tension
between the U.S. view of the requirements for stability and local
views, especially those states in the region who aspire for greater
regional control or influence over how security challenges are
defined and responses organized. Invariably, some countries in
the region may feel that they have a better understanding of
conflicts in their regional neighborhood. Another factor may be
the selective attention to Asia-Pacific regional security issues by
the United States in recent times a trend that may continue
with the next U.S. administration.
203
U.S. engagement with the security challenges of the Asia-
Pacific region, including Northeast Asia, is also likely to remain
hostage to continued U.S. preoccupation with the politics and
security of the Middle East, the Persian Gulf, and Afghanistan.
Neverthel ess, i t wi l l be i mportant for the next U. S.
administration to reinforce its security commitments in the Asia-
Pacific region and to remain fully engaged in the ongoing six-
party talks with North Korea. At the same time, the new U.S.
administration will have to be sensitive to regional aspirations
and concerns by strengthening diplomatic dialogue with key
countries in the region, including South Korea, encouraging
regional actors to define their own priorities, and supporting the
design and development of regional institutional mechanisms
and norms for managing the region’s security challenges. Over
10 years ago, two leading American political scientists, David
Lake and Patrick Morgan, argued that regions had become more
salient as components of international politics; the post-Cold
War period offered an opening to more cooperative regional
orders; and in dealing with the world’s regions, powerful states
had to recognize that regions are different and require foreign
policies tailored to those differences.
3
More recently, others have
asserted that security threats are regional rather than global, and
that the identification of threats comes from within societies and
states rather than from a global or out-of-region origin.
The stark reality is that security challenges on the Korean
Peni nsul a have both regi onal and gl obal i mpacts and
consequences. These and other continuing challenges in the
Northeast Asian region invite a combination of both regional and
global efforts at conflict management in which the United States
and its key allies are fully engaged and committed players.
3 David A. Lake and Patrick M. Morgan, Eds., Regional Orders: Building
Security in a New World (University Park, PA: Pennsylvania State
University Press, 1997).
204
T
he historian C.V. Wedgwood once remarked, “We know the
end before we consider the beginning, and we can never
wholly recapture what it was to know the beginning only.”
I offer my comments and conclusions as one who was
present at the embattled beginning of the Republic of Korea
(ROK), and blessed, thus far, to see its present circumstances and
future promise. In undertaking this consideration of “Korea’s
Growth at 60 Years as Seen from Abroad,” I acknowledge that I
am a soldier. In this light I view Korea at 60.
As I complete this appraisal, contemporaneous events
attesting to the often termed miraculous survival and record
shattering successes of the Republic of Korea are handily
available: hour by hour Korean athletes triumphantly mount the
dais in Beijing and the proud strains of Aegukka waft through the
capitol city of an ancient regional foe of thousands of years, as
other regional powers and allies watch, or, occasionally, share in
Gold, Silver, and Bronze awards.
Broadening the horizon beyond China and the 2008
Olympics, the Secretary General of the United Nations, Ban Ki-
moon, is an honored Korean; the recently elected President of
the ROK, Lee Myung-bak, is the former head of one of the
world’s leading industrial and commercial firms, presiding over a
nation which leads the world in shipbuilding, electronics, and
peacekeeping operations. He proposes imaginative breath-taking
commercial projects on a scale of multi-continental land-linking
from the English Channel to the Port of Busan. Astronaut Yi So-
yeon returned from the orbiting Space Station in April. There is a
I
N
T
E
R
N
A
T
I
O
N
A
L
R
E
L
A
T
I
O
N
S
KOREA
Impossible to Possible
Korea’s Growth Seen from
Abroad:
Successful Nation-Building
205
revival of pride among the citizens of South Korea. And, the
citizens of South Korea continue to charitably feed and sustain
fellow Koreans enslaved in North Korea.
In contrast, the Democratic People’s Republic of Korea
(DPRK) remains bankrupt, starving its population, with the single
accomplishment of having exploded a nuclear device built in
large part directly proportional to the emaciated bodies of its
starving citizenry.
I spent thirteen months in the 1950-53 phase of the Korea
War, four years in the Vietnam War
1
, three years in Border
Patrol and security missions in the Federal Republic of Germany
while it was in the first decade of recovery from the destruction
which it brought upon itself in World War II, and, in all, many
years overseas in Cold War locales.
Within the past decade I was finally able to formalize the
question which first partially arose in my mind, in Vietnam, in
1975: the United States had spent eight times or more of our
national treasury, two to three times and many lives (our most
precious resource), and very nearly four times as much time
involved in assisting the Republic of Vietnam as we did in
assisting the ROK. Yet, in 2008 the Republic of Vietnam no
Louis Tarleton Dechert, Sr.,
is a former President of the
National Korean War
Veterans Association. He
retired from the United
States Army, in the rank of
LTC, in 1973. Dechert began
his Army career in 1950
leaving college to enlist in
the U.S. Army early in the
Korean War. Years later he
graduated with a BA from
Park College, an MBA,
Industrial College of the
Armed Forces, and was
accepted for the PhD
program in Latin American
Studies, of the University of
Texas. Dechert’s exemplary
Army career spanned
twenty-three active duty
years while he valiantly
served his nation.
Louis Tarleton
Dechert, Sr.
Yet, in 2008 the Republic of Vietnam no longer exists
and the Republic of Korea is a leading world nation,
one committed to freedom and democracy.
1 In my last tour of active combat duty I was the G3 for the 1st Field Force
Vietnam (IFFV), with the ROK forces contingent under operational
control. Thus I was able to see the transformation of the ROK Armed
Forces and observe them as one of the elite combat forces to serve
Freedom in the Vietnam War.
206
longer exists and the Republic of Korea is a leading world nation,
one committed to freedom and democracy. What made the
difference? The answer must be: the Korean People. And that is
the major perspective NATION-BUILDING which I follow
in my review of Korea’s Growth Seen from Abroad.
A
n author in 1977 expressed the following thoughts about
the nature and character of the Korean people. “Vigorous
and outgoing, certainly but far more aggressed against than
aggressing. Invaded often, but hardly ever themselves invaders,
the Koreans constitute the classic case of a people of spirit and
individuality boxed in, and battered this way and that, by an
environment and neighbors none of their own making.
“China and Japan have the normal complement of sins to
their records, but surely none are more longstanding in each than
how they have allowed their attitudes to and uses of that
landbridge between themselves, the Korean Peninsula, to traduce
and mulct that peninsula’s people.”
2
One of the world’s most ancient people groups, extremely
cultish, Koreans experienced again and again intrusions, ravages,
and destruction at the hands of traditional regional and territorial
powers of China and Japan as they maneuvered against one
another for dominance. It is entirely probable that a major
The Korean War Veterans
Memorial in Washington,
D.C.’s West Potomac Park.
207
enduring consequence of these happenstances of history
accounts for the modern successes in the building of a new
Korea. Concerning the building of the nation after ca1970, one
historian concludes, “ while they (China and/or Japan) slowly
smothered and finally snuffed out Korean independence, the
Koreans had at l ast begun to devel op a true nati onal
consciousness, the first prerequisite for the building of a modern
state.”
3
At the end of the first three years of the Korea War
4
the
two exhausted parts of the Korean Peninsula (the North and the
South, according to U.S.-USSR agreements,1948) were in
considerably worse condition than they had found themselves in
1948 when the two geographical governments and capitols were
established.
Asi de from physi cal devastati on by the fi re power
expended by the parties to the conflict, millions of Koreans,
North and South, had been killed, hundreds of thousands of
northerners had fled to the South and taken up residence there,
and governmental, educa-tional, medical, financial, diplomatic
institutions and organizational structure, along with virtually all
infrastructure, had been obliterated. In addition, several million
Koreans conscripted for gang labor abroad by the Japanese and
Chinese were still scattered about the Asian world.
2
Michael Keon, Korean Phoenix: A Nation from the Ashes, Prentice-Hall
International, Inc., Englewood Cliffs, NJ, 1977, p. 10.
3
Han Woo Keun, The History of Korea, The Eul-Yoo Publishing
Company, Seoul, 1970, pp. 414-15.
4 Historically, technically, and actually, the Korea War continues
interrupted by a ceasefire. Minimizing or obscuring this fact may severely
handicap any appraisal of what the Republic of Korea has accomplished,
1948-2008. Valid ceasefires are defined by virtually every military
institution in the world as the temporary cessation of hostilities. Fifty-
five years hardly qualifies as temporary. In the Vietnam War, for
example, U.S. Forces observed a Christmas Ceasefire each year, after
1965.
208
The North had the USSR, Communist China, and the
worl d-wi de Communi st Party i n i ts vari ous appl i cati ons
(Comintern
5
and Warsaw Pact
6
, as two examples) to fill the
void. In the South, in the beginning of 1948, the sole assets were
a staunch anti-communist President Syngman Rhee, and the
weak rebuilding process of the ROK Army.
T
wo matters of consequence occurred which, I believe,
formed the basis from which all the elements of today’s
ROK success flow. First, the stubborn Rhee virtually extorted a
promise from the United States in the form of a mutual security
alliance. From this Alliance, still strong and in effect 55 years
later, the rebuilding of the ROK Army proceeded.
The second matter of consequence was initially a concept
of the Americans, later of the UN, and today universally
acknowledged as a key geopolitical concept: the conceptualiza-
tion of undeveloped, third world, and finally developing nations.
After World War I the world expected that the lot of the
inhabitants of each nation would remain, or return to, what it
was before that conflict. However, after World War II, a world
concept, more or less modeled after the American concept,
gradually developed concerning what were initially categorized
as undeveloped nations.
Whatever the evolutions and changes in terminology over
time, the concept has remained and is strong today: each nation
and its people are entitled to develop to their highest potential
and the developed nations have a universal responsibility to
assi st them i n doi ng so. There are numerous regi onal
Right or wrong, and to varying extents,
the fact is that the governments
and people of the ROK and USA exhibit unique
and distinctive relationship characteristics.
209
development, policy, trade, monetary, and aid organizations
modeling assistance from the developed nations of the world
helping those still under development. The UN has several
development agencies also engaged in these enterprises. In fact,
the decade of the sixties was designated by the UN as the
Development Decade.
7
Thus, President Rhee and his scattered supporters were
presented with a nation-developing/building philosophy
(although not characterized by that phrase then or now) which in
ultimate terms would become the channel for the national
consciousness which had evolved through the years of trials and
sufferings undergone by the Korean people.
8
As a later ROK
President would observe, “Our past history seems at first glance
to be more a record of misfortune than glory, but we also find in
our past a strong inspiration, and we value even the misfortunes
for the strong sense of determination they have nourished in our
people’s hearts.”
9
Again, the situation in South Vietnam, at its founding has
been described as “ Korea’s emergence from colonialism was
5
”The Comintern (Com munist Intern ational, also known as the Third
International) was an international Communist organization founded in
Moscow in March 1919. The International intended to fight ‘by all
available means, including armed force, for the overthrow of the
international bourgeoisie and for the creation of an international Soviet
republic as a transition stage to the complete abolition of the State’.”
Wikipedia
6
”Officially named the Warsaw Treaty of Friendship, Cooperation and
Mutual Assistance (Russian:
Translit.: Dogovor o druzhbe,
sotrudnichestve i vzaimnoy pomoshchi), the Warsaw Pact was an
organization of communist states in Central and Eastern Europe.”ibid.
7
Keon, op cit., p. 33.
8
Han, op cit., FN#3.
9
Park, Jung Hee, To Build a Nation, Acropolis Books, Ltd., Washington,
1971, p. 70.
210
an out-of-the-frying pan-into the fire operation; everywhere,
social, administrative, commercial, and industrial vacuum or
destitution prevailed.”
10
In some respects the ROK in July 1953 began again with
some less obvious favorable factors. Rhee’s desperate pragmatic
stubbornness had locked-in American support. American
leadership in the fledgling UN would be an advantage for several
years. In addition, the U.S. initiation of unilateral mammoth
reconstruction programs, such as the Marshall Plan, would
challenge other world powers as well as modeling such assistance
pacts. Thus, the ROK was to undertake the nation-building
process with a reliable source of developed world techniques,
technical assistance, and foreign aid, as well as assistance of all
sorts flowing from the U.S. relationship including military
training, equipping, and assistance.
The author Keon, earlier referenced, has an insight into aid
arrangements which is subtle, but which has been an assumption
for U.S. military assistance since at least 1969. He writes (in
1977), “Because the so-called ‘developed countries’ have been
the overwhelming providers of the materials and expertise (and
even the goals) of development, it is assumed that the power
plants, irrigation systems, and health schemes developed through
Establishment of the ROK-U.S.
Combined Forces Command.
211
such aid must not only imitate those of donor nations, but also
that sociopolitical structures and values within the ‘developing
countri es’ shoul d be much l i ke those of the ‘ devel oped
countries’.”
11
In 1983, as assistance programs for under-developed
nations and developing nations were beginning to gain realistic
momentum, Mr. George Champion, Former Chairman of Chase
Manhattan Bank (1961-1969) provided a comment which I
believe perfectly describes the aptness of the Korean people:
“there are many who believe that money isn’t the primary need
of these countries and that true progress will be made through
improved education and training; the strength of a nation is a
multiple of the character, energy, and ability of its people, not its
natural resources.”
12
R
ight or wrong, and to varying extents, the fact is that the
governments and people of the ROK and USA exhibit unique
and distinctive relationship characteristics.
Human effort can only accomplish so much, never mind
the lofty intentions and human and material resources brought
to the task. In the case of South Korea, the tasks were so
monstrous that even the determined Rhee and his impoverished
citizens, along with their American helpers, could only wrest
minimal progress. It is probable that at the onset they realized
very little of the true magnitude of what they had to accomplish:
Nation-building!
In the years 1953 through to President Rhee’s ejection
from office in 1960, the Korean people worked day and night in
10
Keon, op cit., p. 36.
11
Keon, ibid., p. 7
12
George Champion, Foreign Debts: A Proposal for U.S. Banks, p 28, the
Wall Street Journal, Jan 11, 1983.
212
myriad programs and projects, in virtual misery. And at the end
of the Rhee era they were still among the most impoverished in
the world.
I have been fortunate to have been a frequent visitor to
the ROK and an active participant in many aspects of Korean
government and military life for the past several years. During
this time I was able to talk with Korean men and women from all
walks and professions who lived and worked building their
nation,1953-1960, and later under President Park Chung Hee’s
leadership (1961-1979) actually my contemporaries, albeit
half a world away at the time.
The common thread of remembrance in virtually all of
their comments was of the absolute deadening, mind-numbing
exhausti on of the hard work, the burdens of hours and
exhausting experiences in absolute grinding poverty, seemingly
without end.
D
uring the Korea War period extending from 1950 to 1953,
most of the hard labor in supporting the front-line fighting
forces was performed by men assigned to the Korean Service
Corps (KSC). Almost to a man, American soldiers, airmen, and
Marines still remember and comment on the sheer wearying
stamina of the KSC men equipped with A-frames on their backs
carrying incredible loads up and down the mountains of the
peninsula at all hours in all weather conditions. Many a GI has
remarked about seeing men with A-frames carrying large
refrigerators (or similar loads) on their backs, often at a trot and
uphill!
Those recollections of the Koreans by soldiers fighting the
war best describe the entire nation of Korea, 1953-1979. The
Korean people literally built their nation by the sweat of their
brow and muscle power.
The world still marvels at the labor required to build the
Great Wall of China, the Pyramids of the Nile, and similar works.
213
I suggest that the sheer labor of the Korean people, 1953-1998,
building a leading Nation from virtually nothing, which has
become the envy of much of the world, must also rank as one of
the modern world’s marvels.
Today, I find that many appear to take for granted what
we see Korea 2008 to be oft exclaiming “A miracle!” by
means of explanation. Granting that the Almighty eternally does
miraculous things, Korea 2008 represents what human, Korean,
men and women, did by blood, sacrifice, and terrible demanding
physical effort, during the years 1961-1979 in particular,
marginally assisted
13
by U.S. aid and assistance. The Almighty
worked by creating the national spirit in the individual Koreans
and then providing human leadership equal to the tasks.
Sadly it has been my reasoned observation that the youth
of Korea today have not impressed me as fully realizing and
appreciating what was done by their elders. The on-going
demands of nation-building may come to stultification and the
Republic of Korea may consequently fall into the discard of
nations which tried but failed, for whatever reasons, should this
trend fail to be reversed.
All of my foregoing discussion brings me to conclude my
appraisal discussing the working out and direction of American
military assistance to the ROK and the effects which made
Nation-Building possible.
13
U.S. Aid has never been constant to any recipients due to the annual
appropriate processes of the U.S. Congress and the annual budget
actions of White House Budget officials. Additionally, in Korea 1953-
1954, U.S. Aid initially was a transference/diversion of the military
appropriations already spent or being spent for supporting all of the UN
forces to reconstruction and other aid for the ROK. After 1960, U.S. aid
gradually expanded, plateaued, and then leveled of at a lower level. In
the six decades under review, huge cost increases of military hardware
caused proportionately larger expenditures for fewer total items. In more
recent years, the ROK has undertaken the manufacture of many large
end-item weapons, under contract with U.S..
214
As addressed, there are several characteristics that our two
governments hold in common. In order to provide a better
understanding of the oft inferred stops and starts and detours of
the ROK nation-development, consider the American experience:
“We need to remind ourselves of our own perilous, protracted
effort to implant the torch of liberty in America. We need to
recall that American Colonists began their resistance to harsher
British colonial laws in 1763; that 12 years later the shot rang
out at Lexington; that eight years of bitter struggle followed
before the Treaty of Paris was signed ending the Revolutionary
War; that six more years were consumed in our endeavor to
forge a document of government which has stood the test of
time, including a civil war. It took 26 years to forge our Nation
Freedom worth fighting for is worth the time and tears to
build.”
14
The Republic of Korea has built a Nation comparable to the
United States in some sixty years, accomplishing with U.S.
assistance and support of their nation-building programs and
objectives what it took the U.S. itself over 200 years to
accomplish! Before leaving this point and to reinforce the
concl usi ons to my earl i er questi on WHAT MADE THE
DIFFERENCE? (See discussion, page 200) it was President John
F. Kennedy’s stated objective (to the Special Group Counter-
insurgency,1961) to support the Republic of Vietnam(RVN) to
the extent that the RVN would develop within 40 years to equal
what the U.S. had accomplished in 200 years.
U.S.-ROK nation-building efforts 1950 through 1998
recognized what the U.S.-RVN efforts did not: when nation-
building activities are to be applied in the presence of an active
Too much sunshine results in sunburn, sunstroke,
and possibly heatstroke.
The antidote to those injuries is sun screen lotion.
215
hostile neighboring power, successful progress can only be made
when there is a sufficiently powerful shield of deployed military
strength and police and paramilitary elements including a
national combined intelligence effort.
F
ortunately, during the years 1954-1979, in particular, the
ROK had leaders who recognized that fact. During that span
of time, there were: the so-called Second Korean War (1966-
1969); the attack on the Blue House (President’s Residence) by
North Korean infiltrators across the DMZ to assassinate President
Park (Jan. 17-20, 1968); the Pueblo Seizure (Jan. 23, 1968); the
shooting down of a U.S. Navy EC-121M aircraft over open seas
with 31 U.S. KIA (April 15, 1969); and Operation Paul Bunyan
“Tree / Hatchet Incident” (Aug. 18,1976), perhaps the closest
that the U.S.-ROK-UN Command has come to all-out war since
July 27,1953.
15
During the period 1960-1975 the U.S. was
concurrently engaged in the Vietnam War, as were the Armed
Forces of the ROK for the later part of the period.
On October 9, 1983, an assassination was attempted
against then President Chun Doo Hwan and a large delegation of
ROK Government Ministers during a visit to Rangoon, Burma
(now Yangon, Myanmar). Twenty-one persons were killed and
forty-six wounded. Almost all the killed and wounded were
Koreans. The Korean CIA later established that the assassins were
agents of North Korea. Finally, on Oct. 9, 2006, the North
14
General Harold K. Johnson, Chief of Staff, U.S. Army, Armed Forces Day
Speech, ca1966, message to the Army. Private excerpted copy, Colonel
Louis T Dechert.
15 Major Daniel P Bolger, Scenes from an Unfinished War: Low-Intensity
Conflict in Korea, 1966 -1969, Leavenworth Papers Number 19, Combat
Studies Institute, 1991.
Global Security.Org,
nyan.htm, Operation Paul Bunyan. “Tree / Hatchet Incident” 18 August
1976, Alexandria, VA, current.
216
Koreans exploded a nuclear device, demonstrating a new
dimension of aggression.
16
In more recent years Korea chose leaders who were at the
least partially ill-informed/advised concerning the nature of the
security threats and the active deterrence roles/operations of the
U.S.-ROK-UN Commands. Particularly after 1998 the political
leadership of the ROK became almost myopic in cultivating and
apparently attracting/supporting/serving the North Koreans with
whom the ROK is at war. A visionary policy termed the Sunshine
Policy was announced and applied, often appearing to be anti-
military and anti-U.S..
E
lements of the Korean population, keying on the public anti-
American attitudes of ROK Governmental elements, began
to conduct media events and demonstrations against Americans
and U.S. Forces in Korea. It appears, to many, that the tumult of
that decade of induced anti-Americanism has led to an element
of di srespect for the RVN Armed forces, the uni versal
conscription, and ROK military accomplishments in building and
preserving the nation.
During the Sunshine Policy it would have been well if the
ROK political leadership had learned more about sunshine and
applied that knowledge. Too much sunshine results in sunburn,
British veterans of the Korean
War visit the UN Park in Busan
on the invitation of the Ministry
of Patriots and Veteran Affairs.
217
sunstroke, and possibly heatstroke. The antidote to those injuries
is sun screen lotion. In the nation-building situation in which the
ROK is engaged, the national armed forces and allied forces
provide that sun screen, extending the simile. The recently
elected government of President Lee Myung-bak appears to have
pragmatically learned and is applying that lesson.
Generally nations are built, grow and prosper as Lines of
Communication (LOC) sea, air, river, canals, railroads,
hi ghways, pi pel i nes, power l i nes, radi o, tel evi si on, tel e-
communications expand. That was President Kennedy’s
development plan for the RVN, as noted earlier. In a developing
scenario, 1946 through the present time, many of the under-
developed states start with essentially nothing. Nationally, this
was the case with America, post 1776; and it certainly was the
case of Korea in 1948, and even more so in 1953.
In America, infrastructure development required educated
engineers. Unfortunately all the established higher education
institutions at the time were founded and existed first and
foremost for religious instruction. For this reason the U.S.
Military Academy at West Point was first established. America’s
political leadership realized that educated engineers as well as
other educated skills were essential to development.
Military trained engineers built the LOC, and American
commerce and industry followed. Examples are many. Two might
be easily cited: Lewis and Clark were military engineers, and their
Corps of Discovery was a U.S. Army formation, posted by
President Jefferson to extend American Lines of Communication
west from the Mississippi River to the Pacific Ocean. And, the
16 See FN# 4 and subtended discussion. “While gentlemen cry peace,” the
Korean Peninsula is at peace only in the only most elastic technical
definition of peace. While the ROK longs for peace and reunification and
daily offers acts of good will to fulfill those longings, the DPRK clearly
follows the Communist stated philosophy that peace is only war by
another means.
218
first transcontinental railroad construction and completion,
1853-1869, was constructed mainly by civil war veterans and
their officers, with thousands of Chinese laborers employed on
the west to east construction portion.
The ROK has likewise been well served by the officers and
armed forces trained since 1953 to protect and serve their
nation. Whatever tasks remain for the ROK to forge ahead with
nation-building it may depend upon its armed forces to be
completely equal to the challenges.
I think that the Republic of Korea will survive and thrive
well into the future. The mainstay of that survival, and even of
the possi bl e peace treaty and reuni fi cati on, wi l l be the
professionally trained and equipped ROK Armed Forces who
serve with pride in their great nation. They may be depended
upon as they proved in Vietnam, Iraq, Afghanistan, Lebanon,
and in many other dangerous sites to do their best for the
Republ i c. It has been a pl easure and great personal and
professional reward serving with them.
Several months ago I was moved to provide my vision of
what I then termed The Real Korea War Veterans Memorial. I
close with that vision.
The Republic of Korea today is itself a memorial to
American and Korean sacrifices which is written not in
stone but on living hearts in our flesh and blood, and as
such is the Supreme Korea War Veterans Memorial. For
this reason, if no other, we must take every measure,
devise and carry out every plan, and work until we can
work no longer to build up, then build up again, and then
again, our mutual alliance.
Should our alliance fail because it progressively
grew gray, then feeble, then went on life support, and
finally disappear, then I suggest to you that something of
our mutual national bodies will have died. Something
which has energized us to accomplish the best there is
219
through the past few years will have been excised. And,
just as surely as our physical bodies will perish when the
heart is ripped from them, the very essence of mutual
accomplishment shall leave us, orphans as it were, to try
to make our individual ways — rather than the allied way
— in a hostile world.
Korea is great not because the U.S. is great; the U.S.
is better, or great, because Korea is great. That is the kind
of relationships we have between ourselves and the ROK,
my fellow veterans of Korea. We must preserve, defend,
and ever build higher our relationship.
220
T
he Korean Peni nsul a presents a remarkabl e “natural
experiment” for social scientists. Under Japanese occupation,
some of the most advanced industrial facilities in Asia were
developed in the northern part of the Korean Peninsula; the
south was the breadbasket. At the time of the partition in 1945
into zones of Soviet and American military occupation, in the
north and south, respectively, levels of per capita income and
human capital in the north exceeded those attained in the south.
In 1950, North Korea attacked South Korea in a bid to
forcibly unify the peninsula, drawing the U.S. with the original borders more or
less re-established..
N
O
R
T
H
A
N
D
S
O
U
T
H
,
6
0
Y
E
A
R
S
O
N
KOREA
Impossible to Possible
Inter-Korean Economic
Relations at 60
221
Over the past five decades economic performance in South
Korea has been nothing short of spectacular. Between 1963
when a wide-ranging economic reform program was initiated
and 1997 when the country experienced a financial crisis, real per
capita income growth averaged more than six percent annually
in purchasing power adjusted terms. At the start of that period
the country’s income level was lower than that of Bolivia and
Mozambique; by the end it was higher than that of Greece and
Portugal.
As astonishing as South Korea’s economic performance has
been, its political development has been as impressive, if not
more so: In the space of a single decade between 1987 and 1997,
leadership of the South Korean government went from an
authoritarian strongman (General Chun Doo Hwan) to his
elected but hand-picked successor (General Roh Tae-woo) to an
elected centrist civilian politician (Kim Young-sam) to a former
dissident (Kim Dae-jung). South Korea is arguably the premier
global success story of the past half century.
In stark contrast, North Korea experienced a famine during
the 1990s that killed perhaps 600,000 to 1 million people out of
a pre-famine population of roughly 22 million, making it one of
the 20th century’s worst. This disaster was very much the
product of the country’s political system, an anachronistic
Stalinist dynasty that has systematically denied its populace the
most elemental human, civil, and political rights.
Despite the historic economic integration of the two parts
of the peninsula, for the first half century following partition,
Marcus Noland is a Senior
Fellow at the Peterson
Institute for International
Economics. He was a Senior
Economist at the Council of
Economic Advisers in the
Executive Office of the
President of the United
States and has held research
or teaching positions at Yale
University, the Johns
Hopkins University, the
University of Southern
California and Tokyo
University, etc. He is unique
among American economists
in having devoted serious
scholarly effort to the
problems of North Korea and
the prospects for Korean
unification. He won the 2000-
01 Ohira Memorial Award for
his book Avoiding the
Apocalypse: The Future of
the Two Koreas.
Marcus Noland
The number of South Koreans visiting
the North has grown from less than 3,000
to roughly a quarter-million, though sadly, the number of
North Koreans visiting the South is far, far fewer.
222
economic interaction between North and South Korea was
tightly circumscribed. However, over the past decade, driven by
developments in both the North and the South, there has been a
substantial expansion in inter-Korean exchange. Careful data
analysis suggests that the North Korean economy bottomed out
in 1998 at the end of the famine period, and began a slow
process of recovery from 1999 on.
transfers Mt. Kumgang tourism project and
the Gaeseong Industrial Complex (GIC), were in effect “loss
North Korean laborers
working at a shoe-making
company in the Gaeseong
Industrial Complex.
223du tourism
venture (on the Chinese border) and Gaese. KIC has expanded rapidly,
now housing enterprises employing roughly 30,000 workers, and
is beginning to open to foreign as well as South Korean investors.
Yet even these enclave projects have encountered their share of
setbacks; the operation of the Mt. Kumgang project has been at
least temporarily disrupted by the July 2008 shooting there of a
South Korean tourist.
I off, the Sun uses its
warmth to i nduce the travel er to di srobe. Anal ogousl y,
engagement was originally conceived as an instrument: the point
was to encourage sufficient systemic evolution within North
Korea to establish a meaningful basis for reconciliation and,
224
ultimately, national unification. While this means.
L
ong-term development assistance is a different matter,
however, and pl aci ng a greater emphasi s on pol i cy
conditionality and reciprocity would be warranted. Experience
the world over is that support is most effective when coupled
with domestic reform. In the absence of reform, aid may have
little impact, or may even perversely encourage temporizing
behavior by reluctant authorities.
To the extent that North Koreans have any interactions
225
important to promote this learning and bring the discipline of the
market to the engagement process.
South Korea shoul d commi t to the pri nci pl e. In contrast
to implicit hidden subsidies and political quid pro quos should be
delivered through the public-sector financial institutions, this
approach would be a way to capture the possible social benefits
of engagement with the North on the basis of microeconomic
effi ci ent behavi or of pri vate fi rms. Market-compati bl e
engagement would have the added benefit of encouraging
learning on the part of the North Koreans. The notion that the
road to riches is through the efficient transparent provision of
The notion that the road to riches is
through the efficient transparent provision of services
is a lesson that North Korean officials should be
encouraged to learn.
226
services is a lesson that North Korean officials should be
encouraged to learn.
Lastl y, a successful engagement strategy shoul d-politicized technical assistance
and policy advice, as well as capital. The ongoing Six Party Talks,
if ultimately successful, could spawn regional economics
initiatives as well, including the development of Northeast Asian
transport and energy links, as well as facilitating cooperation on
other transnational issues such as the environment and drug
trafficking, embedding the process of inter-Korean reconciliation
in a broader regional fabric.
A
vi ew regards engagement l ess as a tacti c to achi eve a
transformative goal, than as a goal in and of itself, a stance into
which the Roh Moo-hyun government appeared to drift. The
answer to the question of which of these conceptions of
engagement as a means or as an end prevails in the
coming years, will have a profound impact on not only the
nature of North-South relations, but on North and South Korea
themselves.
From this long-term perspective, the controversies that
have marked the early days the Lee Myung-bak administration
227
and its new “coexistence and co-prosperity” policy should not be
overdone. It is not surprising that the North Koreans have
signaled unhappiness over what they rightly regard as the
hardening of South Korean government policy under the new
government. But engagement should and will continue because
it is consistent with the fundamental interests of both Korean
states. In the South it reflects the strong desire of the South
Korean people to assist North Korea and hedge against the risks
of instability and collapse. And the North, whatever its short-run
tactical maneuvering, will require South Korean support for the
foreseeable future. The current dispute is not over engagement
itself, but the terms on which it will proceed.
Chung Ju-yung, the founder of
Hyundai Group leads a herd of
cattle.
228
W
hen North Korea’s President, Kim Il Sung, died in July,
1994, after ruling with an iron hand for five decades,
South Korea’s business, military and political elite was deeply
divided over how to respond. Hawks argued that the North
Korean system would collapse after half a century of one-man
rule and economic mismanagement. Pointing to the example of
West Germany’s absorption of East Germany, they called for
efforts to destabilize the Communist regime as a prelude to the
absorption of the North by the South. Moderates countered
successfully that a German-style absorption would be too
expensive for the South to bear.
In the ensuing four years, a consensus developed that the
prudent course for the South would be to come to terms with
Kim Il Sung’s son and heir, Kim Jong-il; help him to sustain his
regime economically, and promote North-South economic
cooperation that would gradually make the economic systems of
the North and South more compatible, setting the stage for
eventual reunification on terms acceptable to both sides.
This consensus became the basis for the Sunshine Policy of
President Kim Dae-jung, who took office in 1998, and of his
successor, Roh Moo-hyun, who stepped down in 2007. As
articulated by Kim, the Sunshine Policy would set the stage for
gradual steps toward a loose confederation that would lead, in
time, to full integration of the two systems.
1
However, as the
economic gap between the North and South has widened, hopes
for a German-style absorption of the North have resurfaced in
the South.
N
O
R
T
H
A
N
D
S
O
U
T
H
,
6
0
Y
E
A
R
S
O
N
KOREA
Impossible to Possible
Towards a Stable
Confederacy
229
Roh Moo-hyun, beset with economic problems and facing
opposition to the Sunshine Policy from the Bush Administration
in Washington, failed to move toward a confederation, and the
advent of a new conservative president in 2008, Lee Myung-bak,
has left the future of North-South relations uncertain.
This essay will focus on two critical factors that will
condition the prospects for a confederation leading to eventual
unification: whether or not North Korea will collapse, as the
advocates of absorption predict, and whether South Korea will
maintain a military alliance with the United States that impedes
unification.
I
In predicting a collapse, many observers who compare
North Korea to East Germany ignore the cultural and historical
differences that set the two cases apart. In East Germany, the
Soviet occupation imposed an alien totalitarian model in a
cultural environment more hospitable to democratic concepts. In
Korea, the Confucian ethos and the traditions of absolute
centralized rule that go with it have facilitated totalitarianism in
the North and authoritarian rule in the South. Together with the
power of nationalism, these basic differences explain why the
Selig S. Harrison is a Senior
Scholar of the Woodrow
Wilson International Center
for Scholars and Director of
the Asia Program at the
Center for International
Policy. He has specialized in
South Asia and East Asia for
57 years as a journalist and
scholar and is the author of
five books on Asian affairs
and U.S. relations with Asia.
He has visited North Korea
10 times, most recently in
September 2006. From 1974
to 1996, as a Senior
Associate of the Carnegie
Endowment for International
Peace, he pursued
investigative assignments
every year in a variety of
countries, where he worked
as a journalist, such as India,
Pakistan, Iran, China, Japan
and the two Koreas.
Selig S.
Harrison
In predicting a collapse, many observers
who compare North Korea to East Germany ignore
the cultural and historical differences
that set the two cases apart.
1 Selig S. Harrison, Korean Endgame: A Strategy for Reunification and U.S.
Disengagement, Princeton University Press, Princeton, N.J. 2002, pp. 80-
86, for Kim’s Proposal and a modified version advanced by Roh Tae-woo
for a “Korean Commonwealth.”
230
fate suffered by the East European Communist states is not likely
to be repeated in North Korea.
K
im Il Sung consciously attempted to wrap himself in the
mantle of the Confucian virtues. The tightly controlled
system that he founded has lasted longer than any other
twentieth-century dictatorship because he carried over traditions
of centralized authority inherited from the Confucian-influenced
Korean dynasties of the past. The North’s system is much more
in tune with long-established Korean political norms than the
hopeful democratic transition initiated in 1987 in the South after
three decades of authoritarian rule under Syngman Rhee and a
series of U.S. supported generals.. The
sudden termination of these subsidies following the end of the
Cold War triggered a precipitous decline in the North Korean
Panmunjeom is now ajoint
security area managed by the
UN Command and North
Korean guards.
231
economy that has imposed unprecedented strains on the
political system. As economic hardship has increased, so has a
long-standing policy struggle between pragmatic technocrats
and Workers’ Party ideologues over whether to move toward
market-oriented economic reforms and a liberalization of foreign
economic policy designed to stimulate foreign trade and
investment. The outcome of this struggle and the success of
North Korea i n deal i ng wi th i ts economi c probl ems wi l l
undoubtedly have a critical impact on its political cohesion.
Many predictions of an imminent collapse rest on the
incorrect perception of a monolithic North Korean leadership
implacably resistant to economic reform. In reality, however,
behind the façade of a monolithic power structure, the struggle
between reformers and the Old Guard has been steadily growing
in intensity. Even before the loss of Soviet and Chinese aid, the
pressures for reform were starting to build up. Ironically,
however, they were unable to make much headway in liberalizing
the domestic economy until the food crisis starting in 1995 led
to the widespread, spontaneous eruption of private farm
markets. Faced wi th a breakdown i n i ts machi nery of
government food procurement and distribution, the Kim Jong-il
regime had two options: close down the private markets by force
or look the other way. Kim Jong-il chose to look the other way. In
doing so, he sided with reform minded officials who argued that
the private markets would not only ease the food shortage for
some sections of the population but would also jump-start
movement toward a market economy.
Since 1996, there has been a steady increase in the
number of private markets, together with a diversification of
their merchandise, which now embraces consumer goods as well
as farm produce. Yet no Workers’ Party doctrinal pronounce-
ments have acknowledged or legitimized this significant sea
change in North Korean economic life. Kim Jong-il is presiding
over a process that might be called “reform by stealth”. He is
232
tacitly encouraging change in the dome-stic economy with-out
incurring the political costs of confronting the Old Guard in a
formal doctrinal debate. At the same time, he is openly
sponsoring newly flexible polic-ies toward South Korean and
foreign investment as part of the broader moves toward greater
openness that were symbolized by the June 2000 and October
2007 North-South summits. By all conventional economic
indicators, North Korea is a hopeless basket case, destined for
inevitable collapse under the weight of its economic problems
unless the pace of systematic remedial action is greatly
accelerated. Pointing to the experience of Romania, however,
Marcus Noland suggests “caution in drawing too deterministic a
link between economic hardship and political failure.” In Noland’s
analysis, “between the extremes of reform and collapse lies
muddling through.”
2.
233
polices either under his leadership or that of his successors. For
the foreseeable future, regardless of the pace of reform, Kim
Jong-il is needed as a legitimizing symbol of continuity with the
Kim Il Sung era and is not likely to be replaced.
II
Will a new consensus develop in the South for support of
sustained progress toward a confederation? In my view, this is
unlikely so long as the U.S.-South Korean alliance continues in its
present form. During the decades since 1945, the polarization of
Korea along Cold War lines constituted a built-in barrier to
reunification. Nevertheless, the division of the peninsula, while
making Korea itself militarily unstable, defused the peninsula
temporarily as a flashpoint of regional instability. The Sino-
2 Marcus Noland, “Why North Korea Will Muddle Through,” Foreign
Affairs 76 (July-August 1997): 115-16
234
Japanese competition for dominance in Korea that had persisted
throughout history subsided in the face of the entrenched U.S.
and Soviet presence in the two Koreas.
In the post-Cold War environment, however, a divided
Korea is likely to become a focus of international conflict
involving not only the neighbouring powers but also the United
States. For example, if the United States maintains a continuing
military presence in the South, China is likely to view the
maintenance of a separate North Korea as critical to its security,
and the danger of a U.S.-China conflict over Korea will grow,
especially if the United States and Japan continue to define the
threat from China as a principal raison d’être for their alliance.
The U.S. interest in a stable Northeast Asia would thus be
served by the emergence of a strong, reunified Korea that could
serve as a neutral buffer state, forestalling a repetition of past
Korea-centred major power rivalries in the region.
T
o pursue this interest, the United States would have to
reshape its policies in the peninsula so that it does not stand
in the way of movement toward a loose confederation, as it does
now, while at the same time doing what it can to promote such
movement. This would require, above all, a basic redefinition of
the role of U.S. forces in Korea that would induce the South to
move more rapidly toward accommodation with the North. In its
present form, the U.S. military presence sustains a climate of
indefinite confrontation.
The United States has an open-ended commitment to one
side in a civil war. It is providing a massive economic subsidy that
enables its ally to minimize the sacrifices that would otherwise
be necessary for the maintenance of the conflict. The South’s
upper-and middle-income minority, in particular, has acquired a
vested interest in the status quo. Without its U.S. subsidy, Seoul,
which now spends an average of U.S. $13 billion per year for
defence, would have to double or triple its military budget to
235
replace the conventional forces deployed for its defence by the
United States, not to mention the much higher outlays that
independent nuclear forces would require. In addition to the
direct cost of its forces in Korea, averaging U.S. $2 billion per
year, the United States spends more than U.S. $40 billion
annually to maintain the overall U.S. force structure in East Asia
and the western Pacific on which its capability to intervene in
Korea depends. So long as the South regards this U.S. economic
cushion as an entitlement, it will be under no compulsion to
pursue a modus vivendi with the North.
Despite the end of the Cold War, the role of U.S. forces in
Korea has not changed to keep pace wi th geopol i ti cal
realignments in Korea. The U.S. military presence in the South
was a response to the projection of Soviet and Chinese military
power on the side of the North. Now Russia no longer has a
security commitment to the North. While retaining a nominal
security commitment to Pyongyang and keeping up economic
aid, China has in reality moved steadily closer to Seoul. Both
Moscow and Beijing are increasingly attempting to play the role
of honest broker between the North and South. That is what
they want the United States to do, and that is what the North
also wants the United States to do.
North Korean students
practice for a parade for
September 9, which marks the
establishment of the country.
236
What would a redefinition of the U.S. military role mean in
concrete terms? In essence, the mission of U.S. forces would no
longer be limited to the defence of the South but would be
broadened to embrace the deterrence of aggression by either the
North or the South against the other. In its new role as a
stabilizer and balancer in Korea, the United States would provide
the security umbrella necessary for stable progress toward a
loose confederation, helping promote a climate of mutual trust.
While retaining a nominal security commitment to
Pyongyang and keeping up economic aid,
China has in reality moved steadily closer to Seoul.
Both Moscow and Beijing are increasingly
attempting to play the role of honest broker
between the North and South.
North Korean cheerleaders at
the Summer Universiade
Daegu 2003.
237
Conceivably, U.S. forces could remain for a limited period
following the establishment of a confederation. North Korea, for
its part, has left such a possibility open. Kim Byong-hong, policy
planning chief in the foreign ministry, told me on 7 May 1998
that “Korea is surrounded by big powers Russia, China, and
Japan. We must think of the impact of the withdrawal of U.S.
troops on the balance of power in the region. It is possible that if
U.S. troops pull out of Korea, Japan will rearm immediately.” A
day earlier, Kim Yong-nam, then Foreign Minister and now
chairman of the Supreme People’s Assembly, said more obliquely
that “the United States is standing in the way of a confederation,
but it would be in your interest to help us work for one because
it would enhance stability in the region, and the United States
can advance its interests in both halves of Korea if it were
confederated.”
238
I
n my years living in Korea, before, during and after the war I
got to know many of them, and I liked them. The ones I got to
know best were two young men (boys really) whom we had
hired to drive our jeeps. They were extremely intelligent,
observed the work of our cameramen, and soon learned to shoot
film themselves. Postwar, when most NBC staffers returned to
Japan or the USA, we hired the two young (You Young-sang and
Lim Youn Chul) as “stringers”, meaning we paid them for sending
us film when newsworthy events happened.
Then the Vietnam War came and NBC needed cameramen
to cover that. With some worries about their safety, I sent them
to Saigon. They both succeeded magnificently, so much so that
soon whenever NBC cameramen went to Vietnam they asked to
be able to work with the Koreans. They went to the top among
our cameramen and both and successful careers with NBC News.
Until World War I had never met a Korean, then I signed up in
the Navy for study at the U.S. Naval Japanese Language School
at Boulder, Colorado. Most of our instructors were either former
missionaries or businessmen who had lived in Japan. There was
only one Korean there, a pleasant young man named Choi. He
was fluent in Japanese and at first we thought he was Japanese,
but we soon learned that he was Korean. It was Choi who made
that clear, and it was Choi who taught us, during off hours, about
the twentieth century relations between Japan and Korea.
It was after four combat landings in the Pacific and three
years later before I reached Tokyo as a correspondent for
international News Service. Two years after that I got my first
N
O
R
T
H
A
N
D
S
O
U
T
H
,
6
0
Y
E
A
R
S
O
N
KOREA
Impossible to Possible
Beyond All Expectations
239
glimpse of the Korean hills as my boat from Japan entered the
spectacular harbor at Busan.. When I arrived Korea was very different
from post-war Japan that I had seen. It was more unsettled, more
confusing. The American military forces, the twenty fourth corps,
arrived late from Okinawa. The Cairo Conference among
Churchill, Roosevelt and Chiang Kai-shek agreed that Korea
would become a free and independent country “in due course”.
The situation in Korea, as one might say, was uncertain and
confused. The “in due course”, is still waiting to happen.
Soviet forces arrived in Korea well ahead of the Americans
but they halted, as it had been agreed, near the thirty eighth
parallel. That decision had been taken by diplomats drawing a
line on a map which did not take into account features such as
rivers and mountains, and other obstacles that the line crossed.
The Russians were to take the surrender of the Japanese forces
north of that line and the Americans doing the same to the
south. In effect, most of the industrialization of Korea was north
of the line and the south was mainly agricultural. Arriving at
Busan my first task was to find a way to get to Seoul. A train
seemed to be the only answer. I found one and boarded it. The
facilities aboard it were extremely primitive. The car I rode in
held mostly American soldiers and at one stop (probably Daegu),
Peabody Award winning
reporter John Rick has
participated in or reported on
all of America’s 20th century
wars since World War .
Rich was in Tokyo when the
Korean War began and went
to Korea the first week of the
fighting. For the next three
years he covered the war, a
longer period than any other
American news
correspondent. In December
1950 he had left I.N.S and
joined NBC News. After the
armistice signing in Korea,
Rich spent a year on a
fellowship at the Council on
Foreign Relations in New
York. He now lives in the
house, on the coast of Maine,
where he was born August 5,
1917.
John Rich.
240
some GI’s at the station threw aboard several “blitzcans” of
water, the only liquid we had for the whole trip. Water was not
the only shortage. As we approached Seoul and darkness fell, we
realized that the train’s headlight (if indeed it had one), was not
working. We chugged into Seoul’s railroad station in complete
darkness.
I was booked at the Chosun Hotel and soon became an
acquaintance of the genial English-speaking manager whom we
called Joe Minh. Later, to our horror, when the North Koreans
occupied Seoul in June 1950, Joe Minh was seized and taken
north, and unfortunately his fate is still unknown. At the time I
reached Korea the Americans and Soviets were beginning their
onsite “conference” to decide just how Korea was to become
“independent”. I was there when the Soviet delegation arrived in
Seoul, by train, from the north to begin the deliberations. It
ended in complete failure. The Soviets and the Americans could
not even agree on whom among the Korea people they would
negotiate with to decide the fate of the Korean Peninsula. The
talks ended and the Soviets went north. I was in South Korea at
the voting in Korea’s first election when Syngman Rhee won the
presidency and the new Republic of Korea government was
formed. U.S. Army forces withdrew completely from Korea,
leaving only a small military advisory group of about five
hundred men.
M
eanwhile the Soviets began equipping and training North
Korean forces with T-34 Tanks and Yak Fighter Planes. The
attack from the north on June 25th, 1950, caught the South
Koreans and Americans by surprise. The next three years
witnessed a brutal war up and down the Korean Peninsula.
Almost no place was untouched and millions were left dead and
wounded on both sides. Needless to say South Korea was in a
very sorry state when the Armistice Agreement was signed in
July, 1953. The economy was in a shambles. There were almost
241
no factories anywhere. There were difficult times but American
aid continued to come in. It took a few years for the Koreans to
get organized but then I began to see factories begin to rise, and
in the ports, shipyards beginning to turn out impressive vessels.
Korea was on its way.
Korea soon had a civilian airline. Korea moved outward,
set up embassies and consulates abroad and learned how to
operate in the world economy. In the first weeks of the war what
little army South Korea had was shattered. I saw and took
pictures of South Korean conscripts being prepared for battle.
They were handed an Ameri can ri fl e, gi ven some verbal
instructions on how it worked, and then allowed nine practice
shots at a target. From there they went straight into the front
lines. I saw that South Korean army again in Vietnam. What a
contrast. The Koreans returned the compliment and sent a
division to help the Americans. It was a crack military force. It was
the equal of almost any army anywhere. A well-trained and well-
led fighting force. The Korean miracle had begun and was well
underway. It has grown and succeeded beyond all expectations,
economic, industrial, technological, political and military. South
Korea has built a prosperous state that now even gives foreign aid
to other poor and struggling nations. Truly a miracle.
242
O
n the 15th of August, 1948 the Republic of Korea was
proclaimed in Seoul. Then, just a few short days later, on
September 9, the Democratic People’s Republic of Korea was
officially established in Pyongyang. Thus, two rival Korean states
were born. The division was brought about by many factors,
superpower rivalry being the most important one, although
confl ict between the Korean Left and Right al so greatl y
contributed to the tragedy.
From the very beginning, neither side was willing to accept
the division as permanent. The 1948 ROK Constitution clearly
and unequivocally stated that the entire Korean Peninsula should
be seen as ROK territory. The DPRK Constitution not only
contained a similar claim (with the DPRK, naturally, being
presented as the only legitimate government of both North and
South), but it also went one step further: according to the 1948
North Korean Constitution, Seoul was claimed to be the DPRK’s
capital city. Pyongyang was at the time considered as merely the
provisional headquarters of the North Korean government (only
in 1972 was Pyongyang finally declared to be the capital of the
North). Neither side made a secret of its willingness to unify the
country, by force if necessary, and each side was ready to accept
unification strictly on its own terms.
In the late 1940s the South Korean government did talk
about a “northern expedition”, but it was the North where
immediate unification by force became the most important task
on the political agenda. Since the Soviets controlled the North in
the 1940s, such an operation would be impossible without
Exclusive Dreams:
Two Koreas in Search of Unification
N
O
R
T
H
A
N
D
S
O
U
T
H
,
6
0
Y
E
A
R
S
O
N
KOREA
Impossible to Possible
243
Moscow’s explicit permission and support. From 1948 onwards,
North Korea’s diplomats worked hard to obtain this permission
from Stalin. The Soviet dictator was initially unenthusiastic: he
did not want to risk a world war over some small peninsula in
East Asia. Only in January 1950, thanks to the successful Soviet
nuclear test and the Communist victory in China, did Stalin
change his mind and reluctantly approve the invasion plan.
However, the attempt to conquer the South by force came
to naught. The North Koreans scored some impressive military
success at first, but were eventually driven back and barely
avoided a disastrous defeat. The Korean War led to widespread
destruction and great loss of life, but the country remained
divided.
After the war, both Seoul and Pyongyang remained
committed to unification, but this commitment became largely
theoretical. By the mid-1950s, the Cold War reached its climax,
the boundaries between the two rival camps solidified, and it was
clear that neither the Soviet Union nor the U.S. wished any
serious confrontation to redevelop in Korea.
In a world driven by superpower politics, few people hoped
that unification would be possible any time soon, so the rival
governments concentrated on economic development instead.
Initially, the North held a considerable advantage: it inherited
some 80-90% of the colonial era industrial potential. The
estimated per capita GNP of the North in 1960 was $172 ,
compared to $85 in the South
1
.
The late 1960s saw a short-term revival of the militant
Only in January 1950, thanks to
the successful Soviet nuclear test and the Communist victory
in China, did Stalin change his mind
and reluctantly approve the invasion plan.
Andrei Lankov was born in
1963 in Leningrad (now
Petersburg), then USSR. He
graduated from the
Leningrad State University in
1986, majoring in Chinese
and Korean studies. He
taught Korean history at the
Australian National
University and since 2004 is
teaching at the Kookmin
University in Seoul. He has
published a number of books
on Korean history, including
“North of the DMZ” and
"From Stalin to Kim Il Sung:
Formation of North Korea”
as well as a large number of
articles, both in academic
journals and general media.
Andrei Lankov
244
stance of the North. The feud between China and the Soviet
Union, which reached its height by the mid-60s, allowed North
Korea to acquire considerable autonomy within the Communist
camp, so the Pyongyang leaders came to believe they would be
able to take over the South even if the Soviets and Chinese
would not directly support such an undertaking. This time, their
major hopes were pinned on fermenting internal discontent in
the South (obviously, under the influence of the events in
Vietnam). This hope was encouraged by frequent outbursts of
political turmoil within South Korea like, for example, the
April Revolution of 1960 or the mass rallies against the Korea-
Japan Treaty of 1965.
In the late 1960s, the North Korean Special Forces
undertook a string of large-scale operations in the South. The
most notorious of these was an unsuccessful raid in 1968 on the
Blue House, the residence of the ROK president. Around the
same time Pyongyang also attempted to ignite Vietnamese-style
guerrilla warfare by landing commando units on the South
Korean coast. However, these attempts also ended in failure: the
South Korean public was decidedly unsympathetic towards the
North Korean dream of “red unification”.
D
isappointed at the failure of their militant strategy, the
North Koreans agreed to begin negotiations with the
South. The results of secret talks were made public in 1972 when
Seoul and Pyongyang published the “July 4 Joint Declaration”.
The Declaration stated that both sides were committed to the
“three principles of unification”. According to these principles,
In a world driven by superpower politics, few people
hoped that unification would be possible any time
soon, so the rival governments concentrated on
economic development instead.
245
unification should be reached independently, peacefully, and on
the basis of national solidarity.
The Declaration was widely welcomed at the time as a sign
of Korea’s move towards peaceful co-existence. This, however,
was not really the case, as was demonstrated by subsequent
lapses into the confrontational approach (including, for example,
a 1983 assassination attempt against the then ROK President
and his top politicians, engineered by North Korean agents in
Rangoon, Burma). Nonetheless, the “July 4 Declaration” was a
sign of change. From that time onwards, the two Korean regimes
began to gradually move away from their old unconditional
hostility and towards a measure of cooperation. This intra-
Korean cooperation, the politicians usually insisted, was the best
and safest road to eventual unification. For all practical purposes,
meanwhile, this was just a convenient fiction, driven by the
political need to pay lip service to the unification ideal which had
been firmly enshrined in the ideologies of the rival states.
Unification in fact remained elusive. However, the new paradigm
1 Hamm Taik-young. Arming the Two Koreas: State, Capital and Military
Power. Routledge, 1999, p.131.
Children at a nursery school in
Unsan in famine-struck North
Korea.
246
permitted a diffusion of tension on the peninsula and also
facilitated some limited exchanges between the two sections of
the divided nation.
Around the same time, the economic balance between the
two countries began to undergo a dramatic reversal. From the
early 1960s the South Korean economy entered an extended
period of record growth which is sometimes described as the
“Korean economic miracle”. Meanwhile, the North Korean
economy, once modeled upon the Soviet patterns of the Stalin
era, began to stagnate. As a result, around 1970 the South
overtook the North economically. The economic gap between
the two halves of Korea has been growing ever since, reaching
almost unbelievable proportions. In 2007, the Bank of Korea
estimated that per capita GNP in the North was seventeen times
below the South Korean level. However, this estimate is widely
seen as excessively optimistic such that many experts believe
that the actual gap is 1:35, if not higher
2
. However, even if the
optimists are correct, a 1:17 ratio is still the world’s largest per
capita economic gap between countries which share a land
Two thousands tons of rice aid
from the South is shipped for
transfer to the North.
247
border. This economic disparity creates huge inequalities
between the two Koreas, and this inequality in turn greatly
influences their relations.
T
he late 1980s saw a short-lived revival of the unification
dream, this time in the South. Communist Eastern Europe
was falling like house of cards. The dictatorships in Rumania and
Albania, the two closest analogues to the North Korean regime,
collapsed in a matter of days. Finally, in 1989-90 a bloodless
revolution led to an unexpected unification of Germany. North
Korea seemed to be destined for a similar transformation from
within, and this was widely anticipated in the South, whose
economic superiority was clear to everybody. Around this time,
contacts between two governments intensified, and this led to
some new high-profile agreements, including Agreement on
Reconciliation, Non-aggression and Exchanges and Cooperation
between the South and the North (1991) and the Joi nt
Declaration of the Denuclearization of the Korean Peninsula
(1992).
However, the hopes for German-style unification did not
last long. By the mid-1990s the mood in Seoul changed
completely. First, it became clear that North Korea, unlike the
countries of Eastern Europe, was not going to collapse any time
soon. In the early 1990s, North Korea lost the Soviet aid which
was instrumental in keeping its economy afloat. This let to a near
collapse of the state-run economy. In 1996-99 the country also
experienced a disastrous famine. Nonetheless, Kim Jong II’s
government survived and remained in control of the country.
Second, the German experience made the Seoul decision-makers
realize that the unification of the North and South would be
2
For a critical assesment of the different estimates, see: 0÷¹ ÷¯¬-
±÷7!7 ¯72¹¹¸, #143 (March 2008).
248
more expensive and painful than anybody had ever imagined.
Thus, the entire paradigm changed once again. Unification
as the supreme national goal still remains accepted universally,
even though from the late 1990s one can easily see a decline in
commitment to this stated goal among the youngest generation
of South Koreans. However, under the new circumstances Seoul
was not in a great hurry to reach this goal. A prolonged period of
peaceful co-existence and collaboration came to be seen as a
necessary first step on the way to complete unification.
Such was the background which led to a switch to the
“Sunshine Policy”. This policy was launched by Kim Dae Jung’s
government in 1997. It was continued by President Roh Moo-
hyun throughout 2002-2008, during which time it was formally
re-named the “Policy for Peace and Prosperity”, but the old name
was also still used widely. The major goal of this policy was to
encourage the gradual evolution of North Korea. The policy’s
name refers to one of Aesop’s fables, “the North Wind and the
Sun”. In the fable, the North Wind and the Sun argue about who
is able to remove a cloak from a traveler. The North Wind blows
hard but fails to succeed, since the traveler wraps his cloak even
more tightly to protect himself. The Sun, however, warms the air,
thus forcing the traveler to remove the unnecessary cloak.
The policy was based on the assumption that a soft
approach will persuade the North to institute large-scale social
and economic reforms, more or less similar to that undertaken in
Chi na or Vi etnam. An i mportant part of the underl yi ng
assumptions in this policy was a belief that reform would prolong
the existence of the North Korean state and make possible a
gradual elimination of the huge economic and social gap
This economic disparity creates huge inequalities
between the two Koreas, and this inequality in turn
greatly influences their relations.
249
between the two Koreas. As Aidan Foster-Carter noted, “Despite
the rhetoric of unification, the immediate aim [of the “Sunsine
policy”] was to retain two states, but encourage them to get on
better”.
3
W
as the “Sunshine Policy” successful and, if so, to what
degree? Perhaps, this question has no clear-cut answer
and will thus be disputed by generations of historians. The critics
of the policy insist that it essentially saved the North Korean
dictatorial regime from collapse. This opinion was expressed by
Nicholas Ebrestadt who wrote in 2004: “What thus seems
beyond dispute is that the upsurge of Western aid for the DPRK
under “Sunshine” and “engagement” policy played a role
possibly an instrumental role in reducing the risk of economic
collapse and increasing the odds of survival for the North Korean
state.”
4
It is often implied by the critics that the survival of the
Kim family regime prolonged the suffering of the North Korean
people.
5
They also say that unconditional aid from the South,
instead of bringing about beneficial reforms, actually led to an
opposite result: since the Pyongyang elite can now count on aid,
it has even less incentive to reform itself. Meanwhile, the
supporters of the “Sunshine Line” point at the considerable
improvement in the relations between the two Koreas and to the
explosive growth in their economic exchanges and political
contacts. They also allege that the “Sunshine Policy” helped to
decrease the risk of war and created conditions which rendered
3
Aidan Foster-Carter. Towards the endgame. The World Today. London:
Vol. 58, Iss. 12 (Dec. 2002.); p. 23
4
Nicholas Eberstadt. The Persistence of North Korea: What has been
keeping Pyongyang afloat? Policy Review, #147 (October & November
2004)
5
For example: Jasper Becker. Dancing With the Dictator. New York
Times. New York, N.Y.: Jun. 9, 2005.
250
large-scale aid possible (aid which, they continue, has saved
many lives).
I ndeed, the “Sunshi ne Pol i cy” made possi bl e an
unprecedented increase in political exchanges between the two
sides. The most important of these contacts took place in 2002
when ROK President Kim Dae-jung met the DPRK Defense
council chairman Kim Jong-il. This was the first ever summit
between the heads of the two Korean states. The next summit
took place in 2007, once again in Pyongyang.
All these events occurred against the backdrop of the
humanitarian disaster in the North. In the late 1990s, North
Korea experienced a famine of unprecedented proportions. It is
estimated that between 600,000 and 900,000 people starved to
death throughout 1996-99.
6
The famine was over by 2000,
largely thanks to massive outside aid, however the underlying
problems unfortunately persist. The collectivized North Korean
agriculture cannot produce enough food to meet even the most
basic demands of the country’s population, and in recent years
there was no palpable improvement in food production. In recent
years South Korea has become a major food provider, shipping
about 400,000 metric tons of food every year (roughly 8% of the
entire annual demand). Apart from food aid, a number of
government agencies and NGOs are also involved in providing all
kinds of humanitarian aid and development assistance to North
Korea.
There was also a dramatic growth in the volume of intra-
Korean economic exchange as well. This exchange is usually
described as “economic cooperation,” but this description is
somewhat mi sl eadi ng: so far, the profi tabi l i ty of these
undertakings for the South Korean side remains doubtful.
Nonetheless, one should not judge these projects from a purely
economic point of view, since most of them are likely to have
long-term political consequences.
The last 15 years have been times of explosive growth in
251
the scale of intra-Korean trade. Until the mid-1990s, such trade
was virtually absent. By 2003 the volume of this trade reached
$0.72 billion, while in 2007 the volume of trade and other
economic exchanges increased to $1.8 billion. In the recent years
South Korea has been the second largest trade partner of the
North.
7
C
urrently, there are three major joint undertakings between
the two sides. In the Geumgang Mountains, South Korean
tourists frequent a resort which is located in one of the most
famed scenic parts of the country. The resort is for the exclusive
use of the South Koreans, and their interactions with North
Koreans are kept to a bare minimum. Many critics of the project
therefore describe it disapprovingly as a “money pump” which
keeps the North Korean regime provided with monetary funds.
6 For a detailed summary of the events which led to the Great Famine as
well as analysis of its impact, see: Haggard, Stephan, and Marcus Noland,
Famine in North Korea: Markets, Aid, and Reform. New York: Columbia
University Press, 2007.
7
=÷lº¯((7¹!7 '±. KlT/¸ ¯((P¸ ¡¬
South Korean civic groups ship
800 tons of fertilizers onto the
Russian Svetlana ready to
head for the North.
252
This is partially true, but it is also true that without the trail-
blazing Geumgang (in operation since 1998) no other projects
would be conceivable.
Indeed, two more recent projects are remarkably less
restrictive. One of those projects is the Gaeseong city tours.
Gaeseong, the capital of Korea during the Koryo dynasty (918-
1392) and the site of numerous historical monuments, is located
just across the DMZ, some 50 km away from Seoul. Since 2007,
three hundred South Korean tourists have been allowed to visit
the city every day. The tours are heavily controlled, but still give
visitors an unprecedented opportunity to glimpse North Korean
life. Meanwhile, the population of this, one of North Korea’s
largest cities, also sees busloads of well-dressed, well-fed, and tall
South Koreans whose behavior and image clearly contradicts the
official propaganda.
Since 2004 South Korean companies have also began to
operate in the Gaeseong Industrial Park, located just across the
DMZ. As of February 2008, there were 68 South Korean
companies operating in Gaeseong. These companies employed
23,529 North Korean workers as well as 884 South Korean
managers and technicians.
8
The South Korean investors hope to
cash in on the cheap labor provided by the North Korean side.
The official minimum wage in Gaeseong, as of 2007 was a mere
$57 (and even part of this measly sum is pocketed by the
authorities), while the actual amount paid was only marginally
higher
9
. This might sound an abysmally low figure, but one
should remember that the Gaeseong Industrial Park still provides
the best paid regular jobs in North Korea, and its employees are
Despite of all caveats, Koreans of the North and
South still see themselves as one nation, and this
perception, if it does not materially fade, will
eventually decide their fate.
253
envied in their neighborhoods. In Gaeseong, a large number of
North and South Koreans work together for the first time in 60
years. The North Koreans not only learn modern technical skills,
but they also have ample opportunity to observe their Southern
compatriots. No doubt they come to conclusions which are very
different from what they are told by the official propaganda, and
in the long run this will have a great impact on the internal
situation in North Korea.
N
evertheless, by 2006-2007 one could see that Korean
society was feeling a growing dissatisfaction about the
results of the “Sunshine Policy”. The policy failed to prevent the
devel opment of nucl ear weapons i n North Korea. More
importantly, the long-expected Chinese-style reforms did not
eventuate. On the contrary, once the North Korean government
began to slowly recover from the severe famine of the late
1990s, it undertook attempts to restore the old system of a
centrally planned economy and omnipresent political control.
Unfortunately, such policies are quite rational if judged
from the point of view of Pyongyang’s decision-makers. The
North Korean elite is afraid that even moderate liberalization and
relaxation of political control will have a devastating effect on
political stability. The mere existence of an affluent South makes
the situation in Korea very different from that of China or
Vietnam where communist authoritarian regimes do not directly
face living proof of their systems’ past inefficiencies. If the North
Korean populace learns the true magnitude of the gap between
North and South, the Pyongyang government’s legitimacy will be
severely damaged, and a crisis might follow (much like occurred
8
÷±7º÷Þ¸ 7¹+¯¹=7?÷±=º==¯)¸ 5º¯¬)¸ ¡A¬
9
The Gaeseong North-South Korean Industrial Complex. CRS Report for
the Congress. Washington, Congressional Research Service, 2008, p.9.
254
in East Germany). Hence, instead of being engaged in dangerous
reformist activity, the North Korean leadership prefers to do
everything possible to keep the situation under control and,
logically enough, they use South Korean aid to maintain the
status quo. For example, a large amount of aid is used to feed
the army, police and bureaucracy whose support is vital to the
regime’s internal stability.
This means that in the foreseeable future all Seoul
governments will face an uneasy dilemma. If substantial and
unconditional aid is provided, the North Korean elite will use it
largely to increase its own grip over the people. If aid is not
provided, many more North Koreans will starve to death, while
the regime will still be able to maintain control. In both
situations, the yawning gulf between the two Korean economies
is likely to get even wider. Lee Myung-bak’s government, in
power since February 2008, decided to test another approach to
the North which, it is widely hoped, will help to break away from
the vicious cycle described above. While basically willing to
provide aid, it also stated that aid should come with certain
conditions attached. Ideally, such an approach will make it more
difficult for the North to use the South Korean aid to maintain
the privileged life-style of the ruling elite.
A
s a part of this new approach, President Lee proposed the
“3000 vision” plan. In essence, this plan envisions large-
scale aid being delivered to the North if the North Korean
government chooses to abandon its nuclear weapons. If such a
proposal is accepted, the South promises to increase the per
capi ta i ncome i n the North to $3000 wi thi n a decade.
Unfortunately, this particular proposal does not appear to be
realistic, since the North is very unlikely to accept a deal which
includes de-nuclearization as an essential part of the package.
However, the underlying conditional approach to aid seems to be
the main line of Seoul’s strategy in dealing with the North over
255
the next few years of Lee Myung-bak’s government.
Unification, the long-term stated dream and goal of both
Koreas, therefore remains elusive. In the new situation, the South
Korean public seems to be loosing interest in the goal, and is
definitely not in a special hurry to reach it. Meanwhile, the North
Korean decision-makers are quietly but decisively opposed to it.
The North Korean commoners might want unification, but they
have no means of exercising influence on government policy.
And, l ast but not l east, the great powers, i ncl udi ng the
increasingly important and influential China, are not very
supportive of unification either: they judge that a divided Korea
will serve their interests better. All in all the situation does not
sound encouraging. However, there is reason to hope. It seems
that in the long run the fate of Korea will be decided not by
negotiations between the two Korean governments, but by social
changes and domestic developments within both countries
and in particular, within North Korea itself. In the recent decade
or so, the North Korean populace has learned a lot about the
lifestyle of the South. The exchanges conducted as a part of the
“Sunshine Policy” played some role in these changes, but in most
cases the information has filtered through the remarkably porous
border with China.
There are political changes as well. The Pyongyang
government’s ability to control its people is clearly in decline.
There might be still a long way to go, but it seems that sooner or
later the North Koreans will be able to express their feelings and
dreams, and there is little doubt that these dreams have the
potential to become the leading force for national unification. As
history had demonstrated a number of times, very often the
complicated diplomatic constructions and calculations of power
elites are swept away by the force of popular feeling. Despite of
all caveats, Koreans of the North and South still see themselves
as one nation, and this perception, if it does not materially fade,
will eventually decide their fate.
|
https://pt.scribd.com/document/61173671/Korea-Impossible-to-Possible
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
I'm trying to run some basic openmp examples with MS Visual Studio 2008 SP1 x64. My next step is to install the intel c++ compiler but I'd rather get it working with VS2008 only because then I'm sure I will have problems when I write Matlab MEX files with openMP x64.
I start a new Win32 console project with VS2008 SP1. I then add the x64 configuration in the configuration manager. I then add under Project Properties/Configuration Properties/C/C++/Langauage and change OpenMP Support to "Yes /openmp"
The application compiles fine but when I run it I get the error:
"Unable to start program ....
This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors."
What am I doing wrong? Does microsoft visual c++ 2008 doesn't support x64 openmp and it's win32 only?
#include "stdafx.h"
#include
#include
int main (int argc, char *argv[]) {
int th_id, nthreads;
;
}
|
https://software.intel.com/en-us/forums/intel-moderncode-for-parallel-architectures/topic/293611
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Dear Erica, Why would you create an enum with no cases?
This is such a great question! No-case enumerations represent a fairly obscure Swift “power tool”, and one that most developers are unaware of.
The answer, in a nutshell, is that they enable programmers to establish a mini-namespace with little overhead and an assurance that you can’t accidentally create type instances. Under their umbrella, you can group static members into namespaces, build singletons, create cohesive collections of functionality with a minimum surface eliminating freestanding functions, and in one outlier case provide services built around generic types.
Namespacing
For example, the standard library uses no-case enums to represent command line arguments for the current process. The
Process enum has no cases. It provides a native Swift interface to the command line argc (count)/argv (strings) arguments passed to the current process.
/// Command-line arguments for the current process. public enum Process { /// Access to the raw argc value from C. public static var argc: CInt { get } /// Access to the raw argv value from C. Accessing the argument vector /// through this pointer is unsafe. public static var unsafeArgv: UnsafeMutablePointer<UnsafeMutablePointer<Int8>?> { get } /// Access to the swift arguments, also use lazy initialization of static /// properties to safely initialize the swift arguments. /// /// NOTE: we can not use static lazy let initializer as they can be moved /// around by the optimizer which will break the data dependence on argc /// and argv. public static var arguments: [String] { get } }
Singletons
If you’re thinking the preceding enumeration feels very much like a singleton, you would not be wrong. Consumers are prevented from creating instances and there’s a single entry point for all the functionality. Should you need supporting state, you can always include an embedded type within a no-case enumeration.
Here’s a real world example I built that offers synchronous text-to-speech generation :
/// Synchronous Text-to-Speech support public enum Speaker { /// Internal synthesizer private struct Synthesizer { static let shared = SynchronousSpeech() } /// Say the utterance passed as the argument public static func say(_ utterance: String) { Synthesizer.shared.say(utterance) } }
The synthesizer is hidden from view outside the module, as you see in the public declaration.
import AVFoundation import Foundation /// Synchronous Text-to-Speech support public enum Speaker { /// Say the utterance passed as the argument public static func say(_ utterance: String) }
Users cannot create instances and the single entry point (
Speaker.say()) limits access to the singleton’s restricted functionality.
Wrappers
I created a
PlaygroundState enumeration singleton to centralize and simplify playground code I access over and over. Instead of typing
PlaygroundSupport.PlaygroundPage.current.needsIndefiniteExecution, I use my PlaygroundState singleton to
runForever().
The following example, which is cut down massively from its actual implementation, wraps several technologies including PlaygroundSupport and ProcessInfo to generalize access to simulator details and execution control:
/// Controls and informs the playground's state public enum PlaygroundState { /// Establishes that the playground page needs to execute indefinitely static func runForever() { page.needsIndefiniteExecution = true } /// Instructs Xcode that the playground page has finished execution. static func stop() { page.current.finishExecution() } /// The playground's environmental variables public static var processEnvironment: [String: String] { return processInfo.environment } #if !os(OSX) /// Simulator's device family public static var deviceFamily: String { return processEnvironment["IPHONE_SIMULATOR_DEVICE"] ?? "Unknown Device Family" } /// Simulator's device name public static var deviceName: String { return processEnvironment["SIMULATOR_DEVICE_NAME"] ?? "Unknown Device Name" } /// Simulator's firmware version public static var runtimeVersion: String { return processEnvironment["SIMULATOR_RUNTIME_VERSION"] ?? "Unknown Runtime Version" } #endif }
Consolidating Type Information through Generics
When reviewing SE-0101, Brent Royal-Gordon asked why the proposed
MemoryLayout type needed to be a struct:.
This is a pretty outlier use of caseless enumerations but it’s a valuable one. Rewriting my original struct into an enum, produces the following example. It uses generics to extract information about types:
/// Accesses the memory layout of `T` through its /// `size`, `stride`, and `alignment` properties public enum MemoryLayout<T> { /// Returns the contiguous memory footprint of `T`. /// /// Does not include any dynamically-allocated or "remote" /// storage. In particular, `MemoryLayout.size`, when /// `T` is a class type, is the same regardless of how many /// stored properties `T` has. public static var size: Int { return sizeof(T.self) } /// For instances of `T` in an `Array`, returns the number of /// bytes from the start of one instance to the start of the /// next. This is the same as the number of bytes moved when an /// `UnsafePointer` is incremented. `T` may have a lower minimal /// alignment that trades runtime performance for space /// efficiency. The result is always positive. public static var stride: Int { return strideof(T.self) } /// Returns the default memory alignment of `T`. public static var alignment: Int { return alignof(T.self) } }
By using a caseless enumeration, users can query the types without ever creating instances, for example:
MemoryLayout<Double>.size,
MemoryLayout<NSObject>.stride, etc.
Like my posts? Consider buying a book. Content Update #1 is live. I also have books on Playgrounds (updated with the iOS 10 Swift Playgrounds App) and Structured Documentation for sale at iBooks and LeanPub.
Update:
See also: Natasha’s post on no-case enums and:
@ericasadun They also work for closing off code paths, as in
— Joe Groff (@jckarter) July 18, 2016
4 Comments
Worth to mention Natashas post too
Added!
[…] Dear Erica: No-case Enums? […]
I like the creativity of using enumerations this way (namespacing, with little baggage), but I question whether there should just be a less “accidental” (for lack of a better word) way of doing this in the language (maybe “namespace class Xyz”?) Primarily just because of the definition of an enumeration:
“An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code… yada, yada”
With that said, in Java (I know Java enums are not the same as Swift enums), a great way to define a singleton is using enum:
enum Singleton {
INSTANCE;
…
}
|
http://ericasadun.com/2016/07/18/dear-erica-no-case-enums/
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
IANA Deploying IPv6 190
According to this Wired news article, IANA has begun to "roll out" IPv6. Though it doesn't go into specifics, one assumes this means that the three major IP registries will begin assigning IPv6 addresses. The article mentions another chicken and the egg problem: no IPv6 software (correct me if I'm wrong, but doesn't Linux have IPv6 software?), so there is no need for IPv6 addresses, and vice-versa. It also mentions every traffic light on the planet could have its own IP. Update: 07/16 02:48 by J : Dave Whitinger at LinuxToday sent a link to a mail which clarifies the situation a bit.
IPv6 on other OS's (Score:1)
---
Question: What about IP version 6 (IPv6) support in Open Transport?
Answer: IPv6 is [...blah blah blah...]
IPv6 is being designed to respond to the limitations of IPv4 - including an upcoming shortage of new IP addresses - to allow for the continued expansion of the Internet and deployment on corporate networks. IPv6 also incorporates new functionality to provide security, multimedia support, and plug and play capabilities, features necessary to usher the Internet into the twenty-first century.
At the October 1995 Networld+InterOp trade show, Apple and Mentat demonstrated a prototype of Internet Protocol Version 6 running on Open Transport. The demonstration showed the flexibility of the Open Transport environment - [...OT is wonderful, etc etc...]
Apple and Mentat will continue to work together to ensure timely availability of IPv6 for Mac OS once the standard has been completed.
---
I thought it was interesting anyway. I thought I remembered hearing IPv6 was in OT 2.0 already, but I couldn't find anything verifying it. In any case, OT is easy to extend, and by the time OS X hits, I'm sure the BSD folks will have upgraded their TCP/IP to v6.
Another thing I recall hearing about IPv6 is an improved support for streaming media (since packets aren't well suited for it). I guess that means we'll see an explosion of useless 'webcasts' and a nearly endless amount of new porn sites! We'd probably be able to use IPv4 for another 30 years if the net weren't so crammed full of pointless crap (not that the ol' Internet Coke Machine or Coffee Maker were frivolous
Re:Dumb Question (Score:1)
Re:ipv4=4 8 bit values, ipv6 = 6 8 bit values? (Score:1)
IPv9. (Score:1)
varients on the "Gee wiz that's alot of numbers"
theme I figure I should add my own frivolous post.
For a bit of a giggle check out the RFC for
version 9 of our favorite protocol.
AdamT (at work)
Switchover could cause bigger problems than Y2K. (Score:1)
With the imminent introduction of DSL, together with set-top boxes, internet usage in the home is going to increase significantly, and the currentl limited supply of available IP addresses is a hindrance. Of course techniques such as IP masquerading have ensured that IPv4 numbers have lasted longer, but the limit is still approaching.
Affordable equipment, possibly subsidised by the local/national Telco, available to all will soon be with us. Eventually a net connection will be as common as the telephone. Imagine millions of house-holds in every country with a connection.
Whenever this is introduced, IPv6 must be chosen as the protocol. Implementation and switch-over must be well thought out, and on a scale NEVER seen before. It will make the Year 2000 problems of the present seem like a minor problem in comparison.
I, however, can never see IPv6 being accepted. I have worked in the industry for around 10 years, and have seen numerous projects over-run or fail completly, mainly due to lack of truely technically competant staff. (I have even met a Firewall installer who did not know what an IP port was!). I can see chaos, particullarly if any point-click-drool Microsofties are involved. And don't let the suits run the project, either.
Some of the previous comments here also go against one of my golden rules of computing - if you don't know what you're talking about, keep your mouth shut! Ingnorance leads to disaster.
IPv4 --> IPv6 (Score:2)
According to my Solaris book, this IPv4 address:
222.33.44.83
would be valid in IPv6, and expressed as:
0000:0000:0000:0000:0000:FFFF:222.33.44.83
And could be abbreviated as:
::FFFF:222.33.44.83
IPv6 (Score:5)
There's plenty of IPv6 software to go around, actually - in fact there are many implementations not only of the IPv6 stack, but of protocol layers to allow IPv6 and IPv4 stacks to interoperate. It's just that they're all in beta, and not very many vendors have announced them as products yet. But you can run Linux or *BSD on an IPv6 net today.
In fact, there's a vigorous "6BONE" (like the MBONE) of IPv6-only hosts existing on the current IPv4 Internet via tunneling arrangements. The 6BONE is the proving ground of IPv6 interoperability and routing stuff.
Re:MAC addresses (Score:1)
Actually, once I bought two cheap, no brand ethernet cards, and they both had the same MAC address (all A6's !!!) that was VERY annoying...
Re:IPv6 goes too far. (Score:1)
Re:DNS (Score:1)
*sigh*
Re:1E18 IPs... (Score:1)
Re:I dont think we should haveta pay for ip's (Score:1)
Not really a good idea. The whole point is that your IP addresses depend on where you're linked into the network. Trying to have portable IP addresses would but horrible load on the backbone routers.
Ultimately you should be able to forget about IP addresses and rely on DNS pretty much exclusively -- especially with those 128 bits addresses which will be a PITA to type.
Incidentally, this is why "phone number portability" is so stupid. The phone number should remain something that the switches can route by, just like an IP address. What we need is something like DNS for the phone system -- all phones have a little LCD display, maybe a little keypad. If you haven't got someone's number on quick dial, you can search on their name, and the system would search your local area first and give you a list of matches. Then you could expand geographically if req'd.
Re:Phone number portability (Score:1)
Ahh. Just after I posted the first comment I did wonder about that. In which case we could rearrange 'phone numbers to categorise by something more useful than (just) geographic area and call cost.. You could have different codes for personal, government and commercial numbers... All sorts of things..
Re:Move your number (Score:1)
and/or area codes, but it should work with the same company and code (which is quite
common 'round where I am in the US)
Yes, I think BT do number portability here if you're staying within the same exchange area.
The thing that worries me is that OFTEL seem to be about to force mobile companies to allow customers to take their number with them when they change companies. This seems a little stupid.
Re:more than traffic lights (Score:2)
Eric
--
Re:Uhh... DUMB??!? (Score:1)
--
Re:ipv4=4 8 bit values, ipv6 = 6 8 bit values? (Score:1)
Heh, 16 8 bit values, you just want to make things difficult don't you?
--
Phone number portability (Score:1)
Hmm... I just asked someone who knows more than me (not quite my boss), the translation isn't done (in practice) until the `call' gets to the destination, but your phone number is still effectivly your machine name. The equivalent of your phones IP address is not user visable. The main way your dialed digits are used is for geographic routing: area code and (for NZ (7 digit local numbers, like US/Can)) a three digit switch number. The last four digits get converted to your phones physical address. Think of country level TLDs (eg
.ca, .nz, .us, .uk, etc).
Though this isn't 100% accurate, it's a good basic summarisation. Number Portability is just the stripping of the geographic routing. NP is actually already in heavy use: 0800 (free call) numbers are an execelent example.
Re:1E18 IPs... (Score:1)
Re:more than traffic lights (Score:1)
All I need to do is 1 kernel recompile (and probably update a few IP tools)
:P. Thus is the power of Linux...
Uhh... DUMB??!? (Score:1)
ok. correct me if im wrong, but if a traffic light has an ip address...then that means that SOMEHOW its accessible from the outside world. would you really want someone to be able to "hack" the traffic lights in your neighborhood and play with them at their discretion??? just a thought... other than that i think its cool...
assmodeus
Re:Why IPs should be charged... (Score:1)
Who gives a flying fick in Mercedes has a whole A class. It is not like you were going to get that or that they are runnign out of IPs. Also how do you know that they only use 1%? Maybe they have a huge network.
Also they make a GREAT car and as long as they do that I really don't care what they do with their IP addresses as long as they don't buy them all. Also, I think that it is Diamler-Chrystler now. I will assume you were talking about Diamler (not sure if I am spelling it right.)
IPv6 goes too far. (Score:1)
Here is a scary thought. I am almost scared to share this idea with the world becuase I might give someone an idea. What if everyone were assigned an IP address at birth. this would replace your Social Security Number.
Just think about the horrible possiblities
Re:Gone are the days of remembering ip's. (Score:1)
Your not alone. I too remember ips. When your working in a lab that changes hourly. I know all the ips. I don't even have a DNS on many networks. I make up IPs as I see fit. We have to firewall the lab, to prevent my from messing up the rest of the company, not to keep intruders out.
Re:Home Appliance Scr1pt K1ddi3s. (Score:1)
Re:more than traffic lights (Score:2)
Hmmm and you'll have to get your ISP and everyone up the chain to do the same
Or just set up a tunnel (over IPv4) to the nearest router on the 6bone as is done now.
Initially, there will be a lot of legacy routers around, and a lot of legacy systems (read Windows) that can't talk to an IPv6 number. For that reason, there will be many IPv6 servers with IPv4 aliases.
Re:Home Appliance Scr1pt K1ddi3s. (Score:2)
'scr1pt k1ddi3s' have toolz to hack into your waffle iron. (Model 2?
;))
So remember, ADSL connection == *NIX.
I wonder if new microwaves will have blurbs like: 'It will be most good if you are to put wallfire between not-you and microwave if internet is your telephone' or something to that effect?
more than traffic lights (Score:1)
Re:DNS extensions for IPv6 already defined (Score:1)
Re:More efficient routing ( ever hear of a router (Score:1)
Take for example BGP on a core router. I would not run this on anything with less than 128 MB of RAM today if you want the full routes (I have 256 in my 7206VXR). Imagine once IPv6 starts taking off. I would personally say that routers will get more complicated so as to store routing data in smaller forms in an OSPF kind of way.
Granted you can make a router pretty simple using IPv4 or 6, but if that all anyone ever needed Ascend would only seel their P50's which are about the min I would go with. Also as speeds increase so must the chips and software tricks.
Kashani
Re:Linux ipv6 (Score:1)
> ipv6 network.
Strike allegedly. They have IPv6 code, but not in production code, only in experimental code.
DNS extensions for IPv6 already defined (Score:1)
They have already defined an AAAA record for IPv6 addresses in DNS. I'm not sure how they're going to do reverse DNS zones, though.. reverse DNS for IP addresses is much more challenging than the forward records are.
IPv6 is very interesting stuff.. I spent a few weeks writing code for Ganymede that can do the encoding/decoding of IPv6 addresses.. hopefully people will be able to use Ganymede for IPv6 DNS management when the time comes.
water density (totally off-topic) (Score:1)
Sun is ready for IPv6 (Score:1)
There is a rumor going around that Solaris8 will be IPv6 ready [sunhelp.org]. But if you want to play around with IPv6 on your solaris box, you are welcome to try [sun.com].
Just so you don't think the commercial unices don't want to play with linux.
my 15 minutes of stupidity is due.. (Score:2)
..sorry, I HAD to..
Debians Got it (Score:2)
I don't think all daemons/apps are there yet, but the basic net tools have it.
kind of suprised me when i ran ifconfig and saw:
eth0 Link encap:Ethernet HWaddr 00:40:05:A5:37:69
inet addr:10.1.6.1 Bcast:10.1.6.255 Mask:255.255.255.0
inet6 addr: fe80::240:5ff:fea5:3769/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1054638 errors:0 dropped:0 overruns:0 frame:0
TX packets:1724824 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x6800
is that ipv6 address random? hmmmm....
--
Marques Johansson
displague@linuxfan.com
Re:Windows clients? (Score:1)
The majority of what would be considered the internet runs on various flavors of Unix.
I'll allow that the majority of web browsers are likely Windows based, but that means little since IPv6 provides backward compatibility for low end systems (read Windows).
Re:1E18 IPs... (Score:1)
Re:Errr... Why? (Score:1)
Re:IPv6 (Score:1)
IPv6 of course solves all this.
Re:Linux ipv6 (Score:1)
Re:IPv6 programming API? (Score:1)
Re:It about fscking time (Score:1)
Re:Dumb Question (Score:1)
Re:Yes, you're wrong (Score:1)
Re:Debians Got it (Score:2)
Re:Windows clients? (Score:4)
See if you want to track down versions for your favorite OS.
Re:Maybe IPv6 is still not enough (Score:1)
Re:I dont think we should haveta pay for ip's (Score:1)
The phone number can be the DNS entry, and the telco can assign an IP address to it. You could then call me using the DNS entry of att://250.555.1212/FFFish (as opposed to my wife, @ att://250.555.1212/Crayola). Or you could use my current IPv6 address, of 209.153.188.248.35.88.96/FFFish. When I bugger off to another city, the DNS address (250.555.1212) would stay the same; but it'd be routed to another IP address.
Just because a name is numeric doesn't make it an IP address instead of a DNS entry. (Or, rather, it's just convention that the DNS entry is alphabetic, not alphanumeric...)
Re:IPv6 (Score:1)
>moles of IP numbers in the IPv6 namespace.
If we were talking about water, then 1M of water is 18g. So 1e15 moles of water would be 2e15g, which is 2e15cm^3 of water. This is 2e12L of water. Or a cube approx 1e5cm on a side, so we're talking about 1 cubic kilometer of water, give or take.
Not a drop in the ocean, but still >> the number of atoms in the universe.
Re:Unicast, Anycast and Multicast; CoS and flowlab (Score:1)
We can finally get rid of crappy ass round robin DNS.
---
Openstep/NeXTSTEP/Solaris/FreeBSD/Linux/ultrix/OS
MAC addresses (Score:1)
(I'm assuming that each MAC should have it's own unique ID number...)
Unicast, Anycast and Multicast; CoS and flowlabels (Score:3)
- Unicast is when a packet goes to exactly one destination and is what IPv4 uses most of the time (e.g. for http etc)
- Multicast is as konstant said, you send out one packet to a 'group address' and it gets replicated only where necessary - generally each link sees only one copy of each packet, so it's an efficient way to send audio, video or even files to a large audience. This is also in IPv4.
- Anycast is new in IPv6 - as I understand it, it lets you specify that any of a set of hosts can get the packet (but not all of them, as in multicast). It's useful for lots of things such as load balancing across servers - not sure if it does topologically-distant load balancing but it would be handy if it does.
One other misconception: IPv6 has two main features for class of service / quality of service, both in the IPv6 header:
- Traffic Class - single byte, equivalent to the IPv4 Type of Service byte, carries the class of service - will be a diffserv codepoint (number) once this is standardised, as is happening quite fast. Same codepoints work over IPv4 and IPv6 networks. Typically you assign different codepoints to VoIP, mission-critical apps, web browsing, etc - many apps share the same CoS.
- Flow Label - this is designed to make RSVP work better, allowing a single flow (e.g. ftp session) to be given a unique ID so that routers downstream of this label assignment can more quickly recognise (classify) packets in this flow (rather than looking at IP addresses, TCP/UDP port numbers, and IP protocol).
For more information on QoS/CoS (though not IPv6 specific) see, or the links page.
Re:Its not only about address space (Was: Why IPv6 (Score:3)
QoS I think is in the main header (Class byte and Flow Label). As for packet spoofing, IPv6 simply makes IPsec mandatory, whereas it is optional with IPv4 - however, this is an important step. Of course, IPsec means that much traffic is encrypted (potentially) making it harder to do QoS except by letting the host do its own CoS marking and/or RSVP reservations (which let you guarantee bandwidth end to end IF the network has RSVP enabled).
The interesting stuff for Linux here is Linux-Diffserv and the Linux port of RSVPD, which enable the host to do CoS marking and RSVP reservations. However, unlike Win2000, the *nix world does not have a unified QoS API - some work to be done there for *nix to remain competitive IMO.
There is a lot of work going on in the IETF around QoS, CoS, and policy (i.e. rules that govern which apps/users get which QoS/CoS). Werner Almesberger, the Linux Diffserv guy, is at the IETF this week (as I am) and gave a presentation at the Diffserv deployment BOF.
Interestingly, Linux is way ahead of most OSs and routers in its Diffserv implementation, and apparently it can fill an OC-3 (155 Mbps optical) line while doing CBQ queuing (flexible allocation of bandwidth, see for links), with 12,000 policy rultes. For those who are not in the CoS business, this performance is extremely impressive compared to some commercial routers - just buy a cheap headless PC and you have a $1000 access router with Diffserv CoS, which can also do firewalling, IPsec VPNs, etc.
If anyone's doing trials of Diffserv and wants a tool to manage policy rules for CoS efficiently, email me
Re:MS washing their hands (Score:1)
numbers." Bill Gates, The Road Ahead, Viking Penguin (1995)
Tell ol' Bill that for a suitable sum I'll give him an algorithm that factors large prime numbers in linear time proportional to the size of the prime.
(Or constant time, if time for transmission doesn't count..)
Re:more than traffic lights (Score:2)
Re:more than traffic lights (Score:2)
/dev/tcp me baby.
Re:Windows clients? (Score:2)
Re:I dont think we should haveta pay for ip's (Score:2)
Many companies already allocate a block of addresses for mobile clients, which could end up connecting to any modem pool. Basically that particular block is a VLAN, and often ends operating over a VPN, so your company is spared the routing headache.
Imagine that, YOU having an IP address that designates YOU. Scary thought, eh?
Re:IPv6 goes too far. (Score:1)
What's the difference?
Gone are the days of remembering ip's. (Score:1)
But seriously. I just remember the ip's of a lot of the boxen I connect to. Guess that will have to stop.
HACK THE LIGHTS!!! (Score:2)
If some cr/hacker dares to break into my toaster and change my settings though, I'll be pissed.
Call me old fashioned, but some things don't need their own IPs.
Now, off to firewall my bread maker,
W
-------------------
Re:IPv6 Specification (Score:1)
Re:IPv6 (Score:1)
Happy Graduation day, internet!
Consciousness is not what it thinks it is
Thought exists only as an abstraction
Re:Debians Got it (Score:1)
by wrapping an IPv6 compatible address around
your MAC address.
I believe (if I recall correctly) that IPv6
has generated a site-local address (sort of
equivalent to IPv4 private addressing) out of
your MAC.
Re:more than traffic lights (Score:1)
by colons.
It looks like:
3ffe:1cf8:ff01:0:0:0:0:1 or:
fe80:0:0:0:0:0:cc60:c0a
where the first 64 bits is the network and
the last 64 bits is the host.
IPv6 assignments (Score:5)
won't be initially assigning IP addresses to end users or sites. Instead, they'll be making sub-delegations to TLA registries (a sub-continental registry that will make allocations after the 1st 16 bit boundary of an
ipv6 subnet). So, ARIN, APNIC, and RIPE will begin
issuing TLA's to the TLA registries, who in turn,
will begin making allocations at the NLA level level. These NLA assignments will go to large ISP's. Assignments to individual sites and end-users will be carved out of these NLA assignments.
The last 64 bits is a hard boundary reserved for
the host ID (based on the next-generation EUI-64
MAC address).
Glossary:
TLA: Top-Level Aggregator
NLA: Next-Level Aggregator
SLA: Site-Level Aggregator
Re:Windows clients? (Score:1)
Part of Microsoft Research's stack is a DLL which allows Internet Explorer (4.0 only) talk to IPv6 websites. I've tried it out, and it worked quite well. Still needs some work, but it will get there.
Also, there is a site called "Freenet6" () which offers free, web setup based IPv6 tunnels for both Linux and NT. It's not a subnet (so you can't use it as a route through a Linux system), but it does allow testing of end user application. I've setup addresses for both a NT and Linux machine and the service works great. Now, I just need a few more applications to play with.
--dkm
Re:6bone (Score:1)
An easier way than 6bone for testing client implementations is through Freenet6 (). It uses a web form method to get a tunnel assigned that will work with Linux or NT machines. It's only an end of address (you can't use it as the front for a router), but it works great for testing the end user implementation. It allowed me to get IPv6 up and connected on Linux system here.
There are instructions for setting up the Linux IPv6 support at. de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO.html [bieringer.de]. I've followed it as far as updating my net-tools and traceroute and then hooked up the Freenet6 tunnel. With that, I've been able to FTP out to some IPv6 only sites for testing. Works great!
--dkm
Re: Tunnels and Instructions Links (Score:1)
Let me pass along two links.
The first,. de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO.html [bieringer.de], contains detailed instructions for updating a Linux system to IPv6.
The second, [freenet6.net], is an automated service for getting a tunnel to the 6Bone. This is an end station address (can't be used for a router), but it lets you test the client applications for talking to anywhere on the 6Bone.
--dkm
Re:more than traffic lights (Score:1)
IPv6 will only come online properly when everyone has it. Perhapes IANA should set a date by which all ISPs (and their customers) should be IPv6-Ready and then switch it on overnight....
Re:Ubiquitous computing, anyone? (Score:1)
Didn't you just say your milk is running Linux - No worries !!
DNS (Score:1)
it's ok now to have a pay-for-everything DNS system, since numeric IPs are sort-of-possible to remember and keep track of. But it will be hard to keep track of things like 3ffe:1cf8:ff01:0:0:0:0:1, especially once they get more complex.
have they thought about the usability-by-humans implications of IPv6? do they just expect everyone to pay for a domain, or do they expect a bunch of equivilents of *.ml.org to appear?
Then again, the entire DNS system will have to be revised to hold IPv6 numbers anyway, so setting a completely new system up shouldn't be too hard.. hopefully they'll do the dns thing _right_ this time.
Re:more than traffic lights (Score:1)
I want IP addresses for all *my* protons...
It's 128Bit... (Score:1)
Re:Dumb Question (Score:1)
Re:Home Appliance Scr1pt K1ddi3s. (Score:3)
Yeah, it will be called "Burnt Orifice."
Re:more than traffic lights (Score:1)
3FFE:1CF8:FF01:0:0:0:0.0.0.1
Re:Uhh... DUMB??!? (Score:1)
Errr... Why? (Score:1)
Reminds me of that bit that they presented
at some convention or another in the UK, the
combination television, microwave, and
internet-capable computer... so you could "make
a pizza, browse the web, and catch up on the
latest episode of Friends".
Dear god. When will the hurting stop?
Yes, you're wrong (Score:1)
MacOS X will have IPv6 support.... (Score:1)
They showed an IPv6 version of traceroute running at WWDC as a demo. They ping/traced to the dev centers in Japan just to prove it worked... I'm sure it'll be widely accepted once all the software is ready.
Re:Maybe IPv6 is still not enough (Score:1)
-bonkydog
Re:water density (totally off-topic) (Score:1)
(That's why, in case there are any fellow scuba divers hanging around here, you need to give yourself more weight when diving in the ocean; salt water is denser, so you don't sink as easy.)
Move your number (Score:1)
Assuming all phone switches work basically the same (user 1 picks up, dials, switch plugs in user 2, hangup, repeat) then your "extension" (phone number") is really tied to a port on a card in a box somewhere. SO, when you move, they swap the port numbers.
I.E. Where I work, ext. 228 is port A0107, for box A, card 1, port 7. Now, say I change offices, but don't want to change extensions? My new office is prewiered to port A0412. Quick issue of "cha ext 228" command, tab-tab A0402, "SAVE" (enter) and viola, i've moved.
Naturally, this is a pain in the arse, if not impossible, between different phone companies and/or area codes, but it should work with the same company and code (which is quite common 'round where I am in the US)
Re:Dumb Question (Score:4)
Re:IPv6 (Score:1)
Re:more than traffic lights (Score:1)
IPv6 programming API? (Score:2)
Or are the changes just to deal with incompatibilities like the colon seperater in IPv6 addresses conflicting with URLs?
Re:IPv6 programming API? (Score:1)
Re:ipv4=4 8 bit values, ipv6 = 6 8 bit values? (Score:2)
Re:Home Appliance Scr1pt K1ddi3s. (Score:1)
Especially since, unfortunately, a lot of these things will be running Wince. Maybe they'll realise there's a problem once all these houses start getting burnt down by hacked kitchen appliances.
:) Anyway..
finally! (Score:4)
woohoo! now I can finally telnet to my neighbor's toaster and burn his toast!
Dumb Question (Score:3)
Toasters and traffic lights? Let's get realistic.. (Score:2)
Re:IPv6 programming API? (Score:3)
If you're just using normal (stream or datagram) sockets, the interface isn't very different. The main issues are that you're now in the AF_INET6 domain, and sockaddr_* structs for IPv6 have a different address layout. Apart from that, your code should be pretty much the same.
You can avoid having to worry about this by using the POSIX getaddrinfo() function, but sadly it's not available everywhere yet.
Why IPv6 (Score:5)
Class A: For big monster domains like ARPAnet
2^7 domains*16 million hosts each
Class B: For medium domains like your ISP
2^14 domains*65536 hosts each
Class C: For subnets and labs and stuff
2^22 domains*255 hosts each
Class D: For subnet-only multicast
Class E: nobody ever really used this
Trouble was that everybody wanted something bigger than C, but didn't really need all the addresses in B. So a lot were wasted every time a B class was assigned. There are some kludgy solutions like masking and sewing together lots of C's into one bigger domain, but they all are horribly complicated and a waste of brainpower as anybody who has ever taken a networking course can attest
A second problem was that IPv4 was basically all about sending text from one spot to another, and there was a lack of optimization for high-prio data and multicast data like streaming video. The reason you'll see a lot of patches for IPv6 stuff is not that it isn't backwards compatible with IPv4 so much as that IPv6 has lots of cool features people will want to take advantage of. For example, you can mark the priority of your packets on a scale of (I think?) 1-5, with servers optionally enforcing these values. When a server was in the process of getting slashdotted for example (or some other DoS attack
As another example, the IPv6 packet structure basically lets you chain "extensions" onto your packet, giving you a sort of dynamic packet size.
Another biggie is internet-wide multicasting. A group of people receiving the same streaming video wouldn't have to be sent separate copies from the originating server. It could send one and have intermediate routers spawn copies.
A lot of the pain of setting up a new host is also eliminated. There's some kind of dynamic search-and-allocate thing built in that I don't remember well enough to discuss. Something about new hosts asking their neighbors for a globally unique IP address and eventually getting one.
There's more. Get Tanenbaum's book on networking and find out for yourself.
-konstant
Re:Maybe IPv6 is still not enough (Score:2)
If you assume that the radius of the universe is 15 billion light-years, the volume of the universe (assuming it's spherical) would then be 1.419e23 cubic meters. Given IPv6 has 2^128 addresses, this corresponds to one IPv6 address for every 3.5178e31 cubic meters.
This might not sound like a lot of addresses for the corresponding space. However:
Take the volume of the Solar System to be a sphere centred on the Sun with a radius equal to Pluto's orbit (5,913,520,000,000 meters). The volume of the Solar System is thus 1.08277e38 cubic meters. Using the above figure, we find that for every Solar System-sized chunk of the universe would get just over three million IPv6 addresses. Since the universe is not jam-packed with solar systems, the number of IPv6 addresses per solar system would correspondingly increase. This increase depends on how many solar systems there are, of course, and how densely packed they are. One could easily assume that each solar system would get on the order of 10^18 IPv6 addresses (i.e. there's one solar system for every 3e11 solar system-sized chunk of the universe), which is about 200 million times more IP addresses than the Earth currently has with IPv4.
Conclusion:
IPv6 should provide enough addresses for the known universe. However, because it's always better to be safe than sorry, it is the recommendation of this researcher that IPv8 (2^256 addresses) be implemented before any serious space travel is to be undertaken.
6bone (Score:2)
Linux ipv6 (Score:2)
In order to use ipv6 you will need to add libraries, upgrade to glibc 2.1 and upgrade your BIND, telnet, and finger daemons. There are also patches available to INN.
You can see the how-to (written by Eric Osborne) at.
I don't know of any browsers now available for ipv6 but I bet Netscape and MS will be racing to provide them. Cisco allegedly has router OS upgrades that will allow their boxes to be used on an ipv6 network.
|
https://slashdot.org/story/99/07/15/2312205/iana-deploying-ipv6
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Hi, everybody! I'm a real newbie to Java programming and I'm sure I've come to the right place for help. Anyways....I have an assignment that reads like so:
Create two files using any word processing program or text editor. Write an application that determines whether the two files are located in the same folder. Save the file as SameFolder. java.
I'm assuming that I need to construct some sort of IF statement utilizing the public boolean exists() method. But whenever I try to use that method or the isDirectory() method the program won't compile and I get a "cannot find symbol" error right at the exists() and isDirectory() methods. Here's what I have so far:
import java.nio.file.*;
import static java.nio.file.AccessMode.*;
import java.io.IOException;
public class FileTest
{
public static void main(String[] args)
{
Path path = Paths.get("C:\\Program Files\\Java\\FirstFile.txt");
Path bPath = Paths.get("C:\\Program Files\\Java\\SecondFile.txt");
if(Path.exists(Path path) && Path.exists(Path bPath)
{
System.out.println("Files exist in same folder");
}
}
}
Please note that I have to use the new Paths class. Statements like "File bPath = new File(file1)" cannot be used. Thanks in advance
|
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/15190-need-help-javas-paths-class-printingthethread.html
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
For this assignment you are to write a program that handles text files. The assignment requires three classes (plus library classes); we've given you two - FreqStudy, the driver, and another class, WordCount.
FreqStudy.java
Code Java:
import java.util.*; import java.io.*; public class FreqStudy{ public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); System.out.println("enter file name"); String fileName = scan.next(); Scanner scan2 = new Scanner(System.in); System.out.println("enter words to search for"); System.out.println("enter lower case, separated by spaces"); String wordString = scan2.nextLine(); WordFreq f = new WordFreq(fileName,wordString); f.readLines(); f.reportFrequencies(); } }
WordCount class
Code Java:
public class WordCount{ private String word; private int count; public WordCount(String w){ word = w; count = 0; } public String getWord(){ return word;} public int getCount(){ return count;} public void incCount(){count++;} public String toString() { return(word + " --- " + count); } public boolean equals(Object other){ WordCount i = (WordCount)other; return (this.word.equals(i.word)); } }
As demonstrated in the example run above, an external text file name is entered first. Then any number of individual words are entered, all lower case, and separated by spaces. After doing its analysis, the program then displays a chart that gives the frequencies in the text of the indicated words, to four decimal places. Thus 2.42% of all of the words in the Heart of Darkness text file are "I", 1.33% are "he", and so forth. Pretty clearly Heart of Darkness is narrated in the first person, and is mostly about men.
Further requirements and tips:
* you MUST use an array of WordCount objects to keep track of the occurrences of the indicated words.
* Use printf from Chapter 5 to format your output.
* If s is a String, then this String class method call:
s.split(" "); // this is a single space surrounded by quote marks
returns an array of strings that consists of the tokens (separated by white space) in s. For example, given
String s = "i he his she hers";
String[] words = s.split(" ");
Then words is this five element array of strings: {i, he, his, she, hers}
At the course website we've provided some tips for solving this problem, and in addition we've provided some text files that you might want to experiment with. Thus we urge you to check the ProgramNotes link at the course website for further information about the assignment.
In the box below, enter your WordFreq code. Be sure to comment your code. (As usual, do not add/use additional import statements)
This is the code I have this far but I know that it is wayyy offfThis is the code I have this far but I know that it is wayyy offfCode Java:
import java.io.IOException; import java.util.*; public class WordFreq extends Echo{ private String wordString; private int ct = 0; private String total = ""; private WordCount[]words = new WordCount[8]; private String[]count; private String[]wordString2; private String s; public WordFreq(String f, String w)throws IOException{ super(f); wordString = w; } public void processLine(String line){ wordString2 = wordString.split(" "); s = line; total += s + " "; count = total.split(" "); for(int j = 0; j < count.length; j++){ words[j] = new WordCount(count[j]); } for(int j = 0; j < wordString2.length; j++){ if(wordString2[j].equals(words[j].getWord())){ words[j].incCount(); } } }
CAN'TTT even begin to explain how confused I am. Someone please help!
|
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/27898-java-help-pleaseeeeeeee-printingthethread.html
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Hello my friends, I'm Panos and this is my first post here in CBoard Forums :D
Take a look to my C++ code:
No errors. Let's launch this:No errors. Let's launch this:Code:
#include <iostream>
#include <string>
int main()
{
std::cout << "What is your name? ";
std::string name;
std::cin >> name;
std::cout << "Hello, " << name << std::endl << "And what is yours? ";
std::cin >> name;
std::cout << "Hello, " << name << " nice to meet you too!" << std::endl;
return 0;
}
Attachment 9434
Everything work perfect. Now let's launch it again giving two names (firstname & lastname) as input.
Attachment 9435
As you can see, it doesn't prompt me to insert the second name because it uses the my lastname (Georgiadis) and treat it like this way.
Is there any way to avoid this happening ?
|
https://cboard.cprogramming.com/cplusplus-programming/121539-two-name-into-one-string-variable-problem-printable-thread.html
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
CodePlexProject Hosting for Open Source Software
Hi guys,
I am using blogEngine.net 1.5 and am having some crazy problem with jQuery that I just cannot figure out.
I've tried all of the tips I could find on the net - $j = jQuery.noConflict();, etc, but no luck, it's stressing me out now because I am in a timebox with a project. Any help would be most appreciated.
Problem:
jQuery code called on specific pages (default.aspx, post.aspx, and other static pages) does not execute - even with $j. This is the kind of snippet used on post.aspx, and some of our statics - we fire off a function in
our common.js file that does operations relevant to that page.
<asp:Content
<script type="text/javascript">/*<![CDATA[*/ Namespace.Common.setCurrentPage("articles"); //fires, runs JS, but not jQuery code alert("a javascript alert"); //JS code works $j("body").addClass("test-default"); //jQuery does not work/*]]>*/</script>
</asp:Content>
The main JS file, is as follows. I've changed the namespace name to 'Namespace' for this example.
/*
* Javascript for Namespace.website.com
*
*
* Date: 05-07-2009
* Author: Phil Ricketts
*/
var $j = jQuery.noConflict(); //It was worth a shot
var Namespace= window.Namespace|| {};
// Common functions.
Namespace.Common = function() {
return {
handleError: function(msg) {
alert(msg);
},
hideFocus: function() {
$j("a").click(function(e) {
this.blur();
});
},
currentPage: function() {
var url = document.URL;
var docExt = url.substring(url.length, url.lastIndexOf('/') + 1);
var doc = docExt.substring(0, docExt.lastIndexOf('\.'));
var docPure = doc.replace(/-/g, "").toLowerCase();
//alert("url: " + url + "\r\ndocExt: " + docExt + "\r\ndoc: " + doc + "\r\ndocPure: " + docPure);
$j("ul.niche li." + docExt).addClass("current"); //niche
$j("#nav-top li." + doc.toLowerCase()).addClass("current"); //main navigation highlights
$j("#nestedcategorylist li." + docPure).addClass("current"); //makes main and sub cats current, if current page
$j("#nestedcategorylist li." + docPure + " ul.sub").removeClass("hide"); //shows sub cats
$j("#nestedcategorylist li." + docPure).addClass("current"); //shows sub cats
$j("#nestedcategorylist li ul.sub li." + docPure).parent("ul").removeClass("hide").parent().addClass("current"); //makes sub cat parent current
if ($j.exists("#nestedcategorylist li." + docPure)) { $j("#nav-top li.articles").addClass("current"); }
},
setCurrentPage: function(page) {
page = "#nav-top ." + page;
$j(page).addClass("current"); //why does this not work
},
init: function() {
Namespace.Common.hideFocus();
Namespace.Common.currentPage();
}
}
} ();
// FAQ page functions.
Namespace.Faqs = function() {
return {
setupFaqs: function() {
/*
$j("#page.faqs div.faqitem p").hide();
$j("#page.faqs div.faqitem").each(function(index) {
this.addClass("test" + index);
});
*/
},
init: function() {
Namespace.Faqs.setupFaqs();
},
test: function() {
alert("test is working");
$j("body").addClass("test-using-j"); //no work - why?
$("body").addClass("test-using-dollar"); //no work
jQuery("body").addClass("test-using-jquery"); //no work
}
}
} ();
// DOM ready
$j(function() {
Namespace.Common.init();
});
// Extend jq fn
$j.exists = function(selector) { return ($(selector).length > 0); }
So, on JS load, everything fired on Namespace.Common.init(); works fine as expected.
When I try to call a function like setCurrentPage(); from a static page, it executes the function, but doesn't execute any jQuery code.
Please offer any advice, it's really stumped me - I'm not a JS expert.
Thanks,
Phil
So are you getting an error, or is it just not doing anything? At run time, what is the value of $j, has it correctly idetified the jQuery alias.
Are you using Firefox with Firebug?
morley wrote:
So are you getting an error, or is it just not doing anything? At run time, what is the value of $j, has it correctly idetified the jQuery alias.
The jQuery code does nothing, 'natural' javascript works fine. Everything in currentPage(); works using $j - and $j's functions shows up correctly under DOM in Firebug.
Are you using Firefox with Firebug?
I swear by it.
The jQuery code does nothing, 'natural' javascript works fine. Everything in currentPage(); works using $j - and $j's functions shows up correctly under DOM in Firebug.
Are you using Firefox with Firebug?
I swear by it.
OK cool, so from the code you've posted you're trying to find an element like
#nav-top .articles
Put a breakpoint in the setCurrentPage function on line $j(page).addClass("current"). Refresh your page so code execution runs, you should hit the breakpoint. Leave code execution there and switch to the console tab
Run a few commands in the console tab, lets see if jQuery if functioning OK and can find your element. First, lets find the body - next to >>> command prompt, run
jQuery['body'], it should evaluate and return the [body] response. Can you confirm you are finding that OK? At the very least, it should return empty square brackets which indicate jQuery didn't find anything
If that was OK, try looking for a specific named element, e.g run $j('#nav-top .articles').html()
or whatever, for an element in your DOM you definitely know exists.
Does console window find your element OK?
Just trying to narrow down where it's failing. Once you've finished in console window, press F8 to complete code execution
@morley, thanks so much for your advice - I'll get to this asap.
In the meantime, I've got this error (in IE8) which still leaves me clueless. I tried getting a new copy of jQuery, but the same thing happens:
That's just saying jQuery is throwing an exception, probably because you've given it an element that's invalid for the operation. jQuery will throw an exception if say you pass it null and it's expecting an object to iterate over.
Put a try->catch around the offending code to see what the exception is, e.g
try {
// Your code that is failing
}
catch (e) {
alert(e.message);
}
try {
// Your code that is failing
}
catch (e) {
alert(e.message);
}
This might give you a more descriptive error message so you can see what's going wrong. My problems with jQuery are always self inflicted, usually things like not finding the elements I'm expecting on the page.
I find the debugging technique I described in the previous post quite useful, it lets you evaluate jQuery statements and analyse your DOM. The try catch can be helpful, but a few breakpoints in the right locations will always be more useful :)
this might seam dumb, but is your code beeing run once the DOM is ready ? $('document').ready( function () { ... });
hope it helps ...
Are you sure you want to delete this post? You will not be able to recover it later.
Are you sure you want to delete this thread? You will not be able to recover it later.
|
http://blogengine.codeplex.com/discussions/65443
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Anki has been kind enough to let me play with their new Cozmo unit and explore their SDK. Cozmo is a wonderful device, developed by people who understand a lot of core principles about human interaction and engagement.
Cozmo is adorable. When it recognizes your face, it wriggles with happiness. It explores its environment. When it’s bored, it sets up a game to play with you. It can get “upset” and demand attention. It’s one of the most personable and delightful robots I’ve played with.
At its heart is a well-chosen collection of minimal elements. The unit can move around the room, with a 4-wheel/2-tread system. It includes an onboard forklift that can rise and fall, an OLED “face” that expresses emotion, and a camera system that ties into a computer vision system,
which I believe is based on PIL, the Python Image Library. (Anki tells me that Cozmo’s vision system “does not use PIL or Python in any way, though the Python SDK interface uses PIL for decoding jpegs, drawing animations, etc.”)
Three lightweight blocks with easily-identified markings complete the Cozmo package, which Cozmo can tap, lift, stack, and roll.
Between its remarkable cuteness and its vision-based API, it’s a perfect system for introducing kids to programming. I was really excited to jump into the SDK and see how far I could push it.
Here is Anki’s “Hello World” code (more or less, I’ve tweaked it a little) from their first developer tutorial:
import sys import cozmo ''' Hello Human Make Cozmo say 'Hello Human' in this simple Cozmo SDK example program. ''' def run(sdk_conn): robot = sdk_conn.wait_for_robot() robot.say_text("Hello Human").wait_for_completed() print("Success") if __name__ == '__main__': cozmo.setup_basic_logging() try: cozmo.connect(run) except cozmo.ConnectionError as err: sys.exit("Connection error 😬: %s" % err)
Although simple, this “Hello World” includes quite a lot of implementation details that can scare off young learners. For comparison, here’s the start of Apple’s tutorial on Swift “Learn to Code”:
There’s such a huge difference here. In Apple’s case, everything that Byte (the main character) does is limited to easy-to-understand, simple calls. The entire implementation is abstracted away, and all that’s left are instructions and very directed calls, which the student can put together, re-order, and explore with immediate feedback.
In Anki’s code, you’re presented with material that’s dealing with set-up, exceptions, asynchronous calls, and more. That is a huge amount of information to put in front of a learner, and to then say “ignore all of this”. Cozmo is underserved by this approach. Real life robots are always going to be a lot more fun to work with than on-screen animations. Cozmo deserved as simple a vocabulary as Byte. That difference set me on the road to create a proof of concept.
In this effort, I’ve tried to develop a more engaging system of interaction that better mirrors the way kids learn. By creating high level abstractions, I wanted to support the same kind of learning as “Learn to Code”. Learn to Code begins with procedural calls, and then conditional ones, and moving on to iteration and functional abstraction, and so forth.
My yardstick of success has been, “can my son use these building blocks to express goals and master basic procedural and conditional code?” (I haven’t gotten him up to iteration yet.) So far, so good, actually. Here is what my updated “Hello World” looks like for Cozmo, after creating a more structured entry into robot control functionality:
from Cozmo import * # run, cozmo, run def actions(cozmoLink): '''Specify actions for cozmo to run.''' # Fetch robot coz = Cozmo.robot(cozmoLink) # Say something coz.say("Hello Human") Cozmo.startUp(actions)
Not quite as clean as “Learn to Code” but I think it’s a vast improvement on the original. Calls now go through a central Cozmo class. I’ve chunked together common behavior and I’ve abstracted away most implementation details, which are not of immediate interest to a student learner.
Although I haven’t had the time to really take this as far as I want, my Cozmo system can now talk, drive, turn, and engage (a little) with light cubes. What follows is a slightly more involved example. Cozmo runs several actions in sequence, and then conditionally responds to an interaction:
from Cozmo import * from Colors import * # Run, Cozmo, run def actions(cozmoLink): '''Specify actions for cozmo to run.''' # Fetch robot coz = Cozmo.robot(cozmoLink) # Say something coz.say("Hello") # Drive a little coz.drive(time = 3, direction = Direction.forward) # Turn coz.turn(degrees = 180) # Drive a little more coz.drive(time = 3, direction = Direction.forward) # Light up a cube cube = coz.cube(0) cube.setColor(colorLime) # Tap it! coz.say("Tap it") if cube.waitForTap(): coz.say("You tapped it") else: coz.say("Why no tap?") cube.switchOff() Cozmo.startUp(actions)
And here is a video showing Cozmo executing this code:
If you’d like to explore this a little further:
- Here is a video showing the SDK feedback during that execution. You can see how the commands translate to base Cozmo directives.
- I’ve left a bit of source code over at GitHub if you have a Cozmo or are just interested in my approach.
As you might expect, creating a usable student-focused learning system is time consuming and exhausting. On top of providing controlled functionality, what’s missing here is a lesson plan and a list of skills to master framed into “Let’s learn Python with Cozmo”. What’s here is just a sense of how that functionality might look when directed into more manageable chunks.
Given my time frame, I’ve focused more on “can this device be made student friendly” than producing an actual product. I believe my proof of concept shows that the right kind of engagement can support this kind of learning with this real-world robot.
The thing that appeals most to me about Cozmo from the start has been its rich computer vision capabilities. What I haven’t had a chance to really touch on yet is its high level features like “search for a cube”, “lift it and place it on another cube”, all of which are provided as building blocks in its existing API, and all of which are terrific touch points for a lesson plan.
I can easily see where I’d want to develop some new games with the robot, like lowering reaction time (it gets really hard under about three quarters of a second to tap that darn cube) and creating cube-to-cube sequences of light. I’d also love to discover whether I can extend detection to some leftovers my son brought home from our library’s 3D printer reject bin.
Cozmo does not offer a voice input SDK. It’s only real way to interact is through its cameras (and vision system) and through taps on its cubes. Even so, there’s a pretty rich basis to craft new ways to interact.
As for Anki’s built-ins, they’re quite rich. Cozmo can flip cubes, pull wheelies, and interact in a respectably rich range of physical and (via its face screen) emotional ways.
Even if you’re not programming the system, it’s a delightful toy. Add in the SDK though, and there’s a fantastic basis for learning.
- Ordering Cozmo: anki.com
- SDK Home:
- Developer forums:
- SDK Documentation:
One Comment
I can’t wait to use some of my time off to monkey around with my cozmo. Thanks for writing this up.
|
http://ericasadun.com/2016/12/12/programming-cozmo/
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Introduction: Keyfob Deadbolt
The
Step 1: Mounting Parts
I
Disclaimer: I am not a programmer and therefore the below code may not be the most efficient. Feel free to improve the code for your own uses if you see any errors or problems. It works for me so I hope it works for you.
// turn CW to lock and CCW to unlock
//1700 CCW; 1500 Stop; 1300 CW
//written by Chris Rybitski
#include <Servo.h>
Servo deadbolt; // create servo
const int CWLimit = 6; // Limit Switch on 6 Unlock
const int CCWLimit = 7; // Limit Switch on 7 Lock
const int Redbtn = 12; //red push button
const int Blackbtn = 8; //black push button
const int GreenLED = 10; // Green LED
const int RedLED = 11; //Red LED
const int Ch1 = 5; //rf channel 1
const int Ch2 = 4; //rf channel 2
const int Buzz = 9; //buzzer
int Unlock = 0;
int Lock = 0;
int timer = 0;
boolean UnLcomplete = false;
boolean Lcomplete = false;
void setup()
{
Serial.begin(9600);
deadbolt.attach(3); // attaches the servo
pinMode(GreenLED, OUTPUT);
pinMode(RedLED, OUTPUT);
pinMode(Buzz,OUTPUT);
pinMode(CWLimit, INPUT);
pinMode(CCWLimit, INPUT);
pinMode(Redbtn, INPUT);
pinMode(Blackbtn, INPUT);
pinMode(Ch1, INPUT);
pinMode(Ch2, INPUT);
//set LED's and Buzzer to be off by default
digitalWrite(GreenLED, HIGH);
digitalWrite(RedLED, HIGH);
digitalWrite(Buzz, HIGH);
}
void loop()
{
if (digitalRead(Ch1) == HIGH || digitalRead(Redbtn) == LOW){ //If remote or button is pressed
if(UnLcomplete == false){ //dont run unlock if door is already unlocked
Serial.println("UnLock");
Unlock = 1;}}
if (digitalRead(Ch2) == HIGH || digitalRead(Blackbtn) == LOW){ //If remote or button is pressed
if(Lcomplete == false){ //dont run lock if door is already locked
Serial.println("Lock");
Lock = 1;}}
//---------------UNLOCK-------------------------
if (Unlock == 1){
timer = 0;
while (digitalRead(CWLimit) == LOW){
if (timer > 1500){
digitalWrite(Buzz, LOW);
delay(500);
digitalWrite(Buzz, HIGH);
}
else{
deadbolt.write(1700);
timer++;
delay(1);
}}
deadbolt.write(1500); //servo stop
digitalWrite(RedLED, LOW);
digitalWrite(GreenLED, HIGH);
UnLcomplete = true; //unlock complete
Lcomplete = false; //reset Lock boolean
digitalWrite(Buzz, LOW);
delay(100);
digitalWrite(Buzz, HIGH);
Unlock = 0; //reset
}
//--------------LOCK----------------------------
if (Lock == 1){
timer = 0;
while (digitalRead(CCWLimit) == LOW){
if (timer > 1500){
digitalWrite(Buzz, LOW);
delay(500);
digitalWrite(Buzz, HIGH);
}
else{
deadbolt.write(1300);
timer++;
delay(1);
}}
deadbolt.write(1500);
digitalWrite(GreenLED, LOW);
digitalWrite(RedLED, HIGH);
Lcomplete = true; //lock complete
UnLcomplete = false; //reset Lock boolean
digitalWrite(Buzz, LOW);
delay(100);
digitalWrite(Buzz, HIGH);
delay(50);
digitalWrite(Buzz, LOW);
delay(100);
digitalWrite(Buzz, HIGH);
Lock = 0; //reset
}
}
Step 5: FInal Thoughts
Currently the unit is powered via the USB port using a cell phone charger. There are plans to wire a separate 5 volt supply that does not require the usb cable extending past the door. Although a key can still be used to unlock the door from the outside I am also planning on adding a battery back up in case of power failure.
The link for the RF transmitter and receiver is broken... any chance you have the module specificaitons?
could you reply with some websites where you got all the parts to make this including the program you used to code the key fob? I know this might be a bit of a nuisance but I'm fairly new to this so it would be really appreciated. :)
Nice instructable! Any new update to this i.e. battery back up, new revisions etc.?
unfortunately there are no updates yet. I am currently working on a cruise ship and won't be home until june.
You made a cruise ship with an Arduino? That sounds awesome ;-)
unfortunately there are no updates yet. I am currently working on a cruise ship and won't be home until june.
Is the servo directly attached to the deadbolt? If so, does this servo have any resistance to manually turning it (like when you use the key to open the door)?
I'm not very familiar with servos. Can you freely turn continuous rotation servos when they are off? I have a standard servo and it is resistant to turning when off.
Do you still work near that plastics place? Can we pay you for shipping to get us some from the trash? Or can we contact them directly?
If anyone is looking for cheap components and parts,go on aliexpress.com, shipping takes a while but it is worth it in the long run
The servo is a parallax continuous rotation servo. Amazon and adafruit both sell them
Can you provide the specifics of the servo? I'm trying to size one in terms of power and torque for my deadbolt knob.
Hello, Wich program you use for this project ? :)
hola amigo me puedes explicar como va conectado todo esque no entiendo hay cosas que no me salen, si pudieras explicarmelo paso a paso te lo agradeceria mucho saludos
hola amigo me puedes explicar mas a detalle como va conectado todo saludos espero tu respuesta
Yes, When the lock is turned manually the locked or unlocked limit will be triggered changing the state.
This is exactly what I came here looking for.
Quick question - what happens if someone does unlock with a key? Does the system still know what state it is in, locked or unlocked?
I'm not too well versed in circuitry but couldn't you use a 9v battery with a 5v regulator on it?
certainly, that isn't the most efficient way to power it, but it would work. I would reserve something like that for a battery back up and power the device from an outlet when possible.
Simply a thought for convienence
The arduino uno, used in this project, is built to run stable on 7-12v, it will run on as low as 5v but may not be able to output the full 5v on the output pins. I can also safely run on as high as 20v but runs the danger of over heating. The arduino has an internal 5v regulator. The reason his works without glitch is because his supply is a constant 5v, a battery can drop below 5v as it runs low and that is why 5v batteries aren't recommended
hi, can i use other type of RF transmitter and receiver ?
Of course. Depending on the output of the transmitter you may have to change the code or circuit, but any type of rf transmitter and receiver should work.
Nice! Now hook it up to the internet so you get a text every time it is unlocked. ;-)
Is there nothing that can't do with an Arduino! :-D
Cool idea. Too bad your landlord won't hire a locksmith or replace the lock. Take it with you when you leave (the whole lock hahahah)
congratulations
Hey congratulations on being a finalist in the hack it contest! Good luck to you!
I'm assuming the Parallax servo was a "constant rotation" type, right? Otherwise, I don't think you would need the limit switch.
That is correct, I didn't have a standard servo.
Cool. Just wanted to make sure I wasn't missing something!
This is an absolutely incredible instructable, must say! My arduino is coming in the mail tomorrow and this really inspired me.
Please post pictures. I am really excited to see how everyone's turns out.
Thanks man! so far all I have made is a simple electronic dice... I might make an instructable due to the simplicity of it, but I am still a noob at using arduino :P
My first instructable got featured though! YAY!
I think that this can be more "safe" than the wireless remotes for the car immobilizers that the Baddies jam with jamming devices to "empty" your vehicle
As easy as it is to use a bump key to get into a door I don't think that I run anymore of a risk by having a wireless keyfob. In fact the chances of anyone trying to break into my apartment door the same way they break into a car are very slim. However, you are correct in saying that this isn't the most secure technology. I am just pointing out the fact that my old dead bolt wasn't that secure to begin with.
This is a great DIY, how much (excluding time/labor of course) did it cost? Just wondering if the price difference between this and lockitron ($179) is worth the time it would take to make it. And the fob vs. app, but I'm sure there are a few simple ways of linking this device, so I could control it from my phone.
The arduino is about $30 and the key fob was around $20. All of the other parts I had in stock. If you want to control it from your phone there is a Bluetooth shield that you can get for the arduino. This would involve some custom programming, but it is doable.
This is great. I want to build one.
Like this a lot, voted for you.
pretty cool. I love it is excellent project and i will built it
thnx
please post pictures and good luck.
Nice project. It's seems simple to make. However, I'm curious how the epoxy piece links up to the deadbolt shaft. You took the knob off then figured out how to mold the piece? How did you make the epoxy form? You have pictures of that process?
I was not able to get any pictures of that process because it was kind of messy, but it is very simple. Epoxy putty is basically sticky playdough that dries in about 7 mins (i had the quickset kind). I formed the little blob of putty on the servo disc and depressed the shaft of the lock into the center of the putty. When it dries it is rock hard and holds its shape. I had to trim the dried putty blob because it was hitting the mouting screws. I used a dremel and a sanding drum to do this.
This is awesome! I've been wanting to do something like this on my door for a long time, but I never thought of using a keyfob!
One suggestion, you might want to look into adding a magnetic door sensor. That way you can make sure the door is closed before you lock it and play an alarm if it isnt.
good suggestion.
Please consider a (mechanical) emergency egress override in case of power or mechanism failure.
That is a concern that I need to address. Luckily there is a front and back door to my apartment tho. Ideally I would like to offset the servo and link it to the shaft via gears which would allow for the manual lever to remain attached.
nice project. I used the "relay version" of that receiver to add remote start to my motorbike:
Very nice project!
|
http://www.instructables.com/id/Keyfob-Deadbolt/?download=pdf
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
.visualization.fa;33 34 import java.util.HashSet ;35 import java.util.Iterator ;36 import java.util.Set ;37 38 /** This class is used to "walk" through an NFA and is used, for example, by the DOTGenerator.39 * It sends "event" to its delegate for each state and transition found.40 */41 42 public class FAWalker {43 44 private FAWalkerDelegate delegate;45 private int mode;46 private Set <FAState> visitedStates = new HashSet <FAState>();47 48 public FAWalker(FAWalkerDelegate delegate, int mode) {49 this.delegate = delegate;50 this.mode = mode;51 }52 53 public void walk(FAState state) {54 if(visitedStates.contains(state))55 return;56 visitedStates.add(state);57 58 delegate.walkerState(state, mode);59 Iterator <FATransition> iterator = state.transitions.iterator();60 while(iterator.hasNext()) {61 FATransition transition = iterator.next();62 delegate.walkerTransition(transition, mode);63 walk(transition.target);64 }65 }66 }67
Java API By Example, From Geeks To Geeks. | Our Blog | Conditions of Use | About Us_ |
|
http://kickjava.com/src/org/antlr/works/visualization/fa/FAWalker.java.htm
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
READLINK(2) Linux Programmer's Manual READLINK(2)
readlink, readlinkat - read(): _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L || /* Glibc versions <= 2.19: */ _BSD_SOURCE readlinkat(): Since glibc 2.10: _POSIX_C_SOURCE >= 200809L Before glibc 2.10: _ATFILE_SOURCE ); }
readlink(1), lstat(2), stat(2), symlink(2), realpath(3), path_resolution(7), symlink(7)
This page is part of release 4.12 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at. Linux 2016-10-08 READLINK(2)
Pages that refer to this page: open(2), open_by_handle_at(2), ptrace(2), read(2), stat(2), statx(2), symlink(2), syscalls(2), canonicalize_file_name(3), handle(3), realpath(3), proc(5), namespaces(7), path_resolution(7), pid_namespaces(7), signal-safety(7), symlink(7), lsof(8), umount(8)
|
http://man7.org/linux/man-pages/man2/readlink.2.html
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
Summary
Today we released ScalaTest/Scalactic 3.0.0-M11, which includes a significant reorganization inspired by feedback from the 3.0.0-M10 release two weeks ago.
Today11" % "test"
The main difference between M11 and the previous milestone release is that we got rid of the
Safety and
Compatibility implicit conversions, because a few users reported that
expectMsg calls were failing. This method has the following signature:
def expectMsg[T](o: T): T
The problem occurred because the
Compatibility implicit conversion from
Any to
Succeeded was applied like this:
expectMsg(convertToSucceeded("some message"))Instead of like this:
convertToSucceeded(expectMsg("some message"))
This meant that you were now expecting
Succeeded to be the message instead of
"some message". It compiled, but failed the test. So that approach was not going to work..
For more insight into the coming 3.0 release, see the earlier ScalaTest 3.0 Preview post about 3.0.0-M10.
Thanks and happy testing.
Have an opinion? Readers have already posted 2 comments about this weblog entry. Why not add yours?
If you'd like to be notified whenever Bill Venners adds a new entry to his weblog, subscribe to his RSS feed.
|
http://www.artima.com/weblogs/viewpost.jsp?thread=375914
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
Randall Davis: IBM Has No SCO Code 405
Mick Ohrberg writes ?"
Wait... (Score:5, Funny)
Re:Wait... (Score:5, Funny)
We showed over a million lines of code and where it has existed. [Linux creator] Linus Torvalds has told me that the Linux kernel has around 5 million lines of code. This derivative code accounts for 20 percent of the Linux code base."
Q&A: SCO Group CEO Darl McBride By Michael Singer
WTF! This guy can find a single line!! he must be blind! The CEO of SCO says that 1/5 of linux is a copy. Darl Mcbride would not lie!!!
Remeber SCO owns c++ too!
"And C++ programming languages, we own those" -Darl McBride
Caldera CEO waves UnitedLinux banner By ZDNet Staff August 15, 2002
Re:Wait... (Score:3, Informative)
"And C++ programming languages, we own those" -Darl McBride
And nobody was more surprised to hear it than Bjarne Stroustrup [att.com] himself!
Re:What did Didio see? (Score:5, Informative)
Davis saw no -infringing- code. That's not the same thing as seeing no common code. Copying a ten-line function almost verbatim is likely a copyright violation. Ending up with a handful of lines that look a lot alike, by contrast, is often just an unavoidable side-effect of writing two pieces of code that do the same thing.
Small blocks of code (under 3 lines) are generally not protected by copyright (unless we're talking obfuscated C lines). Even larger blocks of code may not be protected, depending on content.
For example, in many cases (drivers come to mind), there may only be exactly one way to do something (e.g. you must set this register to 1, wait 5 ms, set it to zero, wait 5 ms, then set a second register to 1), in which case those specific bits are unlikely to be copyrightable at all, even if they represent a fairly substantial number of lines of code.
Also, in order for the code to be infringing, it must have been taken from AT&T UNIX or its descendants, and must not have been put there by someone who owned copyright on said code. That means that A. the code must not have been placed there by anyone working for SCO or Novell, and B. the code must not have come from a third, shared source such as BSD. A very large chunk of SCO's UNIX code fails the "B." test, and SCO was an active contributor to Linux, so many cases where code appears the same could easily fail the "A." test as well.
Re:What did Didio see? (Score:3, Interesting)
SO why is she publishing that she was copied code? If she does not have the qualifications to make such a decision then she certainly then she certainly should not be advising investors based on such analysis.
"Davis saw no -infringing- code. That's not the same thing as seeing no common code. Copying a ten-line function almost verbatim is likely a copyright violation. Ending up wi
Figures... (Score:3, Funny)
Counter example would have helped. (Score:5, Interesting)
It surely wouldn't have been hard to take some, say, early and "in the clear" code that has been reused and modified over time to show both that it can be identified and to show how code that has evolved can still leave the fingerprint of the original code. Without that counter example the failure to find matches would seem underwhelming. (The closest the testimony came to this was showing a positive result that was generated and showing how it was a commonly repeated pattern in all software written in C, not something specific to these two programs).
Perhaps elsewhere in IBMs testimony there was reference to this same procedure being successfully?
Counterexample DIY (Score:5, Insightful)
2. Get Linux 2.4.0
3. left out as an exercise for the reader
4. Show positive result
5. Don't profit, but have fun.
Re:Counter example would have helped. (Score:5, Insightful)
Everyone is getting so far off base on this.
SCO is manging to convince people that this is somehow difficult to prove.. that they need more research and more time to PROVE that IBM stole code and put it in linux. Their only claim as to why they think Linux has SCO code is "because there is no way linux could have become as good as it did without stealing from us".. ie: denial
They have yet to show ONE section of code that was lifted. They haven't even shown how one was *similar* enough to have potentially been stolen and heavily modified.. they have shown *NOTHING*
IT's called an expert witness... and their word DOES mean something to the court.. they stake their reputation on it.
Re:Counter example would have helped. (Score:5, Insightful)
I've been thinking this was strange too. After all, if code was copied into Linux it is essentially a public document now - out there for everyone to see. All SCO would have to do is download it and print it out side-by-side with a copy of their matching code. Case closed. SCO wins.
The fact that they haven't done this extremely simple thing seems to strongly point to SCO being a bunch of total bullshitters. Even if some malicious programmer intentionally stole code and modified it slightly (changed variable names, comments, re-arranged the order of functions in header files, etc.) it should be pretty trivial to show a judge what happened and move on to the 'get sacks of cash from IBM' phase of the trial.
Funny, you would think that a company that is suffering continuous, ongoing harm to the tune of US$699 per user would be pretty quick to do such a thing...
LAW (Score:3, Insightful)
It only takes a . out of line to sway the legal result, not necessary the correct and right result.
It not over until the fat penguin sings, then we can all rejoice.
Re:Counter example would have helped. (Score:3, Informative)
That's the SCO argument, isn't it, that derivative works are theirs by copyright. Trouble is that the law is different. Copyright covers the representation not the idea. And for software having malloc() in two pieces of code doesn't rise to copyright
Re:Counter example would have helped. (Score:5, Insightful)
It just hit me: He doesn't have to. It's SCO's responsibility to show that there is infringing code in Linux. It's not IBM's responsibility to show that there is none. All that Davis has to prove is that the search is feasible in a reasonable ammount of time (as opposed to SCO's claim of 25,000 man-years). He's done this admirably. Not being able to find anything is simply icing on the cake.
One beautiful thing about this is that (AFAICT) all (or almost all) of the software he used seems to be Open source (although he has references some similar commercial software), so SCO has absolutely no excuse to not repeat his experiment and come up with different results (presuming that they've actually got a case), given that it takes about 1 hour to run the comparison on off-the-shelf hardware.
The other beautiful thing about this is -- remember Darl's remarks about an MIT team deep-diving the code?...... (boot to the head!)
"I've shown you mine, now you show me yours!"
In other news... (Score:4, Funny)
More at 11.
Re:In other news... (Score:4, Funny)
Re:In other news... (Score:3, Funny)
rocks are wet and water is hard...
Re:In other news... (Score:3, Funny)
Also, magma and ice not being capable of existing in the same environmental conditions, may not meet the requirements of proper experimental research, therefore all experiments must be carried out at 0 degrees kelvin to avoid corruption of data, atmospheric pressure may be designated by the experimenter.
Re:In other news... (Score:4, Funny)
*bows*
Wait... I don't have to commit nerd ritual suicide now, do I?
*prepares to FLEE*
Really??!! (Score:5, Funny)
Re:Really??!! (Score:2)
Re:Really??!! (Score:3, Funny)
* Runs off crying. *
Re:Really??!! (Score:4, Funny)
Kind OF Honest? well you're getting closer
Re:Really??!! (Score:3, Informative)
To be fair, noone says they aren't, except an expert who was payed a lot of money (550/hr) by IBM to say so.
To you and I that would be a lot of money, but TSG is willing to pay BS&F many multiples of that (their law firm charges over $600/hr per lawyer, more for courtroom time. Mr. Silver was paid for 3 hours in this last hearing AND HE SLEPT THROUGH PART OF IT) for their expertice, why should IBM be less willing to spend money for expertice o
Friendly logic lesson. (Score:3, Informative)
Your logic is flawed. If not true, it's unclear whether it's interesting.
Your conclusion would be true if your premise were "interesting if and only if true."
At $550 per hour... (Score:5, Funny)
20. These comparisons required on the order of 10 hours of computation time on a dual 3 GHz Xeon processor system with 2 GB of RAM. This is a high-end workstation routinely and easily available off the shelf from commercial vendors such as Dell.
At $550 per hour, I would've used something like a 386 processor with 8MB of RAM.
Re:At $550 per hour... (Score:5, Funny)
At $550 per hour, I would've used something like a 386 processor with 8MB of RAM.
Hell, I would have built a wetware turing machine using a dozen grad students armed with abacii. In treacle. With Natalie Portman implementing the I/O subsystem.
Re:At $550 per hour... (Score:2)
Re:At $550 per hour... (Score:5, Funny)
Inevitably,...
Imagine a Beowulf cluster of grad students armed with abacii,....
Re:At $550 per hour... (Score:4, Insightful)
I guess that's one reason they didn't hire you.
Re:At $550 per hour... (Score:5, Funny)
Re:At $550 per hour... (Score:4, Informative)
I expect it took more than 10 hours for him to write that document and painstakingly verify its accuracy and wording to avoid perjury. He'll likely spend significant amounts of time testifying in person on the subject as well.
That rate is high but within reason for top-end expert witnesses (which is exactly what he is.) It's not uncommon for renowned professors to make a substantial second income by acting as an expert witness (very common in the chemistry and biology fields, at least.)
Finally, IBM would not even blink if they were handed a bill for several hundred hours at $550 each on this issue. They may even get some of the money back, depending on the details of the final settlement and the subsequent SCO bankruptcy.
What about all of these? (Score:5, Funny)
*/
while(1)
{
}
return(0);
return(1);
i
elseif (...)
else
And don't forget the white space! That is a clear copy!
Re:What about all of these? (Score:5, Funny)
Your compiler: We hates it, it burns us, precious, nasty syntax it is!
Re:What about all of these? (Score:3, Funny)
Wouldn't it be cool to run all of GCC's text messages through some sort of "Gollumnizer" (like the perl script out there that can convert english to Yoda-like phrasing)?
Hell you could even rename it:
"Gollum's Compiler Collection"
in other news... (Score:3, Funny)
Wade'da'minute... (Score:2, Insightful)
Which method is covered for source code comparisions?
1. two printouts held together and up toward a lighted source?
2. side-by-side subjective eyeball comparision
3. diff (and all derivative comparision tools)
4. diff with some wiggle-room command line options?
5. NSA-grade pattern analysis supercomputer?
I'm slightly guarded here, but these SCO FUD-busting articles seemed very promising...
Read the PDF... (Score:5, Informative)
Re:Read the PDF's methodology (Score:3, Informative)
1. ideas
2. purposes
3. procedures
4. processes
5. system
6. method of operations
7. facts
8. unoriginal elements
WOW! Okey Doke. So, now the IBM legal team is really looking for "copy-cat" aspect of which we, the community, are certain there aren't any (save for a few comments).
1. Ideas can't be copyrighted (but they can be patented).
2. Purposes can't be copyrighted.
3. Procedures can't be copyrighted (but they can be patented).
4. Processes can't
It's a matrix... (Score:5, Funny)
SCO, don't try and claim that IBM has your code. That's impossible. Instead, realize the truth. There is no SCO code.
Darl sez... (Score:5, Funny)
There are no American tanks in Baghdad!
They are nowhere near Baghdad.
Their forces committed suicide by the hundreds.... The battle is very fierce and God made us victorious. The fighting continues.
Ooops, wrong script. (fumbles with papers)
IBM is lying about the lack of stolen code.
We need another delay to find stolen code.
There can be no doubt that Linux contains stolen code.
Thanks Professor Davis... and thanks ESR... (Score:5, Informative)
ESR [catb.org] deserves three cheers for 'scratching his itch', making a tool to compare copyrighted code. To have it actually used in the SCO case which was the annoying impetus for its creation (AFAICT) has to be a nice feeling.
I'm not an ESR fanboy, but I'll give him props when I think he deserves it and in this case I think he does.
--LP
Re:Thanks Professor Davis... and thanks ESR... (Score:5, Interesting)
see my work used in this comparison. Extremely good.
you can now expect to be subpoena'd... (Score:3, Funny)
Re:Thanks Professor Davis... and thanks ESR... (Score:3, Insightful)
He didn't get $550/hr to run comparator, he got the fee for being an expert recognizable as such to the court and damned near irrefutable on the subject. His r
$550 an hour....and he reviewed 15 lines of code? (Score:5, Funny)
He basically had some software look for similarities in the code, and then manually verified the hits.
Wow....$550/hour to do that. I've got a CS degree - I'll volunteer to do it for half that!
Oh yeah, he also explained the significance of return statements so that non-programmer types could understand.
-ted
Re:$550 an hour....and he reviewed 15 lines of cod (Score:5, Insightful)
See you in 10 years!
(trans: read the relevant parts of his CV in the PDF- this guy is FOR REAL.)
Duh! Can't you READ?! (Score:3, Informative)
Check.
Columbia Law Review article on "the Legal protection of Computer Programs". Check.
Software Law journal article on "The Nature of Software and its Consequences for Establishing and Evaluating Similarity. BIG Check.
Court Expert on Software Copyright Infringement. Check.
Retained by the DOJ to investigate copyright theft (and subsequent cover up) by the FBI, NSA, DEA, US
Not So Fast Mr. Davis! (Score:5, Funny)
And now
My name is Darl McBride, and I have authorized this message!
Scope (Score:3, Interesting)
Why? 6 million lines of code compared against 6 million (or more) will take a exponentially more time than 27000 vs 6 million.
SCO code (Score:2, Funny)
Hmmm...I wonder if he can prove that COMPARATOR and SIM do not contain any SCO code?
busted! (Score:5, Funny)
IBM: byte us.
IBM has WMD, claims SCO. (Score:5, Funny)
SCO hasn't played their trump card yet... (Score:3, Funny)
Formal Request to Randall Davis (Score:5, Insightful)
I do not fault your analysis; I would like to know more about your methodology, beyond the limited scope of the deposition.
-Hope
Re:Formal Request to Randall Davis (Score:5, Interesting)
I'm more interested in the Abstraction and Comparision aspect. Forget the Filtration aspect as they seem only to pertain to non-Copyright (mostly patentable objects).
Now, for Comparision... What are the wiggle room concepts introduced? I know of the most commonly used one such as "Upper-lowercase, multiple whitespaces"
And for the Abstraction, ones I know of are: inverse logic (a gt b) vs. (b lt a) and inverted or flipped loops.
I know in for Abstraction, one can evade the copyright in this manner. But for Comparision....?
Re:Formal Request to Randall Davis (Score:5, Insightful)
Um. Dr. Davis is the guy who first came up with the abstraction, filtration, comparison test - he was the expert witness in Computer Associates vs. Altai. Check his credentials in the first section.
He actually addresses the point you're asking - the code actually finds looser matches than would be found with abstraction, filtration, comparison. So he just ran them through that, said "well, no matches" - since it's a looser comparison, a stricter comparison would be of no benefit.
I think the court will give him the benefit of the doubt that he knows how to do something that he was the first one to do.
Re:Formal Request to Randall Davis (Score:4, Interesting)
Obligatory stock graph (Score:3, Insightful)
IBM had to do this... (Score:5, Funny)
His resume! (Score:4, Interesting)
"I have also been retained by the Department of Justice in its investigation of the INSLAW matter. In 1992 (and later in 1995) my task in that engagement was to investigate alleged copyright theft and subsequent cover-up by the Federal Bureau of Investigations, the National Security Agency, the Drug Enforcement Agency, the United States Customs Service, and the Defense Intelligence Agency."
Holy rat shit Batman!
Re:His resume! (Score:4, Funny)
So Professor Davis can not only tell us that there is no SCO code in linux, but he should also be able to tell us how much crack the SCO weasels had to smoke before formulating their outrageous claims.
SCO's hubris (Score:5, Interesting)
[2] Mr. Gupta of SCO told the court some specific lines of SCO code mathcing some specific lines of ibm code. That turns out to be a lie. Randall David points out on p. 10 that it is rather obvious even to a non-technical user that they are not similar!
[3] SCO had the gall to claim a 3-line code
#endif
return
}
as being stolen!!
Even among these 3 lines, the #endif was followed by one comment in one code, and one comment in another. And one code had a newline between, and one didn't. As Randall Davis points out, this is like saying that oen author stole from another author since in somewhere in 2 of their books, 2 sentences both end in "the end".
In related news... (Score:3, Funny)
Wilson was subpoenaed on July 3, 2004 for apparently using SCO Unix bullshit in his underwear. SCO lawyers contended that, in addition to all of their other bullshit, this particular stripe of fecal matter in Wilson's BVDs was, in fact, similar the other bullshit that they have spread around since they began their legal actions.
Wilson, a World War II veteran and resident at the Shady Acres Memory Care facility on the western edge of Alatoosa, was not immediately aware of what SCO was in the first place.
"I thought it was the VA -- finally giving me my money for that piece of Kraut shrapnel I took in 1942! Fucking Krauts! Where's my applesauce? Is my wife around?"
Officials at the memory care facility noted that Wilson is an Alzheimers patient who frequently forgets to wipe himself after using the bedpan, hence the source of the stripe in his underwear. They were aware of the legal action again Wilson by SCO, but rather than stir up his angina and blood pressure by witholding the mail that he watches being delivered every day, they let him open the SCO legal letter himself.
"We're just glad he didn't keel over with a stroke," said Frank Johnson, the head nurse of the memory care facility. "He just ranted about the VA and pissed down his leg while asking for his son, who has been dead for 16 years after a car accident. It could've been a lot worse."
The examination of the fecal stripe in the suspect pair of BVDs turned up concrete evidence that, in fact, the shit was Wilson's. In fact, it was not even bullshit and thus not legally open to subpoena by SCO on the grounds that it was more of SCO's bullshit. No countersuit has been filed, as Wilson's surviving family members have apparently never visited him at the facility and only wish to pay the bills for his care.
IronChefMorimoto
Old news, McBride has already admitted this (Score:4, Interesting)
Re:Old news, McBride has already admitted this (Score:5, Insightful)
The basic result is that no such lines existed that can be demonstrated to be non-literal copying, or literal copying.
-Rusty
SCO Stalling (Score:3, Funny)
Heh, paragraph 30 (Score:5, Informative)
I think that pretty much sums up this whole case from the beginning.
SCO is like a Smoke & Mirrors show... (Score:3, Funny)
Maybe SCO should get Dan Rathers help. (Score:4, Funny)
SCO MATRIX (Score:4, Funny)
Only try to realize the truth: There is no code.
Then you will see it is not the code that is gone; it is only your head.
Hardly a surprise but there's more (Score:4, Insightful)
Obligatory Simpson's quote... (Score:3, Funny)
Justice upgrade (Score:5, Insightful)
Re:Justice upgrade (Score:3, Interesting)
Hey Darl, had enough yet?!?! (Score:3, Interesting)
Not to mention the fact that you have no case!! Never had one, never will have one!! Do you sleep well at night, Darl? Do your employees welcome you to the office when you show up for work? Or do they jeer at the man whose cost them any future they could ever have had in the IT industry in the hope that they might "get rich quick" by trying to bust up Linux?
Caldera (let's call it what it is...) was one of the Linux leaders and you've turned this once Linux company into a litigation machine just like you're famous for. Well this time, the joke's on you pal. You've come up against two things you didn't count on. One, that a mega corporation like IBM might actually fight you instead of just paying you off and two, the tenacity of the Linux community and our unique ability to find the facts about a given situation. *This* is how it works here, we police each other with the very same eye we've used to scrutinize this farce of yours.
We have come out on top, and we will always come out on top. We've stared you in your ugly face and we've not flinched.
Screw you, Darl McBride.
Sincerely, Gregory Casamento.
Re:Finally... (Score:5, Insightful)
Re:Finally... (Score:5, Informative)
This has been gone over at length on Groklaw. IBM HAS taken action. No matter what SCO does, IBM still has a huge countersuit under something called Lanham Act [internet.com]. Methinks SCO is in a bit of trouble
question (Score:5, Interesting)
Re:question (Score:5, Informative)
Re:question (Score:5, Interesting)
If Novell did that they would be violating the GPL and infringing on the copyrighted work of Open Sorce programmers.
SCO tried almost the exact same thing (They distribute Linux source (including "stolen" code) under the GPL and then insist that it is illegel to distribute under the GPL and that the GPL is invalid and maybe even un American.
Re:question (Score:5, Informative)
Citing the GPL:Clear enough?
Re:question (Score:3, Interesting)
It looks like they weren't transferred. It is an open question if Novell would be required to make such a transfer (although most people think it unlikely).
Novell could do that. They own they copyright. However, they would have to release the code under the GPL or whatever license is compatible with the GPL and on the files they r
Re:Finally... (Score:4, Interesting)
The courts have their thorough processes to run through. SCO will get umpteen chances to submit memorandums, emergency memorandums, memorandums in opposition to motions, memorandums in support of motions, motions to support memorandums in support of motions for summary judgement, no wait, theres more...
It's making me ill to watch how easily the process is to abuse. But thank God, unless a MS steps in and ponies up the cash, it will eventually be over.
Re:Finally... (Score:5, Funny)
They're not quite dead yet.
SCO: I don't want to go on the cart!Oh, don't be such a baby. You're not fooling anyone, you'll be stone dead in a moment.
Re:Finally... (Score:3, Insightful)
Re:Finally... (Score:5, Insightful)
Since Dr. Randall Davis is an expert witness for IBM, I am guessing that SCO will say, "ain't so!" and then they will ask for time to refute Randall's findings and perhaps come up with an expert witness of their own that finds thousands of "matches." Hopefully the judge in this case will recognize Randall for the expert that he is and accept his findings. However, that just doesn't seem likely to me. This is just another round in a case that will continue like this ad nauseum.
Erick
SCO has their 'expert' (Score:4, Funny)
Re:Finally... (Score:5, Insightful)
Dr. Davis is the person who first elucidated how you compare code (the "abstraction, filtration, comparison" test - Computer Associates vs. Aitai) to see if it violates copyright. SCO will have a hard time trying to argue that its depositions (which are from non-experts, though they claim 'unnamed' experts performed the work) are from people more qualified than Dr. Davis.
So I guess what I'm saying is that SCO will have a hard time finding an expert witness more qualified than Dr. Davis. (Please note that if they try to present a deposition from one, that will likely be stricken - as SCO has been ordered by the court to present such a deposition, and has not - thus indicating it doesn't have one) And I highly doubt that the court will value any other expert over Dr. Davis anyway.
SCO has two of its own employees (Dr. Davis is not an IBM employee, though he is being retained by IBM). IBM has the expert witness who first defined how you compare code. Hmm, I wonder which the judge will believe...
Re:Finally... (Score:5, Interesting)
Whether they still have any patents or copyrights on the functionality of UNIX remains to be seen, and such a case wouldn't necessarily NEED code theft to go forward. Any idiot can see that Linux is a UNIX clone -- the question at that point would be the legality of the cloning process and the layers of licensing that surround it.
Re:Finally... (Score:3, Informative)
Whether they still have any patents or copyrights on the functionality of UNIX remains to be seen,...Ummm, no it doesn't. We already know that SCO doesn't have any patents, and there's no such thing as a copyright on functionality. We copyright code, not functionality.
Re:Finally... (Score:3, Informative)
Yep. You can't copyright ideas, only a particular expression of ideas. In as much as the code -is- the idea, or implements a standard, it can't be copyrighted (e.g. interfaces). Patents cover ideas, not copyright.
Not that SCO hasn't argued exactly the opposite! They've been saying "UNIX concepts and methods" have been infringed as in the press, and even in the courts. It hasn't flown in court at all. The only examples they
a judge will weigh. (Score:5, Informative)
If I recall correctly, Randy told me that he has served as a special master in several cases.
Re: a judge will weigh. (Score:5, Informative)
One would hope, as a matter of fact, the SCOexpert would be required to show where he found matches. That (if it exists) can be explicitly shown to the court.
Then, if need be, the experts can argue over wether or not they match.
Kind of like fingerprints. The suspect's fingerprints are entered as evidence, as are fingerprints found at the scene. The experts can then argue about wether or not they match. But until those fingerprints are presented and accepted as evidence, there is no weighing of testimony to be done.
Re: a judge will weigh. (Score:5, Interesting)
As a matter of fact SCO did show the evidence. This was enumerated in Sandeep Gupta's deposition. The pointed to pdf file has a table of all the files aledged to be copied from Unix sources, and this deposition specifically states he looked at those also (since his automatic detection program failed to find it) and the evidence of copying failed to apply the normal legal standards (also outlined in the deposition). This is very interesting reading indeed.
Re:Finally... (Score:4, Interesting)
That's a final word as far as I'm concerned, and I'd venture so far as to say if IBM wants to make it so it's the final word as far as the law is concerned.
Re:I found this out a while ago... (Score:5, Insightful)
Re:I found this out a while ago... (Score:3, Funny)
< IBMcode
< IBMcode
< IBMcode
===
> SCOliarscode
> SCOliarscode
> SCOliarscode
> SCOliarscode
Either that, or nedit couldn't open such a large file and wound up with a (null) when it tried to malloc the entire SCO code base and IBM code base.
(Over-analysing jokes - it's not just for pendants any more!)
Re:I found this out a while ago... (Score:2)
Maybe it's because I've never used nedit and am missing something?
Re:15 hits (Score:2, Insightful)
All the SCO bullshit over? Far from it. There are still a few hundred million lines of AIX that haven't been compared.
And even if it's over for IBM, doesn't make it necessarily over for Linux in general.
Re:Sounds like.... (Score:3, Insightful)
Actually, didn't Prof Davis also just prove that SCO's source doesn't include Linux code?? If SCO had stolen anything and included it in their code, it would have shown up in the comparator test, wouldn't it?? The comparison just shows common code, it doesn't distinguish which is
|
https://news.slashdot.org/story/04/09/17/1818233/randall-davis-ibm-has-no-sco-code
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
Creating An Asset Pipeline in Python with Paver
What's Paver?What's Paver?
Lately, I have been looking for a good task runner, something similar to grunt or gulp, but one that I can use with Python to write the tasks. This is where Paver comes in.
Paver is a Python library that automates tasks. It has a clean API for creating tasks as Python functions, shell commands, or any combination of the two. Tasks can also depend on other tasks─they can pipe data between tasks, and they can have configuration values that changes as the data goes through each task or that resets as each new task begins. Obviously this is a very flexible system, so I feel it will meet my needs.
What are We Going to Automate?What are We Going to Automate?
I've been doing a lot of JavaScript programming lately, and I really want to move to just coding in CoffeeScript, as it is much more expressive and it's easier to read. I also want to use Less for CSS preprocessing for the same reasons. So right there we have 2 things that would be great to automate, we can throw in CSS and JavaScript minification and concatenation just to round things out.
How to Tell Paver About Your TasksHow to Tell Paver About Your Tasks
The first thing Paver needs in order to start working is a file in your project's root:
pavement.py. This is where you will define all of your pavement tasks. Then we will import the easy module from Paver, which holds all of the important items we will need from the API. After that, we start writing functions.
To tell Paver a function is a task, we just add the
@easy.task decorator to the function definition. This allows us to write support functions that will not be exposed to the
paver command line tool when we run tasks.
Assets and PipelinesAssets and Pipelines
To start, let's write a support function that will gather files for us.
from paver import easy def _get_files(root,ext=None,recurse=False): if not recurse: file_list = easy.path(root).files() if easy.path(root).exists() else None else: file_list = list(easy.path(root).walkfiles()) if easy.path(root).exists() else None if file_list is not None: return file_list if ext is None else [f for f in file_list if file_list and any(map(lambda x: f.endswith(x),ext))] else: return []
Since I don't intend for this function to be used by programmers who may use these Paver tasks, it is merely here to help from behind the scenes. I am using a standard Python convention of marking it "private" by prefixing its name with an underscore. This way, if someone comes along and reads / uses the code, they will be aware of the fact that they should not rely on how that function works, because I do not intend it to be included in the public API, (meaning if you said
from myModule import * , the function
_get_files would not be available to use) and I may change its usage anytime without notice.
Now, let's look at how this function works, because we're already using Paver's stdlib and we haven't even defined a task yet. So after we import
easy from the Paver library, we start our private function definition and say it will take up to three arguments, and a minimum of one. They are:
- root - the root folder to start grabbing files
- ext - an optional file extenstion to filter by
- recurse - if true recurse into sub-directorys of root, default False
Then, inside the function, we first check if we should recurse or not and use that information to compose a list of Path objects. If any file extension is fine we return the list, but as it's probably more common, we filter the list by the given ext argument and return that list.
Build TypesBuild Types
One last thing we will want to do is differentiate between build types. A use case for this is having separate development and production build tasks. This way, when you build in production you get all of the minifacation and obstification you need, but in development, building will only write out compliled CoffeeScript. So our last helper will be an easy way for our tasks to determine what the current build type is:
def _get_buildtype(): return options.build.buildtype if getattr(options.build,'buildtype') else os.environ.get('BUILD_TYPE')
For our first task, we will gather our source files (currently I'm writing CoffeeScript so that's what we will gather. However, we will create tasks for JavaScript and CSS as well). We will also create a variable outside of our task that will hold our data while it travels through our pipeline. It will be an instance of
paver.options.Bunch, which is just a dictionary that allows us to use the dot notation to access its contents. So, instead of saying
myDict['key'], you can just say
myDict.key, which is easier to read and write.
We will add our
Bunch object to another
Bunch object
options that we will import from
paver.easy.
options is how we are supposed to access command line options or default options in our tasks. Below we also set up our
options object (basically our asset pipelines configuration), which we can easily change or extend, but I'll show you more of that later.
Also, notice that we want this to be usable by others, but we don't want anyone who uses it to be forced to install all dependencies that are required by all of our tasks. What if they don't need some of them? So, instead of just importing directly from the CoffeeScript module, I am putting the import inside of a
try / except block. This way, if CoffeeScript isn't installed on the system, we can just throw out a warning once they try to run a task that needs it instead of throwing an exception that will kill the whole program.
Inital SetupInital Setup
from paver import easy,options from paver.easy import path,sh from paver.options import Bunch try: from jsmin import jsmin except ImportError: jsmin = None try: from coffeescript import compile as compile_coffee except ImportError: compile_coffee = None try: from uglipyjs import compile as uglify except ImportError: uglify = None options.assets = Bunch( css='', js='', folders=Bunch( js='src', css='static/css', ), js_files=[], js_ext='.coffee', css_ext='.css', outfiles=Bunch( prod=Bunch( js='vendor/app.min.js', css='' ), dev=Bunch( js='vendor/app.js', css='' ) ), ) options.build = Bunch( buildtype=None, ) def get_js(): ''' gather all source js files, or some other precompiled source files to gather files other than javascript, set: options.assets.js_ext to the extension to collect ie for coffeescript: options.assets.js_ext = '.coffee' ''' ext = options.assets.js_ext or '.js' files = _get_files(options.assets.folders.js,ext,True) options.assets.js_files = map(lambda x: (str(x),x.text()),files) def get_css(): ''' gather all source css files, or some other precompiled source files to gather files other than css files, set: options.assets.css_ext to the extension to collect ie for less: options.assets.css_ext = '.less'\n ''' ext = options.assets.css_ext or '.css' files = _get_files(options.assets.folders.css,ext,True) options.assets.css_files = map(lambda x: (str(x),x.text()),files)
If you notice, all we're really doing here is calling our helper function
_get_files, and using either the value of
options.assets.js_ext, or
options.assets.css_ext to determine the types of files to gather in the task. This also takes care of gathering different types of source files like CoffeeScript, because to tell it to gather CoffeeScript, not JavaScript, you merley need to update
options.assets.js_ext to '.coffee' and voilà! It gathers coffee script.
Compiling CoffeeScriptCompiling CoffeeScript
Now, let's move on to compiling the CoffeeScript, then minification, and uglification.
def coffee(): ''' compile coffeescript files into javascript ''' if compile_coffee is None: easy.info('coffee-script not installed! cannot compile coffescript') return None options.assets.js_files = map(lambda x: ((x[0],compile_coffee(x[1],True))),options.assets.js_files)
Here we are first using the
paver.easy.needs decorator to inform Paver that it will need to perform its
gather_js task before it can run this task (if we haven't gathered anything, we won't have anything to compile). Then, we are emitting a warning and returning if the import for CoffeeScript earlier failed. We then map an anonymous function over our files, which compiles them using the
coffeescript.compile function that we imported as compile_coffee. This way we won't overwrite the built-in
compile function.
Minifacation, UglificationMinifacation, Uglification
Now for the minifacation and uglification tasks, they are almost exactly the same as the last task.
def minify(): ''' minify javascript source with the jsmin module ''' if jsmin is None: easy.info('Jsmin not installed! cannot minify code') return None options.assets.js_files = map(lambda x: ((x[0],jsmin(x[1]))),options.assets.js_files) def uglifyjs(): ''' uglify javascript source code (obstification) using the ugliPyJs module ''' if uglify is None: easy.info('ugliPyJs not installed! cannot uglify code') return None for fle,data in options.assets.js_files: options.assets.js_files[options.assets.js_files.index((fle,data))] = (fle,uglify(data))
ConcatenationConcatenation
Now, once all this is out of the way we will want all of our JavaScript in one big file, so we only have a single file to deal with. This is easy. Also, since we no longer need the file names associated with the data, we can throw that info away and just put each file on top of the next.
def concat(): ''' concatenate all javascript and css files currently in memory ''' options.assets.js = ''.join(map(lambda x: str(x[1]),options.assets.js_files)) options.assets.css = ''.join(map(lambda x: str(x[1]),options.assets.css_files))
Now all we need is a task to write out our finished files, and tasks for our build types and we're all done.
def write_js(buildtype=None): ''' write out all gathered javascript to the file specified in options.assets.outfiles[BUILD_TYPE].js ''' if not easy.path('vendor').exists(): easy.info('making vendor dir') os.mkdir('vendor') buildtype = buildtype or _get_buildtype() with open(options.assets.outfiles[buildtype].js,'w') as f: f.write(options.assets.js) easy.info('Wrote file: {}'.format(options.assets.outfiles[buildtype].js)) def build_production(): ''' Full Build: gather js or coffeescript, compile coffeescript, uglify, minify, concat, write out ''' get_js() coffee() uglifyjs() minify() concat() write_js() def build_dev(): ''' Partial Build: gather js or coffeescript, compile coffeescript, concat, write out ''' get_js() coffee() concat() write_js() ('buildtype=','t','build type') ]) def build(options): ''' Run Build, defaults to 'dev' ''' if(not hasattr(options,'build') or (options.build.get('buildtype',None) is None)): buildtype = 'dev' else: buildtype = options.build.buildtype os.environ['BUILD_TYPE'] = buildtype dict( dev=build_dev, prod=build_production, )[buildtype]()
The thing to really pay attention to here is how we're calling the correct build task function, because we know we want an item from a number of choices (ie: build_dev and build_production), and we just want to call the result. An easy way to accomplish this in Python is to compose a
dict containing all of your choice names / related functions ie:
dict( dev=build_dev, prod=build_production, )
Then, just access the value you need and call it. Since the dict function will return a dictonary, we can just access the item in it that we need, and call it to perform its associated action. ie:
dict( dev=build_dev, prod=build_production, )[buildtype]() #<---- this is where we access the task function we need and call it
Now, all we need is a task that will build our project files, and run the result through Node.js so we know it's working:
def run(): ''' Run production build and pipe generated js into nodejs for execution ''' options.build = Bunch() buildtype = options.build.buildtype = 'prod' build(options) sh("nodejs {}".format(options.assets.outfiles[buildtype].js))
To check it out, just run:
$ paver run
And we have an asset pipeline. Of course, it could possibly do more, such as
- compile less / sass files
- process files with ng-annotate
- minify html or css
However, I will leave these things up to you, since at the moment, this covers most of my own use cases.
To see the full code, check it out on github
|
https://www.codementor.io/jstacoder/creating-an-asset-pipeline-in-python-with-paver-du107wjs3
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
131 Neutral
About Dragonion
- RankMember
Dragonion replied to Dragonion's topic in General and Gameplay ProgrammingFair enough, I just updated the question (although one could argue that there really is nothing stopping anyone from calling themselves an expert either)
Dragonion posted a topic in General and Gameplay ProgrammingFeel free to elaborate your answer.
Dragonion replied to m4uesviecr's topic in Music and Sound FXAs for the beginning I guess you could add a few discrete effects here and there although I personally think it sounds pretty good with a simple synth and a few echoing "blobs". As for the kick I guess it's a matter of either boosting the lower freqs a bit with some EQ, finding another sample/VST/RTAS, or perhaps adding an emphasizing bass drum wherever you need some additional punch. The "haha"-break sounds fine imo and I'm sure you can fix the supposed emptiness with some good mastering software like iZotope Ozone 5. That said, I think it's a good idea to let it rest for some days. I know from my own experience that working on the same track too many days in a row tends to kill the enthusiasm.
Dragonion replied to m4uesviecr's topic in Music and Sound FXI don't know how helpful this is but the mix sounds fine in a regular Razer headset. Good and full atmosphere. The composition is also good although it really isn't a genre I usually listen to. Very creative with all the mouth-generated sounds.
- [quote name='Álvaro' timestamp='1354645307' post='5007155'] [quote name='Dragonion' timestamp='1354644568' post='5007148'] However, in referrencing the loop is translated because two external functions (the int constructor and -destructor) are called in each iteration. [/quote] The int constructor and destructor are trivial and not present in the compiler's output. The two function calls you see are the memory allocation and deallocation. [/quote] True. But for the sake of simplicity I took the liberty of using the words "constructor" and "destructor" as aliases for the entire memory allocation/de-allocation processes they initiate when you use them.
- [quote name='KingofNoobs' timestamp='1354539654' post='5006582']Hello all. I just ran the following two functions 100 times each ...[/quote] When using MSVC your code is translated like this: [source lang="plain"]?passing@@YAXH@Z (void __cdecl passing(int)): 00000000: C3 ret ?referrencing@@YAXPAH@Z (void __cdecl referrencing(int *)): 00000010: 56 push esi 00000011: BE 40 42 0F 00 mov esi,0F4240h 00000016: 6A 04 push 4 00000018: E8 00 00 00 00 call ??2@YAPAXI@Z 0000001D: 50 push eax 0000001E: E8 00 00 00 00 call ??3@YAXPAX@Z 00000023: 83 C4 08 add esp,8 00000026: 4E dec esi 00000027: 75 ED jne 00000016 00000029: 5E pop esi 0000002A: C3 ret[/source] As you can see, the first function, [font=courier new,courier,monospace]passing[/font], is reduced to a single [font=courier new,courier,monospace]ret[/font] instruction making it equivalent to this one: [source lang="cpp"]void passing(int j ) { }[/source] In other words, through optimization algorithms the comiler "concludes" (notice the qutation marks because we a talking about a piece of software) that the loop is redundant and removes it entirely from the function body. However, in [font=courier new,courier,monospace]referrencing[/font] the loop is translated because two external functions (the [font=courier new,courier,monospace]int[/font] constructor and -destructor) are called in each iteration. And even though it may seem like this could be optimized out of the loop as well, as soon as you invoke an external function things change quite significantly from a complier's "point of view" because the function's implementation isn't part of your code and is stored in binary form in some library (or object) file on your hard-drive. I hope this answers your question.
- [quote name='ApochPiQ' timestamp='1336598253' post='4938784']As above, I'm not saying at all that there's nothing to carry over. Just advising heavily against the perspective that syntax is the big thing to get over when coming to C++ for the first time.[/quote] I think you are underestimating the importance of syntax. Not only does it define the concrete building blocks of the language, it is also the first thing newcomers have to learn in order to actually use the language (which -in extension to my original post- is also why learning C# in advance to learning C++ would contribute to a better starting point). That said, I know from my own experience that it's sometimes difficult to view a programming language (or the entire concept of programming for that matter) through the eyes of a newcomer like the OP. For example, try thinking about the difference between two calling conventions like fastcall and stdcall. This is pretty straightforward, right? Well, now imagine that you have a person utterly new to programming in front of you and try explaining it to him/her while keeping in mind that every single time you use a word or topic that he/she would not know as a newcomer (instruction pointer, register, parameter, memory address, stack, binary number ...) you would have to elaborate on this as well. I think this would be a good exercise for you as it would probably make you realize just how much knowledge you take for granted when you have been programming for several years. [quote name='ApochPiQ' timestamp='1336598253' post='4938784']Compared to the really important differences between C++ and basically any other language under the sun, I'd say the presence or absence of certain squiggly symbols is really pretty irrelevant.[/quote] What are these really important differences from a newcomer's perspective? [quote name='ApochPiQ' timestamp='1336598253' post='4938784']C# and Java, by the way, are not really what I would consider C-family languages. They use superficially similar syntax in a few notable areas, but they derive very little else from the true heritage of C. This isn't a history lecture thread so I won't bother digging into the genealogy; suffice it to say that Java was originally created with the express purpose of escaping the C legacy in a number of areas. The syntax resemblance to C and C++ (which, I would argue, is basically limited to curly braces and semicolons) was deliberately chosen to psychologically make it feel more familiar to programmers with a C background, but conceptually and semantically they are vastly different beasts. It is precisely this confusion with "oh hey they use the same squiggles" and the idea that "therefore they must be similar languages" that I consider so dangerous.[/quote] Well, in addition to curly braces and semicolons I just counted 44 operators in the C++ programming language. Out of these, 39 (88.64%) have the same meaning in Java and the remaining 5 of them are all related to pointers/memory access and does thus not exist in Java. In addition to that, all of the most basic keywords for conditional statements and general control flow (if, else, switch, return, case, for, while, continue, break, do ...) along with the names for primitive data types (char, short, int, long, float, double ...), and the keywords for exception handling (try, catch, throw) have essentially the same meaning in Java. There is a reason I mention all this. First of all, I hope you will agree that C++ (originally called "C With Classes" by the way) belongs to the C family. I don't know if you are familiar with the scripting technology called Lua, but this library is written in what the developers call "Clean C" which means it can be build with both C and C++ compilers. I am pretty sure you wouldn't be able to do this had they not had a very tight connection between them. Now, as my little 'research' concluded Java (and presumably C# as well) obviously inherits much of its syntax from C++ which is why I place them in the same family, although I agree that compared to C++ the relation between Java/C# and C is more like the one between a son and his grandfather. Nevertheless, this relation is based on the syntax. From a different and more historical perspective (specifically how machine code stored on punch-cards evolved to assembly language and later on to high level languages) I totally agree that both Java and C# belong in an utterly different family since they in contrast to C and C++ are interpreted languages.
- [quote name='ApochPiQ' timestamp='1336590124' post='4938726']Saying that you can learn one language easily after another because they have similar syntax is like saying flying a jet is similar to driving a car as long as they're both painted the same color.[/quote] I think it varies from person to person and also depends on how much experience they have obtained with the language they started with. When I learned C++ I already had some experience with Java which made it a lot easier for me. For example, I was already familiar with the concept of classes, operators (+ - * / << >>), functions, inheritance, accessors/mutators and a gazillion other things these two languages have in common, and consequently I read my first C++ book a lot faster than if I had not known Java. [quote name='ApochPiQ' timestamp='1336590124' post='4938726'][edit] And having seen the results of C# programmers actually [i]believing[/i] the idea you propose here (i.e. that C++ has similar syntax so it must be easy to learn once you know C#), I can honestly say that this is utter insanity. C# (or Java) programmers coming to C++ without [b]expecting[/b] to learn a totally new way of thinking generally write really, really, really, utterly horrible code.[/quote] I never said it would be easy, I said he would have a good starting point (like I had myself, as I described above). Big difference. Besides that, based on the fact that you think C# and C++ are so fundamentally different that claiming it would be beneficial to know one of them when starting out with the other is "utter insanity", I take it your experience with programming languages in general is more or less limited to the C family (C, C++, C#, Java). Try looking up languages like ML or Haskell and I'm pretty sure it will become immediately clear to you that [i]these[/i] language do indeed use a fundamentally different syntax than both C++ and C#.
- [quote name='way2lazy2care' timestamp='1334706811' post='4932324']If you think this is a flame war, then it shows that you haven't been a member of a forum before ;) This is probably the most civil programming language discussion I've seen.[/quote] ROFL [img][/img] I would personally recommend downloading [url=""]Microsoft Visual C# 2010 Express[/url] (it's free) and learn this as your first language. It's extremely user-friendly and you can click on just about anything in your sourcecode to get help and information, even suggestions on how to fix bugs. Besides that the syntax is very similar to C++ so if one day you would like to try out this language you would have a really good starting point.
Dragonion replied to yannickw's topic in For Beginners[quote name='yannickw' timestamp='1333131740' post='4926749']Could you recommend me some good tutorials or books, pref with some tutorials about create game states, loading models,...[/quote] The [url=""]DirectX SDK[/url] contains a rich set of documents, including a very comprehensive manual and some tutorials to get you started. These have been my own primary source for learning DirectX. I don't know any books specifically aimed at creating game states, but [url=""]Game Engine Architecture[/url] by Jason Gregory has gotten some exceptionally good reviews (I'm planning to read it myself some time in the future). As for loading models DirectX has it's own format called [url=""]X files[/url] which is probably the easiest format to start with since the SDK has build-in functionality for handling these files. Various 3rd party 3DS plug-ins are also available for saving in this format. Alternatively you could export your models as either [url=""]Wavefront OBJ[/url] (supported directly in 3DS) or the [url=""]COLLADA[/url] format (3DS plug-in available). Both of these formats are very popular in the game industry and you can thus find many resources for handling them on the internet. Also there is an entire forum on gamedev.net dedicated to DirectX programming, so ask around whenever you need some advice.
Dragonion replied to yannickw's topic in For Beginners[quote name='yannickw' timestamp='1333113631' post='4926667']So I just need to catch the WM_TOUCH message and subscribe to the different touch events?[/quote] Yes. [quote name='yannickw' timestamp='1333113631' post='4926667']Which would you recommend, DirectX or OpenGL?[/quote] DirectX. Both API's have advantages/disadvantages, but DirectX is a tad more user friendly/high-level (not to mention a lot bigger) and has many utility functions that makes it easier to work with. A good example is that DirectX has a function for loading a texture directly from a file (D3DXCreateTextureFromFile) while OpenGL can only handle raw pixel data (which means you need some external functionality for interpreting/reading a PNG/BMP image, for example). [quote name='yannickw' timestamp='1333113631' post='4926667']I chose XNA because it's rather high level and makes things a lot easier. We don't have enough time to write all the code for loading models and stuff like that, we'll have enough work trying to get the foil to work properly.[/quote] Well, as a general rule very high level languages tend to decrease development time at the cost of less flexibility.
Dragonion replied to yannickw's topic in For BeginnersI haven't worked with XNA myself, but if you use DirectX or OpenGL the WM_TOUCH message will be sent directly to the main window (the one displaying your game), so in this case making the program react to touch input is rather trivial.
Dragonion replied to ajm113's topic in General and Gameplay Programming[quote name='Washu' timestamp='1333096964' post='4926606']The tree structure you would [url=""]want happens to have a name as well[/url][/quote] Thanks, I haven't worked on a compiler since 1998 so I have admittedly forgotten about many of the data structures used in this branch of programming.
Dragonion replied to Waterlimon's topic in For BeginnersAs a general rule you should not place classes in a namespace using headers (because that [i]is[/i] actually messy). Instead, I would personally do something like this: [code]// engine_vehicles_car.hpp --==>> namespace MyEngine { namespace Vehicles { class Car { // ... }; } } // <<==-- engine_vehicles_car.hpp // engine_vehicles_motorcycle.hpp --==>> namespace MyEngine { namespace Vehicles { class Motorcycle { // ... }; } } // <<==-- engine_vehicles_motorcycle.hpp // engine_vehicles.hpp --==>> #include "engine_vehicles_car.hpp" #include "engine_vehicles_motorcycle.hpp" // <<==-- engine_vehicles.hpp // myprogram.cpp --==>> #include "engine_vehicles.hpp" using namespace MyEngine; // optional using namespace MyEngine::Vehicles; // optional // <<==-- myprogram.cpp[/code] Or, in case of multiple small classes, I would perhaps do like this: [code]// engine_vehicles.hpp --==>> namespace MyEngine { namespace Vehicles { class Car { // ... }; class Motorcycle { // ... }; } } // <<==-- engine_vehicles.hpp // myprogram.cpp --==>> #include "engine_vehicles.hpp" using namespace MyEngine; // optional using namespace MyEngine::Vehicles; // optional // <<==-- myprogram.cpp[/code]
Dragonion replied to ajm113's topic in General and Gameplay ProgrammingOne solution would be to first [url=""]tokenize[/url] the input line using [url=""]regular expressions[/url]. This would convert the input string "2 + 2" to a token list like { Value(2), Operator(+), Value(2) }. Next, perform a [url=""]syntactic analysis[/url] which identifies and organizes (typically in some [url=""]tree structure[/url]) the elements that need to be evaluated. Continuing with our "2 + 2" example this would create a tree from the token list with 3 nodes constituting a single addition expression: { Addition(Value(2),Value(2)) }. Lastly, evaluate the tree (or more specifically each node in the tree), which in our example would yield something like Value(4).
|
https://www.gamedev.net/profile/172255-dragonion/?tab=smrep
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
This action might not be possible to undo. Are you sure you want to continue?
From Toilets to Rivers
Experiences, New Opportunities, and Innovative Solutions
© 2014 Asian Development Bank All rights reserved. Published in 2014. Printed in the Philippines.
ISBN 978-92-9254-460-7 (Print), 978-92-9254-461-4 (PDF) Publication Stock No. RPT146362-2 Cataloging-In-Publication Data From toilets to rivers: Experiences new opportunities, and innovative solutions Mandaluyong City, Philippines: Asian Development Bank, 2014. 1. Sanitation services 2. Wastewater management I. Asian Development Bank.
The views expressed in this publication are those of the authors and do not necessarily reflect, (i) “$” refers to US dollars, (ii) ton refers to metric ton, equal to 1,000 kg.
Contents
Acknowledgments Background Abbreviations Weights and Measures Currency Units Improved On-Site Sanitation: A Business Case Ecological Sanitation (Ecosan) Toilets in Rural School: Hayanist, Armenia Community Sanitation Center: Tangerang, Province of Banten, Indonesia Toilet Blocks with Biogas Plants: Naivasha, Kenya Slum Sanitation Project: Mumbai, India Transforming Society through Sanitation Movement: In India Ikotoilets: Thinking Beyond a Toilet: Kenya Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas Treating Wastewater to Protect Coastal Waters: Lilo-an, Cebu, Philippines Customizing a Decentralized Sanitation Solution for Viet Nam’s Peri-urban Areas: Kieu Ky Commune, Ha Noi, Viet Nam Community-based Sanitation (SANIMAS): Denpasar, Bali Province, Indonesia Reusing the Public Market’s Treated Wastewater: Muntinlupa City, Metro Manila, Philippines Decentralized Wastewater Treatment System for Manjuyod Public Market: Manjuyod, Negros Oriental, Philippines “Eco Tanks”: Decentralized Wastewater Treatment for Seaside Communities: San Fernando City, La Union, Philippines Constructed Wetlands with Reuse Applications Constructed Wetland for a Peri-urban Housing Area: Bayawan City, Negros Oriental, Philippines Wastewater Reuse after Reed Bed Treatment: Dubai, United Arab Emirates vi vii ix xiii xiii 1 2 3 4 6 7 8 10 11 12 14 15 17 18 20 20 23
iv
Contents
Low-cost Sewerage Systems Small-bore Sewerage System: Tegucigalpa, Honduras Applying Innovative and Multidimensional Approaches Innovative Technologies for Cost-effective Wastewater Management: West Zone, Metro Manila, Philippines Making the Unthinkable Drinkable: Singapore Performance-based Contract for Wastewater Treatment and Recycling Facility: Melbourne, Australia Innovative Financing Arrangement for Inclusive and Financially Viable Sanitation: Wastewater as a Strategic Part of Economic Development Catalyzing Environmental Investments and Economic Development: Xiamen, Fujian Province, People’s Republic of China Rethinking Financing Options Optimizing National and Local Government Financial Resources for Wastewater Management and River Clean Up: Kitakyushu City, Fukuoka Prefecture, Japan Local Government-financed Citywide Septage Management System: Dumaguete City, Negros Oriental, Philippines Pollution Reduction and Wastewater Management: Guangzhou, Guandong Province, People’s Republic of China Bringing Water Supply and Sanitation Services to Tribal Villages: Orissa, India Household Sanitation Credit Scheme: Viet Nam Microfinancing for Biogas Digesters: Cambodia Public-Private Partnerships: Driving Innovations Addressing Water Scarcity through PPP and Innovative Wastewater Management: Sulaibiya, Kuwait Pioneering Wastewater Recycling: Durban, eThekweni Municipality, South Africa Innovative Design of Facilities to Address Land Constraints: East Zone, Metro Manila, and Rizal Province, Philippines
26 26 28 29 31 32 33 35 36 39 39 41 42 44 45 47 47 48 52 52 54 55
Contents
v
Protecting Water Resources and Coasts Pollution Reduction through Wastewater Management: Hebei Province, People’s Republic of China Wastewater Treatment and Water Resources Protection: Tianjin, People’s Republic of China Protecting Groundwater and Ensuring Energy Security: Orange County, Orlando, Florida, United States of America Creating Synergies for Energy and Nutrient Recovery Sewage Treatment Plant and Greenhouse Gas Emission Reduction Project: Kinoya, Suva City, Viti Levu Island, Republic of Fiji An Innovative Recycling Hub of Regional Biomass by a Public Wastewater Treatment Plant: Suzu City, Ishikawa Prefecture, Japan Industrial Wastewater Treatment with Energy and Nutrient Recovery and Carbon Credits: Batangas, Philippines 100% Biogas for Urban Transport: Linköping, Sweden Wastewater and Septage Treatment and Reuse for Agriculture Wastewater Treatment for Irrigation: Buon Ma Thuot City, Dak Lak Province, Viet Nam Tehran Sewerage System: Iran Septage and Biosolids Management: Metro Manila and Rizal Province, Philippines Wastewater Treatment and Aquaculture Integrated Duckweed-based Wastewater Treatment and Pisciculture: Mirzapur, Bangladesh Wastewater Treatment for Sustainable Tourism and Recreation Eco-Lagoon: Nusa Dua, Bali Province, Indonesia Water and Sanitation for Sustainable Tourism: Boracay, Aklan Province, Philippines Wastewater Treatment and Recreation Park: Bhubaneswar City, Orissa, India Environmental Sanitation and Good Governance Environmental Sanitation Project: Port Louis, Mauritius
58 58 60 61 63 63 65 66 67 70 70 72 73 75 75 77 77 78 80 83 83
Acknowledgments
ollowing the 2nd ADB–DMC and Partners Sanitation Dialogue on May 2011, representatives from the Asian Development Bank (ADB), International Water Association (IWA) and United Nations Secretary General’s Advisory Board on Water and Sanitation (UNSGAB)–Omega Alliance for wastewater revolution– agreed to develop a compendium of case studies of good practices, new approaches and working models on sanitation and wastewater management that could promote the acceptance of innovation and change, create fertile ground for reuse and applying technologies intelligently, demonstrate incentive and financing packages, and inspire investment uptake in wastewater management.
F
Maria Corazon M. Ebarvia was responsible for the compilation of case studies and project briefs, and prepared the introduction to each section. The project briefs were developed by Debbie Villa, Maria Corazon Ebarvia, Robert Domingo, and November Tan following the template agreed upon by ADB and IWA. IWA and its member organizations have contributed case studies/project briefs as part of its Urban Sanitation Initiative. The following helped in finalizing this publication: Anna Lissa Capili for editing, Anna Romelyn Almario for additional inputs, Ginojesu Pascua for layout and design. Publication support in terms of compliance review were ably provided by the team of Anna Sherwood, including Leonardo Magno, April Gallega, and Rodel Bautista. Contribution of case studies by Mary Jane Ortega, Center for Advanced Philippine Studies (CAPS),and United Nations Economic and Social Commission for Asia and the Pacific (UNESCAP) is gratefully acknowledged. This publication also benefited from the support and encouragement of Amy Leung, Gil-Hong Kim, and Jingmin Huang; insights of Anand Chiplunkar; and valuable comments and suggestions from Jonathan Parkinson.
vi
Background
here are 1.7 billion people in Asia and Pacific without access to improved sanitation—far behind the MDG target. Sanitation is central to the larger development agenda, but it remains to be one of Asia’s principal socioeconomic challenges: social—because it deals with public health and human dignity; and economic— because of the tremendous losses from environmental and human impacts. Open defecation, inadequate sanitation facilities and discharge of untreated wastewater into water bodies threaten the health of local people as well as affect livelihoods, ecosystems, and water bodies, the latter of which we rely on for drinking, bathing, swimming, and fishing, among others. A paradigm shift is therefore required towards new approaches that include technological innovation, comprehensive package of financing, credit enhancement and delivery mechanisms, and performance-based and business-oriented solutions, and ensuring that investments are appropriate to the communities and industries they serve. More than ever, it is crucial to increase efforts to improve sanitation by 2015 and beyond. We need to identify doable solutions and opportunities, and agree on actions that will make sanitation happen. But neither of these two activities—identifying opportunities and committing to action—can happen without a solid knowledge base to work from. The project briefs provide a synopsis of case studies from different countries, and demonstrate solution options from which useful lessons on sanitation management can be derived. The case studies were selected from existing publications, which can be referred to for more exhaustive discussion. Documentation was done following a template developed by the Asian Development Bank (ADB) and International Water Association (IWA). Each project brief provides an overview of the technology adopted, capital and operating and maintenance costs, financing mechanisms, institutional arrangements, and project outcomes. While issues of sanitation are often looked at in isolation, they are directly tied to issues of water security, health, food security, environmental sustainability, energy and climate change. The case studies illustrate not only the challenges of sanitation and wastewater management, but more importantly, the proven results in: (a) increasing access to sanitation in poor communities through on-site sanitation facilities, low-cost sewerage and decentralized wastewater treatment systems; (b) improving service delivery through policy reforms, application of appropriate technologies, innovative financing mechanisms and contracts, and public-private partnerships; (c) ensuring financial viability and sustainability; and .
T
vii
Abbreviations
A/O A2/O ABR ABW ADB ADI AF APCF ARWP AWHHE BAST BASTAF BDA BEST BIWC BMZ BOD BOD5 BORDA BOT BTDC CAPS CAS CBO CDM CEDAC CENRO CER CHF CIDS CIEDC CIFA CITYNET CMC COD CO2 – anaerobic/oxic (wastewater treatment process) – anaerobic/anoxic/oxic (wastewater treatment process) – anaerobic baffled reactor – automatic backwash – Asian Development Bank – Absolut Distillers, Inc. – anaerobic filters – Asia Pacific Carbon Fund – Altona Recycled Water Project – Armenian Women for Health and Healthy Environment – baffled anaerobic septic tank – baffled anaerobic septic tank and anaerobic filters – Bhubaneswar Development Authority – Institute for Integrated Social and Economic Development – Boracay Island Water Company – German Ministry for Economic Cooperation and Development – biochemical oxygen demand – five-day biochemical oxygen demand – Bremen Overseas Research and Development Association – build-operate-transfer – Bali Tourism Development Corporation – Center for Advanced Philippine Studies – conventional activate sludge – community-based organization – Clean Development Mechanism – Cambodian Center for Study and Development in Agriculture – City Environment and Natural Resources Office – certified emission reduction – Cooperative Housing Foundation – Cambodia Institute of Development Study – Cambodia-India Entrepreneurship Development Center – Central Institute of Freshwater Aquaculture – Regional Network of Local Authorities for the Management of Human Settlements – Community Management Committees – chemical oxygen demand – carbon dioxide
viii
Abbreviations
ix
CRUEIP CW CWW DAPH Danida DBO DBP DBSA DENR DEWATS DILG DMC DS EA EAST Viet Nam ECOSAN EMB EPA EPA EPP EWS EU FDEP FIRR FMO GDP GEF GERES GHG GIZ GTZ HDPE HGF HIVOS HPMO HRT
– Central Region Urban Environmental Improvement Project – constructed wetlands – City West Water – Department of Animal Production and Health – Danish International Development Assistance – design-build-operate – Development Bank of the Philippines – Development Bank of Southern Africa – Department of Environment and Natural Resources – decentralized wastewater treatment systems – Department of the Interior and Local Government – developing member country – dry solid – executing agency – Eau Agriculture et Sante en Milieu Tropical Viet Nam – ecological sanitation – Environmental Management Bureau – Environment Protection Authority (in Victoria, Australia) – Environment Protection Agency (in Japan) – Ecosan Promotion Project – eThekwini Water Services – European Union – Florida Department of Environmental Protection – financial internal rates of return – The Netherlands Development Finance Company – gross domestic product – Global Environment Facility – Groupe Energies Renouvelables Environnement et Solidarite – greenhouse gas – Deutsche Gesellschaft für Internationale Zusammenarbeit – Deutsche Gesellschaft für Technische Zusammenarbeit – high-density polyethylene – horizontal gravel filter – Humanist Institute for Development Cooperation – Hebei Project Management Office – hydraulic retention time
x
Abbreviations
HSCS ICEF IDEA IEC IFAS IMO IMV IPCOL IWA JBIC KOICA LGU LINAW LITA LLDA LRF MAFF MANTRA MBBR MBR MCGM MDG MF MFRO MHC MLIT MOA MOU MPW MSC MTSP MWCI MWSI MWSS MWSS-RO NBK
– Household Sanitation Credit Scheme – India Canada Environment Facility – intermittently decanted extended aeration – information, education and communication – integrated fixed film activated sludge – International Maritime Organization – Institut des Metiers de la Ville – Investment Promotion Corporation of Orissa, Ltd. – International Water Association – Japan Bank for International Cooperation – Korea International Cooperation Agency – local government unit – Local Initiatives for Affordable Wastewater Treatment Project – Linköpings Trafik AB – Laguna Lake Development Authority – Federation of Swedish Farmers – Ministry of Agriculture, Forestry and Fishery – Movement and Network for the Transformation of Rural Areas – moving bed biofilm reactor – membrane bioreactors – Municipal Corporation of Greater Mumbai – Millennium Development Goal – microfiltration – microfiltration-reverse osmosis – Ministry of Housing and Construction – Ministry of Land, Infrastructure and Transport – Memorandum of Agreement – Memorandum of Understanding – Ministry of Public Works – Municipal Sewerage Company – Manila Third Sewerage Project – Manila Water Company, Inc. – Maynilad Water Services, Inc. – Metropolitan Waterworks and Sewerage System – Metropolitan Waterworks and Sewerage System Regulatory Office – National Bank of Kuwait
Abbreviations
xi
NBP NCIC NDMD NEDA NGO NIMBY NMECD NMG NRW O&M PADCO PBPO PDA PEMSEA PFK PPP PPE PRC PRISM PSA PTA PUB PWRF RBC RO SANAA SANIMAS SBC SBR Sida/SIDA SLBE SSP ST STP SuSanA TA
– National Biodigesters Program – Nanjing Urban Construction Investment Company – Nanjing Drainage Management Department – National Economic and Development Authority – nongovernment organization – “Not In My BackYard” syndrome – Nanjing Municipal Engineering Construction Department – Nanjing Municipal Government – non-revenue water – operation and maintenance – Planning and Development Collaborative International, Inc. – Provincial Biodigester Program Office – Pilot and Demonstration Activity – Partnerships in Environmental Management for the Seas of East Asia – Prudential Financial Inflation – public-private partnership – plant production envelope – People’s Republic of China – Project in Agriculture, Rural Industry Science and Medicine – Philippine Sanitation Alliance – Philippine Tourism Authority – Public Utilities Board – Philippine Water Revolving Fund – rotating biological contactor – reverse osmosis – National Autonomous Water and Sewerage Authorities – Sanitation by the Community Program – Security Bank Corporation – sequential batch reactor – Swedish International Development Cooperation Agency – small local business enterprise – Slum Sanitation Project – settling tank – sewage treatment plant / sludge treatment plant – Sustainable Sanitation Alliance – technical assistance
xii
Abbreviations
TCEPC TDI TIEZA TML TNUIFSL TPWWC TSC TSC TSS TUHH TVAB UAE UDC UDD UEBD UK-DFID UNDP UNEP UNESCAP UNICEF USAID USEPA UV VWS WECF WEMC WHO WMA WSB WSD WSP WSTF WW&SE WWTP XIM
– Tianjin Capital Environmental Protection Company – Tanduay Distillers, Inc. – Tourism Infrastructure and Enterprise Zone Authority – Tianjin Municipal Luanhe Drinking Water Source Protection Engineering – Tamil Nadu Urban Infrastructure Financial Services Ltd. – Tehran Province Water and Wastewater Company – Tehran Sewerage Company – Tianjin Sewerage Company – total suspended solids – Hamburg University of Technology, Institute of Wastewater Management and Water Protection – TekniskaVerken – United Arab Emirates – Utilities Development Company – urine diversion dehydration – Executive Unit for Settlement in Development – United Kingdom Department for International Development – United Nations Development Programme – United Nations Environment Programme – United Nations Economic and Social Commission for Asia and the Pacific – United Nations Children’s Fund – United States Agency for International Development – United States Environmental Protection Agency – ultraviolet – Veolia Water Services – Women in Europe for a Common Future – Wuhan Environmental Monitoring Centre – World Health Organization – Wastewater Management Authority – Water Service Board – Water Supply and Sewerage Department – water service provider – Water Services Trust Fund – Wastewater and Sanitation Enterprise – wastewater treatment plant – Xavier Institute of Management
Weights and Measures
m3 m3/d ha hp IG km lpcd l/min MLD m mg/l mm MGD psi km2 m2 t/day – cubic meter(s) – cubic meter(s) per day – hectare(s) – horsepower – imperial gallon – kilometer(s) – liters per capita per day – liters per minute – million liters per day – meter(s) – milligram per liter – millimeter(s) – million gallons per day – per square inch – square kilometer(s) – square meter(s) – ton per day
Currency Units
A$ CNY D € KES KWD P Rs S$ Tk ¥ – Australian dollar – yuan – dong – euro – Kenyan shilling – Kuwaiti dinar – Philippine peso – Indian rupee – Singapore dollar – taka – yen
xiii
Improved On-Site Sanitation: A Business Case
By the end of 2011, there were 2.5 billion people who lacked access to an improved sanitation facility. Of these, 761 million use public or shared sanitation facilities and another 693 million use facilities that do not meet minimum standards of hygiene (unimproved sanitation facilities). The remaining one billion still practise open defecation. The majority (71%) of those without sanitation live in rural areas, where 90% of all open defecation takes place. 1 While public or shared sanitation facilities are not considered as ‘improved’ sanitation, these facilities nevertheless provide a means to end open defecation. Evidence supports sharing of facilities when they are shared among a small group, or in places where individual household toilet is not possible (e.g., in slum areas). Instances of shared facilities or public toilets are in schools, public markets, transportation terminals, etc. The key is to keep these shared facilities clean and safe. In addition to addressing concerns on health and dignity, some types of toilets provide opportunities for recycling, biogas production, and entrepreneurship. In Armenia, the ecological sanitation (ecosan) project provided an affordable option to upgrade school sanitation. It serves as an example of how sanitation in schools and rural areas without any connection to sewer systems can be improved. The community sanitation centers in Tangerang, Banten, Indonesia and the toilet blocks in Naivasha, Kenya include toilets, bathroom/shower areas, water kiosk, wastewater treatment and biogas digester. In Mumbai, India, the toilet blocks are connected to septic tanks or the sewerage system. User fees are collected in these community toilet blocks to recover the operating and maintenance (O&M) costs, as well as provide income to the operators of the facilities. The main difference between a public toilet and a community toilet block is that the latter belongs to a specific community of users, and is generally not for public use. Sulabh has adopted a pay-and-use approach to maintain community sanitation complexes that were constructed to cater to the poor and low-income sections in many cities in India. The project proves that poor, slum communities are willing to pay for improved water and sanitation services, hence, such operations can be financially viable. Some Sulabh toilets are connected to biogas digesters, while some are connected to low-cost wastewater treatment plants, such as the duckweed-based system. The duckweed-based system also provides financial returns from pisciculture. Both the ikotoilets and ecosan toilets involve urine diversion, and the recycling of water and nutrients contained within human wastes back into the local environment. Some farmers with ecosan toilets became entrepreneurs selling income-generating organic vegetables. In Kenya, the ikotoilets and shower sanitation centers also serve as sites for community activity. By providing complementary services, (e.g., kiosks, snack shops, shoe shines, barber shops, and newspaper stands) ikotoilets became a multi-use community space—a “toilet mall.” The profits from these business activities and from advertising provide revenue streams to recover the cost of construction and maintenance of the sanitation centers. These case studies show that such business-oriented solutions create incentives for investing in sanitation, and making them sustainable.
1
Source: WHO and UNICEF. 2013. Progress on sanitation and drinking-water: 2013 update.
1
2
From Toilets to River
Project briefs: • Ecosan Toilets in Rural Schools: Hayanist, Armenia • Community Sanitation Center: Tangerang, Province of Banten, Indonesia • Toilet Blocks with Biogas Plants: Naivasha, Kenya • Slum Sanitation Project: Mumbai, India • Transforming Society through Sanitation Movement: India • Ikotoilets: Thinking Beyond a Toilet: Kenya
canal without any benefit of treatment; and at times, discharged wastewater is used for irrigation purposes. To address the common problem of inadequate school sanitation in rural areas, the Hayanist village, with approximately 2,500 inhabitants, has been chosen for an ecological sanitation (ecosan) pilot project. The pilot project applied a decentralized solution given the village’s lack of capacity to shoulder the costs associated with the operation and maintenance (O&M) of a centralized sewerage system. Technology option • The urine diversion dehydration (UDD) technology was chosen during stakeholder consultations, where presentations of different toilet systems and a scale model of a urine diversion toilet were provided. • A local architect, in cooperation with the Hamburg University of Technology, developed the design of the UDD toilet block. The design aims to provide sufficient number of toilets using minimal space and walls to save on expensive construction materials. • Constructed as an extension of the existing school building, a toilet block was built with 7 male and female toilet cubicles (double-vault UDD squatting pans), 3 waterless urinals, and 6 washbasins. o Urine (from boys and girls) is separately collected and stored. o The two feces vaults of a toilet unit have urine diverting squatting pan each. o The urine storage tanks are located in the basement of the toilet building. o Double-vault UDD toilets were selected to collect and store feces for better hygiene and safety. Considering that urine collected from healthy persons is almost sterile, separation of urine and feces is maintained as most pathogens are found in the feces. It should be noted however, that the possibility of cross contamination (feces to urine) could not be completely eliminated. • A wind-driven ventilator is provided for adequate ventilation. • There were six washbasins installed for hand washing. Water for these washbasins are
Ecological Sanitation (Ecosan) Toilets in Rural School
Hayanist, Armenia
Waterless urinals (AWHEE, 2006)
Ecosan UDD toilet (AWHEE, 2006)
Hayanist is located 12 km southwest of the capital Yerevan, and is situated in a basin-shaped area with swampy soil and high groundwater table. A network of open drainage channels made up of small and shallow drainage canals along each street cover the area. Majority of the households use pit latrines as sanitation system, the liquid of which often infiltrates the ground. Households with a flush toilet, on the other hand, discharge wastewater to a drainage
Improved On-Site Sanitation: A Business Case
3
•
sourced from local artesian wells. They are also stocked with towels and soap. The resulting greywater flows into the existing sewage pipes (without treatment). Reuse: Urine is stored for approximately 6 months before the school director used the urine as fertilizer for the barley field. This is in accordance with the World Health Organization (WHO) “Guidelines for the safe use of wastewater, excreta and greywater” (2006).
• A sustainable, affordable and safe school • •
sanitation system was established, which was well accepted by students and teachers alike. No cases of helminths were recorded after project completion and operation. UDD toilets were installed in 3 other schools and 25 private households (partially financed by owners) in other Eastern European, Caucasus, and Central Asian countries. Increased awareness among politicians (both high and low administrational levels), resulting in financial support for more sustainable sanitation projects. The project served as an example of how sanitary conditions in rural areas without any connection to sewer or piped water supply systems can be improved.
•
Institutional and Management Arrangements • The Armenian Women for Health and Healthy Environment (AWHHE) is the executing agency, in close coordination with the Women in Europe for a Common Future (WECF) of Netherlands. • Quelque-Chose Architects, a local company, developed the technical design of the UDD toilet block, in cooperation with the Hamburg University of Technology, Institute of Wastewater Management and Water Protection (TUHH). • The Ministry of Foreign Affairs of Netherlands extended funding support. • A trained personnel was hired to carry out (O&M) activities, i.e., inspection and cleaning of toilets on a daily basis. • Women and Village Committees were established to mobilize the community. • Children were involved in awareness-raising campaign through innovative artistic approaches (i.e., ecogames, exhibitions, and creation of a book). Financing Arrangements • The cost of the new toilet block is estimated to be around €28,740–approximately 70% was allotted for construction materials, and 30% for the design, labor, education and training. • The Ministry of Foreign Affairs of Netherlands provided 70% of the total costs. Project Outcome • Cases of contamination of surface water, open drainage channels and groundwater with pathogens and nitrates were significantly reduced.
•
Contact for More Information Emma Anakhasyan, AWHHE Local Project Coordinator (Email: office@awhhe.am)
Community Sanitation Center
Tangerang, Province of Banten, Indonesia
Community toilet block with biogas digester (Source: RTI International )
Tangerang is a city in the Province of Banten, Indonesia. It is located about 25 km west of Jakarta. The urban slum areas in Tangerang City are mostly settlement areas without infrastructure and services, such as clean water supply and solid waste management. In order to address the need for sanitation services in many of these settlements, the Institute for Integrated Social and Economic Development (BEST) initiated Community Sanitation Centers that consist of low-cost community toilets and gas retrieval systems.
4
From Toilets to River
Technology option • The community sanitation centers aim to provide basic sanitation facilities, such as bathrooms (six units), a wash area, a water point, and a wastewater treatment plant and biogas digester. • Each sanitation center has a maintenance operator to oversee the day-to-day operations. • BEST monitors toilet conditions, building and surrounding areas, water supply, etc., as well as conducts a Consumer Satisfaction Survey to get feedback from the consumers on the service provided. The survey includes questions on water quality and services. Institutional and Management Arrangements • BEST, the main actor of the project, coordinates and manages project resources. • Donor agencies provided seed funding for the construction of the center. A Joint Cooperation Agreement was signed between BEST and international donor agencies for the construction of each sanitation center. • The local government of Tangerang provided funding for the construction of seven centers and facilitated the implementation of the project by allowing the construction and operation of centers without permits. • A Memorandum of Understanding (MOU) was signed between the individual communities and BEST, affirming the willingness-to-pay of the former for the facilities provided. • The operators of the centers are families from the community. They are paid a basic salary by BEST, and take part in the profits. Each operator signs an individual contract with BEST. Financing Arrangements • The construction of each community sanitation center (land acquisition, construction —including a wastewater treatment plant and biodigester, and the purchase of a water pump) is fully subsidized by a grant from donors. Running costs, such as operations and routine maintenance, are generated and covered from user fees. • BEST relies on other sources of funding because not all its staff costs for servicing the centers are covered by revenues.
Project Outcome • There are 29 poor community settlements throughout Tangerang and Surabaya that gained access to toilet facilities and clean water and sanitation. • Awareness on the importance of sound sanitary practices increased, while the cost of water was lowered by 60% compared to that of private water vendors. • Community health improved. • Land values in areas surrounding the centers have increased, and new sources of income were created for small businesses. • There was a change in attitudes and behavior of communities, such that communities now feel encouraged to tackle other community problems like improving drainage systems and local roads. Contact for More Information Hamzah Harun Al Rasyid, Director, Institute for Integrated Social and Economic Development
Toilet Blocks with Biogas Plant
Naivasha, Kenya
Sanitation facility with water kiosk. Underground biogas plant in front (Source: Sustainable Sanitation Alliance)
Area of top manhole, above the biogas fixed dome (Source: SuSanA)
Improved On-Site Sanitation: A Business Case
5
Naivasha is a small town located on the shores of Lake Naivasha, about 80 km north of Nairobi, the capital of Kenya. The town covers an area of 30 km2, and has a population of approximately 70,000 people. The town relies mainly on pit latrines, with less than 5% of households and businesses connected to the sewer system. The sewer system is linked to a poorly functioning wastewater treatment plant. The project focused on improving the living conditions by providing hygienic and environmentally friendly sanitation solutions with reuse of the human waste. It also aims to provide a business-oriented solution that creates economic incentives for the water sector institutions to invest in sanitation. Technology option • The toilet block comprises of toilets, hand-wash basins, urinals, a shower, and a water kiosk. The wastewater from the facility is drained into an underground biogas plant to treat the wastewater anaerobically. • Biogas plant: { The biogas has two outputs: treated effluent (continuous flow) and sludge (emptied once per year) { The biogas plant has a volume of 54 m3 with two expansion chambers with underground structure at 0.5m below the ground surface. { Design parameters: 1,000 users per day; dimensions were based on hydraulic retention time (HRT) of 5 days. Institutional and Management Arrangements • The Water Service Board (WSB) planned the toilet block in partnership with the local water service provider and the municipal council of Naivasha in early 2007. The EU-SIDA-GIZ EcoSan Promotion Project (EPP), the Water Services Trust Fund (WSTF), the Rift Valley Water Service Board, the municipal council of Naivasha, and the water service provider formed a project task force that jointly developed the sanitation concept.
• The water service provider trained and licensed
the operation of the facility to Banda Livestock Self Help Group, a community-based organization, to maintain the toilet block on a renewable one-year contract. The same also agreed to monitor the operation of the facilities on a weekly basis in order to identify any maintenance requirements. Financing Arrangements Capital investment • The investment costs for the entire project (€25,000) was financed through a grant from the European Union (EU)—ACP EU Water Facility, Swedish International Development Corporation Agency (SIDA), Deutsche Gesellschaft fur Internationale Zusammenarbeit (GIZ), formerly known as German Technical Corporation (GTZ), and WSTF (supported by the Kenyan Government). Cost recovery • The use of the Naivasha Public Toilet carries a fee of KES5 (€0.05) per use; shower costs KES10 (€0.1) and a 20–22 litre jerry-can of water costs KES2 (€0.02). • These tariffs were proposed by the water service provider. • The WSB (asset holder) and the Water Service Regulatory Board (regulator) are the ones responsible for adjusting the tariffs, if required. Project Outcomes • After a year of operation, the toilet blocks are delivering convenient, safe and affordable sanitation services. In 2010, the toilet block had approximately 9,000 users per month, and has drastically improved the hygienic conditions in Naivasha, and also provided an income to the operator and the water service provider. • The project was the first sanitation project of the WSTF, which served as a learning facility for various stakeholders, and also paved the way for further improvement of the facility design and implementation. The WSTF has since then developed an improved public sanitation design with a toolkit. This is being up-scaled in Kenya.
6
From Toilets to River
Slum Sanitation Project
Mumbai, India Greater Mumbai hosts a population of more than 16 million. Prior to the Slum Sanitation Project (SSP), sanitation improvement schemes for the slum dwellers were implemented by the Municipal Corporation of Greater Mumbai (MCGM) through a supply-driven approach. Subsequently, 80% of publicly constructed toilet blocks were found to be not functioning, and thus, incapable of meeting the demand. These facilities were also putting pressure on public finances since the MCGM was responsible for all maintenance costs. Taking this into
consideration, it was deemed necessary to develop an appropriate strategy for improving sanitation facilities to meet the needs of slum dwellers on a more sustainable basis. Technology option • The toilet blocks comprise of bathing cubicles, urinals and squatting platforms for defecation. The main difference between a public toilet and a community toilet block is that the latter belongs to a specific community of users, and is generally not for public use. • Wastewater from the toilet blocks is discharged either into the municipal sewerage network or through septic tanks, when connection to a sewer is not feasible. Institutional and Management Arrangements • Participation of nongovernmental organizations (NGOs) and community-based organizations (CBOs) in all key aspects of project preparation and implementation was a cornerstone of the project design. The MCGM managed the bidding process, and contracted NGOs to undertake a range of activities according to specified standards of performance related to cleanliness and access to facilities. • Memorandums of Understanding (MOUs) were signed between the MCGM and each of the CBOs or small local business enterprises (SLBEs) responsible for management of the toilet blocks. • The MOU ensured that CBOs/SLBEs were held responsible for the O&M of the blocks, while the MCGM retained the right to evaluate the performance of these entities over time, and if need be, cancel the contract and offer to a different CBO/SLBE in case of unsatisfactory performance. Financing Arrangements Capital investment • The total capital investment cost ($28 million) was borne by MCGM under a loan from the World Bank, which covered 60% of the costs. • Prior to the construction of toilet blocks, the residents paid an upfront contribution between Rs100-Rs500 ($2.25–$11). This contribution was used to finance the upgrade and rehabilitation of the toilets.
Pour-flush toilet (Source: IWA)
Toilet block (Source: IWA)
Toilet block (Source: Water and Sanitation Program)
Improved On-Site Sanitation: A Business Case
7
Cost recovery • The cost recovery policy was applied through monthly payment of Rs30 ($0.67) per family, whereas people without monthly passes (visitors) pay Rs1 ($0.02) per usage. Project Outcomes • Over 328 toilets blocks and more than 5,100 toilet seats have been constructed in the slum areas across Mumbai under SSP. • The localised management arrangement installs a sense of ownership within communities, which translates into greater responsibility for O&M of the assets. • Stakeholder involvement in the SSP was successful as a result of a learning-bydoing approach. • The SSP provided a solid foundation for a new paradigm in the provision of sustainable sanitation services in Mumbai, shifting the focus away from a supply-driven and capitalintensive toilet construction approach to one that provides incentives to multiple stakeholders acting collaboratively for a more durable O&M regime to help ensure improved access and quality services.
diseases, such as dysentery, hookworm or cholera. This staggering mortality rate was due to the lack of safe human waste disposal system. Low sanitation coverage in India was primarily due to insufficient motivation and awareness of the people, and lack of affordable sanitation technology. Technology option • The Sulabh Two-Pit-Pour-Flush Toilet technology is an indigenous, eco-friendly, technically appropriate, socio-culturally acceptable, and economically affordable technology. It consists of a pan with a steep slope of 25–28 degrees and a trap with 20-millimeter water-seal requiring only 1.5 to 2 liters of water for flushing. The Sulabh toilet does not need scavengers to clean the pits. There are two pits of varying size and capacity, depending on the number of users, these are designed for 3 years usage. Both pits are used alternately. When one pit is full, incoming excreta is diverted into the second pit. In 2 years, the sludge gets digested, and is almost dry and pathogen-free, thus, safe for handling as manure, which can then be used as a soil-conditioner. • In some areas, biogas is produced from the human excreta to electrify homes. The Sulabh biogas technology process includes filtration of effluent through activated charcoal and the use of ultraviolet rays. • Some of the ponds and ditches requiring wastewater treatment use duckweed technology. Duckweed aquatic plant greatly reduces biochemical oxygen demand (BOD), chemical oxygen demand (COD), suspended solids, bacteria and other pathogens from wastewater. Small pilot projects were implemented to clean up ponds and ditches to show gains in economic returns from pisciculture. Institutional and Management Arrangements • Sulabh collaborated with State governments. This collaboration brought about an acceptance of Sulabh work to the people, and brought it to a meaningful scale of operations. • State governments also conducted houseto-house contact and campaigns in the local language to uplift scavengers from their subhuman conditions using the Sulabh toilet system.
Transforming Society through Sanitation Movement
India
Sulabh Two-Pit-Pour-Flush Toilet (Source: B. Pathak)
In India, 360 out of 1,000 million people used either dry latrines, which were manually cleaned by scavengers who carried excreta away with their hands, or just defecated in an open area. The lack of latrines caused many health problems, including the death of nearly 1.9 million children each year due to
8
From Toilets to River
Financing Arrangements • Financing of the Sulabh toilets are mainly from the local State governments. The local body provides for the cost of construction of the toilet complex. Sulabh does not depend on external agencies for financing as it is generated through internal resources. • The maintenance of toilets and day-to-day expenses are taken from the user’s payments. A pay-and-use system is utilized to maintain community toilets in many parts of the country, including 25 States, 4 Union Territories, and 1,075 towns and metropolitan cities, such as Delhi, Bombay, Calcutta, and Madras. However, not all public toilet complexes in the slums and less developed areas are self- sustaining. Thus, maintenance of such toilets is cross-subsidized from the income generated from busier toilet complexes in the urban and developed areas. Project Outcomes • To date, some major outcomes and impact of Sulabh’s initiatives include: (i) 1.2 million Sulabh household toilets constructed, resulting in open defecation-free areas; (ii) 190 human excretabased biogas plants; (iii) 640 towns made scavenging-free; (iv) 7,000 scavengers trained and resettled, thereby uplifting the social status of so-called ‘untouchables’; and (v) over 10.5 million people using Sulabh facilities every day. • Sulabh’s collaboration with the State Governments helped influence policy and make sanitation part of the national mandate.
Ikotoilets as a multi-use community center—a “toilet mall.” ()
Ikotoilet urine-collection system, City Park, Nairobi, Kenya ()
The Ikotoilet is an innovative solution to the growing environmental sanitation problem in Kenya. This is based on an enterprise model by a company named Ecotact. This initiative extends from offering sanitation services to a range of complimentary business services, such as kiosks, barber shops, etc. Technology option • Ikotoilet is a complete toilet facility with a separate area for men and women, integrated with a low-flush system. • The system is constructed such that the urine is collected separately for reuse, and rainwater is collected and stored in tanks to be used as alternative water supply. Institutional and Management Arrangements • Ecotact is a Nairobi-based company established in 2008 to improve the urban landscape for low-income communities through a buildoperate-transfer (BOT) model of public-private partnership (PPP). • Ecotact signed a long-term contract with municipalities to use public land and, in return, the same bears all the construction costs, and operates the facilities for 5 years. However, it relinquishes ultimate ownership of the facilities to the municipalities, who can decide whether to extend their contracts with Ecotact.
Ikotoilets: Thinking Beyond a Toilet
Kenya In Kenya, it is expected that the population will reach 42 million by the end of 2011 with 65% of this population residing in slums. The investment by the government in public sanitation facilities in Nairobi has been almost nonexistent for the past 30 years, and as a result, sanitation facilities have been characterized by overcrowding and poor maintenance with inaccessible and unhygienic conditions.
Improved On-Site Sanitation: A Business Case
9
Financial Arrangements Capital investment • The capital cost for this project was funded by Ecotact with the support of the Acumen Fund, the Global Water Challenge, and the World Bank. Capital recovery • The cost recovery policy applied was a user fee of KES5.00 ($0.06), complemented with advertising revenues from clients who use the Ikotoilets premises for their publicity, and from the rent derived from leasing out space to microentrepreneurs (who operate their businesses in the ‘mall’ areas). Project Outcomes • By the end of 2010, 29 units of Ikotoilet have been installed across 12 municipalities, inclusive of two Ikotoilets in the slums of Mathare and Kawangare, which served more than 5 million users in 2010. • A new standard of hygiene in target communities has been achieved, reducing environmental health risks, and restoring dignity with the provision of sanitation services. • Sustainability of Ikotoilets is enhanced through youth training programmes that provide sufficient management skills to prepare them to eventually run these facilities as entrepreneurs.
Onyango, P., Rieck, C. 2010. Public toilet with biogas plant and water kiosk in Naivasha, Kenya Case study of sustainable sanitation projects. () S. Deegener (TUHH), M. Samwel (WECF), E. Anakhasyan (AWHHE). 2007. Data Sheets for Ecosan Projects: Dry urine diverting school toilets in Hayanist, Armenia. Deutsche Gesellschaft fur Technische Zusammenarbeit (GTZ) GmbH. ———. 2009. Case Study of SuSanA Projects: UDD Toilets in Rural School. Hayanist, Armenia. Sustainable Sanitation Alliance. Sulabh Sanitation Movement. Sulabh International Social Service Organisation. (. ly/1k8tPFQ) United Nations Economic and Social Commission for Asia and the Pacific (UNESCAP). 2004. Community Toilets in Tangerang, Indonesia. World Bank-Water and Sanitation Program. 2007. Taking Water and Sanitation to the Urban Poor. Case Study.
References
Acumen Fund. 2011. Quality Sanitation Facilities for the Urban Poor.. org/investment/ecotact-limited.html. (Accessed 2 November 2011). Field note: Mumbai SSP - Empowering Slum Communities - Revised May 2006. International Water Association. 2012. Project: Ikotoilets, Kenya. () ———. 2012. Public Toilet with Biogas Plant, Kenya. () ——— Slum Sanitation Program, India (. ly/1ixrpVQ)
Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas
The decentralized concept of wastewater management aims to provide a framework for developing “alternative” systems consisting of a variety of approaches for collection, treatment, and dispersal/reuse of wastewater. It goes beyond merely managing individual user systems. Effluent from individual dwellings, industrial or institutional facilities, clusters of homes or businesses, public markets, and entire communities may be routed to further treatment processes in smaller facilities that are closer to the sources. They provide a range of treatment options from simple, passive treatment (such as septic tanks with soil dispersal) to more complex and mechanized approaches (such as rotating biocontactor, membrane bioreactor, moving bed biofilm reactor, etc.), as well as less complicated systems like the anaerobic baffled reactor. An evaluation of site-specific conditions should be performed to determine the appropriate type of treatment system for each location. The six project briefs highlight how decentralized wastewater treatment systems can be sustainable and appropriate options for communities and homeowners. The technologies selected to best showcase these treatment systems are: (a) rotating biological contactor for the public market in Lilo-an (Cebu, Philippines); (b) anaerobic baffled reactor for the public markets in Muntinlupa City (Philippines) and Manjuyod (Philippines), and peri-urban areas in Hanoi (Viet Nam) and Denpasar (Bali, Indonesia); and (c) ecotanks for slum areas and coastal tourism area in San Fernando City (La Union, Philippines). Decentralized wastewater systems in these sites have been demonstrated to be cost effective, economical and reliable solutions to meet public health and water quality goals as well as offer opportunity for water reuse. Awareness-raising activities and consultations with stakeholders ensured social acceptability and active participation. It should be noted, nonetheless, that the decentralized concept will not be the answer to all wastewater management problems. Likewise, centralized systems are not the only appropriate approach. We have to go beyond the “one size fits all” mentality. The many potential benefits of decentralized systems indicate that it is a method, which deserves much greater attention, especially in smaller communities, rural areas and the developing urban fringe, where the alternative decentralized strategy makes the best sense. Project briefs • Treating Wastewater to Protect Coastal Waters: Lilo-an, Cebu, Philippines • Customizing a Decentralized Sanitation Solution for Viet Nam’s Peri-urban Areas: Kieu Ky Commune, Ha Noi, Viet Nam • Community-based Sanitation (SANIMAS): Denpasar, Bali Province, Indonesia • Reusing the Public Market’s Treated Wastewater: Muntinlupa City, Metro Manila, Philippines • Decentralized Wastewater Treatment System for Manjuyod Public Market: Manjuyod, Negros Oriental, Philippines • “Eco Tanks” for Seaside Communities: San Fernando City, La Union, Philippines
10
Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas
11
Treating Wastewater to Protect Coastal Waters
Lilo-an, Cebu, Philippines
•
Rotating biological contactor installed in the public market in Lilo-an, Cebu. (Source: ADB)
Lilo-an, a third class municipality in the province of Cebu, has a population of approximately 70,000 people. The town has been suffering from deteriorated coastal water quality with high coliform cell counts, the largest source being wastewater from the Lilo-an public market. Although the public market has a septic tank, it was deemed insufficient. Because of the poor quality of water, the town’s tourism industry dropped dramatically. The Philippine Clean Water Act (2004) suggests that local governments construct a centralized wastewater treatment system with an extensive collection system. Unfortunately, Lilo-an could not afford to do so. Thus, a decentralized wastewater treatment, which was far less expensive, was considered to be more suitable for the municipality. Technology option • Wastewater treatment. A wastewater treatment facility based on a rotating biological contactor (RBC) was constructed. Wastewater is collected via two sewerage lines. After screening, the water is directed to an underground collection tank where it will be pumped vertically to an overhead wastewater tank. From the overhead tank, the water reaches the RBC tanks via gravimetric flow. There are two RBC tanks operated by one unit of 1-hp motor at a rotating speed of one rotation
per minute. The average retention time of the wastewater inside the two RBC tanks is 10 hours if the operation mode is continuous. After the RBC treatment process, the water is directed to a cloth filter tank, which then overflows to the final holding tank. From there, the water can be recycled or directed to a discharge pipe for disposal. Sludge treatment. The public market’s old three-chamber septic tank was used for sludge treatment. Sludge, accumulated at the bottom of the RBC tank, is directed to the first chamber of the septic tank via separate sludge return pipes. The tank then acts as an anaerobic stabilizer for the treatment facility’s surplus sludge. Once the third chamber fills up, wastewater pumps are activated to direct the liquid back to the overhead tank, and thus, to the RBC. This completes a closed loop system for sludge management.
Institutional and Management Arrangements • The Municipal Government is owner of the plant. • Lilo-an Community Multi-Purpose Cooperative maintains and operates the treatment plant. • The Department of Environment and Natural Resources - Environmental Management Bureau (DENR-EMB) Region 7 monitors wastewater effluents discharged into bodies of water. Financial Arrangements • The project was funded by a grant from ADB. • A cost recovery scheme, focusing on user fees, was implemented to cover the O&M costs, and ensure viability and sustainability of the project. Project Outcomes • A significant improvement on removal efficiency, with over 99.8% for total coliform and 97.8% for fecal coliform bacteria. • Biochemicall oxygen demand (BOD) and chemical oxygen demand (COD) removal was also satisfactory. • A removal of about 3.35% of ammonia was noted, as was phosphorus removal of about 18%.
12
From Toilets to River
Customizing a Decentralized Sanitation Solution for Viet Nam’s Peri-urban Areas
Kieu Ky Commune, Ha Noi, Viet Nam
main components: (i) identify appropriate options for domestic wastewater collection and treatment; (ii) select appropriate wastewater collection and treatment system for the craftwork shops; and (iii) implement a pilot wastewater treatment plant. Partnership funding and technology was secured from ADB’s Pilot and Demonstration Activities (PDA) fund, which aims at promoting effective water management policies and practices at the regional level, as well as from the Institut des Metiers de la Ville (IMV) and the Bremen Overseas Research and Development Association (BORDA), whose modular, decentralized, and cost-effective wastewater treatment packages that they have termed “DEWATS” (decentralized wastewater treatment systems) were used for this project. Technology option Septic tanks of 60 pilot households were connected to a decentralized wastewater treatment facility, which was designed to treat 40 m3/d of wastewater, and comprised of the following components: • Gravity-fed sewer: It consists of small-bore piping installed for each connected household to carry its septic tank effluent and greywater to the DEWATS. • Primary settling unit: It serves as a wastewater retention point and an area for control of influent fluctuations (an equalization tank), which allows any large sludge, debris and other floatable and visible wastes to settle or be screened out. • Anaerobic baffled reactor (ABR): An upgraded baffled anaerobic septic tank (BAST) that uses static devices to regulate the flow of fluids, forcing wastewater to flow from the inlet to the tank outlet. • Anaerobic filters (AF): Particles and dissolved solids are trapped, organic matter is degraded, and pathogens and chemicals in the wastewater are removed by the bacterial biofilm in the filters. • Horizontal gravel filter (HGF) and constructed wetlands: The vegetated soil filter (or reed bed) is used to further treat wastewater by copying the natural purification abilities of wetlands. The plant roots within the gravel help to oxygenate the wastewater. This oxygenation helps to degrade remaining organic pollutants and reduce the odor.
During construction of the anaerobic baffled reactor (Source: ADB)
Baffled anaerobic septic tank and anaerobic filter (Source: ADB)
Kieu Ky Commune is a peri-urban commune of the Ha Noi Capital District. Located 20 km downstream from the city center, it is directly affected by the polluted urban wastewater draining down from the city. The commune’s primary economic activities are traditional crafts, such as gold leaf production, which use inefficient production processes that can further contribute to environmental air and water pollution. Wastewater from the craft industry in Kieu Ky Commune polluted the rice fields via irrigation canals. The residents consequently suffered from sanitation-related problems (e.g., contaminated drinking water, skin allergies, and foul-smelling rivers with dead fish). Though septic tanks and dry latrines exist in the commune, these facilities are not effective in treating wastewater. ADB, together with the Ha Noi People’s Committee and EAST (Eau Agriculture et Sante en Milieu Tropical) Viet Nam, managed a pilot and demonstration activity to find a sanitation solution for the people of Kieu Ky. The project had three
Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas
13
• Discharge pipe: After the HGF, the effluent is
usually considered clean enough for discharge to a nearby creek or canal. Institutional and Management Arrangements • EAST Viet Nam is the main executing agency for the entire project; while BORDA (through provision of its DEWATS technology), the contractor (No. 5 Assembly Construction and Investment Joint Stock Company), and the District and Commune People’s Committees of Kieu Ky all served as cooperating agencies. • EAST Viet Nam: The French NGO managed project activities; provided all information needed to help BORDA design the wastewater treatment plant; and contracted a construction company for the pilot plant construction. • Bremen Overseas Research and Development Association (BORDA): The German NGO was responsible for the layout and design of the treatment plant. BORDA worked with EAST in establishing and proposing a financing and operational mechanism for the O&M of the treatment plant. BORDA also provided O&M training for the village head and the appointed facility operator. • Supervision Team: BORDA contracted a private supervisor for the project, as well as local supervisors to represent the community. The local supervisors ensured that the community was involved during the construction process to avoid conflicts, and give the community a sense of ownership for the treatment facility. • Kieu Ky Commune: The commune manages the completed facility and piped network. The head of the commune is in charge of collecting a monthly fee from each household; contracting a sanitation professional company when required (sludge removal, filter cleaning, etc.); and deciding on how to further develop the sanitation infrastructure. A facility operator was appointed by the commune to handle small technical maintenance work, and ensure continuous system operation. Financial Arrangements • ADB PDA grant of $50,000 covered all of the research, analysis, surveying, and outreach tasks of the project. BORDA Viet Nam then supplied
• • • •
an additional $14,000 towards the DEWATS portion of the project, and IMV also provided $7,000. The total project cost for all parties was $71,000. Materials and construction costs: $31,000. (ADB = $10,000; BORDA = $14,000; IMV = $7,000) Monthly fee from each household: $0.30. (This cost covers the facility operator’s salary and short/midterm O&M costs.) The People’s Committee covers the costs of desludging the system every 2 to 3 years. The Kieu Ky Commune will need to raise money to finance cost of fixing future equipment damages.
Project Outcomes • Through the project, it was determined that DEWATS, when combined with a baffled anaerobic septic tank and anaerobic filters (BASTAF) and constructed wetlands (CW), is one of the preferred sanitation solutions for Kieu Ky. • Initial monitoring results showed that the facility removed up to 98% of BOD and 96% of COD, and meets the water quality standards (TCVN 5945–2005). However, proper assessments of the commune’s current environmental and sanitary situation require samples taken regularly over a longer period of time. • The project showed that raising community awareness, to encourage hygienic and environmental behavior improvement, is critical to the project’s sustainability. People were willing to pay when they understood the benefits gained from collective sanitation services. • Some limitations recognized by the project: Technical difficulties in connecting households to piped network, and the need for bigger resources to increase the number of households connected to the treatment facility. • Practical application of this PDA is expected in the Provincial Water Supply and Sanitation Project for Thua Thien Hue Province and the Central Region Rural Water Supply and Sanitation Project. Contact for more information Hubert Jenny, Principal Urban Development Specialist, ADB Viet Nam Resident Mission.
14
From Toilets to River
Community-Based Sanitation (SANIMAS)
Denpasar, Bali Province, Indonesia
•
designed DEWATS to treat about 60 m3 of blackwater and greywater per day. There were 67 household connection boxes, functioning as grease-trap units; 200 control boxes or manholes; simple sewage pipes from houses; an ABR with no electricity inputs; a drainage system next to the plant; and an electric pump to provide effluent discharge back-up during floods. These were all installed during the project.
During construction (Source: Yuyun Ismawati)
Road with manholes for the sewer system (Source: Yuyun Ismawati)
The lack of proper septic tanks for about 80% of rooms or houses in Kusuma Bangsa, West Denpasar District, leads to a discharge of wastewater to a nearby stream. Floods cause the stream to push wastewater and rubbish back into houses. The residents, especially children below five years old, suffer from a high rate of diarrhea and other waterborne diseases due to the lack of proper sanitation and frequent flooding. In a neighborhood where monthly family income ranges from $44 to $167, the cost of constant treatment for these diseases becomes a burden. Indonesia’s Sanitation by the Community Program (SANIMAS), which uses a community-based development approach, implemented a project in 2004–2005 that would provide sanitation services for 840 people in Kusuma Bangsa. Technology option • The community chose a simple BORDA-
Institutional and management arrangements • Community-Based Organization (CBO): The CBO has legal ownership of the infrastructure, organizes meetings, identifies beneficiaries, compiles action plans, manages funds, and mobilizes people to support and participate in the project. Together with an appointed operator, who collects user fees from participating households, the CBO ensures the system works properly and takes care of minor repairs. The municipality assumed responsibility for major repairs. • BORDA and BALIFOKUS: A German NGO (BORDA) worked through a local NGO (BALIFOKUS) to find a technical solution for the community after a needs assessment and is responsible for taking effluent samples to monitor the wastewater quality every 6 months. • Community Action Plan Book: The CBO and BALIFOKUS compiled into one book all the plans and anticipated activities for construction fund management, sustainable cost coverage for O&M, and system and services maintenance. It was signed by all parties involved. The community used the book as a tool to submit fund disbursement requests to contributors, such as government agencies. • Project Joint Account and Financial Report: A joint account was opened at a local bank to manage the multisourced project funding. Withdrawals required approval from all three account signatories. CBO managers and treasurers were trained by BALIFOKUS and BORDA to compile simple financial reports and receipts, which were submitted to all parties in the same financial report at the end of the construction stage.
Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas
15
Financing Arrangements • Total cost of implementation, construction, and capacity building: $39,814 (multisource financing). • User fee collected from 211 households per year: $1,406.67. o O&M cost per year (including solid waste collection): $827.78. o The CBO uses the $578.89 profit to fund other infrastructure improvements within the neighborhood. Project Outcomes • High level of contributions from the community resulted in solid waste collection service with new sanitation service, improved pathways, and excess funds in the community account. • Residents enjoy better health, reduced health expenses, a cleaner neighborhood, and groundwater that is better preserved. Women no longer worry about floods and backwash during the rainy season. Children suffer less from diarrhea and are safer using the new concrete paths. • The community’s empowerment through increased awareness on health and hygiene issues gave them the confidence to lobby for initiatives to further improve the area. • The DEWATS plant, which can treat domestic wastewater to standards set by environmental agencies, requires only simple, low maintenance approaches and procedures. User fees are reasonable for the poor and cover all O&M costs. • Provision of off-site sanitation for 211 households, benefitting around 840 people. Contact for more information Yuyun Ismawati, Director, BALIFOKUS Foundation (yuyun@lead.or.id, balifokus@balifokus.or.id).
Reusing the Public Market’s Treated Wastewater
Muntinlupa City, Metro Manila, Philippines
Wastewater in the anaerobic baffled reactor (Source: USAID-LINAW Project)
Treated water is reused for street cleaning and flushing toilets in the market. (Source: USAID-LINAW Project)
The Muntinlupa Market, with 1,445 stall owners and 4,880 vendors serving about 4,500 customers daily, produces extremely contaminated wastewater from its eateries, toilets, and stalls. It pollutes a tributary creek of Laguna de Bay, which is a source of drinking water and freshwater fish for Metro Manila. If the market failed to abide by new regulations under the Philippine Clean Water Act 2004, it would close, and result in massive layoffs. The local government unit addressed this by constructing a low-cost, low-maintenance wastewater treatment facility for the market with technical assistance from the United States Agency for International Development (USAID). Technology option • The system uses grit screens, septic tanks, and an ABR to reduce the pollution level of the wastewater from more than 600 mg/l BOD to less than 30 mg/l.
16
From Toilets to River
• Cocopeat, a widely available by-product of
the coconut processing industry, is used as an alternative filter once compacted. It is 100% organic and highly effective in removing pollutants. Limited space required the treatment facility to be constructed under the market’s parking lot. Its main reactor was designed to withstand the heavy loads of cars and trucks. The tank lid was formed using a concrete slab with 6-inch thick steel reinforcement.
the use of the wastewater treatment facility. It also helped the city raise awareness about the facility’s contributions to the public market and its consumers. Financing Arrangements • Facility construction cost: P6.7 million, funded by Muntinlupa City. • Social Marketing Plan estimated cost: P118,512.50 (70% funded by USAID and 30% by Muntinlupa City). • Cost recovery for construction cost: o O&M per year: P324,000. o User fee collected from market stall owners per year: P2,601,000 (at P5.00/day per stall owner). o Cost recovery for construction: Within 3–4 years. Project Outcomes • Water pollution level decreased from 600 mg/l to less than 30 mg/l. • Treated water is used for flushing toilets, street cleaning, and watering plants, which saved the city about P25,000 per month in operation costs of the market. • Compliance to the Philippine Clean Water Act of 2004 prevented closure of the market and guaranteed livelihood for stall owners and vendors. Community is more educated on proper waste disposal, wastewater management, and water and sanitation. Contact for more information Lisa Kircher Lumbao, Team Leader for LINAW, USAID (Email: llumbao@eco-asia.org.ph) Jet D. Pabilonia, City Environment Protection and Natural Resource Office, Muntinlupa City (Email: jetdp3369@yahoo.com)
•
Institutional and management arrangements • USAID: USAID provided technical assistance and expertise in designing the wastewater treatment facility under its Local Initiatives for Affordable Wastewater Treatment (LINAW) Project. It also initiated the Social Marketing Plan to raise public awareness on water and sanitation, and encourage participation from the people to support the wastewater management project. • Planning and Development Collaborative International, Inc. (PADCO): The local government unit (LGU) signed an MOU with USAID through PADCO—an international development consulting firm under contract with the Government of the United States through USAID—detailing responsibilities on initial design, planning, construction, and monitoring of the facility. • Local government unit: The LGU for Muntinlupa City worked with its City Engineer’s Office, Muntinlupa Public Market Cooperative, and City Planning and Development Office to construct the facility with guidance from PADCO and USAID. The LGU coordinated and led all local project activities according to the Local Government Code, and the signed MOU with PADCO. Local project activities included collection of data, consultation with local stakeholders, and establishment of teams needed to implement project activities. Since the LGU owns the treatment facility, benefits and income generated from the project are directly used for the O&M of the facility. • Muntinlupa City Public Market Cooperative: The cooperative, which is managed by the LGU, manages the collection of the “user’s fee” for
Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas
17
Decentralized Wastewater Treatment System for Manjuyod Public Market
Manjuyod, Negros Oriental, Philippines
•
(iii) a 1-chamber anaerobic filter; (iv) a planted gravel filter; and (v) an indicator pond to monitor effluent quality as well as for aesthetic purposes. Raw wastewater is first collected. It is then brought to the settling tank for the separation of solid material and scum. The wastewater then passes through an anaerobic baffled reactor to reduce the BOD and COD content. Oxygen is then introduced to the wastewater in the next step via a planted gravel filter with plants and their roots. To complete the aerobic process, a polishing pond was installed. The pond is used to monitor wastewater quality after treatment, specifically for BOD5 and total suspended solids (TSS). Treated wastewater will then be discharged to the sea.
View of the anaerobic treatment modules: settling tank (ST), anaerobic baffled reactor (ABR), and anaerobic filter (AF). (Source: BORDA)
Manjuyod is a municipality in the province of Negros Oriental. One of the problems that it faced was the blackwater generated by the public market that contributed to the degradation of its water bodies. Waterborne diseases, such as diarrhea, typhoid fever and acute gastro-enteritis, are among the leading causes of morbidity in the municipality. A new public market was to be constructed. It was necessary to integrate an environmentally sound system, which provides hygienic and sanitary facilities alongside the construction. Thus, the new market was the site of the wastewater treatment system, so that raw wastewater would be treated and disposed of in a manner that minimized potential harm to public health and detrimental impacts on the environment. Sources of untreated water were the new public market, the fruit and vegetable market, restaurants, nearby residents, and the Municipal Health Office. Technology Option • The DEWATS in Manjuyod has the capacity to treat 40 m3 of wastewater per day. The system consists of five components: (i) a settling tank; (ii) an 8-chamber anaerobic baffled reactor;
Institutional and Management Arrangements The LGU is the project proponent. The planning and executing institution is the Negros Oriental Provincial Engineer’s Office. Monitoring of the treated wastewater, specifically BOD5 and TSS, will be undertaken by the Municipal Environment and Natural Resources Office. Financing Arrangements The cost of the construction of the DEWATS was P1.2 million, and was paid for using funds generated from the internal resources of the local government of Manjuyod and augmented by the Provincial Government. O&M cost is minimal because no mechanical part was installed. If a pump is installed, electricity cost will be factored in. Project Outcomes • There has been an improvement in the water quality after treatment, complying with Class C water quality standards of the national government. • The DEWATS facility provides communities with a means to reduce pollution load, thereby protecting public health and preserving the natural environment and ecosystems. • Effluent quality was reduced to less than 30 mg/l.
18
From Toilets to River
“Eco Tanks”: Decentralized Wastewater Treatment for Seaside Communities
San Fernando City, La Union, Philippines
Institutional and Management Arrangements • The City Government sent representatives of the City Environment and Natural Resources Office, health workers, and City Engineering Office during the assessment and construction phases. • CITYNET conceptualized and piloted the Eco Tanks in the three communities. • Philippine Sanitation Alliance (PSA) helped fund a third tank for the city. • Barangay Councils and staff of Catbangen, Poro and San Francisco helped during the assessment study and the construction phase. Financing Arrangements • The main funding agency was the City Government, with CITYNET and the PSA (via USAID and Rotary) providing additional funding substantially. • The city’s funds paid for (i) rapid technical assessment, (ii) two Eco Tanks and pumps needed at Barangays Catbangen and Poro sites, (iii) shipping costs for the tanks from Manila to San Fernando, La Union, and (iv) installation of the tanks and all associated infrastructure. CITYNET’s funds paid for the shipping of the tanks from Bangkok to Manila, as well as all information, education and communication (IEC) activity costs. PSA (using Rotary International and USAID funds) assisted in the funding for the San Francisco site. • The total project cost for all parties was about $78,000. Much of this was due to international shipping cost, installation costs for diverting the drainage canals, and, in the case of San Francisco, creating a new drainage system. The Eco Tanks themselves, as sold by Premier Products, only cost as much as $5,000 for the largest model. Project Outcomes • The Eco Tank system was installed in three sites, treating wastewater from drainage canals. • A similar project was also undertaken in Negombo, Sri Lanka through CITYNET. Contact for more information Rizalyn Medrano (City Environment and Natural Resources Office (CENRO) of San Fernando City, La Union); email: rizalyn_medrano@yahoo.com.
Eco Tanks (Source: Citynet)
San Fernando City is located in La Union province. By 2000, the city had a population of 102,082 with an annual average growth of 2.3%. The population increase corresponded with an increase in water pollution, especially in many slum communities that are largely unserviced by proper sewerage systems. There were three sites chosen for the project. The first two, Barangays Catbangen and Poro, are residential slum areas located on each side of the Catbangen creek. The third site, Barangay San Francisco, is located along the coast, and is popular with the locals and tourists. The sites experienced poor sanitation, including: (i) toilets that did not have properly constructed septic tanks, and mostly, not desludged; and (ii) open pit toilets. Thus, the quality of groundwater, river water and seawater was compromised. Technology Option • Eco Tank is a small-scale sewage treatment system, which uses anaerobic bacteria to biochemically treat wastewater from residential areas. • The tank(s) consists of just two chambers: an anaerobic settling area or holding tank, and a chamber filled with small, porous, plastic balls that will harbor anaerobic bacteria, and act as an anaerobic filter. • The tank is lightweight, low cost, nonmechanized, easy to install, and made of fiberglass.
Decentralized Wastewater Treatment Systems for Public Markets and Peri-Urban Areas
19
References
Asian Development Bank. 2006. Decentralized wastewater treatment facility for the Lilo-an public market. ———. 2009. Completion Report: Promoting Effective Water Policies and Practices (phase 5) – Pilot and Demonstration Activity for Viet Nam: Developing Appropriate Sanitation Solutions for Peri-urban Areas in Viet Nam. Manila. BORDA. 2008. Decentralized Wastewater Treatment System -DEWATS for Manjuyod Public Market, Negros Oriental. (. ly/1jj1Vt5) City Environment and Natural Resources Office of the City of San Fernando, La Union. 2011. City-to-City cooperation project for decentralized sewage treatment using Eco Tanks in the City of San Fernando. Powerpoint Presentation. CITYNET. 2011. Project: City-to-City cooperation project for decentralized sewage treatment using Eco Tanks. () (accessed 11 May 2011) UNESCAP. 2007. Case Study: Sanitation by the Community in Denpasar, Indonesia (SANIMAS). ———2009. Case Study: Wastewater Treatment Facility in the Muntinlupa Public Market, Philippines. () USAID. Success Story: Public Market Reuses Treated Wastewater.
Constructed Wetlands with Reuse Applications
The use of natural processes to remove pollutants in constructed wetlands has been extensively investigated and effectively applied in Western countries for decades. Constructed wetlands are man-made, engineered systems that utilize natural treatment processes to reduce the pollution levels in wastewater. The combination of soil, plants and microorganisms efficiently removes organic pollutants, nutrients and toxic contaminants in wastewater using a variety of physical, biological and chemical processes. Compared to conventional treatment systems, constructed wetlands have lower energy and chemical requirements. Lesser energy requirement means less greenhouse gases. In fact, the plants sequester carbon dioxide into their biomass. The low capital and O&M costs of these systems, together with good removal efficiency, and simplicity in operation, make them an attractive wastewater treatment option for developing countries. The two cases from the Philippines and United Arab Emirates show that in areas where land is available, but capital may be limited, the constructed wetlands offer a cost-effective and ecologically sustainable option. In addition to having access to an improved and sustainable sanitation system, the people in the two communities were able to augment their water supply for irrigation. In Bayawan City, the local government introduced vegetable and cut flower production using organic farming methods as one of the projects that aim to diversify livelihood in the coastal village where the constructed wetland is located. Due to available nutrients in the wetland effluent, the end users are very satisfied using it for irrigation purposes. Part of the treated wastewater is also stored for fire fighting purposes. Similarly, the inhabitants of Dubai had benefited from being able to safely reuse treated effluent for irrigation. Project briefs • Constructed Wetland for a Peri-urban Housing Area: Bayawan City, Negros Oriental, Philippines • Wastewater Reuse After Reed Bed Treatment: Dubai, United Arab Emirates
Constructed Wetland for a Periurban Housing Area
Bayawan City, Negros Oriental, Philippines Families that lived in informal settlements along the coast had no access to safe water supply and sanitation facilities, resulting in a high incidence of morbidity and mortality from waterborne diseases. The families were resettled and provided with improved housing (676 terraced houses), sanitation (pour-flush toilets), and connection to safe, piped water supply. The social housing project— Fishermen’s Gawad Kalinga Village—is located in Barangay Villareal, a peri-urban area of Bayawan City. The housing project also includes a health center, day care center, multipurpose hall, and community center. The local government prepared for an expected population growth of 2.9%, and corresponding increase in pollution by developing a wastewater treatment system. Bayawan City, with support from the Department of the Interior and Local Government (DILG)-GTZ Water and Sanitation Program, developed and implemented the country’s first constructed wetland wastewater treatment facility within the 7.4-hectare (ha) housing project.
20
Constructed Wetlands with Reuse Applications
21
The constructed wetland covers around 3,000 m2. The project would be used as a pilot and demonstration project for other communities and cities. Technology Option • The hybrid constructed wetland system combines two reed bed systems, namely, vertical and horizontal flow wetlands, to act as biological filters. The plants used in the filter are locally available reeds called ‘tambok’ (Phragmites karka). Designed for a flow rate of 50 liters per day for the 3,400 people and a BOD concentration of 300 mg/l, the constructed wetland works together with the three-chamber septic tanks and small-bore sewers that were already under construction as part of the housing project. • The wastewater distribution system is composed of four concrete header tanks, and a system of perforated high density polyethylene (HDPE) pipes. The system is operated manually, i.e., switching on and off the pump and emptying the header tanks into the distribution system. The water flows by gravity through the distribution system. This design helps save on electricity cost. The header tanks are covered to reduce odor. • The treated wastewater is then collected and pumped into a storage tank, and reused in construction works, irrigation, fire fighting and home gardening.
• Improvements made after the project: A pipe
system with tap stands was installed to distribute the treated wastewater to the vegetable and flower fields. The sludge from the septic tanks will be composted in the drying beds in the city’s sanitary landfill facility, and then made into biofertilizer. Methane will be recovered as well through filtering and processing by a biogas digester. The wastewater treatment system is, therefore, integrated with the sanitary landfill project of the city. Institutional and Management Arrangements • A Memorandum of Agreement (MOA) was signed in April 2005 between the City Government of Bayawan and the German Technical Cooperation Agency (GTZ) for the provision of technical assistance. • Planning and site assessment: A German consultant from Oekotec GmbH and two Filipino consultants worked together, and consulted with the city government and stakeholders to introduce the constructed wetlands technology, as well as assess potential sites. • Construction: Bayawan City Government, using a loan from the World Bank, financed the construction of the treatment system. The City Engineering Office, under the supervision of the local consultants, carried out construction.
Schematic diagram of the constructed wetlands system in Bayawan City. (Source: City Engineering Office, Bayawan City)
22
From Toilets to River
•
particularly the allocation of a budget to cover the O&M cost. Monitoring: The local water service provider regularly analyzes the influent and effluent of the constructed wetland. Analysis includes total dissolved solids, pH, BOD, ammonia, nitrate, phosphate and coliform.
Financing Arrangements • Total construction cost is about €160,000. Bayawan City financed the bulk of this cost with a loan from the World Bank. • The technical assistance provided by the DILG-GTZ Water and Sanitation Program covered the costs of the international consultant, workshops, community participation, and social preparation sessions. • O&M per year: €3,500 (€200 for electricity and €3,300 for labor), paid for in full by the city administration. • Households pay only for their water and electricity consumption, not for wastewater treatment. Also, residents and gardeners use the treated wastewater at no cost.
a. constructed wetland system (Mark Mulingbayan); b. collection pipe (Steve Griffiths); c. feeder tank (Steve Griffiths); d. elevated storage tank for reuse (Bayawan City)
• Public awareness and capacity development:
During the construction, execution, implementation, and operation stages, the City Government of Bayawan, through its Engineering office, undertook IEC campaigns, and took full ownership for setting up a village association to prepare future inhabitants of the relocation area. The staff of the City Engineering Office and City Environmental and Natural Resources Office, as well as members of the village association also attended training workshops for the operation, maintenance, and management of the wastewater treatment facility. The residents and farmers were also trained on proper reuse of treated wastewater, using WHO Guidelines (e.g., wearing gloves, watering the soil and not the leaves, to stop irrigating with treated wastewater 4 weeks before harvest, etc.). Sustainability: Upon completion of the GTZ sanitation program in the Philippines, the Bayawan City Council assumed responsibility for the operation of the constructed wetland,
•
Project Outcomes • The constructed wetland has reduced water pollution. Laboratory analysis shows that the physical and chemical parameters of the treated wastewater have significantly improved (e.g., 97% BOD removal efficiency; increase in dissolved oxygen, 54% reduction of TSS, 71% reduction of total coliform). If land is available, the constructed wetland is a cost-effective solution for domestic wastewater treatment. • The level of social acceptability for the wastewater treatment system by the residents of the housing project is high. The constructed wetland has contributed to the reduced incidence rate of diarrhea and intestinal worms in children in the area. • The system produces treated wastewater that can be reused. • Treated wastewater was used in: (a) concrete production, thereby reducing construction costs; (b) organic cut flower and vegetable farming; and (c) fighting fires. Money is saved through the use of the treated wastewater, in lieu of public water supply. The treated wastewater also saves on
Constructed Wetlands with Reuse Applications
23
•
•
•
•
fertilizer since it is rich in nutrients. The effluent has almost ideal concentrations of nitrate and phosphate to be used for fertilizer and irrigation. The organic farms provide alternative or supplemental livelihood opportunities for the residents who mostly derived their income from fishing. The constructed wetland serves as a demonstration site for local engineers and decision-makers from other local government units. An increase in visitors at the housing project to view the facility was observed. With the knowledge and experience gained, Bayawan City built an additional wetland system combined with an ABR for the District Hospital. (The institutional arrangements with the Department of Health still need to be secured for the connection of the hospital to the treatment system.) The constructed wetland project complements other programs being implemented by Bayawan City, such as the Healthy City, Food Security, Integrated Solid Waste Management, the ‘Character First’, and the Organic Farming programs.
and would entail technical expertise. Thus, innovative technical solutions are required to address such situation given that the high water demand in this hot, dry region is in conflict with its extremely limited availability. Technology Option • The reed bed technology, which combines both aerobic and anaerobic decomposition processes in a sand layer up to a meter thick, is used in Dubai for treatment of car wash wastewater, greywater, blackwater, and septic sludge. • Reed beds are an example of a constructed wetland treatment process (vertical or horizontal subsurface flow, soil filter planted with Phragmites communis or Phragmites australis or other marsh plants). A major change in the oxygen’s system can be achieved through intermittent loading of the reed beds. • Long-term use and transport of pretreated water into the soil is guaranteed. This is due to the continuous growth and decay of the roots and rhizomes of the aquatic macrophytes, and the resulting soil macropores that prevents clogging by filter substrates, such as sand and gravel.
Wastewater Reuse after Reed Bed Treatment
Dubai, United Arab Emirates Dubai has a sub-tropical, arid climate (temperatures range from 10°C to 48°C) with infrequent and irregular rainfall totalling less than 130 mm per year. With rapid industrialization and population growth, public infrastructure is unable to keep up with the increasing volume of sewage.
Reed Bed (Source: IWA)
At present, there are two ways to transport wastewater: (i) via long sewer networks to the main sewage treatment plant, or (ii) if the site is not connected to sewers, stored in tanks and then transported by tanker to a central sewage treatment plant at a later time or pretreated in septic tanks before being released to the ground for infiltration. While the second approach presents problems, (e.g., soil and groundwater contamination) installation of huge sewer lines as an option is quite expensive
Sedimentation Tank (Source: IWA)
24
From Toilets to River
• Project 1: Domestic wastewater at the Waagner
Biro Gulf head office is collected by separate gravity sewer lines for greywater and blackwater. o Greywater: After settling in a two-chamber tank, wastewater is pumped into two parallel vertical flow sand filter reed beds, each with an area of 250 m2. o Blackwater: This is passed through a threechamber septic tank for pretreatment prior to treatment in a mechanical selfbackwashing filter. Final disposal is via subsurface drip irrigation. o The settled solids from the pretreatment units of greywater and blackwater are pumped every 3 months from the settlement tanks into 200 m2 sludge dewatering reed bed for mineralization. Project 2: Car washing wastewater from Waagner Biro Gulf workshop is collected through gravity sewer to the pretreatment: (i) three-chamber oil separator without chemicals; (ii) 20 m2-horizontal flow sand filter reed bed; and (iii) final treatment in the reed bed for greywater treatment. Project 3: Domestic wastewater of SAMA Dubai: (i) three-chamber septic tank and 100 m2vertical flow sand filter reed bed treatment for toilet blackwater; (ii) two-chamber settlement tank and 40 m2-separate vertical flow sand filter reed bed treatment for greywater; (iii) 20 m2sludge dewatering reed bed (reed-planted sand filter bed) for mineralization of septic tank sludge. Treated water is reused for landscape irrigation. Project 4: Conversion of conventional septic tank with soak away at Dubai Municipality Jaddaf: The septic tank is used as pretreatment system. The pretreated water is pumped to a vertical flow sand filter reed bed for biological and tertiary treatment. The treated effluent is then used for irrigation.
• Mizan Consult FZE designs and supervises
treatment for various clients in different settings. construction, training and operation. Mizan Consult FZE is a UAE-based independent wastewater consultant specializing in reed bed technology, and working as sub-consultant or directly for the client. The construction and operation and maintenance (O&M) is carried out by different local contractors supervised and trained by the specialised consultant.
•
•
Financing Arrangements • Clients are generally responsible for the investment. Build-Operate-Own-Transfer (BOOT) projects are also under operation in the UAE. Financing is then carried out by contractors. • The actual construction investment for reed bed systems in this region is equal to conventional systems (activated sludge plants) for up to 15,000 persons (for larger installations, the conventional systems may have lower cost than reed bed systems). • On average, 90% of the investment costs are civil works, e.g., earth movement and installation of filter material, and distribution and drainage of pipe works. • Operational costs of reed bed systems are estimated to be about 10%–30% of activated sludge plants. Project Outcomes • There is significant improvement in public health due to reduced sewage overflow of septic and holding tanks. • It prevents traffic jams caused by vacuum tankers. • It reduces freshwater consumption with reuse of treated wastewater as service water. • In terms of operational efficiency in treating wastewater, average pollutant concentrations from reed beds indicate the following: o Biochemical oxygen demand (BOD): 10 mg/l (average influent parameter: 200–400 mg/l) o Chemical oxygen demand (COD): 25 mg/l (average influent parameter: 400–600 mg/l) o Total suspended solids (TSS): < 5 mg/l o pH: 7.5 o Ammonium as Nitrogen (NH4-N): 1
•
Institutional and Management Arrangements • Waagner Biro Gulf is the executing agency for the project. Waagner Biro Gulf is a construction company specializing in steel, bridge, and marine constructions with a special branch for environmental technologies involving innovative solutions in the field of closed loop wastewater
Constructed Wetlands with Reuse Applications
25
• The vertical flow reed planted sand filter
performed perfectly under hot climate conditions. It was able to achieve results that comply with all Middle East irrigation standards in the treatment of all kinds of sewage (grey, raw, black, tanker, and oil), proven by more than 20 systems currently in operation in the Middle East. Direct treatment of raw sewage in a double stage reed bed has the lowest O&M requirements, and is therefore the most appropriate reed bed technology for remote treatment of sewage in the Middle East. The investment costs for reed beds are equal or even higher compared to conventional package plants. However, the O&M costs are much lower. After 5–7 years, the reed bed system becomes financially viable than the conventional package plants. The reed bed system (i) consumes only little energy (maximum 0.3 kWh/m3), (ii) produces a biomass which is a valuable by-product, and (iii) serves as biotope. Depending on the type of reed bed system used, no sludge disposal is required for 15 years as sludge gets directly mineralized in the system. The reed bed technology provides a wastewater treatment solution that is long lasting, lowmaintenance, easy-to-operate with high performance, and sustainable. The reed bed technology, however, is not a low cost solution for short term projects.
•
Sievert, Wolfram, and Jana Schlick. 2009. Three examples of Wastewater reuse after reed bed treatment, Dubai, Industrial Zone - Case study of sustainable sanitation projects. Sustainable Sanitation Alliance. 2010. Constructed wetland for a peri-urban housing area (Bayawan City, Philippines). (. ly/1fyOeiD)
•
•
• •
•
Contact for more information: Wolfram Sievert: w.sievert@gmx.de; w.sievert@ mizanconsult.com Jana Schlick: jana.schlick@planco.org
References
Guino-o, Robert S., Antonio S. Aguilar and Enrique G. Dracion. 2009. The Efficiency and Social Acceptability of the Constructed Wetland of Bayawan City, Negros Oriental. International Water Association. Six Examples of wastewater Reuse after Reed Bed Treatment, United Arab Emirates. (. ly/1apRvRA)
Low-Cost Sewerage Systems
The low-cost simplified sewer system, also known as condominial sewer (in Brazil) or small-bore sewer system, collects all household wastewater (both blackwater and greywater) in small-diameter pipes laid at fairly flat gradients. Simplified sewers are laid in the front yard, backyard, or under the pavement (sidewalk), rather than in the center of the road as with conventional sewerage. It is suitable for existing unplanned low-income areas, as well as new housing estates with a regular layout. Cost-saving features of any simplified sewerage system include smaller diameter of pipes, smaller and shallower trenches, simplified manholes, and connection to decentralized, small-scale wastewater treatment. Consequently, the main collectors and sewage pumping stations are eliminated in the process. It is important to take note that with simplified sewerage, it is crucial to have in place expert design, construction supervision, and management arrangements to remove blockages in interceptor and junction chambers, which are more frequent than with conventional sewers. Construction can be carried out by trained and properly supervised contractors or community members. Simplified sewer systems have been used in slum and peri-urban areas in Brazil, Pakistan, Peru, South Africa, Sri Lanka, etc. In Tegucigalpa, Honduras, around 20 communities with 24,000 inhabitants in the marginal areas have benefitted from this low-cost sewerage system. support from the Executive Unit for Settlement in Development (UEBD) for the construction of a sewerage system. Based on community demand for better sanitary facilities, the National Autonomous Water and Sewage Authorities (SANAA), with support from UNICEF, included a sanitation component to the Tegucigalpa water programme (generally referred to as ‘Tegucigalpa model’). Technology Option • The technology option used was small-bore sewerage system (solid-free sewerage), which has been implemented successfully in the United States, Brazil and Australia. • The small-bore sewerage system refers to the transport of domestic sewage, which is settled on-site in a septic tank. Only settled sewage is discharged into the sewage pipes to the main collector. Institutional and Management Arrangements • The SANAA, with the support of UNICEF, created the UEBD for execution of the sanitation programme. • The construction, administration, maintenance and operation of the sewerage systems were planned through Junta de Agua (Community Water Board), which is owned by the community. The Community Water Board takes independent decisions on the technology and management options, tariffs, and speed of repayment.
Small-bore Sewerage System
Tegucigalpa, Honduras In 1995, statistics showed that about 150 periurban communities (279,000 persons) in Tegucigalpa lacked access to proper sanitation. The inconveniences of traditional latrines were unbearable for the community, thus, they requested
Construction of small-bore sewer system (Source: UNV/Natasha Mistry).
26
Low-Cost Sewerage Systems
27
• The community provided the manual labour
(each household had to excavate 15 m of trench and some local construction materials including PVC accessories). UNICEF, in partnership with the Cooperative Housing Foundation (CHF), provided families with near-market rate credit for the construction of household sanitary services, such as toilet, shower, etc. The UEBD has the commitment and responsibility to implement courses on O&M of the sewerage system and also a hygiene programme for all beneficiaries.
References
Annemarieke Mooijman. 1998. UNICEF Workshop on Environmental Sanitation and Hygiene, New York, 10–13 June 1998. International Water Association. Low-cost Sewerage Systems in Tegucigalpa, Honduras.
•
•
Financing Arrangements Capital Investment • Construction of toilets was carried out through the Honduran Fund for Social Investment. • The capital investment was financed by the community, UNICEF, and the Government. The communities and the investors made sure all initial costs were covered. Cost recovery • The cost recovery policy was applied through monthly payments by the communities to a rotating fund, which enabled UEBD to expand the programme’s coverage. Project Outcomes • There were four sewerage systems constructed two years after implementation of the programme, and 3,500 people benefited. Subsequently, an additional 19 sewerage systems were constructed between 1998 and 1999, which benefitted an additional 25,000 people. • However, for some poorer households, the cost of connecting their house to the sewerage system was too high, and consequently, these households remain unconnected to the sewerage system. • Note: The sewerage system could no longer meet the demands of the city 10 years after construction due to population increase, ageing infrastructure, and damage caused by an earthquake in 2009. Now, SANAA is seeking a loan to meet the cost ($500 million minimum) for total replacement of the sewer system in Tegucigalpa.
Applying Innovative and Multidimensional Approaches
Existing and emerging challenges, stricter regulations, new requirements, stakeholder needs, climate change issues, and market opportunities—all these require novel ideas and approaches, and doing something different rather than just doing the same thing better. There is a need to move away from the traditional approach of doing business to ensure functioning sanitation systems—from collection to conveyance to treatment and reuse. Adopting and implementing innovative approaches would entail strategic application of science and technologies as well as reforms in policies and institutional arrangements, introduction of new financing mechanisms, and most importantly, behavior change. The six case studies feature innovations in technologies, design, financing, contract management, and ways in dealing with the needs of poor communities. Such innovations are necessary in today’s world to meet the challenge of having universal sanitation coverage and scaling up muchneeded wastewater treatment. Innovative technologies are being used by one of the water concessionaires in the different decentralized wastewater treatment facilities in Metro Manila to address energy and land availability issues. Wastewater reuse should be seen as a means of mitigating pressures in areas where water is scarce. Singapore is solving its water security problem through proper wastewater management, and applying innovative technologies to ensure the quality of water for potable use. Performance-based contracting has been applied by City West Water in Melbourne, Australia for its water recycling facility. This approach focuses on incentivised contracts with specific and measurable performance metrics agreed on by the contracting parties, and directly relating contract payment to performance against indicators. This stands in contrast to the traditional waterfall approach, where payment is related to completion of project milestones and deliverables. The Alandur sewerage project in India became a bankable project through a coordinated effort involving the municipalities of Alandur and Chennai, the State of Tamil Nadu, state asset management and credit facilities, donors, and stakeholders working together to implement a comprehensive package of innovative financial and credit enhancement mechanisms. Arrangements were made to also ensure affordability and access to sanitation by poor communities. Innovative technologies combined with the publicprivate partnership (PPP) approach resulted in saving water, energy and costs in the case of the city of Fillmore in California, USA. The plant features state-of-the-art technology that meets the stringent federal and state requirements, maximizes energy efficiency helping to keep costs down, and allows reuse of water for irrigating school grounds, parks and other green areas. Adopting an integrated approach to clean up the Qinhuai river, the city of Nanjing, People’s Republic of China embarked on projects that focused on sewerage, wastewater and sludge treatment, stormwater drainage, river improvement and water replenishment projects. Funding for these projects are through loans from an international financing institution, such as ADB and commercial bank. Access to capital markets through issuance of 10year water bonds was also pursued by the municipal government with private sector participation. Project briefs • Innovative Technologies for Cost-effective Wastewater Management: West Zone, Metro Manila, Philippines
28
Applying Innovative and Multi-Dimensional Approaches
29
• Making the Unthinkable Drinkable: • •
Singapore Performance-based Contract for Wastewater Treatment and Recycling Facility: Melbourne, Australia Innovative Financing Arrangements for Inclusive and Financially Viable Sanitation and Wastewater Management:
• •
The new decentralized systems utilizing biological treatment technologies are relatively more cost effective, can be retrofitted into aging systems, and have small footprint. Nutrient reduction solutions are also needed due to harmful algal blooms, eutrophication and hypoxic problems in Manila Bay. These biological treatment technologies include membrane bioreactors (MBR), moving bed biofilm reactor (MBBR), integrated fixed-film reactor, and biological aerated filters. Technology Option • Five sewerage systems (Central Manila Sewerage System, Dagat-dagatan Sewerage System, sewerage system with communal septic tanks, Makati Isolated System, and Ayala Alabang System), with more than 490 km of sewer lines and total treatment capacity of 469,000 m3/d, serving approximately 120,000 households. • Technologies used in the five sewerage systems include: a) Physico/Chemical Screening/Grit Removal/ Aeration: treatment process used in the Central Manila Sewerage System and communal septic tanks. b) Lagoon (waste stablization ponds): manmade ponds used to treat organic wastes through the symbiotic actions of algae and microorganisms (by natural and mechanical aeration). The facility consists of a collection system, interceptor, screen chamber, wet well, pumping station, aeration ponds, facultative ponds, and polishing ponds. It is the treatment process used in the Dagatdagatan Sewage Treatment Plant (STP) (200,000 m3/d capacity). Maynilad also operates a 450-m3/d Septage Treatment Plant inside the Dagat- dagatan STP compound. c) Activated Sludge - Extended Aeration: type of activated sludge process with no primary settling and long aerobic detention time to generate less excess sludge overall. It is the treatment process used in the Ayala Alabang System (capacity of 10,000 m3/d). • Technologies used in the decentralized STPs: a) Conventional Activated Sludge (CAS) is the most common suspended growth process used for municipal wastewater treatment. It
Innovative Technologies for Cost-Effective Wastewater Management
West Zone, Metro Manila, Philippines Maynilad Water Services, Inc. (MWSI) is one of the two concessionaires that provides the western portion of Metro Manila as well as parts of the provinces of Cavite and Bulacan with water supply and wastewater services. In Metro Manila, the major factors being raised against putting up centralized sewerage systems include: high initial investments cost, relatively flat terrain (affecting gravity sewer option), high energy cost, social cost from digging up the roads, high water table, low lying land, and susceptibility to natural disasters and climate change impacts. Therefore, the decentralized system is the best alternative. However, in choosing decentralized wastewater treatment systems, energy cost—a major component of the O&M cost—becomes a primary consideration for technology selection. Based on the experience of the private concessionaires, approximately half of the O&M cost is for energy consumption of decentralized systems. After five years, the cost of O&M can exceed the capital cost of the treatment plant. Thus, energy cost is the main constraint for technology selection.
30
From Toilets to River
consists essentially of an aerated biological reactor followed by a secondary clarifier. It is the treatment process used in Bahay Toro STP (13,400 m3/d). Features: • Good process flexibility • Reliable operation • Proven track record in all plant sizes • Low odor emission • Energy production • Ability to withstand nominal changes in water characteristics b) Sequencing Batch Reactor (SBR) is a fill-and-draw activated sludge system designed to operate under non-steady state conditions. It is the treatment process used in Congressional STP (567 m3/d), Grant STP (4,800 m3/d), Legal STP (4,800 m3/d), Bagbag STP (10,400 m3/d) and Tatalon STP (8,100 m3/d). Features: • Smaller footprint because of absence of primary, secondary clarifiers and digester • Biological nutrient removal (nitrogen and phosphorus) • High degree of coliform removal • Less chlorine dosing required for post disinfection • Ability to withstand hydraulic and organic shock loads
c) Moving Bed Biofilm Reactor (MBBR) uses a variant integrated fixed film activated sludge (IFAS) process, and it is essentially a hybrid between a suspended growth (activated sludge process) and a fixed film system. It is the treatment process used in San Antonio STP (3,310 m3/d), Paco STP (410 m3/d), Del Monte STP (3,510 m3/d), and Paltok STP (4,900 m3/d). Features: • Flexible design that allows for increased capacity • Stable under large load variations • Smaller footprint • Single pass treatment • Extremely compact and simple biological treatment system d) STM Aerotor uses IFAS technology as part of a process that provides biological nutrient removal for municipal and industrial wastewater treatment. It is the treatment process used in Baesa STP (390 m3/d), Tandang Sora STP (1,200 m3/d), and Samson STP (3,510 m3/d). Features: • Low energy requirement (lowest energy cost compared with CAS, MBBR and SBR) • Small footprint
Conventional Activated Sludge (Bahay Toro STP) (Source: MWSI)
Sequencing Batch Reactor (Bagbag STP) (Source: MWSI)
Moving Bed Biofilm Reactor (Paltok STP) (Source: MWSI)
STM-Aerotor (Tandang Sora STP) (Source: MWSI)
Applying Innovative and Multi-Dimensional Approaches
31
• • • • • •
Improved sludge settling and quality Low capital cost Advanced biological nutrient removal Stable process No odors Handles various load fluctuations
Institutional and Management Arrangements As one of the two concessionaires, MWSI is tasked to provide water supply, sewerage and sanitation services in the West Zone area (western part of Metro Manila, and parts of the provinces of Cavite and Bulacan). The Metropolitan Waterworks and Sewerage System Regulatory Office (MWSSRO) evaluates the proper implementation of the Concession Agreement, monitors water quality and supply in all service areas, and handles the water tariffs being charged by the concessionaires to all their customers. On the other hand, the Department of Environment and Natural Resources (DENR) and the Laguna Lake Development Authority (LLDA) provide and enforce wastewater standards for treatment operation and facilities. Financing Arrangements As of December 2012, all customer types (residential, commercial and industrial) in Metro Manila pay a 20% environmental charge from the basic water charge. For MWSI, a sewerage charge is levied (as high as 20% of the basic water charge) on commercial and industrial customers who are currently connected to sewer lines. Project Outcomes By selecting technology based on performance indicators, Maynilad is able to achieve cost-effective solution for wastewater management with lower capital costs, and lower operating and maintenance costs.
relied on rainwater collection through its network of drains, canals, rivers and stormwater collection, and imported water from Malaysia that will end in 2061. To reduce Singapore’s dependence on imported water, the government took steps to increase the size of the local water catchment area, and build up supply from non-conventional sources, e.g., reclaimed and desalinated water.
Microfiltration (Source: PUB Singapore)
Reverse Osmosis (Source: PUB Singapore)
Ultraviolet disinfection (Source: PUB Singapore)
Making the Unthinkable Drinkable
Singapore Singapore is a small island city state covering an area of 710 km2. Freshwater has always been a challenge, considered inadequate and uncertain. Singapore
Technology Option Three stages of the system: • Microfiltration (MF): Treated used water is passed through membranes to filter out suspended solids, colloidal particles, diseasecausing bacteria, some viruses and protozoan cysts. Only dissolved salts and organic molecules can pass through the membrane. • Reverse Osmosis (RO): This process uses a semi-permeable membrane with very small
32
From Toilets to River
•
pores allowing very small molecules, such as water molecules, to pass through. At this stage, the water is free from viruses and bacteria, and contains negligible amount of salts and organic matters. Ultraviolet (UV) Disinfection: Considered a safety back-up to the RO stage, the UV disinfection ensures that all organisms are inactivated, and the purity of the product water is guaranteed. With the addition of some alkaline chemicals, NEWater is ready to be used for a wide range of applications.
(iii) A sanitary appliance fee, which is a fixed, used water fee, based on the number of sanitary appliances owned. Project Outcomes • Today, there are four NEWater plants supplying 30% of needed water. The biggest market has been in the industrial sector freeing up reserves of potable water. • NEWater technology brings about a closed water loop system for more efficient resource use. • NEWater passed more than 65,000 scientific tests and surpasses World Health Organization (WHO) requirements.
Institutional and Management Arrangements • The Ministry of the Environment and Water Resources tasked both the Public Utilities Board (PUB) and the National Environment Agency to come up with a solution to Singapore’s water problem. • The goal of the joint venture was to determine the suitability of using NEWater to supplement water supply. PUB made sure there was an efficient, adequate and sustainable supply of water while the National Environment Agency made sure the technology would not harm the quality of the environment. • An expert panel consisting of local and foreign experts oversaw the study. The panel, after 2 years, concluded that the technology would ensure an efficient, adequate and sustainable water supply, and did not harm human health and the environment. Financing Arrangements • Water tariffs in Singapore were set at a level allowing for cost recovery, including capital costs. PUB issued a bond to raise $400 million to finance part of its investment program. Also, water tariffs were set based on the volume used. These included: (i) A water conservation tax to reinforce the water conservation message. Proceeds would go directly to the government. The tax was set at 30%, but a 45% tax level is applied to domestic consumption above 40 m3 per month and connection; (ii) A water fee which is the fee for the volume of water used; and
Performance-based Contract for a Wastewater Treatment and Recycling Facility
Melbourne, Australia
Altona wastewater treatment plant (Source: M. Giesemann)
City West Water (CWW) owns and operates a wastewater treatment plant in the suburb of Altona in Melbourne that treats mostly domestic wastewater from a catchment, with a population equivalent to 50,000. In 2007, to obtain a new operating license to upgrade its plant and gain community acceptance for the new plant, CWW agreed to maximize the recycling of the brackish-like treated effluent from the original treatment facility, instead of discharging the treated effluent to Port Phillip Bay. A private operator was engaged to design, build and operate (DBO) a microfiltration-reverse osmosis (MFRO) desalination plant for 5 years. There were some difficulties in preparing the contract, i.e., how to handle those periods when there was insufficient feedwater available. Thus, performance-based indicators and other new concepts were introduced in the contract to solve such issues.
Applying Innovative and Multi-Dimensional Approaches
33
Technology Option • The Altona Wastewater Treatment Plant uses an activated sludge, nutrient removal treatment process known as Intermittently Decanted Extended Aeration (IDEA) to treat the sewage to a standard required by Victoria’s Environment Protection Authority (EPA) for discharge via a submerged marine outfall to Port Phillip Bay. The biosolids are taken off-site and fully reused. • To further treat the effluent, remove the salt and other contaminants, and permit recycling, CWW constructed the MFRO desalination plant, using a membrane process consisting of strainers, MF membranes, and a two-stage RO process. • In addition to the MFRO plant, the Altona Recycled Water Project (ARWP) also consists of feedwater and process water storage tanks, three pumping stations, and three delivery pipelines. Institutional and Management Arrangements • The institutional arrangement involves CWW as the provider of recycled water services to its irrigation and industrial customers within the city, and the MFRO Plant Operator. • The type of contract for the ARWP was a traditional design and construct contract with an added O&M contract for a period of 5 years, and with an option for a further 5 years. The O&M contract included a performance payment component. • The performance-based component sets conditions based on: (i) a sensible assignment of responsibilities and risks; and (ii) a performance-based payment system that rewards the maximization of catchment yields, and the consistency and quality in the recycled water produced. • Moreover, to ensure that the assignment of accountabilities matched only the factors over which each party could exercise control, three new operational concepts were introduced: (a) Plant Production Envelope (PPE) - the maximum amount of recycled water the MFRO Plant could produce in any given month without external limitations); (b) Plant Productivity (ratio of the actual volume of recycled water produced to the PPE in a given time period); and (c) Plant Performance Factor (calculated based on key
performance indicators, weights, targets and actual performance achieved). Financing Arrangements • The total estimated cost of the ARWP is over A$50 million ($52.6 million). • Under the terms of the contract, payments to the MFRO Plant Operator were based on the Key Performance Indicators developed and weighted. Project Outcomes • The MFRO plant supplies 5.9 million liters per day (MLD) to industry (for boilers and cooling towers) and 3.1 MLD to irrigate two local golf courses and nearby local government recreational areas. • The operational performance-based contract: (i) permitted risks to be appropriately allocated; (ii) provided an incentive to the contractor for the delivery of good performance; and (iii) ensured better compliance of CWW to health and environmental regulations. Contact for more information Matthew Giesemann, General Manager, City West Water email: mgiesemann@citywestwater.com.au
Innovative Financing Arrangements for Inclusive and Financially Viable Sanitation
Alandur, Tamil Nadu, India Alandur is a town located in the eastern coast of Southern India in Tamil Nadu adjacent to the City of Chennai with a population of 165,000 (approximately 25% of which live in slums). The Alandur Sewerage Project is a good example of PPP in the urban sanitation sector. As the first project in the municipal sanitation sector to take the PPP route in India, this case study demonstrates a model that represents an effective institutional and financial approach to implement a sewerage and treatment system with cost recovery.
34
From Toilets to River
• Public awareness campaigns and stakeholder
consultations at all stages of the project were carried out to resolve issues in a transparent manner. Financing Arrangements • TNUIFSL ensured financial discipline by setting up an accounting system, and with the municipality creating a special account for all project transactions. Capital investment • One-off deposits in the form of connection charges were collected from users in different category ranges (domestic, commercial, industrial), and a loan facility was arranged through a nationalized bank. • In order to offset any deficit in the sewerage account, the Government of Tamil Nadu provided gap funding to bridge any shortfall in domestic connection payments. • The financial arrangement for community toilets and its connection to a sewerage system was made by the municipality of Alandur. Cost recovery • The municipality charges the residents (consumers) a monthly fee derived through an iterative process with TNUIFSL. • Wastewater tariffs were structured based on affordability and willingness-to-pay survey. Project Outcomes • From a public health perspective, the key positive impacts are the improved standard of living and public health for all households with connections to the sewerage system. • Of the 23,000 households, 8,350 were connected in 2005. Nearly 500 slum households were provided with sewerage connections, and 14 toilet blocks have been constructed for the benefit of the poorer sectors. Lessons Learnt • The inclusive approach in which different sectors of the population are taken into consideration based on income levels, proved to be effective when aiming to increase service users. Those unable to afford connections to the sewerage network benefit from improved communal
Wastewater treatment plant (Source: IWA)
Technology Option Conventional sewerage system • Main sewer of 19 km and branch sewer lines of 101 km and pumping stations. Treatment system • Sewage treatment plant with a total capacity of 24 MLD (two units of 12 MLD each). Low cost sanitation system • Community toilet blocks connected to sewerage system/septic tank. Institutional and Management Arrangements • Tamil Nadu Urban Infrastructure Financial Services Ltd. (TNUIFSL) was nominated by the municipality of Alandur as the agency to coordinate, supervise and structure the finances for the Alandur project. It was also responsible for the conduct of detailed studies on the feasibility of the project. • Initially, it was decided that the municipality would operate and maintain the sewerage system, but due to lack of resources, it was decided to transfer management responsibility, via a competitive bidding process, to a private contractor. Clear contract conditions and cost control guidelines were followed.
Applying Innovative and Multi-Dimensional Approaches
35
•
toilets. Measures, such as allowing for domestic customers to pay the connection charge in installments, ensured that the public’s concerns were addressed. The municipality’s concerted efforts in spreading awareness about the project have resulted in a good response from communities. People’s participation has been on-going, and this has been encouraged through collective efforts as well as transparent procedures.
scale water reuse system to benefit many areas of the town. The result is a facility, which meets the requirements of federal and state regulations as a zero-discharge facility, and a water-recycling program that irrigates school grounds, parks and other green areas. Technology Option • The plant features state-of-the-art technology that maximizes energy efficiency, helping to keep costs down. • A flow-equalization system minimizes water flow during the day when cost and energy use is highest. • Wastewater is cycled back into the plant where it is treated during off-peak hours when power demand and cost is lower. • MBR and UV disinfection system are expected to yield cleaner recycled water suitable for irrigation. • The UV disinfection system features an automated mechanical wiper-cleaning system that removes debris without removing the UV lamps or halting operation. • Operating at full capacity, the Fillmore plant is designed to treat 2.4 MGD (9,000 m3/d). The current configuration is intended to operate at 1.8 MGD (4,500 m3/d). • The plant’s peak pumping capacity is 4,146 gallons of effluent per minute (15,700 l/min). The facilities also include a recycled water tank that has a storage capacity of 1 million gallons (3,785 m3). Institutional and Management Arrangements • The city engaged the services of American Water Company in a PPP under a DBO model to build a facility capable of producing highquality disinfected water to meet the stringent standards required for surface and sub-surface irrigation of public and private facilities. • American Water Company (American Water) is the operator of the plant. The company handled coordination activities with W.M. Lyles Construction Company and the designengineering firm of Kennedy/Jenks Consultants. • American Water will maintain and operate the wastewater treatment system over the next 20 years.
Saving Water and Costs through Innovative Design and Contract
City of Fillmore, California, United States of America
Fillmore MBR unit (Source: Mark Strauss, American Water Enterprises)
Layout of MBR unit (Source: Mark Strauss, American Water Enterprises)
In response to the stricter regulations imposed by the Los Angeles Regional Water Quality Control Board to improve the quality of treated wastewater discharges to the Santa Clara River, as well as to meet the demands of a growing population, the City of Fillmore decided to upgrade its existing wastewater treatment plant using an innovative approach. The plant was replaced by a state-of-the-art water recycling facility, which would end the practice of river discharges, and enable development of full-
36
From Toilets to River
Financing Arrangements • The total project cost is around $42.5 million, of which $26 million were allotted for the MBR treatment plant and its accessories, and $4 million for the water reuse system. The remaining balance is expended on offsite engineering, construction, and securing of permits. • Potential savings in the contingency funds are shared among the city, American Water, the contractor, and the design-engineering firm. Project Outcomes • Compliance with state and federal regulatory requirements; • Generation of substantial cost savings; • The PPP approach and DBO model helped the city achieve savings of about $4 million. • Working through a single contract with the city at a guaranteed cost allowed city officials to effectively manage expenditures, and significantly contributed to the project being completed ahead of schedule, and within budget; and • Reduction in the demand for surface and groundwater through the use of reclaimed water for irrigation purposes. Contact for more information Mark Strauss, Senior Vice President of Corporate Strategy and Business Development, American Water Company, website:
Traditional urban wastewater management practice in the People’s Republic of China (PRC) was based on the use of septic tanks. Rapidly increasing urbanization makes such an approach inadequate. Over the past decade, a fundamental shift has been to an integrated approach to urban water management, and use of centralized municipal wastewater treatment.
Wetland park (Source: ADB)
River rehabilitation (Source: ADB)
Investing in Integrated Infrastructure Solution for Qinhuai River Environmental Improvement
Nanjing, Jiangsu Province, People’s Republic of China Nanjing, the capital of Jiangsu Province, is a rapidly developing city with a population of 6.4 million, of which 4.5 million is urban. Nanjing City comprises 11 districts and 2 counties that straddle the Yangtze River. It is located in the lower reaches of the Yangtze River, about 270 km to the northwest of Shanghai.
Although much improvement has been made, the current status of wastewater management still provides numerous opportunities to reduce water pollution, protect water resources, and improve the living conditions and public health of urban and suburban residents. Key problems and opportunities in Nanjing include (i) worsening surface water quality; (ii) inadequate wastewater treatment capacity; (iii) lack of a sludge treatment facility and disposal site; (iv) inadequate stormwater discharge capacity resulting in frequent urban flooding; (v) high river siltation contributing to formation of organic substances that pollute rivers; and (vi) the need for ongoing financial and institutional reforms to make urban services sustainable.
Applying Innovative and Multi-Dimensional Approaches
37
Technology Option The Project has five major components: • Inner Qinhuai River Sewerage and Water Replenishment: involves the construction of river sewer interceptors, river intake pumping stations and pipelines, culverts, and installation of a water diversion system. • City East Wastewater Treatment Plant (WWTP) and Sewerage System: involves the installation of additional sewer pipelines and expansion of the existing wastewater treatment plant, river improvement works and the construction of an ecological wetland park. • North He Xi District Sewerage, River Improvement, and Water Replenishment: involves the installation of sewer pipelines and expansion of sewer pumping station, river improvement works, and construction of controlling water gates. • Stormwater Drainage System: involves the construction of drain outlets and pipelines. • Sludge Treatment and Disposal: involves the construction of: (i) a sludge treatment facility (80 tonnes/day of dry solid); (ii) municipal sludge disposal facility (840 m3/d); and (iii) a leachate collection and treatment system. Additional components involve institutional development as well as the proposed active participation of women in park development. Institutional and Management Arrangements • Nanjing Municipal Government (NMG) is the executing agency for the project. • Nanjing Urban Construction Investment Company (NCIC), which is one of the largest city infrastructure state-owned enterprises in the PRC, is in charge of construction and operation of the City East WWTP and its sewerage components. • Nanjing Drainage Management Department (NDMD) is the implementing agency for the three components: (i) Inner Qinhuai River sewerage and water replenishment; (ii) North He Xi District sewerage, river improvement, and water replenishment; and (iii) sludge treatment and disposal.
• Nanjing Municipal Engineering Construction
Department (NMECD) is a non-revenuegenerating legal entity and a government department within Nanjing Municipal Public Utilities Bureau. It is the implementing agency responsible for the construction of drainage engineering works, and O&M of drainage facilities, and will handle the stormwater component of the project. Financing Arrangements • Total project cost is estimated to be at $236.7 million, broken down as follows: $100 million (ADB loan); $54.9 million (commercial bank loan); and $81.8 million (NMG counterpart). • NMG is keen on pursuing private sector participation for the project by gaining access to capital markets to finance water and wastewater infrastructure through bond issuance. • NCIC proposes to issue 10-year bonds value at CNY2 billion, subject to the same implementing capacity building measures. Project Outcomes • The impact of the project is to improve the urban environment, public health, and quality of life of urban residents and businesses in Nanjing City. The outcome of the project is improved management of surface water resources in Nanjing. • Specifically, by 2010, the project will benefit about 2.7 million urban residents in Nanjing whose living conditions and public health standards will improve as a result of (i) reduced pollution in Nanjing’s surface water following the improvement of wastewater collection and treatment rate, better sludge management, and renewal of degraded urban wetland; (ii) protection from flooding, and elimination of hazards associated with inadequate stormwater drainage; and (iii) reduction of incidence of waterborne infectious diseases to below the 2005/2006 level of 43 cases per 1,000 people. • By 2010, the project will improve the management of surface water resources in Nanjing by (i) achieving the goal of 85%
38
From Toilets to River
wastewater treatment rate in Nanjing; (ii) reducing the annual pollution load in the Qinhuai River by 5,000 tonnes BOD, 9,000 tonnes COD, 6,800 tonnes of TSS, 950 tonnes ammonia nitrogen, and 110 tonnes total phosphorus; (iii) significantly reducing flooding in urban areas; (iv) increasing the efficiency and management capacity of the implementing agencies; and (v) improving cost recovery through a better tariff structure, with gradual increases to achieve cost recovery.
References
Asian Development Bank. 2006. People’s Republic of China: Nanjing Qinhuai River Environmental Improvement Project. Various reports. Francisco Arellano. 2012. Technology Options for Wastewater Treatment. Presentation made during the Pasig River Forum. Asian Development Bank. Manila. 24 April 2012. G. Chung. DBO Project Delivers Savings on MBR Facility. () Kok Tze Weng. 2010. “Water Reuse: Scale, Technology and Prospects.” Presentation made during the Asian Development Bank (ADB) and Partners Conference on Water Crisis and Choices, ADB, Manila, 11–15 October 2010. M. Strauss. Fillmore saves water and cost through innovative design and contract. Desalination & Water Reuse. Vol. 20/4. pp. 33–34. Matthew Giesemann. 2009. Performance Based Contract for an MFRO Plant. Water. Maunsell/AECOM. 2006. Nanjing Qinhuai River Environmental Improvement Final PPTA Report. Public Private Partnerships in India. 2010/2011. Case Studies Alandur Sewerage Project.. ly/IrbRTf (accessed on 27th October 2011). Public Utilities Bureau, Singapore. 2011. “Water for All: Conserve, Value, Enjoy.” Presentation during the 2011 World Water Week in Stockholm (21–27 August 2011). USAID. 2005. Case Studies of Bankable Water and Sewerage Utilities. Volume II: Compendium of Case Studies.
Wastewater as a Strategic Part of Economic Development
Better access to clean water and sanitation services is a progressive strategy for economic growth, and results in immediate and long-term economic, social, and environmental benefits that make a difference to the lives of many people. The project brief articulates the close link between water and the economy. Good management of wastewater and water resources brings more efficiency and higher productivity across economic sectors as well as contributes to the health of the people and the ecosystem. It creates huge opportunity for attracting investments and tourists, generating employment, improving public health, reducing poverty, and managing the environment and water resources more sustainably. The economic returns from tourism, real estate, businesses and reuse applications more than offset the investment cost for the clean-up and wastewater management system. Project Brief Catalyzing Environmental Investments and Economic Development: Xiamen, Fujian Province, People’s Republic of China quality. Additionally, several red tide outbreaks occurred during the 1980s. In 1989, the cleanup of Yuan Dang Lagoon was initiated by the Municipal Government of Xiamen, prompted in part by the adverse reactions of foreign and local investors towards the lake’s unsightly condition, and the threats it posed to the community’s well-being. The initial cleanup program involved the installation of two wastewater treatment plants, dredging of bottom sludge, construction of tidal channels, wastewater interception and collection system, retention walls, lake shoreline protection and greening work, and the development of Egret Island. Technology Option • There were 7 sewage treatment plants, 376 km of piping system, and 31 sewage pumping stations constructed in Xiamen. • Technologies used: (i) traditional activated sludge for sewage, gravitational sedimentation; (ii) anaerobic/oxic (A/O) process for the removal of phosphorous; (iii) anaerobic/anoxic/oxic (A2/O) process; (iv) O’Bell oxidation ditch; (v) improved activated sludge; (vi) deoxidation ditch; (vii) activated sludge with biochemical treatment; and (viii) anaerobic treatment for sludge. Financing Arrangements • Total investment for the construction of the above was greater than CNY1 billion. • Financing sources for the investment in environmental protection and management include: (i) public financial budget; (ii) an environmental protection special fund taken from the pollution discharge fee; (iii) the “three simultaneous investments” of any construction project; and (iv) loans from the World Bank and the Asian Development Bank.
Catalyzing Environmental Investments and Economic Development
Xiamen, Fujian Province, People’s Republic of China Xiamen is a coastal city located in the south of Fujian. The city covers 1,565 km2 of land, and 390 km2 of sea areas. In 1980, Xiamen was designated as a special economic zone, specifically as an international port, and a scenic tourist city. The poor exchange of water in Yuan Dang Lagoon with the outside sea area, combined with untreated sewage and garbage being dumped into the lagoon, resulted in the deterioration in the lake’s water
39
40
From Toilets to River
• Cost recovery:
o Wastewater treatment fees; o Selling organic fertilizer produced from treated sludge (as of 2007, two sludge treatment plants produced 0.25 million tonnes of organic fertilizer—for tea plants, fruit trees, and for export.); and o Selling reclaimed water. For example, as of 2007, the Shiweitou Sewage Treatment Plant supplies 24,000 t/day of midwater for watering plants in more than 500 hectares of green belts in the city, thereby generating an income of CNY2 million annually.
• Environmental benefits: There have been
distinctive overall improvements in the water quality, with significant reductions in BOD, COD and heavy metals, such as mercury, lead, and cadmium. In 2007, the coverage of treatment has reached 80% on Xiamen Island. The discharged treated sewage was in compliance with the first category of Xiamen Standards for Water Pollution Discharge Control. (COD: 20mg/l, and BOD5: 6mg/l after treatment) Economic benefits: (i) increased real estate values; (ii) enhanced tourism; and (iii) attracted businesses. More investments came in as many investors chose Yuan Dang Lagoon as the site of their business for aesthetic reasons. The Yuan Dang Lagoon area has emerged as a center for international and domestic investment, tourism, and residential development in Xiamen. (The average annual growth rate of gross domestic product of Xiamen reached 23.3% from 1981 to 2004.) The cleanup project has helped to evolve the techniques for commercial use of biogas, sludge, and treated wastewater from the wastewater treatment plants. Social benefits: Yuan Dang Lagoon has become a community venue for cultural, recreational, tourism and leisure activities. City dwellers no longer worry about living near the lake’s banks. Instead, they frequent the area for recreational purposes. In addition, the successful cleanup of Yuan Dang Lagoon has stimulated the awareness of the general public and various government departments on the importance of a healthy environment in enhancing urban economic development.
•
•
•
•
Xiang’an Sewage Treatment Plant (Source: Zhou Quilin)
Project Outcomes • With the successful clean up of the Yuan Dang Lagoon, there was an increase in urban sewage treatment investments from CNY68 million in 1996 to CNY179 million in 2005. Also, there was an increase in sewerage investments from CNY146.41 million in 1996 to CNY236 million in 2005.
Reference
Zhou Qiulin. 2007. Case Study on Investment in Environmental Infrastructure in Xiamen, PRC. GEF/UNDP/IMO Partnerships in Environmental Management for the Seas of East Asia (PEMSEA).
Rethinking Financing Options
Financing of innovative wastewater management systems does not seem to be the real constraint. The problem seems to be in terms of capacity to access financing and set in place the appropriate enabling conditions. There are already a number of financing sources and modalities. The project briefs demonstrate that shaping new ways to secure financing for households, markets and the public sector, and drive change is possible and doable. Innovative financing mechanisms also provide incentives for cities to invest in wastewater and septage management systems, and for households to invest in onsite sanitation systems. Cost sharing between national and local governments in the case of Kitakyushu, Japan and Guangzhou, People’s Republic of China (PRC), and between the local government and the water utility in the case of Dumaguete City, Philippines, show how massive investments for wastewater management can be financed through strategic collaboration. The key is to optimize public funds, consider targeted subsidy schemes, and structure affordable user fees for cost recovery. In Japan, the national government subsidies will finance up to 55% of capital cost for wastewater treatment plants, and 50% for sewer lines. For the unsubsidized portion, funding is done through local bonds issued by the local government, beneficiary contribution, and general account of the local government. Sewer user charges are collected from households for O&M. The wastewater management systems in Guangzhou, PRC were financed through bank loans, the Municipal Construction Fund, national and local government appropriated funds, and foreign grants. In Dumaguete City, the city government and the local water district (utility) jointly funded the construction costs of the septage treatment plant and desludging equipment as well as the O&M costs. Full cost recovery is attained through the collection of user fees from households and establishments. A noteworthy innovation is socialized community fundraising, which has been implemented with great success by Gram Vikas, a nongovernment organization that works with the poor to improve sanitation in the rural villages in Orissa, India. Gram Vikas (‘village development’) has helped households in these villages acquire good quality toilets and bathrooms as well as 24-hour water supply, with cofinancing from the village corpus fund. All households in the village contribute a certain amount, in cash or in kind, to the corpus fund, depending on their capacity to pay. Most of these villages are tribal and dalit—the poorest of the poor—which makes their success all the more incredible. Microfinance also provides a solution to the household sanitation cash trap, and allows poor households to gain access to improved sanitation facilities at affordable and flexible payment terms. In Cambodia, microfinancing and national subsidy provided farmers with the means to acquire biogas digesters to treat human and animal wastes, and then process them into safe fertilizer as well as create biogas for use in cooking and lighting. This has resulted in reduced time for fuelwood gathering by women. The project in central Viet Nam shows how a sanitation credit scheme and revolving fund enabled households to construct latrines and septic tanks. Also noteworthy is the strong participation of the Women’s Union of Viet Nam, making the improvements more socially relevant. The socialized corpus fund in Orissa, India, and the microfinancing schemes in central Viet Nam and Cambodia are some of the examples of communitybased financing that allowed poor households to gain access to improved sanitation.
41
42
From Toilets to River
Project Briefs • Optimizing National and Local Government Financial Resources for Wastewater Management and River Clean Up: Kitakyushu City, Fukuoka Prefecture, Japan • Local Government-financed Citywide Septage Management System: Dumaguete City, Negros Oriental, Philippines • Leveraging Capital for Pollution Reduction through Various Financing Mechanisms: Guangzhou, Guandong Province, People’s Republic of China • Bringing Water Supply and Sanitation Services to Tribal Villages: Orissa, India • Household Sanitation Credit Scheme: Viet Nam • Microfinancing for Biogas Digesters: Cambodia
The city of Kitakyushu is an industrial city in Western Japan, with a population of 1 million. The city has a long coastalline of 210 km and abundant nature with 40% of the city area covered by forest. The GDP of this city is approximately ¥3 trillion, and many heavy industry groups, such as iron foundries, are located in the coastal area. In the 1960s, the pollution at Douai Bay, which is located in the middle of an industrial area, became so serious that its marine life became completely extinct. The area was called the “Sea of Death”. The water quality of the Murasaki River— which flows through the center of Kitakyushu—was extremely polluted in 1967 with a BOD value of 58 mg/l (around 1 mg/l currently) due to the city’s rapid industrialization and urbanization, and the lack of wastewater treatment facilities. As a result, residents disliked approaching the riverside. Technology Option • Around 99.8% of the population is connected to the public sewerage system. • The onsite treatment systems (Johkasou) cover approximately 600 households from small communities in rural areas (where sewerage construction is difficult). • For a rapid and relatively cheap manifestation of sewerage benefits, i.e., water quality improvement and flood damage reduction, the combined sewer system was introduced in the 1960s in almost all of the central city area. • At the final stage of sewerage implementation, the combined sewer system, which covers an area of 3,422 ha, represents 20% of the whole wastewater-treated area, while the separate sewer system has been installed in the remaining 80%. • Since 2003, the city of Kitakyushu is fully tackling the improvement of the combined sewer system, while continuing the changeover to the separate sewer system, and the construction of stormwater reservoirs for pollution control during heavy precipitation events. • Small-scale sewerage systems have been planned in suburban areas with low population density. The wastewater unit load and the minimum diameter of sewer pipes were determined based on data from water supply conditions to reduce construction costs.
Optimizing National and Local Government Financial Resources for Wastewater Management and River Clean Up
Kitakyushu City, Fukuoka Prefecture, Japan
Before (1960s) (Source: City of Kitakyushu)
Present (Source: City of Kitakyushu)
Rethonking Financing Options
43
• The city has five wastewater treatment plants.
These plants use the conventional activated sludge process, and have a total capacity of 621,000 m3/d.
• Various citizen organizations conducted
environmental research, river cleanup campaigns, and collections of the cans and bottles thrown along roadsides. In 1968, the city of Kitakyushu created the ‘Countermeasures Association of Murasaki River’ as a special organization to tackle water pollution issues. This was followed by a resettlement plan for the barracks of low-income earners located along Murasaki River, and included consultations with the occupiers for relocation in building plots and apartments provided by the city. The private sector took part from the beginning in the creation of ‘The Restoration Project of Murasaki River’, which started in 1987.
•
•
Source: Japan Sanitation Consortium. 2013. Wastewater Treatment and River Clean Up: Case of Kitakyushu
Institutional and Management Arrangements • Kitakyushu’s Water and Sewer Bureau manages sewage works. Although the Water Bureau and Sewer Bureau merged in April 2012, their general accounts remained separated. • The financial regulations of the Local Public Enterprise Act have been applied since 1985, and a corporate accounting method has been adopted. • The operations at the central control center of the wastewater treatment plants have been outsourced to the private sector since the 1970s.
Financing Arrangements • In Japan, the implementation of sewage works is placed under the responsibility of • local governments. • Experts and knowledgeable persons from central and local governments were gathered in the so-called Sewerage Finance Research Committee. The goal of this committee is to determine the fundamental principle for the financing of sewage works according to socioeconomic conditions (decision of subsidy rules with transparency). • The central government provides subsidies at fixed rates, which depend on the type of facilities. • The funding of unsubsidized facilities is done through local bonds, and the general account of the local government. Residents also partly pay for the capital cost through beneficiary contribution. • The current subsidy rate is 55% for eligible wastewater treatment plants, and 50% for sewer lines. • The total capital investment cost for sewerage facilities in Kitakyushu exceeded ¥600 billion over the past 40 years. According to the fundamental principle of sewerage finance established by the Sewerage Finance Research Committee, this cost was shared between municipality bonds (65% of total cost), subsidies from the central government (26%), beneficiary contribution (3%), and the general account of the city (6%).
44
From Toilets to River
• At the time of bond repayment by local
governments, the law authorizes about 50% redemption with the tax revenue allocated to local governments for this purpose. Generally, sewer user charges are calculated by the addition of basic charge, and the charge depending on the supplied water amount. In the case of Kitakyushu, for a family that uses 20 m3/ month (40 m3/2 months), the sewer user charge is ¥4,292 (for 2 months), which is equivalent to ¥107/m3 ($1.34/m3). This is cheaper than in many cities of Europe. (Conversion factor: ¥80/$1)
•
(iv) The establishment of a monitoring system to assess water quality in the major discharge points receiving industrial wastewater from factories. (v) The strong will of the city authorities represented by the mayor, and supported by the residents, was a powerful driving force for sewerage projects.
Project Outcomes • As with many cities of Japan in the 1960s, the bay and rivers of Kitakyushu were extremely polluted; a situation comparable to the conditions currently found in cities of developing countries. Pollution has been overcome because of the investment made by private factories in wastewater treatment facilities for industrial effluent, as well as the significant public investment made for the development of sewerage systems. • The understanding, efforts and collaboration of Kitakyushu City, the residents, and the private sector enabled sewerage progress. • Kitakyushu was the first city in Japan that improved its water environment. • The improvement of water environment in cities of the country not only supported Japan’s economic development, but also allowed all sorts of environmental engineering development by both the public and private sectors. The developed technologies supplied outside Japan enabled environmental improvement in other countries as well. This well paid back the large investment required for sewerage. • Positive outcomes of sewerage works in Kitakyushu: (i) The development of a legal and financial support system from the central government was a powerful incentive for sewerage implementation. (ii) The determination of a business scheme well suited to the characteristics of the city enabled effective project cost reductions. (iii) The adoption of the combined sewer system in areas with urgent needs.
Local Government-financed Citywide Septage Management System
Dumaguete City, Negros Oriental, Philippines
Vacuum trucks for septage collection (Source: Josie Antonio)
Treatment Ponds (Source: Josie Antonio)
Dumaguete City is the administrative capital of the province of Negros Oriental, and a regional center of commerce and trade in Western Visayas in the Philippines. It is known as a university town for its institutions of higher learning. Studies showed poor water quality of its coastal areas, and the high risk of contaminating the city’s groundwater. In 2006, in an effort to protect groundwater, this being the only source of water supply, the city government of Dumaguete, with the technical assistance from the USAID, adopted a septage management program
Rethonking Financing Options
45
in a joint venture with the Dumaguete City Water District, the local water utility company. The septage management program mandates appropriate design, construction and maintenance of septic tanks, regular desludging, treatment of septage, and “user fees” to recover capital and operating costs of the system. The city also constructed a decentralized wastewater treatment system for the city’s public market in 2007 to further minimize degradation of the city’s coastal waters. Local and city ordinances have been passed to support the septage and wastewater management program. Technology Option Public Market Wastewater Treatment Plant: • Anaerobic Baffle Reactor System, a nonmechanized treatment process with a treatment capacity of 80 m3/d. • The system is composed of a settling tank, anaerobic baffle reactor, anaerobic filter, planted gravel filter, and chlorinator. Septage Treatment Plant: • The treatment system uses stabilization ponds composed of anaerobic, facultative and maturation ponds. A planted gravel filter and wetland are used for polishing operations. Institutional and Management Arrangements • The city government of Dumaguete is the project owner, with the City Planning and Development Office as supervising agency. • The Dumaguete City Water District desludges septic tanks of residences, business establishments and institutions and transports the septage to the septage treatment plant. • The City Government operates the septage treatment plant. • The Dumaguete City Water District collects the septage “user fee” as an add-on to the monthly water bills. • The City Environment and Natural Resources Office regularly monitors the septage treatment plant efficiency. Financing Arrangements • The city government and the local water district jointly and equally funded the initial construction costs of the septage treatment plant and desludging equipment.
• The city government and the water district • Capital and operating costs are recovered
through the septage “user fee” of P2.00 ($0.05) per m3 of water consumed. Project Outcomes • Ended the indiscriminate disposal of septage by private desludgers. • Community awareness of the local government’s environmental protection initiatives. • City’s desludging fees through “user fee” are lower than those of commercial desludgers. • Full capital cost recovery in 6 years. • Farmers use dried sludge as soil conditioners. • Generated savings of about P4.1 million in 2012. • Number of septic tanks desludged is around 9,000, with an estimated septage volume of about 44,000 m3. Contact for more information Engr. Josie Antonio, Dumaguete City Development and Planning Office, Dumaguete City Water District cpdodgte@gmail.com equally share operating costs.
Pollution Reduction and Wastewater Management
Guangzhou Province, People’s Republic of China Guangzhou is the capital of Guangdong Province, along the Pearl River delta. The river has made the city the political, economic, cultural, scientific, and technological center of the province. With the increase in economic development and population, domestic sewage also increased, affecting the river water quality negatively. The construction of the Municipal Sewage Treatment Plant in 1997 spurred an increase in environmental infrastructure investments with the introduction of foreign and local capital via BOT arrangements and bank loans. Technology Option • Sewerage systems, pumping stations, and wastewater and sludge treatment facilities: (i) Xilang: 5 stations, 69 km of pipelines, activated sludge process of
46
From Toilets to River
dephosphorization and denitrogenation, and a sludge treatment process; (ii) Liede: 4 stations, 144 km of pipelines, and activated sludge process; the third phase adopted the improved anaerobic/anoxic/ oxic (A2/O) activated sludge process (iii) Datansha: 5 stations, 10.3 km of pipelines, and both an A2/O activated sludge and inverted A2/O activated sludge process for removal of phosphorus and nitrogen; (iv) Lijiao: 7 stations, 115 km of pipelines, and an anaerobic/oxic (A/O) activated sludge process; (v) Dashadi: 2 stations, 120 km of pipelines, and an A2/O activated sludge process; (vi) Zhuliao: 2 stations, 51.6 km of pipelines and an A2/O activated sludge process; (vii) Jiufo: 61 km of pipelines and an oxidation ditch process; and (viii) Longgui: 2 stations, 123 km of pipelines and an A2/O activated sludge process. • The Jinsheng Sludge Treatment Plant in the Panyu District, considered the largest sludge treatment plant in the world, includes the use of an additive that deactivates heavy metals, anaerobic sludge treatment, vacuum dehydration, compaction, and sintering. Institutional and Management Arrangements
• The central government provides the laws • •
and policies on pollution prevention and project financing. The Guangzhou City Wastewater Treatment Limited Company was set up in 2004. The local government chooses the company to operate in a BOT arrangement.
Financing Arrangements • BOT contracts were arranged for Xilang and the Jinsheng treatment systems. • In Xilang, treatment charges were collected from the residents and corporations that are connected to the system. The amount was enough for credit repayment, maintain sewage treatment plant operation, and gain meager profits. • For Jinsheng, the government paid for the sludge treatment cost during the operation period. • Most of the sewage treatment systems were partially financed through bank loans, the Municipal Construction Fund, national and local appropriated funds, grants-in-aid, and foreign donations. • The Guangzhou water company, representing the government, would collect sewage treatment fees from the residents and corporations that are connected to the treatment facilities. Shortfall in collected fees for the repayment of the loans would be partly provided by the government through sewage treatment subsidies. Project Outcomes • In Xilang, the foreign company involved considered other project investments because of the reasonable return on investment. • There is an improvement in water quality and environmental conditions. In Liede, the treated sewage met the state’s second class emissions standards. In both Datansha and Lijiao, treated sewage met the state’s first class emissions standards. • In the Jinsheng Sludge Treatment Plant, its compaction and sintering processes resulted in the production of red bricks, which were of world class quality.
Liede sewage treatment plant (Source: Lin Duan)
Xilang sewage treatment plant (Source: Lin Duan)
Rethonking Financing Options
47
Bringing Water Supply and Sanitation Services to the Tribal Villages
Orissa, India
A Gram Vikas village: houses with water supply, bathrooms and toilets (Source: Joe Mandiath
Many remote tribal villages in Orissa lack basic sanitation facilities. The only available water source is tainted with human waste, and disease is prevalent among its members. Access to clean water is restricted to powerful members of the community. Gram Vikas implemented the MANTRA (Movement and Network for the Transformation of Rural Areas) program, an integrated habitat development program. The program’s key areas are water and sanitation for the poorest and most marginalized communities. Technology Option • All households are provided with bathing facilities, a toilet, and clean running water supply. An overhead water tank using the gravity flow design is used with zero energy inputs. Institutional Arrangements • Gram Vikas provides skills building, training, and education. • The Village General Body is the platform for community discussions. • The Village Executive Committee is elected from the body. When registered and legally recognized, it is known as a Village Society. • The Village Society undertakes financial transactions, leverage development resources, and enters into formal agreements.
Financing Arrangements • Communities are required to cover part of the cost of the bathroom, toilet and water supply, and contribute towards building the structures. Also, the communities collaboratively establish their water supply systems. The cost of O&M of the system are borne by the community. To put this into effect, a village corpus fund is created with contributions from all families. Poorer families that cannot afford to pay the whole amount contribute in other ways, such as collecting raw materials. More affluent families pay more to help maintain the average. • The corpus fund is then invested in a local bank, and the interest generated covers the cost of extending water and sanitation facilities to new households. Also, the interest covers increasing the capacity of the water tank, or other major infrastructural capital expenses that may come up. • External sources include government programs and international and domestic donors. If there is a gap between funds generated, the gap is met using Gram Vikas’ resources. Project Outcomes • There are 404 registered Village Societies created. • Around 700 villages raised a combined corpus fund of over Rs50.7 million. • Approximately 44,697 families have access to toilets; 21,947 families have access to 24 hours protected water supply. • An 80% reduction in incidences of water-borne diseases and morbidity rates has been observed.
Household Sanitation Credit Scheme
Viet Nam The Central Region Urban Environmental Improvement Project in Viet Nam (CRUEIP)—loan approved in December 2003; project completed in April 2011—aimed to improve living conditions in a series of six mid-size coastal towns in the
48
From Toilets to River
central provinces of Viet Nam. To achieve these objectives, the project supported the construction of stormwater drainage and flood control works, as well as infrastructure facilities for the management of solid waste and wastewater. In addition, the project aimed to strengthen awareness on the benefits of environmental sanitation amongst urban communities, and also with local government agencies. Linked with this were provisions that encouraged poor families to invest in improved personal sanitation facilities, most notably through a household sanitation credit scheme.
Financing Arrangements • The project provided the start-up capital for this revolving fund; but the members of the CMC determined the conditions for loan and repayment as well as defined the criteria for eligibility. • The CMCs administered the credit scheme as a revolving fund, and provided health awareness and technical information to borrowers. • The community awareness and pro-poor sanitation component only represented about 1% in pure financial terms of the CRUEIP project effort. • Credit terms: Loan amount is D4 million or around $250 (80% of the estimated costs of the proposed septic tank/superstructure/connection to the sewerage system for the household). The remaining 20% is in-kind contribution by the household (i.e., labor). The interest rate is 0.5% per month. Payment is within 24 months on a monthly basis. Project Outcomes • By the end of the project in 2011, approximately 2,230 houses in the CRUEIP towns had constructed new latrines and septic tanks as compared with a target number of 1,220. Three-quarters of credit recipients were women. The revolving fund operation is now expected to continue the program after completion of CRUEIP. • The concept of creating or stimulating the demand for investing in sanitary facilities at the household level, boosted by a tailor-made community-managed credit scheme, can be replicated at a larger scale in many other urban settings throughout Viet Nam. Contact for more information Hubert Jenny, Hoang Nhat Do, and Jan Jelle van Gijn (Viet Nam Resident Mission, Asian Development Bank).
Construction of toilet and septic tank (Source: Do Nhat Hoang)
Technology Option • Household latrines, toilets and septic tanks. Institutional Arrangements • The entire community awareness programme and the credit scheme was managed by the Community Management Committees (CMC), one for each project town, with the membership largely drawn from the local chapter of the Viet Nam Women’s Union. • Consistency with project approach and guidelines was ensured through representation within each CMC of an official from the provincial Project Management Unit. • The CMCs informed households about the opportunity to take on short-term loans for the construction of a toilet, a septic tank or latrine, through a Household Sanitation Credit Scheme (HSCS). Poor and near-poor households (based on the assessment of the Women’s Union) will have access to the credit scheme.
Rethonking Financing Options
49
Microfinancing for Biogas Digesters
Cambodia
A nearly completed biodigester, showing the mixing tank (rear), biodigester (middle), and outlet (front). (Source: National Biodigester Program, 2011)
Technology Option • Serving as the primary settling tank, the biogas reactor is an anaerobic, sealed chamber, which facilitates the relatively fast passage of liquid effluent through the chamber, and digestion of much of the settled sludge by anaerobic bacteria. • The biogas reactors built for this project, also known as the “Farmer’s Friend Biodigester”, are of the ‘fixed dome’ type. Each reactor has (i) an inlet mixing chamber, where animal manure can be mixed with water to allow its flow into the unit; (ii) a main chamber, where the anaerobic fermentation and biogas production takes place; and (iii) a raised outlet area (and maintenance manhole), where liquid effluent and sludge is gradually discharged through pressure exerted on the liquid by the accumulating biogas. • The generated gas, which is dependent on the size of the biogas reactor, can be used for small scale applications (e.g., operating a gas stove or light), or for large scale applications (e.g., powering the scalding vats of a slaughterhouse). Institutional Arrangements • The main executing agencies are: (i) Ministry of Agriculture, Forestry and Fishery (MAFF), as the program owner and host; (ii) SNVNetherlands Development Organization, as the main technical assistance and planning agency; and (iii) Department of Animal Production and Health (DAPH) of Cambodia, as the coordinating agency for the project. • The Ministry of Foreign Affairs of Netherlands is the main funding agency, through their Asia Biogas Program. The German International Cooperation (GIZ) provided additional funding for program establishment and maintenance, IEC campaign activities, and a flat rate subsidy on the cost of the biodigesters for the farmers. • The Netherlands Development Finance Company (FMO) provides loans to two local cooperating microfinance institutions— PRASAC and AMRET. In turn, both institutions provide loans to farmers for the purchase of their biodigester facilities. • Cooperating agencies include: o Humanist Institute for Development Cooperation (HIVOS), which is purchasing the carbon offsets generated by the project;
Standard model of the Farmer’s Friend Biodigester (Source: National Biodigester Program)
Majority of Cambodians who live in the rural areas are into agriculture. They have no access to electricity, use collected firewood for cooking, and rely on either expensive commercial fertilizers or risky raw animal manure to fertilize their fields. Faced with these challenges, the biogas digester presents a cost effective solution to address their concerns. The biogas digester is a simple, yet powerful sanitation technology option that is capable of: (i) processing human and animal feces into safe and free fertilizer; (ii) reducing cases of groundwater contamination by processing feces instead of having it discharged untreated; (iii) creating biogas for use in cooking and household lighting; (iv) empowering women and families by reducing their time spent on gathering fuelwood and cooking; (v) reducing indoor air pollution brought about by burning fuelwood; and (vi) eliminating carbon dioxide (CO2) emissions during fermentation of openly-discharged sewage, thereby helping to reduce the threat of climate change and potentially create carbon offset credits for sale to industrialized countries.
50
From Toilets to River
o PRASAC Microfinance Institution and AMRET Microfinance Institution; o ACELDA Bank, which channels funds from the program to individual farmers for a postconstruction, flat rate subsidy of $150 off the cost of all biodigesters purchased through the program; o Cambodian Center for Study and Development in Agriculture (CEDAC), acting as the Provincial Biodigester Program Office (PBPO) in Kampot, Prey Veng, Kandal, and Kampong Thom provinces; o Preah Kossomak Polytechnic Institute, which provides training for technicians and masons on biodigester construction; o Development Technology Workshop Cambodia, which develops appropriate biodigester accessories for the program (e.g. stoves, drains, lights); o Cambodia-India Entrepreneurship Development Center (CIEDC), which assists in the capacity development for entrepreneurs who wish to start a new biodigester company as part of the program; o Groupe Energies Renouvelables Environnement et Solidarite (GERES), consultant for rural energy-related studies; o Cambodia Institute of Development Study (CIDS), consultant for socioeconomic studies;
o iLi Consulting Engineers Mekong, consultant for technical engineering issues; o Local governments of the provinces of Siem Reap, Battambang, Pursat, Kampong Thom, Kampong Cham, Kampong Chhnang, Kampong Speu, Svay Rieng, Prey Veng, Kandal, Takeo, Kampot, Kep, and Sihanoukville. All these provinces helped to establish their PBPO, except for Kampot, Prey Veng, Kandal, and Kampong Thom provinces. Their local governments liaised directly with the biodigester sales companies, the microfinance institutions, and with interested farmers. Financing Arrangements • To cover the cost of biodigesters in the National Biodigesters Program (NBP), a flat-rate subsidy of $150 is provided using GIZ funding (Table1). The balance is paid for by farmers through loans from the microfinancing institutions (PRASAC and AMRET). The farmers can borrow up to a maximum of $1,000, with an interest rate of only 1.2% per month, for a duration of 4–24 months. Table 1 shows the total cost, subsidy, and cost for the farmer-borrower (loanable amount). • Table 2 shows the payback period of a 4 m3-biodigester at a cost of $400, per prior fuel source.
Table 1. Cost and Subsidy
Biodigester size (m3) 4 6 8 10 15 Total cost 400 500 550 650 900 subsidy from NBP 150 150 150 150 150 Farmer cost 250 350 400 500 750
Source: National Biodigester Programme. 2011.
Table 2. Cost Savings and Payable Period
Type of Fuel Sources Firewood Charcoal Kerosene LPG Quantity Saved 6 kg 2kg 0.7 liter 0.5 kg Cost per unit $ 0.07 $ 0.20 $ 0.65 $ 1.00 Total cost save per day $ 0.42 $ 0.42 $ 0.46 $ 0.50 Total cost save per year $ 153 $ 153 $ 166 $ 183 Payback period without subsidy 2.6 years 2.6 years 2.4 years 2.2 years Payback period with subsidy ($150) 1.6 years 1.6 years 1.5 years 1.3 years
Source: National Biodigester Programme. 2011.
Rethonking Financing Options
51
Project outcomes • Improved overall sanitation in Cambodia; • Improved lives of the farming families by utilizing an existing resource (manure of their animals) that provides them with free biogas for cooking and lighting; • Improved agricultural productivity of the farmers through their ‘closing the loop’ use of the output bio-slurry; • Improved governing and marketing institutions by using the multipartnership program to bring together and utilize the talents of the different government agencies, private sector groups, and nongovernment organizations operating in the country; and • Sale of about 12,000 biodigester units that have benefitted an estimated 60,000 Cambodians. Contact for more information National Biodigester Programme Saoleng Lam, Programme Coordinator Department of Animal Health and Production, Ministry of Agriculture, Forestry and Fisheries Tel: +855 17961056 Email: saoleng@nbp.org.kh Program Website: Program Email: admin@nbp.org.kh
———. Case Study: Biogas Digesters for Cambodians - A Multi-partner National Biodigester Program in Cambodia. Lin Duan. 2007. Case Study on Investments in Environmental Infrastructure in Guanzhou, PRC. GEF/UNDP/IMO Partnerships in Environmental Managment for the Seas of East Asia (PEMSEA). National Biodigester Programme. 2011. Information Folder. () Yasuyuki Fukunaga. 2012. “ City of Kitakyushu’s Experience on Wastewater Management.” Presentation made during the ADB workshop: Is ADB Ready for Technological Advancements in WastewaterManagement? (3–4 October 2012, ADB HQ, Manila).
Reference
Asian Development Bank. 2006. Serving the Rural Poor: A Review of Civil Society-Ied Initiatives in Rural Water and Sanitation. Discussion Paper. Gram Vikas Annual Report. 2008–2009. International Water Association. 2011. Project: Dumaguete City Septage Management System, Philippines. () Joe Madiath. 2011. “Village Corpus and Capacity Development.” Presentation made during the 2nd ADB-DMC and Partners Sanitation Dialogue, ADB, Manila, 23–25 May 2011. Korea International Cooperation Agency (KOICA), United Nations Environment Program (UNEP) and Center for Advanced Philippine Studies (CAPS) case studies. (. ly/188MUaI)
Public-Private Partnerships: Driving Innovations
In general, the public sector provides the water, sanitation and waste management services. However, experience demonstrates that government alone cannot meet the growing demand for such services. In many countries, central and local governments are hard pressed to develop and finance the construction and operation of these much-needed facilities and services as a consequence of lack of capacity and knowledge as well as other socioeconomic issues that compete for limited financial resources. Whereas traditional development assistance plays a vital role in enabling some governments to meet the challenge, it provides only a fraction of the needed investment. This indicates that an alternative approach is required to develop, finance and implement such traditionally public domain projects—one that involves collaboration with the private sector. A PPP arrangement allows the public sector to consider otherwise unaffordable projects. PPP can provide the delivery mechanism to fill the infrastructure gap between what the government and communities can afford, what the citizens expect, and what environmental management and sustainable growth require. Through PPP, the public sector can leverage the private sectors’ technical and managerial expertise and financial support. However, the enabling conditions—clear policy and regulatory framework, contract management, cost recovery mechanism, consistent enforcement of laws—have to be in place to attract private sector participation and ensure sustainable partnership. The three cases in Kuwait, South Africa and the Philippines highlight the adoption of PPP as a delivery mechanism for putting in place innovative design and technologies for more effective wastewater treatment and reuse application. The wastewater recycling project in Durban, South Africa, which is operating on a BOT basis, found profitable use for its treated effluent. It supplies water to industries as well as potable water to the city. Likewise, the wastewater management project in Sulaibiya, Kuwait uses the BOT modality, and provides an alternative to the more expensive desalination plants in addressing the country’s problem with scarcity of water resources. In the Philippines, the water concessionaire for the East Zone of Metro Manila as well as Rizal Province applies innovative design of the facilities to meet land constraints, and gain acceptability in the communities. Project Briefs • Addressing Water Scarcity through PPP and Innovative Wastewater Management: Sulaibiya, Kuwait • Pioneering Wastewater Treatment and Reuse: Durban, eThekweni Municipality, South Africa • Adopting Innovative Design for Wastewater Management Systems: East Zone, Metro Manila, and Rizal Province, Philippines
Addressing Water Scarcity Through PPP and Innovative Wastewater Management
Sulaibiya, Kuwait The Sulaibiya Wastewater Treatment and Reclamation Plant is a groundbreaking project, not only in the Middle East where it is the first infrastructure facility of its size to be executed as BOT, but also the largest of its kind using the RO/ UF technique in domestic wastewater treatment and reclamation. The BOT arrangement is part of the Kuwaiti Government’s plan to encourage effective participation by the private sector in the development of the national economy through the execution of infrastructure projects.
52
Public-Private Partnerships Driving Innovations
53
•
•
The secondary treated wastewater is pumped from the collection basin to the ultrafiltration unit, which has five trains containing 8700 filter units for complete removal of suspended solids. Then the filtrate flows into a 6000-m3 basin before being pumped to the RO facility.
The plant has a total ultrafiltration (UF) membrane area of 304,640m2 arranged in 68 skids. (Source: IWA)
Technology Option Pretreatment system • The Ardiya plant acts as a pretreatment phase, with four parallel lines of 6 mm step screen with aerated grit chamber to remove particles, sand, and grit to a particle size of 0.2 mm. • There are two circular buffer tanks (20,000 m3) to balance the wastewater influent variation agitators. • All the structures are covered with a scrubber system to prevent odour nuisance. • The pumping station consists of eight pumps, two of which are standby units to transfer wastewater through three pressure pipelines from Ardiya to the Sulaibiya treatment plant. Treatment system • The Sulaibiya Treatment Plant is comprised of three elements: biological nutrient removal, RO/UF membranes, and sludge treatment. The capacity is 375,000 m3/d, with the option to be extended to 600,000 m3/d. The treatment process starts with nine aeration tanks. Air is supplied through the blower building which contains five blower units. • The secondary clarifiers (consisting of nine circular secondary clarifiers) and the effluent are discharged to a collection basin where the reclamation processes are started. • The suspended solids are pumped into the gravity belt thickening building, and then the wastewater is discharged to eight aerobic digesters. • The sludge produced is transported to the sludge drying beds, and stored in a special area for 6 months to make use of it as fertilizer.
Institutional and Management Arrangements • The contract was administered by the Kuwait Ministry of Public Works (MPW) and awarded to Utilities Development Company (UDC) – jointly owned by the Kharafi Group (75%) and Ionics Italba – an Italian company (25%). • The German company Philipp Holzmann and the Italian company Italba, a subsidiary of Ionics Inc. (USA), were involved in the design and construction of the project. • Kharafi National KSC (closed), formerly called the National Company for Mechanical and Electrical Works, was responsible for the O&M of the treatment facility with the participation of United Utilities Company of the United Kingdom. Financing Arrangements Capital investment • The National Bank of Kuwait (NBK), Gulf Bank, and The Bank of Kuwait & the Middle East arranged for the capital expenditure, with NBK acting as the facility agent. ABN Amro acted as the financial advisers to UDC, while Prudential Financial Inflation (PKF) acted as financial model auditor for the loan arrangers. The total project cost was KWD130 million ($140 million). Estimated cost of water produced in Kuwait • The Al-Kharafi company sells UF-treated wastewater at $1.73/1,000 IG (=$0.38/m3), and RO treated wastewater at $2.95/1,000 IG (=$0.65/m3) to the MPW. These prices are lower than the cost of freshwater (e.g., from desalination), which is $17.51/1,000 IG ($3.86/m3). Price of water charged to consumers • MPW water charges are $0.35/1,000 IG ($0.07/m3) for UF-treated wastewater, and $0.70/1,000 IG for RO-treated wastewater. The treated wastewater is utilized for agricultural and industrial uses. The price of freshwater is $2.77/1,000 IG (0.61/m3).
54
From Toilets to River
Project Outcomes • Sulaibiya wastewater treatment plant is the first in a series of similar projects in the region through which problems related to the scarcity of water resources are expected to be solved. Similar projects will also be beneficial, as they will reduce the need to build more expensive seawater desalination plants. • The project had reduced environmental pollution, as partially treated wastewater is no longer discharged into the Arabian Gulf. • The State will generate savings of around KWD3.2 billion ($11 billion) over the lifetime of the concession ($265 million annually), even with subsidies to the consumers, due to lower cost of wastewater treatment compared to the cost of desalination. • The project will provide the State of Kuwait with a fully functional wastewater reclamation plant free of charge when the concession period expires (when the project is transferred to the State of Kuwait). • Effluent quality surpasses that of government, WHO and US Environmental Protection Agency (USEPA) standards. Contact for more information International Water Association
Wastewater treatment plant in Durban (Source: IWA)
The project was South Africa’s first private wastewater recycling project, operating on a 20-year BOT basis, and designed to provide effluent of a particular standard for industries. Technology Option • Existing activated sludge process: Upgraded from 50ml/day to 77 ml/day. A conventional design was used to remove 95% of the incoming COD, and 98% of incoming ammonia loads. • Tertiary plant treatment process for removal of iron through lamella settlers. • Dual media filtration to remove the iron precipitate, and ozonation for breaking down the remaining non-biodegradable organic compound. Institutional and Management Arrangements • The project was based on a PPP arrangement, following a formal tender process. Durban Water Recycling (Pty) Ltd. was eventually awarded a 20-year concession contract for the production of high quality reclaimed water. • Technology and processes are managed by Veolia Water Services (VWS), which makes sure that the installations are highly specialised and tailored specifically to meet the water quality requirements of Durban Water Recycling’s primary clients.
Pioneering Wastewater Recycling
Durban, eThekweni Municipality, South Africa Durban is part of the eThekweni Municipality, located on the east coast of South Africa. The combination of limited water resources in the city along with sewage capacity constraints, led to the investigation of different wastewater recycling processes since the region produces approximately 450 million litres of wastewater per day. The overall objective of this project was to treat about 48 million litres of domestic and industrial wastewater (approximately 10% of the city’s wastewater) to a measure near to potable standards, and sell the same to industrial customers for use in their processes.
Public-Private Partnerships Driving Innovations
55
•
Preliminary and primary wastewater treatment processes were performed by eThekwini Water Services (EWS), while the effluent from the primary settlement tank, which is fed into the activated sludge plant, is operated by VWS. At the end of the contracted 20-year period, the facilities will be handed over to the municipality.
Innovative Design of Facilities to Address Land Constraints
East Zone, Metro Manila and Rizal Province, Philippines In 1997, Manila Water Company, Inc. (MWCI or Manila Water), a private company, was awarded the concession contract by the Metropolitan Waterworks and Sewerage System (MWSS) for the east zone area of Metro Manila and nearby Rizal province. Currently, MWCI provides water and wastewater services to over 6 million people from 23 cities and municipalities of eastern Metro Manila and Rizal Province.
Financing Arrangements Capital investment • The Development Bank of Southern Africa (DBSA), Rand Merchant Bank, Societe General and Natixis Bank (two French banks) financed the capital investment, which ensured all initial capital expenditure was covered. • The cost of further upgrading, including new technology investments and its attendant risks, was covered by VWS under their BOT concession. Cost recovery • The cost recovery policy was applied through monthly payments by the users. • Mondi Paper, through its commitment of using recycled water in its entire paper production, gave the project an assurance of having a secured client for its end product. The project also covers various industries, thus, increasing the profitability of the initiative. Project Outcomes • At operational capacity, the reclamation plant meets approximately 7% of the city’s current potable water demand, and at the same time, reduces the city’s treated wastewater output by 10%, thus, minimizing the wastewater load discharged into the marine environment. • A profitable use was found for a product which would in the past be discharged into the environment, contributing to its pollution. This new perspective is advantageous not only to the community, who enjoys a more stable supply of drinking water, but also to the reclaimed water clients, who are able to satisfy their production requirements with the treated wastewater for a lower price. Contact for information International Water Association
Olandes STP (Marikina City): process tanks built underground and support facility on stilts (Source: Steve Griffiths)
Pineda STP (Pasig City): aeration tanks under a basketball court (Source: Steve Griffiths)
Poblacion STP (Makati City): elevated and on top of a Flood Control Pond (Source: MWCI)
56
From Toilets to River
At the start of the concession, there were very little available sewerage services in the area, estimated to be at only 3% coverage. In 2004, only about 10% of the population of the East Zone was connected to a public sewerage system, and less than 1% of the generated sewage received secondary treatment. Because of the rapid growing population of the metropolis, the volume of untreated wastewater increased accordingly. This led to the deterioration of Metro Manila’s major water bodies, which were found to be polluted with organic wastes. Steep targets for both septage and sewerage management are in place. Manila Water’s wastewater management program comprises of: (i) septage management, including desludging of septic tanks; (ii) separate sewer networks; and (iii) combined sewer-drainage systems. Some of the challenges faced in the implementation of a wastewater treatment system included: (i) the high costs of conventional sewerage systems; (ii) existing urban infrastructure with its narrow roads; (iii) the lack of available land; and (iv) increasing population and rapid urbanization. In a densely populated city, where real estate is premium, it is difficult to acquire a land that will be conducive for a wastewater treatment plant. There was also the added difficulty of the “Not In My BackYard (NIMBY)” syndrome. Given all these, Manila Water had to explore innovative ways on how to implement wastewater projects. Manila Water has successfully implemented many projects without having to purchase land. This is done through masterplanning for early land acquisition, effective stakeholder engagement, and innovative use of the land. Essentially, Manila Water incorporates a community feature in its facilities to ensure public acceptability for the project as well as inculcate ‘ownership’. Common features incorporated are basketball courts, parks, and parking lots. At the same time, Manila Water designs its facilities in a way that will blend in with its surroundings. Many of the treatment tanks are covered, and all facilities are landscaped and maintained on a daily basis.
Technology Option • Conveyance of wastewater is usually through combined sewer-drainage network, or in some selected places, through separate sewer lines. • Desludging of septic tanks per household is done every 5–7 years through vacuum tanker trucks of various sizes. The septage collected is brought to MWCI’s septage treatment plants. • Manila Water employs activated sludge treatment, mostly conventional and a few which will employ sequencing batch reactors (upon the completion of the Taguig North, and Marikina North Sewage Treatment Plants). • In 2001, a Batch Treatment Process was constructed to equalize, aerate, and clarify wastewater in a timed sequence in one reactor basin. • Sludge from septage and wastewater treatment is dewatered before final disposal to laharaffected areas in Central Luzon. • Treated wastewater is used for gardening purposes or in water toilets within the facilities. • Mesophilic Anaerobic Digester became operational in 2008. Institutional and Management Arrangements • The Concession Agreement is a 25-year contract, which was recently extended, pushing the effective end date of concession to 2037. • Several regulatory bodies interact and monitor the performance of Manila Water regarding its conduct of business. The MWSS-RO evaluates the proper implementation of the Concession Agreement, monitors water quality and supply in all service areas, and handles the water tariffs being charged by the concessionaires to all their customers. The DENR and the LLDA, on the other hand, provide and enforce wastewater standards for treatment operation and facilities. • Manila Water has also formed strong partnerships with different sectors of the community, including the local government units and communities to fast-track the implementation of the combined sewerdrainage system, and the operation of the sewage treatment plants (STPs).
Public-Private Partnerships Driving Innovations
57
•
In terms of innovation in managing stakeholders, Manila Water is aggressively and continuously pursuing efforts to educate communities regarding wastewater through educational trips (e.g., Lakbayan), and information and education campaigns.
•
•
Financing Arrangements • A Rate Rebasing exercise is performed every 5 years to (i) look at performance of the concessionaire in the previous period; and (ii) review proposed business plans. This exercise also determines whether there is merit in increasing or decreasing the effective tariff imposed on consumers. • As of December 2012, all customer types (residential, commercial, and industrial) in Metro Manila pay a 20% environmental charge from the basic water charge. The sewerage charge is pegged at 30% of the basic water charge for East Zone customers.2 • The combined sewer-drainage system strategy is a component of the Manila Third Sewerage Project (MTSP), which was aided by a $64 million loan from the World Bank. • All of Manila Water’s expenditures are recovered through the imposition of a water tariff, consistent with the allowed rate on return base. Project Outcomes • From the MTSP Loan, three STPs are constructed using the combined sewerdrainage system approach. The approach allowed rapid and efficient provision of coverage while directly addressing issues on land availability and congested roads. In addition, it minimizes pipe laying cost by integrating with existing drainage infrastructure. Manila Water has saved approximately a billion pesos ($25 million) in land acquisition costs through this scheme. Close to 5 ha of land have been acquired through agreements with various government agencies.
•
The concentration of pollutants discharged from the STPs into the major rivers is within the allowable levels specified by national and regional standards. The climate-proofed Olandes STP received global recognition for its state-of-the-art design from the International Water Association’s 2010 Asia Pacific Regional Project Innovation Award with an Honor Award for Small Projects, making it a world class wastewater treatment facility. The Olandes STP grounds also serve as a recreational park for nearby residents. Communities have become more open to the idea of having wastewater and septage treatment facilities nearby, and enjoy using the community features.
Contact for more information Gillian Mari B. Berba, Program Manager for Wastewater-Manila Water Company, Inc., email: gillian.berba@manilawater.com
Reference
Baffrey, R., G. Aranzamendez, K. Salazar and G. Vergara. 2011. The Combined SewerDrainage System: A Decentralized Approach to Protect Manila’s Rivers. eThekwini Online. The Durban Water Recycling Project. (Accessed 27 October 2011). International Water Association,. 2012. Wastewater Recycling Project, South Africa. (. ly/1gD69tg) Mahmoud Khaled Karam. Utilization of Treated Effluent in the State of Kuwait. Powerpoint presentation. () Utilities Development Company. 2013. The Sulaibiya Wastewater Treatment and Reclamation Plant - Powerpoint presentation.
2
Source: MWCI billing statements
Protecting Water Resources and Coasts
An estimated 90% of all wastewater in developing countries is discharged directly into rivers, lakes or the oceans without treatment.* Contaminated water from poor sanitation, and inadequate wastewater management contribute to poverty through costs to health care, lost labor productivity, and impacts on fisheries, tourism, and other socioeconomic activities. Without better infrastructure, services and management, millions of people will continue to get sick or die each year, and there will be further losses in biodiversity and ecosystem resilience, thereby affecting livelihoods and restricting development and efforts towards a more sustainable future. The three case studies show how these challenges can be turned around. Finding appropriate solutions will require innovation to reduce the volume of wastewater produced, treat and even reuse the waste, and do it in an affordable, sustainable way. The wastewater management system being implemented in five cities (Baoding, Chengde, Tangshan, Xuanhua, and Zhangjiakou) in Hebei Province, People’s Republic of China (PRC) contributed to the protection of drinking water sources not only in these cities, but also in downstream Beijing and Tianjin. The project also resulted in lower incidence of waterborne diseases and pollution reduction in Baiyangdian Lake, Bohai Bay, and Hai River Basin. Treated wastewater is used in industries, parks, and thermal plants while the sludge is processed into fertilizer. In Tianjin, the Wastewater Treatment and Water Resources Protection Project strengthened capacity for water supply and wastewater operations through management based on corporate approach and commercial principles, including cost recovery from users, and an improved water and wastewater tariff structure. The wastewater management projects in Hebei and Tianjin are especially noteworthy for improving public health and living conditions as well as controlling pollution in Bohai Sea, an important gateway to the PRC. In Florida, USA, the wastewater management system in Orange County enhances the environmental conditions in the River Econlockhatchee catchment. With 100% of the treated wastewater reused, mostly as cooling water for a power plant, the demand on limited groundwater reserves in the Florida aquifer is reduced. Project Briefs • Pollution Reduction and Wastewater Management: Hebei Province, People’s Republic of China • Wastewater Treatment and Water Resources Protection: Tianjin, People’s Republic of China • Protecting Groundwater and Ensuring Energy Security: Orange County, Orlando, Florida, United States of America
Pollution Reduction through Wastewater Management
Hebei Province, People’s Republic of China Hebei Province covers an area of 188,000 km2. With a population of 70.34 million in 2009, Hebei lies in the heavily polluted Hai River Basin, which drains into the Bohai Sea through nine tributaries. The Hebei Province Wastewater Management Project was implemented in five cities—Baoding, Chengde, Tangshan, Xuanhua, and Zhangjiakou—all priority areas under the Hai River Basin Pollution Prevention and Control Plan.
58
Protecting Water Resources and Coasts
59
Sewerage construction (Source: ADB)
Institutional and Management Arrangements • The Hebei Provincial Government was the executing agency responsible for the overall supervision of the project through its Hebei Project Management Office (HPMO) as implementation and coordinating office. • Local project implementation agencies were the Municipal Sewerage Companies (MSCs) in the project cities. Each MSC sets up a project implementation unit to coordinate with the HPMO, implements project activities on time, and takes responsibility for day-to-day implementation. Financing Arrangements • Total project cost was $173.61 million, of which the central and municipal governments provided around $92 million with ADB loans amounting to $82 million. • By mid 2009, 46 civil works and equipment packages ($74 million) were awarded through international competitive bidding, national competitive bidding, and international shopping. • Revenues were based on the actual and proposed tariffs, and estimates of water volume, minus the service fees paid to the water supply company. • The financial viability of the individual components and the project as a whole was confirmed. The financial internal rates of return (FIRR) for the five components ranged from 3.5% to 11.1%, with three of the components higher than estimated at appraisal. The overall FIRR for the project was 6.4%, higher than the estimate of 5.7% at appraisal, and higher than the weighted average cost of capital of 3%. Project Outcomes • WWTPs were constructed, or expanded, to include pre-treatment and primary treatment facilities as well as secondary and sludge treatment facilities in the five cities. • In all the WWTPs, effluent will be conveyed by an outfall to a river, from which the water will be available for irrigation and other uses downstream. • Various schemes and facilities were put in place to utilize reclaimed water. The water
Wastewater treatment plant in Hebei (Source: ADB)
Project Components • Wastewater management infrastructure and facilities were constructed in: (i) Baoding: 104 km of sewers, two submersible-pump lift stations, and a wastewater treatment plant (WWTP) expansion with a capacity of 240,000 m3/d; (ii) Chengde: 32 km of sewers and a WWTP with a capacity of 80,000 m3/d; (iii) Tangshan: 10 km of sewers and a WWTP with a capacity of 80,000 m3/d; (iv) Xuanhua: 24.5 km of sewers and a WWTP with a capacity of 120,000 m3/d; and (v) Zhangjiakou: 27.8 km of sewers, 1.5 km of open channels, and a WWTP with a capacity of 100,000 m3/d. Technology Option • Treatment processes include secondary biological treatment with nitrification and organic phosphorus reduction. Based on the varying conditions and requirements, the oxidation ditch process was selected for Chengde, Xuanhua and Zhangjiakou; and the A/O process for Baoding and Tangshan.
60
From Toilets to River
•
•
•
recycling facilities mainly supply industries, landscaping, and thermal plants. The total capacity for water recycling is 150,000 m3/d, which is nearly 30% of the entire wastewater treatment under the project. For the Baoding WWTP, a portion of the sludge will be processed into fertilizer pellets. Chengde and Tangshan have also developed and implemented a pilot program for sludge utilization for composting and fertilizer production. The project improved the living environment as well as public health standards in the five cities. The newly installed sewer systems and WWTPs collected and treated about 540,000 m3/d of wastewater. This has contributed to the protection of drinking water sources of project cities and the downstream cities of Beijing and Tianjin. It has also reduced and controlled pollution in Baiyangdian Lake, Bohai Bay, and the Hai River Basin. In addition, the improved environment has provided opportunities for local environmental, economic and social development, and has even promoted sustainable tourism. Incidence of waterborne diseases was significantly reduced with zero cases of schistosomiasis, giardia, and cholera in 2008–2009.
Technology Option • Component A included: (i) construction of the Beicang wastewater treatment plant with a capacity of 100,000 m3/d with secondary treatment and sludge-dewatering facilities, and capacity of treated water for reuse; (ii) laying 14.80 km of sewer pipes; and (iii) constructing a pump station with a 86,400 m3/d capacity. The biological treatment process selected was the A/O process with high phosphorus removal efficiency. • Component B included: (i) improving open channel works from the Jiuwangzhuang Gate to the Dazhangzhuang Pump Station, including structure maintenance and landscape works; (ii) constructing a closed culvert, with a total length of 34.14 km, encompassing a regulating gate, closed box culvert, outlet sluice gate, regulating tank, and maintenance gate to avoid pollution from the Zhou River; (iii) Yuqiao Reservoir works involving soil and water conservation, village waste treatment, hospital solid and wastewater treatment works; and (iv) establishing a management information system, mostly for hydrological quality monitoring, and pump station gate remote control.
Wastewater Treatment and Water Resources Protection
Tianjin, People’s Republic of China The Tianjin Wastewater Treatment and Water Resources Protection Project was approved by ADB in December 2000. It aimed to improve: (i) the urban environment by reducing environmental contamination through improved wastewater management; and (ii) the quality of raw water supply in Tianjin. Secondary objectives included: (i) strengthening the capacity of the raw water supply and wastewater operations to be more efficient and managed on commercial principles: (ii) introducing comprehensive watershed management approaches: and (iii) improving cost recovery from users through an improved tariff structure.
Aeration Ponds (Source: ADB)
Sludge-Dewatering Centrifuges (Source: ADB)
Protecting Water Resources and Coasts
61
Institutional and Management Arrangements • The Tianjin municipal government was the executing agency (EA). • The project had two components: (i) component A, focusing on wastewater treatment, under the implementation of the Tianjin Sewerage Company (TSC), and subsequently transferred to the Tianjin Capital Environmental Protection Company (TCEPC), a semi-private company; and (ii) component B, focusing on water resources protection, under the implementation of Tianjin Municipal Luanhe Drinking Water Source Protection Engineering (TML). Financing Arrangements • Capital financing: The total project cost after completion was $337.3 million, with local financing of $208.9 million, through the government’s equity, and a loan from the China Development Bank. • Cost recovery: o Component A: Introduced wastewater tariffs on 1 December 2003 of CNY0.60 per m3 for domestic consumers, and CNY1.00 per m3 for nondomestic consumers. Gradually but affordably increased wastewater tariffs to CNY0.80 per m3 for domestic consumers, and CNY1.20 per m3 for nondomestic consumers. o Component B: Introduced different tariffs for different water consumers on 1 September 2002. Gradually but affordably increased water tariff from CNY1.40 per m3 in 1999 to currently CNY3.90 per m3 for domestic consumers. Implemented a significant increase in water tariff from CNY1.40 per m3 in 1999 to currently CNY21.90 per m3 for special consumers. Project Outcomes • Cases of cholera decreased by 40%, and hepatitis by 64% (2001–2007). • Percentage of urban wastewater collected: 50%–60% by end of 2008; 100% by 2010. • Raw water remained in good quality, and in accordance with national standards (Class III). • Public satisfaction with urban environment increased.
Protecting Groundwater and Ensuring Energy Security
Orange County, Orlando, Florida, United States of America The Orange County Eastern Water Reclamation Facility is located in one of the most rapidly growing areas in the United States. In 1984, this advanced water reclamation system was designed and constructed to enhance the environmental setting of the River Econlockhatchee catchment in east Central Florida, to reduce demand on potable groundwater, provide reclaimed water for non-potable uses, and provide sufficient wastewater treatment capacity for the city.
Orange County wastewater treatment plant (Source: IWA)
Technology Option • The full scale treatment plant capacity is 72 MLD. • Pretreatment unit with screening unit and a ‘pista’ grit removal system. • A five-stage ‘Bardenpho’ nutrient removal system comprised of in-line fermentation tank, 1st anoxic tank, an aeration basin, 2nd anoxic tank, re-aeration, and secondary clarification. • Final stage polishing with an automatic backwash (ABW) filter, and chlorination to disinfect the treated wastewater. • Dechlorination occurs in the dechlorination zone of the wetlands, prior to reclaimed water entering wetlands vegetation zone.
62
From Toilets to River
•
Air from the headworks is treated for odor control in three biofilters.
References
A Rapid Response Assessment. United Nations Environment Programme, UN-HABITAT, GRID-Arendal. Asian Development Bank. 2002. Hebei Province Wastewater Management Project. Summary Environmental Impact Assessment. ———. 2010. Hebei Province Wastewater Management Project. Project Completion Report. Corcoran, E., C. Nellemann, E. Baker, R. Bos, D. Osborn, H. Savelli (eds). 2010. Sick Water? The central role of wastewater management in sustainable development.
Institutional and Management Arrangements • The Board of Orange County (consisting of the Executive Officer, the Mayor, and 6 elected district commissioners) is responsible for reviewing all Orange County utility department activities, and setting policies for their growth. • The Water Reclamation Utility (under the Orange County Utilities Department) oversees the O&M of the treatment plant. Financing Arrangements Cost recovery • The capital investment was financed by the Orange County Utilities Department, with the support of the Board of Orange County. • The wastewater customers pay a monthly fee to cover O&M costs and also capital expenditures for treatment plant expansion. Project Outcomes • The water reclamation facility uses reclaimed water in a combination of natural and constructed wetlands, which was among the first treatment facility to be permitted by the Florida Department of Environmental Protection (FDEP) to be exempted from existing wetlands rules and regulations. • The treated effluent (water reclaimed) is currently 100% reused, thus reducing the demand on limited groundwater reserves in the Florida aquifer. • The treatment facility produced reclaimed water, 90% of which is used as cooling water for the Orlando Utilities Commission’s Stanton Energy Center, a 900-megawatt power plant located adjacent to the facility. • In recent times, user revenues have declined due to the economic (market) downturn. As such, the Orange County Utilities Department is faced with changing regulations and uncertain funding, which has made it more complicated to operate and maintain the facility. It is therefore considered to be essential for the Orange County Utilities to have better bond issuance to supplement the current budget plan. Contact for more information Water Reclamation Division, Utilities Administration Building, 9150 Curry Ford Road, 3rd Floor Orlando, FL 32825 Email: Water. Reclamation@ocfl.net International Water Association (IWA)
Creating Synergies for Energy and Nutrient Recovery
In an era of stringent regulations and sustainable thinking, wastes are now seen as resources. The traditional goal of wastewater treatment has been to protect the water environment from organic and nutrient pollution. While this goal is even more important today, it is also being recognized that the pollutants are resources—in the wrong place. Therefore, the focus is moving towards recovering valuable energy and nutrient resources. Biogas production is an effective measure to replace fossil fuels with renewable fuels, and chemical fertilizer with biofertilizer. Methane capture in wastewater treatment facilities not only contributes to climate change mitigation efforts, but also to generation of renewable energy source for use by the wastewater treatment facilities and nearby communities. Wastewater treatment projects capture methane-rich biogas that would have otherwise been released in the atmosphere. Many poor households with toilets connected to biogas digesters have improved not only the sanitation conditions, but they now have alternative source of energy for cooking and lighting as well . In some cities in Europe (e.g., Linköping in Sweden, Oslo in Norway, Lille in France, etc.), public buses and trains are fuelled by biogas from municipal and agricultural wastewater treatment. In addition, carbon credits can be earned, providing additional financial incentives for wastewater and sludge management. Both the wastewater treatment facilities in Suva City, Fiji and at the Absolut Distillers Inc. plant in Batangas, Philippines availed of the clean development mechanism. Sludge from septic tanks and wastewater treatment can also be converted into soil conditioners and fertilizer. Recovering nutrients can offer several benefits, such as (a) revenue from a saleable organic fertilizer product, (b) savings from using chemical fertilizer, (c) improving operations by reducing nutrient loads in return streams, and (d) preventing the formation of struvite, which clogs system pipes. Considering that the phosphate deposits worldwide are becoming depleted, recovery of phosphorus from wastewater as struvite, and recycling these nutrients into agriculture as fertilizer appear promising. Project Briefs • Sewage Treatment Plant with Greenhouse Gas Emission Reduction Project: Suva City, Viti Levu Island, Republic of Fiji • An Innovative Recycling Hub of Regional Biomass by a Public Wastewater Treatment Plant: Suzu City, Ishikawa Prefecture, Japan • Industrial Wastewater Treatment with Energy and Nutrient Recovery and Carbon Credits: Batangas, Philippines • 100 % Biogas for Urban Transport: Linköping, Sweden
Sewage Treatment Plant with Greenhouse Gas Emission Reduction Project
Kinoya, Suva City, Viti Levu Island, Republic of Fiji Fiji, covering a total land area of 18,376 km2, consists of more than 300 islands, mostly of mountainous terrain and volcanic origin. Eighty-five percent of the total area is composed on its two largest islands—Viti Levu and Vanua Levu.
sequential batch reactors (Source: ADB)
63
64
From Toilets to River
anaerobic sludge digester (Source: ADB)
Financing Arrangements • Project was developed with support from ADB, Technical Support Facility, and Carbon Market Programme. • On December 2003, ADB approved a loan for the “Suva-Nausori Water Supply and Sewerage Project” (L2055-FIJ) of which the sewage treatment project is made a subcomponent of said project. • Asia Pacific Carbon Fund (APCF) is cofinancing carbon savings though upfront payment against the purchase of certified emission reduction (CERs) to be generated by the project up to 2012. • Total Clean Development Mechanism (CDM) expenditure: $330,000 • Income from CDM: $1million–$2million Project Outcomes • Being the first of its kind in the Pacific, the project is expected to serve as a model for the development of other similar undertaking, focusing on renewable and environmentally sound interventions. • The project is expected to contribute to the worldwide effort in controlling the release of GHG emission. • The living and working conditions of local communities are expected to be improved with the elimination of obnoxious odors and air pollution at the Kinoya Sewage Treatment Plant and its surroundings. • The reduction of a significant quantity of methane will translate to additional revenues for the national government with the sale of CERs. The generated revenues could then be utilized to implement urgently needed developmental activities in the country. • Annual CERs are estimated to be around 22,469 CERs. Total expected CERs for the APCF are 44,938. Contact for more information Taito Delana, General Manager, Water Authority of Fiji email: tdelana@waf.com.fj
sludge drying beds (Source: ADB)
With most of the developmental interventions in the area confined to coastal areas, this has put growing pressure on coastal resources. Increasing population, urbanization, and industrial and economic development are identified as the main drivers for such a situation. Coastal development has resulted in the degradation of natural habitat (due to inappropriate agricultural activities, mining, etc.), pollution due to improper waste disposal, increased withdrawals from freshwater sources, and depletion of coastal fisheries. Technology Option Through the introduction of a methane recovery and combustion system to the existing and proposed anaerobic sludge treatment units (anaerobic digesters), the project aims to recover generated methane resulting from the anaerobic decomposition of organic matter. Institutional and Management Arrangements • The project was conceived by the Water Supply and Sewerage Department (WSD) under the Ministry of Works, Transport and Public Utilities, Government of Fiji Islands. • Operation of the facility is now under the responsibility of the Water Authority of Fiji, since its establishment in 2010.
Creating Synergies for Energy and Nutrient Recovery
65
An Innovative Recycling Hub of Regional Biomass by a Public Wastewater Treatment Plant
Suzu City, Ishikawa Prefecture, Japan Suzu City in Ishikawa Prefecture is located at the tip of the Noto Peninsula, off the coast of the Sea of Japan. Because of the new global warming mitigation measures, the city was faced with having to improve sanitation and solid waste management. Sewage works need to be expanded from the central community to those communities at the fringes where it was difficult to extend pipe networks. In addition, conventional sanitation methods needed to be changed and remodeled such that only one facility would be used to treat all the waste in the region. This new system was introduced at an existing public wastewater treatment plant that would undergo remodeling. The main objectives of the project were to: (i) lessen the amount of greenhouse gases generated; (ii) introduce and remodel a facility that accepts different forms of raw waste from all parts of the city; and (iii) recover energy and convert excess methane sludge into green fertilizer.
Technology Option • The following structures and equipment illustrate the new methane fermentation facility: o Machine Building: to receive and pretreat biomass. The pretreatment system can effectively remove substances not suitable for fermentation, such as plastics. Equipment includes (i) garbage crushing and separation machines with an improved crushing and sorting system that enables a higher collection rate of kitchen, raw fish and other seafood processing waste; (ii) a solubilization tank that contributes to more efficient methane fermentation; and (iii) a thickening machine; o Fermentation Building: for methane fermentation, which includes mixing and methane fermentation tanks; o Gas Holder Facility: to temporarily store biogas generated, including a gas holder, dried desulfurization equipment, and a boiler, etc.; o Heating Building: to heat the Fermentation Building by using biogas, which includes a sludge dewatering machine and an indirect steam heating dried machine; o Drying Building: to dry dewatered sludge; o Sludge Treatment Building: for anaerobic digestion and dewatering digested sludge; and o Deodorizing equipment, which includes a biological deodorizing apparatus and an activated adsorption tower. Institutional and Management Arrangements • The local government of Suzu City is the owner of the project, with Matsui Consulting Firm Co., Ltd. providing advice and guidance. • The Japan Institute of Wastewater Engineering Technology prepared the biomass recycling system, the carbon dioxide reduction effect, and clarified legal procedures. • Kawasaki Plant Systems was responsible for the design of the project, the fast implementation of contract for the works, and adoption of a steel-made digestion tank and a film-made gas holder.
Aerial view of the Suzu City wastewater treatment facility. (Source: Saburo Matsui)
Vertical steel methane fermentation tank. (Source: Saburo Matsui)
66
From Toilets to River
Financing Arrangements • This is the first biomass utilization project jointly promoted by Japan’s Ministry of Land, Infrastructure and Transport (MLIT), and the Ministry of the Environment. The project was financed through subsidy from the Ministry of the Environment. Project Outcomes • The facility allowed Suzu City to achieve both cost merits and the challenge to meet global warming measures when compared to individually treating and disposing of sludge. • The biogas generated was useful to reduce the energy requirements of the facility. • The drying condition showed that the dried sludge meets Environment Protection Agency (EPA) standards and is safe. • When a comparison of costs was conducted, ¥43 million per year of savings was realized by the use of the new facility, and treating waste collectively. In particular, the sludge disposal cost becomes zero by introducing the dry fertilizer to agricultural areas. • Approximately 4,500 tonnes of carbon dioxide could be reduced within 19 years. • The innovative recycling hub of the facility provides a model to many other municipalities in Japan, which have similar difficulties in sanitation and municipal solid waste management. Contact for more information Masuhiro Izumiya, email: suzu@city.suzu.ishikawa.jp Todo Ishikawa, President, Japan Institute of Wastewater Engineering Technology email: t-ishikawa@jiwet.or.jp International Water Association (IWA)
Industrial Wastewater Treatment with Energy and Nutrient Recovery and Carbon Credits
Batangas, Philippines
Thermophilic anaerobic digester and lagoons (Source: G. Tee)
Reed bed (Photo: M. Ebarvia)
Absolut Distillers (formerly, Absolut Chemicals) Inc. (ADI) is a subsidiary of Tanduay Distillers, Inc. (TDI). It is a distillery business located in Lian town in Batangas, Philippines. ADI distillery produced high-strength wastewater, which polluted waterways, specifically the Bagbag and Pamlico Rivers. In 1998, the Pollution Adjudication Board of the DENR issued a cease-and-desist order due to its contribution to the pollution of the said rivers. A state-of-the-art wastewater treatment plant was not economically viable at that time because it required a large investment. ADI needed to find an alternative solution in the management of its wastewater. Technology Option • Lagoons were enlarged and retrofitted with extremely strong HDPE geomembrane liners in 1998. • The following year, with the assistance of the University of the Philippines in Los Baños, the Liquid Fertilization Program was initiated.
Creating Synergies for Energy and Nutrient Recovery
67
• •
•
The Pilot Reed Bed System was constructed in 2000 for further polishing of the treated wastewater. In 2001, the Sequential Batch Reactor (SBR) System was constructed to equalize, aerate, and clarify wastewater in a timed sequence in one reactor basin. A Thermophilic Anaerobic Digester became operational in 2008. The process used a Hybrid Anaerobic Digester System and a Covered Inground Anaerobic Reactor lagoon to capture methane. The methane is then used as a fuel for the boilers, and flared using an Enclosed Type Biogas Flare System.
Institutional and Management Arrangements • This was considered a large investment project, thus a Clean Development Mechanism (CDM) Memorandum of Agreement was signed in November 2007 among TDI, ADI, and Japan’s Mitsubishi Corporation. • Under the CDM agreement, there are certified emission reduction (CER) credits to be generated by the digester system. Mitsubishi can purchase any and all the credits up to 480,000 units. Thus, ADI should take all necessary measures to make the project result in (i) greenhouse gas reductions; and (ii) the creation of CER credits. • Mitsubishi Corporation provided funding for the construction of the digester system, its basic design, and operational parameters. • SGV & Co. is an auditing firm that will audit ADI’s financial report, a copy of which will be delivered to Mitsubishi Corporation. • The DENR is the national authority that provides rules and regulations for effluent standards. Financing Arrangements • The CDM agreement allowed Mitsubishi to fund the construction of a biogas digester in exchange and/or transfer of CER credits from the project to Mitsubishi. • The payment by Mitsubishi for the construction of the digester is to be made in advance, detailed in an agreed upon schedule.
Project Outcomes • ADI was granted by the Food and Pesticide Authority the license as manufacturer and distributor of liquid fertilizer. • The cease-and-desist order was lifted in 2004. • The use of distillery effluents benefitted 150 sugarcane farmers and four sugarcane plantations (a total area of 1,339 ha). • The liquid fertilizer is given away to the farmers for free. The application of the distillery slops in sugarcane fields has resulted in a 60% increase in yield. • Fossil fuel use and consequent emissions were displaced due to ADI’s capture of carbon dioxide and methane generated from the alcohol distillation slop water treatment. This was then used as fuel for the boilers. Sixteen tonnes of bunker oil was displaced per day, while carbon dioxide emissions were reduced to 96,000 tonnes per year. • ADI’s initiatives received numerous accolades including: (i) annual citations from the DENR and the Office of the President; (ii) the Global CSR Award in 2011; and (iii) the gold award in the 2011 International Green Apple Environment Award in London.
100% Biogas for Urban Transport
Linköping, Sweden Linköping is a city located in the middle of an agricultural district on the east coast of Sweden, with 140,000 inhabitants. Because of its location, the prerequisites for building biogas plants are therefore apparent. The manure from cattle and pigs in the
Source: Bioenergy from waste: Biogas Production Model ()
68
From Toilets to River
area could be codigested with abattoir waste and organic waste from other food industries in the area. In the early 1990s, the city of Linköping was in the process of converting the bus fleet to use alternative fuel in order to reduce the local pollution from diesel buses. The most interesting alternative was to shift to natural gas. However, the decision to expand the natural gas grid from the south and up to the central parts of Sweden was delayed. The City of Linköping, therefore, decided to use locally-produced biogas as fuel for the urban bus fleet. Technology Option • The plant has an annual treatment capacity of 100,000 tonnes, and produces 4.7 million m3 of upgraded biogas (97% methane), which is used by 64 buses and a number of heavy and light duty vehicles. • The Linköping plant handles 2,000 tonnes/ year of animal manure and 36,000 tonnes/year of other waste materials, mainly waste from different food industries (waste fat, vegetable waste, slaughter-house waste, etc.). The plant was originally designed to handle 100,000 tonnes/year, including 25,000 tonnes/year of manure. In 2005, the total throughput was 45,000 tonnes. • Abattoir waste (blood, rumen content, and process water) is pumped through a 1.7 km-long pipeline from the source to the biogas plant in an underground pipeline. The same trench is used by the low pressure pipeline for upgraded biogas to the refuelling station for buses. The rest of the abattoir waste is minced before it is transported on road to the biogas plant. • The waste is mixed with manure at the biogas plant, and then pasteurized for an hour at 70°C before being fed to the digesters. • The biogas plant has two conventional stirred tank digesters, each with a capacity of 3,700 m3, and with a residence time of 30 days. The process is operated at mesophilic conditions. The digestate is removed continuously from the digester, and stored at the plant for a few days before it is transported back to the farmers, and used as biofertilizer. The annual production of government-approved high grade biofertilizer is around 52,000 tonnes.
Linköping biogas plant (Source: Svensk Biogas)
Slow filling system for city buses (Source: Svensk Biogas)
Institutional and Management Arrangements • In 1991, TekniskaVerken (TVAB), the municipal service provider, set up a pilot project of five buses powered by methane collected from the wastewater treatment plant. • Close collaboration between TVAB and Linköping University helped to speed up the development of biogas knowledge and production. • The source of feedstock was then expanded to include waste from the local slaughterhouse owned by Scan-Farmek. The Federation of Swedish Farmers (LRF) also came on board to supply feedstock in the form of crop residues and manure. • To solidify their cooperation, the three stakeholders started an associated company with shared ownership called Linköping Biogas AB (now Svensk Biogas) in 1995. Financing Arrangements • The company received government funding to build a €140,000 methane production facility, which was completed in 1996. • Additional funding and expertise came from the municipality of Linköping, the county, the regional bus authority, Linköpings Trafik AB
Creating Synergies for Energy and Nutrient Recovery
69
(LITA), and TVAB to cover the risks (financial and technical) associated with the application of new technology in the city. Project outcomes The project resulted in: • Reduction of CO2 emissions from urban transport by 9,000 tonnes per year as well as the local emissions of dust, sulphur, and nitrogen oxides. • Decrease in dependence on fossil fuels, with the biogas generated effectively replacing 5.5 million liters of petrol and diesel annually. • Provision of an environmentally sound process for the treatment of organic waste in the region, with reduction in the volume of waste sent for incineration by 3,422 tonnes annually. Contact for more information Werner Scheidegger, Svensk Biogas AB e-mail address: werner.scheidegger@svenskbiogas.se Contact number: +46 13 20 92 01
Taito Delana. 2011. Powerpoint Presentation: Kinoya Sewerage Treatment Plant GHG Emission Reduction Project, Fiji. Tan Tee, G. 2009. “The CDM Project of Absolute Chemicals, Inc.: The First in the Philippine Manufacturing Industry.” Presentation during the 2009 East Asian Seas Congress. Manila. (23–26 November 2009).
References
100% Biogas for Urban Transport in Linköping, Sweden: Biogas in Buses, Cars and Trains. () (accessed 6 March 2013). ADB-APCF. 2011. Project Brief: Fiji-Kinoya Sewerage Treatment Plant GHG Emission Reduction Project, Suva. (). Ministry of the Environment, Government of Fiji. 2007. Fiji National Liquid Waste Management Strategy and Action Plan. International Waters Project-Pacific Technical Report. Natalie Mayer. 2012. 100% Biogas-Fuelled Public Transport In Linköping, Sweden. (. ly/1beKGF4/) (accessed 6 March 2013). Saburo Matsui. 2010. An Innovative Recycling Hub of Regional Biomass by Anaerobic Digestion of a Public Wastewater Treatment Plant The Successful Project in Suzu City, Japan.
Wastewater and Septage Treatment and Reuse for Agriculture
With the increasing scarcity of freshwater resources, but ever growing demand for more efficient food production for the expanding populations, much wider recognition is being given to wastewater as an important resource. In arid and semi-arid climates, and in areas without irrigation systems, wastewater may constitute an indispensable source of water and nutrients for agriculture. In rural and peri-urban areas of most developing countries, the use of sewage and wastewater for irrigation is a common practice because its high nutrient content reduces or even eliminates the need for expensive chemical fertilizers. Wastewater treatment and reuse also protects groundwater from both contamination and depletion. Concern for human health and the environment are the most important constraints in the reuse of wastewater. Risks can be minimized by applying suitable irrigation techniques, and wastewater and sludge treatment technologies, selecting crops that are less likely to transmit pathogens to consumers, and using protective measures to reduce exposure. The projects in Viet Nam and Iran illustrate the opportunities for wastewater management and reuse in safely meeting the growing demand for water resources for agricultural use without degrading the environment. The biosolids from septage and wastewater treatment in Metro Manila, Philippines are composted and applied in sugar plantations affected by lahar (volcanic mudflows) as organic soil conditioners. Project Briefs • Wastewater Treatment for Irrigation: Buon Ma Thuot City, Dak Lak Province, Viet Nam • Tehran Sewerage Project: Iran • Septage and Biosolids Management: Metro Manila and Rizal Province, Philippines
Wastewater Treatment for Irrigation
Buon Ma Thuot City, Dak Lak Province, Viet Nam The capital of Dak Lak province, Buon Ma Thuot City is the administrative, economic, social and cultural center, and regional hub of the Central Highlands of Viet Nam. It plays a key role in national security and defence, and is a center of trade and human resource training for the central highlands and central coast areas. The city’s population is expected to grow steadily over the next 10 years. It was envisioned to become a modern Class 1 City by 2015. Technology Option • The wastewater management system was developed for the collection of domestic wastewater and treatment. It included the following components: (i) a central sewage pumping station; (ii) stabilization ponds; and (iii) separate sewerage and drainage systems with 5,500 house connections. No energy and chemicals were required for the stabilization ponds. The technology is simple and understandable. It minimized mechanical and
70
Wastewater and Septage Treatment and Reuse for Agriculture
71
•
electrical content, maximized available human resources, and used local products. The Wastewater Reclamation System was constructed in order for the treated wastewater to be reused for agriculture. The system included the following: (i) enhanced treatment, which made use of four additional maturation ponds and a pumping station; (ii) conveyance through high and low reservoirs; and (iii) final delivery of the reclaimed water to the farmers and fields through a gravity distribution pipeline.
•
A drainage surcharge, equal to a 10% surcharge on current water rates, was integrated into the water tariff, which is collected by the Buon Ma Thuot Water Supply Company. In addition, a wastewater fee of 20% of the water bill was included for those households connected to the separate sewerage system.
Wastewater treatment ponds (Source: Viet Anh Nguyen)
Sewerage system (Source: Viet Anh Nguyen)
Institutional and Management Arrangements A Wastewater and Sanitation Enterprise (WW&SE) was established to manage and operate the treatment and reclamation facility. This institution made great efforts in creating favorable revenue conditions from which the new enterprise would be realized. The WW&SE was formed under the operating “umbrella” of the Urban Management Environmental Sanitation Company, the recipient organization of the DANIDA grant funds. Financing Arrangements • The total project value, inclusive of the 20% contribution from the Government of Viet Nam is D126.2 million ($21.7 million).
Project Outcomes • A total of 5,500 house connections were completed by the end of 2007. Under the fully expanded capacity of the sewerage network and WWTP, around 17,000 house connections will be served. • The Separate Sewerage System minimized odors, excluded rainwater flow resulting in smaller pipe sizes, reduced pumping costs, and minimized sewage quantity for economical WWTP dimensioning. • Diseases related to polluted environment (such as diarrhea) have decreased. • People’s knowledge regarding the relationship between a polluted environment and health has been improved. Locals are now agreeing to voluntarily connect to the drainage system. • Around 4,000 m3/d of reclaimed wastewater is provided to subsistence farmers. This is equal to serving 100 ha of agricultural land with or without rain. Thus, the farmers, including the ethnic minorities, now have a reliable yearround source of irrigation water. • Wastewater residual nutrients have reduced the need for supplemental fertilizer. • 115 ha of coffee plantation are being irrigated with treated wastewater. Contact for more information Viet Anh Nguyen (Ha Noi University of Civil Engineering). Email: vietanhctn@gmail.com; vietanhctn@yahoo.com
72
From Toilets to River
Tehran Sewerage System
Tehran, Iran
Wastewater treatment plant in Tehran (Source: IWA)
The Tehran Sewerage System is an innovative project to improve the environmental conditions in the Greater Tehran area, through the installation of wastewater collection and sewage treatment facilities to improve the general public health and further enhance irrigation systems in the surrounding areas. The project also targeted the low-income groups living in the southern part of Tehran, which represented about 65% of the total population. Technology Option • The project promotes an integrated approach to water management, in which the construction of a sewerage network reduced contamination of groundwater, and treated wastewater is reused in agriculture. Treatment system The project consists of: • Interceptors and laterals to convey wastewater in the northern, southern, and partly in the central areas of Tehran. • Western Trunk Main (pipeline of about 24 km) and Eastern Trunk Main constructed as a tunnel 20 km long (4 km of which was constructed as a culvert). • Secondary treatment (capacity of 450,000 m3/d) with chlorination (disinfection unit). • Provisions made available for possible extension to tertiary treatment system.
Institutional and Management Arrangements • In 1991, the Government of Iran (GOI) approved an Act on the establishment of Water and Sewerage Companies to set up the institutional and governance framework for the reform in the water and sanitation sector. This resulted in the creation of six water and wastewater companies in provincial capitals. For the Tehran Province, this entailed the establishment of the Tehran Province Water and Wastewater Company (TPWWC). • In order to promote accountability and autonomy of its line management, the TPWWC commenced a program in 1996 for spinning off line units into subsidiary companies to operate independently. Thus, the Tehran Sewerage Company (TSC) was established with delegated responsibility to operate and maintain the wastewater collection and treatment system. Financing Arrangements Capital investment The capital investment was financed through the International Bank for Reconstruction and Development - World Bank ($145.0 million), with local financing of $196.45 million through the TPWWC. Cost recovery • Sewage collection tariff, based on the volume of water consumption. • User connection fees. Project Outcomes • By December 2008, TSC had a total of 211,000 connections. This means over 2 million people had benefitted from the provision of wastewater collection and treatment facilities, as well as reduced health risks due to the improved sanitary and environmental conditions. • The farmers of the Varamin Plain also benefitted by having increased agricultural outputs through the use of treated effluents for irrigation, and of treated sludge for soil conditioning.
Wastewater and Septage Treatment and Reuse for Agriculture
73
Septage and Biosolids Management
Metro Manila and Rizal Province, Philippines
In response, MWCI’s wastewater management program comprises of: (i) septage management, including desludging of septic tanks; (ii) separate sewer networks; and (iii) combined sewerdrainage systems. Technology Option • Desludging of septic tanks per household is done every five to seven years in the East Zone area via 78 vacuum tanker trucks of various sizes. The size of the trucks used is dependent on the ease of access to individual septic tanks. • The collected sludge from the septic tanks is brought to the MWCI’s septage treatment plants, which have a combined capacity considered to be the largest in the world. The North Septage Treatment Plant, located in San Mateo, Rizal, has a capacity of 586 m3/d while the South Septage Treatment Plant, located in Taguig City, has a capacity of 814 m3/d. The two plants have a combined treatment capacity of 1,400 m3/d. • The treatment processes include: (i) primary treatment, which involves screening and grit and scum removal; and (ii) secondary treatment, which uses the activated sludge process. This is followed by the coagulantassisted mechanical dewatering in screw presses for the sludge, including adding polymers, and mechanical compaction for stabilization and subsequent reduction of volume. The filtrate (liquid component) is treated further in a conventional sewage treatment facility. The dewatered sludge or biosolids are then brought to lahar-affected areas in Central Luzon for composting and inoculation in preparation for being used as organic soil conditioners in the corn and sugarcane plantations. Institutional and Management Arrangements • As a concessionaire of the MWSS for the period of 1997 to 2037, MWCI is tasked to deliver and expand water and wastewater services to the eastern part of Metro Manila and Rizal Province. MWCI has direct management control of their septage and biosolids management program. • The MWSS Regulatory Office (MWSS-RO) evaluates the proper implementation of the
Vacuum trucks for desludging septic tanks. (Source: S. Griffiths)
South Septage Treatment Plant (Source: S. Griffiths)
Biosolids spread out and sprayed with inoculants. (Source: MWCI)
Manila Water Company, Inc. (MWCI) is one of the two concessionaires of MWSS. MWCI provides the eastern portion of Metro Manila as well as the province of Rizal with water supply and wastewater services. The area includes over 6 million people, of which 1.6 million belong to the low-income communities. Around 85% of the population use septic tanks. Many of the septic tanks were deemed improperly designed, constructed and maintained. Up to 58% of the organic load of Metro Manila’s receiving bodies of water came from these septic tanks. This has contributed to the poor water quality of Laguna de Bay, Pasig River, and Manila Bay.
74
From Toilets to River Concession Agreement, monitors water quality and supply in all service areas, and regulates the water tariffs being charged by the concessionaires to all their customers. The DENR and the LLDA provide and enforce wastewater standards for treatment operation and facilities. Financing Arrangements • In 2005, MWCI collected fees for septage collection services amounting to P803, and P5,000 per truckload for residential and commercial areas, respectively. Scheduled septic tank maintenance is provided to residents at no additional charge by MWCI. Charges for residential customers are applicable only for services requested by the customer outside of the regular schedule. • As of December 2012, all customer types (residential, commercial, and industrial) in Metro Manila pay a 20% environmental charge from the basic water charge. The sewerage charge is pegged at 30% of the basic water charge for East Zone customers.3 Project Outcomes • Number of septic tanks desludged: 217,765 benefitting around 850,000 households (as of February 2011). • The treated septage consistently meets the Class C standards specified by DENR. • Since the start of its operations, the project brought about the following: (i) reduction in the frequency of overflowing septic tanks; (ii) reduction of health risks from contact with septage in drainage systems; and (iii) elimination of indiscriminate dumping of raw septage by private contractors. • The biosolids are further processed by service providers to yield higher value soil conditioners, and these are given or sold to corn, sugarcane and mango producers in lahar-affected areas in Tarlac and Pampanga. Between 2006 and 2008, approximately 49,000 m3 of biosolids were applied. The volume of biosolids that MWCI delivered to these nutrient-poor areas has tremendously helped in improving the soil fertility of these once barren areas.
•
Through the biosolids management program, MWCI assisted in the rehabilitation of farmlands affected by the eruption of Mount Pinatubo, provided both an economical and environmentally-sustainable method of biosolids disposal and reuse, and delivered employment and agricultural benefits to a severely disaster-stricken area.
References
ADB. 2011. Information on PFR2 Sub-projects. Appendix 4: PFR2 Sub-project Buon Ma Thuot. Extract from World Bank Technical Report: Second Viet Nam Urban Water Manila Water Co., Inc. “Sanitasyon Para Sa Barangay”: Manila Water’s Experience in Septage Management. ———. 2010. Biosolids Management Program. (Report). Viet-Anh Nguyen. 2011. Environment Sanitation Project for the Buon Ma Thuot City. World Bank. 2009. Implementation Completion and Results Report. Tehran Sewerage Project. (, accessed in November 2011).
3
Source: MWCI billing statements.
Wastewater Treatment and Aquaculture
Duckweed aquaculture has been regarded as a potential technology to combine both wastewater treatment and feed production in developing and industrialised countries. In the United States, use of duckweed-covered lagoons for tertiary treatment is classified by the USEPA as an innovative and alternative technology. Aquatic macrophytes, such as duckweeds, grow readily in ponds fed with human waste, and their use in wastewater treatment has been studied with regard to BOD and nutrient removal, including nutritional value for raising animals. The rapidly growing duckweeds are capable of accumulating nutrients and minerals from wastewater, which are removed from the system as the plants are harvested from the pond surface. Duckweed ponds also have the potential to create a financial incentive for controlling faeces and wastewater, and improve sanitation in both rural and urban areas. Duckweeds are cultivated in these ponds, mainly for feed for Chinese carps and India’s major carps, but also for chickens, ducks, and edible snails. Because of their comparatively high productivity, and high content of valuable protein, they provide an excellent feed supplement. When duckweed biomass is used for animal production, the generation of income, and nutritional improvement appear as possible side-benefits from the wastewater treatment process. In Mirzapur, Bangladesh, the full potential of duckweed aquaculture lies in its combined use in sanitation, food production, and income generation as illustrated in the following project brief. Project Brief Integrated Duckweed-based Wastewater Treatment and Pisciculture: Mirzapur, Bangladesh
Integrated Duckweed-based Wastewater Treatment and Pisciculture
Mirzapur, Bangladesh
Duckweed ponds (Source: Masum A Patwary)
Situated in the central Bangladeshi district of Tangail, Mirzapur is a town with an estimated resident population of around 20,000. The town gained popularity for its Kumudini Welfare Trust Hospital, which was considered the largest hospital in the country during the time of its construction. The hospital complex has an estimated wastewater volume equivalent to a population of about 2,000 to 3,000. The generated volume is sourced from the hospital, school, and staff quarters. In recognition of the inadequacy of the existing, aid-funded 4-cell facultative wastewater treatment
75
76
From Toilets to River
system to treat the wastewater treatment requirements of the hospital complex, the Mirzapur Shobuj Shona (Green Gold) project was conceived. The initiatitive was spearheaded by the Project in Agriculture, Rural Industry Science and Medicine (PRISM)-Bangladesh, a local nongovernmental organization (NGO). Technology Option • The Mirzapur Shobuj Shona project made use of the existing 4-cell facultative lagoon complex by converting three lagoons into fish ponds, with the fourth one serving as a primary receiving and settling tank. • A 0.6 ha plug flow duckweed wastewater treatment system was also established, and is attached to the lagoon complex. • Collected wastewater is received in the 0.25 ha primary receiving pond to remove suspended solids. • Wastewater effluent from the receiving pond is then pumped to the adjacent duckweedcovered serpentine plug-flow lagoon for treatment. Institutional and Management Arrangements • The project is managed by the following entities: (i) the Kumudini Welfare Trust, a non-profit family trust managed by an outside board of directors, with one of its representative member being a nominee by the Government of Bangladesh; (ii) PRISM-Bangladesh, a nonprofit Bangladeshi NGO in charge of developing and maintaining the wastewater system; and (iii) the public. • Obligations among parties involved are specified in contracts. Financing Arrangements • Based on financial records spanning 8 years, the average total income generated from the sale of duckweed-fed fish and livestock is estimated to be around Tk399,630 ($1= Tk80) annually. • The system makes a net profit (average of about Tk83,777 before taxes), which is enough to cover capital investment and recurrent costs. • System is self-sustaining. Charging of user fees and/or subsidies from the government are not needed to sustain the operation of the system.
Project Outcomes The Mirzapur Shobuj Shona project has demonstrated the following: • With the use of duckweed, treatment of conventional wastewater to advanced tertiary levels can be done (effluent parameters: BOD: 8.2 mg/l; TSS: 7.8 mg/l). • The system showcased efficient resource recovery—(i) reuse of treated effluent for irrigation; (ii) production of high quality duckweed feed supplement for fish and livestock; (iii) generation of biogas for energy needs; and (iv) use of composted sludge as fertilizer. • The system has become a model for financial robustness, earning profits to achieve costrecovery, without the need for user fees or subsidies. Contact for more information: Paul Skillicorn, President, Agriquatics 800 W. 38th St., Suite 3203 Austin, Texas 78705 Tel.: +512 934-7441 Email: info@agriquatics.com Masum A. Patwary, Environmental Advisor, PRISM-Bangladesh Email: patwaryma@gmail.com; m.patwary@tees.ac.uk
References
Jonathan Parkinson (GHK). 2005. Decentralised Domestic Wastewater and Faecal Sludge Management in Bangladesh. United Kingdom-Department for International Development (UK-DFID). Sascha Iqbal. 1999. Duckweed Aquaculture: Potentials, Possibilities and Limitations for Combined Wastewater Treatment and Animal Feed Production in Developing Countries. SANDEC Report No. 6/99. Duebendorf: SANDEC and EAWAG. (http:// bit.ly/1ca7un3) Dr. Masum A. Patwary. 2013. Powerpoint Presentation: Wastewater for Aquaculture: The Case of Mirzapur, Bangladesh. (ADB, Manila, 29–31 January 2013).
Wastewater Treatment for Sustainable Tourism and Recreation
The tourism sector subsists by offering cleanliness and a comfortable environment. Sanitation facilities are essential in tourism areas. A very obvious reason for wastewater treatment for tourist sites, whose income depends on tourists coming, and coming again, is that nobody wants to swim in dirty water. In the Nusa Dua hotel complex in Bali, Indonesia, the wastewater treatment system not only provides reclaimed water for the gardens and golf course, it is also a mini-ecosystem by itself, attracting recreational fishers, bird watchers and tourists. Boracay is a prime tourist destination in the Philippines, with its fine white sand beach. News on coliform levels in the coastal waters resulted in a decline in tourist arrival. In response, the government entered into a joint venture agreement with a private company to ensure water supply and sanitation for sustainable tourism in Boracay. Also using the PPP approach, the joint venture agreement between a local government entity in Bhubaneswar City, Orissa, India and a private company that operates amusement parks turned an unsanitary wetland into a recreational park with wastewater treatment system. A lake in the park was developed for boating facilities, and a filtration plant, duckweed pond, sedimentation pond, and fishpond were set up for treatment of the water. The low-cost wastewater treatment system improved the environmental conditions in the city and downstream areas, while the park generated employment, and attracted over a million visitors from within and outside the city. Project Briefs • Eco-lagoon: Nusa Dua, Bali Province, Indonesia • Water and Sanitation for Sustainable Tourism: Boracay, Aklan Province, Philippines • Wastewater Treatment and Recreation Park: Bhubaneswar City, Orissa, India
Eco-Lagoon
Nusa Dua, Bali Province, Indonesia Nusa Dua was established in the 1970s in Bali, Indonesia to provide world-class facilities within the island. It is an enclave of four- and five-star hotels, with an 18-hole golf course and a retail village. In its concept development, Nusa Dua prioritized ecofriendly approaches towards the natural physical surroundings, and preservation of the sociocultural setting. Environmental concerns are also prioritized as demonstrated by the wastewater treatment system. Technology Option • Collection and conveyance: There are pumping stations for conveying the wastewater collected from the hotels in the Nusa Dua hotel complex to the treatment ponds. • Treatment system: o Area: 30 ha. o Capacity: 10,000 m3/d o Average loading: 5,700 m3/d o Three lagoons: primary treatment, secondary treatment - stabilization pond - aeration - sedimentation - filtration
77
78
From Toilets to River
o There is also biotechnology and tertiary treatment so wastewater can be reused for irrigation in nearby villages, and watering the golf course in the hotel complex.
Financing Arrangements • The capital investment was financed by the Nusa Dua Hotel complex and BTDC. • The cost recovery policy was applied through monthly payments by the hotels to BTDC. • User fees are collected from visitors upon entering the Eco-Lagoon. Project Outcomes • Treated wastewater is reused for watering the public gardens in the Nusa Dua complex, and grounds of individual hotels. • The presence of mangrove trees, and the algae produced in the Eco-Lagoon encourages fish to breed, and tiny frogs to flourish, which then attract various species of birds to feed at the lagoon. Because of the high diversity and number of birds, the Eco-Lagoon has become a bird-watching site. In addition to the endemic species, migratory birds like the egrets have attracted bird watchers to the complex. Recreational fishing amenities also attract visitors to the Eco-Lagoon park. Training activities on bird counting are also conducted in the park. Like a miniature ecosystem, the EcoLagoon has turned into a tourist attraction, and site for study tour. Contact for more information Bali Tourism Development Corporation (777 BTDC Area, Nusa Dua 80364, Bali, Indonesia).
Wastewater treatment ponds: “Eco-Lagoon” (Photos: M. Ebarvia)
Institutional and Management Arrangements • The wastewater treatment facility is centrally managed by the Bali Tourism Development Corporation (BTDC). The wastewater from 12 big hotels in Nusa Dua and two hotels outside Nusa Dua is collected and conveyed to the wastewater treatment system located in Bualu village outside Nusa Dua. Wastewater from these hotels undergoes primary and secondary treatment. There is a final wastewater station known as the “Eco-Lagoon” that has become a recreational site, educational center, and tourist attraction. • All construction and development within the complex was carried out according to the standards and guidelines outlined in the Design Criteria, Covenant Construction and Restriction Area Code. These regulations are intended to preserve the natural surroundings within the complex.
Water and Sanitation for Sustainable Tourism
Boracay, Aklan Province, Philippines Boracay Island is the Philippines’ premiere beach destination, boasting of kilometers of powdery, fine, white sand. Approximately a million tourists flock to this destination to enjoy the sun and the beach. Before the entry of the Boracay Island Water Company (BIWC), the existing wastewater treatment plant was no longer able to competently perform, given the huge volume and changing characteristics of wastewater generated. This was a critical issue, which can affect its prime economic activity. Untreated wastewater seeps into the beaches, presenting aesthetical and sanitation
Wastewater Treatment for Sustainable Tourism and Recreation
79
concerns. At the same time, Boracay was facing water supply inadequacy issues. In April 2009, the East Zone concessionaire of Metro Manila, Philippines— Manila Water Company, Inc. (MWCI)—entered into an agreement with the government with the goal to ensure sustainability of Boracay, creating the Boracay Island Water Company.
Technology Option • Treatment system: Complete mix activated sludge Institutional and Management Arrangements • MWCI entered into a joint venture agreement with then Philippine Tourism Authority (PTA, now Tourism Infrastructure and Enterprise Zone Authority or TIEZA) to form Boracay Island Water Company, which will operate, manage, rehabilitate, expand, and finance water supply and sewerage services in the island for 25 years. • Operating under a concession agreement, Boracay Island Water will undergo a periodic review. • This joint venture was considered a landmark milestone as it was the first to be formed under the new National Economic and Development Authority (NEDA) guidelines. Financing Arrangements • On 29 July 2011, Boracay Island Water entered into an Omnibus agreement with Development Bank of the Philippines (DBP) and Security Bank Corporation (SBC). The lenders have agreed to provide loans in the aggregate principal amount of up to P500 million. The table below shows the schedule of commitment of the lenders under Tranche 1.
Boracay white sand beach (Source: Ben Mañosca)
Boracay Island Water Company (Source: Ben Mañosca)
Financing the Water Supply and Wastewater Treatment in Boracay Sub-Tranche Sub-Tranche 1A Lender Development Bank of the Philippines Security Bank Corporation Security Bank Corporation Fund Source Philippine Water Revolving Fund (PWRF) PWRF Internally Generated Funds Commitment Amount P250,000,000.00
Sub-Tranche 1B
P125,000,000.00
Sub-Tranche 1C
P125,000,000.00
Source: Boracay Island Water Company
80
From Toilets to River
•
On 14 November 2012, the company entered into a second Omnibus agreement extending the loans for another P500 million with the same commitment amounts shown in the table.
of almost 1 million. This growth has resulted in excessive wastewater generation, estimated at 180 MLD. The city has no centralized sewage treatment, thus, untreated and semi-treated sewage flow into the city’s water bodies that creates unsanitary conditions. A strip of wetland, NICCO Park, was earmarked for development. It covered 57 acres (27.07 ha), and was primarily used as a dumpsite for the city. Also, the site was encroached upon by slum dwellers. As part of the Bhubaneswar Master Plan, a lake in the park was developed for boating facilities and a filtration plant was set up for treatment of the water. To further clean the water, a wastewater treatment facility using biotic methods was also set up. The project aims to expand affordable recreation facilities in Bhubaneswar, and to improve the city’s sanitation system in a cost-effective way. Technology Option • Phase 1: Basic water treatment which included filtration and aeration. • Phase 2: Natural treatment process using duckweed and pisciculture. Sedimentation pond and a fishpond were constructed. • The system will treat 4 MLD of wastewater.
International Kite Boarding Event in Boracay (Source: Ben Mañosca)
Project Outcomes • Water loss is down from 37% to 15%, water pressure increased from 15 pounds per square inch (psi) to an average of 34 psi, and 98% of the island is enjoying 24-hour water supply. • Wastewater treatment capacity increased from 2.6 MLD to 6.5 MLD. • Joint venture of MWCI-PTA has posted positive gains since 2011. • The project is 4 years ahead of target in environmental compliance with the completion of Sewage Treatment Plant (STP) upgrade. • The International Kite Boarding Event, cancelled in 2005 due to issues in wastewater pollution affecting the beach, was recommenced in 2010 after STP upgrade was completed. Contact for more information Bernardo Mañosca, Boracay Island Water Company Email: ben.manosca@manilawater.com
Wastewater Treatment and Recreation Park
Bhubaneswar City, Orissa, India Bhubaneswar City is the administrative capital of Orissa, India, with a natural river system running through it. It has experienced a spiraling population growth rate from 16,512 in 1951 to a current estimate
(Source: UNESCAP)
Wastewater Treatment for Sustainable Tourism and Recreation
81
Institutional and Management Arrangements • Public-Private Partnership (PPP): In 1996, Bhubaneswar Development Authority (BDA), a local government entity, and NICCO Parks and Resorts Ltd, a private company, formed the BDA-NICCO Park as a joint venture company. An MOU specified the roles and responsibilities of each partner. The Board of Directors consisted of seven members—three members each from BDA/Government of Orissa and NICCO, and one from the Investment Promotion Corporation of Orissa Ltd. (IPCOL). • NICCO Parks, a private recreation company that sets up and manages amusement parks, operates and manages the facility, as well as markets and promotes the amusement park. • BDA, a state government agency responsible for all city-level planning, liaised with all external agencies to obtain necessary approvals. • Government of Orissa provided the land for the project. • IPCOL provided the loan to partly finance the park. • Xavier Institute of Management (XIM), in collaboration with its technical partner, the Central Institute of Freshwater Aquaculture (CIFA), designed and established the biotic wastewater treatment system. • India Canada Environment Facility (ICEF), a bilateral funding agency, which supports water and energy initiatives, provided financial support for the wastewater treatment system. Financing Arrangements • The amount budgeted for the park was Rs44 million. Of this amount, the two partners invested Rs12 million as equity; Rs27.5 million was taken as a term loan from the financial institution, IPCOL; Rs2.1 million from the Orissa State Finance Corporation; and Rs1.6 million from internal revenue. The agreement includes a paid up capital of Rs12 million, of which 49% is subscribed by BDA, and the remaining 51% by NICCO. • The amount budgeted for the wastewater treatment was Rs5.5 million. Financial support was given by ICEF for one year of operation. It was then handed over to BDA-NICCO Park.
• •
•
• • •
Resources for the park were largely sufficient, but those for the wastewater treatment were not. Flexibility in financing arrangements, especially in loan repayments, given the vulnerable natural environment of the park, was key in the development of the facility. Risk is shared equally between the BDA and NICCO. Guarantees and undertakings required by banks and financial institutions are provided by both BDA and NICCO. Profits are apportioned as per share in equity. All assets are insured for natural calamity or other losses. The BDA is answerable to the Government of Orissa and its citizens on any aspect relating to the facility, such as water quality, issues of access, expansion, etc.
Project Outcomes • Conversion of an unsanitary wetland into a green area with recreation facilities. The recreation facility attracted an estimated 1.2 million paying visitors both from within and outside the city. • The park and wastewater treatment activities resulted in the generation of employment in the area, including low income workers, and skills creation through training by NICCO. Local staff were trained in the O&M of equipment in the park and commercial operations. • A sanitary environment for the city residents was created. The wastewater treatment facility has improved the quality of water downstream from the project site where many poor communities continue to use the river as a source of water for many daily tasks. • The simple and low-cost treatment technology used in the project makes it easy for local people to manage and maintain. This can be replicated in other cities. • On the wastewater treatment aspect, by working with a joint venture ran primarily as a private company, bureaucratic hindrances and delays often associated with government procedures were removed. • At present, PPP has been accepted as an effective and viable mechanism for service
82
From Toilets to River
delivery reflected through the national level guidelines on private sector participation in urban development, specifically in the area of water and sanitation. In the Department of Industry, Government of Orissa, a policy framework has recently been developed for PPP in infrastructure. Contact for more information Sandhya Venkateswaran c-181 Sarvodaya Enclave, 2nd Floor, New Delhi 110017, India Deoranjan Kumar Signh Vice Chairman Bhubaneswar Development Authority Akash Sova Building, Sachivalaya Marg Bhubaneswar 1, Orissa, India Tel.: +91 6742396124
References
Anak Agung Ratna Dewi 2012. “Sustainable Water Supply and Waste Management in Bali, Indonesia.” Presentation made during the East Asian Seas Congress 2012, Changwon City, Republic of Korea, 9-13 July 2012. Bernardo Mañosca. 2013. Sustaining Tourism: The Boracay Water Story. Powerpoint Presentation. Sub-regional Conference on Promoting Innovations in Wastewater Management. ADB. Manila. 29–31 January 2013. United Nations Economic and Social Commission for Asia and the Pacific (UNESCAP). 2005. Wastewater and Recreation Park in Orissa. () () accessed in 1 December 2009.
Environmental Sanitation and Good Governance
Good governance is not just about government. It is also about how citizens, leaders, public institutions, the media, the private sector, and civil society relate to each other in order to make change happen. An important part of the equation is the way government goes about the business of governing. Good governance requires three things: (a) state capability – the extent to which leaders and governments are able to get things done; (b) responsiveness – whether public policies and institutions respond to the needs of citizens, and uphold their rights; and (c) accountability – the ability of citizens, civil society, and the private sector to scrutinize public institutions and governments, and hold them to account.4 So how does all this relate to sanitation? States that are capable, responsive and accountable are more likely able to provide the basic services, such as education, health, water, and sanitation. And they are more likely to attract investment, generate long term economic growth, and reduce poverty. Unless governance improves, poor people will continue to suffer from a lack of security, public services, such as water and sanitation, and economic opportunities. In Mauritius, to reduce pollution of rivers due to rapid residential and industrial development, the Wastewater Management Authority (WMA) was set up in accordance with the Wastewater Management Authority Act. The WMA in Mauritius is a good model of an effective organization capable of implementing a national sewerage program, providing wastewater treatment services to consumers, achieving cost recovery through monthly tariffs, successfully negotiating agreements with
Construction of sewerage system.(Source: IWA)
industrial plants on pretreatment systems, and enforcing compliance with the discharge standards and regulations. The project in Port Louis, Mauritius makes the case that investing in wastewater management and services is a necessary condition for enabling sustained economic growth, and that good governance is an essential sufficient condition. Project Brief • Environmental Sanitation Project: Port Louis, Mauritius
Environmental Sanitation Project
Port Louis, Mauritius
4
UK Department for International Development (DFID) . 2006.
83
84
From Toilets to River
At the time when the project was prepared in the mid-1990s, Mauritius had already become a middleincome country with a GDP per capita of about $3,550 per year. During this period, rapid growth in both residential and industrial development in Port Louis resulted in noticeable pollution of rivers and land that prompted the government to undertake a program to connect household and industrial polluters to the sewerage system. Technology Option Wastewater collection treatment • A rising main conveys wastewater from Fort Victoria (capacity of 23,000 m3/d) and Pointe aux Sables pumping stations (capacity of 25,000 m3/d) to the treatment plant. Treatment system • Over 150 pretreatment plants (either individual or jointly installed) treat industrial effluents before discharge to the public sewer. • Sewage treatment: Primary treatment with disinfection, treating over 40,000 m3/d of wastewater. • The plant was also designed to stabilize and dewater sludge. • Sea outfall: The outfall reaches about 695 m offshore, with six diffusers set at an average depth of 30 m to ensure that the effluent mixes with seawater. Institutional and Management Arrangements • The Wastewater Management Authority (WMA) was set up in accordance with the Wastewater Management Authority Act in 2001 to operate, maintain, and manage all public sewerage systems, and treatment facilities. • The WMA in Mauritius is an example of an effective organization capable of implementing a national sewerage program, providing wastewater services to consumers successfully negotiating agreements with industrial plants on pre-treatment systems, and enforcing compliance with the discharge standards and regulations. • The Ministry of Environment is responsible for supervising an environmental audit, consisting
of a team set up at the level of the Government to monitor the impact of the wastewater projects being implemented under the national sewerage program. Financing Arrangements Capital investment • The World Bank financed the sewerage system ($12.4 million), capacity building for the wastewater authority, and program implementation. • The Japanese Bank for International Cooperation (JBIC) financed, with a soft loan ($33.6 million), two new pumping stations, the Montagne Jacquot wastewater treatment plant, and the sea outfall. The government of Mauritius also provided funds for some aspects of each component. Cost recovery • Cost recovery was achieved through monthly wastewater tariffs. Project Outcomes • The number of household connections to sewage treatment facilities has increased on a yearly basis, and this has significantly improved the sanitary conditions and public health in Port Louis. By 2006, 30% of Mauritians were connected to the network (10% increase). • The institutional performance of the wastewater sector improved, with revenues generated through tariffs covering all O&M costs as well as the interest payments for loans. • Environmental degradation has been reversed. Treated wastewater rose from 20.2 million m3 in 1999 to 30.5 million m3 in 2005. Lessons Learnt • Regularly reviewing the organizational effectiveness of implementing agencies, and quickly addressing weaknesses can help ensure that agencies perform as effectively as possible. • Introducing joint billing for water and wastewater makes cost recovery more efficient, and also reduces costs for administration of the scheme.
Environmental Sanitation and Good Governance
85
References
UK Department for International Development (DFID). 2006. White Paper on Eliminating World Poverty: Making Governance Work for the Poor. World Bank. 2010. Implementation Completion and Results Report. Environmental Sewerage and Sanitation Project. (. ly/18kPvt80 - accessed in November 2011).
From Toilets to Rivers Experiences, New Opportunities, and Innovative Solutions.
About the Asian Development Bank ADB’s vision is an Asia and Pacific region free of poverty. Its mission is to help its developing member countries reduce poverty and improve the quality of life of their people. Despite the region’s many successes, it remains home to approximately two-thirds of the world’s poor: 1.6 billion people who live on less than $2 a day, with 733
|
https://www.scribd.com/doc/213479059/From-Toilets-to-Rivers-Experiences-New-Opportunities-and-Innovative-Solutions
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
# include <Servo.h>int value = 0;Servo m1;void setup () { m1.attach(3); delay(1); m1.write(10); delay(200); m1.write(100); delay(1000); }void loop() { m1.write(10); delay(10); m1.write(80); }
Hello,I was playing around with the values in the loop to try and get my motor to do somethingThe noises are a beep beep beep (3 different pitches, one low, medium, high) then another long low, then long high and then nothing.I can't get the motors to move at all and this is where I'm stuck.Do you have any tutorials you can recommend ? Once I get the motors working in a state where I can set the speed through code then I'm golden as the rest of the code is easierThanks for your answer !
|
https://forum.arduino.cc/index.php?PHPSESSID=0l6mpbmp46sqd62gs3pq5h7cl0&topic=463963.msg3185463
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
As you may already know,.
First let's create a directory, initialize npm, and install webpack locally:
mkdir webpack-demo && cd webpack-demo npm init -y npm install --save-dev webpack
Now we'll create the following directory structure and contents:
project
webpack-demo |- package.json + |- index.html + |- /src + |- index.js
src/index.js
function component() { var element = document.createElement('div'); // Lodash, currently included via a script, is required for this line to work element.innerHTML = _.join(['Hello', 'webpack'], ' '); return element; } document.body.appendChild(component());
index.html
<html> <head> <title>Getting Started</title> <script src=""></script> </head> <body> <script src="./src/index.js"></script> </body> </html>
In this example, there are implicit dependencies between the
<script> tags. Our
index.js file depends on
lodash being included in the page before it runs. This is because
index.js never:
project
webpack-demo |- package.json + |- /dist + |- index.html - |- index.html |- /src |- index.js
To bundle the
lodash dependency with
index.js, we'll need to install the library locally...
npm install --save lodash
and then import it in our script...
src/index.js
+ import _ from 'lodash'; + function component() {
<html> <head> <title>Getting Started</title> - <script src=""></script> </head> <body> - <script src="./src/index.js"></script> + <script src="bundle with our script as the entry point and
bundle.js as the output. The
npx command, which ships with Node 8.2 or higher, runs the webpack binary (
./node_modules/.bin/webpack) of the webpack package we installed in the beginning:
npx webpack src/index.js dist/bundle.js Hash: 857f878815ce63ad5b4f Version: webpack 3.9.1 Time:
Your output may vary a bit, but if the build is successful then you are good to go.
Open
index.html in your browser and, if everything went right, you should see the following text: 'Hello webpack'.
The
import and
export statements have been standardized in ES2015. Although they are not supported in most browsers yet, webpack does support them out of the box.
Behind the scenes, webpack actually "transpiles" the code so that older browsers can also run it. If you inspect
dist/bundle.
Most projects will need a more complex setup, which is why webpack supports a configuration file. This is much more efficient than having to type in a lot of commands in the terminal, so let's create one to replace the CLI options used above:
project
webpack-demo |- package.json + |- webpack.config.js |- /dist |- index.html |- /src |- index.js
webpack.config.js
const path = require('path'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') } };
Now, let's run the build again but instead using our new configuration:
npx webpack --config webpack.config.js Hash: 857f878815ce63ad5b4f Version: webpack 3.9.1 Time: 298
Note that when calling
webpackvia its path on windows, you must use backslashes instead, e.g.
node_modules\.bin\webpack --config webpack.config.js.
If a
webpack.config.jsis present, the
webpackcommand picks it up by default. We use the
--configoption here only to show that you can pass a config
{ ... "scripts": { "build": "webpack" }, ... } Hash: 857f878815ce63ad5b4f Version: webpack 3.9.1 Time: |- bundle.js |- index.html |- /src |- index.js |- /node_modules
If you're using npm 5, you'll probably also see a
package-lock.jsonfile in your directory.
If you want to learn more about webpack's design, you can check out the basic concepts and configuration pages. Furthermore, the API section digs into the various interfaces webpack offers.
© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
|
http://docs.w3cub.com/webpack/guides/getting-started/
|
CC-MAIN-2018-51
|
en
|
refinedweb
|
beginner
A semigroup for some given type
A has a single operation (which we will call
combine), which takes two values of type
A, and returns a value of type
A. This operation must be guaranteed to be associative. That is to say that:
(a.combine(b)).combine(c)
must be the same as
a.combine(b.combine(c))
for all possible values of a, b ,c.
There are instances of
Semigroup defined for many types found in Arrow and the Kotlin std lib.
For example,
Int values are combined using addition by default but multiplication is also associative and forms another
Semigroup.
Now that you’ve learned about the Semigroup instance for Int try to guess how it works in the following examples:
import arrow.* import arrow.typeclasses.* import arrow.instances.* ForInt extensions { 1.combine(2) } // 3
import arrow.data.* import arrow.instances.listk.semigroup.* ListK.semigroup<Int>().run { listOf(1, 2, 3).k().combine(listOf(4, 5, 6).k()) } // ListK(list=[1, 2, 3, 4, 5, 6])
import arrow.core.* import arrow.instances.option.monoid.* Option.monoid<Int>(Int.semigroup()).run { Option(1).combine(Option(2)) } // Some(3)
Option.monoid<Int>(Int.semigroup()).run { Option(1).combine(None) } // Some(1)
Many of these types have methods defined directly on them, which allow for such combining, e.g.
+ on
List, but the value of having a
Semigroup typeclass available is that these compose.
Additionaly
Semigroup adds
+ syntax to all types for which a Semigroup instance exists:
Option.monoid<Int>(Int.semigroup()).run { Option(1) + Option(2) } // Some(3)
Contents partially adapted from Scala Exercises Cat’s Semigroup Tutorial
|
https://arrow-kt.io/docs/arrow/typeclasses/semigroup/
|
CC-MAIN-2018-51
|
en
|
refinedweb
|
DSON Importer for Poser 1.0.0.56 is now available!
DAZ 3D is pleased to announce the next General Release version of DSON Importer for Poser, version 1.0.0.56!
What is new in this version? Do I need to update my copy?
The 1.0.0.56 version is a bugfix release. It resolves several issues with the loading and/or handling of DSON format content. All new downloads of the product will be of this version. A Change Log with additional information can be viewed on the Documentation Center.
Highlights are:
- Fixed crashed when a morph specifies an incorrect number of deltas
- Fixed support for geometry culling when a conforming figure does not graft
- Fixed support for Point At
- Fixed a crash when items are loaded from directories that are not mapped
- Fixed resolution of nodes where node name does not equal asset id
- Fixed read of rigidity rotation
- Fixed support for OSX 10.5
For more information on the previous release (1.0.0.27), see this thread.
I could wish old content was being updated faster, however I did manage to get the supersuit and the boots saved DSON compatable and made the PCF for them.
This is done in Poser Pro 2012 64 bit, using materials I've purchased elsewhere, but I'm happy to say that the default suit works just like it does in DS, though finding all the various material zones to get things textured is something of a challenge. (Then again it is in DS too if you aren't using one of the presets.)
This was also done without the newer DSON Importer, which I shall go reset after posting this.
edit: Gotta add the picture.
Apparently some of the older Genesis content cannot be easily be converted to DSON compatible format. Possible never will be. I feel your pain, some items not available in Poser format are the reason I got interested in Genesis to begin with. So I've taking to learning how to use Daz.
Thanks, but:
1. Is the Poser single axis scaling now fixed ? (The blendzones)
2. Is the internal scaling now fixed ? (The morphform dials)
Hi,
today I have downloaded the new files and installed them.
But now I can't load any Genesis figure in Poser 9 pose room.
I get allway a little white window with this message:
Traceback (most recent call last):
File "F:\! 3D\POSER\DSON-Genesis\Runtime\libraries\Character\DAZ People\Genesis.py", line 1, in
import dson.dzdsonimporter
ImportError: No module named dson.dzdsonimporter
DsonImporter is installed in Poser 9 Program folder, Essentials are installed in an external runtime I made for Dson Content.
Before I have used the previous release (1.0.0.27) and was able to load figures and content.
Do you have any ideas?
You installed the new files in the exact same locations as the old ones?
Yes
This is my 3rd version of Dsonimporter I use.
Do you know if the installer uninstalled the old files first?
Thank you answer. Yes it did.
I even have looked yesterday if Dsonimporter is in Addon folder - yes it is. Also the scripts are in there typical folder.
I'm stumped because I've done everything as usual, and it's not the first DSon version and Essentials, which I installed. Also, I can not confuse files because I had downloaded the 3 files needed for my system to a new folder down.
-----------------
Edit:
I wanted to add the logfile but it is not allowed.
And her are the Dson files in my Poser 9 python folder:
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\addons\dson\boost_python-vc100-mt-1_50.dll
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\addons\dson\DzDSONIO.dll
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\addons\dson\QtCore4.dll
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\addons\dson\__init__.pyc
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\addons\dson\__init__.py
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\addons\dson\dzdsonimporter.pyd
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\poserScripts\ScriptsMenu\DSON Support\Importer Preferences....py
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\poserScripts\ScriptsMenu\DSON Support\Transfer Active Morphs.py
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\poserScripts\ScriptsMenu\DSON Support\SubDivision\Set SubDivision Level 0.py
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\poserScripts\ScriptsMenu\DSON Support\SubDivision\Set SubDivision Level 1.py
C:\Program Files (x86)\Smith Micro\Poser 9\Runtime\Python\poserScripts\ScriptsMenu\DSON Support\SubDivision\Set SubDivision OFF.py
For some reason, Poser can't find or can't see that directory.where dsondzdsoninporter is located. Make sure that it hasn't lost the DSON-Genesis library.
Thank you for your ideas.
I remove my Dson-Runtime in Poser GUI at Library and readd it.
But no results.
Than I have copied the Dsonimporter files from Python folder in my external runtime - the same failure message agai at try to load Genesis figure.
Is DAZ aware the Poser library is still locking up in Poser Pro 2012 after loading Genesis/Genesis content to a scene? It doesn't happen immediately, but invariably while working on a scene with Genesis, the library no longer responds.
They probably aren't, because not everyone useing PP2012 is having that problem. I use PP2012 (64bit) and I didn't have the problem when working on that image I posted. I've never had that problem that I've noticed, actually.
I've never had a problem either
Many people did and reported it and DAZ confirmed it. There were two workarounds. One was to set the Library to External rather than embedded, the second was to use Shaderworks Library. Which is cool, and I use it when I want to do something the Poser library can't do. But, I don't like the External Library. And ... since Genesis is the only thing that causes the Library to freeze, I don't need the Library to be External when I'm using Poser content. But, changing the Library from Embedded to External or from External to Embedded requires a relaunch of Poser.
The second or third release supposedly fixed the Library freezing. I think the second introduced the freezing for some people who had not initially had that problem.
It IS improved, and I can work on a scene with Genesis in it for longer before the Library freezes, but eventually, it always does. It's another one of those little gotchas that affect some computers and don't affect others. Who knows. Now that my XPS warranty is expired, it's time to replace it. The new computer may be ... immune ... to the frozen Library.
Although ... something else could be broken instead ...
Computers. Gotta love them. They make our lives so much more interesting.
.
Another option is to go into the imprter's preferences (in the Scripts>DSON Importer menu) and turn off the Show progress option. You won't get a progress bar during import, but your library should remain unfrozen.
I just replaced my XPS 410 with XPS 8500. Can't wait to try rendering with the new PC.
Did that when it was first suggested, but my Library still freezes.
I'm looking at the Dell Precisions. There are entirely TOO many choices though. Which is good, but it means it will probably be several months before I decide on the build.
I just replaced my XPS 410 with XPS 8500. Can't wait to try rendering with the new PC.
Have you bug reported that? The devs need to know about it.
Do I open a help request even though it's a bug and not a request for help?
Have you bug reported that? The devs need to know about it.
Submit it to Bug Tracker
Oops.
Where is Bug Tracker hidden? You will need to sign up for an account
Yey, I would like to signup to tell about my problem but I have got no activation mail. :(
Just the second time. I think my ISP don't like Daz mails. I even have problems to get all the newletters.
Yes I did Daz to my adress book. But without a failure message I can't make anything.
Today I have deleted my external runtime with Dson Content and have installed all new - Dsonimporter file and the both General Essentials. With the same result - Genesis.py can't find Dsonimporter.
DSON importer needs to be installed to the Runtime in the main Poser program directory...
Yes, I did. It is not my first Dsonimporter-Installation. That's why I am confused.
I noticed from your sig that you are using Poser 9 on a 64 bit system. Are you by chance installing the 64 bit dson importer? If so that's the wrong one for you to use. You need the 32 bit importer. Poser 9 is not a 64 bit program, it's 32 bit.
Thank you for your help.
No, I have downloaded the 32 bit version of Dsonimporter and installed in Poser 9 Program folder like I allways have done the last times.
Therefore I am confused because this time it doesn't work.
That is... weird, and I have no idea what else it could be not that I'm an expert, but all the obvious we've covered.
Have you tried the obvious, which is to just reinstall the DSON Importer?
|
http://www.daz3d.com/forums/discussion/comment/221003/
|
CC-MAIN-2017-43
|
en
|
refinedweb
|
All of my production Arduino projects allow some sort of configuration changes. Various operational constants are maintained in EEPROM. When the Arduino is first started, I can change these settings and rewrite them into EEPROM if I have a terminal connected to the Arduino.
Generally, I am OK with connecting my laptop to one of these arduinos to make configuration changes, should the need arise. But I would like the option to be able to configure using an LCD screen and push buttons if reconfiguring were regularly necessary or if connecting a USB cable to the arduino were difficult.
I have spent a lot of time over the years configuring datacom equipment and much of it is configured using a small LCD and a couple of buttons like this ADTRAN TSU
This particular device uses enter/up/down/cancel to navigate its menus. This is the kind of functionality I’d like to replicate on an arduino.
I purchased a LinkSprite LCD/Keypad shield for the arduino from Sparkfun. It looks like this:
The docs says the shield uses digital pins 4-9 and analog pin 0. The schematic indicates pin D10 is being used as well and looking at the board a trace does appear to go somewhere.
The LCD display is a normal display and can be accessed using the standard liquidCrystal library.
The buttons are a bit weird. All 5 buttons connect to a single analog port and each has a different resistor assigned to it so that when each button is pressed, the analog port returns a different value.
I started out having a lot of trouble dealing with these switches. I started at the LinkSprite site and downloaded their sample code. Well, that was for Version 2 of this board and evidently sparkfun (at the time of purchase any way) was selling V1. V2 appears to allow you to press buttons simultaneously and V1 doesn’t.
I found the correct sample code here.
This code worked fine for me; however, I found it rather difficult to follow. I wrote my own getkey function which is far clearer (at least to me)
#include <LiquidCrystal.h> const int maxDeviation = 5; enum keyNameE {none=0, right=1, up=2, down=3, left=4, select=5}; // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 4, 5, 6, 7); int getKey( ) { int curValue; curValue = analogRead(A0); if (abs(curValue-0) < maxDeviation) return right; else if (abs(curValue-143) < maxDeviation) return up; else if (abs(curValue-332) < maxDeviation) return down; else if (abs(curValue-507) < maxDeviation) return left; else if (abs(curValue-740) < maxDeviation) return select; else return none; } // getKey void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); lcd.print("hello, world!"); Serial.begin(9600); } void loop() { int curValue; int i; int lastValue = 1023; while (true) { i = getKey(); switch(getKey()) { case none: lcd.setCursor(0,1); lcd.print("NONE "); break; case right: lcd.setCursor(0,1); lcd.print("RIGHT "); break; case up: lcd.setCursor(0,1); lcd.print("UP "); break; case down: lcd.setCursor(0,1); lcd.print("DOWN "); break; case left: lcd.setCursor(0,1); lcd.print("LEFT "); break; case select: lcd.setCursor(0,1); lcd.print("SELECT "); break; } } // while }
It is very disappointing that getKey cannot return an enumeration. I spent way too much time trying to force it. From what I gather, the Arduino IDE’s preprocessing some how messes this up such that I can only return an int. Fortunately I can still use the enum labels in the switch so clarity is maintained.
If you use this code and find that certain buttons aren’t recognized, increase the deviation constant. I found +/- 5 worked every time on my board, but if your resistors’ deviation is more than mine, you might have an issue.
Once I had the sample code running smoothly, I set out to code my reconfig function which allows configuring of the arduino via the shield. Here’s a short video of how this functions:
I’m not going to post the code here. It isn’t a simple function call. You must encode the strings into a switch statement so really it consists of a skeleton function that is hand-modified and then getKey and another function that handles the scrolling.
If someone really wants this code, drop me a line and I’ll make it available.
|
https://bigdanzblog.wordpress.com/2015/01/23/linksprite-lcdkeypad-arduino-shield-for-software-configuration/
|
CC-MAIN-2017-39
|
en
|
refinedweb
|
Opened 7 years ago
Closed 7 years ago
Last modified 3 years ago
#14952 closed Uncategorized (wontfix)
New find_commands(management_dir) to support .pyc and .pyo
Description
In django/core/management/init.py: []
In our environment, We compile all .py to .pyc, and then remove all .py.
Then manage.py can't find our commands because find_commands only find .py.
Here is a modified version for find_command:
def find_commands(management_dir): """ Given a path to a management directory, returns a list of all the command names that are available. Returns an empty list if no commands are defined. """ command_dir = os.path.join(management_dir, 'commands') ret = {} try: filenames = os.listdir(command_dir) for filename in filenames: if filename.startswith('_'): continue if filename.endswith('.py'): modname = filename[:-3] elif filename.endswith('.pyc') or filename.endswith('.pyo'): modname = filename[:-4] else: modname = None if modname: ret[modname] = 1 except OSError: pass return ret.keys()
Change History (9)
comment:1 Changed 7 years ago by
comment:2 follow-up: 3 Changed 6 years ago by
Do you have a source for "executing Python bytecode only files is gradually being removed from CPython"? There are no PEPs pertaining to removing the bytecode generation step for CPython.
comment:3 Changed 6 years ago by
Do you have a source for "executing Python bytecode only files is gradually being removed from CPython"? There are no PEPs pertaining to removing the bytecode generation step for CPython.
PEP 3147 doesn't remove bytecode generation, but it moves the
pyc files into a
__pycache__ subdirectory, and this is already implemented in Python 3. So adding any code to Django that explicitly look for
pyc files next to the
py file is adding code that we already know to be obsolete. This is just reinforcement of the point that bytecode files are an internal CPython implementation detail, and not something that other code should be looking at directly.
comment:4 Changed 5 years ago by
It's a sort of functionality that cannot be ignored. The distribution of compiled sources is a necessary thing, unless you work *only* with open-source, there are some contracts and companies out there that requires (sometimes enforced by law) some sort of "compiled" or "executables".
My company is obliged to a law called "PAF-ECF" (a brazilian federal law which applies to all retail automation systems) and requires that we point and sign an "executable" file (that just cannot be "readable" or an editable source file). We use a complicated mix of Django for database modeling and the ERP part of the software which runs in a browser. The point-of-sales (POS) part is a GTK+ application that uses those Django models. We need to deploy only the compiled files. There is no other way.
By the way, PEP 3147 will do not ignore ".pyc" files, unless the ".py" file is there..
It's so simple and so needed that I just can't figure out why this is marked as "won't fix".
(!) My english isn't so good (as I think it is :-). I have no intention to be rude or anything like that. Actually I love Django and all the fantastic things that you developers did. I learned a lot from you.
comment:5 Changed 5 years ago by
I can appreciate the situation you're in here, but @carljm's point is entirely valid - PYC files aren't "compiled python" (or, at least, they shouldn't be treated like that). They're a cache of the runtime operation of a language interpreter -- an artefact that varies between language implementations and versions.
In this case, what you're faced with are legal requirements, rather than technical ones. If Brazilian law specifically uses words like "executable", then whoever drafted the law clearly didn't anticipate dynamic languages like Python. While this is unfortunate, it's unreasonable to expect us to modify the project to accommodate a non-recommended use of Python just to satisfy your interpretation of a Brazilian legal requirement.
In the short term, I'd suggest trying to work around the law. Get legal advice about *exactly* what must be signed in order to be compliant. Have you actually got legal advice that declares that in the case of Python, the .pyc file *is* the executable? I'm not a lawyer, and I have no familiarity with the PAF-ECF law, but if it says you need to sign the "executable", then is there any scope for you to sign the *Python* executable and say you've met your requirement? Could you sign the .py file, on the grounds that *it* is the executable? Could you sign an egg file that contains the source code? These are all questions that you'd need to get legal advice on to be certain, but from my past experience, the way that an engineer chooses to interpret the law doesn't always match the way that a lawyer or judge would consider compliant usage.
In the longer term, work to fix the law. Work with your representatives to get the wording altered in a way that is compatible with dynamic languages. This is the industry you work in, so you need to take an interest when governments start passing boneheaded laws that don't match industry practice.
comment:6 Changed 5 years ago by
Thank you @russellm,
Since your response I read (and re-read) the PEP 3147 carefully and, although they will continue to support source-less distributions, we will be looking for a better way to distribute our code. You gave me a lot of good advices.
comment:7 Changed 3 years ago by
I'm developing an application that can run either as a local webserver (frozen using cx_freeze) or as a regular webserver on aws.
Freezing has its advantages for non advanced users: makes the deploy simpler since they don't have to install python, django, rest-framework and all dependencies on a user. We also don't have to control multiple environments in the case user has already a python version.
Although some may consider Django isn't made for this purpose, I consider this an issue because python, in fact, supports importing from zipfiles (PEP 273) and also supports running pyc/pyo compiled files.
In fact, django find_commands tries to stick to import behaviour finding command modules that can be imported, but it fails because it only considers regular folders (and not folders inside zip) and only commands with .py extension for this purpose.
I've made a small patch that can solve both problems, although I believe this could be accomplished using some kind of setting in the case of the file extension:
def listdir(path): """ Replacement for os.listdir that list dir inside zip files """ if not os.path.isdir(path): pos = path.lower().find('.zip') if pos >= 0: pos += 4 zip = path[:pos] path_within = path[pos + 1:].replace('\\', '/') from zipfile import ZipFile zip = ZipFile(zip) return [a[len(path_within)+1:] for a in zip.namelist() if a.startswith(path_within)] return os.listdir(path) def find_commands(management_dir): """ Given a path to a management directory, returns a list of all the command names that are available. Returns an empty list if no commands are defined. """ command_dir = os.path.join(management_dir, 'commands') try: return [os.path.splitext(f)[0] for f in listdir(command_dir) if not f.startswith('_') and (f.endswith(('.py', '.pyc'))] except OSError: return []
comment:8 Changed 3 years ago by
I would like to see included this feature too, I distribute pyo files and I have to leave .py for migrations and management commands
No, executing Python bytecode only files is gradually being removed from CPython, this is not a sane way to do deployments. Wontfixing.
|
https://code.djangoproject.com/ticket/14952
|
CC-MAIN-2017-39
|
en
|
refinedweb
|
RANDOM(3) BSD Programmer's Manual RANDOM(3)
NAME
random, srandom, initstate, setstate - better random number generator;
routines for changing generators
SYNOPSIS
#include <<stdlib.h>>
long
random(void);
void
srandom(unsigned seed);
char *
initstate(unsigned seed, char *state, int()/ srandom() have (almost) the same calling sequence and ini-
tialization), however, random()
will by default produce a sequence of numbers that can be duplicated by
calling srandom() with `1' as the
rand(3)
HISTORY
These functions appeared in 4.2BSD.
BUGS
About 2/3 the speed of rand(3).
4.2 Berkeley Distribution June 4, 1993 2
|
http://modman.unixdev.net/?sektion=3&page=setstate&manpath=4.4BSD-Lite2
|
CC-MAIN-2017-39
|
en
|
refinedweb
|
On Sun, Oct 01, 2000 at 08:31:10AM -0700, Me wrote: > As for the subject, I have noticed that ne2000 card > support was compiled > into gnumach for the 2000-03 hurd tarball, but I can > only get the card > detected if the card is on io=0x300. Is there a place > to change this so > that multiple ne2000 cards could be supported by > gnumach? Ah, yes. We haven't talked about GNU Mach yet. Here is what is required: As GNU Mach doesn't support such boot time options, you need to hack the kernel, but it isn't hard: In gnumach-1.2/linux/dev/drivers/net/Space.c, you'll find this: /* In Mach, by default allow at least 2 interfaces. */ #ifdef MACH #ifndef ETH1_ADDR # define ETH1_ADDR 0 #endif #ifndef ETH1_IRQ # define ETH1_IRQ 0 #endif #endif You need to fill those in. If you want to override everything, you do this: Replace: #ifdef MACH static struct device eth1_dev = { "eth1", 0, 0, 0, 0, ETH1_ADDR, ETH1_IRQ, 0, 0, 0, ð2_dev, ethif_probe }; #else static struct device eth1_dev = { "eth1", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð2_dev, ethif_probe }; #endif With: static struct device eth1_dev = { "eth1", 0, 0, 0, 0, 0x300, 10, 0, 0, 0, ð2_dev, ne_probe }; This will FORCE the probe for a NE2000 card (and no other second chard is recognized) at the specified address. I think you should be able to specify ETH1_ADDR and _IRQ at compile time, but I can't find
|
https://lists.debian.org/debian-hurd/2000/10/msg00025.html
|
CC-MAIN-2017-30
|
en
|
refinedweb
|
Tim Wilson wrote: > > I'm still a little intimidated by the OOP > features that Python offers. I should probably just bit the bullet and dig > in and learn it. For starts, you might try thinking of a class instance as a Python dictionary. For instance the dictionary: # make a dictionary aFoo = {} # fill dictionary with data aFoo['one'] = 1 aFoo['two'] = 2 aFoo['three'] = 3 is quite similar to the class: # make a class (and also say somehow how the data inside is structured) class Foo: def __init__(self, one, two, three): self.one = one self.two = two self.three = three # fill an instance of Foo (aFoo) with data aFoo = Foo(1, 2, 3) Of course, initialization in __init__ isn't necessary, you could do: class Foo: pass # empty class aFoo = Foo() aFoo.one = 1 aFoo.two = 2 aFoo.three = 3 But the nice thing about a class (as compared to a dictionary) is that it's easy to add functions to a class that actually do something with the data stored inside (for instance, do some calculation). By initializing (lots of) the data in an __init__ function, you're sure these data members are there during the class's lifetime, as __init__ is always executed when the class is created: class Foo: def __init__(self, one, two, three): self.one = one self.two = two self.three = three def add_all(self): return self.one + self.two + self.three aFoo = Foo(1, 2, 3) print aFoo.add_all() # prints 6 aBar = Foo(3, 3, 3) print aBar.add_all() # prints 9 Of course, it's possible to write functions that do this with dictionaries, but classes add some nice extra structure that is helpful. They can be useful to bundle data and the functions that operate on that data together, without the outside world needing to know what's going on exactly inside the data and the functions (data hiding). Classes of course also offer inheritance, but that's for later. > I think I understand how a list would be useful to store > the atoms until the total mass can be calculated. I don't see where you > parse the user input here. > I'll be more specific: > How will it know the difference between CO (carbon monoxide) > and Co (a cobalt atom)? Hmm. You have this dictionary with as the keys the various element names (and as value their mass), let's call it 'elements', and a string describing a molecule called 'molecule'. An approach may be: # untested code! Doesn't do boundary checking! is probably slow! def getWeightForNextElement(molecule, elements): # assumption: all elements are a maximum of two characters, where the first # is a capital, and the second is lowercase # if 'molecule' doesn't start with an atom identifier at all we return 'None' if molecule[0] not in string.uppercase: return None if molecule[1] not in string.lowercase: # okay, we're dealing with a single char element, look it up: if elements.has_key(molecule[0]): return (elements[molecule[0]), 1) # return weight and length of what we read else: return None # not a known element else: # okay, we're dealing with a two char element: if elements.has_key(molecule[0:1]): return (elements[molecule[0:1]), 2) # return weight and length of str we read else: return None # not a known element This function, if it works at all :), could be fed with a molecule string. If the function doesn't return None and thus recognizes the weight, it'll return the weight value, and the length (1 or 2) of the characters it read. You can then strip those characters from the front of the string, feed in the string again, and get the weight of the next character, until you read the string. Of course it doesn't work with '()' or numbers yet. > How will the program be > able to figure out how many atoms of each type are in a molecule like > (NH4)3PO4? Numbers first. You can adapt the previous function (better rewrite it anyway, it was just a bad first attempt :) so that it recognizes if digits are involved (string.digits). What it should do is that as soon as it encounters a digit, it scans if any digits follow. It'll compose a string of all digits read. It then should convert (with int(), let's say) this string to an actual amount. It should then somehow notify the calling function that it read a number, and the value of this number. Since the function doesn't support this I suggested rewriting. Better perhaps to do any weight calculations later anyway, and just return the elements read (not their weights), too. Parenthesis. You could do something like this: * If you read a '(' parenthesis, add create a new empty list of elements, and add this to the list of elements read. * Do this whenever you see another '(' (a nested '('). So you might get a list nested in a list nested in a list, if you have a lot of ((())) stuff. * Until you read a ')' parenthesis, add any read elements to the current list (or their mass). If you read numbers, of course do the right multiplications, or simply add as many elements to the current list as the number indicates. When you've read the string (and the string makes sense syntactically; doesn't contain unknown elements or weird parenthesis such as '(()'), you'll end up with a big master list of elements (or mass) that may contain sublists of a similar structure. Now you want to add the weight of it all: # untested! def add_everything(master_list, elements): sum = 0.0 for el in master_list: if el is types.ListType: # recursion; add everything in the sublist and add it to the master sum sum = sum + add_everything(el, elements) else: sum = sum + elements[el] return sum A whole long post. I hope I'm making sense somewhat and that it helps. :) Please let us all know! Regards, Martijn
|
https://mail.python.org/pipermail/tutor/1999-March/000080.html
|
CC-MAIN-2018-05
|
en
|
refinedweb
|
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017
Class View and Object Browser Icons
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Class View and Object Browser Icons.
Class View** and the Object Browser display icons that represent code entities, for example, namespaces, classes, functions, and variables. The following table illustrates and describes the icons.
The following signal icons apply to all the previous icons and indicate their accessibility.
Viewing the Structure of Code
Show:
|
https://msdn.microsoft.com/en-us/library/windows/apps/y47ychfe.aspx
|
CC-MAIN-2018-05
|
en
|
refinedweb
|
Content count384
Joined
Last visited
Community Reputation1531 Excellent
About BaneTrapper
- RankMember
Personal Information
- InterestsDesign
Programming
Trying to make me first game,any advice appreciated
BaneTrapper replied to sergejC's topic in For BeginnersIf you put your mind to it, figure out things you don't know, and grind it out. Yes you will succeed There are many aspects to a story, therefore there isn't one liner that will answer that question. Short version: git gud. Longer version: From personal experience, its imagination, and iteration on written story, that really polishes it to be "Interesting" and "good". I will quote Shia Labeouf "JUST DO IT!", and you will get better at it. At times you get stuck, figure it out, and continue. But most important thing of all is, think small for first few projects, finish the project you started! You might want to train your skills first, by making a simplistic levels, to get hang of it, before you do it in bigger project. Same goes for everything, you might want to make standalone puzzles first in Unity, before making a game with puzzles in it, because it might be overwhelming, and give you feeling of NEVER GETTING THINGS DONE. Hope i helped a bit. Bane
Looking to join c++ project-s.
BaneTrapper replied to BaneTrapper's topic in Hobby Project ClassifiedsWot i was just scrolling and downwoted cause i pressed "Page down" key :o. I added mark for payment in "Edit 2:" section in first post.
Looking to join c++ project-s.
BaneTrapper posted a topic in Hobby Project ClassifiedsHello, call me BaneTrapper. Since start of year 2014 to mid 2016 i have programmed using c++ language making various projects. I have started learning c++ early 2012 using tutorials, and watching videos of other programmers tackle their projects, that's how i grew my knowledge. What i want: I am looking to spend my time, and improve my coding knowledge, but most importantly i want to learn from other coders, studding their code, and communicating. What i am willing to learn stretches from basic things like scripting languages, creating ports of applications, your tricks on data management, creation of custom engines for games (Dealing with hardware), basically anything worth knowing. What em i good at? I am versatile coding in c++ language, i can to some extent optimize code for performance i understand a bit of how compilers generate code, i have watched plenty of talk's on code/performance optimization so i have good understanding of do's and don'ts. Like everyone i have created more bugs in code then i can recall, but i have to my best knowledge fixed every single one i have made or at least figured out how to fix, yes there where some that took months to figure out simply because they didn't occur so often, or i didn't posses knowledge to fix them. I know a math, its not algebra math, but i do vectors, and understand sin/cos. I have dabbled, and wrote few algorithms from need which i later figured out actually have names, so i'm inventor too :o . Video of 2D, rpg game i have coded all by my self(Note: There was another programmer but he worked on adding lua to the project, so we would port from my created scripting language to lua, which i still don't agree would be a good choice, but for collaboration purpose i agreed) A bit on the image what you we can see: The screenshot is from the game Editor, we can see navigation mesh, and regions mesh which are for even triggers, there are objects which most of them have interactivity implemented(opening doors, lighting candles on fire, and extinguishing, picking berries from bushes, collecting flowers), then there's button's which act as switches for state machine so one switch from editing terrain, to editing attributes of objects etc. My time restrictment: I would offer my hard work, and my limited knowledge for MORE knowledge. Yes it's that simple! Which would evaluate to 2 hours when i work, and full day when i got free days.(Add there i got chores to take off ya know... i am a living organism, but no doubt i get 8 hours in) Edit: I forgot to add contacts :P BaneTrapperDev@gmail.com or BaneTrapperDev@hotmail.com, or you can pm me. Edit 2: About payment: I don't require payment, or desire one. I am financially set with my job, that is why i cannot offer more hours then written above. But if you share split, sure i'l take my cut.
[Team][Looking for 3D artists & level designers] Isometric RPG
BaneTrapper replied to Red River Digital's topic in Hobby Project ClassifiedsIt might help to post anything of game(Screenshots, concept art, piece of story anything rly), so possible applicant can know what hes getting intro, whats the art style ETC. GoodLuck! :cool:
C++ Programmer Needed (Diablo 2 style Open Realm)
BaneTrapper replied to Tkodo's topic in Hobby Project ClassifiedsFirst thing, i clicked on link . There are literally boobs in center of screen, could write NSFW :P. Tho this sounds quite interesting, although a bit scary since i cannot find ANY gameplay of the game. 1: Skills, and spells are same thing differently worded, do you require mechanics to the skill (Code to orbit orbs around a character / point), GUI, or storage/cooldowns/mana usage? 2: Do you want to revamp / rework the combat system? 3: You want to rewrite the graphics code / engine, to newer version? 4: "finish the external overlay", do you need GUI? 5: "create a all In 1 camera system", Sounds like code spaghetti :D, or is it? . 6: Crafting system? sure. Is there inventory, and items to work with? 7: "add the demon grading system", you want skills again? differently named? 8: You want to re adapt audio to new format? What are you using that it doesn't support .mp3? but supports .wav? 9: add a gameplay map. You want environment artist / creator? Sounds like you need half of a game here :huh: But as you said "Never stop". Hoping to get answers, and please is there any gameplay/sneak peak of the actual game what's there? Till then, BT.
All Jokes aside, what is 6/2(1+2)?
BaneTrapper replied to Tutorial Doctor's topic in GDNet LoungeGot rekt so hard, i blame that i am tired
Issues with IDE Linker? Why is this happening, and how do i fix it?
BaneTrapper replied to BaneTrapper's topic in For BeginnersBut isn't #pragma once MSVC only? is it crossplatform?, if not. That's why i use #include/
Issues with IDE Linker? Why is this happening, and how do i fix it?
BaneTrapper replied to BaneTrapper's topic in For BeginnersOh god, i forgot to update, i fixed it. Header guard had name conflict... And yes, thank you for help. I decided to find issue my self, and i forgot about this post. I Was stuck for some time, and i was getting nowhere so i felt supper down. I really appreciate your help!
Issues with IDE Linker? Why is this happening, and how do i fix it?
BaneTrapper posted a topic in For BeginnersHello, recently i separated one file intro multyple, now i am having compiler complain some of classes having unknown variables. //The function int Object::GetAttackDamage() { int damage = 0; if (inventory != NULL) { BaseItem * equWep = unit->GetEquipedWeapon(); if (equWep != NULL) { damage += equWep->wepDamage; } } if(unit) damage += unit->attackDamage; return damage; } //The error C:/Prog/Code/src/Objects.cpp:155:22: error: 'class BaseItem' has no member named 'wepDamage' damage += equWep->wepDamage; I can confirm that Objects.cpp includes Inventory.h which includes BaseItem.h Which has class BaseItem which inherites BaseItemWeapon which has this member, its publicly inherited so its visible. I don't know whats happening, or what have i done wrong Here are raw cut outs of data from project, its clearly visible it is correct AFAIK. What are common issues, and how would i go solving this issue? I have no clue what to do...
A list of commands for units in 2D RPG, a way to handle it.
BaneTrapper replied to BaneTrapper's topic in For BeginnersI accidentally clicked away pressed backspace and lost about 30minutes of text(20 lines) :| so here we go again... For some reason the written text was not saved when i got back in I will shorten it up. I have thoroughly read your opinions, and i have even added a check for actions as you have, i stated i would be posting my code later on . At the time i was making first post i was going with templates, and variadic template for the list. It wasn't working at all. As a matter of fact, the way i am doing it is very similar to yours ApochPiQ, i would go as far to say the idea is exactly the same, i just implemented it in a different way, its implemented in a way to suit my code design that is already in place so i don't rework it all. Yep. One way of implementing such a "nested order queue" (in principle only, because it were not really a queue) with break points and alternatives and prioritization of what to do and ... already build-in is the behavior tree (just to throw in this term ;) ) It is okay if this is your goal, and/or if the game is a, say, personal study on the way to evolve. But in the end I'm seconding ApochePiQ, in both roles as a developer as well as a player. An NPC that is not able to react on world state changes is what is looking really stupid. If a NPC follows a once planned action list stubbornly without the ability to break and restart elsewhere, then noticeable chances are that the NPC gets stuck somewhere and try forever, and a player observing the NPC simply shakes the head. You have to answer the question how probable that is and how much the game will suffer if it occurs. Worst case, of course, is that the game will be unplayable. With this in mind, having a game finished is not to be judged on the criterion of superficially seen code completeness, but also on its usability as a game. I have added a check system for actions, it will handle those cases if unit got stuck intro a corner of house and surrounded by objects, by asshole player. It will get it self out. If it has to destroy the objects player placed, then it can. Its handling cases like those when unit is pathing, and there is no path to the end position. It can modify the world in order to get there. If it means start hacking away at a big mountain so be it! although to prevent stupid cases like that i got a road system, and units while traveling from location to location will stick to the road. If even the road got blocked by a troll played that put allot of boxes on the road to block it. Unit would try to find path using pathfinding from last path node to next one, and last node to the final one. If it still failed, well then its the mountain hacking scenario. But for a person doing AI first time, its a hard task getting AI to even work, making it smart is very complex, but doable.
A list of commands for units in 2D RPG, a way to handle it.
BaneTrapper replied to BaneTrapper's topic in For BeginnersHello to you too Henry. What i am doing is AI for units, at time of postings units knew how to do tasks(move to location, attack, idle, check if enemy radius...) The engine handles units data, and reacts accordingly, if unit flag for movement is set to move on given path, it will read from units path list, and lead unit on the path until the path list is done. What i wanted for units to have is memory of their actions, here is a example why: Unit is assigned a path, and is walking on it. If unit spots a enemy in sight radius it will decide, should it run, or fight the spotted enemy, now i can set flags for movement to walk to enemy, or run away from the enemy, but in process i lost the path unit was walking before. That was my problem i was trying to solve, i decided unit needs a action list. With action list, if unit was walking a path, and spotted a enemy. It would push a new action on top of the stack, thus remembering its previous actions, while allowing new ones to execute. Now in the first post i really did try hard to simplify it, i am doing it right now, when unit spots a enemy unit allot of actions are set, but i was very simple(stating it would only push one action) for sake of understanding. I started this project with little design, and on top of all i am actually self learned, and read no books on programming or design. I get stuff to work, and that is what i want to achieve. But i do watch lots of educational videos on programming in general, and reading lots of topics to keep up to date with the programming world. The way you designed code, i attempted it when i was starting project, but it just didn't fit, the way i am doing it right now is easier for me, and also is less coding from what i notice, that is my opinion. I suffer from lack of knowledge to explain, and additionally inexperience. How i handle the "go to the nearest quest giver and get a quest and then try to beat the quest" is: I first call a function getPathToUnit(position_start, unit_ID); From unit id i track position all time because the unit will reposition in most cases. The function handles the path generation. Lets start_pos unit is in tavern in town One, and unit_ID unit position is in its House in town Two. The action list ends up looking something like this: setMoveToEntranceOfBuilding() setMoveToEntranceOfTown() setMoveTravelToTown_name(Town_Name) setMoveToTarget(Unit_ID) initateDialogWith(Unit_ID) getQuestFrom(Unit_ID) But if unit was next to the target the list would look approximately to setMoveToTarget_Until_In_Radius(Unit_ID, Dialog_Radius) initateDialogWith(Unit_ID) getQuestFrom(Unit_ID) So that is not a one call, because that would be a real nightmare to make. Possible, but unnecessary work, because that big function can be cut up intro many small ones, and they can be reused. I have made a prototype, and i am happy enough to go with it, i want to finish the game. Or at least make the AI be smarter then a empty box. I will be posting full code when i'm done with prototype, to show how iv'e done it.
How to actually learn game development?
BaneTrapper replied to Austin Whitelaw's topic in For Beginners4:Eventually join a team, having teachers or teammates is so beneficial! having somebody to work with. I'm extremely hesitant to agree with that. I have severe confidence issues because the teachers, teammates, and other programmers I worked with treated me like my knowledge and mental capacity was one step above that of a rock. I would stress extreme caution when seeking to join them. I have experienced the same thing, but be intelligent about it. I was also told i am dumb as rock, i could not remember a dam thing when they told me, they tell me something i forget it 5 seconds later. They where not wrong, they where just assholes when they told me. I figured out that i had an issue, i fixed it, i trained, and i still train. I now remember allot better then when i was young, and i can focus very well, but they are still assholes. So i got 1 point from those people, i was hurt, and i still am, but i respect what they did even if they are not aware of it, because i am. They helped me, and for that i am grateful.
A list of commands for units in 2D RPG, a way to handle it.
BaneTrapper posted a topic in For BeginnersHello. So i am up to this seemingly tough problem, i would like some opinions, and thoughts on how to solve it, or deal with it in a good(Efficient) way. I have 2D Rpg, where AI can do specific tasks, but i cannot tell it to do a list of them. For example: I want to do this: Give unit a order: Go talk to quest_giver_person, receive quest, and finish it. That would be something like this code vise: / let this execute, we start from 0: this would make the unit generate a path to the given target so the list of commands would look like We also, regenerate the path every so often, so we actually get to the target if he repositioned. //Unit* unit; //TheList-> 0: unit->moveUntilPathFinished();//Follows generated path, handles exceptions like collision that shouldn't occur, but gets you to target location in the end 1: unit->moveToTargetUntilInRadius(quest_giver_person.position, glob::COMMUNICATION_RADIUS);//To be very simple, this gets you to target until you are in radius given 2: unit->getQuestFrom(quest_giver_person);//AI Logic handles this, and gets quest Now 0 command finished, it gets erased and we continue / are in quest_giver_person radius so 0 also gets errased so we get left with //Unit* unit; //TheList-> 1: unit->getQuestFrom(quest_giver_person);//AI Logic handles this, and gets quest This would generate a new list of stuff for the AI to do. I hope this explains the principle of what i am trying to achieve. I will be active if you have questions, or if i missed some crucial data, i will supply it asap! How the unit is structured, and some functions that would be used in this example: int main() { } int a = 1; double d = 2;//REGISTER THIS AS C++ SNYTAX PLS! //Unit.h namespace uni { enum MovementType { MTNone = 0, MTPath = 2, MTKeysButton = 3, MTPatrol = 4 }; }; class UnitMovement { public: uni::MovementType moveType; glob::Direction movDirectionX; glob::Direction movDirectionY; bool isMoving; double moveSpeed; std::vector<sf::Vector2f> listPath; int moveTargetVecID;//Target vecID to follow glob::Direction facingDirection; int patrolVecID;//This is ID, that indicates to which note in listPath to move to int patrolIncrementValue;//This is to know if moving forward on path or backwards unsigned int patrolAmountOfTimes; UnitMovement(double MoveSpeed); UnitMovement(double MoveSpeed, const std::vector<sf::Vector2f> & ListPath); void setMoveToLocation(Object & me, const sf::Vector2f & position); void setMoveToLocationSmart(Object & me, const sf::Vector2f & position);//Uses AStar void setAllMovementToHalt(); void setPatrolToLocation(Object & me, const sf::Vector2f & position, unsigned int TimesToPatrol = glob::MaxUI); void setPatrolPath(Object & me, std::vector<sf::Vector2f> & listPath, unsigned int TimesToPatrol = glob::MaxUI); void AssignFollowTarget(Object & obj); void SetFacingDirection(glob::Direction dir, Object & me); }; class Unit : public UnitMovement, public UnitBattle ... { public: LoopUnit();//Loops unit specific stuff like movement, following paths, and executes it on the unit effectively causing un //it to reposition, and calls LoopUnitAI() LoopUnitAI();//Loops unit AI specific stuff if unit controller is AI }; //Object.h class Object { public: std::unique_ptr<Unit> unit; }; class ObjectHolder { public: std::vector<Object> listObject; LoopObjects();//Handles objects logic, and calls LoopUnit() }; I gave it a though with teammate, and the result is pretty poor, it will work but i don't like that: How it would work is: Have a function that would take action, and be able to tell unit what to do with the action. For example: int a = 0;//C++ syntax PLS! enum Command { none = 0, moveToTargetUntilInRadius = 1, getQuestFrom = 2 //... }; class Action { Command commandType; //Whatever std::bind requires to be stored Action(Command CommandType, whatever_std::bind_requires); } //Will probably use std::list for the final product, but i haven't used list in ages so i'l use vector in this example std::vector<Action> listActions;//This would be the list that unit has //This is how it would add stuff to the list listActions.push_back(Action(Command::moveToTargetUntilInRadius, std::bind(target_unit->objVectorID))); And this should work, i need to prototype it first, but its idea we came up with.
Returning a nullptr refence, how bad is my teammate?
BaneTrapper replied to BaneTrapper's topic in Coding HorrorsI never meant it as an insult, i just couldn't force him to change it . I expect references to be valid, if he cannot ensure it, return a pointer. After a laugh he did a quick fix , thx on the opinions. EDIT:: The compiler gave a warning, he though its okay.
Returning a nullptr refence, how bad is my teammate?
BaneTrapper posted a topic in Coding HorrorsDoes anyone find this code being very bad? Can you rate this from 0 to 10. I am very interested what is your opinion on returning a reference that is nullptr. const std::string &SoundHandler::getPlayingFromPlaylist(const std::string& playlistName) { //Check to see if the playlist exists auto iter = playlists.find(playlistName); if(iter == playlists.end()) return nullptr; return playlists[playlistName].currentlyPlaying; }
|
https://www.gamedev.net/profile/200465-banetrapper/?tab=smrep
|
CC-MAIN-2018-05
|
en
|
refinedweb
|
.masterfs;21 22 import java.io.File ;23 import java.util.Collection ;24 import org.netbeans.api.queries.SharabilityQuery;25 import org.netbeans.spi.queries.SharabilityQueryImplementation;26 import org.netbeans.spi.queries.VisibilityQueryImplementation;27 import org.openide.util.Lookup;28 29 /**30 * Provides implementation of <code>SharabilityQueryImplementation</code> that31 * is tightly coupled with <code>GlobalVisibilityQueryImpl</code> which is based on regular32 * expression provided by users via property in IDESettings with property name 33 * IDESettings.PROP_IGNORED_FILES in Tools/Options. 34 *35 * Invisible files are considered as not shared. 36 *37 * @author Radek Matous38 */39 public class GlobalSharabilityQueryImpl implements SharabilityQueryImplementation {40 private GlobalVisibilityQueryImpl visibilityQuery;41 /** Creates a new instance of GlobalSharabilityQueryImpl */42 public GlobalSharabilityQueryImpl() {43 }44 45 public int getSharability(final File file) {46 if (visibilityQuery == null) {47 Lookup.Result result = Lookup.getDefault().lookup(new Lookup.Template(VisibilityQueryImplementation.class));48 Collection allInstance = result.allInstances();49 assert allInstance.contains(GlobalVisibilityQueryImpl.INSTANCE);50 visibilityQuery = GlobalVisibilityQueryImpl.INSTANCE;51 }52 return (visibilityQuery.isVisible(file.getName())) ? SharabilityQuery.UNKNOWN : SharabilityQuery.NOT_SHARABLE;53 } 54 }55
Java API By Example, From Geeks To Geeks. | Our Blog | Conditions of Use | About Us_ |
|
http://kickjava.com/src/org/netbeans/modules/masterfs/GlobalSharabilityQueryImpl.java.htm
|
CC-MAIN-2018-05
|
en
|
refinedweb
|
BizTalk Property Schemas in Different Namespaces
In BizTalk 2006 R2, I have noticed that sometimes the promoted property fields are not available. This seemed to be a random occurance so I decided to spend a little time investigating.
Problem Scenario:
The property schema field will not show up in a Receive Shape filter. No matter how many times you build, rebuild, and close the solution it will not show up. Just for kicks, I set the property schema field to “MessageContextPropertyBase” (the default is MessageDataPropertyBase). I then built the project and sure enough the property field now shows up. Good right? Wrong – This type is only used for property fields that are promoted that are NOT included in your message. For example, if you had a custom pipeline that promoted a property not included in the message schema. The MessageDataPropertyBase should be used for fields included in the message.
Ok, so I started looking into this further and decided to open up an orchestration that was working with the Receive Shape filter. The property field used as the filter was in the same namespace as my orchestration’s message schema. The previous test that did not work used a message that was in a different BizTalk project than the property schema.
Cause:
A property schema used in a different BizTalk project will not be available in Receive Shape filters. This also applies to intellisense used in the expression shapes. I am not sure if this a BizTalk bug or Microsoft intended this design. It seems like a proper design to have one common property schema for the solution where fields are available across projects.
Resolution:
Create a property schema in each BizTalk schema project.
Hope this helps in your future development where the promoted property field is not available.
I had a similar situation. I have reusable property schemas in one project that needed to be used in a number of other projects. Although normally MessageDataPropertyBase is used to promote fields included in the message, MessageContextPropertyBase will work just fine – your field will be properly promoted in the pipeline by XLM Disassembler AND the property will be available in the orchestration (just add reference to property schema project).
|
https://blog.tallan.com/2010/04/15/biztalk-property-schemas-in-different-namespaces/
|
CC-MAIN-2018-05
|
en
|
refinedweb
|
TS2339: Property 'slider' does not exist on type 'JQuery<HTMLElement>'
I'm using the bootstrap-select
I have successfully imported
bootstrap-select into my project using:
<!-- Latest compiled and minified CSS --> <link rel="stylesheet" href=""> <!-- Latest compiled and minified JavaScript --> <script src=""></script> <!-- (Optional) Latest compiled and minified JavaScript translation files --> <script src="-*.min.js"></script>
within the document
<head> tag. I want to see how to modify the checkmarks within the multiple select boxes, and figured I would try to use the
$('.selectpicker').selectpicker('deselectAll');
Method as shown here. Whenever I attempt to use that bit of code, I receive an error:
TS2339: Property 'selectpicker' does not exist on type 'JQuery<HTMLElement>'.
I have even tried installing the types definition using
npm install --save-dev @types/bootstrap-select
But the issue still remains. I'm using the Visual Studio SPA template which uses ASP.NET Core template, Vue.js and Webpack.?
- How to enable jQuery plugin in VisualStudio using Typescript
I have ASP Net Web Application in which I use Typescript and Knockout for frontend. I would like to enable Notify.Js plugin.
Here's what I've achieved so far:
Added nugget package DefinitelyTyped NotifyJs
Added Notify.js and Notify.min.js files in /Scripts
Added references for those two files in _references.js
Imported notify.js in main-config.ts:
paths: { ..., "jquery-notify": "notify.min", ... } shim: { ..., "jquery-notify": { "deps": ["jquery"] }, ... } require([..., "jquery-notify"], )
When I open any .ts file, intellisense does find a namespace NotifyJS, which is in notify.js.d.ts file, but it doesn't allow me to use any functions from notify.js $.notify("") returns an error:
(TS) Property 'notify' does not exist on type 'JQueryStatic'.
I also tried naming it just "notify" instead of "jquery-notify", neither works.
- Not able download in IE
I created a chart in d3. According to my requirement, i have to download as png from all browser. am using saveSvgAsPng.js for that.
code
saveSvgAsPng(document.getElementById("sample"), "sample.png", { width: '50%' });
I am able to download in Chrome and firefox, but not able to download in IE.
On checking Console, am getting below errors
Unknown font format for; Fonts may not be working correctly
Rendered SVG images cannot be downloaded in this browser.
Need help, do no i missed any parameter to pass in option.
Thanks in advance
- Typescript convert object to Array
Trying to convert Javascript Object
const xyz = { 'fName': {type: 'string'}, 'mName': {type: 'string'}, 'lName': {type: 'string'} };
To
const arr = [ {'fName': {type: 'string'}}, {'mName': {type: 'string'}}, {'lName': {type: 'string'}} ]
It looks like some logic I'm missing today, tried online lot of blgs but didn't get anything(tough day).
Please someone tell me why I am not able to convert.
- 'Unexpected token export' when using gulp / webpackstream / vue
I am trying to use vue's template compiler in my project via gulp and webpack-stream. The set up is something like this:
gulp.task('js', function () { return gulp.src('./src/js/main.js') .pipe(webpackStream( module.exports = { output : { filename: 'bundle.js' }, resolve : { alias: { "vue$": "vue/dist/vue.esm.js", // bind to modules; modules: path.join(__dirname, "../node_modules") } } } )) .on('error', function handleError() { this.emit('end'); // Recover from errors }) .pipe(gulp.dest('./js/')); });
the error message is this:
Uncaught SyntaxError: Unexpected token export
which is being caused by this:
export default Vue$3;
-
- webpack-dev-server and webpack -> output file to parent directory and have webpack-dev-server hot reloading still working
We have the following structure in our web application:
/src(.sln) --/ClientSite --/AdminSite --/SharedWeb
In
SharedWebwe have the following folders:
--/Client --/Admin --/Shared
We have this structure in order to have hot reloading with
webpack-dev-serverno matter what file we edit and only have one
package.jsonetc. Thread about why we choose this structure if anyone is interested:
Shared react front end components -> Separate project with TypeScript -> Visual Studio 2017
Everything has worked fine so far but now that we need to deploy our solution we need to export the
bundle.jsto the correct site.
In
webpack.client.config.js:
Works fine with hot reloading but script file is not exported to the site correctly:
output: { filename: "./Scripts/dist/[name].bundle.js", },
Script file is exported correctly but hot reloading stops working:
output: { filename: "../ClientSite/Scripts/dist/[name].bundle.js", },
Correct way with using path and filename according to documentation, nothing works:
output: { path: path.resolve(__dirname, "Scripts/dist/"), filename: "[name].bundle.js" }
Script file is exported correctly but hot reloading does not work. If I use
webpackwith
--watchand manually reload
webpack-dev-serverURL I can see the changes but it does not reload automatically.
output: { path: path.resolve(__dirname, "../ClientSite/Scripts/dist/"), filename: "[name].bundle.js" },
- Ruby on Rails / dropdown menu issue / begginner
I'm making my first RoR app with this tutorial:, and I have a problem with dropdown menu. It should look like on 45:03. When I click on "Categories" I don't see the content. Nothing happens on the website, I see just additional "#" after the local host:3000 (I mean:). Can you guys help me with solving this problem? I'm pretty sure I followed the instructions properly, checked it a few times.
- Navbar (un)collapsed (un)hide header
So, I am using bootstrap for my navbar. Thats all easy and simple and I have that implemented.
Since I have a header on top of my Navbar, I decided to put them both inside the same
row divand give each a
col-md-12so they would align. I then did
@media only screen and (max-width: 500px) { #titleRe { width: 75%; } #navRe { width: 25%; padding-top: 1.5rem; } }
and it looks like this navbar uncollapsed. As you can imagine, collapsed, it looks amazing and they are side to side, but when uncollapsed I can't view the navbar properly (for the obvious reasons).
My question is: How can I make the Header disappear when I open the navbar, and make the navbar centred?
Thanks
- How to trigger validation bubble
I have a starting form that has a bootstrap 4 form group input button (input with associated button). I am using simple Jquery validation to prompt the user to enter a valid studentid. If a user hits the enter key while the input has focus there is an HTML 5 validation bubble that pops up "Please fill out this field". I am trying (for consistency) to get the button to produce the same behavior. I have tried creating a jquery event and simulating a click event, and several other approaches... Anyone have an idea how to accomplish this?
<form id="student-search-form" name="student-search-form" onsubmit="authorizeuser()" class="was-validated" autocomplete="off" autocompletetype="none"> <div class="input-group input-group-sm"> <input id="searchid" name="searchid" type="text" class="form-control" placeholder="Student ID" aria- <button id="go" class="btn btn-success rounded-right" type="button" onclick="triggerenter()">Go!</button> </span> <div class="invalid-feedback ml-1">Please provide a valid StudentID</div> </div> </form>
- Have data-live-search interpret the same as normal space ( )
I am using data-live-search with bootstrap-select and am running into a problem where the blank spaces used in my options are not interpreted the same as a normal space. I would like to have replaced by a normal blank space. Was wondering if there is any easy way to fix this? Here is a JSFiddle of the problem. Code is below as well (per SO rules).
<body> <div class="container" style="width: auto;"> <select class="selectpicker" title='Choose one of the following...' data- <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> </div> </body>
- Angular - Updating Selectpicker options with web service results
For some reason, refreshing a selectpicker element inside a subscribe method doesn't work for me. I'm calling refresh outside of the subscribe method (in order to disable the selectpicker while data is being loaded), but when I try to refresh it after I update the options, it doesn't seem to work. Here's the relevant code:
My HTML:
<div class="form-group col-md-2 pull-right"> <label for="city">City</label> <select [disabled]="!properties.get('city').enabled" [(ngModel)]="properties.get('city').value" name="city" id="city" class="form-control selectpicker" data- <option dropdownAlignRight="true" [ngValue]="">{{properties.get('city').spaceholder}}</option> <option dropdownAlignRight="true" *{{option.text}}</option> </select> </div> <div class="form-group col-md-2 pull-right"> <label for="street">Street</label> <select [disabled]="!properties.get('street').enabled" [(ngModel)]="properties.get('street').value" name="street" id="street" class="form-control selectpicker" data- <option dropdownAlignRight="true" [ngValue]="">{{properties.get('street').spaceholder}}</option> <ng-container * <option dropdownAlignRight="true" [ngValue]="option.id">{{option.text}}</option> </ng-container> </select> </div>
Withing ngAfterViewInit, I'm declaring that "street" should be updated when "city" is being selected:
$('#city').on('hidden.bs.select', function (event, clickedIndex, newValue, oldValue) { var url = GLOBALS.getStreetsByCityIdUrl(that.properties.get('city').value); that.updateDependentPicklist(url, 'street'); });
And this is how I'm subscribing to the web service, in order to fetch the data:
updateDependentPicklist(picklistUrl, propertyId){ var that = this; that.properties.get(propertyId).options = null; that.properties.get(propertyId).enabled = false; that.properties.get(propertyId).spaceholder = 'Loading Options...'; /* * This one works! * Streets "Empty option" changes to Loading Options... and gets disabled */ that.refreshSelectpicker(propertyId); this.webService.createGetService(picklistUrl) .subscribe( result => { if (result.coll && result.coll.length > 0){ var resultCollection = result.coll; var optionsArr : [{id : string, text : string}] = [{id : null, text : null}]; for (let i in resultCollection) { if (resultCollection.hasOwnProperty(i)) { var option = resultCollection[i]; optionsArr.push({id : option['Id'], text : option['Name']}); } } optionsArr.splice(0, 1); that.properties.get(propertyId).options = optionsArr; that.properties.get(propertyId).enabled = true; that.properties.get(propertyId).spaceholder = 'Choose...'; //Nothing happens here... that.refreshSelectpicker(propertyId); } else { that.properties.get(propertyId).spaceholder = 'Nothing Found'; that.properties.get(propertyId).enabled = false; //Nothing happens here... that.refreshSelectpicker(propertyId); } }, error => { that.properties.get(propertyId).spaceholder = 'Error'; that.properties.get(propertyId).enabled = false; //Nothing happens here... that.refreshSelectpicker(propertyId); } ) } refreshSelectpicker(id){ setTimeout(() => { $("#"+id).selectpicker("refresh"); }, 50) }
Thanks!
|
http://quabr.com/48215786/ts2339-property-slider-does-not-exist-on-type-jqueryhtmlelement
|
CC-MAIN-2018-05
|
en
|
refinedweb
|
US9390055B2 - Systems, methods and devices for integrating end-host and network resources in distributed memory - Google PatentsSystems, methods and devices for integrating end-host and network resources in distributed memory Download PDF
Info
- Publication number
- US9390055B2US9390055B2 US13890850 US201313890850A US9390055B2 US 9390055 B2 US9390055 B2 US 9390055B2 US 13890850 US13890850 US 13890850 US 201313890850 A US201313890850 A US 201313890850A US 9390055 B2 US9390055 B2 US 9390055B2
- Authority
- US
- Grant status
- Grant
- Patent type
-
- Prior art keywords
- data
- address
- network
- memory
-/17331—Distributed shared memory [DSM], e.g. remote direct memory access [RD06F17/30203—Details of providing network file services by network file servers, e.g. by using NFS, CIF
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements or network protocols for addressing or naming
- H04L61/60—Details
- H04L61/6086—Details involving dual-stack hosts, e.g. in internet protocol version 4 [IPv4]/ internet protocol version 6 [IPv6] networks
Abstract
Description.
The present invention relates to systems, methods and devices for integrating end-host and network resources in the design of a low-latency persistent distributed memory.
Enterprise storage systems are expected to keep data safe, and allow it to be accessed with excellent performance characteristics. This is a well explored problem space, and today many large corporations make their business out of selling hardware that stores data. Despite the relatively established nature of storage technology, remarkably fewer approaches have been explored in the design of storage systems.
Data storage in network environments has traditionally been designed in one of two ways: the dominant approach is to have a single, shared server (often called a target or array) that houses a bunch of persistent memory (disks or flash) and presents it over a network connection using a protocol such as NFS or iSCSI. A secondary, and less popular, approach is called “distributed storage” (or sometimes “clustered storage”) in which many network connected devices collaborate to provide storage functionality.
The centralized approach used in the first class is appealing because it is easier to build and reason about, however, it also suffers from challenges in achieving very high performance because a single device must scale to handle a very high rate of requests.
The second approach has potential benefits in terms of both performance and cost: many lower-cost storage targets may federate to provide a higher aggregate level of performance than can be achieved on a single server. Unfortunately, distributed storage presents problems in multiple areas. A large class of problems in distributed storage is that system-wide state (such as where the current and correct version of a piece of data is located) and system-wide decisions (such as whether a device has failed and how to recover) end up being distributed and involve a great deal of complexity of design and implementation in order to match the functionality of a centralized solution.
By and large, the design of enterprise storage is treated much like the design of any other software server: A piece of software is written to handle read and write requests, and this software is deployed on one or more end hosts. In some cases, these end hosts are actually sold, as a package, including the storage server software. Three common approaches to this design are summarized as belonging to Monolithic Storage Devices, Clustered or Parallel File and Storage Systems, and Peer-to-Peer or Overlay Network-based Storage.
Monolithic storage devices, often known as “Filers” (in the case of file-level protocols such as CIFS and NFS), “Arrays” (in the case of block level protocols such as iSCSI or Fiber Channel), or more generally as “Storage Targets”, are generally single physical devices that contain disks and computing capabilities, attach to an enterprise network, and store data. In this model a vendor tightly couples the storage server software with the specific hardware that it will be packaged on and sells the entire unit as a package. Popular examples here include NFS servers from Network Appliance, or arrays from EMC, HP, or IBM.
In clustered or parallel file and storage systems, the storage software is spread across many physical devices. Systems typically divide responsibility between a small, important number of very important hosts that handle control messages and requests for important, highly contended data, and a second class of servers that just store data. The first tier of servers is often referred to, in the case of clustered file systems, as metadata servers. Clustered systems may be packaged completely as software as is the case with systems such as Lustre, Glustre, CLVM, or the Google File System or as hardware, such as Panasas, Isilon, or iBricks.
Some more recent systems have explored peer-to-peer style storage, or overlay network-based storage, in which a collection of individual devices achieve some degree of self-organization by dividing a large virtual storage address space among themselves. These systems often use Distributed Hash Tables (DHTs) and the application of hash functions to either data or data addresses in order to distribute data over a large collection of hosts in order to achieve scalability. Examples of these systems include file systems such as Ceph, Corfu, and the Fast Array of Wimpy Nodes (FAWN) prototypes, which combine purpose-designed hardware and software.
These classifications are not meant to perfectly taxonomize storage systems, but rather to show that while a number of approaches have been taken to the construction of storage systems, they have all been implemented effectively as software server applications that may or may not include end server hardware. As such, these designs all hinge on the fact that logic in the end systems is where enterprise storage should be implemented. They are designed with the assumption that relatively simple and general purpose underlying networks (even storage specific networks such as fibre channel) are sufficient to build reliable, high-performance storage.
Although it is possible to construct a very high performance monolithic storage system with a great deal of bandwidth and fairly low latency, it is difficult for such a system to compete with the latency and bandwidth of local device buses on modern hardware, such as PCIe. In approaches described herein, resources may be provisioned on the host for the best possible performance, while still providing availability (location transparency, replication). Disclosed systems make efficient uses of resources that are already present (fast storage, switching, and host bandwidth, CPU) to provide a high-performance storage target at much lower cost than a dedicated monolithic appliance. Further, monolithic storage systems invariably add an unnecessary bottleneck to the design of networked storage systems. Where a single end system (the storage target) is required to serve request traffic from multiple clients, it must scale in performance in order to satisfy the demands of that request load. Scaling a single end system in this manner is challenging for a number of reasons, including (as only a few simple examples) both bandwidth of network connections to the collection of clients, bandwidth and latency of access to its local persistent storage devices, CPU and memory demands in order to process and issue individual request traffic.
Recent years have seen a fundamental set of changes to the technical capabilities of enterprise computing: In particular: (a) non-volatile memories, such as Flash-based technologies have become fast, inexpensive, and connected directly to individual computers over high-speed busses such as PCIe; (b) Server CPUs have become increasingly parallel, often possessing additional cores that may be dedicated to the management of specific devices such as network interfaces or disks, these core may directly manage a subset of PCIe devices on a system; (c) network switching hardware has become faster, more capable, and more extensible.
Projects such as OpenFlow, and Commercial products, including Arista Networks' Extensible Operating System (EOS) allow new, software-based functionality to be pushed onto the network forwarding path. All three of these factors characterize commodity hardware, and reflect trends that will increase in the years to come.
It is no longer sensible to think of storage architectures as systems that are implemented on end hosts at the other end of the network from the applications that consume them. It is also no longer sensible to consider high-performance storage as an application server that is implemented above a general-purpose network. These assumptions are common in virtually all storage systems that are designed and sold today, and do not reflect the realities of emerging hardware.
In distributed storage systems, it is assumed that all participants of the system are effectively independent, and may communicate with each other in arbitrary manners. As a result, in the event of a loss of connection to a small number of nodes, it is hard to disambiguate between the case where those nodes have all simultaneously failed, and the case where the network has become partitioned, leaving those nodes alive, but unable to communicate with the rest of the system. Similarly, a decision to move a piece of data stored on one node to reside on another typically requires that all nodes “agree” and that there is no cached state that might result in a node reading or writing a stale copy of that piece of data.
Known distributed memory systems access data over networks, and maintain some relationship between data addresses and network addresses. In NFS and SMB, for instance, a file is located at “server_address:/mount/point/file_name.ext”. Block-level protocols such as iSCSI use similar techniques. Some research systems, for instance the Chord DHT, FAWN, and Microsoft's Flat Datacenter Storage (FDS) use a hash function to map a data address onto a specific network host address. For example, a list of n hosts might be stored in a table, and then when accessing a specific piece of data, the host performing the access would calculate:
destination table index=hash_function(data address) modulo n
This methodology results in the hash function evenly, but semi-randomly, distributing load over the hosts in the table. In these cases, requests are still sent specifically to end hosts, leading to considerable complexity in activities such as (a) adding or removing hosts from the cluster, (b) responding to the failure of individual hosts, (c) moving specific pieces of data, for instance to rebalance load in the face of hot spots.
In known network switches, deciding where to send writes in order to distribute load in a distributed system has been challenging; techniques such as uniform hashing have been used to approximate load balancing. In all of these solutions, requests have to pass through a dumb switch which has no information relating to the distributed resources available to it and, moreover, complex logic to support routing, replication, and load-balancing becomes very difficult since the various memory resources must work in concert to some degree to understand where data is and how it has been treated by other memory resources in the distributed hosts.
Storage may be considered to be increasingly both expensive and underutilized. PCIe flash memories are available from numerous hardware vendors and range in random access performance from about 50K to about 1M Input/Output Operations per Second (“IOPS”). At 50K IOPS, a single flash device consumes 25W and has comparable random access performance to an aggregate of 250 15K enterprise-class SAS hard disks that consume 10 W each. In enterprise environments, the hardware cost and performance characteristics of these “Storage-Class Memories” associated with distributed environments may be problematic. Few applications produce sufficient continuous load as to entirely utilize a single device, and multiple devices must be combined to achieve redundancy. Unfortunately, the performance of these memories defies traditional “array” form factors, because, unlike spinning disks, even a single card is capable of saturating a 10 Gb network interface, and may require significant CPU resources to operate at that speed. While promising results have been achieved in aggregating a distributed set of nonvolatile memories into distributed data structures, these systems have focused on specific workloads and interfaces, such as KV stores or shared logs, and assumed a single global domain of trust. Enterprise environments have multiple tenants and require support for legacy storage protocols such as iSCSI and NFS. The problem presented by aspects of storage class memory may be considered similar to that experienced with enterprise servers: Server hardware was often idle, and environments hosted large numbers of inflexible, unchangeable OS and application stacks. Hardware virtualization decoupled the entire software stack from the hardware that it ran on, allowing existing applications to more densely share physical resources, while also enabling entirely new software systems to be deployed alongside incumbent application stacks. one aspect of the subject matter disclosed herein, there are provided A distributed memory device comprising a network component configured for network communication with one or more memory resources that store data and one or more consumer devices that use data, the network component comprising a switching device in operative communication with a mapping resource, wherein the mapping resource is configured to associate mappings between data addresses relating to data from a data object and information relating to one or more storage locations in the one or more memory resources associated with the data from the data object, wherein each data address has contained therein identification information for identifying the data from the data object associated with that data address; and the switching device is configured to route memory requests based on the mapping of the of the data address associated with said memory resource received from the mapping resource.
In some aspects, there are provided distributed memory systems for one or more data objects comprising a network component configured for network communication with one or more memory resources and one or more consumer devices, the network component comprising a switching device in operative communication with a mapping resource, wherein the mapping resource is configured to associate mappings between data addresses associated with data from a data object and information relating to a storage location, wherein each data address has contained therein identification information for identifying the data from the particular data object associated with that data address, and the switching device is configured to receive routing information from the mapping resource based on the mappings the one or more consumer devices are configured to generate the data addresses, encode identifying information related to data from a data object, and embed the encoded identifying information in data addresses; and the one or more memory resources are configured to store the data from one or more data objects in storage locations in accordance with the associations in the mapping resource.
In some aspects, there are provided methods for using and storing data objects across distributed memory resources over a network, the method comprising the steps:
generating a data address at a consumer device, the data address comprising at least a portion that contains encoded information that identifies a portion of data in one of the data objects;
sending memory requests relating to the portion of data over the network to a network component, wherein addressing information of the memory request comprises the data address;
receiving the memory request at the network component and checking to see if the data address has been mapped to information relating to a storage location in the distributed memory resources in a mapping resource that is communicatively coupled to the network component;
if the data address has been mapped to information relating to a storage location in the mapping resource, forwarding the memory request to that storage location mapped to the data address, else forwarding the memory request to the distributed memory resources in accordance with a routing methodology.
In some aspects of the instantly disclosed subject matter, all of the distributed hosts communicate using a shared network. Rather than treating the implementation of the system as a collection of addressable hosts each serving some subset of data, as in conventional distributed memory systems, aspects of the instantly disclosed system treat the system as a set of directly addressable data that uses existing network-based protocols, abstractions and infrastructure to map data directly on to network primitives. This permits the use of functionality on conventional network switches to coordinate responses to failure of hosts, data migration between hosts, and related challenges. Put simply, by putting data addressing functionality onto network protocols, the network itself can effectively centralize the challenging aspects of distributed storage at a single network component.
In aspects described herein, there are architectures and designs of storage systems that incorporate and integrate software on both end hosts (to manage locally attached storage, such as PCIe flash devices) and on network switches that permits the complex logic involved in storage implementations, such as where to store data and how to achieve redundancy, to be placed in the specific hardware components where that logic can most effectively be implemented and acted upon. In some aspects, end-hosts and network switches may not require software. For example, in some cases the subject matter described herein may leverage existing network infrastructure on switches by using pre-existing address forwarding protocols or by allowing end-hosts to handle requests according to pre-existing storage policies and protocols. In some aspects, software to implement the functionalities described herein may be required at some or all of the consumer devices, network component or storage resources.
The approach described in some disclosed aspects utilizes modified network interconnects (e.g. an Ethernet switch) that may be necessary in network storage systems. These are often a “choke point” in terms of both performance and failure management. Rather than adding an additional such point, as is the case in monolithic storage servers, instantly disclosed aspects utilize performance-sensitive logic for the processing, and forwarding of storage requests directly on the network data path at such a switch, and thus allow requests to be distributed across multiple end systems, each offering a relatively simple interface to accessing data on its local disks.
Whereas prior distributed systems approximate storage-specific request forwarding by implementing an overlay, or peer-to-peer architecture within software on the participating end systems, aspects disclosed herein provide lower latency and higher throughput by routing storage requests directly within the network (e.g. on the interconnect, on network interfaces in end systems, or otherwise) to whichever host can best satisfy the request (according to metrics such as response latency, power consumption, data availability, etc.). For example, low latency and high-throughput storage is achieved in aspects of the instantly disclosed subject matter by directly monitoring each host's request queue rather than randomly distributing writes or using old information that may handle bursty traffic poorly.
Approaches described herein in some aspects relate to the use of distributed shared memory and specifically that a network-based approach can be used to address data across all memory storage locations and that the unification of that addressing can be used to manage the placement of data over time, responding to performance and failure concerns as they arise.
Aspects of the instantly disclosed subject matter may be utilized to build a scalable storage system. Rather than building distributed memory resources in a manner that has generally been achieved with storage arrays in the past, where a computer system manages a large number of connected disks over an internal device bus, aspects of the instantly disclosed subject matter use commodity network technologies (e.g. Ethernet) as an interconnect, and thus allows the system to be extended by adding additional nodes on the network.
In general, aspects of the subject matter disclosed herein attempt to strike a balance between two opposing realities: First, in order to capitalize on device performance, clients (i.e. consumer devices) should have access to network attached storage devices (i.e. memory resources) and the freedom to deploy application-specific distributed storage stacks on top of them. Second, it is desirable for memory resources to be shared, in an isolated manner, between multiple concurrent consumer devices within the datacenter environment. The approach used in prior storage system designs is to first aggregate a collection of devices into a single, unified addressable structure and then treating the problem of subdividing and specializing this aggregate as a higher-layer problem. To balance these two, aspects described herein utilize resource partitioning techniques that have been used in operating system and virtual design, particularly for the management of CPU and memory resources: Given a set of network-attached storage devices that is to be shared concurrently by multiple independent clients, we begin with device-level interfaces to achieve per-client isolation, and then tackle the systems problems of building useful aggregate storage systems above this on a per-tenant basis.
Some aspects described herein utilize some or all of the following three concepts:
- (1) They may export sparse address spaces on network attached storage devices as a basis for establishing controlled sharing. Virtualizating the storage address space at the device itself allows multiple clients to each have the illusion of their own isolated “slice” of each storage device and allows them to issue requests directly, rather than through an intermediary. It also provides an appropriate point to incorporate hardware-level virtualization support (e.g., object-level SSD APIs, NIC multiqueue, and SR-IOV) and network isolation techniques like VLANs or OpenFlow rules to map clients to specific, isolated storage resources;
- (2) They implement the storage data path as a set of efficient, stackable address translation layers that are decoupled from individual storage devices. Aspects may take a “libOS” approach of allowing clients to compose the specific storage features that they require from a set of common facilities such as striping and layering. Implementing the storage data path as a dispatch layer that is decoupled from device management means that it may be placed appropriately: common components may be used to integrate directly with application code and to build a clustered NFS server. While these modules are reusable, they are not prescriptive: clients may opt to deploy software directly against device address spaces; and
- (3) They provide defensive, opt-in coordination interfaces that can be used to build shared storage functionality wherever it is desirable. Storage clients benefit from functionality such as failure detection and recovery, and space efficiency through deduplication. We provide a set of coordination APIs that allow shared services like these to be built and used by clients where desired without subjecting all clients to them. These interfaces tolerate misbehaving clients by being designed in manner that only allows clients to put their own data at risk.
Aspects disclosed herein may consist of an enterprise storage system that applies these three ideas to achieve high-performance, controlled sharing of network attached non-volatile memory resources in enterprise environments. They may include an embedded software stack that runs co-located with each storage device to present it as a Network Attached Disk (NAD). NADs are registered with a fault-tolerant cluster coordination service that tracks storage consumption and accounts it to a set of registered storage clients, which are end consumers of NAD-based resources. Clients use our dispatch interface to compose storage paths, allowing them to combine individual device resources into striped, replicated storage aggregates.
The examples and objectives described above are included solely to advance the understanding of the subject matter described herein and are not intended in any way to limit the invention to aspects that are in accordance with the examples or improvements described above.
The invention, both as to its arrangement and method of operation, together with further aspects and advantages thereof, as would be understood by a person skilled in the art of the instant invention, may be best understood and otherwise become apparent by reference to the accompanying schematic and graphical representations in light of the brief but detailed description hereafter:
The present invention will now be described more fully with reference to the accompanying schematic and graphical representations in which representative aspects of the present invention are shown. The invention may however be embodied and applied and used in different forms and should not be construed as being limited to the exemplary aspects set forth herein. Rather, these aspects are provided so that this application will be understood in illustration and brief explanation in order to convey the true scope of the invention to those skilled in the art. Some of the illustrations include detailed explanation of operation of the present invention and as such should be limited thereto.
As used herein, the term “virtual,” as used in the context of computing devices, may refer to one or more computing hardware or software resources that, while offering some or all of the characteristics of an actual hardware or software resource to the end user, is a simulation of such a physical hardware or software resource. Virtualization is the process of, or means for, instantiating simulated or virtual computing elements such as, inter alia, hardware platforms, operating systems, memory resources, network resources, or any hardware resource, software resource, interfaces, protocols, or other element that would be understood as being capable of being rendered virtual by a worker skilled in the art of virtualization. Virtualization can sometimes be understood as abstracting the physical characteristics of a computing platform or device from users or other computing devices or networks, and instead providing access to an abstract equivalent for the users, other computers or networks, sometimes embodied as a data object or image recorded on a computer readable medium. The term “physical,” as used in the context of computing devices, may refer to actual or physical computing elements (as opposed to virtualized abstractions of same).
As used herein, a “consumer device” may refer to any computing device that is utilized by an end-user that may require the use of memory resources for carrying out computing functions. It may be referred to herein as a client or an end user device. It may refer to the computing device that is the source or originator for memory requests (i.e. read, write or update requests).
A “computing device” may include virtual or physical computing device, and also refers to any device capable of receiving and/or storing and/or processing and/or providing computer readable instructions or information. It may include virtual and/or physical computing device, and also refer may refer to any device capable of receiving and/or transmitting and/or storing and/or processing and/or providing computer readable instructions or information. This may include any general purpose computer, any hand-held device, any processing device, microcontroller or any combination thereof. The computing device may also refer to any device that may be communicatively coupled to any network as would be known to a worker skilled in the art.
A “memory resource” can be any computing device containing or comprising a memory component, or an element or portion thereof, that is used or available to be used for information storage and retrieval. Memory, as used herein, can refer to any of the components, resources, media, or combination thereof, that retain data, including what may be historically referred to as primary (or internal or main memory due to its direct link to a computer processor component), secondary (external or auxiliary as it is not always directly accessible by the computer processor component) and tertiary storage, either alone or in combination, although not limited to these characterizations. Although the term “storage” and “memory” may sometimes carry different meaning, they may in some cases be used interchangeably herein. Memory resources may be physical and/or virtual in nature. A virtual memory resource may refer to a virtualization of any one or more memory resources configured to simulate or be an abstraction of one or more available physical memory resources across one or more physical memory components as a single memory component. This may be achieved in some aspects by combining fragmented or distributed physical memory resources. The physical memory resources may be the same or different types of resources, including memory resources that provide rapid and/or temporary data storage, such as RAM (Random Access Memory), SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), CAM (Content-Addressable Memory), or other rapid-access memory, or more longer-term data storage that may or may not provide for rapid access, use and/or storage, such as a hard disk drive, flash drive, optical drive, SSD, other flash-based memory, PCM (Phase change memory), or equivalent. Other memory resources may include uArrays, Network-Attached Disks and SAN. A given virtual memory resource may thus include, in whole or in part, virtualized volatile memory devices, non-volatile memory devices, or both volatile and non-volatile memory devices acting in concert, flash-based memory and PCM (phase change memory). Virtual memory resources may or may not adopt the same characteristics of the physical memory resources to which they are associated. For the purposes of the subject matter disclosed herein, a memory resource may also include any future unforeseen storage devices that may be developed for storing data. A memory resource may be the same computing device as the consumer device, such as when the consumer device comprises local storage that may be used for data objects associated with such consumer device.
A “switching device” refers in general to any device resident on a network that that links network segments or network devices. As used herein, it may refer to a multi-port network bridge that processes and routes data between devices on a network. Switches exist for various types of networks including Fibre Channel, Asynchronous Transfer Mode, InfiniBand, Ethernet and others. A switch is a telecommunication device that receives a message from any device connected to it and then transmits the message to the device for which the message was meant, or in some cases to other devices that are capable of determining the device for which the message was meant. A switching device may be used in a virtual and/or a physical environment. Furthermore, a switching device may also include software provisions for custom programmability, network virtualization, simplified architectures, automated monitoring/management, etc.
A “network component” comprises a network switch and a mapping resource. The network switch and mapping resource may reside in the same or different physical components, provided that they are communicatively coupled. The network switch in this network component can be configured to operate in a similar manner to conventional switches, in that it directs data traffic across network resources and that it uses address forwarding protocols to direct data traffic when the appropriate destination of that data has not yet been determined or is not “known” by the switch. It has additional functionality, which may be in accordance with instructions provided by software running on the switch (or on other devices that are connected to it), which permits the switch to receive routing information regarding a specific piece of data from a mapping resource that forms part of the network component. In this way, the network switch in a network component does not need to maintain its own lookup table for routing data, but rather is instructed, either by the mapping resource or, should the system wish to rely on existing network infrastructure and functionality, by existing address forwarding protocols, on where to direct memory requests.
As used herein, “NAD” is a network attached device that provides network-attached storage (NAS) and which provides a dedicated memory storage device, such as but not limited to a hard disk drive or SSD, that is set up with its own network address and provides data storage services to other devices on the network. A network-attached storage device may be attached to a local area network and assigned an address, such as an IP address or a MAC address. NADs may consists of hard disk storage, including multi-disk RAID systems. Software for NADs can usually handle a number of network protocols, including Microsoft's Internetwork Packet Exchange and NetBEUI, Novell's Netware Internetwork Packet Exchange, and Sun Microsystems' Network File System. Although some NADs will run a standard operating system like Windows, many NADs run their own proprietary operating system. For example, the network attached storage platforms from NetApp use the company's proprietary Data ONTAP operating system.
A “mapping resource” is a resource that associates mappings between data addresses and information that relates to a storage location. The mappings may be static associations between data addresses and storage locations (or information relating thereto); the mappings may also comprise of a mapping scheme for determining with which storage locations a data address or data address comprising a given prefix or portion the data address should be associated. The mapping resource can also change the mappings depending on characteristics of the data relating to the data addresses, of the network or networks, of the end hosts in the distributed memory resources, of the consumer devices, or the end-user of the consumer devices. The mapping resource may, in some aspects, provide a centralized reference, such as a look up table, for recording and managing where specific data associated with data addresses are or should be stored. The mappings may be static associations between data addresses and information relating to storage locations, but may also be dynamic and include policies and functionalities that map ranges or classes of data addresses, which may be identified by such data addresses having certain prefixes (or suffixes) or other characteristics, according to a mapping scheme. For example, if a mapping resource may map those data addresses that comprise a portion that falls within a predetermined range to memory resources according to a hash function, round-robin assignment, striping of chunks, or by sending such data addresses to the memory resource that best meets operational objectives (as may be determined by received operational characteristics at the time of forwarding the request), such as sending to the memory resource having the shortest queue for memory requests pertaining to a particular object, or to the class of memory resources having the lowest failure rate for all data originating from a class of end users that require safe storage of sensitive data.
“Memory requests” or “memory instructions” as used herein may refer to any requests or instructions for reading data from, accessing data from, writing data to, updating data on or otherwise using data on memory resources.
The instantly disclosed subject matter consists of methods, systems and devices for managing distributed memory resources for the use and storage of data and data objects that may be created, accessed or otherwise used by one or more consumer devices and/or end-users of such consumer devices. In some aspects, an exemplary device comprises a network component configured for network communication with one or more memory resources that store data and one or more consumer devices that use data. The network component comprises a switching device in operative communication with a mapping resource, wherein the mapping resource is configured to maintain mappings between: (i) data addresses associated with data from a particular data object and (ii) information relating to a storage location in the one or more memory resources associated with the data from the particular data object. The data addresses of the instantly disclosed subject matter is configured to have contained therein identification information for identifying the data from the particular data object associated with that data address. The switching device is configured to receive routing information from the mapping resource based on the mappings, while it may rely on address forwarding protocols in cases where the mapping resource has no mapping for a particular data address or, alternatively, the system has at a given point in time or for specific data decided to rely on the network for forwarding memory requests.
In one aspect, there is provided a clustered NFS server for VMware ESX. On a single 48-port 10 Gb switch, this aspect is capable of delivering 1M random IOPS to a set of 80 load-generating I/O-intensive virtual machines, at an aggregate throughput of 20 GB/s. Such aspect may have implemented thereon replication, striping, and deduplication as composable layers in the system. This approach allows new NADs to be added incrementally, with an associated improvement in aggregate performance and latency.
In operation, aspects can operate in accordance with the following. A range of data addresses are made available for use by a consumer device. In some cases, this range is made available by the network component and in other cases the consumer device is limited only by the addressing protocol or convention with respect to the range of addresses that may be used. The consumer device may create or generate any data address from within this range to designate for memory requests relating to a give data. The consumer device is configured to create the data address in accordance with a communication protocol or a convention to both: (a) build identifying information that can be used to relate to or identify a specific portion of data, such as a data object or a particular byte or a range of bytes in a particular data object; and (b) create a data address for that specific portion of data that includes within such data address the identifying information relating to the portion of data. The consumer device in this example will send a data packet in respect of a given portion of data with the data address included in its destination field. The network component will receive a packet with the data address included in its destination field and, the switch will route that packet, after determining routing information from information contained in the mapping resource, to the memory resource that is or will be associated with that data address in the mapping resource. In cases where there is no mapping associated with the data address (because, for example, it is a new data address for data that has not been stored or accessed by the consumer devices), the network component may be configured to forward the packet associated with the data address according to a forwarding protocol, which may be based on information in the data address or other operational characteristics, or, alternatively, according to address forwarding protocols or other policies that are well understood in the art to determine where the data will be or is stored. In such cases, once the network switch of the network component has resolved the destination of the data packet, information relating to the storage location may be mapped to the data address in the mapping resource, if the mapping is static, or the mapping resource may simply keep track of the mapping scheme that it used for mapping the data.
The mapping resource, for example, associates data addresses with the MAC addresses of the memory resources that are connected, via a network, to the network component. In aspects, the mapping resource may associate data addresses with varying degrees of granularity. In some aspects, the mapping resource can map data addresses to specific resources (e.g. a drive or SSD, within a memory resource), a specific location within any such specific resource (e.g. a specific location on a drive or SSD), or a communication port that handles traffic to multiple memory resources on a segment communicatively coupled to that port (and which, for example, may rely on address forwarding protocols or other user-implemented policies on hubs and or switches residing on the network in order to forward data packets to the correct memory resource). Furthermore, the mapping resource is configured to receive or obtain information relating to computing or network devices on the network. Such information may comprise characteristics relating to the type, status or nature of any of: the consumer device, the data or data objects that are being sent over the network, the end user, the networks or network segments over which the data is being sent, and the memory resources. The mapping resource is configured to manage the mappings between the data addresses and the information relating to the storage locations in response to these characteristics and/or a pre-determined policy to achieve some objective relating to the usage of the data. In aspects, real-time changes to the mappings will result in a centralized management of where and how data is stored over distributed memory resources. The network switch on the network component directs the data to the storage location indicated in the mapping resource and as such the network component manages the storage locations for data.
The memory resources comprise of one or more memory storage resources that are connected via a communication network. Upon receipt of data packets from the network component, the appropriate memory resource may store the data in accordance with known methodologies. In aspects, the memory resource receiving the memory request (i.e. a read, write, or update) obtains information relating to the identity of the data associated with the request by decoding that information encoded in the data address (or in some aspects, some information, such as the offset within the data object associated with the data, from header information in the payload) and utilizes that information to determine where (a) the requested data is stored (in the case of a read) or (b) the data should be stored, and then keep track such information in its internal file system information. The memory resource may be configured to decode this information by pre-loading the memory resource with software; among other things, this software may in some aspects provide the appropriate convention to the memory resource thus enabling it to recognize and decode the data-identifying information from the data address associated with a memory request. Data that is returned responsive to a read request may be located by the file system of the memory resource utilizing the information the encoded information, and then is sent back to the requesting consumer device using the source address that accompanied the data packet associated with the read request. An acknowledgement may occur for write requests to confirm that the write occurred.
In some aspects, consumer devices may have local storage for data. The use of the local storage may supersede the use of the distributed memory resources and the consumer device may override the use of the network component and instead choose to use local storage resources. In some cases, this may be used when low-latency or high speed and frequent memory requests are initiated. In some aspects, the local storage resources may be integrated into the distributed memory resources and be addressable by the mapping resource. A consumer device, in some aspects, may in some cases also be a memory resource.
In some aspects, the generation of data addresses by consumer devices is, at least in part, by convention. There are many examples of client applications that could conceivable generate data addresses, including but not limited to file systems, databases, key/value stores. While the data address is, in many cases, an IP address, the instant subject matter uses portions of the IP address to carry information. In other words, portions of the data address, which are utilized by network resources to identify a destination, are manipulated to also refer to information that identifies the specific portion of data that is associated with the data address. In such cases, the data address is analogous to a disk: a disk lets you issue reads or writes at an arbitrary location, and since any valid data addresses may be generated (provided they are within a given range of data addresses that are in accordance with acceptable protocols) that may carry information in accordance with a convention. This information, while recognized by existing network infrastructures in an exemplary aspect as an IP address (or a destination field), can also be recognized by the consumer device, network component, and/or the memory resources as information that can be unpacked to identify the portion of data in question. By using the analogue of a disk to the IP address, the following illustrative example can be used to understand the how information is carried by the data address: valid locations of a data object start at 0 and increase in number to the size of the disk (in this case, the appropriate field of the IP address). An exemplary 1 TB disk would allow the issuance of read and write requests to any address from 0 up to about 1,000,000,000,000. The disk can be instructed to write the value 18 at location 9,900, which would involve finding the 9,900th byte of the disk and setting it to 18. This address space for the disk in this illustrative example may be described as linear and non-virtualized, wherein each address is a physical location on the device. Using this analog in aspects of the instant invention, the mapping resource can be seen as allowing arbitrary indirection between the data address generated at the consumer device and another. It can map a data address A to a location B, where B is the endpoint on the network that is currently responsible for providing the data relating to A, and therefore information carried by the data address can be used in different ways, including to identify the portion of data to which the data address is related.
Extending the exemplary hypothetical disk example above to a data address, the data address can be thought of as a disk that is much smaller than the 1 TB imagined above. Rather, it can, for example, store 1000 bytes, with addresses from 0 to 9999. The network component, or in alternative aspects, the memory resources themselves, offer up a range of data addresses for use by a consumer device. In this example, the memory resources comprise of three servers (x, y and z) that each offer up one disk. In this exemplary convention, the system permits the generation of 4-digit data addresses for which the mapping resource determines (or dynamically “maps”) addresses from 0000 to 0999 refer to server x, 1000 to 1999 refer to server y, and 2000 to 9999 refer to server z. The mappings, in this simple example, are prefix based. The address 0000 is on server x, 1000 is on server y and any four-digit address from 2000 to 9999 is on z in accordance with the mapping in the mapping resource, but the mapping resource may, depending on operational characteristics of the system, or a change in policy objectives, may re-map the addresses to the servers (or indeed additional servers) in an alternative manner. In the above example, provided for illustrative purposes, data addresses are analogized as addresses to a disk, in that they talk about an address where a piece of data lives. They can be used to read or write data as if you were talking to a disk. Due to the arbitrary mapping of the data addresses to storage locations on the mapping resource, data addresses in fact have no relationship with the disk addresses on x, y, and z.
In aspects, the consumer devices are configured to encode the information relating to the data, and then generate a data address containing such encoded information, according to a convention. Consumer devices may have loaded thereon (or in accessible memory) software that provides the necessary instructions to obtain an object ID from the name service (if no object ID exists), to generate a data address and then encode the information in the data address and, if applicable, in the header of a packet payload. In some aspects, instructions and logic relating to the use of prefixes in data packets can be implemented by software that is loaded on the consumer device. In such a way, generation of data addresses and the use of prefixes in data addresses at the consumer device can be implemented to give the local consumer device some control over where the data is stored, or on what type or group of memory devices. In some cases, specific ranges of data addresses may be associated with particular memory resources (or a group or class of memory resources) and in such cases it is possible for the consumer device to be aware of these associations and generate data addresses within selected ranges to implement storage for data from some data objects in specific memory resources (e.g. the consumer device may be given a requirement to store some information locally, or to store frequently accessed information in low-latency storage, or to store particularly sensitive data on memory resources with high security and low failure rates, or any other such requirement or operational objective). In other cases, the consumer device may have not have access to this information and thus control over the designation of memory resources may entirely be handled at the network component by, for example, the network component assigning to the network component specific data address ranges that the network component has associated with certain memory resources. In other words, the network component is “ignorant” to this requirement. In some aspects, partial control may be given to the consumer device and partial control maintained at the network component through designation of address ranges. In some aspects, no software instructions on the consumer device is required and the encoding and embedding of information that identifies the data in the data address will occur in accordance with an existing network protocol, a specifically designed network protocol, or an interface may intercept and amend the data addresses to encode and embed the data identifying information.
Any conventions for identifying the data may be implemented. An example, included herein to provide an illustration of possible conventions, may include the following: the top digit of the data address corresponds to a specific memory server, and the remaining three digits to name a location on that server's disk. This would specifically be for a direct mapping to local disk addresses on consumer devices, as follows:
Data addresses 0**** map to Disc X
Data addresses 1**** map to Disc Y
Data addresses 2**** map to Z
In the above example, data address 0000 would go to x, and x could know to map it to its disk at 000. 1000 could go to 000 on y. The consumer device knows nothing about the disks that are being used to build the system, it just knows that it can use addresses from 0000 to 2999.
As a completely different exemplary convention, consumer devices could agree to use the first two digits to identify an object (e.g. object ID) from which the data associated with a request originates, and the second to identify a location in that object (e.g. offset) where that data is found in the data object. In this convention, objects can be a maximum of 100 bytes (00 to 99). When a new object is created, the system would choose a server to host data from that object (or in some cases, the object); in other words, the mapping resource maps the data according to criteria relating to the data address. So for data objects 00, 10, and 25, the mapping resource may wish to map the objects to the memory devices in accordance with the following policy (or indeed specific mappings):
00** maps to Host x
10** maps to Host y
25** maps to Host z
A write to byte 10 in object zero would be addressed to 0010, and sent by the network component to x. x would then be responsible for understanding where 0010 is stored on its disk. The consumer device, in this example, can send network instructions as if it was directly to the data.
In some aspects, the system is configured to provide direct mappings for specific pieces of data by associating data addresses for constituent portions of data objects that are comprised of such specific pieces of data, and then by taking advantage of the ability to store information that identifies that constituent portion within corresponding data address, the network infrastructure can handle traffic specifically for granular pieces of data. The network infrastructure can direct memory requests directly to the specific storage location for highly specific and granular portions of data.
In one aspect, the creation of data addresses that can be used as the higher level data addresses that include information identifying the data, can occur in the following two stage process:
STAGE 1: Address Encoding
A consumer device requires a read of byte 1024 of a file named “a.txt”. The file system (or in some cases, the name service) maintains information that allows the consumer device to determine that “a.txt” has object ID “34”. The network protocol used in an aspect of this patent ENCODES this file name and offset as address 00341024. In other words, it concatenates the two values, using the first four digits to store the object number, and the second four digits to store the offset within that offset. This encoded address is used as the destination address in a packet that is sent to the network. Whereas, IP and other standard network protocols normally use the address of a computer as a destination address, aspects of the instantly disclosed system uses that address field, which is read by the network component, to instead hold the address of a piece of data, irrespective of where it actually resides.
This encoding stage is a convention than a mechanism. Applications of this protocol or methodology will need to decide on an encoding that suits the needs of the consumer device or the network protocol. In some aspects, the convention may be determined by an administrator and coded into the system. Concatenation of object and offset is one possibility. Flat offset into a large byte-addressable address space is another.
STAGE 2: Address Mapping
Mapping is the process by which the network transparently resolves the data address that is stored in the destination field of the packet described above, to a storage location where that data currently resides. Even for relatively static mappings, aspects can take advantage of the hardware of the network component to forward data to a changing set of physical hosts. The broader insight is that all sorts of dynamism may applied to this mapping, to do things like load balancing, fencing of hosts, failure recovery, achievement of operational objectives (e.g. high speed, high safety, low-latency, etc.).
In some aspects, a centralized nature of the network component facilitates the use of the network to achieve updates to mappings across an entire set of distributed memory systems, irrespective of agreement among individual memory resources or storage locations therein. This means that the network, as a set of one or more central devices, can be used to enforce that a change to mappings happens either all at once for memory resource in the system, or not at all. This is important because it is used to ensure consistency: the idea that all clients in the system always share the same view of the data being stored without requiring that memory resources communicate with one another.
In some aspects, the memory resources may comprise of storage distributed across end hosts, conventional storage targets, and possibly on-switch flash (this can be used to buffer replicated writes under bursty load). The network switch of the network component distributes requests to the hosts that hold the data by treating the request as an IPv6 address (i.e. data address) and forwarding it according to routing tables (in this aspect, the mapping resource of the network component), which are constructed by a control plane in the network component. Aspects of this architecture allow any memory resource to write at the aggregate maximum write bandwidth, and to allow the cluster to saturate on writes while preserving consistency and redundancy.
Consumer device memory instructions may be handled at one of several locations: either as a library linked in to a client application, as a kernel extension, or when the client is virtualized, as either a virtual machine appliance or a hypervisor driver. The lowest latency configuration is one that removes as many data copies or other request processing delays as possible. For example storage (flash cards) and NIC ports connected to the network component are directly mapped into the front end (e.g. through VMware DirectIO), and the front end is mapped into the consumer device application as a shared library.
The front end is responsible for translating the requests from the form used by the consumer device (e.g., path name and offset) into the network address form used by the forwarding layer. Note that the traditional file system interface (path names, POSIX-like file operations) is only one of several possible interfaces. For example, the store could also present itself as a key-value store in the client library, with a more direct and thus more efficient translation into the native format of the storage system.
In one aspects, information that identifies data is may be directly transcribed onto existing network protocol address spaces, such as the IPv6 and Ethernet protocols, although any protocol network address spaces may be used. Hardware implementation of known switching hardware can quickly forward these messages in the network. The network switch's position as an intermediary between a large number of memory resources is leveraged to achieve consistent changes related to addressing within the cluster of memory resources.
In one aspect, a two-layered model is utilized that overlaps IPv6 and Ethernet. The IPv6 address space is used to represent a data address for a data object as follows: a 128-bit IPv6 address is split into a concatenated (object id, byte address) pair. In this aspect, there is an even 64-bit/64-bit split (with a small amount of loss at the top of the object ID that arises from IPv6 address assignment conventions). This split is somewhat arbitrary and could be adjusted to allow other data representations, such as a simple tree hierarchy, or an absolute index into a sparse address space as is used (albeit above the host level) by KV stores such as chord. As such, this aspect does not rely on end hosts (i.e. memory resources) in the system each maintaining a (possibly inconsistent) mapping of all data addresses to all end hosts (and also each network switch maintaining a lookup table, which may also be, or become inconsistent), but rather encodes a the IPv6 destination with data identifying information to form a data address, and permits consumer devices to send network messages directly to data. When such prior memory resources maintain mappings to their own data (and in some distributed memory systems, mappings to data on other memory resources), changes to or movement of data becomes redundant or renders data unavailable on one or some memory resources in the distributed memory system; further, related data (e.g. backup copies, or live portions of data objects stored across multiple memory resources) must be maintained appropriately. This means that highly complex logic and safeguards must be in place, or the data becomes inconsistent or unstable—and in many cases both. Since aspects of the instant disclosure do not require that memory resources maintain mappings to their own data, and this mapping is handled by a central network component, significant complexity at the memory resource (as well as conventional network switches in the associated network infrastructure that must maintain lookup tables specific to these mappings) is made redundant. Moreover, the consumer devices in aspects of the instant disclosure may send network requests specifically to highly granular portions of data (e.g. a specific byte in data objects like files).
Upon a consumer device of the instant disclosure sending a memory request (i.e. read/write/update), it becomes the responsibility of the network to ensure that that request reaches the data, wherever it may currently reside. In some aspects, Ethernet-level addressing is used at this stage and uses IPv6 over Ethernet. The network components in this aspect map, in the mapping resource, IPv6 addresses to the Ethernet-level MAC addresses, which are resolvable to individual memory resources. Network components maintain a mapping resource (which may be analogous to forwarding or lookup tables in standard network switches). The mapping resources permit network components to use network switches that are use very low-latency memory and thus can implement routing in a very fast and simple manner. The memory resource can identify the data associated with the memory request according to the data address and subsequently act accordingly (including by storing or updating data and providing acknowledgement, or by reading and providing the requested data).
In aspects, the consumer devices are configured to generate data addresses at the IPv6 layer which remain global and constant, and uses the network component switch's mapping in the mapping resource of IPv6 addresses to Ethernet addresses in order to reflect the current location of a piece of data. Ethernet addresses as ephemeral, session-oriented mappings of where a given piece of data is right now. Network attached disks (the storage nodes on which the data actually resides) assign virtual MAC addresses that reflect active data. In this manner, a message to an IPv6 data address on the network component is resolved to an Ethernet address instance that is given to the memory resource that currently houses that piece of data. The Ethernet address space, then, is allocated in a rolling manner, as data access is required.
Note that IPv6 address prefixing and wildcarding allows a range of data to be assigned to a specific MAC address instance, or range of MAC addresses. This is done by sending an advertisement indicating that all IP addresses in a contiguous range of IPs reside at a specific MAC address.
While the above aspect describes an instantiation using IPv6 data address and Ethernet addresses, but other aspects may not be tied specifically to those protocols. In the above aspect aspects of these protocols are leveraged to carry information within in an IPv6 protocol, but other aspects may use other network protocols known in the art. IPv6 utilizes fast implementations on modern switches, such as the one described in the aspect above, which permits high speed performance while having a useful interface to help enforce consistency of mappings. However, other network switches and protocols, including but not limited to SDN-type switches, as would be known in to persons skilled in the art, may also permit alternative switch hardware to efficiently forward new protocols at the L2 and L3 layers.
Although the above aspect utilizes mappings on commodity switches with IPv6 and Ethernet protocols, other aspects may utilize other switching and network technology and use other types of network-based addressing to route requests for stored data. Many other forms of switching and network technology and/or network-based addressing protocols or methodology, including those which may not be developed yet, may be used without departing from the improvements relating to the use of the generation of data addresses comprising information relating to the data, which can then be mapped to storage locations within memory resources described herein.
The mapping resources in some aspects operate like forwarding tables in known network switches. In some aspects, the mapping resource operates as a cache in the network component in the same manner that a TLB (Table Lookaside Buffer) is used to speed up virtual memory accesses in a computer's MMU. Instant aspects of the system maintain, outside the network switch of the network component, a set of mappings in the mapping resource linking the data address generated at the consumer device (which in some aspects may be represented as 128-bit IPv6 addresses) to the locations where that data resides. The network switch of the network component is then used to enable fast forwarding of the memory requests. In cases where the network switch does not currently have a mapping for a given address, it will generate a request for a resolution (for instance, using the IPv6 Neighbor Discovery Protocol), at which point the mapping may be looked up from an in-memory or on-disk data structure, and returned to the switch. An important benefit to this approach is that the job of resolution may still be pushed entirely to the requesting host, as in the hash mapping used by Chord. However, in that case, the hash function would map a data address to one of n Ethernet addresses, each representing a memory resource but if the system decided to move a subset of data from an active memory resource, or if the memory resource failed and corrective action needed to be taken, the mappings in the mapping resource can be invalidated (by indicating that the associated Ethernet address is no longer reachable) and the originating memory resource can handle the exception by coordinating to resolve a new address. This approach avoids the inconsistency problems that often arise in distributed storage systems.
Information relating to a storage location, which may be contained within a mapping resource, may refer to any information relating to the storage location where data may be stored. In certain instances, this may be a MAC address or an IP address of a memory resource. Addressing methodologies of other communication protocols, which may or may not be developed, may be used without departing from the principles identified herein to map data addresses with storage locations. In other instances, the information may be information pertaining to a port, for example in a network component, which is responsible for or linked to a certain range of memory resource addresses. In certain instances, this may be information pertaining to the actual physical memory address on a hard disk or SSD within a memory resource where data may be stored. In certain instances, this may also be information pertaining to memory address, in a virtual environment, where data may be stored. The information relating to a storage location may also refer to an association for a range or class of data addresses, as identified according to predetermined portions of the data address, to a particular scheme for associating specific data addresses that fall within such range or class with memory resources. In other words, instead of associating each data address with a static piece of information relating specifically to a particular memory resource (e.g. MAC address), it may associate the range or class of data addresses to a scheme for distributing the memory requests associated with the data addresses in a manner that meets some operational objective (i.e. replication for preventing loss of data, low-latency, safe storage, etc.). Where the memory request is sent as a result of this scheme may be stored in the mapping resource, or the mapping resource may utilize address resolution protocols to determine where the data actually resides.
In some aspects, the network switch of the network component provides a central point of control and actuation for data storage locations that is not present in traditional completely end-host-addressing-based distributed storage. Rather, managing forwarding on the network switch at the network component (in conjunction with the mapping resource), by mapping the data addresses (that contain data-identifying information according to a convention) to information that relates to the storage location of the data in a memory resource (e.g. a MAC address) the following functionalities are achieved:
-;
The mapping resource, which may in some aspects be a switch-based forwarding table, represents a caching resource, similar to a TLB on modern computers' MMUs, which can be managed for performance in the software components of some aspects. In aspects, request-originating memory resources may resolve mappings for memory requests, but the instantly disclosed subject matter allows a useful mechanism for safe and high-performance interception of those requests that will not render data residing on the other memory resources inconsistent since the mapping resource can identify and monitor the requests and update (or even subsequently change) the mappings to maintain consistency.
In some aspects the network switch of the network component is able to dynamically take action on in-flight requests based on operational characteristics of the memory resources, the consumer devices, the network and network resources, the data itself, and even the end user. In some aspects, this permits at least the following functionalities:
- Load-aware write targeting: The network component can direct write requests to the NAD or other memory resource that is currently serving the fewest active requests and update mapping appropriately. This results in a balancing of load in the system and a reduction in write request latency.
- Multicast fan-out for replication: In common operation, writes must be written to more than one NAD in order to survive failures. The network component can perform such fan-out of requests, permitting consumer devices to need to only send one request to the network, and the network component will duplicate the request as may be necessary to the two or more replica memory resources. Note that in conjunction with the load-aware write targeting, described above, the memory resources storing the duplicate versions of the data could be the two least loaded hosts.
- Load aware read “anycasting”: In respect of a memory request for a read, where the data is replicated on multiple hosts, the network component provides for directing read requests to the least loaded memory resource rather than the memory resource that is using the “active” (i.e. non-back-up copy). The network component is aware of all replicas for a given piece of data, and thus it remains free to forward read requests to the least loaded memory resource. In such cases, there may be no “back-up” copy but rather any of the copies may be used depending on operational characteristics of the system.
The memory request decision process, made on the network component, as to where a given packet or request should be forwarded, may be based on the current “load” as indicated by outstanding requests (or queue depth) on each of the memory resources. Other operational characteristics of the memory resources could also be considered, including but not limited to the available space on the target devices, their performance relative to other devices, security or failure rating, or other characteristics that would impact performance of the memory resources or requirements associated with a memory request or instruction. A combination of operational characteristics of other aspects of the system, such as the nature of the data, the consumer device, the end-user, and/or the network. As an illustrative example, data for which the network component is aware is subject to frequent read requests by multiple users may be mapped by the network component to multiple memory resources, each of which are particularly suited to responding to read requests quickly or with low-latency. In another example, the end-user may require significant levels of reliability and would be willing to sacrifice speed therefor, in which case the network component, once it becomes aware of such operation characteristics, can map data address associated with data from these end-users (or their consumer devices) to memory resources having high reliability characteristics.
In some aspects, allocations can be made according to the mappings determined at the network component (in the mapping resource) once the network component is aware (i.e. provided with the necessary operational characteristics and/or operational objectives) that a memory resource is more capable of meeting a particular requirement than other memory resources, that a particular memory resource is to be dedicated for a particular use, that a particular memory resource is to be prioritized for a particular use over other memory resources, or that a particular memory resource is available for a particular use. In exemplary aspects, some types of memory storage may provide varying levels of different operational characteristics that would be better suited for (a) certain types of data having certain types of data type characteristics; or (b) achieving a pre-determined operational objective as requested by, for example, the user or system administrator. These operational characteristics and operational objectives may include, but are not limited to, characteristics relating to speed, integrity, redundancy, persistence, security, methodology of implementing memory instructions (e.g. log-based methods and conventional block-based non-journaling data storage schemes or other methodologies known in the art), association with a file system (i.e. whether or not use of a particular file system will tend to increase or decrease achievement of a particular operational objective or policy on a particular type of physical memory resource). Other characteristics of memory resources known to persons skilled in the art can be considered a pre-determined memory characteristic, whether or not disclosed herein or even known at the time of filing, without departing from the spirit or scope of the disclosed subject matter. The data type characteristics may apply to data types that, for example, are likely to be read, written or updated more or less frequently, are more sensitive to corruption or threat of being subjected to unauthorized access or amendment, have a requirement to be read, written and/or updated in a high-speed manner or need only be read, written and/or updated in a low-speed and/or infrequent manner, need to be accessed by many users; or need to be accessed by a narrow class of users. Other data characteristic known to persons skilled in the art can be considered to be an applicable pre-determined data type characteristic, whether or not disclosed herein or even known at the time of filing, without departing from the spirit or scope of the disclosed subject matter.
In some aspects, memory resources having one or more shared pre-determined memory characteristics may be dedicated and/or prioritized by the network component for use by data types having one or more shared pre-determined data types characteristics. To the extent that the memory resources are not available or for which another use is more highly prioritized, other physical memory resources may be used that may provide a reduced ability to achieve an operational objective or policy, but nevertheless higher than other available memory resources. The level of prioritization, or acceptable reduction in ability to meet such operational objective or policy, may be pre-determined by a user or administrator. In some aspects, physical memory resources can be dedicated or prioritized according to a policy or policies that best leverage relationships between operational characteristics between end-users, consumer devices, the network and network components, and the memory resources in order to best achieve said policy or policies. In some aspects, policies or operational objectives can be applied across organizations (i.e. cross-application, cross-host, cross-user, etc.). In some aspects, policy can be applied across “semantic” layers, allowing finer grained treatment of stored memory than has traditionally been possible. For instance, in a storage system that traditionally manages highly distributed memory resources, one exemplary policy would allow for the treatment of specific files, file types, or records within files in a different manner than the rest of the virtual memory component. Memory characteristic may include, but are not limited to: high-performance storage capability, durable storage capability, storage configured for encrypted data, configured for replication, configured for synchronization, configured for audit requirements, configured for ease of deletion, configured for multi-client access or use, configured for rapid access/read/write, etc., or a combination thereof. Data type characteristics may include, but are limited to: frequency of access, high or low sensitivity, security requirements, accessible by multiple users for concurrent use, configuration type files, etc., or a combination thereof.
In some aspects, other protocols for data-addressed network forwarding, including existing or specifically-designed protocols, may be used, other than, for example IPv4, IPv6 and Ethernet. For example, since IPv6 has a 128-bit target address, but certain ranges within this address space have specific meaning and are treated differently by switching hardware which therefore limits certain regions of the address space, different protocols, including those specifically designed for the instant system will benefit from a dynamically-sized address field, possibly also not requiring an entire 128-bit source address, given that request sources are in fact memory resources or consumer devices, rather than pieces of data. In some aspects, protocols supported by SDN-based switches are utilized for data addresses and/or the information relating to the storage locations.
In an exemplary aspect, approaches described herein would unify addressing of data in a collection of networked computers, including memory on the consumer device (RAM), local disks and flash devices, RAM and disks on remote memory resources, including enterprise storage targets, and even remote, cloud-based storage through services such as Amazon's S3. This allows a centralized configuration to indicate how data should be mapped to ranges of the global address space, and the MMU on a given host, would simply translate requests that could not be satisfied from its own memory into data-based network addressed. These requests would then be forwarded to the appropriate destination and returned from there.
In aspects, Ethernet and IPv6 protocols are used to map data addresses and storage locations across the distributed memory resources. Other aspects support implementations using protocols that can be used on systems utilizing SDN interfaces such as OpenStack, Arista Networks' EOS APIs, and Intel's new Fulcrum-based 10 Gb switch reference architecture.
In some aspects, the sufficient systems level support are deployed to the network component, the consumer devices and the memory resources, including applications, libraries, operating systems, host computing platforms, and/or network switching hardware/software, such that requests to access memory can be encoded in a network-relevant representation (i.e. the consumer device can generate a data address in accordance with the conventions disclosed herein to carry the data-identifying information) and that the network switching and endpoint network stacks be able to handle these requests appropriately. The deployment may in some aspects be similar to RAID methodologies in that RAID supports a set of codings and related mechanisms for spreading data over a collection of disks, while the instantly disclosed aspects support the addressing of data and address/placement management techniques that allows the network to appropriately support high performance distributed memory implementations. In most aspects, an end user of the instantly disclosed system will have no specific awareness of the underlying mechanism.
While some aspects focus on datacenter networks, where there is a great deal of desire to realize high-performance, scale-out memory/storage implementations, other aspects may be utilized in any situation where distributed memory resources are addressed over a shared network or bus, and where the common approach in that network's implementation is to map data addresses associated with specific pieces of data to memory resources. Aspects are applicable to any such system as the methodology can be either reused with little or no modification, or modified in order to allow the direct addressing of specific data resources that reside on those end components. Directly addressing data facilitates the addition or removal of components, the migration/mobility of data, replication, load-balanced placement, and other benefits. Aspects of the disclosed subject matter may also be applied to hardware components (such as SATA or SCSI discs) on a host device bus (SATA/SCSI/PCI). Alternatively, it could be applied in the wide area internet, for instance to allow data movement across physical sites over time, or efficient wide area replication. In other aspects, data may be stored at storage locations that are not actual disks or other physical memory resources. Any memory resources are sufficient, and the approach is potentially very useful in building large-scale, high-performance, replicated shared memory systems, within the RAM memories of many computers in a cluster that may be combined into a large addressable memory. Virtual memory resources may be utilized in connection with the disclosed subject matter as the memory resources.;
- The use of address resolution protocols (such as ARP in IPv4, or NDP in IPv6) or similar mechanisms to populate forwarding tables on switching elements, including the network switch of the network component, with the appropriate lower-level address when a new high-level address;
- The use of virtual memory or MMU implementation techniques in the mapping resource of the network component, such as page tables, or mapping trees, to provide a current, canonical set of all address mappings between the two layers, and the use of this global view of all mappings to respond to address resolution requests, including those described above;
- The use of the address resolution protocol or other interactions with the switching elements of the network to dynamically update the location of specific pieces of data within the mapping resource, including, as an illustrative example, in an IPv4 network is the transmission of an unsolicited ARP response to force a remapping of an IP address from one physical location to another;
- The use of that same remapping approach to invalidate an active mapping, in order to force future accesses to that mapping to trigger a fault, and in some aspects, a new address resolution request, which can be used to force the mapping resource in the network component to remove mappings to stale data, even in the event that the memory resource responsible for that stale data has become unresponsive;
- The use of that same remapping approach to redirect requests to an intermediate element, on which they may be buffered, which among other benefits allows in-flight accesses to data to be paused so that changes to the underlying placement or content of that data may be made at the mapping resource level to maintain consistent and safe access to that data which can be moved to (or updated on or associated with a back-up copy on) another memory resource;
- Address management techniques to provide a central view of the entire data address space, describing all data and its mappings of associated data addresses onto specific physical locations, and the development of mechanisms associated with that global view to dynamically change the placement or encoding of data based on operational characteristics or objectives of the system;
- achieve de-duplication, or the remapping of multiple data addresses that point to multiple “copies” of identical data such that they point to a smaller number of shared copies of that data, in order to save space and improve efficiencies of memory requests or instructions (e.g. reads, writes and updates) to same or similar data;
- Mapping schemes (or routing methodologies) to migrate data to tolerate failures, or to balance load in terms of data access;
- The use of generalized address representations in network forwarding, such as prefix-based forwarding rules, to allow the assignment of ranges of data addresses (e.g. all data addresses within a particular range, which may be supplied to the consumer devices to generate data addresses for specific pieces of data according to a convention) to a single specific lower-level address may point to a specific memory resource or class of resources to implement a designation of particular memory resources for particular consumer devices (or a class of consumer devices) or particular data;
- The use of specificity in generalized address approaches, such as longest prefix matching, to allow subsets of a large mapped range of data addresses to be remapped, for reasons including but not limited to load balancing, to move a “hot” piece of data onto a less contended destination, or other operational objectives;
- The use of this high-level data address representation, and mapping thereof to lower-level addresses relating to storage locations, to allow consumer devices to effectively balance the placement of data across multiple endpoints, without requiring a large number of forwarding table rules; for example, prefix matching may be used to divide a data object associated with a number of data addresses into four equal groups of data addresses, wherein a portion of each such address contains the data object's id code and a data offset id code, followed by the remainder of the data address and the remaining portion of the data addresses, which are not used to identify the data from the data object, determine which of the four groups of data addresses that such data address will belong. Aspects of the instantly disclosed subject matter can support memory requests from consumer devices in which such requests are made with a prefix that includes the object id and offset id, but not the remaining address, resulting in the data within the object being divided across mappings associated with the four groups of data addresses, each group of which can each be associated with a specific memory resource or class of memory resources in order to achieve a particular operational objective associated with that data object;
The prefix mapping scheme approach described above can also be used to divide data from a data object into storage locations across the distributed memory resources associated by the network component (as set by an administrator or in accordance with an operational objective) for particular ranges of data addresses having the same prefixes. For example, in some aspects the use of data address hashing by the requesting consumer device to encode a hash of the data address that will uniformly distribute requests relating to data from the same data object into the associated groups of data addresses that share the same prefix. Rotational shift of data addresses such that the lower-order bits in a data address are rotated to the high order bits of the address. This rotation allows prefix matching to describe an arbitrary-grained “striping” of the data of the data object across the groups of data addresses. In some aspects, the expansion or contraction of prefix sizes is possible to redistribute or rebalance the placement of a data from a data object, or range of data addresses that can utilize the same or similar address space for the prefixes, across multiple hosts in a dynamic manner. The terms mapping schemes, routing methodologies or forwarding rules may be used interchangeably herein.
Referring to
In one exemplary aspect, as shown in
The memory resources, in some aspects, are configured to receive the data address and decoding the information identifying the data of the data object. Upon receipt of a memory instruction relating to data of a data object, the memory resource is able to identify the data in respect of which the memory request relates by interpreting the decoded identifying information contained within the data address. In the case of a read request, the information identifying the data permits the memory resource to efficiently determine where the information is stored and return the necessary information that is responsive to the read request. In respect of a write request, the data address is associated with the data to be written.
In some aspects of the instantly disclosed subject matter, there are provided uses of the systems, methods, and devices disclosed herein to provide centralized memory resource administration to providers and consumers of memory storage systems. In some aspects, aspects of the instantly disclosed subject matter include uses of the systems, methods, and devices disclosed herein to provide and/or manage distributed memory resources wherein users of the system are charged on a per use basis (including, for example, the number of memory requests or the amount of storage used) and/or further the basis of various usage factors, including but not limited to a user's level of usage, the number and type of distributed memory resources that are used, and the number of network segments served by the network component. In other aspects, there are provided uses of the disclosed systems, methods and devices, to provide enterprise storage that can provide and/or manage virtual memory components, optionally in accordance with one or more pre-determined policies, for any network of communicatively coupled physical computing devices, wherein at least one of which comprises physical memory resources. In some aspects, the disclosed uses and methods may include incurring charges upon utilization of the disclosed systems, methods, and devices, including, for example, incurring charges upon the communication of memory instructions, upon usage of memory resources on a fee per unit of memory basis and/or unit of time basis, upon use or installation of network components on a per installed basis (or alternatively as a license for the use of a set number of memory resources), or on a license fee basis.
In one exemplary aspect, the network component is implemented at a Control Plane within a standard network switch. The control plane manages mappings from data objects to volumes on end-host (i.e. memory resources). Mappings are pushed onto the forwarding tables (i.e. mapping resource) of the network switch of the network component as IPv6 routes. Mappings for low-latency local resources only are pushed from the master down to local devices. One way to distribute routing is to use routing tables on the hosts as well, giving them a default route of the network switch but letting them have a subset of routes for their own data objects (thus allowing them to utilize local storage for their own data objects, or depending on whether operational objectives would be achieved in view of certain operational characteristics, using distributed memory via the network component). In another aspect, logic that determines the routing of data may be implemented in combination with or as an alternative to the control plan or local routing tables. The logic may be associated with the information that forms the data addresses by, for example, associating specific memory resources or operational objectives to data addresses having predetermined prefixes. For example, all data addresses beginning with, ending with, or comprising therein a particular range will be routed in a particular manner or to a particular memory resource or class or group of memory resources. Pushing default routing logic or tables onto local devices but letting them have a subset of routes for their own data objects may not always suffice when local traffic may also be better served remotely (e.g., if the local host is loaded and there is an unloaded remote host).
To create a data object, a consumer device provides a path name to the name service and is returned an object ID. The name service resides on the consumer device or in any location that is communicatively coupled to the consumer device, and is made available in some aspects by loading software with instructions for such a service. Along with the path name, the consumer device can supply a set of additional parameters, such as the replica set to which the data object should belong. If these parameters are not supplied, the name service will create a data object in a replica set it chooses based on global policy (e.g., the least full replica set of the minimum number of nodes where one node is the host that issued the request). Renaming a data object is done by a request through the name service, which simply updates its table from path to object ID. Deleting a data object is also done by requesting the name server to delete the given path. When data objects are created or deleted, the name server issues a request to the replica set that holds the object to either create or delete the object itself.
The control plane in the network component renders the data objects globally accessible. The volumes that host their data have IPv6 addresses, and the network component maintains the mapping from the data address, in which an object ID is encoded, to the volumes on which data of the associated data object resides as a set of IPv6 routes. Parts of data objects may be treated specially (e.g., hot ranges may be pushed to local flash on the client host) by generating routes at sub-object specificity by, for example, specifying on the logic routes with a prefix length greater than the length of the object ID.
The following routing for reads versus writes may be implemented in some aspects. “n-way” replication requires writes to be distributed to more than one location. Routes are not necessarily statically constructed to point to the locations where data may be found, but in some aspects may be constructed dynamically to optimize IO for the current workload. A service at the default route destination, i.e. the memory resource, can initiate or request the construction of new routing table entries at the mapping resource in the network component when there is requirement to service a request (since delivery to the default route indicates the absence of more specific routes) when, for example, the default route may be unavailable. Newly constructed routes can take into account, based on the operational characteristics, the current read/write loads on all of the volumes that can handle requests for the given data object range and create routes to the volumes that are expected to optimize current performance. Routes may also be constructed before the default route has initiated them. The default route simply ensures that all requests will be handled appropriately.
In some aspects, the network component may employ congestion monitoring methodologies. A process running on the network component watches the queue depth/latency statistics of the communication ports that are connected to the distributed memory resources and may take various actions when the queues become too deep or slow, such as invalidating forwarding table entries that point to congested ports (causing a route computation for a new routing to an alternate memory resource or set of memory resources attached a particular port) to be done the next time those addresses are received by the network switch of the network component, which will select the optimal route, and adding new routing table entries to optimize the paths between clients and volumes based on observed workload.
In some aspects, the network component may employ data migration methodologies. The congestion monitoring and routing table management services at the network component optimize I/O for the current workload and placement of data. Data can be moved or migrated from a memory resource (or class of memory resources), including at a granularity of sub-object (i.e. discrete portions of data for a data object) depending on the current workload. For instance, data of a data object that is being accessed frequently and that resides on a remote volume could be better served from a local volume, from both the point of view of the accessing client and the system as a whole. To this end, a service watches communication ports that are becoming over-utilized to see whether it would be beneficial to relocate some of the data residing on that port (e.g., if a request source has capacity and is responsible for a majority of the requests for a given object range), and triggers data migration if so. Data migration is performed by adjusting the replica set for the given object range to include the new memory resource, and synchronizing the new volume for the remapped data address ranges, and invalidating routes to cause the route management service at the network component to generate optimized routes that include the new volume.
In some aspects, the network component maintains as the mapping resource a database comprising information about the location of objects in the system, so that it can generate routes to the current versions of each data object range. Some states may be flushed if there is more data in the system than can fit in the memory available for the location database, or all of the state may be lost if the switch loses power. Therefore, the database must be recoverable from persistent data to recreate the information in the mapping resource. This, among other benefits, provides a source of back-up information and/or redundancy for the network component and/or the mapping resource. The contents of the mapping resource comprise a tree of net address (object ID+offset) ranges, where the leaves are the list of volumes holding current mappings. Data objects can be split among volumes at any granularity. Information in the mapping resource comprises various levels of data: data objects present in the system, how those objects are fragmented across volumes in the memory resources, and which volumes hold current data for which data objects, are a few examples. In some aspects, there is a global table of data objects that is always up-to-date in persistent storage: the name service creates the record of its existence including the replica set that holds it before returning the object ID to the caller, and likewise removes it before completing a deletion request. As creation and deletion are expected to be relatively infrequent compared to reads and writes, this is not expected to run into scalability problems or hurt overall performance.
The network component is configured to perform volume discovery upon addition of memory resources. ARP (Address Resolution Protocol) requests can discover live volumes: front ends should respond for any addresses (at any granularity) that exist on local volumes. A persistent database records all volumes added to the system.
Systems disclosed herein utilize ARP, and which is implemented in aspects of the instant system as follows. In general, a data packet contains, inter alia, a source IP address field, a source MAC address field, a destination IP address field and a destination MAC address field. When network computing devices are trying to communicate, a sending network computing device populates fields of a data packet and sends it over a network to the destination or receiving network computing device (i.e. memory resource). When the sending network computing device is not aware of the destination host's MAC address, this field may be populated as an all-zero MAC address and an ARP request is sent out. The network computing device that has the destination IP address associated with that data packet responds to the ARP request with its MAC address. If the data packet is received by intermediate network computing devices they will forward the request until the receiving network computing device receives the packet, or alternatively, an intermediate network computing device that is aware of the destination MAC address which will forward the data packet on to the receiving network computing device. The sending network computing device, or indeed the intermediate network computing devices, after receiving the destination host's MAC address, uses this MAC address in the destination MAC address field and sends the data packet over the network. Thus an ARP table may be populated. A populated ARP table may have mappings associating IP addresses (layer 3) to MAC addresses (layer 2). Similarly, any switch residing on the network may also have such an ARP table within. Further to the ARP table, a switch may also have a MAC table that associates MAC addresses to ports. When a switch receives a data packet with a destination MAC address, it uses the MAC table to learn which port it needs to forward the data packet to and directs the data packet to that port. If, in instances, where the switch doesn't have in its MAC table a MAC address to port association then it floods all the ports to which it is connected and when it receives a response from the appropriate computing device that is assigned that MAC address, it populates its MAC table so that the next time it sees the same MAC address, it would know which port to direct the packet. The population of the MAC table may happen as a by product of data packet communication during the population of the ARP table (i.e., the switch may learn of a MAC address to port association when an ARP request is in progress). As stated previously, in some aspects, the network component may utilize ARP requests to identify newly added or unknown memory resources; alternatively, in some aspects, a data address may be mapped to a port in the mapping resource that is coupled via one or more network segments to a plurality of memory resources and, accordingly, an ARP request, or similar, may be used by the network component to route a packet associated with a memory request (i.e. read, write or update) to the correct memory resource.
In aspects, some data addresses comprise of 128 bits and according to one convention can be encoded to consist of an object ID and data offset that uniquely identifies a datum across the repository. Reads may be satisfied locally if local latency is good, but may also be dispatched to the network component when the local resource is loaded. To avoid redundant reads and resulting capacity problems, the local device should avoid forwarding the memory request to the network component when it expects to be fastest, and the network component may also second-guess the device if it receives a request from a device for a local resource. To preserve the efficacy of the network component's network switch forwarding table (i.e. mapping table), which is used for maintaining low latency, the offset portion of the data address may be divided into chunks that are likely to be reused across a large number of requests, and include the actual offset and range as part of the request header in the payload. In other words, in some aspects, the data address can be used to encode Object ID, for which policies relating to data addresses can be implemented at the network component, and other information relating to the data of interest within the data object, can be mapped in the header in the payload. This header information can be used by either or both of the mapping resource to route data packets or by the memory resource to recognize the data and store it appropriately. In some cases, only the object ID portion will be used by the mapping resource to map the data address, as it can, for example, map all data addresses associated with a particular data object (i.e. all data having a similar prefix or other component of a data address) to a specific memory resource or class of memory resources (e.g. those with the lowest request queues). The chunk size of the offset portion of the data address could be dynamically tuned depending on operational characteristics of the observed workload, or configured for a given object/range according to a preconfigured policy. Write addresses may also be masked at finer granularity than read addresses, allowing for adjusting the competing concerns of load-balancing versus forwarding table hit rate differently for read/write workloads.);
- 2. The read request is converted to a storage format: the Object ID is resolved to a data address from local cache that can be used as a network address; the data address may be masked for the mapping resource, and exact offset added as packet header rather than as part of the data.
In some situations it is more efficient to forward all requests to the network component, even those that are reflected back to the requesting host for processing. This can occur, for instance, in situations where network interrupts may be mapped directly to the software that is managing and handling requests, whereas on-host processor-to-processor communications require the involvement of an OS or VMM scheduler. In these situations, the shortcut path described in step 3 above is ignored.);
- 2. Writes are stored on disk in a with additional metadata including a logical sequence number so that the owner of the most recent object update can be determined by querying all holders of object data and choosing the one with the highest sequence number. This allows the system to survive crashes, while treating performance-critical cached metadata as soft state that doesn't need to be written to durable storage as aggressively as request data.
- 3. When a new route is generated, it is recorded in the mapping resource.
In some aspects, a path lookup for data from a data object can be implemented for memory requests (i.e. read, write or update). In such path lookups, a data address is resolved from or by a consumer device into an object ID in the repository by consulting a central namespace (or local) database. The request is forwarded once the consumer device receives, obtains or determines the object ID associated with the data object from which the data is part. On the basis of this object ID, the consumer device may, in some aspects, check for a local mapping. If the data object is present locally and the current request queue for the local storage is below a minimum threshold (wherein such threshold is set in accordance with one or more operational objectives), the request is queued locally. Otherwise, it is forwarded to the network component. The network component may forward the request to any memory resource that holds the object, including the originator of the request (i.e. the requesting consumer device). It chooses the target with smallest expected latency, based on request queue size.
In some cases, replication may be implemented. Data from data objects may be stored on multiple volumes, either as complete replicated copies or in a configurable k/n error correction coding. These volumes may be represented on the mapping resource of the network component as multicast groups or as multiple routes for the same prefix in the mapping resource as, for example, IPv6 routing tables. In the latter case, the multiple routes for the same prefix are designated for all data addresses sharing the same prefix (because, for example, they refer to the same data object) which would result in data from that data object being distributed across all of the multiple routes either arbitrarily or according to a striping, hash or other data distribution scheme using the remainder of the data address (e.g. the offset portion of the data address).
In some cases, when the network component receives a read request, it will choose the least loaded or lowest latency subset of n memory resources (this will be 1 in a mirrored configuration) that can satisfy the request. The network component will forward the incoming write request to all replicas in a replica set, and the issuing consumer device will consider the write as complete when a configured number of replicas acknowledge the write. The configured number may be a predetermined number set by an administrator or a static or dynamic value that is a function of the required level of security or redundancy that may be required to meet one or more operational objectives. The network component may also provide some amount of PCI-attached high speed flash for to buffer writes under bursts of high load, when the write set for the operation is unable to meet latency or throughput targets.
In some aspects, the subject matter disclosed herein provides methods for efficiently replicating write requests. Storage systems may be required, in some cases, to trade off conflicting desires to maintain high performance, ensure durability of data in the face of failure, and avoid wasting any more memory than is necessary. These goals are complicated by the fact that workload is a dominant contributor to actual system performance: a storage system design that is good for one workload may be pessimal or at least sub-optimal for another. Known storage implementations frequently make use of variants of the Redundant Array of Inexpensive Disk (RAID) standards. RAID describes a number of approaches to storing data across a collection of disks, including mirroring (RAID1), striping (RAID0), striping with parity (RAID5), and striping mirrored copies (RAID10). Related to the RAID standards, other systems have made use of forward error correcting codes, in particular the class of the algorithms commonly called “erasure codes” to allow an encoding of a piece of data into n parts, such that the recovery of any k of n (where k<=n) parts is sufficient to reconstruct the original data. In some distributed storage systems, erasure codes have been used to overcome the more static assignment of data to physical locations that is characteristic of RAID. Erasure coded systems achieve resilience to failure in their coding up front, and have more freedom to place data in response to available capacity and system load. Unfortunately, erasure coding (and parity based RAID) also demand that data be analyzed and transformed as it is accessed. This is a significant limitation on modern storage hardware, because any such transformations add latency to request processing. It is preferable to modify (or even copy) data as little as possible between applications that use it and the devices that store it.
Some aspects disclosed herein utilize an approach to replicating and placing data that is used in systems described herein that provide similar benefits as RAID and FEC-based protocols, but without coding data in flight. Instead, the instantly disclosed systems and methods take advantage of low-latency logic on the network component to allow reads and writes to be forwarded appropriately. With regard to writes, this means dynamically selecting a set of memory resources that satisfies a specified level of replication, and provides the best possible performance. In the case of reads, this involves remembering where the most recent version of a given piece of data has been written, and selecting the best (fastest, least loaded, or other criteria including minimizing power consumption) network component from that set.
In aspects, a replica set may be larger than the number of replicas that are requested for a given object. As such, given a replica set of size n, the system is parameterized for f<n, such that the failure of up to f memory resources may be tolerated. f, which is a function of the failure tolerance threshold, determines the number of replicas required within a replica set of size n in order to ensure that data is never lost. For example, in a set of size n=3, setting f=1 indicates that all data must be written to memory resource replicas; a failure of any single memory resource will still be tolerated with all data lost from that host being replicated on one of the other two. Setting f=3 demands that all data be replicated to all three memory resources, as according to that failure tolerance threshold, the system must survive the failure of all but one replica. In general, the number of replicas to be written, r, must always be at least f+1 (where f+1<=n). Aspects of the system described herein may allow for the mitigation of loads involved in writing large numbers of replicas by achieving some base level of replication (e.g. 2 replicas) and then deferring additional replica writes to some (bounded, short-term) point in the future. A benefit to considering this problem in terms of f/n failure tolerance is that a network interconnect-based system is free to place replicas dynamically on any r hosts within the n-host replica set. This approach to placement has similar characteristics to erasure coding in terms of managing risk through the selection of (k/n codings), however, by specifically characterizing f and n, more direct information about the failures to be tolerated and the domain within which those failures may occur; in other words, n helps characterize the exposure to risk in the system.
In some aspects, an approach for forwarding and placing writes is provided. A network component with a replica set of n memory resources will maintain a set of replica stripes. Each stripe is a collection of r hosts belonging to the replica set. A write request arriving at the network component will be dispatched dynamically, to a single replica stripe. While a complete set of (n choose r) replica stripes is possible, it is typically easier to use a smaller number. Some aspects may use a “chain” of overlapping sets, each offset by a single memory resource. For r=2, n=3 this chained set is ((0,1), (1,2), (2,0)). For r=3, n=5, this is ((0,1,2), (1,2,3), (2,3,4), (3,4,0), (4,0,1)). Other approaches to building replica stripes are possible and reasonable.
In some aspects, the network component tracks the current availability of each replica stripe to serve write requests with maximal performance. It provides the write path with an ordered schedule of stripes that should service new requests. This ordered schedule is based on factors such as the current load (both from other writes and from read traffic) issued against that stripe, available capacity on the storage devices on that stripe, past performance, and known background activity that may contribute to storage performance, or other operational characteristics of memory resources (or, indeed, of the consumer device, the network, the network component, and the data or data object). Note that for many of these criteria, the schedule is influenced by the worst performing memory resource within each replica stripe—indeed, a key purpose in approaches disclosed herein is to pass requests to memory resources that are behaving well and avoid hosts that are failed, overloaded, or otherwise performing poorly. This approach aims to ensure that the forwarded request will complete as quickly and efficiently as possible given the management and configuration constraints of the system.
In aspects, the network component effectively converts a unicast write (i.e. a single write request that is not part of a set of replicas), received by the writing memory resource, into a multicast write to all or some the members of the replica stripe. Multicast in this case does not mandate IP or Ethernet multicast implementations, but rather that the arriving message is forwarded to all members of the selected stripe. Request completions may be held on the switch until all replicas in the stripe acknowledge completion. Alternatively, acknowledgements may be passed back to the writing memory resource, and tracked there. In this latter sense, writes are a combination of the networking concepts of anycast and multicast: The memory resource desires to have the write stored on all members of any single replica stripe.
In some aspects, an approach for forwarding read requests is provided. Reads arrive on the network component addressed for a specific piece of data and must be forwarded to a memory resource in the replica stripe that the data was last written to. In some aspects, the network component maintains a fast-path forwarding table within the mapping resource to map recently accessed data addresses to their associated replica set. In this aspect, other data mappings may be maintained on a slightly slower path and stored in memory on a server that is co-located with the network component or mapping resource (but may also be implemented on the memory of the mapping resource). In all cases, the network component will attempt to forward a read request to the replica set member that is capable of serving it with the lowest latency, while attempting to avoid disrupting other request traffic.
In some aspects, end system software for memory resources is utilized. As mentioned previously in this document, storage lives on end systems (i.e. memory resources) connected to the network component. Aspects herein have installed on thereon software that responds to memory requests that are forwarded from the network component as “micro-arrays” or virtualized “network attached disks” (NADs). The software stack used to manage these memory resources is described in a previously filed provisional patent, U.S. Patent Application No. 61/610,691, filed on Mar. 14, 2012, which is incorporated herein by reference. A log-structured file system is disclosed that virtualizes the address space of underlying storage devices and allows them to be accessed in an efficient, durable, and high performance manner. Any of the virtualized memory resources may operate, from the perspective of the network component and/or the consumer device, in the same manner as any other form of physical memory resource.
Aspects that perform write balancing are provided, including the following. The network component has access to all memory requests and is therefore positioned to balance write loads; the network component is configured in some aspects to be responsible for allocation of responsible memory resources and then associating data to locations in such memory resources by maintaining corresponding associations in the mapping resource. For example, when a write arrives at the network component, it will send it to the least-loaded memory resource, potentially in a round-robin manner. It will in some aspects maintain the mapping of logical address (i.e. data address) to physical address (i.e. information relating to a storage location) as part of an in-memory tree. This mapping will also be stored in the log write itself, allowing consistency to be restored in the event that the network component crashes. To recover from such a crash, the network component must have an accurate list of memory resources involved in the storage system. The network component may in some aspects be configured to flush switch-level mappings (i.e. obtain look-up table on other conventional network switches on the network or on the network switch of the network component itself).
Since data may need to be available even if the memory resource on which it resides fails or becomes overloaded, the network component itself should do fairly simple forwarding and certainly should not be involved in coding of data, particularly depending on the operational characteristics of the available memory resources; for example, on flash memory, erasure coding schemes may be inefficient, so it is more efficient to just store replicas and maintain the multiple mappings in the mapping resource and allow the mapping resource to provide routing information for the network switch of the network component. At the least, the network component can help with replication by avoiding sending duplicate copies from memory resource to network component on the write path. The network component can duplicate the message and send it out appropriately at that point by, for example, multicast (i.e. a single write request that is part of a set of replicas). Other examples include the use of extensibility on the network component itself if multicast fails to work as desired.
When writing, consumer devices may write into an object address space (i.e. data address) as described above. If replication should be provided, the network component may maintain replication groups as single storage location addresses. These destinations may in fact be IPv4/IPv6 multicast groups. The network component can do fork/join replication here: a write comes in, it is dispatched to all members of the replica group as part of the forwarding rules (i.e. routing scheme). An entry representing the unacknowledged request is added to an outstanding request list. This list is used to return acknowledgements to the writer only when all replicas have completed. To avoid large amounts of outstanding state, this can be implemented as a statically sized, per-port list on the network component's incoming port that is assigned to the consumer device or devices that are sending the write requests that must be maintained on such a list. If outstanding slots are overwritten, they can be failed back to the sender (i.e. consumer device) or, in some aspects, as a timeout. Requests can have a nonce to avoid late, expired completions from overwriting slots that have been reused.
Referring to
With reference to
In one aspect, the hardware utilized includes the following dense, high-performance storage technologies: (a) PCIe Flash SSD (e.g. Intel 910) having 800 GB, Random 4K at 70K IOPS Sequential Read at 200K IOPS; (b) Microserver Chassis (e.g. Quanta STRATOS 5900-X31A) 24 Servers in 3RU PCIe flash device and 10 Gb NIC; and (c) 10 Gb SDN Switch (e.g. Arista 7050T) 48 port (stackable) full-mesh. Aspects described herein may be based on a (still very dense) modular 2u server enclosure that allows four flash devices as independent modules, each with their own CPU and 10 Gb NIC.
An exemplary NAD object interface, summarized in
Aspects of the instantly disclosed subject matter may utilize the performance characteristics of fast storage memories that lend themselves to a dispatch-oriented programming model in which a pipeline of operations is performed on requests as they are passed from an originating client (i.e. a consuming device), through a set of transformations, and eventually to the appropriate storage device(s). Similarity to packet processing systems such as X-Kernel, Scout, and Click may be utilized, but are adapted to a storage context, in which modules along the pipeline perform translations through a set of layered address spaces, and may fork and/or collect requests and responses as they are passed. Composable dispatch implementation is structured as a library that may either be used to construct network storage protocol implementations as servers, or be linked directly into OS or application code. For example, it can provide an NFS interface to shared storage for conventional machines, while simultaneously exposing a low-level key/value interface for more specialized applications. NAD implementation in disclosed aspects may isolate these consumers from one another, while the modular dispatch library allows reuse of common translations to achieve functionalities such as replication and striping. Instantiations of set of library-based storage components may be described as a storage path. In some aspects, a storage path may be considered as a pipeline of single-purpose storage request processors. Each processor in such aspects takes a storage request (e.g., a read or write request) as input from its predecessor, and produces one or more requests to its children. Processors are used to express mappings between address spaces. NADs may expose isolated objects, which are sparse address spaces that describe some stored data; processors perform translations that allow multiple objects to be combined for some functional purpose, and present them as a single object, which may in turn be used by other processors.
Data requests are generally acknowledged at the point that they reach a storage device, and so as a result they differ from packet forwarding logic in that they travel both down and then back up through a storage path; processors contain logic to handle both requests and responses. Data requests may also be split or merged as they traverse a processor. For example a replication processor may duplicate a request and issue it to multiple nodes, and then collect all responses before passing a single response back up to its parent. Finally, while processors describe fast, library-based request dispatching logic, they may also utilize additional facilities from the system. Disclosed aspects may allow processor implementations access to APIs for shared, cluster-wide states which may be used on a control path to, for instance, store replica configuration. It may additionally provide facilities for background functionality such as NAD failure detection and response. The intention of the processor organization is to allow dispatch decisions to be pushed out to client implementations and be made with minimal performance impact, while still benefiting from common system-wide infrastructure for maintaining the system and responding to failures.
Some aspects comprise a replication process 710, which allows a request to be split and issued concurrently to a set of replica objects. The request address remains unchanged within each object, and responses are collected until all replicas have acknowledged a request as complete. Reads are passed to the first replica, and in the event of a failure (either an error response or a timeout) they are passed to the next replica. The processor may be parameterized to allow arbitrarily many replicas to be configured. Note that more complex implementations of replication are certainly possible, for instance by issuing reads to all replicas and cross-checking results or round-robin dispatch of reads to balance load among replicas. The replication implementation described above is relatively more simple, and is also what we use in the current system. Also note that the replication processor may not in some aspects contain specific logic for failure recovery. This logic, which is described below, may be handled by a processor component that lies outside the dispatch library.
As exemplified in
Another example processor is that of dynamic mapping, shown in exemplary form in
In some aspects, object maps are backed by normal striped, replicated mapping files. Consuming devices read the file maps themselves, caching whatever parts of the b-tree they access in memory while the object is open, and use a synchronization RPC service to coordinate changes to the maps of open files. The synchronization service may provide transactional map updates, accepting a set of update requests and applying them to the map file atomically through a two-phase commit protocol with all the clients that have the map open. In a preparation phase, consuming devices wait for any outstanding IO to the affected ranges to complete, and block incoming IO to those ranges until the transaction has committed. If all the clients acknowledge the preparation request, the transaction is committed, otherwise it is aborted. Committing the transaction invalidates the affected regions of the map in the client-side cache, causing the updates to be fetched if and when the client next accesses that region of the object. The physical b-tree updates are performed by the RPC service (relying on object snapshots to make the file update atomic). Transactions may optionally use a form of optimistic concurrency control: consuming devices that update the map can register watches on regions of the object. If any of the watched regions have been modified, the transaction will be aborted by the client that performed the modification when an update commit is attempted. The de-duplication service uses this feature to safely remap data in live objects without having to lock IO to the regions it is de-duplicating, minimizing interference with end-user workloads.
Storage paths may be connected sets of processors that provide a top-level dispatch entry point for requests to be issued to.
Allowing consuming devices direct access to storage devices may complicate system reconfiguration tasks that need to be performed in response the failure of devices or the addition of new hardware. Aspects of the instantly disclosed subject matter therefore must handle reconfigurations in a manner that interferes with client workloads as little as possible, and must be able to reconfigure client dispatch instances safely and efficiently. The system achieves reconfiguration through a set of mechanisms: First, as NADs are well-balanced network, compute, and storage pairings, they tend to have slack computing resources when the system is not running at peak load. Aspects disclosed herein provide a background job scheduling framework in which tasks may be registered in a work queue that is held in cluster-wide state, and then scheduled for execution on one or more NADs as resources become available. Second, the system may have a physical state monitoring service that generates events in response to physical failures and hardware warnings, such as SMART reporting from flash devices. Third, processor-specific backend logic can run on the NADs and react to environmental changes in the system. These processor backends register for relevant change requests, are able to issue queries against system's set of OID records, and can then queue background tasks to reconfigure the system. Tasks often begin with a data movement operation, for instance rebuilding a lost replica on a new NAD. When the requested data movement is complete, they update relevant records in the ODI namespace to “wire in” the configuration change. Finally, they use a notification mechanism to request that clients reload the dispatch graphs for affected objects. It is worth noting that the task and cluster state logic is very separate from the NAD-based object interface that we discussed at the start of this section. The computing resources on the individual NADs may aggregate to form what can effectively be considered a hosting environment for the higher-level cluster management and background storage services that the system uses to manage them. These services may be control-path facilities that are completely isolated from the client/NAD request path. Multiple sets of network interactions may run on independent VLANs.
In aspects, it may be determined that a NAD has failed in response to either a reported hardware failure from a responsive NAD (such as a failed flash device) or a NAD that stops responding to requests for more than a configurable timeout (currently one minute). At this point, the replication processor backend may be configured to execute, and is responsible for recovering the data redundancy that was lost with the failing NAD.
Similar to rebuilding lost data after a failure, a striping process backend responds to the addition of new hardware by migrating stripes onto new NADs as they are attached. The striping module 715 shown in
De-duplication may be considered as a enterprise storage feature where regions of coincidentally identical data in different objects or offsets are stored just once. This feature can result in dramatic capacity savings for backup systems but is also valuable when it can extend the capacity of non-volatile memory, which has a relatively high per-GB cost. Aspects of the instantly disclosed subject matter uses a hybrid approach to de-duplication, in which the memory and CPU intensive de-duplication process is done out-of-band, but is driven by lightweight hints that are calculated on the write path in order to minimize the overall I/O load on the system. De-duplication hints are stored in a file with a header specifying the object address, then a series of tuples containing a lightweight 32 b hash, the region size, and the object offset. Aspects disclosed herein may use an extensibility interface to the write paths of our NFS server, wherein a background task such as de-duplication can register a small code module. An interface may be utilized to collect hints and to regularly write them to /.dedup/hints, a reserved path in the namespace.
In some aspects, there is disclosed a de-duplication engine that runs as a background task and consumes these hints. A pseudocode implementation of this loop is shown in
Disclosed aspects provide a mechanism for isolating network resources and connectivity between tenants that share common physical servers and switching. Some disclosed aspects utilize a managed network to enforce isolation between independent endpoints. In aspects, integration with both OpenFlow-based switches, and software switching at the VMM to ensure that data objects are only addressable by their authorized clients. Some implementation use Ethernet VLANs, based on the observation that this was a hardware-supported isolation approach that was in common use in enterprise environments. Additional implementations use OpenFlow, because it provided a more flexible tunneling abstraction for traffic isolation. In some aspects, the control path is initially mapped to clients at a preconfigured IP address. Consuming device connections to the control interface can be authenticated in one of two ways: either through a shared secret that is configured on each consuming device, or by storing a list of valid MAC addresses for consuming devices. End-to-end authentication to establish private connections to NADs can be used, which also incurs configuration overhead in managing individual client keys. The second option assumes that the environment is capable of enforcing unforgeable Ethernet MAC addresses, which is a reasonable assumption in enterprise environments, as MACs can be validated and enforced by VMMs or network hardware.
In some aspects, an objective of one or more of the NADs is to give multiple consuming devices low-latency access to shared flash storage, through a sparse, byte addressable object interface to the higher layers. The objects are also versioned for synchronization: when a NAD is brought online, it may have out-of-date copies of replicated objects. The replication service needs to copy just the differences between the version already on the NAD and the current state. Some NAD implementations use a log-structured object store. Writes are written as self-describing records to a continuous log and then garbage-collected in large contiguous segments. Metadata is held in btrees, which are themselves written out to disk in a tog. A log may be used so that both writes and deletion happen in contiguous chunks for good performance on flash memory. The garbage collector empties segments by copying any live data to the head of the log. It maintains the invariant that replaying the data log will always reproduce the correct object state, which is useful for debugging and error recovery. In order to handle write-heavy workloads, the garbage collector is multithreaded so that it can clean more than one area at a time. The log structure gives good write performance: incoming writes can be acknowledged after a single write to flash, with metadata flushed asynchronously. Read performance is better than for log-structured systems on disk because there is no seek latency, but still requires a large in-memory cache of metadata btrees. Also, because a common workload in virtualized datacenters is random aligned reads and writes of about the same size as the underlying block size, such writes must be placed so that the data is aligned on block boundaries. Otherwise each block-sized read would need to read two blocks from disk. Versioning and synchronization is managed by sequence numbers. Every.).
Although the invention has been described above by reference to certain aspects and examples of the invention, the invention is not limited to the aspects described above. Modifications and variations of the aspects described above will occur to those skilled in the art in light of the above teachings.
|
https://patents.google.com/patent/US9390055B2/en
|
CC-MAIN-2018-51
|
en
|
refinedweb
|
If (xcnt < 2) return; date = x[0]; time = x[1];
What if we decide to add an error message?
if (xcnt < 2) printf("Timestamp array is too small\n"); return; date = x[0]; time = x[1];
Indeed, this is the ultimate "safe" program - for valid arrays, it never does anything but return, terminating program execution! The code's execution is identical to
if (xcnt < 2) { printf("Timestamp array is too small\n"); } return; date = x[0]; time = x[1];
For quick coding, C lets you omit the { } around a conditional statement, a shortcut most published C programs take advantage of. You will be tempted to take this shortcut, too. Don't! Ever! Always enclose conditional code in braces. The errors introduced by incorrectly matched conditions and subordinate statements are very hard to ferret out. Our original example is better coded like this:
if (xcnt < 2) { return; } date = x[0]; time = x[1];
Note that using braces also lets the compiler catch a missing semicolon, so you get lots of protection by following this simple rule.
Unwinding this example also suggests a rule I mentioned in Chapter 2: Do all your assignments as separate statements, not as part of a more complex expression. Another helpful rule is: Use parentheses around expressions in return statements. For example, if you really did want to return the date after assigning it to a global variable, you might code
if (xcnt < 2) { date = x[0]; return (date); }
This doesn't solve the original problem we looked at, but it does show how to code return statements so you're less likely to be tripped up by other problems with complex expressions.
|
https://www.brainbell.com/tutors/c/Advice_and_Warnings_for_C/Brace_Yourself.html
|
CC-MAIN-2018-51
|
en
|
refinedweb
|
Building the Right Environment to Support AI, Machine Learning and Deep Learning
Watch→
import java.awt.*;
import java.awt.event.*;
public class YourClass implements MouseListener {
// Your constructors and methods here
public void mouseClicked(MouseEvent ev) {
int mask = InputEvent.BUTTON1_MASK - 1;
int mods = ev.getModifiers() & mask;
if (mods == 0) {
// Left button clicked
}
else {
// Right button clicked
}
}
}.
|
http://www.devx.com/tips/Tip/12508
|
CC-MAIN-2018-51
|
en
|
refinedweb
|
RxOdbcData
revoscalepy.RxOdbcData(connection_string: str = None, table: str = None, sql_query: str = None, dbms_name: str = None, database_name: str = None, use_fast_read: bool = True, trim_space: bool = True, row_buffering: bool = True, return_data_frame: bool = True, string_as_factors: bool = False, column_classes: dict = None, column_info: dict = None, rows_per_read: int = 500000, verbose: int = 0, write_factors_as_indexes: bool = False, **kwargs)
Description
Main generator for class RxOdbcData, which extends RxDataSource.
Arguments
connection_string
None or character string specifying the connection string.
table
None or character string specifying the table name. Cannot be used with sqlQuery.
sql_query
None or character string specifying a valid SQL select query. Cannot be used with table.
dbms_name
None or character string specifying the Database Management System (DBMS) name.
database_name
None or character string specifying the name of the database.
use_fast_read
Bool specifying whether or not to use a direct ODBC connection.
trim_space
Bool specifying whether or not to trim the white character of string data for reading.
row_buffering
Bool specifying whether or not to buffer rows on read from the database. If you are having problems with your ODBC driver, try setting this to False.
return_data_frame
Bool indicating whether or not to convert the result from a list to a data frame (for use in rxReadNext only). If False, a list is returned.
string”..
write_factors_as_indexes
Bool value, If True, when writing to an RxOdbcData data source, underlying factor indexes will be written instead of the string representations.
kwargs
Additional arguments to be passed directly to the underlying functions.
Returns
Object of class RxOdbcData.
Example
from revoscalepy import RxOdbcData, RxOptions, rx_write_object, rx_read_object, RxXdfData from numpy import array_equal import os # Establish a connection to an ODBC data source connection_string = 'Driver=SQL Server;Server=.;Database=RevoTestDb;Trusted_Connection=True;' dest = RxOdbcData(connection_string, table = "data") # Write an array to the database my_array = [1,2,3] rx_write_object(dest = dest, key = "my_array", value = my_array) # Retrieve the array from the database array_ds = rx_read_object(src = dest, key = "my_array") array_equal(my_array, array_ds) # True # Write a XDF object to the database sample_data_path = RxOptions.get_option("sampleDataDir") kyphosis = RxXdfData(os.path.join(sample_data_path, "kyphosis.xdf")) rx_write_object(dest = dest, key = "kyphosis", value = kyphosis) # Retrieve the data from the database kyphosis_ds = rx_read_object(src = dest, key="kyphosis")
|
https://docs.microsoft.com/en-us/machine-learning-server/python-reference/revoscalepy/rxodbcdata
|
CC-MAIN-2018-51
|
en
|
refinedweb
|
Java program to check if a matrix is upper triangular matrix or not :
In this tutorial, we will learn how to find if a matrix is upper triangular or not. A matrix is called upper triangular if all the elements of the matrix below the main diagonal is 0. Else, it is not an upper triangular matrix.
Our Java program will first take the inputs for the matrix from the user and then it will check if it is upper triangular or not. For example, below matrix is upper triangular :
1 2 3 0 4 5 0 0 6
The main diagonal is 1-4-6 and all elements are 0 below the diagonal.
How to solve this problem :
Let?s take one example, below matrix is an upper triangular matrix :
1 2 3 4 0 5 6 7 0 0 8 9 0 0 0 10
Let?s try to analyze it :
- row = 0 , total 0 = 0
- row = 1 , total 0 = 1, for column 0
- row = 2 , total 0 = 2, from column 0 to column 1
- row = 3 , total 0 = 3, from column 0 to column 2
So, for line no. i, we will check for all column positions starting from 0 to i - 1. If all are 0, it is not an upper triangular matrix. Else, it is . Let?s do this programmatically :
Java program to check upper triangular matrix :
import java.util.Scanner; class Main { public static void main(String args[]) { //1 int row, col; boolean isUpperTriangular = true; / for (int i = 0; i < row; i++) { for (int j = 0; j < i; j++) { if (inputArray[i][j] != 0) { isUpperTriangular = false; break; } } if (!isUpperTriangular) { break; } } //8 if(isUpperTriangular){ System.out.println("Upper triangular matrix."); }else{ System.out.println("Not an Upper triangular matrix."); } } }
Explanation :
- Create two integers row and col to store the row and columns for the matrix.isUpperTriangular value is a flag to determine if it is a upper triangular or not. If yes, it?s value will be true , else false.
- Create one scanner object to read the user input values. Ask the user to enter the rows count. Read and store it in row variable.
- Similarly, read the total count of columns for the matrix and store it in col variable.
- Create one two dimensional integer array inputArray. The row and columns of this array is save as the user given row and col values.
- Run two for loops and read all elements for the matrix. Read and store them in the two dimensional array.
- Print out the matrix to the user. Since we are storing it in a two dimensional array, add one new line after each row.
- Now, scan all elements of the matrix using two loops. The outer loop will run from i = 0 to i = row -1. Inner loop will run from j = 0 to j = i -1. That means, it will check only the values below the main diagonal of the matrix. Check for each item if it is 0 or not. If not, set the value of isUpperTriangular = false and break from both loop. One break will break from the inner loop. We are checking again using an if and breaking from the outer loop.
- Finally, based on the flag value, print if it is a upper triangular matrix or not.
Sample Output :
Enter total number of rows : 3 Enter total number of columns : 3 Enter element for array[1,1] : 1 Enter element for array[1,2] : 2 Enter element for array[1,3] : 3 Enter element for array[2,1] : 0 Enter element for array[2,2] : 4 Enter element for array[2,3] : 5 Enter element for array[3,1] : 0 Enter element for array[3,2] : 0 Enter element for array[3,3] : 6 You have entered : 1 2 3 0 4 5 0 0 6 -> Upper triangular matrix. -> Not an Upper triangular matrix.
Similar tutorials :
- Java program to check if a Matrix is Sparse Matrix or Dense Matrix
- Java program to find Saddle point of a Matrix
- Java Program to find Transpose of a matrix
- Java program to print an identity matrix
- Java program to print the boundary elements of a matrix
- Java program to subtract one matrix from another
|
https://www.codevscolor.com/java-check-upper-triangular-matrix
|
CC-MAIN-2020-40
|
en
|
refinedweb
|
Write a program to convert octal to Binary in Java :
In this tutorial, we will learn how to convert one octal number to binary in Java. But before that, let’s check what is octal number and what is its relation with binary.
Octal number System :
Octal number system is a base-8 number system, i.e. it uses numbers from 0 to 7. In decimal, we represent each number as base 10 . Similarly, in octal, each number is represented in base 8.
To convert a binary number to octal, start from right and take group of three digits of that number each time. Now, convert each three digits and that will be the octal representation for the number.
For example, let’s take example for 100. Binary representation for 100 is 1100100. Group each number : (1)(100)(100) . Convert each group of binary : (1)(4)(4). i.e. 144 is the octal representation of decimal 100. If we try to convert the octal to decimal = 1(88) + 48 + 41 = 64 + 32 + 4 = 100
To convert a octal number to binary, we can simply convert each digit to binary format. That’s it.
Program to convert Octal number to Binary :
/* *.ArrayList; import java.util.Scanner; /** * Example Class */ public class ExampleClass { /** * System.out.println utility method * * @param value : value to print */ static void print(String value) { System.out.println(value); } /** * Method to convert a decimal number to Binary * * @param no : Decimal number * @return : Binary number in String form */ static String decimalToBinary(int no) { String binaryResult = ""; while (no > 0) { binaryResult = (no % 2) + binaryResult; no = no / 2; } return binaryResult; } /** * Method to convert octal number binary * * @param octal : Octal number * @return : Binary number in string format */ static String octalToBinary(int octal) { String octalResult = ""; int reminder; String binary; while (octal != 0) { //pick each digits of this number and convert it to binary reminder = octal % 10; //convert it to binary binary = decimalToBinary(reminder); if (octal > 8) { //binary number is of length 3. If not, add extra zeros to front . Don't add for the last digit , i.e // for the last iteration if (binary.length() == 1) { binary = "00" + binary; } else if (binary.length() == 2) { binary = "0" + binary; } } //append the binary format to the result string octalResult = binary + octalResult; //reduce the value. If previously it was 332, next time it will be 33 octal = octal / 10; } //return the result return octalResult; } /** * main method for this class */ public static void main(String[] args) { int octalNum; Scanner scanner = new Scanner(System.in); print("Enter a Octal Number : "); octalNum = scanner.nextInt(); print("Binary representation of " + octalNum + " is : " + octalToBinary(octalNum)); } }
How it works :
- Main algorithm of the above program is to take each digit of a number and convert it to a three digit binary number. Append these binary numbers and that will be the output.
- We have two methods here : first one is to convert a octal number to binary : the main method will call it first.
- Next we will pick each digit of the given number . e.g. if the input number is 234, first we will take 4, then 3 and after that 2.
- Each number picked will be converted to its three digit binary representation. For the above example, we will first convert 4 i.e. ‘100’ , then 3 i.e. ‘011’ and finally 2 i.e. ‘010’. But for the last number, i.e. first digit, don’t add any starting ‘0’. So, 2 will be ‘10’.
- Finally append all binary representations and return the result as a String.
Sample Output :
Enter a Octal Number : 112 Binary representation of 112 is : 1001010
Enter a Octal Number : 7 Binary representation of 7 is : 111
Similar tutorials :
- Java 8 example to convert a string to integer stream (IntStream)
- Java program to convert decimal to binary
- Java program to convert a string to lowercase and uppercase
- Java Program to convert an ArrayList to an Array
- Java program to convert a string to an array of string
- How to convert stacktrace to string in Java
|
https://www.codevscolor.com/java-program-convert-octal-binary
|
CC-MAIN-2020-40
|
en
|
refinedweb
|
11628/differences-between-composer-network-and-composer-identity
I am learning hyperledger these days. I have a doubt. "What is the difference between composer network and composer identity.?
For permissions, you can read about the ACLs here ->
'Composer Network' represents the business network entity. 'Composer Identity' refers to a specific blockchain identity that is mapped to a single Participant - defined in a Participant Registry that is contained within the business network in question.
Registries maintain a particular type of view of an Asset, Participant . Registries are also maintained by Composer for Identity or Historical transactions. It allows someone in that business network (given the right authority) to see the current status and history of the ledger, and Registries classify that much like a database table might do - ie depends on the level of details required (eg. Backroom Traders (Participant), Front Office Traders (Participant), Metal Commodities (Assets), Agricultural Commodities (Asset) etc etc) - or could just be rolled up as 'Traders'(Participant) and 'Commodities' (Asset) types if less detail is required. The salient point is you store Participant - or Asset Instances - in their respective type registries.
See the tutorials for examples of Assets and Participants in action:
Hyperledger Composer is an application development framework ...READ MORE
To answer your first query.. Blockchain is ...READ MORE
Coins are cryptocurrencies that are independent and ...READ MORE
Hashgraph uses Superior distributed ledger technology. Hashgraph ...READ MORE
Summary: Both should provide similar reliability of ...READ MORE
This will solve your problem
import org.apache.commons.codec.binary.Hex;
Transaction txn ...READ MORE
To read and add data you can ...READ MORE
When a block is mined, it is ...READ MORE
I had same issue.
I created card ...READ MORE
OR
Already have an account? Sign in.
|
https://www.edureka.co/community/11628/differences-between-composer-network-and-composer-identity?show=11647
|
CC-MAIN-2020-40
|
en
|
refinedweb
|
Ok - so you have everything set up and now you want to change how a particular Resource looks.
For instance, you may want to show a google map for location fields, or even present some values as a graph.
You can do this all by writing your custom components.
Example of overriding how dashboard looks:
AdminBroOptions:
const AdminBroOptions = { ... dashboard: { component: AdminBro.bundle('./my-dashboard-component') }, ... }
Dashboard component:
./my-dashboard-component.jsx
import React from 'react' import { Box } from 'admin-bro' const Dashboard = (props) => { return ( <Box>My custom dashboard</Box> ) } export default Dashboard
As you can see AdminBro uses React as a frontend framework. So before you proceed - make sure you know how react works.
Where you can insert your custom components?
Currently, there are 4 places where you can inject components to alter how AdminBro looks:
- overriding how properties are rendered in PropertyOptions#components by using
componentsobject (PLURAL)
- creating new or update default actions by overriding Action#component param
- changing how the dashboard looks like by using dashboard.component param.
- creating new pages by using AdminPage.
Requiring component
First of all - you have to require them by using AdminBro.bundle function. What it does - it gives your component an unique ID and sends it to the bundling process.
You can do it like this:
{ component: AdminBro.bundle('./path-to-your-jsx-or-tsx-file') }
All files required by AdminBro.bundle has to have one default export - the one with your react component.
You can use either
.jsx or
.tsx extension for your components.
Dependencies
AdminBro bundler gives you the ability to import following dependencies without the need of requiring them in your
package.json file:
State management
Routing
Styling
Other
So you can do something like this:
// your-custom-component.jsx import React from 'react' import { withRouter } from 'react-router-dom' const YourComponent (props) => {...} export default withRouter(YourComponent)
Props passed to components
In your components, you can use props passed by their controlling components.
Currently we have 2 controlling components:
- one for an action: BaseActionComponent with ActionProps
- and one for custom property field: BasePropertyComponent with BasePropertyProps
Dashboard and Pages don't have any controlling component, so they don't receive any props.
Reusing UI Components of AdminBro
AdminBro gives you the ability to reuse its components. You can do this by simply requiring them:
import { Label } from '@admin-bro/design-system' const YourComponent (props) => {( <Label>Some styled text<Label> )}
We divide components internally to 2 groups:
- application components - which requires AdminBro, you can think about them as "smart components"
- and design system components - they don't require AdminBro and you can use them outside of the AdminBro setup.
That is why sometimes you have to import components from 'admin-bro' package and sometimes from '@admin-bro/design-system'.
Each of the components is described with the playground option, so make sure to check out all the documentation of all the components.
One of the most versatile component is a BasePropertyComponent. It allows you to render any property. Combined with useRecord is a powerful tool for building forms.
Theming
We support Theme compatible with standard.
In order to override default colors, fonts, sizes etc., you can put your values in AdminBroOptions.branding.
Using style props
AdminBro components are supercharged with multiple props controlling styles. For instance in order to change color of a module:@admin-bro/design-system.Button you can pass backgroundColor (bg) from the module:@admin-bro/design-system.Theme like that:
<Button bg="primary60"></Button>
For all possible options visit the Theme description.
Adding custom css to components
If using style props is not enough - you can always pass your custom CSS. So for instance let's assume that you would like to overwrite CSS in a Button component. You can do this like that:
import { Button } from '@admin-bro/design-system' const MyButton = styled(Button)` background-color: #ccc; color: ${({theme}) => theme.colors.grey100}; ... `
We use styled-components under the hood so make sure to check out their docs.
Using other AdminBro frontend classes and objects
AdminBro also exposes following classes:
You can use them like this:
import { ApiClient, ViewHelpers } from 'admin-bro'
|
https://adminbro.com/tutorial-writing-react-components.html
|
CC-MAIN-2020-40
|
en
|
refinedweb
|
I want to add two functionalities to my widget. 1 - To launch application by clicking on widget. 2 - To add refresh button on order to update view on the widget which was built with custom rows and list view.
This is my widget file:
[BroadcastReceiver(Label = "@string/widget_name")] [IntentFilter(new string[] { "android.appwidget.action.APPWIDGET_UPDATE" })] [MetaData("android.appwidget.provider", Resource = "@xml/widget_word")] public class WidgetProvider : AppWidgetProvider { public override void OnUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { base.OnUpdate(context, appWidgetManager, appWidgetIds); int N = appWidgetIds.Length; for (int i = 0; i < N; ++i) { RemoteViews remoteViews = updateWidgetListView(context, appWidgetIds[i]); appWidgetManager.UpdateAppWidget(appWidgetIds[i], remoteViews); } } private RemoteViews updateWidgetListView(Context context, int appWidgetId) { RemoteViews header = new RemoteViews(context.PackageName, Resource.Layout.widget_layout); RemoteViews remoteViews = new RemoteViews(context.PackageName, Resource.Layout.text_view_layout); remoteViews.AddView(Resource.Id.lay2, header); Intent svcIntent = new Intent(context, typeof(WidgetService)); svcIntent.SetPackage(context.PackageName); svcIntent.PutExtra(AppWidgetManager.ExtraAppwidgetId, appWidgetId); svcIntent.SetData(Android.Net.Uri.Parse(svcIntent.ToUri(Android.Content.IntentUriType.AndroidAppScheme))); remoteViews.SetViewPadding(Resource.Id.listViewWidget, 0, 90, 0, 0); remoteViews.SetRemoteAdapter(Resource.Id.listViewWidget, svcIntent); remoteViews.SetEmptyView(Resource.Id.listViewWidget, Resource.Id.empty_view); return remoteViews; } }
Answers
I haven't touched this part in a long time, but I have it working. I have done it in this way. Change your WidgetProvider a bit and make a new class called UpdateMachine.
The click event is based on a layout with a OnClick event in UpdateMachine (buildUpdate).
WidgetProvider
UpdateMachine
This takes care off the starting of the application through click.
you can get data from local storage
You can set textViews this way:
I haven't found a way yet to do this through web calls though.
@D3nnis Thank you for your answer. Unfortunately your answer doesn't support list view implementation in widget. Maybe you have some examples with list view?
This is my update service:
and my List provider:
}
Do you want to open the app in general when touching the widget, or do you want to have a different result for each object that you touch in the list.
Can't you use something like this in your WidgetProvider:
You also need to have a good OnStartCommand. If I don't have these lines, the click event doesn't work in any way.
Here is an example that uses the Hello World application and opens the app when you press the HELLO WORLD, CLICK ME! button. I tried to make it as small as possible.
In this case it's using myButton. You can replace it with the whole ListView or with another object.
This is the whole code to make it open the app at a click event. Maybe you could make it work with your code.
UpdateMachine.cs
WidgetExample.cs:
Widget.xml:
Your examples don't work with RemoteViewsService and List Provider. I don't know where should I implement this code in my example:
I don't have buildUpdate function and List Provider extends Java.Lang.Class not component name.
I'm sorry, I can't help you further than this on this subject. I only used Service and not RemoteViewsService.
Maybe you could use the code in OnGetViewFactory or an other override function.
|
https://forums.xamarin.com/discussion/comment/244015
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
ASP.NET Core Blazor dependency injection
Blazor supports dependency injection (DI). Apps can use built-in services by injecting them into components. Apps can also define and register custom services and make them available throughout the app via DI.
DI is a technique for accessing services configured in a central location. This can be useful in Blazor apps to:
- Share a single instance of a service class across many components, known as a singleton service.
- Decouple components from concrete service classes by using reference abstractions. For example, consider an interface
IDataAccessfor accessing data in the app. The interface is implemented by a concrete
DataAccessclass and registered as a service in the app's service container. When a component uses DI to receive an
IDataAccessimplementation, the component isn't coupled to the concrete type. The implementation can be swapped, perhaps for a mock implementation in unit tests.
Default services
Default services are automatically added to the app's service collection.
A custom service provider doesn't automatically provide the default services listed in the table. If you use a custom service provider and require any of the services shown in the table, add the required services to the new service provider.
Add services to an app
After creating a new app, examine the
Startup.ConfigureServices method:
public void ConfigureServices(IServiceCollection services) { // Add custom services here }
The
ConfigureServices method is passed an IServiceCollection, which is a list of service descriptor objects (ServiceDescriptor). Services are added by providing service descriptors to the service collection. The following example demonstrates the concept with the
IDataAccess interface and its concrete implementation
DataAccess:
public void ConfigureServices(IServiceCollection services) { services.AddSingleton<IDataAccess, DataAccess>(); }
Services can be configured with the lifetimes shown in the following table.
The DI system is based on the DI system in ASP.NET Core. For more information, see Dependency injection in ASP.NET Core.
Request a service in a component
After services are added to the service collection, inject the services into the components using the @inject Razor directive.
@inject has two parameters:
- Type – The type of the service to inject.
- Property – The name of the property receiving the injected app service. The property doesn't require manual creation. The compiler creates the property.
For more information, see Dependency injection into views in ASP.NET Core.
Use multiple
@inject statements to inject different services.
The following example shows how to use
@inject. The service implementing
Services.IDataAccess is injected into the component's property
DataRepository. Note how the code is only using the
IDataAccess abstraction:
@page "/customer-list" @using Services @inject IDataAccess DataRepository @if (Customers != null) { <ul> @foreach (var customer in Customers) { <li>@customer.FirstName @customer.LastName</li> } </ul> } @code { private IReadOnlyList<Customer> Customers; protected override async Task OnInitializedAsync() { // The property DataRepository received an implementation // of IDataAccess through dependency injection. Use // DataRepository to obtain data from the server. Customers = await DataRepository.GetAllCustomersAsync(); } }
Internally, the generated property (
DataRepository) is decorated with the
InjectAttribute attribute. Typically, this attribute isn't used directly. If a base class is required for components and injected properties are also required for the base class, manually add the
InjectAttribute:
public class ComponentBase : IComponent { // DI works even if using the InjectAttribute in a component's base class. [Inject] protected IDataAccess DataRepository { get; set; } ... }
In components derived from the base class, the
@inject directive isn't required. The
InjectAttribute of the base class is sufficient:
@page "/demo" @inherits ComponentBase <h1>Demo Component</h1>
Use DI in services
Complex services might require additional services. In the prior example,
DataAccess might require the
HttpClient default service.
@inject (or the
InjectAttribute) isn't available for use in services. Constructor injection must be used instead. Required services are added by adding parameters to the service's constructor. When DI creates the service, it recognizes the services it requires in the constructor and provides them accordingly.
public class DataAccess : IDataAccess { // The constructor receives an HttpClient via dependency // injection. HttpClient is a default service. public DataAccess(HttpClient client) { ... } }
Prerequisites for constructor injection:
- One constructor must exist whose arguments can all be fulfilled by DI. Additional parameters not covered by DI are allowed if they specify default values.
- The applicable constructor must be public.
- One applicable constructor must exist. In case of an ambiguity, DI throws an exception.
Utility base component classes to manage a DI scope
In ASP.NET Core apps, scoped services are typically scoped to the current request. After the request completes, any scoped or transient services are disposed by the DI system. In Blazor Server apps, the request scope lasts for the duration of the client connection, which can result in transient and scoped services living much longer than expected.
To scope services to the lifetime of a component, can use the
OwningComponentBase and
OwningComponentBase<TService> base classes. These base classes expose a
ScopedServices property of type
IServiceProvider that resolve services that are scoped to the lifetime of the component. To author a component that inherits from a base class in Razor, use the
@inherits directive.
@page "/users" @attribute [Authorize] @inherits OwningComponentBase<Data.ApplicationDbContext> <h1>Users (@Service.Users.Count())</h1> <ul> @foreach (var user in Service.Users) { <li>@user.UserName</li> } </ul>
Note
Services injected into the component using
@inject or the
InjectAttribute aren't created in the component's scope and are tied to the request scope.
Additional resources
Feedback
|
https://docs.microsoft.com/en-us/aspnet/core/blazor/dependency-injection?view=aspnetcore-3.0&viewFallbackFrom=aspnetcore-2.2
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
Developing packages & plugins
- Package introduction
- Developing Dart packages
- Developing plugin packages
- Adding documentation
- Publishing packages
- Handling package interdependencies
Package introductionPackage introduction
Packages enable the creation of modular code that can be shared easily. A minimal package consists of:
A
pubspec.yamlfile: A metadata file that declares the package name, version, author, etc.
A
libdirectory containing the public code in the package, minimally a single
<package-name>.dartfile.
Package typesPackage types
Packages can contain several kinds of content:
Dart packages: General packages written in Dart, for example the
pathpackage. Some of these might contain Flutter specific functionality and thus have a dependency on the Flutter framework, restricting their use to Flutter only, for example the
fluropackage.
Plugin packages: A specialized Dart package which contain an API written in Dart code combined with a platform-specific implementation for Android (using Java or Kotlin), and/or for iOS (using ObjC or Swift). A concrete example is the
batteryplugin package.
Developing Dart packagesDeveloping Dart packages
Step 1: Create the packageStep 1: Create the package
To create a Dart package, use the
--template=package flag with
flutter create:
$ flutter create --template=package hello
This creates a package project in the
hello/ folder with the following
specialized content:
lib/hello.dart:
- The Dart code for the package.
test/hello_test.dart:
- The unit tests for the package.
Step 2: Implement the packageStep 2: Implement the package
For pure Dart packages, simply add the functionality inside the main
lib/<package name>.dart file, or in several files in the
lib directory.
To test the package, add unit tests
in a
test directory.
For additional details on how to organize the package contents, see the Dart library package documentation.
Developing plugin packagesDeveloping plugin packages
If you want to develop a package that calls into platform-specific APIs, you need to develop a plugin package. A plugin package is a specialized version of a Dart package, that in addition to the content described above also contains platform-specific implementations written for Android (Java or Kotlin code), for iOS (Objective-C or Swift code), or for both. The API is connected to the platform-specific implementation(s) using platform channels.
Step 1: Create the packageStep 1: Create the package
To create a plugin package, use the
--template=plugin flag with
flutter create.
Use the
--org option to specify your organization, using reverse domain name
notation. This value is used in various package and bundle identifiers in the
generated Android and iOS code.
$ flutter create --org com.example --template=plugin hello
This creates a plugin project in the
hello/ folder with the following
specialized content:
lib/hello.dart:
- The Dart API for the plugin.
android/src/main/java/com/example/hello/HelloPlugin.java:
- The Android platform specific implementation of the plugin API.
ios/Classes/HelloPlugin.m:
- The iOS platform specific implementation of the plugin API.
example/:
- A Flutter app that depends on the plugin, and illustrates how to use it.
By default, the plugin project uses Objective-C for iOS code and
Java for Android code. If you prefer Swift or Kotlin, you can specify the
iOS language using
-i and/or the Android language using
-a. For example:
$ flutter create --template=plugin -i swift -a kotlin hello
Step 2: Implement the packageStep 2: Implement the package
As a plugin package contains code for several platforms written in several programming languages, some specific steps are needed to ensure a smooth experience.
Step 2a: Define the package API (.dart)Step 2a: Define the package API (.dart)
The API of the plugin package is defined in Dart code. Open the main
hello/
folder in your favorite Flutter editor. Locate the file
lib/hello.dart.
Step 2b: Add Android platform code (.java/.kt)Step 2b: Add Android platform code (.java/.kt)
We recommend you edit the Android code using Android Studio.
Before editing the Android platform code in Android Studio, first make sure that
the code has been built at least once (i.e., run the example app from your IDE/editor,
or in a terminal execute
cd hello/example; flutter build apk).
- Launch Android Studio
- Select ‘Import project’ in ‘Welcome to Android Studio’ dialog, or select ‘File > New > Import Project…’’ in the menu, and select the
hello/example/android/build.gradlefile.
- In the ‘Gradle Sync’ dialog, select ‘OK’.
- In the ‘Android Gradle Plugin Update’ dialog, select ‘Don’t remind me again for this project’.
The Android platform code of your plugin is located in
hello/java/com.example.hello/HelloPlugin.
You can run the example app from Android Studio by pressing the ▶ button.
Step 2c: Add iOS platform code (.h+.m/.swift)Step 2c: Add iOS platform code (.h+.m/.swift)
We recommend you edit the iOS code using Xcode.
Before editing the iOS platform code in Xcode, first make sure that
the code has been built at least once (i.e., run the example app from your IDE/editor,
or in a terminal execute
cd hello/example; flutter build ios --no-codesign).
- Launch Xcode
- Select ‘File > Open’, and select the
hello/example/ios/Runner.xcworkspacefile.
The iOS platform code of your plugin is located in
Pods/Development
Pods/hello/Classes/ in the Project Navigator.
You can run the example app by pressing the ▶ button.
Step 2d: Connect the API and the platform codeStep 2d: Connect the API and the platform code
Finally, you need to connect the API written in Dart code with the platform-specific implementations. This is done using platform channels.
Adding documentationAdding documentation
It is recommended practice to add the following documentation to all packages:
- A
README.mdfile that introduces the package
- A
CHANGELOG.mdfile that documents changes in each version
- A
LICENSEfile containing the terms under which the package is licensed
- API documentation for all public APIs (see below for details)
API documentationAPI documentation
When you publish a package, API documentation is automatically generated and published to dartdocs.org, see for example the device_info docs
If you wish to generate API documentation locally on your developement machine, use the following commands:
Change directory to the location of your package:
cd ~/dev/mypackage
Tell the documentation tool where the Flutter SDK is (change to reflect where you placed it):
export FLUTTER_ROOT=~/dev/flutter(on macOS or Linux)
set FLUTTER_ROOT=~/dev/flutter(on Windows)
Run the
dartdoctool (comes as part of the Flutter SDK):
$FLUTTER_ROOT/bin/cache/dart-sdk/bin/dartdoc(on macOS or Linux)
%FLUTTER_ROOT%\bin\cache\dart-sdk\bin\dartdoc(on Windows)
For tips on how to write API documentation, see Effective Dart: Documentation.
Adding licenses to the LICENSE fileAdding licenses to the LICENSE file
Individual licenses inside each LICENSE file should be separated by 80 hyphens on their own on a line.
If a LICENSE file contains more than one component license, then each component license must start with the names of the packages to which the component license applies, with each package name on its own line, and the list of package names separated from the actual license text by a blank line. (The packages need not match the names of the pub package. For example, a package might itself contain code from multiple third-party sources, and might need to include a license for each one.)
Good:
package_1 <some license text> -------------------------------------------------------------------------------- package_2 <some license text>
Also good:
package_1 <some license text> -------------------------------------------------------------------------------- package_1 package_2 <some license text>
Bad:
<some license text> -------------------------------------------------------------------------------- <some license text>
Also bad:
package_1 <some license text> -------------------------------------------------------------------------------- <some license text>
Publishing packagesPublishing packages
Once you have implemented a package, you can publish it on the Pub site, so that other developers can easily use it.
Prior to publishing, make sure to review the
pubspec.yaml,
README.md, and
CHANGELOG.md files to make sure their content is complete and correct. Also, to improve the quality and usability of your package, consider including the items below.
- Diverse code usage examples
- Screenshots, animated gifs, or videos
- A link to the corresponding code repository
Next, run the dry-run command to see if everything passes analysis:
$ flutter pub pub publish --dry-run
(Note the redundant
pub pub, which is needed until issue #33302 is resolved).
Finally, run the actual publish command:
$ flutter pub pub publish
For details on publishing, see the publishing docs for the Pub site.
Handling package interdependenciesHandling package interdependencies
If you are developing a package
hello that depends on the Dart API exposed
by another package, you need to add that package to the
dependencies
section of your
pubspec.yaml file. The code below makes the Dart API
of the
url_launcher plugin available to
hello:
In
hello/pubspec.yaml:
dependencies: url_launcher: ^0.4.2
You can now
import 'package:url_launcher/url_launcher.dart' and
launch(someUrl) in
the Dart code of
hello.
This is no different from how you include packages in Flutter apps or any other Dart project.
But if
hello happens to be a plugin package whose platform-specific code needs access
to the platform-specific APIs exposed by
url_launcher, you also need to add
suitable dependency declarations to your platform-specific build files, as shown below.
AndroidAndroid
In
hello/android/build.gradle:
android { // lines skipped dependencies { provided rootProject.findProject(":url_launcher") } }
You can now
import io.flutter.plugins.urllauncher.UrlLauncherPlugin and access the
UrlLauncherPlugin
class in the source code at
hello/android/src.
iOSiOS
In
hello/ios/hello.podspec:
Pod::Spec.new do |s| # lines skipped s.dependency 'url_launcher'
You can now
#import "UrlLauncherPlugin.h" and access the
UrlLauncherPlugin class in the source code
at
hello/ios/Classes.
|
https://flutter.dev/docs/development/packages-and-plugins/developing-packages
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
A menu bar represents a list of menus which can be added to the top of a top-level window. Each menu is associated with a drop-down list of menu items. The concept of menu bar can be implemented by using three Java classes: JMenuBar, Menu and JMenuitem. A menu bar is represented by the object of class JMenuBar in which only the default constructor is defined. A menu bar may consist of one or more menus represented by the objects of the class JMenu. A menu contains a list of menu items represented by the objects of the class JMenuitem.
The JMenu class defines the following constructors.
JMenu () //first
JMenu(String optionName) //second
JMenu(String optionName, boolean removable) //third
The first constructor creates an empty menu. The second constructor creates a menu with the name of the menu specified by optionName. In the third constructor, removable may have one of the two values: true or false. Ifit is true then the menu can float freely in the application window, otherwise it remains attached to the menu bar.
The JMenuitem class defines the following constructors.
JMenuitem () //first
JMenuitem(String itemName) //second
JMenuitem(String itemName, Icon icon) //third
The first constructor creates a menu item with no name and no menu shortcut. In the second constructor, itemName specifies the name of the menu item. In the third constructor, icon specifies the icon associated with the menu item.
A checkable menu item can also be created by using a subclass of JMenuitem called JCheckboxMenuitem.
The JCheckboxMenuitem class defines the following constructors.
JCheckboxMenuitem()
JCheckboxMenuitem(String itemName)
JCheckboxMenuitem(String itemName, boolean checkable)
The first constructor creates an unchecked menu item with no name. The second constructor creates an unchecked menu item with the name of the menu item specified by itemName. In the third constructor, checkable can either be true or false. If it is true then the menu item is initially checked, otherwise it is unchecked.
There are two types of menus which are given below.
• Regular menus: They are placed at the top of the application window within a menu bar.
• Pop-up menus: They appear in the window when the user clicks. For example, a pop-up menu appears on right click of the mouse.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JMenuBar2JavaExample extends JFrame
{
private JMenuBar MnuBar = new JMenuBar();
private JMenu MnuOne = new JMenu("File");
private JCheckBoxMenuItem chkOne = new JCheckBoxMenuItem("Check Box First");
private JCheckBoxMenuItem chkTwo = new JCheckBoxMenuItem("Check Box Second");
private JRadioButtonMenuItem RdoOne = new JRadioButtonMenuItem("Radio Button One");
private JRadioButtonMenuItem RdoTwo = new JRadioButtonMenuItem("Radio Button Two");
private JRadioButtonMenuItem RdoThree = new JRadioButtonMenuItem("Radio Button Three");
private ButtonGroup BtnGrp = new ButtonGroup();
public JMenuBar2JavaExample()
{
setTitle("Menu Bar2 In java Swing");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
setJMenuBar(MnuBar);
MnuBar.add(MnuOne);
MnuOne.add(chkOne);
MnuOne.add(chkTwo);
MnuOne.addSeparator();
MnuOne.add(RdoOne);
MnuOne.add(RdoTwo);
MnuOne.add(RdoThree);
BtnGrp.add(RdoOne);
BtnGrp.add(RdoTwo);
BtnGrp.add(RdoThree);
}
public static void main(String[] ds)
{
JMenuBar2JavaExample frm = new JMenuBar2JavaExample();
final int WIDTH = 170;
final int HEIGHT = 220;
frm.setSize(500,500);
frm
|
http://ecomputernotes.com/java/swing/menubar-example
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
launch a .stl file
Hi Ros Users:
I have a .stl file and I just would like to launch in a gazebo empty world with a .launch. How con I do that?
Thanks a lot !
Hi Ros Users:
I have a .stl file and I just would like to launch in a gazebo empty world with a .launch. How con I do that?
Thanks a lot !
answered 2015-10-19 08:47:15 -0500
You.
Thanks a lot @Stefan Kohlbrecher ! I have fixed it! But now I have another problem... please have a look at... because maybe you can help me. Thanks a lot again
Open the file in SolidWorks and export to URDF using this plug-in. This URDF file can be read in Gazebo. You can find the details and procedure in following links Solidworks teacher blog, Design for gazebo, Willow Garage.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2015-10-19 06:13:17 -0500
Seen: 447 times
Last updated: Oct 19 '15
Using diff drive to drive a new robot
Gazebo simulations not repeatable
Unable to find ros-indigo-gazebo7-ros-pkgs
What means 'ground truth'
Wheel slippery, wrong direction and not straight
how to use "rosparam load" to set specified namespace parameter?
Battery Usage Simulation in Gazebo
rosparam load all yaml-files in folder
Gazebo world from heightmap in Electric/Fuerte
problem loading walls model in gazebo 1.0
|
https://answers.ros.org/question/219390/launch-a-stl-file/
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
I noticed in the TortoiseSVN interface that there is a
"switch" repository command. What about using that? I
don't know what the command line equivalent would be,
but that should be able to let him do what he wants,
no? E.g. The following:
- Do work on repo
- Commit to repo
- Make release
- switch to alternate repo
- Make release
- switch back to primary repo
I think the only issue would be that the alternate
repo would have to have the same layout as the primary
repo. But you should be able to get that if you (a)
exported a release and made that the import of the
alternate's trunk, and (b) committed to the trunk of
the alternate and then made a release from the
alternate.
The process might get a little more muddy depending on
how well the tools handle the merging and such. At
worse case, you might have to check out your release
into a separate directory before doing the switch
process.
FYI - I am not 100% sure this will work - more like
25-50% sure. And wouldn't try it unless someone else
confirmed my line of thought; at least, not in your
normal WC with anything important.
The other alternative of just doing the export and
import into a branch on a separate repo will likely be
cleaner and easier to do though.
Just a thought & 2 cents for the pot.
BRM
--- Steve Greenland <steveg@lsli.com> wrote:
> On Mon, Jan 31, 2005 at 04:00:06PM +0000, abcd
> wrote:
> > --- Petr Smr??ka <smrcka@1sig.cz> wrote:
> > > There will be a trunk of the project accessible
> to
> > > your client
> >
> > That's precisely what I don't want to happen. The
> > client does not (and should not and will never)
> have
> > the visibility of my machines. Is your procedure
> > applicable even in the case of a completely
> > independent repository i.e., one residing on a
> remote
> > machine?
>
> In that case, I think you're stuck with the
> following model:
>
> - In your repo, on the trunk, hack hack hack.
>
> - Create a release for you client by copying to tag.
> (Or merge into
> client branch, or whatever is appropriate.)
>
> - Export the tag.
>
> - Import the export into client repo.
>
> Of course, by doing this, not much is gained by them
> having their own
> repo; you might as well give a tarball. Hmmm, I
> suppose them having a
> repo might make it easier to preview changes,
> revert, etc.
>
> Ahhh, the other approach might be SVK, which does
> support merging
> between repositories. But all I know about SVK I
> read on the web:
>
>
> 31 18:24:31 2005
This is an archived mail posted to the Subversion Users
mailing list.
|
https://svn.haxx.se/users/archive-2005-01/1948.shtml
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
"The."
All this sounded very promising, so I embarked on the journey of installing and configuring buildbot for the application that Titus and I will be presenting at our PyCon tutorial later this month. I have to say it wasn't trivial to get buildbot to work, and I was hoping to find a simple HOWTO somewhere on the Web, but since I haven't found it, I'm jotting down these notes for future reference. I used the latest version of buildbot, 0.7.1, on a Red Hat 9 Linux box. In the following discussion, I will refer to the application built and tested via buildbot as APP.
Installing buildbot
This step is easy. Just get the package from its SourceForge download page and run "python setup.py install" to install it. A special utility called buildbot will be installed in /usr/local/bin.
Update 2/21/06
I didn't mention in my initial post that you also need to install a number of pre-requisite packages before you can install and run buildbot (thanks to Titus for pointing this out):
a) install ZopeInterface; one way of quickly doing it is running the following command as root:
# easy_install
b) install CVSToys; the quick way:
# easy_install
c) install Twisted; there is no quick way, so I just downloaded the latest version of TwistedSumo (although technically you just need Twisted and TwistedWeb):
# wget
# tar jxvf TwistedSumo-2006-02-12.tar.bz2
# cd TwistedSumo-2006-02-12
# python setup.py install
Creating the buildmaster
The buildmaster is the machine which triggers the build-and-test process by sending commands to other machines known as the buildslaves. The buildmaster itself does not run the build-and-test commands, the slaves do that, then they send the results back to the master, which displays them in a nice HTML format.
The build-and-test process can be scheduled periodically, or can be triggered by source code changes. I took the easy way of just triggering it periodically, every 6 hours.
On my Linux box, I created a user account called buildmaster, I logged in as the buildmaster user and I created a directory called APP. The I ran this command:
buildbot master /home/buildmaster/APP
This created some files in the APP directory, the most important of them being a sample configuration file called master.cfg.sample. I copied that file to master.cfg.
All this was easy. Now comes the hard part.
Configuring the buildmaster
The configuration file master.cfg is really just Python code, and as such it is easy to modify and extend -- if you know where to modify and what to extend :-).
Here are the most important sections of this file, with my modifications:
Defining the project name and URL
Search for c['projectName'] in the configuration file. The default lines are:
c['projectName'] = "Buildbot"
c['projectURL'] = ""
I replaced them with:
c['projectName'] = "App"
c['projectURL'] = ""
where App and are the name of the application, and its URL respectively. These values are displayed by buildbot in its HTML status page.
Defining the URL for the builbot status page
Search for c['buildbotURL'] in the configuration file. The default line is:
c['buildbotURL'] = ""
I changed it to:
c['buildbotURL'] = ""
You need to make sure that whatever port you choose here is actually available on the host machine, and is externally reachable if you want to see the HTLM status page from another machine.
If you replace the default port 8010 with another value (9000 in my case), you also need to specify that value in this line:
c['status'].append(html.Waterfall(http_port=9000))
Defining the buildslaves
Search for c['bots'] in the configuration file. The default line is:
c['bots'] = [("bot1name", "bot1passwd")]
I modified the line to look like this:
c['bots'] = [("x86_rh9", "slavepassword")]
Here I defined a buildslave called x86_rh9 with the given password. If you have more slave machines, just add more tuples to the above list. Make a note of these values, because you will need to use the exact same ones when configuring the buildslaves. More on this when we get there.
Configuring the schedulers
Search for c['schedulers'] in the configuration file. I commented out all the lines in that section and I added these lines:
# We build and test every 6 hours
periodic = Periodic("every_6_hours", ["x86_rh9_trunk"], 6*60*60)
c['schedulers'] = [periodic]
Here I defined a schedule of type Periodic with a name of every_6_hours, which will run a builder called x86_rh9_trunk with a periodicity of 6*60*60 seconds (i.e. 6 hours). The builder name needs to correspond to an actual builder, which we will define in the next section.
I also modified the import line at the top of the config file from:
from buildbot.scheduler import Scheduler
to:
from buildbot.scheduler import Scheduler, Periodic
Configuring the build steps
This is the core of the config file, because this is where you define all the steps that your build-and-test process will consist of.
Search for c['builders'] in the configuration file. I commented out all the lines from:
cvsroot = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot"
to:
c['builders'] = [b1]
I added instead these lines:
source = s(step.SVN, mode='update',
baseURL='',
defaultBranch='trunk')
unit_tests = s(UnitTests, command="/usr/local/bin/python setup.py test")
text_tests = s(TextTests, command="/usr/local/texttest/texttest.py")
build_egg = s(BuildEgg, command="%s/build_egg.py" % BUILDBOT_SCRIPT_DIR)
install_egg = s(InstallEgg, command="%s/install_egg.py" % BUILDBOT_SCRIPT_DIR)
f = factory.BuildFactory([source,
unit_tests,
text_tests,
build_egg,
install_egg,
])
c['builders'] = [
{'name':'x86_rh9_trunk',
'slavename':'x86_rh9',
'builddir':'test-APP-linux',
'factory':f },
]
First off, here's what the buildbot manual has to say about build steps:
BuildStepsare usually specified in the buildmaster's configuration file, in a list of “step specifications” that is used to create the
BuildFactory. These “step specifications” are not actual steps, but rather a tuple of the
BuildStepsubclass to be created and a dictionary of arguments. There is a convenience function named “
s” in the
buildbot.process.factorymodule for creating these specification tuples.
In my example above, I have the following build steps: source, unit_tests, text_tests, build_egg and install_egg.
source is a build step of type SVN which does a SVN update of the source code by going to the specified SVN URL; the default branch is trunk, which was fine with me. If you need to check out a different branch, see the buildbot documentation on SVN operations
For different types (i.e. classes) of steps, it's a good idea to look at the file step.py in the buildbot/process directory (which got installed in my case in /usr/local/lib/python2.4/site-packages/buildbot/process/step.py).
The step.py file already contains pre-canned steps for configuring, compiling and testing your freshly-updated source code. They are called respectively Configure, Compile and Test, and are subclasses of the ShellCommand class, which basically executes a given command, captures its stdout and stderr and returns the exit code for that command.
However, I wanted to have some control at least on the text that appears in the buildbot HTML status page next to my steps. For example, I wanted my UnitTest step to say "unit tests" instead of the default "test". For this, I derived a class from step.ShellCommand and called it UnitTests. I created a file called extensions.py in the same directory as master.cfg and added my own classes, which basically just redefine 3 variables. Here is my entire extensions.py file:
from buildbot.process import step
from step import ShellCommand
class UnitTests(ShellCommand):
name = "unit tests"
description = ["running unit tests"]
descriptionDone = [name]
class TextTests(ShellCommand):
name = "texttest regression tests"
description = ["running texttest regression tests"]
descriptionDone = [name]
class BuildEgg(ShellCommand):
name = "egg creation"
description = ["building egg"]
descriptionDone = [name]
class InstallEgg(ShellCommand):
name = "egg installation"
description = ["installing egg"]
descriptionDone = [name]
The two variables that I wanted to customize are description, which appears in the buildbot HTML status page while that particular step is being executed, and descriptionDone, which appears in the status page once the step is finished.
To make master.cfg aware of my custom classes, I added this line to the top of the config file:
from extensions import UnitTests, TextTests, BuildEgg, InstallEgg
Let's look at the custom build steps I added. For the unit_tests step, I'm telling buildbot to run the command python setup.py test on the buildslaves and report back the results. For the text_tests step, the command is /usr/local/texttest/texttest.py, which is where I installed the TextTest acceptance/regression test package. For build_egg and install_egg, I'm running my own custom scripts build_egg.py and install_egg.py on the buildslave, using the BUILDBOT_SCRIPT_DIR variable which I defined at the top of the configuration file as:
BUILDBOT_SCRIPT_DIR = "/home/buildbot/APP/bot_scripts"
As you add more build steps, you need to also add them to the factory object:
f = factory.BuildFactory([source,
unit_tests,
text_tests,
build_egg,
install_egg,
])
The final step in dealing with build steps is defining the builders, which correspond to the buildslaves. In my case, I only have one buildslave machine, so I'm only defining one builder called x86_rh9_trunk which is running on the slave called x86_rh9. The slave will use a builddir named test-APP-linux; this is the directory where the source code will get checked out and where all the build steps will be performed.
Note: the name of the builder x86_rh9_trunk needs to correspond with the name you indicated when defining the scheduler.
Here is again the code fragment which defines the builder:
c['builders'] = [
{'name':'x86_rh9_trunk',
'slavename':'x86_rh9',
'builddir':'test-APP-linux',
'factory':f },
]
We're pretty much done with configuring the buildmaster. Now it's time to create and configure a buildslave.
Creating and configuring a buildslave
On my Linux box, I created a user account called buildbot, I logged in as the buildbot user and I created a directory called APP. The I ran this command:
buildbot slave /home/buildbot/APP localhost:9989 x86_rh9 slavepassword
Note that most of these values have already been defined in the buildmaster's master.cfg file:
- localhost is the host where the buildmaster is running (if you're running the master on a different machine from the one running the slave, you need to indicate here a name or an IP address which is reachable from the slave machine)
- 9989 is the default port that the buildmaster listens on (it is assigned to c['slavePortnum'] in master.cfg)
- x86_rh9 is the name of this slave, and slavepassword is the password for this slave (both values are assigned in master.cfg to c['bots'])
I also created my custom scripts for building and installing a Python egg. I created a sub-directory of APP called bot_scripts, and in there I put build_egg.py and install_egg.py, the 2 scripts that are referenced in the "Build steps" section of the buildmaster's configuration file.
Starting and stopping the buildmaster and the buildslave
To start the buildmaster, I ran this command as user buildmaster:
buildbot start /home/buildmaster/APP
To stop the buildmaster, I used this command:
buildbot stop /home/buildmaster/APP
When I needed the buildmaster to re-read its configuration file, I used this command:
buildbot sighup /home/buildmaster/APP
I used similar commands to start and stop the buildslave, the only difference being that I was logged in as user buildbot and I indicated /home/buildbot/APP as the BASEDIR directory for the buildbot start/stop/sighup commands.
If everything went well, you should be able at this point to see the buildbot HTML status page at the URL that you defined in the buildmaster master.cfg file (in my case this was)
If you can't reach the status page, something might have gone wrong during the startup of the buildmaster. Inspect the file /home/buildmaster/APP/twistd.log for details. I had some configuration file errors initially which prevented the buildmaster from starting.
Whenever the buildmaster is started, it will initiate a build-and-test process. If it can't contact the buildslave, you will see a red cell on the status page with a message such as
In this case, you need to look at the slave's log file, which in my case is in /home/buildbot/APP/twistd.log. Make sure the host name and port numbers, as well as the slave name and password are the same in the slave's buildbot.tac file and in the master's master.cfg file.
If the slave is reachable from the master, then the build-and-test process should unfold, and you should end up with something like this on the status page:
That's about it. I'm sure there are many more intricacies that I have yet to discover, but I hope that this HOWTO will be useful to people who are trying to give buildbot a chance, only to be discouraged by its somewhat steep learning curve.
And I can't finish this post without pointing you to the live buildbot status page for the Python code base.
14 comments:
Can you go into more detail on how you got BuildBot working on RH9? Doesn't RH9 come with an older version of Python that the newer versions of Twisted will not work on?
Anyway.. this was a great post.
More details about my setup on the RH9 box:
- I compiled and installed Python 2.4.2 from the tarball on python.org.
- I used the exact versions of Twisted and other required packages that are mentioned in the post.
Cool.. did you replace the default Python installation or did you install 2.4.2 in parallel the to stock version?
I installed Python 2.4.2 in /usr/local/bin, then I renamed /usr/bin/python to something else, so I didn't have to worry about /usr/bin being in front of /usr/local/bin in PATH.
Thanks you very much for this invaluable guide. It really saved me an headhacke ;)
You can avoid all mentioned installation hassles by switching to our Parabuild - it takes three minutes to install.
If only I came across this guide sooner, I would have saved myself a lot of headache about buildbot. :P Now, I just need to figure out how to get the build master to kick off a build when a change in a repository has been detected
EXCELLENT explanation of the create-slave option to buildbot(version 0.7.5). I never did get a clear explanation from the sourceforge buildbot documentation of just which port number was needed. Thank you so much for clarifying that tidbit of knowledge. They should mimick your presentation on that, at sourceforge, to help novices like me get going quicker.
Regards,
Carl E.
The command
buildbot master /home/buildmaster/APP
should be
buildbot create-master /home/buildmaster/APP
Great stuff. Don't be shy to write more like this ;-)
In 0.7.6 and later, c['slaves'] is used instead of c['bots']
This is to help people who find this in the future. IMHO it's much easier to follow than the buildbot manual.
You should think about updating this. But even as it is, this was very useful. Thank you! :)
|
http://agiletesting.blogspot.com/2006/02/continuous-integration-with-buildbot.html
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
Closed Bug 783958 Opened 7 years ago Closed 6 years ago
b2g email client needs its HTML security implementation reviewed
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
People
(Reporter: asuth, Assigned: freddyb)
References
Details
Attachments
(1 file)
The e-mail client may receive HTML e-mails that are full of nefarious badness. We have implemented a defense-in-depth strategy that is believed to be safe. It needs to be reviewed. Our strategy is derived from this discussion on the webapi list: With particular focus on Henri Sivonen's response: The key ideas are that: sandboxed iframes are great but insufficient because they currently have no means of preventing information leakage from displaying images, fetching external resources, or prefetching external resources. (Content policies protect Thunderbird from this.) We could push for a standardized thing along these lines. The pipeline is generally: 1) HTML is sanitized using bleach.js by using document.implementation.createHTMLDocumet to create a document "loaded as data" and then crammed in using innerHTML and traversing the DOM tree and removing everything that's not covered by a whitelist covering tags, attributes (both global and per-tag), and CSS style rules (based on whitelisted properties.) Notes: - Our whitelist does not include <script> tags or any on* attributes. - href's are not whitelisted, but instead a helper function transfers the values (iff they are http/https currently) onto an inert attribute we made up. - src's are not whitelisted, but instead a helper function transfers: a) http/https protocol references onto an external image attribute we made up, b) cid protocol references onto an embedded image attribute we made up, c) discards everything else. - We currently don't whitelist any CSS stuff that could include a url() reference (including shortcuts like 'background'), although we'd want to support this along similar lines to our handling of sources. 2) The sanitized HTML is inserted into an iframe with sandbox="allow-same-origin" set on it. We specify "allow-same-origin" because we need to be able to reach into the DOM tree to perform fix-ups. Since "allow-scripts" is not set, this is believed safe. Sandbox flags are being implemented on Bug 341604 and have not yet landed. We are currently populating the iframe using iframe.contentDocument.open/write/close after setting the sandbox attribute. The spec is clear that a navigation event must take place after the sandbox flag is set for the protection to take place. It's not 100% clear that this covers our current mechanism. Additionally, our app should be protected by CSP that prevents all scripts except from 'self' which should carry over to our same-origin iframe. If we end up implementing the CSP sandbox directive on Bug 671389 that should also constrain the iframe (and potentially avoid any navigation semantics issues). Note that I do not believe the CSP stuff has happened for our app yet. 3) If the user requests embedded images or external images to be displayed, we traverse the DOM tree and transfer the contents of our inert made-up attributes onto the "src" attributes of images as appropriate. For the embedded image case, we map the cid reference to the Blob we stored the image and then use window.URL.createObjectURL. The tentative plan for clicking on links is to add an event listener for clicks and see if the user clicked on an 'a' and then consult the inert place we stashed the href on and then prompt the user with a "do you want to browse to [the actual link you clicked on]". This has not been UX approved yet, but I think is a reasonable way to a) help deal with potential phishing issues and our lack of a display-the-URL-on-hover implementation, and b) provide confirmation the user actually wants to both trigger the browser and for the specific URL, especially since it is easy to mis-interpret a scroll or just fat-finger the wrong link. ## Implementation Details / Source ## - bleach.js fork used: - bleach.js' actual JS logic: - bleach.js' unit tests (which use a different whitelist): - our HTML sanitization whitelist and logic with lots of comments: - our email lib tests related to HTML and sanitization: - our iframe creation logic, also with lots of comments:
Note: This implementation has already landed in gaia and is hooked-up to IMAP accounts, but not ActiveSync accounts. Because MozTCPSocket has not landed, a custom b2g build is currently required in order to be exposed to the implementation or any risks it might have.
Assignee: nobody → ptheriault
Thanks for heaps of info Andrew. I'll digest and get back to you asap.? For example "allow-same-origin-in" and "allow-same-origin-out", or an up/down or inner/outer suffix to the same effect.
. Do you know if we are giving anything up by using "allow-same-origin" (but not allowing script)? Given the inert nature of the document, it seems like the primary risk would be that the HTTP requests related to (remote) image fetches could leak some type of information, such as the referrer. (Link clicks are not currently implemented, but may be dispatched to the browser in such a way that no referrer is generated.) And indeed, when I just ran b2g-desktop with gaia built with DEBUG=1 (so served off of http:// instead of as a packaged zip), the referrer did show up in the logs. However, when I ran without DEBUG and therefore as a packaged app, no referrer goes over the wire to the webserver. It's not clear if the latter behavior is intended or a side effect of the different protocol causing it to be filtered out..
(In reply to Andrew Sutherland (:asuth) from comment #4) > . Yes this was the intention. Apps will be on the web and there is often a need for them to be more privileged than content they frame. Perhaps some future enhancements to <iframe mozbrowser> would make it usable by the email app. It seems that <iframe mozbrowser> may support injection by the parent in future as this would be handy for other apps. All of the restrictions the email client needs would be useful options to the iframe mozbrowser or sandbox so perhaps someday this could be used and simplify the email client. > Do you know if we are giving anything up by using "allow-same-origin" (but > not allowing script)? It seems ok because the HTML has been sanitized so well. ... >. It would seem more appropriate for the User-Agent to indicate the application rather than for it to be exposed in the 'referer', if this is even an issue. There is a need for an app and/or mozbrowser to be able to change the user-agent string, to limit fingerprinting, and perhaps there is a case to be made for the email client app to modify the default user agent too.
Apologies for the delay in getting through this, Andrew. I am working on this as a priority at the moment.
Should have commented on this bug a long time ago: I finished reviewing this code, and didn't find any issues. I performed limited testing by using a modified version of the email app, and injecting malicious content but didn't find any issues. Given the complexity of the problem I think it would be good to develop a custom fuzzer to exercise the sanitization list thoroughly, but I havent had a chance to do this.?
Flags: needinfo?(ptheriault)
Mozilla's Thimble uses slowparse by Atul:
Thanks, Josh! slowparse looks pretty sweet in terms of implementation simplicity, being webby as opposed to requiring a bunch of node shims, having tests, etc. Atul, is there any reason we would want to not use slowparse?
(In reply to Andrew Sutherland (:asuth) from comment #8) >? I'm not aware of any pre-existing solutions. What is the timeline for this change?
Flags: needinfo?(ptheriault)
(In reply to Paul Theriault [:pauljt] from comment #11) > I'm not aware of any pre-existing solutions. What is the timeline for this > change? Migrating the e-mail back-end to live in a worker (bug 814257) is part of the push to make the e-mail app be more responsive/appear faster/etc. I think the dream is that we would uplift all of this stuff to v1.0.1 in the extremely short term (this week/ASAP/unreasonably soon/etc.), but a v1.1 uplift may be more realistic depending on what release management thinks of the risk profile over the various massive changes going on. My sincere apologies for creating this situation by not realizing when I implemented the sanitizer that it was going to be a potentially major problem/change for migrating to a worker instead of a background page. I was betting pretty hard on the background page thing being an option or our workers drastically improving.
Is there any way we could keep the sanitizer in main thread, in addition to the worker ( can you still get the performance increase)? I am concerned about using a new parser - any differences in behavior between the worker parser and the parser in the browser are potential security vulnerabilities. As an aside, I am aware of at least a few security issues on webmaker, not sure if they relate specifically to the parser or not though.
Hi Asuth and b2g folks! So, while I would be totally flattered if you used slowparse, there are a number of things that might not be awesome for your needs, as the parser was created primarily to make HTML easier to learn and manipulate--not to sanitize. Among the potential drawbacks are: * Slowparse uses the DOM API to create an actual DOM tree as it parses through the document. This part of the code is abstracted away into something called a "DOM Builder" [1], so it's possible to make an alternative implementation that doesn't use a page's DOM API directly (e.g. for use in a web worker). Currently, the direct use of the DOM API results in a few bugs [2], although none of them are security vulnerabilities. * Slowparse has never been security reviewed; it also doesn't actually sanitize HTML. A separate extension to Slowparse called "forbidJS" [3] can be used to report errors for the most common uses of JS via script tags, javascript URLs, and event-handling attributes, but these errors are only intended to let users know as early as possible that their JS won't work when published: the JS isn't actually stripped from the HTML--that's done on the server-side, via Bleach. * Slowparse isn't actually a fully-featured HTML5 parser. There are a number of HTML5 "shortcuts" that it's oblivious to [4]. All that said, patches are welcome. I also think that the Popcorn team has been investigating ways to sanitize HTML using JavaScript, at the very least via nodejs, so you might want to consult with them too. [1] [2] [3] [4]
As a status update, Vivien (:vingtetun) has been been porting a worker-thread SAX parser and adapting our bleach.js implementation to use that.
As an update, we had an off-thread discussion where many people thought we should surface a WebAPI for this stuff, but not pure JS implementations were immediately available. Accordingly, Vivien went with using John Resig's "Pure Javascript HTML Parser" available at ejohn.org/blog/pure-javascript-html-parser/. It was only labeled MPL licensed (although was derived from a tri-licensed-including-Apache 2.0 upstream), but I asked John and he kindly has allowed us to use it under Apache 2.0 which is our preferred license for Gaia. There were some potential security bugs in the implementation that I believe I've resolved: - The HTML parser seemed to be under the incorrect impression that you could escape double-quotes with backslashes inside attributes. This was a problem because the sanitizer was up-converting single-quoted attributes and unquoted attributes to become double-quoted attributes. The up-conversion seems reasonable to me, although I don't strongly care, so I've fixed the code to properly escape attributes and added some unit tests to our bleach.js. - Greedy .* match was used for script and style tags so if there was more than one script/style tag in a document, its characters would include everything in between. - The dynamically built regexp for script/style was unsafely case sensitive, so the same thing could happen. I've also made the parser/sanitizer strip and ignore namespace prefixes on tags for the time being. This was done for consistency with the DOM-based implementation (which ignored 'prefix' and 'namespaceURI') rather than out of any security concern. Since we operate on a white-list, namespacing would just cause valid things to become invalid. Although if you white-list 'xmlns' as an attribute, things would become more exciting, including causing CDATA parsing to start needing to happen, which the parser does not support. I still have a bit more to do on cleaning up the parser/sanitizer. I'll ping here again when I am done hacking on it and review/audit can begin. I have created a pull request at which will be what people get pointed at.
Okay, the HTML sanitizer passes both its bleach.js tests and our gaia-email-libs-and-more tests. Paul, the pull request is here if you could take a look or find someone who can take a look: Barring major complications, this will likely land on gaia/master early next week where it will bake for a little before being uplifted to v1.0.1 and v1.1.
Flags: needinfo?(ptheriault)
Thanks for the update Andrew. I'll take a look. I am concerned about the parser quirks, but I will have a look at in the context of other mitigating controls.
Flags: needinfo?(ptheriault)
I've been able to focus more on the CSS parsing side of the house now, and we are going to need to do something more sophisticated than the naive '}', '{', ';' splitting Vivien did as an initial stop-gap implementation. (Which is not really a surprise; I should have called that out in my previous statement that I did not think we were good to go with CSS.) Specifically, this CSS string is able to cause us to pass-through background-image which is undesirable for information leakage purposes: body { /* } */ background-image: url(); /* { color: red; */ } Given that CSS explicitly calls for error recovery that involves parsing matched characters and escapes, I think continuing with the regexp implementation is a bad idea. It looks like the best option is Tab Atkins' "Standards-Based CSS Parser" at and which he introduces in a blog post at. Tab is the editor of the CSS3 spec, and the parser is designed to match the spec at the potential cost of speed/performance. Since Gecko ideally conforms to the spec, this seems like the best way to ensure that what the sanitizer sees is what the Gecko CSS parser would see if it read the same thing. Note that the implementation is currently very limited in terms of unit tests, so we would be relying on the correctness of its translation of the spec at the current time. Because the parser does not include integrated stringification, we would likely want to run the lexer in location-storing mode and slightly modify the parser to operate in a somewhat streaming fashion that allows us to emit or not emit the verbatim text provided as appropriate. The long-term performance plan would be to build up some serious nefarious test coverage before we would consider moving to a parser that might in fact deviate from spec. The other best option would appear to be the caja CSS parser: caja is intended to do things like this, and even has a unit test case for error recovery, but does not have overwhelming coverage at the unit level, at least: There are a number of other pure JS parsers out there too. I have done a brief skim of the readme's and the unit test directories and none of them jump out at me as advertising any specific levels of spec compliance or having specific error recovery unit tests, but it was indeed a very brief skim!
As an update, we went with with the CSS3 syntax spec derived implementation at. This was landed very late on 4/3 in bug 814257. As per previous discussion with :pauljt where I believe consensus was reached on this, we believe the protection provided by CSP and the iframe sandbox that both prevent the execution of JS in the iframe context are keeping us safe from malicious code. The fallout of a failure of the sanitizer is expected to be limited to information leakage that a message is being displayed, namely from URI references that would be actively fetched (images) or pre-fetched (appropriately marked links, DNS?). We continue to err on the side of removing HTML attributes and CSS declarations that *might* contain such references. Bug 857914 has been filed on not erring so much about that.
Assignee: ptheriault → fbraun
The current setup is very cumbersome to setup. htmlchew.js doesn't really work as well in a browser as it's supposed to..where would I get define() for example? :/
This part of the review is done. Please address bug 899070 for a secreview+ :)
I am attaching the test files I produced during my tests. Feel free to play with. :)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
|
https://bugzilla.mozilla.org/show_bug.cgi?id=783958
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
Being at JavaOne you learn about new technologies and the first thing when learning about something new is trying to integrate the technology into e4 on JavaFX.
This time it’s OpenDolphin I learned about and hacked this morning support to integrate open dolphin into your e4 apps which turned out to be really easy. All you need is:
- OSGified OpenDolphin Libs including its dependencies
- Extra Bundle which will provide you a
ClientDolphininstance you can fetch from the the DI container
I’ve pushed both of them to a new github project and afterwards it’s nothing more than create a Part-POJO like this:
public class MyDolphinView { @Inject ClientDolphin clientDolphin; @PostConstruct void init(BorderPane p) { // Default OpenDolphin+JavaFX Code } }
I’ve also checked in a little demo app (you need to run the demo server you can get from the open-dolphin project) which when run looks like this:
Advertisements
Hy Tom! I checked it out, yet there are missing bundles even with e(fx)clipse – IDE 1.0.0.201408150702 org.eclipse.fx.ide.feature.feature.group BestSolution.at installed. Do I need to have a separate target with the resp. runtime? Or otherwise, what feature did you have installed in the IDE to satisfy the requirements?
Bundle ‘org.eclipse.fx.core.databinding’ cannot be resolved MANIFEST.MF
Bundle ‘org.eclipse.fx.ui.databinding’ cannot be resolved MANIFEST.MF
Bundle ‘org.eclipse.fx.ui.di’ cannot be resolved MANIFEST.MF
Bundle ‘org.eclipse.fx.ui.theme’ cannot be resolved MANIFEST.MF
Bundle ‘org.eclipse.fx.ui.workbench.fx’ cannot be resolved MANIFEST.MF
Thanks a lot!
Without setting up a target platform you won’t get anywhere.
Pingback: JavaFX links of the (past few) week(s), October 13 // JavaFX News, Demos and Insight // FX Experience
|
https://tomsondev.bestsolution.at/2014/10/01/e4-on-javafx-and-opendolphin/?shared=email&msg=fail
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
Investors considering a purchase of Mohawk Industries, Inc. (Symbol: MHK) shares, but tentative about paying the going market price of $193.74/share, might benefit from considering selling puts among the alternative strategies at their disposal. One interesting put contract in particular, is the February 2016 put at the $175 strike, which has a bid at the time of this writing of $6.20. Collecting that bid as the premium represents a 3.5% return against the $175 commitment, or a 6.3% annualized rate of return (at Stock Options Channel we call this the YieldBoost ).
Selling a put does not give an investor access to MHK's upside potential the way owning shares would, because the put seller only ends up owning shares in the scenario where the contract is exercised. And the person on the other side of the contract would only benefit from exercising at the $175 strike if doing so produced a better outcome than selling at the going market price. ( Do options carry counterparty risk? This and six other common options myths debunked ). So unless Mohawk Industries, Inc. sees its shares fall 9.5% and the contract is exercised (resulting in a cost basis of $168.80 per share before broker commissions, subtracting the $6.20 from $175), the only upside to the put seller is from collecting that premium for the 6.3% annualized rate of return.
Below is a chart showing the trailing twelve month trading history for Mohawk Industries, Inc., and highlighting in green where the $175 strike is located relative to that history:
The chart above, and the stock's historical volatility, can be a helpful guide in combination with fundamental analysis to judge whether selling the February 2016 put at the $175 strike for the 6.3% annualized rate of return represents good reward for the risks. We calculate the trailing twelve month volatility for Mohawk Industries, Inc. (considering the last 252 trading day closing values as well as today's price of $193.74) to be 22%. For other put options contract ideas at the various different available expirations, visit the MHK Stock Options page of StockOptionsChannel.com.
In mid-afternoon trading on Tuesday, the put volume among S&P 500 components was 822,953 contracts, with call volume at 926,867, for a put:call ratio of 0.89.
|
https://www.nasdaq.com/articles/commit-buy-mohawk-industries-175-earn-63-annualized-using-options-2015-07-28
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
flutter_parsed_text 1.2.3
🔗 Flutter Parsed text
A Flutter package to parse text and extract parts using predefined types like
url,
phone and
Regex.
Usage 💻 #
To use this package, add
flutter_parsed_text as a dependency in your pubspec.yaml file.
import 'package:flutter_parsed_text/flutter_parsed_text.dart';
Working ⚙️ #
ParsedText can receive this paramters & all the RichText parameters:
text: Text that will be parsed and rendered.
style: It takes a
TextStyle object as it's property to style all the non links text objects.
parse: Array of
MatchText object - used for defining structure for pattern matching .
MatchText( type: ParsedType.EMAIL, // predefined type can be any of this ParsedTypes style: TextStyle( color: Colors.red, fontSize: 24, ), // custom style to be applied to this matched text onTap: (url) { // do something here with passed url }, // callback funtion when the text is tapped on ),
You can also define a custom pattern like this:
MatchText( pattern: r"\B#+([\w]+)\b", // a custom pattern to match style: TextStyle( color: Colors.pink, fontSize: 24, ), // custom style to be applied to this matched text onTap: (url) async { // do something here with passed url }, // callback funtion when the text is tapped on )
You can also set RegexOption for the custom regex pattern like so:
MatchText( pattern: r"\B#+([\w]+)\b", // a custom pattern to match regexOptions: RegexOptions( multiLine = false, caseSensitive = false, unicode = false, dotAll = false ) style: TextStyle( color: Colors.pink, fontSize: 24, ), // custom style to be applied to this matched text onTap: (url) async { // do something here with passed url }, // callback funtion when the text is tapped on )
A boolean that show a diffrent text and passes a diffrent text to the callback
eg: Your str is
"Mention [@michel:5455345]" where
5455345 is ID of this user which will be passed as parameter to the callback funtion and
@michel the value to display on interface. Your pattern for ID & username extraction :
/\[(@[^:]+):([^\]]+)\]/i
Displayed text will be :
Mention ^^@michel^^
MatchText( pattern: r"\[(@[^:]+):([^\]]+)\]", style: TextStyle( color: Colors.green, fontSize: 24, ), // you must return a map with two keys // [display] - the text you want to show to the user // [value] - the value underneath it renderText: ({String str, String pattern}) { Map<String, String> map = Map<String, String>(); RegExp customRegExp = RegExp(pattern); Match match = customRegExp.firstMatch(str); map['display'] = match.group(1); map['value'] = match.group(2); return map; }, onTap: (url) { // do something here with passed url }, ),
Example ✍🏻 #
Find the complete example wiring in the Flutter_Parsed_Text example application.
A small example of the ParsedText widget.
ParsedText( text: "[@michael:51515151] Hello this is an example of the ParsedText, links like or are clickable and phone number 444-555-6666 can call too. But you can also do more with this package, for example Bob will change style and David too. foo@gmail.com And the magic number is 42! #react #react-native", parse: <MatchText>[ MatchText( type: "email", style: TextStyle( color: Colors.red, fontSize: 24, ), onTap: (url) { launch("mailto:" + url); }, ), ], )
Found this project useful? ❤️ #
If you found this project useful, then please consider giving it a ⭐️ on Github and sharing it with your friends via social media.
API details 👨🏻💻 #
See the flutter_parsed_text.dart for more API details
License ⚖️ #
Issues and feedback 💭 #
If you have any suggestion for including a feature or if something doesn't work, feel free to open a Github issue for us to have a discussion on it.
[1.2.3]
- ParsedType enum added and fixed a issue where a space was added after the parsed text.
[1.2.2]
- Regex Options added as parameter
[1.2.1]
- Empty List as default value for parse
[1.2.0]
- Key added & In build types inproved & Changed how text parsing works
[1.1.2]
- README.md updated
[1.1.1]
- README.md updated
[1.1.0]
- Replace Text Widget with RichText Widget
[1.0.0]
- Initial Release_parsed_text: ^1_parsed_text/flutter_parsed.
|
https://pub.dev/packages/flutter_parsed_text
|
CC-MAIN-2019-39
|
en
|
refinedweb
|
Hello I'm using Unity Free 4.3.4 for iOS game.
I'm having several plugins for my game: Admob, GameAnalytics, Facebookshare. Then I would like to add In App Purchase and it is Soomla.
When I add Soomla to my existing project, the game crash when trying to purchase an item. So I try using the same Implementation and codes on an empty newly created project and it work just fine. I try deleting the whole plugin from my existing project and re-add but it still the same.
There is one difference. When I build my existing project as xCode, I have to drag some of Soomla's library from Libraries folder to 'Link Binary' to make it runnable. But in my newly created project, I don't have to do anything about this libraries.
Where should the problem comes from? Are there any conflicts between plugins? If so how solve it? Or is there any configuration of the plugin that may be wrong? How should I reset it or delete its cache?
Thank you very much
Hello
You should contact the support team of those involved in the development of the plugin (moreover if you paid for it).
Btw i did not find the plugins you talk about in the asset store.
And yes there could be conflicts between plugins.
Try to add the plugins one by one to your empty project to identify those in conflict.
One more thing, you said it crashed, unity crashes? you have errors? bug splat? (crashes in editor and after build?)
Hello Nerevar thanks for your reply
The In App Purchase is here and the admob plugin is here. I believe that the problem comes from Unity side, project setting, or plugins conflict, because it works very well on empty project. I will try adding plugins one by one to see if there are any conflict.
One thing to note is that I'm upgrading my game version to 1.1 and version 1.0 is working fine with all the plugins.
About the crash, it happens when I test on device when I try purchasing an item (Soomla plugin's.
Integrate Admob in iOS and windows phone
0
Answers
Failed to load 'Assets/Plugins/x86_64/FlexWrapper.dll
1
Answer
Unable to insert joystick in 3d game kit lite
0
Answers
Assets\Plugins\UnityPurchasing\script\InventoryDemo.cs(4,45): error CS0246: The type or namespace name 'IStoreListener' could not be found (are you missing a using directive or an assembly reference?)
0
Answers
com.google.android.gms.ads.MobileAds Issue With Firebase
1
Answer
|
https://answers.unity.com/questions/743519/a-plugin-crash-on-existing-project-but-works-well.html
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
The Plugins module offers items to integrate platform-specific functionality like social networks, analytics or monetization.
Plugins are usually imported with the pattern
import Felgo 3.0 in your qml source code, e.g.:
import Felgo 3.0
If you want to use a plugin on the Build Server you have to indicate which plugins you want to link against. This can be achieved by adding a new key/value pair to your config.json file in your game's qml root directory, e.g.:
"plugins": [ "gamecenter", "flurry" ]
Please have a look at the individual plugin documentation for the required plugin identifier for your import statement and Build Server value.
Voted #1 for:
|
https://felgo.com/doc/plugins-qmlmodule/
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
Hi TzuChiao
Those are great and fair comments!
1. Kafka utilization.
Regarding what is written in link[1], it's correct.
More partitions lead to higher throughput and latency.
But the number of partitions in one Kafka node is limited to some level in
my proposal.
It does not increase infinitely as we would add more servers to support
more concurrent actions.
As I shared in my previous email, all partitions(no matter of topic) would
be evenly distributed among nodes.
So overhead from multiple partitions can be limited in one node, and
topic-wise overhead can be distributed among multiple nodes.
With regard to your question on batch processing, yes, current MessageFeed
fetches messages in batch.
But inherently activation processing can't be done in batch.
Even though it fetches a bunch of messages, invoker should(and does) handle
activation in serial order(concurrently).
Because if they commit offsets in batch, there is a possibility to invoke
actions multiple times in case of failure.
In turn, committing offset is done one by one.
If you are only mentioning about fetching multiple messages, that can be
achieved in my proposal as well because consumers are dedicated to a given
topic and it's safe to fetch multiple messages.
(However, committing offset still works in serial)
Each consumers in a same group will be assigned one partition respectively.
And they can fetch as many messages as they want if they commit offsets one
by one.
2. Resource-aware scheduling.
Actually, I think optimal scheduling based on real resource usage is not
feasible in a current architecture.
This is because real resource resides in invoker side, but scheduling
decision is made by controllers.
And resource status can change in 5ms ~ 10ms as the execution time of
action can be very less.
(I observed 2ms execution time for some actions.)
So all invokers should share their extremely frequently changing status to
all controllers,
and a controller should schedule activations to optimal invokers along with
considering other controllers.
(Because there is a possibility that other controllers can also schedule
activations to same the invoker.)
And all these procedures should be done within lesser than 5ms.
So I think there will always be some gap between real resource usages and
status kept by controllers.
And this is the reason why I made a proposal which utilizes an asynchronous
way.
Regarding sharding concept at loadbalancer, I just refer to it to minimize
the intervention among controllers when scheduling.
Since scheduling for container creation and activations are segregated, and
container creation process can work in an asynchronous way, I think that
would be enough.
If there is a better way to handle this, that would be better.
Finally, regarding the word, autonomous, I just named it because a
container itself can fetch and handle activation messages without any
intervention of invokers : )
Anyway, thank you for very valuable comments.
I hope this would help.
Best regards
Dominic.
2018-06-07 21:55 GMT+09:00 TzuChiao Yeh <su3g4284zo6y7@gmail.com>:
> Hi Dominic,
>
> I really like your proposal! Thanks for your awesome presentation and
> materials, help me a lot.
>
> I have some opinions and questions here about the proposal and previous
> discussions:
>
> 1. About kafka utilization:
>
> First of all, bypassing invokers is a great idea, though this will lead to
> lots of hard work on various runtime. The possibility on utilizing "hot"
> containers and parallelism also looks well.
>
> I'm not a kafka expert at all, but there are some external references
> talking about large number of partitions. [1]
>
> One question here -
>
> From my own investigation, current implementation on messaging (consumer)
> uses batch (offset) to enhance performance. Since your proposed algorithm
> assign each topic to an action, more accurately speaking, each partition to
> a running container. It might drop the capability on using batch and I'm
> not sure that how much overhead will take? Or there might be some advanced
> design for balancing number of partition and offset?
>
> 2. Controller side:
>
> I pay more interests on the future enhancement for extending more states
> (from invokers) for controllers. I.e. the more accurate resource-aware
> scheduling (i.e. memory-aware that Markus proposed in previous dev list),
> package aware scheduling for package caching [2] and control the running
> container's reserved time that you've mentioned ---> warm/hot containers
> utilization.
>
> At the first time, I'm confused of the "autonomous" word maps to your
> algorithm. I think the scheduling logic still sit in controller side (for
> checking lags, limits and so on).
> Seems like the proposed algorithm will not drop out the current sharding
> loadbalancer, can you share more experience or plans on integrating these
> in controller side?
>
> [1]
>-
> topicspartitions-in-a-kafka-cluster/
> [2]
>
> Thanks,
> TzuChiao
>
> Dominic Kim <style9595@gmail.com> 於 2018年6月7日 週四 上午1:08寫道:
>
> > Sorry.
> > Let me share Kafka benchmark results again.
> >
> > | # of topics | Kafka TPS |
> > | 50 | 34,488 |
> > | 100 | 34,502 |
> > | 200 | 31,781 |
> > | 500 | 30,324 |
> > | 1000 | 30,855 |
> >
> > Best regards
> > Dominic
> >
> >
> > 2018-06-07 2:04 GMT+09:00 Dominic Kim <style9595@gmail.com>:
> >
> > > Sorry for the late response Tyson.
> > >
> > > Let me first answer your second question.
> > > Vuser is just the number of threads to send the requests.
> > > Each Vusers randomly picked the namespace and send the request using
> REST
> > > API.
> > > So they are independent of the number of namespaces.
> > >
> > > And regarding performance degradation on the number of users, I think
> it
> > > works a little bit differently.
> > > Even though I have only 2 users(namespaces), if their homeInvoker is
> > same,
> > > TPS become very less.
> > > So it is a matter of the number of actions whose homeInvoker are same
> > > though more the number of users than the number of containers can harm
> > the
> > > performance.
> > > This is because controller should send those actions to the same
> invoker
> > > even though there are other idle invokers.
> > > In my proposal, controllers can schedule activation to any invokers so
> it
> > > does not happen.
> > >
> > >
> > > And regarding the issue about the sheer number of Kafka topics, let me
> > > share my idea.
> > >
> > > 1. Data size is not changed.
> > >
> > > If we have 1000 activation requests, they will be spread among invoker
> > > topics. Let's say we have 10 invokers, then ideally each topic will
> have
> > > 100 messages.
> > > In my proposal, if I have 10 actions, each topic will have 100 messages
> > as
> > > well.
> > > Surely there will be more number of actions than the number of
> invokers,
> > > data will be spread to more topics, but data size is unchanged.
> > >
> > > 2. Data size depends on the number of active actions.
> > >
> > > For example, if we have one million actions, in turn, one million
> topics
> > > in Kafka.
> > > If only half of them are executed, then there will be data only for
> half
> > > of them.
> > > For rest half of topics, there will be no data and they won't affect
> the
> > > performance.
> > >
> > > 3. Things to concern.
> > >
> > > Let me describe what happens if there are more number of Kafka topics.
> > >
> > > Let's say there are 3 invokers with 5 activations each in the current
> > > implementation, then it would look like this.
> > >
> > > invoker0: 0 1 2 3 4 5 (5 messages) -> consumer0
> > > invoker1: 0 1 2 3 4 5 -> consumer1
> > > invoekr2: 0 1 2 3 4 5 -> consumer2
> > >
> > > Now If I have 15 actions with 15 topics in my proposal.
> > >
> > > action0: 0 -> consumer0
> > > action1: 0 -> consumer1
> > > action2: 0 -> consumer2
> > > action3: 0 -> consumer3
> > > .
> > > .
> > > .
> > > action14: 0 -> consumer14
> > >
> > > Kafka utilizes page cache to maximize the performance.
> > > Since the size of data is not changed, data kept in page cache is also
> > not
> > > changed.
> > > But the number of parallel access to data is increased. I think it
> might
> > > be some overhead.
> > >
> > > That's the reason why I performed benchmark with multiple topics.
> > >
> > > # of topics
> > >
> > > Kafka TPS
> > >
> > > 50
> > >
> > > 34,488
> > >
> > > 100
> > >
> > > 34,502
> > >
> > > 200
> > >
> > > 31,781
> > >
> > > 500
> > >
> > > 30,324
> > >
> > > 1,000
> > >
> > > 30,855
> > >
> > > As you can see there are some overheads from increased parallel access
> to
> > > data.
> > > Here we can see about 4,000 TPS degraded as the number of topics
> > increased.
> > >
> > > But we can still support 30K TPS with 1000 topics using 3 Kafka nodes.
> > > If we need more TPS we can just add more nodes.
> > > Since Kafka can horizontally scale-out, if we add 3 more servers, I
> > expect
> > > we can get 60K TPS.
> > >
> > > Partitions in Kafka are evenly distributed among nodes in a cluster.
> > > Each nodes becomes a leader for each partition. If we have 100
> partitions
> > > with 4 Kafka nodes, ideally each Kafka nodes will be a leader for 25
> > > partitions.
> > > Then consumers can directly read messages from different partition
> > leaders.
> > > This is why Kafka can horizontally scale-out.
> > >
> > > Even though the number of topics is increased, if we add more Kafka
> > nodes,
> > > the number of partitions which is managed by one Kafka node would be
> > > unchanged.
> > > So if we can support 30K TPS with 1000 topics using 3 nodes, then we
> can
> > > still get 60K TPS with 2000 topics using 6 nodes.
> > > Similarly, if we have enough Kafka nodes, the number of partitions in
> one
> > > Kafka nodes will be same though we have one million concurrent
> > invocations.
> > >
> > > This is what I am thinking.
> > > If I miss anything, kindly let me know.
> > >
> > > Thanks
> > > Regards
> > > Dominic.
> > >
> > >
> > >
> > >
> > >
> > > 2018-05-26 13:22 GMT+09:00 Tyson Norris <tnorris@adobe.com.invalid>:
> > >
> > >> Hi Dominic -
> > >>
> > >> Thanks for the detailed presentation! It is helpful to go through to
> > >> understand your points - well done.
> > >>
> > >>
> > >> A couple of comments:
> > >>
> > >> - I'm not sure how unbounded topic (and partition) growth will be
> > >> handled, realistically. AFAIK, these are not free of resource
> > consumption
> > >> at the client or.
> > >>
> > >> - In your test it looks like you have 990 vusers example (pdf page
> 121)
> > -
> > >> are these using different namespaces? I ask because I think the
> current
> > >> impl isolates the container per namespace, so if you are limited to
> 180
> > >> containers, I can see how there will be container removal/restarts in
> > the
> > >> case where the number of users greatly outnumbers the number of
> > containers
> > >> - I'm not sure if the test behaves this way, or your "New
> > implementation"
> > >> behaves similar? (does a container get reused for many different
> > >> namespaces?)
> > >>
> > >>
> > >> I'm interested to know if there are any kafka experts here that can
> > >> provide more comments on the topics/partition handling question? I
> will
> > >> also ask for some additional feedback from other colleagues.
> > >>
> > >>
> > >> I will gather some more comments to share, but wanted to start off
> with
> > >> these. Will continue next week after the long (US holiday) weekend.
> > >>
> > >>
> > >> Thanks
> > >>
> > >> Tyson
> > >>
> > >>
> > >> ________________________________
> > >> From: Dominic Kim <style9595@gmail.com>
> > >> Sent: Friday, May 25, 2018 1:58:55 AM
> > >> To: dev@openwhisk.apache.org
> > >> Subject: Re: New scheduling algorithm proposal.
> > >>
> > >> Dear Whiskers.
> > >>
> > >> I uploaded the material that I used to give a speech at last biweekly
> > >> meeting.
> > >>
> > >>
> > >> 2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FOPENW
> > >> HISK%2FAutonomous%2BContainer%2BScheduling&data=02%7C01%
> > >> 7Ctnorris%40adobe.com%7C0c84bff555fb4990142708d5c21dc5e8%7Cf
> > >> a7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636628355491109416
> > >> &sdata=qppUpTRm%2BkTR5EueiLg7Ix6xiGWlzk5WDn3DxJv032w%3D&reserved=0
> > >>
> > >> This document mainly describes following things:
> > >>
> > >> 1. Current implementation details
> > >> 2. Potential issues with current implementation
> > >> 3. New scheduling algorithm proposal: Autonomous Container Scheduling
> > >> 4. Review previous issues with new scheduling algorithm
> > >> 5. Pros and cons of new scheduling algorithm
> > >> 6. Performance evaluation with prototyping
> > >>
> > >>
> > >> I hope this is helpful for many Whiskers to understand the issues and
> > new
> > >> proposal.
> > >>
> > >> Thanks
> > >> Best regards
> > >> Dominic
> > >>
> > >>
> > >> 2018-05-18 18:44 GMT+09:00 Dominic Kim <style9595@gmail.com>:
> > >>
> > >> > Hi Tyson
> > >> > Thank you for comments.
> > >> >
> > >> > First, total data size in Kafka would not be changed, since the
> number
> > >> of
> > >> > activation requests will be same though we activate more topics.
> > >> > Same amount of data will be just split into different topics, so
> there
> > >> > would be no need for more disk space in Kafka.
> > >> > But it will increase parallel processing at Kafka layer, more number
> > of
> > >> > consumers will access to Kafka at the same time.
> > >> >
> > >> > The reason why active/inactive is meaningful in the scene is, the
> size
> > >> of
> > >> > parallel processing will be dependent on it.
> > >> > Though we have 100k and more topics(actions), if only 10 actions are
> > >> being
> > >> > invoked, there will be only 10 parallel processing.
> > >> > The number of inactive topics does not affect the performance of
> > active
> > >> > consumers.
> > >> > If we really need to support 100k parallel action invocation, surely
> > we
> > >> > need more nodes to handle them not only for just Kafka.
> > >> > Kafka can horizontally scale out and number of active topics at some
> > >> point
> > >> > will always be lesser than the total number of topics, Based on my
> > >> > benchmark results, I expect it is enough to take with scale-out of
> > >> Kafka.
> > >> >
> > >> > Regarding topic cleanup, we don't need to clean them up by
> ourselves,
> > >> > Kafka will clean up expired data based on retention configuration.
> > >> > So if the topic is no more activated(the action is no more invoked),
> > >> there
> > >> > would be no actual data though the topic exists.
> > >> > And as I said, even if data exists for some topics, they won't
> affect
> > >> > other active consumers if they are not activated.
> > >> >
> > >> > Regarding concurrent activation PR, it is very worthy change. And
I
> > >> > recognize it is orthogonal to my PR.
> > >> > It will not only alleviate current performance issue but can be used
> > >> with
> > >> > my changes as well.
> > >> >
> > >> > In current logics, controller schedule activations based on hash,
> your
> > >> PR
> > >> > would be much effective if some changes are made on scheduling
> logic.
> > >> >
> > >> > Regarding bypassing kafka, I am inclined to use Kafka because it can
> > act
> > >> > as a kind of buffer.
> > >> > If some activations are not processed due to some reasons such as
> lack
> > >> of
> > >> > resources or invoker failure and so on, Kafka can keep them up for
> > some
> > >> > times and guarantee `at most once` invocation though invocation
> might
> > >> be a
> > >> > bit delayed.
> > >> >
> > >> > With regard to combined approach, I think that is great idea.
> > >> > For that, container states should be shared among invokers and they
> > can
> > >> > send activation request to any containers(local, or remote).
> > >> > As so invokers will utilize warmed resources which are not located
> in
> > >> its
> > >> > local.
> > >> >
> > >> > But it will also introduce some synchronization issue among
> > controllers
> > >> > and invokers or it needs segregation between resources based
> > scheduling
> > >> at
> > >> > controller and real invocation.
> > >> > In the earlier case, since controller will schedule activations
> based
> > on
> > >> > resources status, it is required to synchronize them in realtime.
> > >> > Invokers can send requests to any remote containers, there will be
> > >> > mismatch in resource status between controllers and invokers.
> > >> >
> > >> > In the later case, controller should be able to send requests to any
> > >> > invokers then invoker will schedule the activations.
> > >> > In this case also, invokers need to synchronize their container
> status
> > >> > among them.
> > >> >
> > >> > Under the situation all invokers have same resources status, if two
> > >> > invokers received same action invocation requests, it's not easy to
> > >> control
> > >> > the traffic among them, because they will schedule requests to same
> > >> > containers. And if we take similar approach with what you suggested,
> > to
> > >> > send intent to use the containers first, it will introduce
> increasing
> > >> > latency overhead as more and more invokers joined the cluster.
> > >> > I couldn't find any good way to handle this yet. And this is why I
> > >> > proposed autonomous containerProxy to enable location free
> scheduling.
> > >> >
> > >> > Finally regarding SPI, yes you are correct, ContainerProxy is highly
> > >> > dependent on ContainerPool, I will update my PR as you guided.
> > >> >
> > >> > Thanks
> > >> > Regards
> > >> > Dominic.
> > >> >
> > >> >
> > >> > 2018-05-18 2:22 GMT+09:00 Tyson Norris <tnorris@adobe.com.invalid>:
> > >> >
> > >> >> Hi Dominic -
> > >> >>
> > >> >> I share similar concerns about an unbounded number of topics,
> despite
> > >> >> testing with 10k topics. I’m not sure a topic being considered
> active
> > >> vs
> > >> >> inactive makes a difference from broker/consumer perspective?
I
> think
> > >> there
> > >> >> would minimally have to be some topic cleanup that happens, and
I’m
> > not
> > >> >> sure the impact of deleting topics in bulk will have on the system
> > >> either.
> > >> >>
> > >> >> A couple of tangent notes related to container reuse to improve
> > >> >> performance:
> > >> >> - I’m putting together the concurrent activation PR[1] (to allow
> > reuse
> > >> of
> > >> >> an warm container for multiple activations concurrently); this
can
> > >> improve
> > >> >> throughput for those actions that can tolerate it (FYI per-action
> > >> config is
> > >> >> not implemented yet). It suffers from similar inaccuracy of kafka
> > >> >> ingestion at invoker “how many messages should I read”? But
I think
> > we
> > >> can
> > >> >> tune this a bit by adding some intelligence to Invoker/MessageFeed
> > >> like “if
> > >> >> I never see ContainerPool indicate it is busy, read more next
> time” -
> > >> that
> > >> >> is, allow ContainerPool to backpressure MessageFeed based on
> ability
> > to
> > >> >> consume, and not (as today) strictly on consume+process.
> > >> >>
> > >> >> - Another variant we are investigating is putting a ContainerPool
> > into
> > >> >> Controller. This will prevent container reuse across controllers
> > >> (bad!),
> > >> >> but will bypass kafka(good!). I think this will be plausible for
> > >> actions
> > >> >> that support concurrency, and may be useful for anything that
runs
> as
> > >> >> blocking to improve a few ms of latency, but I’m not sure of
all
> the
> > >> >> ramifications yet.
> > >> >>
> > >> >>
> > >> >> Another (more far out) approach combines some of these is changing
> > the
> > >> >> “scheduling” concept to be more resource reservation and garbage
> > >> >> collection. Specifically that the ContainerPool could be a
> > combination
> > >> of
> > >> >> self-managed resources AND remote managed resources. If no proper
> > >> (warm)
> > >> >> container exists locally or remotely, a self-managed one is
> created,
> > >> and
> > >> >> advertised. Other ContainerPool instances can leverage the remote
> > >> resources
> > >> >> (containers). To pause or remove a container requires advertising
> > >> intent to
> > >> >> change state, and giving clients time to veto. So there is some
> added
> > >> >> complication in the start/reserver/pause/rm container lifecycle,
> but
> > >> the
> > >> >> case for reuse is maximized in best case scenario (concurrency
> > tolerant
> > >> >> actions) and concurrency intolerant actions have a chance to
> > leverage a
> > >> >> broader pool of containers (iff the ability to reserve a shared
> > >> available
> > >> >> container is fast enough, compared to starting a new cold one).
> There
> > >> is a
> > >> >> lot wrapped in there (how are resources advertised, what are the
> new
> > >> states
> > >> >> of lifecycle, etc), so take this idea with a grain of salt.
> > >> >>
> > >> >>
> > >> >> Specific to your PR: do you need an SPI for ContainerProxy? Or
can
> it
> > >> >> just be designated by the ContainerPool impl to use a specific
> > >> >> ContainerProxy variant? I think these are now and will continue
to
> be
> > >> tied
> > >> >> closely together, so would manage them as a single SPI.
> > >> >>
> > >> >> Thanks
> > >> >> Tyson
> > >> >>
> > >> >> [1]
> > >> 2F%2Fgithub.com%2Fapache%2Fincubator-openwhisk%2Fpull%
> > >> 2F2795&data=02%7C01%7Ctnorris%40adobe.com%7C0c84bff555fb4990
> > >> 142708d5c21dc5e8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
> > >> 7C636628355491109416&sdata=WsPtzIMCpQsGQDML8n1Jm%2BbsBj8BWhw
> > >> IJ%2B9wiQjkQOE%3D&reserved=0<http
> > >> >> s://github.com/apache/incubator-openwhisk/pull/2795#pullrequ
> > >> >> estreview-115830270>
> > >> >>
> > >> >> On May 16, 2018, at 10:42 PM, Dominic Kim <style9595@gmail.com
> > <mailto:
> > >> st
> > >> >> yle9595@gmail.com>> wrote:
> > >> >>
> > >> >> Dear all.
> > >> >>
> > >> >> Does anyone have any comments on this?
> > >> >> Any comments or opinions would be greatly welcome : )
> > >> >>
> > >> >> I think we need around following changes to take this in.
> > >> >>
> > >> >> 1. SPI supports for ContainerProxy and ContainerPool ( I already
> > >> opened PR
> > >> >> for this:
> >
> > >> >> 2F%2Fgithub.com%2Fapache%2Fincubator-openwhisk%2Fpull%
> > >> >> 2F3663&data=02%7C01%7Ctnorris%40adobe.com%7Cb2dd7c5686bc466f
> > >> >> 92f708d5bbb8f43d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
> > >> >> 7C636621325405375234&sdata=KYHyOGosc%2BqMIFLVVRO2gYCYZRegfQL
> > >> >> l%2BfGjSvtGI9k%3D&reserved=0)
> > >> >> 2. SPI supports for Throttling/Entitlement logics
> > >> >> 3. New loadbalancer
> > >> >> 4. New ContainerPool and ContainerProxy
> > >> >> 5. New notions for limit and logics to hanlde more fine-grained
> > >> limit.(It
> > >> >> should be able to coexist with existing limit)
> > >> >>
> > >> >> If there's no any comments, I will open a PR based on it one by
> one.
> > >> >> Then it would be better for us to discuss on this because we can
> > >> directly
> > >> >> discuss over basic implementation.
> > >> >>
> > >> >> Thanks
> > >> >> Regards
> > >> >> Dominic.
> > >> >>
> > >> >>
> > >> >>
> > >> >> 2018-05-09 11:42 GMT+09:00 Dominic Kim <style9595@gmail.com
> <mailto:
> > st
> > >> >> yle9595@gmail.com>>:
> > >> >>
> > >> >> One more thing to clarify is invoker parallelism.
> > >> >>
> > >> >> ##*.
> > >> >>
> > >> >> More precisely, I think it is related to Kafka consumer rather
than
> > >> >> invoker. Invoker logic can run in parallel. But `MessageFeed`
seems
> > >> not.
> > >> >> Once outstanding message size reaches max size, it will wait for
> > >> messages
> > >> >> processed. If few activation messages for an action are not
> properly
> > >> >> handled, `MessageFeed` does not consume more message from
> Kafka(until
> > >> any
> > >> >> messages are processed).
> > >> >> So subsequent messages for other actions cannot be fetched or
> delayed
> > >> due
> > >> >> to unprocessed messages. This is why I mentioned invoker
> > parallelism. I
> > >> >> think I should rephrase it as `MessageFeed` parallelism.
> > >> >>
> > >> >> As you know partition is unit of parallelism in Kafka. If we have
> > >> multiple
> > >> >> partitions for activation topic, we can setup multiple consumers
> and
> > it
> > >> >> will enable parallel processing for Kafka messages as well.
> > >> >> Since logics in invoker can already run in parallel, with this
> > change,
> > >> we
> > >> >> can process messages entirely in parallel.
> > >> >>
> > >> >> In my proposal, I split activation messages from container
> > coordination
> > >> >> message(action parallelism), assign more partition for activation
> > >> >> messages(in-topic parallelism) and enable parallel processing
with
> > >> >> multiple
> > >> >> consumers(containers).
> > >> >>
> > >> >>
> > >> >> Thanks
> > >> >> Regards
> > >> >> Dominic.
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >> 2018-05-08 19:34 GMT+09:00 Dominic Kim <style9595@gmail.com
> <mailto:
> > st
> > >> >> yle9595@gmail.com>>:
> > >> >>
> > >> >> Thank you for the response Markus and Christian.
> > >> >>
> > >> >> Yes I agree that we need to discuss this proposal in abstract
way
> > >> instead
> > >> >> in conjunction it with any specific technology because we can
take
> > >> better
> > >> >> software stack if possible.
> > >> >> Let me answer your questions line by line.
> > >> >>
> > >> >>
> > >> >> ## Does not wait for previous run.
> > >> >>
> > >> >> Yes it is valid thoughts. If we keep cumulating requests in the
> > queue,
> > >> >> latency can be spiky especially in case execution time of action
is
> > >> huge.
> > >> >> So if we want to take this in, we need to find proper way to
> balance
> > >> >> creating more containers for latency and making existing containers
> > >> handle
> > >> >> requests.
> > >> >>
> > >> >>
> > >> >> ## Not able to accurately control concurrent invocation.
> > >> >>
> > >> >> Ok I originally thought this is related to concurrent containers
> > rather
> > >> >> than concurrent activations.
> > >> >> But I am still inclined to concurrent containers approach.
> > >> >> In current logic, it is dependent on factors other than real
> > concurrent
> > >> >> invocations.
> > >> >> If RTT between controllers and invokers becomes high for some
> > reasons,
> > >> >> controller will reject new requests though invokers are actually
> > idle.
> > >> >>
> > >> >> ## TPS is not deterministic.
> > >> >>
> > >> >> I meant not deterministic TPS for just one user rather I meant
> > >> >> system-wide deterministic TPS.
> > >> >> Surely TPS can vary when heterogenous actions(which have different
> > >> >> execution time) are invoked.
> > >> >> But currently it's not easy to figure out what the TPS is with
> only 1
> > >> >> kind of action because it is changed based on not only
> heterogeneity
> > of
> > >> >> actions but the number of users and namespaces.
> > >> >>
> > >> >> I think at least we need to be able to have this kind of official
> > spec:
> > >> >> In case actions with 20 ms execution time are invoked, our system
> TPS
> > >> is
> > >> >> 20,000 TPS(no matter how many users or namespaces are used).
> > >> >>
> > >> >>
> > >> >> Your understanding about my proposal is perfectly correct.
> > >> >> Small thing to add is, controller sends `ContainerCreation` request
> > >> based
> > >> >> on processing speed of containers rather than availability of
> > existing
> > >> >> containers.
> > >> >>
> > >> >> BTW, regarding your concern about Kafka topic, I think we may
be
> fine
> > >> >> because,
> > >> >> the number of topics will be unbounded, but the number of active
> > topics
> > >> >> will be bounded.
> > >> >>
> > >> >> If we take this approach, it is mandatory to limit retention bytes
> > and
> > >> >> duration for each topics.
> > >> >> So the number of active topics is limited and actual data in them
> are
> > >> >> also limited, so I think that would be fine.
> > >> >>
> > >> >> But it is necessary to have optimal configurations for retention
> and
> > >> many
> > >> >> benchmark to confirm this.
> > >> >>
> > >> >>
> > >> >> And I didn't get the meaning of eventual consistency of consumer
> lag.
> > >> >> You meant that is eventual consistent because it changes very
> quickly
> > >> >> even within one second?
> > >> >>
> > >> >>
> > >> >> Thanks
> > >> >> Regards
> > >> >> Dominic
> > >> >>
> > >> >>
> > >> >>
> > >> >> 2018-05-08 17:25 GMT+09:00 Markus Thoemmes <
> > markus.thoemmes@de.ibm.com
> > >> <ma
> > >> >> ilto:markus.thoemmes@de.ibm.com>>:
> > >> >>
> > >> >> Hey Dominic,
> > >> >>
> > >> >> Thank you for the very detailed writeup. Since there is a lot
in
> > here,
> > >> >> please allow me to rephrase some of your proposals to see if I
> > >> understood
> > >> >> correctly. I'll go through point-by-point to try to keep it close
> to
> > >> your
> > >> >> proposal.
> > >> >>
> > >> >> **Note:** This is a result of an extensive discussion of Christian
> > >> >> Bickel (@cbickel) and myself on this proposal. I used "I"
> throughout
> > >> the
> > >> >> writeup for easier readability, but all of it can be read as "we".
> > >> >>
> > >> >> # Issues:
> > >> >>
> > >> >> ## Interventions of actions.
> > >> >>
> > >> >> That's a valid concern when using today's loadbalancer. This is
> > >> >> noisy-neighbor behavior that can happen today under the
> circumstances
> > >> you
> > >> >> describe.
> > >> >>
> > >> >> ## Does not wait for previous run.
> > >> >>
> > >> >> True as well today. The algorithms used until today value
> correctness
> > >> >> over performance. You're right, that you could track the expected
> > queue
> > >> >> occupation and schedule accordingly. That does have its own risks
> > >> though
> > >> >> (what if your action has very spiky latency behavior?).
> > >> >>
> > >> >> I'd generally propose to break this out into a seperate discussion.
> > It
> > >> >> doesn't really correlate to the other points, WDYT?
> > >> >>
> > >> >> ##*.
> > >> >>
> > >> >> ## Not able to accurately control concurrent invocation.
> > >> >>
> > >> >> Well, the limits are "concurrent actions in the system". You should
> > be
> > >> >> able to get 5 activations on the queue with today's mechanism.
You
> > >> should
> > >> >> get as many containers as needed to handle your load. For very
> > >> >> short-running actions, you might not need N containers to handle
N
> > >> >> messages
> > >> >> in the queue.
> > >> >>
> > >> >> ## TPS is not deterministic.
> > >> >>
> > >> >> I'm wondering: Have TPS been deterministic for just one user?
I'd
> > argue
> > >> >> that this is a valid metric on its own kind. I agree that these
> > numbers
> > >> >> can
> > >> >> drop significantly under heterogeneous load.
> > >> >>
> > >> >> # Proposal:
> > >> >>
> > >> >> I'll try to rephrase and add some bits of abstraction here and
> there
> > to
> > >> >> see if I understood this correctly:
> > >> >>
> > >> >> The controller should schedule based on individual actions. It
> should
> > >> >> not send those to an arbitrary invoker but rather to something
that
> > >> >> identifies those actions themselves (a kafka topic in your
> example).
> > >> I'll
> > >> >> call this *PerActionContainerPool*. Those calls from the controller
> > >> will
> > >> >> be
> > >> >> handled by each *ContainerProxy* directly rather than being
> threaded
> > >> >> through another "centralized" component (the invoker). The
> > >> >> *ContainerProxy*
> > >> >> is responsible for handling the "aftermath": Writing activation
> > >> records,
> > >> >> collecting logs etc (like today).
> > >> >>
> > >> >> Iff the controller thinks that the existing containers cannot
> sustain
> > >> >> the load (i.e. if all containers are currently in use), it advises
> a
> > >> >> *ContainerCreationSystem* (all invokers combined in your case)
to
> > >> create a
> > >> >> new container. This container will be added to the
> > >> >> *PerActionContainerPool*.
> > >> >>
> > >> >> The invoker in your proposal has no scheduling logic at all (which
> is
> > >> >> sound with the issues lined out above) other than container
> creation
> > >> >> itself.
> > >> >>
> > >> >> # Conclusion:
> > >> >>
> > >> >> I like the proposal in the abstract way I've tried to phrase above.
> > It
> > >> >> indeed amplifies warm-container usage and in general should be
> > >> superior to
> > >> >> the more statistical approach of today's loadbalancer.
> > >> >>
> > >> >> I think we should discuss this proposal in an abstract,
> > >> >> non-technology-bound way. I do think that having so many kafka
> topics
> > >> >> including all the rebalancing needed can become an issue,
> especially
> > >> >> because the sheer number of kafka topics is unbounded. I also
think
> > >> that
> > >> >> the consumer lag is subject to eventual consistency and depending
> on
> > >> how
> > >> >> eventual that is it can turn into queueing in your system, even
> > though
> > >> >> that
> > >> >> wouldn't be necessary from a capacity perspective.
> > >> >>
> > >> >> I don't want to ditch the proposal because of those concerns
> though!
> > >> >>
> > >> >> As I said: The proposal itself makes a lot of sense and I like
it a
> > >> lot!
> > >> >> Let's not trap ourselves in the technology used today though.
> You're
> > >> >> proposing a major restructuring so we might as well think more
> > >> >> green-fieldy. WDYT?
> > >> >>
> > >> >> Cheers,
> > >> >> Christian and Markus
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >
> > >>
> > >
> > >
> >
>
|
http://mail-archives.apache.org/mod_mbox/openwhisk-dev/201806.mbox/%3CCAFEpjOqSShhYR8ULAmRQuUW_Jnx-pqu5sNkmx1yJTCekyfnUYg@mail.gmail.com%3E
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
Trouble with aopc compiled class being loaded with a factoryJeff Black Jun 7, 2006 11:22 AM
We have a bean that we aspectize via "@@org.jboss.cache.aop.AopMarker" using JDK1.4 and JBossCache 1.3.0. This class is included in a jar that is bundled in a war file and deployed to WebLogic 8.1.
We then use a factory class to load this via:
try { clazz = Class.forName(className); } catch (Exception t) { log.fatal("Unable to load '" + key + "' implementation class: '" + className + "'" + ": " + t); log.fatal("Cause: " + t.getCause()); t.printStackTrace(System.err); }
However, this always fails with a java.lang.ExceptionInInitializationError whose getCause() is ArrayIndexOutOfBoundsException: 8.
Decompiling the aspectized class shows that the array in question was created by aopc inside of one of the field interception methods. Commenting out this field in our code just moves the getCause() exception to another field interception method's array.
As a point of reference, removing the @@ annotaion allows the class to loaded without problem.
I'm not sure what's going on here and I could use someone else's perspective. This is great stuff and I am eager to get it up and running.
Thanks, Jeff
1. Re: Trouble with aopc compiled class being loaded with a facBrian Stansberry Jun 7, 2006 12:35 PM (in response to Jeff Black)
This is a total shot in the dark, so please just take it as such:
Have you tried:
try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); clazz = cl.loadClass(className); } catch (Exception t) { log.fatal("Unable to load '" + key + "' implementation class: '" + className + "'" + ": " + t); log.fatal("Cause: " + t.getCause()); t.printStackTrace(System.err); }
2. Re: Trouble with aopc compiled class being loaded with a facben.wang Jun 8, 2006 8:01 AM (in response to Jeff Black)
Have you tried to use it outside WL first? I meant try to load the "instrumented" class using your example in a standalone Java program.
Again, it is also a shot in the dark. :-) But can this be related to the WL classloader?
3. Re: Trouble with aopc compiled class being loaded with a facJeff Black Jun 8, 2006 11:01 AM (in response to Jeff Black)
Thank you for the quick replies. I have removed weblogic from the equation and created the following unit test that gives me the same result.
Note that I originally posted this to the cache forum, because that is where we are headed, but if need be, I could repost this to the AOP forum. We are using jboss-aop-1.3.5.jar, btw. Also I forgor to mention that we are using compile time annotations and aopc.
package com.gestalt.dmit.mcsoa.registrar.presence.jbosscache.impl; /** * A class that blah.... * * @@org.jboss.cache.aop.AopMarker * */ public class JeffImpl { private long _foo; private long _bar; public JeffImpl(long duration, long expires) { _foo = duration; _bar= expires; } }
package com.gestalt.dmit.mcsoa.registrar.presence; import com.gestalt.dmit.mcsoa.registrar.presence.jbosscache.impl.*; import junit.framework.TestCase; public class PresenceSubscriptionFactoryTest extends TestCase { public void testGetJeffInstance() { try { JeffImpl jps = new JeffImpl(Long.MAX_VALUE, Long.MIN_VALUE); assertTrue("JeffImpl came back as incorrect implementation! " + jps.getClass().getName(), jps instanceof JeffImpl); } catch (Exception e) { e.printStackTrace(); } } }
Which throws the following exception:
[gcpunit] ------------- Standard Error ----------------- [gcpunit] java.lang.ArrayIndexOutOfBoundsException: 1 [gcpunit] at com.gestalt.dmit.mcsoa.registrar.presence.jbosscache.impl.JeffImpl._foo_w_$aop(JeffImpl.java) [gcpunit] at com.gestalt.dmit.mcsoa.registrar.presence.jbosscache.impl.JeffImpl.<init>(JeffImpl.java:16) [gcpunit] at com.gestalt.dmit.mcsoa.registrar.presence.PresenceSubscriptionFactoryTest.testGetJeffInstance(PresenceSubscriptionFactory Test.java:12) [gcpunit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [gcpunit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [gcpunit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [gcpunit] at java.lang.reflect.Method.invoke(Method.java:324) [gcpunit] at junit.framework.TestCase.runTest(TestCase.java:154) [gcpunit] at junit.framework.TestCase.runBare(TestCase.java:127) [gcpunit] at junit.framework.TestResult$1.protect(TestResult.java:106) [gcpunit] at junit.framework.TestResult.runProtected(TestResult.java:124) [gcpunit] at junit.framework.TestResult.run(TestResult.java:109) [gcpunit] at junit.framework.TestCase.run(TestCase.java:118) [gcpunit] at junit.framework.TestSuite.runTest(TestSuite.java:208) [gcpunit] at junit.framework.TestSuite.run(TestSuite.java:203)
This is about the simpliest case I could distill our code down to and I am still baffled.
4. Re: Trouble with aopc compiled class being loaded with a facben.wang Jun 8, 2006 11:59 AM (in response to Jeff Black)
I have just tried out a similar test case like yours but still can't reproduce. Can you use load-time instrumentation option to see if the problem is there as well?
Here is the test case:
public void testLoadingClass() { Address addr = new Address(); addr.getClass().getName(); }
Here is Address class that is under JBossCache testsuite.
package org.jboss.cache.aop.test; /** * @@org.jboss.cache.aop.AopMarker */ public class Address { String street = null; String city = null; int zip = 0; public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public int getZip() { return zip; } public void setZip(int zip) { this.zip = zip; } public String toString() { return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip(); } }
5. Re: Trouble with aopc compiled class being loaded with a facJeff Black Jun 8, 2006 2:52 PM (in response to Jeff Black)
Ben and all,
Thank you for your reply and sample code. I have discovered the problem. My class had underscores prefixing the all the instance variable names. This will cause the ArrayIndexOutOfBoundsException.
I verified the same with the sample class Address below. Change all references of
street
to
_street
and you should be able to duplicate the error.
I am new to JBoss products, so if you could tell me where to file this issue with JIRA, I will do so with reproduceable steps.
6. Re: Trouble with aopc compiled class being loaded with a facben.wang Jun 8, 2006 8:03 PM (in response to Jeff Black)
OK. then this is a bug with JBoss Aop. Please file the bug there and Kabir should be able to take care of it.
|
https://developer.jboss.org/message/265124
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
Beginning with XLL+ version 7.0.6, it is possible to shared object handles between XLLs. An object can be constructed in one XLL, and its handle can be passed to a function in a second XLL for use within an add-in function.
For a class to be shared between XLLs, a number of conditions must be satisified.
exported_GetCacheInstance().
HandleCacheInstanceImportManager::RegisterType().
A handle provider XLL that needs to share handles with other XLLs must
export the function
exported_GetCacheInstance().
This function may only be included by one C++ source file in
any particular XLL. For one cpp file, and only one cpp file,
insert
#define NONRTDHANDLES_IMPLEMENT_EXPORT before
the line that includes the handles extension file, e.g.
#define NONRTDHANDLES_IMPLEMENT_EXPORT #include "extensions\StringHandles.h"
Including this line will have the effect that the function
exported_GetCacheInstance() is created and exported.
If the line is not included by any CPP source file, then handles will not be exported for use by other XLLs.
An XLL that uses handles created by another XLL - a consumer XLL -
must instruct the global singleton instance of the
HandleCacheInstanceImportManager object where to find
handles of each type, by calling
HandleCacheInstanceImportManager::RegisterType()
during
OnXllOpenEx(), e.g.:
BOOL CHandleConsumerApp::OnXllOpenEx() { // Inform the controller that handles for the following object types will // be sourced from "HandleProvider.xll" psl::HandleCacheInstanceImportManager::RegisterType(L"Thing", _T("HandleProvider.xll")); psl::HandleCacheInstanceImportManager::RegisterType(L"test::Thing2", _T("HandleProvider.xll")); psl::HandleCacheInstanceImportManager::RegisterType(L"std::map<std::string,std::string>", _T("HandleProvider.xll")); return TRUE; }
The class name argument must be a wide (Unicode) string and must exactly match
the form of the class name used in add-in functions. If a namespace is used
in the add-in function's definition then the namespace must be used
in the
RegisterType() call.
Similarly, if template arguments are used, they must be in exactly the same form as in the add-in function, including white-space.
Note that the XLL name is in standard text form (either ASCII or Unicode depending on the project settings) and that it:
For more details see the SharedHandles sample project.
Next: Grouping arguments >>
|
http://planatechsolutions.com/xllplus7-online/start_handles9.htm
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
Hello,
I want to test Network Bandwidth. I've seen that CommVaut provide a Workflow for this purpose.
So I've download "CvNetworkTestTool Gui" version 11 workflow.
When I run this workflow.
I had this error message:
Error Code: [19:857] Description: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon. Source: <commserve>, Process: Workflow
Could you help me ?
Regards.
Sam
I noticed there are a couple query activities in the workflow that are not properly terminated with semicolons. This needs to be fixed officially, but in the meantime I will private message you a fixed version.
I will then submit the official fix internally.
I checked further into this issue and found that it is officially fixed in the next release of the workflow.
I've retrieve and install your new Workflow.
Now I've the following error message:
"Error Code: [19:857] Description: 'rm' is not recognized as an internal or external command, operable program or batch file. Source: <commserve>, Process: Workflow"
The workflow is not correctly detecting the OS type, therefore the OS decision activity directs to the Unix based commands wherein RM is not a windows command.
This is also fixed in the next version. Let me check when this will be available.
Do you have check when this workflow will be fixed ?
Thanks.
We are actively working on a fix for this issue. We hope to have the fix uploaded to the store on or before friday. Thanks for your patience.
Hi
Please download the updated CvNetworkTestTool Gui workflow.
See store link below.
Let us know if you need further help on this.
Leo
Hi Leo,
I can now run the Workflow.
But I got a error not linked to the Workflow directly since I got the same error with CVNetworkTestTool.exe.
I'll open a new post for that.
Regards,
Sam.
|
http://sso.forum.commvault.com/forums/thread/52890.aspx
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
marble
#include <AbstractWorkerThread.h>
Detailed Description
The AbstractWorkerThread is a class written for small tasks that have to run multiple times on different data asynchronously.
You should be able to use this class for many different tasks, but you'll have to think about Multi-Threading additionally. The AbstractWorkerThread runs the function work() as long as workAvailable() returns true. If there is no work available for a longer time, the thread will switch itself off. As a result you have to call ensureRunning() every time you want something to be worked on. You'll probably want to call this in your addSchedule() function.
Definition at line 36 of file AbstractWorkerThread.h.
Constructor & Destructor Documentation
Definition at line 48 of file AbstractWorkerThread.cpp.
Definition at line 54 of file AbstractWorkerThread.cpp.
Member Function Documentation
Definition at line 59 of file AbstractWorkerThread.cpp.
Reimplemented from QThread.
Definition at line 70 of file AbstractWorkerThread.
|
https://api.kde.org/4.14-api/kdeedu-apidocs/marble/html/classMarble_1_1AbstractWorkerThread.html
|
CC-MAIN-2019-47
|
en
|
refinedweb
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.