text:
The Red Clydesiders Reforms - 1928
The Rt. Hon. Mr. Wheatley Joins The Alliance. (1928)
From the July 1928 issue of the Socialist Standard
It has been calculated that of the rich persons who joined the Labour Party recently 50 per cent. were already candidates and the others were signing the book daily at the "Parliamentary Employment Exchange." ("Daily Herald," 26/6/28.)
The above is from the speech of the Right Hon. John Wheatley, M.P., Minister of Health in the Labour Government of 1924 and supporter of the Holy Catholic Church.
The new alliance of Cook, Maxton, and Wheatley has a programme described by Mr. Wheatley thus :
Cook and Maxton declare that the workers should constitutionally seize the present surplus wealth of the idle rich and use it to give a decent standard of life here and now to the working classes.
So the party of rich candidates (the Labour Party) is going to seize—by taxation—some of the surplus and give it to the poor.
How that is going to affect the exploiting nature of Capitalism Mr. Wheatley doesn't explain. It sounds as revolutionary as Lloyd George's Insurance Act or Gladstone's Death Duties. What this triple alliance want is pathetically put by Wheatley—"You should hit Capitalism oftener and harder." How hard and how often, Mr. Wheatley? To stand for the overthrow of Capitalism, not often but all the time is not their way. And it would not sound as well as Mr. Wheatley's patriotic reformism as made plain in his evidence in his libel action.
Adolph Kohn
By ajohnstone at July 31, 2018 No comments: Links to this post
Some economic history
The Socialist Party talks about class because this is the basic feature of present-day society. The productive resources of society are owned and controlled by a minority class and are run for their benefit. We can't see how any person can deny that we are living in a class society and that this is the all-important social fact that those of us seeking social change must take into account. In fact, that the immense majority are excluded from the ownership and control of productive resources means that there is a group in society that has a material interest in ending this state of affairs by establishing a society of common ownership and democratic control, it means that socialism is not some ideal society to which all people of goodwill are somehow to be converted. It provides it with a basis in social reality, with a group of people—the overwhelming majority, it so happens—who have an interest in establishing it as the practical solution to the problems they face.
Capitalist society is rushing headlong towards barbarism. So long as the mad struggle for profit in this private property economy exists, and it must exist as long as capitalism exists, war, hunger, and environmental destruction is forever the prospect of life. Chaos and misery are forever the rewards of the overwhelming majority of the peoples of all countries. The destruction of the world is a grim reality unless the social order of capitalism is abolished and replaced by socialism, the society of all the people for all the people.
While all the capitalists are incapable and unwilling to produce in the interests of the common good of the people, while production is organised solely in the interests of profit, invention in the interests of society as a whole remains stagnant. New technology which could lighten the lives of the people and produce enough to have plenty for all, is impossible in an economy where the main aim of those who own the industries, mines, transportation, and utilities is production for profit.
Capitalism had not always existed. Capitalist production grew out of individual production of feudal times. The typical feudal form of production was production for local consumption: food, clothing and other articles were produced by the serfs for themselves and for their feudal lords. With the development of a surplus – that is,, more articles than the particular group needed – the surplus was sold in exchange for articles brought in from other countries or from other parts of the country. But the main part of production was still for consumption by the producing group and the lord who had feudal rights over it. It was only when the feudal units began to break up that this form of production gradually gave way to production for profit, which is the essential mark of capitalism. Production for profit required two things: someone with enough resources to buy means of production (looms, spinning-machines and so on); and, secondly, people who had no means of production themselves, no resources by using which they could live. In other words, there had to be "capitalists," who owned means of production, and workers whose only chance of getting a livelihood was to work the machines owned by the capitalists.
The workers produced things, not directly for themselves or for the personal use of their new "lord," the capitalist, but for the capitalist to sell for money. Things made in this way are called "commodities" – that is, articles produced for sale on the market. The worker received wages, the employer received profit.
Tools and instruments of production, of one kind or another, have also existed from time immemorial. But only with the rise of modern capitalism, which is only a few hundred years old, have money and the means of production been converted into what they never were before, namely, capital. More accurately, it is only under modern capitalism that capital becomes dominant, that it pervades and controls and actuates all economic life.
Under slavery and feudalism, the nobility and the landlords owned human chattels or the land and mercilessly exploited the slaves and serfs. But what these slaves and serfs produced beyond the needs of their own wretched existence, was consumed by their overlords. What did they produce? Food, clothing, castles and palaces, and other objects of personal use and consumption. Little or nothing was produced for exchange. There was an accumulation of great personal fortunes, but no accumulation of commodities to speak of. The means of production were simple and primitive, like the hand-plow and the spinning wheel, and their primary purpose was to satisfy the needs of the ruling classes. In addition, there were numerous free producers who owned their own land or their own shops and tools. They were small independent producers.
Modern capitalism arose only with the development of machinery, with the great expansion of production which this made possible, with the expropriation of the independent producers, and the concentration of the means of production in the hands of a few. The means of production became capital when they became the private property of a capitalist minority and were employed for the exploitation of the modern wage-worker.
The peculiarity of capital, which distinguishes it from mere money and mere tools and mere raw materials and mere labor power, is this: All these become capital when they are used for the purpose of accumulating more capital. This is the difference between capitalism and all societies that went before it. The difference is so important that it cannot be over-emphasised.
When the overwhelming majority—the working class, as we define it—take conscious democratic political action to do this, classes can then be abolished and a genuine community with a common social interest created. Production will be switched from production for sale on a market with a view to profit to production to satisfy people's needs. Money—as a means of exchange, a means to buy things produced for sale— will become redundant and disappear. The existence of money and the existence of socialism are incompatible since the existence of money implies the existence both of exchange and of private property whereas socialism, as a society of common ownership and production for use, implies the non-existence of both and so also of the need for money. Under capitalism, money is very useful, indeed indispensable. Without it capitalism could not function; to try to abolish it would lead to chaos and economic breakdown. So we don't stand for the abolition of money now under capitalism. What we stand for is the establishment of the common ownership and democratic control of productive resources; this will allow production to be geared directly to meeting people's needs, so making money unnecessary. A society dominated by money is one of the effects of capitalism, not its cause as you seem to imply. The only way to end the nefarious effects of money that you correctly identify is to establish socialism, where human values can flourish instead of the commercial and financial values that distort and debase our lives today.
Kids without a home
The scale of Scotland's homelessness crisis has been described as "damning" after figures showed the equivalent of 38 children a day were left without somewhere permanent to live last year. Analysis by the charity Shelter Scotland revealed 14,075 children were in households assessed as being homeless in 2017-18 – the equivalent of six or seven pupils for every school.
On one day in March, 6,615 children were living in temporary accommodation – the fourth consecutive year in which the figure has risen, the charity said. It described the scale of child homelessness as "shocking", and said not having a permanent place to live can have "drastic" effects on young people.
Alison Watson, deputy director of Shelter Scotland, said the "acute shortage of housing" lies at the heart of the problem. She said: "The sheer scale of homelessness among children in Scotland is damning on our society. "For the equivalent of a class and a half of schoolchildren to be made homeless every day just isn't right. "The fact families with children then have to endure the limbo of temporary accommodation longer than other homeless households just compounds their misery. This has got to stop."
Further analysis showed that 51 per cent of people who have experienced homelessness had no evidence of health conditions relating to drugs, alcohol or mental health – information the charity said could help dispel "the myth that homelessness is largely a substance abuse issue".
https://www.scotsman.com/news/politics/damning-report-reveals-38-children-made-homeless-in-scotland-each-day-1-4775565
Socialism and the Socialist Party
The modern nation is exclusively a product of capitalism. Nations began to emerge with the growth of trade and formed the framework for the production and distribution of commodities on a capitalist basis. The left-nationalists propose to achieve independence and socialism simultaneously. However, fewer and fewer people still believe that Scottish independence is a step forward in the struggle for socialism. Independence is not the interests of the working class. Workers must unite with the only class whose interests lie unreservedly in eliminating capitalism – the international working class across the world. Class consciousness and national chauvinism do not mix. Socialism, which means the replacement of the present social order by one based upon free and democratic access to the means of living, has been identified with theories of nationalisation, the welfare state and the command economy of state-capitalism. Our political foes have thus been able to attach to the term socialism unfavourable words like bureaucracy, officialdom, red tape. Propaganda and word magic have combined to convert the coinage of political terms into a debased and worthless currency. Now as always, the Socialist Party carry on their work of explaining and clarifying. They must especially denounce the falsity and the hypocrisy of all the nationalist groups. Socialist transformation is not possible without a continuous battle against those who misdirect the working class.
All the politicians will tell you that they have the answers. But their answers fail to solve the problems which face society. After decades of politicians' clever answers, the society we live in is still in a mess, with mass poverty, social insecurity, and environmental destruction getting worse, not better. Politicians tell us that they're running things for our benefit, but capitalism can only be run in the interest of the small minority who own and control the means of producing and distributing goods and services. Capitalism can only be run by treating the working-class as second-class citizens. The Socialist Party says that there is a real alternative. The establishment of world socialism remains the only secure future for humanity. We are not blaming people for capitalism. The system and not individuals within it is responsible for what is happening. This system is part of a long, historical process; the socialist argument is that it is now time to move on to a new social system which will be in line with the productive potentialities of our modern world. Some philanthropic capitalists do indulge in gestures of benevolence towards the class which they legally rob. So what? The essential point is that the capitalist's power and affluence are based on exploiting the working class. Within capitalism, the capitalist cannot act as anything but an exploiter and the worker cannot act as anything but a wage slave.
The capitalist market not only encourages but guarantees inequality and exploitation. Capitalist societies are by definition class societies, and those deprived of the basic necessities of life are more than simply the "less fortunate." They are the victims of a materially unequal society in which the ownership of wealth, and the social and political power that comes with it, remains heavily concentrated. To the socialist, then, there is no distinction between the "deserving" or "undeserving" poor, just a deprived class of people whose needs have yet to be met.
Under capitalist production, the toiler is, indeed, just a piece of machinery, necessary to the progress of trade and commerce, and we have been taught to believe that such is all we are fitted to be.
Today we live to work, and the proposal of the Socialist Party—undoubtedly a revolutionary one—to reverse the sequence, to produce wealth in order to live, seems to be beyond the comprehension of our fellow wage-slaves who cannot get away from the notions connected with capitalist methods of production and exchange, hence the information that under a socialist system no wages would be paid comes to him as a shock. This, then, is our job. To explain to thoughtful and involved individuals that only socialism will liberate mankind's ability to produce a world of abundance.
Socialism is not a fantasy any more than any other untried idea is a fantasy. Socialism has to be brought about by workers. A slave who has become conscious of his or her slavery, and who has risen to the height of fighting for emancipation, has half-ceased to be a slave. The class-conscious worker of to-day fights for a better life for him or herself, here on earth, rallying fellow-workers to the present-day struggle for a better life here upon earth. Socialism is an idea which implies certain political principles and one of these is an unshakeable refusal to compromise with the enemies of the working class—with any political party, whatever it calls itself, which stands for capitalism. When a worker goes into a voting booth and, where there is no socialist candidate, writes socialism across the paper we are doing several things. We are saying that he hates capitalism, is declaring for a social revolution to replace it. We are standing up as the enemy of all the capitalist parties. Under capitalism, there are many kinds of working-class organisations: trade unions, political parties, tenants associations, friendly societies and so on—formed for a variety of different purposes. A working-class organisation can only be considered revolutionary when it consciously aims to replace capitalism. Our principles are based on the logic of our socialist theory; on the knowledge that human society has developed to the point where the potential exists to provide for the material needs of every human being on the planet; on the assumption that, faced with the ultimate reality of capitalism's failure to solve the ghastly problems that it creates, human beings will take into their common ownership the means of life; that common ownership, and the abolition of all the wasteful activities that capitalism makes necessary, will permit society to function on the basis of free labour in the production of goods and services and free access to the fruits of that production. That is the socialist proposition, the root of our socialist principles and the Socialist Party does not seek power for itself to enthrone those principles. We seek to promote and spread a knowledge of socialism and whether the majority that ultimately takes the required political action to bring about socialism uses the Socialist Party or some other political vehicle to take power from the political agents of capitalism and establish Socialism is of no consequence to us.
Our task will be completed with the achievement of socialism; politics will disappear as government over people gives way to a straightforward democratic administration of social production and distribution. Capitalism cannot be made to function in the interests of the great majority of people, the working class, who are the real wealth producers. However long it takes for that truth to percolate the consciousness of the working class, for that period we will suffer the social problems that have been the identification marks of capitalism since its inception. Conversely, until that consciousness begins to take root, the Socialist Party will retain its principles and seek its purpose in the dissemination of those principles.
The Object of the Socialist Party
The more seeds sowed now, the greater will be the harvest of conscious working class support for socialism. It is not within our power to give details of how socialist society will arrange its daily affairs. However, we can show the broad scope of possibilities for human development when production is for use and people, without exception, have free access to what they require from what is socially produced. Socialism is not just about providing basic needs it is essentially a "whole life" concept.
Capitalism requires perpetual economic growth in order to avoid economic crises. More specifically, in order to stave off mass unemployment and economic misery, capitalism requires increasing commodity production, escalating resource extraction, increasing trash and toxic dumping, and ever-increasing energy production. Capitalism, by its very nature, must expand unendingly and it has already surpassed the limits of sustainable growth. Capitalism is not only incapable of responding adequately to the environmental crisis, it is the very cause of the crisis and can only make matters worse. It is not enough just to oppose capitalism. We also need to create something better: an alternative system of human relations – socialism. It is not only desirable, it is imperative. It is essential that environmental activists begin to focus on ending the economic system of capitalism itself. The survival of life on this planet depends on it. The only way to rationally reorganise the economy sustainably is to collectively and democratically own, control and plan the world's industrial productive forces. All manner of useless, wasteful and polluting industries must be eliminated while developing and expanding others. Achieving climate change goals agreed in Paris is unlikely to be achieved under the capitalist market economy.
Revolution alone is the hope of the toiling masses, and not reform. For reformism —whether political or social —does not affect the cause of the workers' troubles. Change the entire conditions of social life and labour by the capture of the political machine by an educated and organised working class, and use it to abolish wage-slavery forever, and to establish society upon a basis of common ownership in the means and instruments of production and distribution. Thus only can, then only will, the ills and anxieties of the wealth producers cease.
It is true that the word "socialism" has become distorted this century to mean state capitalism even for most of those who consider themselves socialists, the word still does convey, better than for instance "moneyless society" which suggests a mere economic change, what we stand for: a society where productive resources are commonly, (i.e. socially,) owned and where people cooperate. i.e. act socially, to produce what is needed. After all, we say that humans are social animals, and what better name for a society where humans can develop their social potential to the full than "socialism". We certainly do not believe in "pre-determinacy": that all we have to do is sit around and wait for socialism to come. Capitalism certainly paves the way for socialism, but people make history and it is people who will have to make the transformation from capitalism to socialism. What socialists can— and must—do is accelerate this. Our general political activities consist in propagating the idea of socialism. This involves publishing leaflets, pamphlets and a monthly magazine, holding meetings, debating with other groups, contesting elections, and campaigning via the internet and the World Wide Web, all with the aim, at the moment, of spreading a knowledge of what socialism is and of inciting a desire for it. Later, when a majority have come to want socialism, the aim will be to dislodge from power, through democratic political action, the supporters of class privilege and the profit system. The answer we give as to what a socialist minority should do is that socialists should seek to "agitate, educate and organise" workers for socialism. This is based on the assumption that not only can workers understand socialism but that a majority of them must before socialism can be established. It follows from this that seeking to be a leadership cannot advance the cause of socialism, only the spread of socialist knowledge can. It also follows that socialists should organise themselves, not as an elite general staff, but as an open democratic party, so prefiguring the mass socialist party they expect to emerge and indeed so prefiguring the inevitably democratic nature of a socialist society.
Rally to the ranks of the Socialist Party, for it has one Object—Socialism; one method—Revolution. Is the idea of a world-wide revolution realistic? Why not? After all, capitalism is already a world-wide system, in fact, it is now more than ever a single world system. Even theorists of capitalism are beginning to recognise this with their talk of "globalisation". They are right. What it means is that if global capitalism is to be replaced it can only be replaced globally, by another global system, world socialism. As all socialists know, the only people who can alter the society in such a way as to remove the causes of poverty, not merely to lessen it, but to remove it once and for all, and with this the cause of war in the world, are the workers. They will do this as quickly as they understand the basis of the system of the society in which they live. It is therefore incumbent upon Socialists to spread this understanding, and anything short of this is a waste of time, which soon leads to a waste of lives, by malnutrition, and sooner or later, by war or global warming.
No More Patching Up
We are living in a world which has the resources to satisfy the material needs of every man, woman, and child on the planet. We could produce enough food to feed everybody adequately and enough houses to house everybody properly. We could have a fully-comprehensive health care service, environmental-friendly industry, and pollution-free towns. All this is technically possible. The resources are there. The technology is there The people with the skills are there. But it doesn't happen. It doesn't happen because we are living in a class-divided society where the aim of production is not to satisfy people's needs but to make a profit. The basis of present-day society is the concentration of the ownership and control of productive resources into the hands of a small minority of the population. The basic economic law of the profit system is "no profit, no production". Defenders of profits see profit-making as an incentive to produce, as what makes the economic system go round. To a certain extent, this is true, but it also restricts and distorts what is produced to what is profitable.
The reason why there are tens of thousands of homeless people in Britain and why there are millions of others who are living in accommodation which is regarded even by the government's own low standards as "unfit for human habitation" is not because we couldn't build or upgrade enough houses for them. It is because it is not profitable to do so. The income of those facing an acute housing problem is too low to allow them to be able to afford even minimally adequate housing. And no building firm is going to build houses or flats if it can't sell or rent them out at a profit. So the homeless and the badly houses go without— despite the fact that the resources and workers to solve their problem exist.
On a world scale, it is for the same reason that there are millions of people who are starving or suffering from starvation-related diseases. This is not because enough food to feed them can't be produced. It is not profitable to produce food for people who desperately need it but cannot afford to pay for it. If you haven't go any money, or enough money, your demand doesn't count. You don't constitute a market, so your needs are ignored.
That's the way the capitalist system works and there's nothing that can be done about it except change the system. The Socialist Party say that it is pointless trying to patch up and reform capitalism. It must be abolished altogether and replaced by a new system. Our message is plain. Workers can and must make the effort correctly to interpret, in the light of their own experience, the gigantic con-trick that is being used against them.
A hundred years ago, when capitalism seemed to be a divinely-ordained system, destined to last forever, the "upper classes" made no bones about admitting that all the work was done by the "labouring classes." The capitalist economists used to reflect on the happy arrangement of society by which landowners, shareholders and the rest were free from the painful necessity to work. But now, condition's are changing. As the upper class begins to realise that only lack of knowledge prevents the workers of the world putting an end to the present system, and with it the consumption of surplus value by a favoured few, so they begin to change their tune. One by one they try to persuade the workers that they are all only humble working men and women.
The unions are the organisations of the workers in particular industries for the purpose of improving wages and conditions of labour or resisting a worsening of those conditions and wages. The trade union officials that the workers elect and pay are appointed and paid to carry out the work that the majority of the workers in the union instruct them to do. Nevertheless, leading trade union officials have attempted to curb their members' struggles for improved conditions and, in particular, have used their position to try to prevent the workers from using the strike weapon, the only effective weapon the workers have on the industrial field.
While it is true that the Left strive to fish in troubled waters a communist spokesman can only carry his or her fellow-workers only so far along a road they want to travel. It is often forgotten by those not directly concerned that when workers come out on strike it is a very serious matter for them; they are jeopardising their livelihood and are hardly likely to do this at the behest of a few wild and irresponsible individuals. Whether their action is good policy at the given moment or not is immaterial; they have given it serious consideration and have taken action seriously, and therefore the charge that they are led by the nose by political agitators is particularly insulting when coming from the people they appoint and pay to fight their battles. To whom are trade union members supposed to be loyal? Surely to themselves and not to the officials who fail to carry out the policy for which they were appointed. "Negotiating machinery" was not devised to help the workers but to aid the employers in keeping the machinery of capitalism running smoothly. Give a date weeks ahead when a strike is proposed so that (1) the employers can make adequate preparation to defeat it and (2) so that the workers will be bamboozled by long drawn-out negotiations that will weary them into agreeing to compromises favourable to the employers. The strike that has the best chance of succeeding is the one that comes out of the blue and, if unsuccessful, is abandoned before the workers' organisation has become too weak to enable them to strike again out of the blue with better success. In the industrial field, the workers are fighting the employers and their only loyalty is to themselves. Where the officials they appoint fail to recognise this they should be replaced by those who do. Strikes cause disorganisation and some suffering; if they did not do so they would be worthless as weapons to be wielded by the workers in disputes over wages and conditions.
A Manifesto of Emancipation
We must take the work of salvation into our own hands in order to guard against deceitful "friends." The socialist movement is a "do-it-yourself" movement. There is one, and only one, revolutionary strategy. Help yourselves. We in the Socialist Party do not have a loose definition of socialism that which s everything and everybody and mean nothing to anybody. We laid down our definition and principles, based on our understanding of capitalism, which is fundamentally the same to-day as it was in 1904. We don't want new definitions which will please all-comers and principles which don't offend.
Marx and Engels said "The emancipation of the working classes must be conquered by the working classes themselves. We cannot, therefore, co-operate with people who openly state that the workers are too uneducated to emancipate themselves and must be freed from above by philanthropic big bourgeois and petty bourgeois."
Their ally Joseph Dietzgen explained, "If a worker wants to take part in the self-emancipation of his class, the basic requirement is that he should cease allowing others to teach him and should set about teaching himself."
Eugene Debs pointed out "I do not want you to follow me or anyone else; if you are looking for a Moses to lead you out of this capitalist wilderness, you will stay right where you are. I would not lead you into the promised land if I could, because if I led you in, some one else would lead you out. You must use your heads as well as your hands, and get yourself out of your present condition; as it is now the capitalists use your heads and your hands."
That is why socialist democracy requires the widest participation in decision-making at all levels. Workers cannot transform themselves unless they are free to do so. The objective of the Socialist Party is a society in which "the free development of each is a condition for the free development of all" as in The Communist Manifesto, and this cannot be achieved by authoritarian methods. If self-emancipation is the goal, it must be the means as well. Defenders of capitalism have been very happy to endorse dictatorial exploitative regimes that called themselves socialist as examples of socialism so to destroy the very concept of socialism in the minds of millions of people. Our job as socialists is to help people see through the illusions of capitalism, to understand that we are faced with this stark choice of socialism or barbarism, and to encourage a vision of self-emancipation. Capitalism rests on the domination of the overwhelming majority by a small minority. And one of the worst things about this domination is that it is experienced as such, without being understood as such.
The working class constitutes the majority of the population. The struggle against the capitalist class is a struggle against all who live by the labour of others, and against all exploitation. It can only end in the capture of political power by the working class, and the transferral of all land, transportation, factories, mills and mines to the whole of society under which all that is produced benefit the people themselves. The Socialist Party declares that its aim is to develop the class consciousness of the workers through our agitation in the class struggle. The Socialist Party stands for the self-emancipation of the working class, thus, we seek to be open about our goals with our fellow-workers.
Reformism accepts the basic structure of the system while striving to modify certain institutions and internal structures. The reformists fail miserably because of their basically unsound economic premise. Applying themselves to the treatment of EFFECTS, they leave untouched the CAUSE of poverty, insecurity and war: CAPITALISM. Capitalism has developed the economic resources of the world to that extent where socialism, from the economic standpoint, is a practical possibility NOW. The only barrier is the lack of a socialist majority, organised for the conquest of political power and the establishment of the socialist system of society. Consequently we consider that the task of socialists in the Socialist Party, is to use all means at their disposal for the making of socialists. We contend that it is impossible to change society through the medium of reforms, and that the change to socialism must be effected at the base of society, which is the ownership of the means of production (at present in the hands of the capitalist class). To convert these means of living into the common property of society and to create a class-free and wage-less society where 'each will give according to his ability and take according to his needs ' is the only true perspective of socialists. Socialism, once established, will mean complete economic and social equality. Every one will stand in an equal relationship to the means of production, owning none of it as individuals but owning all of it by their membership of the community.
The Socialist Party, at and between every general election, points to the way out by replacing capitalism with socialism. All those who chose capitalism by voting Labour, Tory, LibDem or nationalist have only themselves to thank. They have got what they voted for. There have been innumerable Acts of Parliament aimed at ending the workers' problems. Only in socialism, where production of all things is solely for the satisfaction of people's needs, is a solution to be found. In socialism, where human needs will be the only factor governing production, when a point is reached at which a sufficiency of all things has been produced. it will simply mean more leisure time for the producers without the attendant hardships of today. The only way to end the economic anarchy that is capitalism was to institute a socialist society.
Why change is necessary
We live in a strange society which honours the dead more than it cares for the living. It builds monuments to mark the famous dead, but not houses for all the living. There are great social achievements but, as is usual under capitalism, humanity is denied the full benefits of them. Having created the means of extending and improving life, capitalism negates such an advance because it destroys life at an intense rate. It is a tragic paradox that the system which has enabled medical science to extend its horizons is one which creates more "artificial" deaths than it saves in avoided natural deaths. Lack of decent food (or any food) kills millions of people each year. Millions die each year because they do not have access to clean water or hygienic sanitation. In vast areas of the world health services hardly exist with one doctor has to attend to thousands of patients. The mortality rate in such areas is phenomenally high. Even in Britain, where there is supposed to be a free health service, NHS treatment is second-rate and "on the cheap", and recent government cuts have seriously affected services. Patients have died in ambulances which have been forced to drive around searching for an open casualty department. In times of "peace", there are always local wars going on somewhere. In Afghanistan, Syria Iraq and elsewhere, hundreds of thousands have lost their lives fighting for their masters' interests. The environment is made unclean and unsafe by industrially produced chemical pollutants which are cheaper to release into the atmosphere than to avoid or destroy. City-dwellers inhale regular doses of polluted filthy air which cause sickness and contribute to many early deaths. Many of the accidents which injure and kill people in the course of employment are predictable and avoidable, but employers calculate that it is cheaper to make occasional compensation payments than to make working conditions safe. The strain of the competitive rat-race frequently leads to chronic illnesses. People under stress are less resistant to minor ailments which can become potential killers. In periods of economic recession, the suicide rate rises rapidly. Every winter people die of the cold because they cannot afford to put on a heater. Hypothermia especially affects pensioners and the families of the unemployed.
These artificial killers account for many millions of deaths each year. Even if workers think that they are immune from all of them at the moment, the insecurity of working-class life makes them prime targets in the future. For those who survive capitalism's ways of killing people, old age can be a depressing and impoverished period of life. In a society which is primarily interested in workers as exploitable commodities, once a worker has passed retirement age they are often seen as a social inconvenience old workers are "problems". Under this wasteful, destructive profit system working class lives are frustrated. From birth to the grave wage slaves have to put up with conditions which scientific advances have made unnecessary. We could live and die in peace, but the majority of the working class consents to a system which dehumanises social relationships. There is a better way to live. In a socialist society, human beings will be free to live healthy lives in a healthy social environment. We will all have free access to what we need so no one will die for lack of basic requirements to sustain life. Old people in a socialist world community will give according to their abilities and take according to their needs, as will all people, including the physically and mentally disabled. In a creative, satisfying society men and women will have no need to fear old age. Socialism offers a happier way of living.
For wage workers, the world is drab and insecure, but more than that, laden with resentment and suspicion, part indeed of a whole world of resentment and suspicion that is capitalism. Even his next door neighbour he is reluctant to really trust, and as for his workmate—a prospective competitor—that's often worse. Given a world of common ownership, work would be everyone's ambition—a way of self expression that the present system just cannot provide. Freed from the strains of competition and the cash nexus, we could meet people from far and wide on truly equal and friendly terms, because the cause of suspicion and fear would no longer exist.
Socialists see leaders as a useless anachronism. From a purely practical point of view, the Socialist sees many arguments against leadership. It is undemocratic in principle; it is unhelpful in the task of arousing class consciousness and a sense of the dignity and strength of the working class; it, therefore, tends to demoralise the "rank and file" and leads to a spirit of competition rather than co-operation; it can also be a direct cause of factionalism, intrigues and splits caused by personal ambition and group rivalry developing into hostility. Another way in which the leadership cult can be detrimental to a political party is due to the leader's "charismatic" personality being identified with his or her party's policy. Even if the leader leads a blameless life, has courage and intelligence, is unbribable and unbreakable, it only requires a jail sentence or an early grave, for the party to suffer a crippling blow. What we do want is the support of intelligent men and women the world over, committed to destroying the rotten fabric of capitalist society, not patching the old threadbare curtain of fraud and exploitation any more but tearing it from the window to let the clear light of a new day shine through, exposing in stark reality the squalor and misery, famines and wars, bigotry and xenophobia. We can and must decide our political destiny for ourselves, taking full responsibility on our own shoulders and not leaving the burden of decision to selected individuals. For the "leader" is no better than his flock and may well be a good deal worse. Leadership, hero-worship, and élitism are contrary to the democracy of the socialist movement, incompatible with the egalitarian nature of a socialist society and are utterly inimical to the mass movement of class-conscious workers to abolish the old privilege-ridden society.
A socialist party must admit only conscious socialists to its membership for the simple reason that to do otherwise would attract people of all sorts of political opinions; people interested in anything but socialism. To do this would destroy our character as a socialist party. Our sole criteria for existing as a party is to propagate the idea of socialism. A working-class party must have as its object the only political object in the workers' interest — the overthrow of capitalism and its replacement by socialism. We have always kept our object clear. This is not sectarian—it is consistent and principled.
At election time voters are asked to pay the price for their political gullibility. "Vote for us" cry the defenders of the profit system: "Send us to Parliament r and we will make the country a pleasant place to live in". Many workers don't bother to vote in elections. Campaign leaflets are thrown away by the pestered electorate as casually as the promises within them will be cast aside by the winning party. Workers are right to be cynical about the parties of capitalism: what have they ever done for us? The real issue in elections is not which leader to choose or which policies to enact. The workings of capitalism are not susceptible to the manipulation of l government. Whoever gets in, profits still come before human needs. The real issue is which social system we want to live under capitalism or socialism? None of the manifestos will say anything about the system. The politicians will not make speeches saying "Vote for us so that we can run capitalism—we stand firmly for a system of class division and legalised exploitation a vote for us is a vote to continue the same old problems". Well, they wouldn't say that, would they? But in effect, that is precisely what they mean. Elections are never about the real issue. Petty, reformist trivialities are presented as if they're what it's all about. Nobody mentions The System—but that is what the whole performance is about.
When the Socialist Party arrives on the election scene and talk about the real issue, the defenders of capitalism become terribly embarrassed: Labourites go red in the face, Tories go blue in the face and Nationalist return to the economic status quo. But there is no escaping it—the real electoral issue is whether we are to live in a competitive, class-divided society or whether we are commonly to own and democratically control the resources of the world. The choice is yours. Making a social revolution takes a bit more than "breaking the mould". How, then, are we to enact this great change? The first step is to want it. There can be no socialism unless people want it. Do you want a society where food is produced solely to be eaten, houses solely to live in, clothes solely to wear? Do you want to get rid of the buying and selling system where we can only obtain what we want if there is a profit in it for the capitalists?
We want socialism: but wishful thinking will not make a revolution. Capitalism survives because of mass consent. So what would happen if there was mass dissent—if a majority of the working class (which is itself a majority of humanity) withdrew its support from capitalism? The system cannot continue without our acquiescence. Mass dissent or majority socialist consciousness—call it what you like—does not appear by magic. Most people accept the capitalist system because they are used to it. Workers believe that capitalism has always existed and always will. The job of socialists is to show that capitalism is just a temporary stage in human evolution. There is an alternative. Once a majority understand and want socialism, what must they do? They must do the opposite of what they do to support capitalism. Instead of electing leaders to run capitalism they must elect socialist delegates who will carry out their political will. Once socialists get into the parliaments of the world they will have one act to perform: the expropriation of the capitalist class and the transfer of the means of wealth production and distribution to the whole community. That is the sole aim of socialists; that is the real electoral issue. Any political promise or demand less than socialist revolution is worthy of the hostility of the working class.
Socialism will be the result of social forces within capitalism driving workers to the conclusion that the present system does not operate in their interests and that only a society of common ownership of the means of production. democratically organised by themselves, can. The Socialist Party is one among many of these forces. We do not think that our efforts alone will bring socialism, but that the whole range of workers' experiences (including contact with our party) will prepare them for it. If to some people this preparation seems a tedious process and our progress seems slow, we must say that we too would like to see the socialist idea spreading more quickly. However, important ideas in human history have always taken quite some time to become popular and have only seemed credible to the majority after once being accepted by a sizeable minority. Then they have spread very quickly. Historically speaking the socialist idea has only been around a brief moment. Capitalism has not been around long either. We hope it won't be with us much longer, but we may have to live under it for some time yet. This we must be realistic about and accept.
But if you agree with us, it's not your admiration we want. That won't bring socialism any nearer. We want your active support. Join us and help add weight of numbers to our logic and rationality. The bigger we are, the less likely it is that the people you argue with will say they'll never be convinced that the society we want will ever work.
Our rich heritage
Party News from the July 1957
From Glasgow (City and Kelvingrove Branches).— "We don't deal in emotion and sentimentality; we adopt a scientific attitude," quoted the Glasgow Herald. The speaker was Comrade Shaw, addressing an interested audience in Queen's Park Recreation Grounds on May Day. While Comrade Shaw was presenting the revolutionary proposition, Mr. Frank Cousins, the official May Day demonstration speaker, was dishing out the sentimentality in the Bandstand in Queen's Park. Our audience, however, showed their appreciation of the scientific attitude by donating £2 for the purpose of carrying on the good work. It was a grand start to a promising May Day. The Glasgow membership was more active than in recent years, and about 16 members scurried busily about Queen's Park selling literature to the tune of 11 dozen Socialist Standards. The evening meeting was held in St. Andrew's Hall, in opposition to the Communist Party and a Skiffle Group competition. A lively audience of 70 heard Comrades Richmond and Higgins expounding " The Socialist Way Out." Several nights before the meeting the centre of the city was "decorated" with whitewash advertising our activities, but the Fates and the rain were against us.
A fortnight later, at Rothesay. Comrade Richmond, on behalf of the Party, addressed a Week-end School of the Amalgamated Union of Foundry Workers. His subject was "Modern Trends in Marxism." The school consisted of about 40 trade union branch delegates and provided Comrade Richmond with an alert and interested audience. Socialist literature was sold at the meeting, and the venture seems to have been very successful. This is the first time a Trade Union School has requested a speaker from us, but judging by the amount of interest Comrade Richmond's incisive lectures aroused, it does not seem like the last.
All during May, the Socialist platform has been erected in West Regent Street, where large and interested audiences have gathered to hear the antidote to Capitalist Propaganda. Literature sales and propaganda collections have been encouraging, and there is a possibility of some more members airing their vocal chords there during the rest of the summer.
We Need Socialism
Many agree with our object socialism but disagree with our view of how it should come about. Well, the important thing is that we agree about the socialist objective. We're sure our differences about methods can be reconciled by discussion and debate. The struggle for socialism is a political one and its object is to achieve the abolition of capitalism and its replacement with socialism by a majority of socialists. On the political front, there is only one kind of action which is consistent with the socialist objective—work to persuade the majority of workers that only socialism can achieve the common ownership of the means of production and the establishment of a system of production for use on the basis of equality and co-operation. There cannot be a long-term objective which can be reconciled with short-term actions to ease the worst effects of capitalism. These "short-term actions"committed to advocating a modified form of capitalism which would surely be hostile to socialist principles. We cannot seek the abolition of capitalism by advocating some modified form of it. This is surely contradictory. The decision to support reformist parties of an allegedly working class nature has been a complete waste of time. The working class the world over are still an exploited class; we still have poverty, unemployment, wars and all the social problems that go with capitalism. If all those who argued that the socialist objective should be set aside in favour of political attempts to improve capitalism had instead joined the socialist movement based uncompromisingly on socialist principles, then we would have a large and influential socialist party. The choices in the real world are these you either have capitalism with all its unavoidable consequences in terms of its problems, or you have a socialist system of production for use which would enable the people of the world to solve those problems. The political and economic realities are that there is no ground in between. By its very nature capitalism cannot be run in the interests of the community; its social and political limitations are essentially economic in nature and cannot be controlled. This is what all reformers have ultimately discovered. The difference between the socialist and the anti-socialist is clearly that the socialist is one who takes up the prosecution of the class war to its final aim: the overthrow of capitalism and the establishment of socialism. He or she who, claiming to be a socialist abjures this, is, therefore, no socialist and of necessity must be anti-socialist
Capitalism deprives the working class of the full product of their labour. It makes a world of conflict, terror, famine, disease. Its hallmark is exploitation, poverty, the degrading of its people. The engine of modern capitalism is commodity production. Goods are produced and services made available because it is profitable to do so. "Things" are a potential source of profit with the result that capitalism elevates the material and the tangible to positions of exclusive supremacy. That which is measurable and which has currency in dollars, marks, and pounds, etc. is—by definition—more important than attributes and experiences which are not so quantifiable.
Capitalism is disconcerted by beauty, truth, dignity, generosity of spirit and so on because these are intangible and elusive. You may have to pay ten pounds to buy a recording of a Mozart symphony and perhaps a million times that amount for a landscape painting by Renoir, but in neither case does the cost reflect the beauty sublimed in the experience of listening to the music or looking at the painting. On the contrary, it is the scarcity of the two artifacts which is crucial. If only one CD of a Mozart symphony was available but several million paintings by Renoir existed, we would expect the prices of the record and the paintings to reflect these facts. Capitalist economics might now make the record a million times more expensive than any one of the paintings. To paraphrase Marx: in the capitalist society, their price is related to scarcity and not to intrinsic value.
What value can be attached to a Mozart symphony, a Renoir painting, the exhilaration of a sunny day in May, a mother's love, a teacher's power to enthuse, the integrity and conviction of a stunning piece of acting, the sense of being a respected member of a team, congeniality, generosity and fraternity? Capitalist economics has nothing to say about such matters. It is as though they were part of another world—a netherworld remote from the "real" world of buying and selling and the market. Because they are not the subject of commodity exchange they are—in capitalism's terms— capricious and unimportant, insubstantial and trivial. Yet for most people, they are the essence of what makes life worthwhile. A society obsessed with markets, with buying and selling, with profits before all else, transforms humankind, and in doing turns potentially creative, altruistic and sociable people into materialistic monsters. Capitalism is always prepared to spend a huge part of its resources on destruction, regardless of how much deprivation there is in the world. It is no coincidence that it is at its most inventive, efficient and productive in wartime when its aim is to destroy as much, and murder as many, as it can.
Lothian Socialist Discussion (25/7)
Wednesday, 25 July
The Autonomous Centre of Edinburgh,
17 West Montgomery Place,
Edinburgh EH7 5HA
For years we have witnessed the "success" of a procession of practical efforts to rally workers to socialism by clever policies. We have seen the transformation of these advocates of socialist goals into supporters of the status quo — rebels who have been converted into supporters of the system. Their trademark has become the reforming, improving and administering capitalism. Rebels become transformed into administrators of capitalist states, recruiters for capitalist wars. In the name of building up a socialist movement among the masses, they have emasculated and compromised socialist principles. When elected, they have actually administered capitalism in the only way it can be administered, in the interest of the capitalist class, even to the extent of supporting capitalist wars and crushing workers on strike.
Where are the convinced socialists they were going to make? Where are the socialist masses? Their practical, realistic policies have proven worse than illusory. They have failed to make socialists! Yet they continue to heap scorn and sneer at the Socialist Party for our small numbers. With smug superiority, they dismiss the Socialist Party as "ivory tower utopians," "dogmatic sectarians," "impossiblists," etc. The real question is: Who have ignored the lessons of experience? Where are the socialists you have gained by your efforts? The oft-vaunted new and fresh approaches have proved to be very stale indeed.
We have been confronted and challenged by those who fight for something "in the meantime" and who are actively participating in the "workers' struggles." The lure and fascination of protest marches and making demands is very attractive. (In a sense, it indicates how deep-rooted discontent with capitalism really is, and it demonstrates the latent strength of socialism once the masses wake up to the need for changing the system instead of adjusting to it.) But — and this is the vital point — these activities are not in harmony with the immediate needs of our time: the making of socialists. The lack of socialists is all that stands in the way of socialism, now.
The militants and activists" have had impressive "successes" and "victories" in every field except one. The lessons of experience and history have proven beyond any shadow of a doubt that they have not remotely convinced the workers of the need for socialism. From campaigns carried on in the name of socialism, the one thing conspicuous by its absence has been any mention of the socialist case. The great indictment of these activists is that they divert the workers from the genuine socialist movement, and have hampered the growth of socialism by many years. Were all that tremendous energy and enthusiasm harnessed in the genuine socialist work of making socialists, how much more the movement would have been advanced! The "practical realist" has proven to be an impractical utopian; the "activist" has proven to be the occupant of an ivory tower. These "practical realists" with their "in-the-meantime" activities have sidetracked the movement from what is truly meaningful. All those dedicated energies have diverted overwhelming numbers of workers from genuine socialism. Had all these efforts and all that enthusiasm been devoted to socialist education, just imagine how much further advanced and inspiring the movement would be today.
What is encouraging is that, in spite of the antics of the Left, we see some signs of the times that workers are waking up!
Defeat the Masters
Whenever Leftist literature mention "socialism" it always hastens to say "of course we realise the people are not ready yet for socialism" giving the impression that they are very glad the people are not yet convinced of socialism.
...yet while the people In the U.S.A. are less socialistic minded than European workers, the Party has underestimated the amount of socialist sentiment among the workers and farmers, unclear though these ideas are. Nevertheless, there is a portion of the working people who realise that there is something wrong with the chaotic and rotten capitalist system and think that there could be a system whereby plenty would be produced and distributed for everyone. The Socialist Party, by raising the question and explaining socialism in connection with every injustice and oppression of capitalism could find many a recruit from among these people. The Left say we are calling for immediate socialism and yes are for the building of socialism just as soon as the workers wish it. The kind of economy we envisage would, for the first time, make possible an end to wars. The aim of the working class would be to end capitalism and all forms of exploitation everywhere, and everywhere introduce a socialist world. The working people themselves should own and operate the industries cooperatively. This would end production for profit and the waste of competing corporations. We propose that all resources, all land and buildings, all manufacturing establishments, mines, all the means of transportation and communication, should be, not private property, but the common property of all, without any class division. We propose that production be made to serve the needs of those who work, rather than to serve the needs of a few parasites. When the Socialist Party speak of a society organised on the basis of planned production and distribution we mean something we have in mind to do away with production for profit. Production for profit must be supplanted by production determined by the needs of the entire people and directed by the associated producers themselves. This is the socialist remedy for capitalist anarchy, insecurity, and misery. Capitalism is not simply an exploitative system, but an essentially unstable one.
Socialism, as conceived by Marx and Engels, would be a social order based on the collective ownership and democratic control of the means of production and distribution. Social production in such a society would be for use as against production for profit. Its objective would be the abolition of all classes, all class divisions, class privilege, class rule, arising from the production of such abundance that the struggle for material needs would be completely eliminated. The productive capacity of a socialist society would at last free humanity from economic exploitation, from oppression, and from any form of coercion by a state machine. It would enable people to devote themselves to their fullest intellectual and cultural development. We have to develop class solidarity. There are only two roads for the working class—the capitalist road, which, in the conditions of our time, can lead only to starvation, poverty, and war; and the road of the socialist revolution, which points the way to plenty, prosperity and lasting peace.
The working class is the only class with the capacity to end the insanity of capitalist rule. The fundamental task of the Socialist Party is to instil in the class the consciousness of its historic role. For a socialist world, we summon our fellow-workers. A socialist world can give us peace and plenty. Look now how the capitalism totters on the brink of destruction. Climate change is no longer a fear but a grim reality. The capitalist parties are as rotten and bankrupt as the system they uphold. They can maintain themselves and the capitalist system today only by piling additional burdens upon the people. For the future, they offer only more conflict, continued insecurity, and increasing austerity. The evils of capitalism will disappear only with the destruction of capitalism and the building of socialism. A socialist society will do away with the anarchy of capitalism. Democratically-elected councils in every industry and district will manage the factories and community services. Forward to the new world that awaits us. Vote, for socialism." Vote for the Socialist Party, the only party that keeps the revolutionary banner unfurled. We must win the support of every man and woman who desires to see the end of anxieties, frustrations, and fears caused by capitalism. The capitalist class is developing a ruthless attack on working people. We stand at the threshold of great class battles. If we are bold and clear-sighted, workers can repel this attack, and in their turn to launch a smashing offensive against capitalism. From the great mass struggles for living standards will develop a movement steeled in the struggle that can defeat and overthrow the capitalist class and establish a socialist world.
Socialist musings from Canada's past
Oppose Capitalism. Support Socialism
Summer school update
Why a class struggle
The problem is not the Tories or Labour.....
Understanding The Socialist Party
Scotland's Deprivation Means Early Deaths
Wealth for all
Conflicting Plans
Abundance for All
The only road is the socialist road.
Changing "Good Laws" For New Ones?
Glasgow Branch Meetings (18/7)
For a New Society - Muster under our banner
Something Is Very Wrong,
The future belongs to socialism
Poverty-stricken Scotland
Hail the coming of socialism!
Arouse, ye slaves!
Can't Cope With Orgy Of Crime
The Spirit of Revolution
The Socialist Cause
The Most Compassionate Suggestion Of All
Summer School 2018 Updates
Glasgow's Poverty
Young Guard of What?
The Boss Doesn't Always Like Progress
If Anything is Good To Go It's Capitalism
Our task in the Socialist Party
The wages gap
Challenging Human Nature
Scottish Slavery
Not Our Idea Of Equal Social Access
Slaves and Serfs
Green Socialists
Will you hear us?
TOWARDS WORLD SOCIALISM
Edinburgh Branch Meeting (5/7)
The Future Belongs to the People
The only hope is a socialist future
Socialist Standard No. 1367 July 2018


Georgia, a country with 4.5 million inhabitants, is currently developing a national low emission development strategy. At the local level, Covenant of Mayor signatory cities are planning to make significant contributions to this strategy and Georgia's national mitigation efforts. Of the seven current signatories to the EU Covenant of Mayors (CoM) in Georgia, four have already submitted and have begun implementing Sustainable Energy Action Plans (SEAP). The SEAPs outline plans to achieve the commitment outlined in the CoM to reach GHG emission reductions of at least 20% by 2020.
The development of the SEAPs involved a variety of stakeholders, including local and national public sector, private actors, international donors and experts. A variety of barriers were faced, including a lack of data (and access to existing data), difficulty engaging the private sector, political issues, capacity constraints, definition of baselines, adapting an EU process to a transition country context, donor coordination, national and local level coordination, and limited financial resources.
Critical to the success of the development of the SEAPS were political commitment on national and local level, international financial support, technical assistance to local level & national coordinators, access to funds, motivated personnel and capacity building programs externally financed by the CoM.


text:
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
// Note: breeze is available from both 'breeze-client' and indirectly from 'breeze-sequelize'
// if you compare them the ARE '==='.
var breeze_client_1 = require("breeze-client");
var breeze_sequelize_1 = require("breeze-sequelize");
var adapter_model_library_backing_store_1 = require("breeze-client/adapter-model-library-backing-store");
var demo_key_generator_1 = require("./demo-key-generator");
{ }
adapter_model_library_backing_store_1.ModelLibraryBackingStoreAdapter.register(breeze_client_1.breeze.config);
var _dbConfigNw = {
    //user: "jayt",
    //password: "password",
    user: "root",
    password: "mysql",
    dbName: 'northwindib'
};
var _seqOpts = {
    dialect: "mysql",
    host: "localhost",
    port: 3306,
    // logging: console.log,
    pool: {
        max: 100
    }
};
var _sequelizeManager = createSequelizeManager();
function createSequelizeManager() {
    var filename = "NorthwindIBMetadata.json";
    if (!fs.existsSync(filename)) {
        // next(new Error("Unable to locate file: " + filename));
        throw new Error("Unable to locate file: " + filename);
    }
    var metadata = fs.readFileSync(filename, 'utf8');
    var sm = new breeze_sequelize_1.SequelizeManager(_dbConfigNw, _seqOpts);
    sm.importMetadata(metadata);
    sm.keyGenerator = new demo_key_generator_1.DemoKeyGenerator(sm.sequelize);
    return sm;
}
function getMetadata(req, res, next) {
    var filename = "NorthwindIBMetadata.json";
    if (!fs.existsSync(filename)) {
        next(new Error("Unable to locate file: " + filename));
    }
    var metadata = fs.readFileSync(filename, 'utf8');
    res.sendfile(filename);
}
exports.getMetadata = getMetadata;
function get(req, res, next) {
    var resourceName = req.params.slug;
    if (exports.namedQuery[resourceName]) {
        exports.namedQuery[resourceName](req, res, next);
    }
    else {
        var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, resourceName);
        executeEntityQuery(entityQuery, null, res, next);
    }
}
exports.get = get;
function saveChanges(req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntity = beforeSaveEntity;
    saveHandler.beforeSaveEntities = beforeSaveEntities.bind(saveHandler);
    saveHandler.save().then(function (r) {
        returnSaveResults(r, res);
    }).catch(function (e) {
        next(e);
    });
}
exports.saveChanges = saveChanges;
function executeEntityQuery(entityQuery, returnResultsFn, res, next) {
    return __awaiter(this, void 0, void 0, function () {
        var query, r, e_1;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    returnResultsFn = returnResultsFn || returnQueryResults;
                    _a.label = 1;
                case 1:
                    _a.trys.push([1, 3, , 4]);
                    query = new breeze_sequelize_1.SequelizeQuery(_sequelizeManager, entityQuery);
                    return [4 /*yield*/, query.execute(null)];
                case 2:
                    r = _a.sent();
                    returnResultsFn(r, res);
                    return [3 /*break*/, 4];
                case 3:
                    e_1 = _a.sent();
                    next(e_1);
                    return [3 /*break*/, 4];
                case 4: return [2 /*return*/];
            }
        });
    });
}
function saveUsingCallback(saveHandler, res, next) {
    return __awaiter(this, void 0, void 0, function () {
        var r, e_2;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    _a.trys.push([0, 2, , 3]);
                    return [4 /*yield*/, saveHandler.save()];
                case 1:
                    r = _a.sent();
                    returnSaveResults(r, res);
                    return [3 /*break*/, 3];
                case 2:
                    e_2 = _a.sent();
                    next(e_2);
                    return [3 /*break*/, 3];
                case 3: return [2 /*return*/];
            }
        });
    });
}
// Used to return
function returnQueryResults(results, res) {
    res.setHeader("Content-Type", "application/json");
    res.send(results);
}
function returnSaveResults(results, res) {
    res.setHeader("Content-Type", "application/json");
    res.send(results);
}
exports.namedQuery = {};
exports.namedQuery.CustomerFirstOrDefault = function (req, res, next) {
    // should return empty array
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").where("companyName", "StartsWith", "blah").take(1);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomersStartingWithA = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers")
        .where("companyName", "startsWith", "A");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomersStartingWith = function (req, res, next) {
    // start with client query and add an additional filter.
    var companyName = req.query.companyName;
    if (companyName == undefined) {
        var err = { statusCode: 404, message: "'companyName must be provided'" };
        next(err);
    }
    // need to use upper case because base query came from server
    var pred = new breeze_client_1.breeze.Predicate("companyName", "startsWith", companyName);
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").where(pred);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomersOrderedStartingWith = function (req, res, next) {
    // start with client query and add an additional filter.
    var companyName = req.query.companyName;
    // need to use upper case because base query came from server
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers")
        .where("companyName", "startsWith", companyName)
        .orderBy("companyName");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomersAndOrders = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").expand("orders");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomerWithScalarResult = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").take(1);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomersWithHttpError = function (req, res, next) {
    var err = { statusCode: 404, message: "Unable to do something" };
    next(err);
};
// HRM is HttpResponseMessage ( just for
exports.namedQuery.CustomersAsHRM = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CustomersWithBigOrders = function (req, res, next) {
    var entityQuery = breeze_client_1.breeze.EntityQuery.from("Customers").where("orders", "any", "freight", ">", 100).expand("orders");
    var processResults = function (results, res) {
        var newResults = results.map(function (r) {
            return {
                customer: r,
                bigOrders: r.orders.filter(function (order) {
                    return order.Freight > 100;
                })
            };
        });
        returnQueryResults(newResults, res);
    };
    executeEntityQuery(entityQuery, processResults, res, next);
};
exports.namedQuery.CustomersAndProducts = function (req, res, next) {
    var eq1 = breeze_client_1.EntityQuery.from("Customers");
    var sq1 = new breeze_sequelize_1.SequelizeQuery(_sequelizeManager, eq1);
    var r1;
    sq1.execute().then(function (r) {
        r1 = r;
        var eq2 = breeze_client_1.EntityQuery.from("Products");
        var sq2 = new breeze_sequelize_1.SequelizeQuery(_sequelizeManager, eq2);
        return sq2.execute();
    }).then(function (r2) {
        returnQueryResults({ Customers: r1, Products: r2 }, res);
    });
};
//// AltCustomers will not be in the resourceName/entityType map;
exports.namedQuery.AltCustomers = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.SearchCustomers = function (req, res, next) {
    var qbe = req.query;
    var ok = qbe != null && qbe.CompanyName != null && qbe.ContactNames.length > 0 && qbe.City.length > 1;
    if (!ok) {
        throw new Error("qbe error");
    }
    // const entityQuery = EntityQuery.from("Customers").where("companyName", "startsWith", qbe.companyName);
    // just testing that qbe actually made it in not attempted to write qbe logic here
    // so just return first 3 customers.
    var entityQuery = breeze_client_1.EntityQuery.from("Customers").take(3);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.SearchCustomers2 = function (req, res, next) {
    var qbeList = req.query.qbeList;
    if (qbeList.length < 2) {
        throw new Error("all least two items must be passed in");
    }
    qbeList.forEach(function (qbe) {
        var ok = qbe != null && qbe.CompanyName != null && qbe.ContactNames.length > 0 && qbe.City.length > 1;
        if (!ok) {
            throw new Error("qbe error");
        }
    });
    // just testing that qbe actually made it in not attempted to write qbe logic here
    // so just return first 3 customers.
    var entityQuery = breeze_client_1.EntityQuery.from("Customers").take(3);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.OrdersCountForCustomer = function (req, res, next) {
    var companyName = req.query.companyName;
    var entityQuery = breeze_client_1.EntityQuery.from("Customers")
        .where("companyName", "startsWith", companyName)
        .expand("orders")
        .take(1);
    var processResults = function (results, res) {
        var r;
        if (results.length > 0) {
            r = r.orders.length;
        }
        else {
            r = 0;
        }
        returnQueryResults(r, res);
    };
    executeEntityQuery(entityQuery, processResults, res, next);
};
exports.namedQuery.EnumerableEmployees = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Employees");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.EmployeesMultipleParams = function (req, res, next) {
    var empId = req.query.employeeID;
    var city = req.query.city;
    var where = { or: [{ employeeID: empId }, { city: city }] };
    var entityQuery = breeze_client_1.EntityQuery.from("Employees").where(where);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CompanyNames = function (req, res, next) {
    var entityQuery = breeze_client_1.EntityQuery.from("Customers").select("companyName");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CompanyNamesAndIds = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").select("companyName, customerID");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.CompanyNamesAndIdsAsDTO = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").select("companyName, customerID");
    var projectResults = function (results, res) {
        var newResults = results.map(function (r) {
            return { companyName: r.companyName, customerID: r.customerID };
        });
        returnQueryResults(newResults, res);
    };
    executeEntityQuery(entityQuery, projectResults, res, next);
};
exports.namedQuery.CompanyInfoAndOrders = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Customers").select("companyName, customerID, orders");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.OrdersAndCustomers = function (req, res, next) {
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Orders").expand("customer");
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.SearchEmployees = function (req, res, next) {
    var employeeIds = req.query.employeeIds;
    var pred = { employeeID: { in: employeeIds } };
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Employees").where(pred);
    executeEntityQuery(entityQuery, null, res, next);
};
exports.namedQuery.EmployeesFilteredByCountryAndBirthdate = function (req, res, next) {
    var birthDate = new Date(Date.parse(req.query.birthDate));
    var country = req.query.country;
    var pred = { birthDate: { ge: birthDate }, country: country };
    var entityQuery = breeze_sequelize_1.urlToEntityQuery(req.url, "Employees").where(pred);
    executeEntityQuery(entityQuery, null, res, next);
};
// not yet implemented
//public Object CustomerCountsByCountry() {
//    return ContextProvider.Context.Customers.GroupBy(c => c.Country).Select(g => new { g.Key, Count = g.Count() });
// need expand support for these.
//public IQueryable<Object> CustomersWithBigOrders() {
//    const stuff = ContextProvider.Context.Customers.Select(c => new { Customer = c, BigOrders = c.Orders.Where(o => o.Freight > 100) });
//public Object CustomersAndProducts() {
//    const stuff = new { Customers = ContextProvider.Context.Customers.ToList(), Products = ContextProvider.Context.Products.ToList() };
exports.namedQuery.saveWithComment = function (req, res, next) {
    var _this = this;
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntities = function (saveMap) { return __awaiter(_this, void 0, void 0, function () {
        var tag, entity;
        return __generator(this, function (_a) {
            tag = saveHandler.saveOptions.tag;
            entity = {
                comment1: (tag == null) ? "Generic comment" : tag,
                createdOn: new Date(),
                seqNum: 1
            };
            saveMap.addEntity("Comment", entity);
            return [2 /*return*/, saveMap];
        });
    }); };
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveWithFreight = function (req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntity = checkFreightOnOrder.bind(saveHandler);
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveWithFreight2 = function (req, res, next) {
    var _this = this;
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntities = function (saveMap) { return __awaiter(_this, void 0, void 0, function () {
        var orderInfos, fn;
        return __generator(this, function (_a) {
            orderInfos = saveMap.getEntityInfosOfType("Order");
            fn = checkFreightOnOrder.bind(saveHandler);
            orderInfos.forEach(function (order) { return fn(order); });
            return [2 /*return*/, saveMap];
        });
    }); };
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveWithExit = function (req, res, next) {
    res.setHeader("Content-Type", "application/json");
    var results = {
        entities: [],
        keyMappings: []
    };
    res.send(results);
};
exports.namedQuery.saveWithEntityErrorsException = function (req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntities = function (saveMap) {
        return __awaiter(this, void 0, void 0, function () {
            var orderInfos, errorDetails;
            return __generator(this, function (_a) {
                orderInfos = saveMap.getEntityInfosOfType("Order");
                errorDetails = orderInfos.map(function (orderInfo) {
                    saveMap.addEntityError(orderInfo, "WrongMethod", "Cannot save orders with this save method", "orderID");
                });
                saveMap.setErrorMessage("test of custom exception message");
                return [2 /*return*/, saveMap];
            });
        });
    };
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveCheckInitializer = function (req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntities = function (saveMap) {
        return __awaiter(this, void 0, void 0, function () {
            var today, order;
            return __generator(this, function (_a) {
                today = new Date();
                today.setHours(0, 0, 0, 0);
                order = {
                    orderDate: today
                };
                saveMap.addEntity("Order", order);
                return [2 /*return*/, saveMap];
            });
        });
    };
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveCheckUnmappedProperty = function (req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntity = function (entityInfo) {
        var unmappedValue = entityInfo.unmapped["myUnmappedProperty"];
        // in c#
        // const unmappedValue = entityInfo.UnmappedValuesMap["myUnmappedProperty"];
        if (unmappedValue !== "anything22") {
            throw new Error("wrong value for unmapped property:  " + unmappedValue);
        }
        return false;
    };
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveCheckUnmappedPropertySerialized = function (req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntity = function (entityInfo) {
        var unmappedValue = entityInfo.unmapped["myUnmappedProperty"];
        if (unmappedValue !== "ANYTHING22") {
            throw new Error("wrong value for unmapped property:  " + unmappedValue);
        }
        var anotherOne = entityInfo.unmapped["anotherOne"];
        if (anotherOne.z[5].foo !== 4) {
            throw new Error("wrong value for 'anotherOne.z[5].foo'");
        }
        if (anotherOne.extra !== 666) {
            throw new Error("wrong value for 'anotherOne.extra'");
        }
        var cust = entityInfo.entity;
        if (cust.companyName.toUpperCase() !== cust.companyName) {
            throw new Error("Uppercasing of company name did not occur");
        }
        return false;
    };
    saveUsingCallback(saveHandler, res, next);
};
exports.namedQuery.saveCheckUnmappedPropertySuppressed = function (req, res, next) {
    var saveHandler = new breeze_sequelize_1.SequelizeSaveHandler(_sequelizeManager, req);
    saveHandler.beforeSaveEntity = function (entityInfo) {
        var unmapped = entityInfo.unmapped;
        if (unmapped != null) {
            throw new Error("unmapped properties should have been suppressed");
        }
        return false;
    };
    saveUsingCallback(saveHandler, res, next);
};
function beforeSaveEntity(entityInfo) {
    if (entityInfo.entityType.shortName === "Region" && entityInfo.entityAspect.entityState === "Added") {
        if (entityInfo.entity.regionDescription.toLowerCase().indexOf("error") === 0) {
            return false;
        }
    }
    if (entityInfo.entityType.shortName === "Employee") {
        var emp = entityInfo.entity;
        if (emp.fullName === null) {
            emp.fullName = emp.firstName + " " + emp.lastName;
        }
    }
    return true;
}
// returns undefined or a Promise;
function beforeSaveEntities(saveMap) {
    return __awaiter(this, void 0, void 0, function () {
        var tag, customers, suppliers, categoryInfos, promises;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    tag = this.saveOptions.tag;
                    customers = saveMap.getEntityInfosOfType("Customer");
                    customers.forEach(function (custInfo) {
                        if (custInfo.entityAspect.entityState !== "Deleted") {
                            var companyName = custInfo.entity.companyName || custInfo.entity.CompanyName;
                            if (companyName.toLowerCase().indexOf("error") === 0) {
                                saveMap.addEntityError(custInfo, "Bad customer", "This customer is not valid!", "companyName");
                            }
                            var contactName = custInfo.entity.contactName || custInfo.entity.ContactName;
                            if (contactName && contactName.toLowerCase().indexOf("error") === 0) {
                                saveMap.addEntityError(custInfo, "Bad ContactName", "This contact name should not contain the word 'Error'", "contactName");
                            }
                        }
                    });
                    if (tag === "addProdOnServer") {
                        suppliers = saveMap.getEntityInfosOfType("Supplier");
                        suppliers.forEach(function (supplierInfo) {
                            var product = {
                                productName: "Test_ Product added on server",
                                supplierID: supplierInfo.entity.supplierID
                            };
                            saveMap.addEntity("Product", product);
                        });
                    }
                    if (!(tag === "increaseProductPrice")) return [3 /*break*/, 2];
                    categoryInfos = saveMap.getEntityInfosOfType("Category");
                    promises = categoryInfos.filter(function (catInfo) {
                        return catInfo.entity.categoryID != null;
                    }).map(function (catInfo) {
                        var entityQuery = breeze_client_1.EntityQuery.from("Products").where("categoryID", "==", catInfo.entity.categoryID);
                        var query = new breeze_sequelize_1.SequelizeQuery(_sequelizeManager, entityQuery);
                        return query.execute().then(function (r) {
                            var products = r;
                            products.forEach(function (product) {
                                product.unitPrice = product.unitPrice + .01;
                                var ei = saveMap.addEntity("Product", product, "Modified");
                                ei.forceUpdate = true;
                            });
                        });
                    });
                    return [4 /*yield*/, Promise.all(promises)];
                case 1:
                    _a.sent();
                    return [2 /*return*/, saveMap];
                case 2: return [2 /*return*/];
            }
        });
    });
}
function checkFreightOnOrder(orderInfo) {
    var order = orderInfo.entity;
    if (this.saveOptions.tag === "freight update") {
        order.freight = order.freight + 1;
    }
    else if (this.saveOptions.tag === "freight update-ov") {
        order.freight = order.freight + 1;
        orderInfo.entityAspect.originalValuesMap["freight"] = null;
    }
    else if (this.saveOptions.tag === "freight update-force") {
        order.freight = order.freight + 1;
        orderInfo.forceUpdate = true;
    }
    return true;
}
// TODO: can't do this yet because it require an async version of beforeSaveEntities
// i.e. think about a beforeSaveEntitiesAsync call.
//function increaseProductPrice(saveMap) {
//  // for every 'modififed"category entity found update all of its product's prices by +1 or -1 $
//  // and include these in the save
//  categories = saveMap.getEntitiesOfType("Category");
//  const modCats = categories.filter(function(cat) {
//    return cat.entityAspect.entityState == "Modified";
//  });
//  modCats.forEach(function(cat){
//    const query = EntityQuery.from("Products").where("CategoryID", "==", cat.CategoryID);
//    // more here
//
//  });
//}
// C# version
//protected override Dictionary<Type, List<EntityInfo>> BeforeSaveEntities(Dictionary<Type, List<EntityInfo>> saveMap) {
//
//  const tag = (string)SaveOptions.Tag;
//
//  if (tag == "CommentOrderShipAddress.Before") {
//    const orderInfos = saveMap[typeof(Order)];
//    byte seq = 1;
//    foreach (const info in orderInfos) {
//      const order = (Order)info.Entity;
//      AddComment(order.ShipAddress, seq++);
//    }
//  } else if (tag == "UpdateProduceShipAddress.Before") {
//    const orderInfos = saveMap[typeof(Order)];
//    const order = (Order)orderInfos[0].Entity;
//    UpdateProduceDescription(order.ShipAddress);
//  } else if (tag == "LookupEmployeeInSeparateContext.Before") {
//    LookupEmployeeInSeparateContext(false);
//  } else if (tag == "LookupEmployeeInSeparateContext.SameConnection.Before") {
//    LookupEmployeeInSeparateContext(true);
//  } else if (tag == "ValidationError.Before") {
//    foreach (const type in saveMap.Keys) {
//      const list = saveMap[type];
//      foreach (const entityInfo in list) {
//        const entity = entityInfo.Entity;
//        const entityError = new EntityError() {
//          EntityTypeName = type.Name,
//              ErrorMessage = "Error message for " + type.Name,
//              ErrorName = "Server-Side Validation",
//        };
//        if (entity is Order) {
//          const order = (Order)entity;
//          entityError.KeyValues = new object[] { order.OrderID };
//          entityError.PropertyName = "OrderDate";
//        }
//
//      }
//    }
//  } else if (tag == "increaseProductPrice") {
//    Dictionary<Type, List<EntityInfo>> saveMapAdditions = new Dictionary<Type, List<EntityInfo>>();
//    foreach (const type in saveMap.Keys) {
//      if (type == typeof(Category)) {
//        foreach (const entityInfo in saveMap[type]) {
//          if (entityInfo.EntityState == EntityState.Modified) {
//            Category category = (entityInfo.Entity as Category);
//            const products = this.Context.Products.Where(p => p.CategoryID == category.CategoryID);
//            foreach (const product in products) {
//              if (!saveMapAdditions.ContainsKey(typeof(Product)))
//                saveMapAdditions[typeof(Product)] = new List<EntityInfo>();
//
//              const ei = this.CreateEntityInfo(product, EntityState.Modified);
//              ei.ForceUpdate = true;
//              const incr = (Convert.ToInt64(product.UnitPrice) % 2) == 0 ? 1 : -1;
//              product.UnitPrice += incr;
//              saveMapAdditions[typeof(Product)].Add(ei);
//            }
//          }
//        }
//      }
//    }
//    foreach (const type in saveMapAdditions.Keys) {
//      if (!saveMap.ContainsKey(type)) {
//        saveMap[type] = new List<EntityInfo>();
//      }
//      foreach (const enInfo in saveMapAdditions[type]) {
//        saveMap[type].Add(enInfo);
//      }
//    }
//  }
//# sourceMappingURL=routes.js.map

redpajama_set_name: RedPajamaGithub


text:
logo-header-footer
Samsung Will Share Plans at the Developers Conference
The Developer Conference by Samsung Company is going to be about the future plans, including the strategies for its ecosystem and platform. They invite creators and developers from around the world to check out the new opportunity that the company offers for them. The conference will take place on October 26.
This is the annual event where Samsung shares its plans and strategies for the upcoming year. This time it will be completely virtual. Developers will be able to join lectures and find out more about the successful experience on the market.
Samsung wants to talk more about updates it made in its own software, platforms, and services. It is the work of thousands of creators and developers that the company wants to celebrate. Samsung officials want to reveal its plans on extending opportunities for talented people. They plan to increase their own ecosystem offering more jobs to developers who will work on new technologies.
The head of Samsung Electronics IT and Mobile Communications Business Department, DJ Koh, will be the first speaker at the conference. He is going to tell participants about the strategy the company has for the new season and the innovations they want to implement to make the experience of their consumers even more positive.
Among the speakers, there will be the Senior Vice President of Mobile Platform Center Daniel Ahn, Vice President from Visual Solution Lab Samsung Research America Bill Mandel, Vice President from Customer Experience Office Jeongsook Lee.
According to the officials, speakers will discuss privacy and security issues, platforms like Tizen, Bixby, and SmartThings there. This conference is divided into three groups: Platforms Designed for Connected Experience, Innovating Mobile Experiences Across Samsung Galaxy Ecosystem, and The Evolution of Tizen.
The conference will be revealed on the SDC website at 10 am PT on October 26. Everyone can join it. If you want to keep up with the latest news, follow our page on Facebook and share the news you like with others.
Feb, 02 2021
Using mods in Cyberpunk 2077 may not be safe Developers from CD Projekt RED warned PC players to use mods and other people's saves Cyberpunk 2077 with "caution".    As it turned out, the studio wrote a group of users who drew attention to the problem with external DLL-files that the game uses. In theory, because of this third-party users can gain access to its owner's PC commands.  The creators of the role-playing thriller promised to fix the flaw immediately, but advised players to use mods and their own saves with caution.   This is just another technical problem associated with the game - not so long ago, the studio has released hotfix 1.11,...
HOTLINE MIAMI 2: WRONG NUMBER REVIEW
4 Best Live TV Streaming Services
6 Games That Will Improve Your Mind and Help You Get Smarter
Hannah Marsh
How to be More Productive – A Guide to Knowing and Making the Most out of Your Day
Performance You Can Rely On
Trust your product to our hands and we will connect the ads with the relevant audience.
(c) 2022-Oilembargo40 - All Rights Reserved
Recommend your app

redpajama_set_name: RedPajamaCommonCrawl


Нижче подано таблицю з часів англійської мови та приклад використання кожного з них.
I wrote a letter a day ago.
I will write you a letter.
I was writing a letter from 6 to 7 p. m.
I will be writing a letter at this time tomorrow.
By the time you came I had written a letter.
I will have written a letter to her by tomorrow.
Не said he would have written a letter to her by the next day.
By the time you came I had been writing a letter for an hour already.
Ihave been writinga letter for two hours already.
By 10 p. m. I will have been writing a letter for two hours already.