Before Change
from typing import Dict // NOQA
from typing import Optional // NOQA
try:
from pytorch_lightning.callbacks import EarlyStopping
from pytorch_lightning import LightningModule
from pytorch_lightning import Trainer
_available = True
except (ImportError, SyntaxError) as e:
// SyntaxError is raised with Python versions below 3.6 since PyTorch Lightning does not
// support them.
_import_error = e
// PyTorchLightningPruningCallback is disabled because PyTorch Lightning is not available.
_available = False
EarlyStopping = object
class PyTorchLightningPruningCallback(EarlyStopping):
PyTorch Lightning callback to prune unpromising trials.
See `the example <https://github.com/optuna/optuna/blob/master/
After Change
from typing import Dict // NOQA
from typing import Optional // NOQA
with optuna._imports.try_import(catch=(ImportError, SyntaxError)) as _imports:
from pytorch_lightning.callbacks import EarlyStopping
from pytorch_lightning import LightningModule
from pytorch_lightning import Trainer
if not _imports.is_successful():
EarlyStopping = object // NOQA


If you have not yet picked a wallet and registered it with your browser, try out the Demo Wallet.
This is a minimal credential Verifier application that demonstrates
how an app would ask the user for a credential
(using CHAPI's get()
under the hood).
When you click the Request button, a Verifiable Credential will be requested from your digital wallet.
Present a Credential


Welcome to documentation for eblur/dust¶
The eblur/dust set of python modules calculate scattering absorption and scattering efficiencies for dust from the infrared to the X-ray. This code can also be used to calculate dust scattering halo images in the X-ray, in both interstellar and intergalactic (cosmological) contexts.
Features¶
A number of dust grain size distributions and optical constants are provided, but they can be fully customized by the user by invoking custom objects of the approporiate class. Provided dust models include:
- A power law distribution of dust grain sizes
- Weingartner & Draine (2001) grain size distributions for Milky Way dust
- Optical constants (complex index of refraction) for 0.1 um sized graphite and astrosilicate grains
- Rayleigh-Gans scattering physics
- Mie scattering physics using the algorithms of
Bohren & Huffman (1986)
- Converted from fortran and IDL to python
Installation¶
As of yet there is no static install version. I recommend cloning the github repo into a directory in your python path.:
cd /path/to/python/libraries/
git clone git@github.com:eblur/dust.git .
Contribute¶
Source code: github.com/eblur/dust
License¶
Copyright (c) 2014, Lia Corrales All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.


If an age in which anarchism red seriously within Western discussions of revolution and political philosophy died at the close of World War I, anarchy did not remain buried. Both an earlier conspiratorial-libertarian breed of anarchism, and later anarcho-syndicalist proposals for loosely confederated workers' organizations were resurrected in Spain, and later by a New Left disenchanted with the claims of liberal democracy and state communism. Moreover, the spectral re of the anarchist was to continue to haunt the modernist imagination. Both state socialism and liberal democracy (and later fascism) were compelled to excise the inchoate, lawless impulses hidden within their own theoretical premises. What, then, becomes of these impulses? I will argue that they found uneasy sanctuary in an emerging modernist fiction, whose very techniques can be understood as both an evasion and an accommodation of a political violence that "history" has refused to shelter. Just as slogans, which Alice Yaeger Kaplan calls the "lifeline between writing and politics," have indicated the linguistic cruxes over which labor has fought its battles, so too will the crisis of violence mark a defining set of moments in the emergence of the modernist aesthetic. 1 Most modern writers were only able to portray anarchist rebellion as at best wrongheaded or doomed, as in Thomas Hardy, or at worst drunken, mindless, catastrophic, and satanic. Nonetheless, a certain quality of demonic rowdiness infiltrates modern texts, even where technique becomes the supreme agent of a textual will-to-power intent on regulating semantic anarchy. Modernist fiction continues to rehearse and redefine the battles of a mythic anarchist violence.
Clearly the complex evolution of collective fantasies of violence is as important to cultural historians as to sociologists and political historians; the construction of these fantasies may provide insight into the strange set of texts that have come to be identified as examples of literary modernism. What is today too quickly dismissed as an "elite" or autonomous modernism was in fact, over time, deeply engaged with popular cultures and political issues, and thus can be viewed neither as an evasion of worldly concerns nor a retreat into autonomy. I contend that the aesthetic itself prophesies potential routes for the desires of the masses, and that anarchic violence marks the boundaries of the contested terrain of the modern imagination. The bomb-throwing anarchist functions simultaneously as the unspeakable object of dread in early modernist and premodernist fiction, and as a reservoir for extreme and unrealizable social aspirations. This duality creates one of the underlying dialectics of modernist aesthetics.
The political violence represented in the re of the anarchist is perpetually elusive and evanescent, eluding any "molar" conration by which it might be packaged, contained, and defused. Even preventative measures and well intentioned attempts to come to terms with violence will always be a step behind, so to speak, condemned to follow in the bloodied footsteps of the act itself. For, as Elaine Scarry argues, violence is metaphysically distinct from language in both its production and its reception. 2 It cannot be grasped; it is by definition excessive. Language, however violent, falls short.
When I insist on the elusiveness of violence I do not mean to reduce it to a textual operation, nor do I intend to dismiss its omnipresent reality on the battlefields, in the streets, in schools and homes. Yet specific forms of textuality may be highly calibrated mechanisms for containing, appropriating, confronting, or evading a political violence understood as other. While violence bears out the significance of any operation usually perceived as textual, that same violence will always be situated as extratextual. As Gilles Deleuze and Félix Guattari argue, the violence of language itself insists that extralinguistic forces overdetermine utterance. 3
If, in some mad dream of a director, violence were consummated "onstage" in all its indeterminate glory, it would presumably provoke a powerfully antisocial response in its audience. Such a theory underlies both the radical imagination that would insist on direct political action and the censorial imagination moved by the dread of mobs rioting at, for instance, contemporary black motion pictures. For the former, it seems the audience must be "moved" beyond outrage or pity to action. Violence transforms the project of offending an audience--a relatively simple task, after all--into a full-fledged attack on social structures. Were critique ever to become truly ruthless in its response, and aimed at everything that exists, as Marx wished, it would pass over into wide-scale demolition. Censorship itself confirms the idea that any audience may be mobilized into pandemonium. Obviously racist, sexist, and other biases that have long equated the "other" with the "irrational" can come into play in various ways. A fully ethical struggle emerges out of the drama enacted over the control of scapegoats, and the question of whether the scapegoats will be numerous enough for self-determination. It is enough for now to underscore the way in which "violence" is understood to clarify and illuminate the compelling and manichean forces at work upon consciousness, forcing it to choose between the real urgencies of the moment. For even as violence inspires rebellion and breaks down the hypothetical barriers to disorder, its unveiling manifests, too, a desire for rigorous and absolute clarity.
Just as something called "anarchy" is invoked to rationalize the most draconian forms of state repression, so too the traditions of anarchism present the most uncompromising meditation on the revelatory possibilities of political violence. The anarcho-syndicalist tradition, exemplified particularly in Sorel but also in writers such as Mikhail Aleksandrovich Bakunin, Petr Alekseevich Kropotkin, and Emma Goldman, demonstrates the ambiguous position of the anarchist in the popular imagination. Conservatives like Fyodor Dostoevski and Joseph Conrad characterized the anarchist as motivated by ressentiment, though this is not invariably the case (as both of those writers instinctively grasped). What Walter Benjamin termed a "quite childish" anarchism relied on a variety of now dated presumptions and theories: Rousseauesque ideas of the state of nature, social Darwinism, heroic voluntarism, sentimental altruism, and so forth. 4 Nonetheless, anarchist theory struggled to expand the limits of progressive thought: Kropotkin revised Darwinist thought to include the concept of mutual aid; Goldman was one of the strongest debunkers of eugenics, as well as an early champion of sexual freedom. Most strikingly, anarchism in its invocation of a better world resisted the compulsion of self-legitimation. Violence in anarchist thought expressed something more than a mere temperamental or pathological dissatisfaction with things; even as an abstract fantasy, it became that which dramatized the very limits of morality and rational thought, 5 abandoning instrumental rationality in favor of spectacle and the sensational apocalypse.
I want to stress here the uncompromising will to distortion in the anarchist tradition, its insistence that arguments based on means and ends take us nowhere; indeed, for the anarchist, this "us" is precisely exclusionary, for the moral calculus of gains and losses cannot be considered in the abstract. Calculation--debate--already defines the circulation of power and "reasonable" arguments are always spoken from the position of power; in their utterance they express their own power, insisting on a humanist distinction between violence and speech. While it may be metaphysically impossible to find an alternative to that distinction--one upon which every democratic social contract indeed rests--we should admit that similar arguments are senseless to those who live and work under the stick.
Consequently, Georges Sorel's Reflections on Violence is characterized by the burning desire to clarify, once and for all, the precise delineations of the workers' struggle. He envisions the general strike as "a body of images capable of invoking instinctively all the sentiments which correspond to the different manifestations of war undertaken by Socialism against modern society." 6 Sorel champions what he calls the philosophy of "pessimism," which emerges heroically from the shambles of satirical thinking. For the pessimistic chiliast, radical change is utopian rather than actual. If the evils from which society suffers are understood as structural, their exposure must rely on an unrelenting violence rather than a rhetorical promise that violence is indeed at work and guilt can be pinpointed. This is not to say that radical change is never worth the attempt, but instead that it falls short everywhere, and not merely because of political contingencies or counter-revolutionary retaliation. Change is abortive precisely because it is the impossible reservoir of millenarian hopes: a dream. In this world, hope might exceed its best intentions, warping them in the process. But the "image" of change is uncompromising, as the malcontent Souvarine--a Russian, significantly, and Bakunin's disciple--asserts in Zola's Germinal:
Don't bother me with your evolution! set fire to the four corners of the town, mow down the people, level everything, and when there is nothing more of this rotten world left standing, perhaps a better one will grow in its place. 7
Sorel, for all his enthusiasms and subsequent disillusionment, knows the full torment of Souvarine's "perhaps," a term that beckons from beyond the rational limits of possibility. Still, he holds to the fantastic notion that we cannot approach a new order without utterly demolishing the current one, and builds on the site of that very "perhaps" the positive myth of violence. Despite his oft-quoted assertion that art is the image of all life after the revolution, it is the image of violence itself that ensures the possibility of collective action, not any facile parables of a peaceful world. 8 The "myth" of violence is at once both the demolition of the current order (the general strike) and the tortured "perhaps" in which the future is dreamed and idealized. It is in this sense that I want to speak of the dream life of political violence, and to relocate Sorel as a theoretician of the modern imaginary rather than as a purveyor of positivist sociology.
Bakunin's famous assertion that the desire for destruction is at the same time a creative desire underscores the clarifying and dramatic impulses at work in such a simplification of human experience. 9 But once again we must examine the tension between violence as defining act and violence as chaos. Zola's Souvarine holds fast to "intrigue" and scoffs at Marx's pretense that the worker will rise "in the clear light of day." 10 If the open act of violence is the method of revelation that clarifies the true terms of the struggle, then intrigue and a shadowy underworld seem to be its matrix. These tensions--between action and plot, instantaneous clarification and dim obfuscation, apocalypse and history, the violence of demolition and that of regeneration, the scientific struggle of the workers and pandemonium--characterize the performance of anarchy before its imagined audience.
We cannot overemphasize the systematic if ambiguous dependence of the bombthrower upon the scarred field of late Victorian temperament, so fiercely haunted by the subcultures of discontent, by those spectral but demographically insistent forms that do not so much lie beneath as comprise the surface and limits of public consciousness. As I have suggested, the act of violence demands an audience. Benjamin's brief meditations on the "destructive character," moved by a compulsion to clear the path regardless of what will be built upon that demolition, assures a spectacular nihilism: "the destroyer must constantly be surrounded by people, witnesses to his efficacy." 11 Much of the violence involved in acts of "terrorism" is avowedly a way of getting people to pay attention.
Sorel asserts that "Socialism is wholly comprised" in the myth of the general strike, and that "the myth in its entirety . . . is alone important" (RV, 137, 136). Consequently he disavows interest in any scientific predictions about the course of the revolution, and has nothing but contempt for the aspirations of the state. Sorel's body of myth is intuitive, pictorial, immediate, and chiliastic, setting itself against both narrative and the vagueness of language itself. It is designed to keep class conflict an active force:
Experience shows that the framing of a future, in some indeterminate time, may, when it is done in a certain way, be very effective, and have very few inconveniences; this happens when the anticipations of the future take the form of myths, which enclose with them all the strongest inclinations of a people, of a party or of a class, inclinations which recur to the mind with the insistence of instincts in all the circumstances of life; and which give an aspect of complete reality to the hopes of immediate action by which, more easily than any other method, men can reform their desires, passions, and mental activity. [RV, 133]
Because Sorel sees no necessary correspondence between economic interests and political ideology, it becomes requisite to establish a generalized class consciousness, to wilfully enact a vision of struggle, and to impress upon a corrupted consciousness an indeterminate framing of the future in order to clarify the workers' view of the present. 12 As syndicalism expresses the political independence of the workers, so too will the general strike express the independence of desire, an independence that obviates centralized planning.  The interest here is in the way that Sorel both suspends and performs the possibility of violence before his audience, and the ways in which this drama enacts within itself the struggle for the ethical type of audience it wishes to create.
While Sorel's reading of Marx is obviously reductive, it underscores the desire to see and act upon the base causes of injustice in the world. Sorel is prepared to create a myth that will delineate exactly the shape of what T. E. Hulme translates as "class war," even when history refuses to produce such war. Such a reading, especially when juxtaposed with the seemingly universal dread of disorder, points to the tensions arising between the rebellious re of the anarchist and the audience. For if anarchist violence as laid out by Sorel works to establish a mythic community of clear-eyed revolutionaries, it also summons into active being the oppositional community of the right-minded, which exists as much by the virtue of the threat that anarchy poses to it as by virtue of any genial or genetic bonds.
Yet desire is a conundrum. Ernesto Laclau and Chantal Mouffe draw on Sorel in order to solve the dilemma posed by Rosa Luxemburg's "spontaneism," a scheme that wrestles with the unruliness of the working class. 13 Luxemburg expresses faith in the masses, but also betrays condescending impatience with them, leavened only by the saintlike tolerance of the revolutionary. She fails to acknowledge the crisis (the multiplicity of subject positions resistant to the simple class analysis of the party) named by her own pamphlet, The Mass Strike. Thus anarchism: in Reflections, at least, Sorel refuses the "party," aligning himself here with the syndicalist insistence on the immediate economic and political self-determination of the workers. It is not the masses who have yet to learn their lesson, but rather their so-called leaders, who betray them at the first whiff of power. This is why Laclau and Mouffe turn to Sorel, who, according to their genealogy of the concept of hegemony, quite rightly recognized the mythic (as opposed to concrete or historical) nature of a collective overdetermination that would unify the struggle. Myth provides the collective enunciation of a will--in post-Marxist terms, the will to consolidate the hegemonically disparate subject positions that together might be said to constitute the proletariat. Yet even in Sorel's work it is often unclear whether this myth arises spontaneously from the collective consciousness of the workers or whether the myth is only inchoate spontaneity and provides the catalyst for collective action. He testifies to its popularity, but not to its origin (RV, 35). The precise distinction between being told what the slogans and actions of the revolution are to be and the self-creation of them by the workers remains to be theorized. In a sense, then, this oversight frames the dilemma of the production of cultural commodities: the struggle for possession of one's desire.
Still, it is clear that Sorel gave voice to the structures of feeling inhabited by the generations of World War I and the decade immediately thereafter. He struck a chord that resonated less perhaps with the specific class to which it was addressed (already dissolute in class terms, as Sorel knew quite well) than with the less strongly politically affiliated among European intellectuals and revolutionaries who had lived through the agonizing breakdown of any revolutionary consensus. Antonio Gramsci laments that Sorel never produced a theory of the party, though this failing, if it is that, was the source of his subsequent intellectual reception. 14 Sorel described a moment in which the passions of the masses might be actively triggered into a felt collectivity and constitute the emergence of a collective will. In this century, at least, "passion" has often been overlooked by theoreticians of leftist coalitions who were usually carrying on about laws of history even as they attempted to break them. Sorel's readers (he had few critics) were quick to seize upon the outline of action he gave them and to invoke the authority of his name, whatever their political leanings.
Sorel's apologists typically insist that he remains unread in any critically effective manner, that his disciples and detractors alike--Mussolini, Lenin, Gramsci--merely quote his most widely known tract out of context and to their own ends. Kaplan pinpoints the phenomenon of Sorel's open text, which she sees as characteristic of a certain modern restlessness set in motion by certain forms of European modernism as well as revolutionary and fascist politics. She speaks of the "Sorel effect" on his readers (RB, 59), pointing out the possibly intentional sketchiness, error, oversimplification, and muddleheadedness of his style. 15 The indeterminacy of his text, as Kaplan intimates, involves a modernist textualization of political violence. The old and wearisome Marxist dichotomy between theory and praxis is at issue here, of course, but so are other factors. Sorel champions the mystique of violence, not the practice, thus implying an epistemological gap between historical forces and mythic structures--a gap which, I will argue, modernist creative fiction rushes to cover over. As Kaplan writes, "what is important . . . is not violence itself, but reflections on violence" (RB, 62). She is correct to establish an equivalence between the style of Sorel, the response to his book, and the subject matter, and to align all three under the rubric "slogan." Moreover, as she insists, Reflections was written in response to the failure of a sustained revolutionary movement on the part of French workers. For Sorel this was nothing less than a moral and imaginative failure, and it became necessary to imagine possibilities previously unknown in revolutionary politics.
Sorel is thus generally classified as a "moralist," for he refuses nationalism (even in its internationalist guise), and much of his work interrogates the values necessary to revolutionary (as opposed to political) action. Sorel's work opposes the growth of the state, here parting company with both German-style social democracy and Bolshevism. 16 His "diremptive" (sometimes translated as "disruptive") methodology is a means of critical analysis, standing opposed to theories of economic determinism and to scientism in general. Diremption is a "method by which one could isolate an object of socio-historical analysis in order to determine its qualitative nature in the context of its multi-variate relations with other phenomena." 17 In other words, his thinking aims at integrating historical with ideational forces, in order to show not the motive but the functioning of any event. Moreover, theory should be participatory, driven by what he terms a "will to deliverance," as opposed to theoretical disinterestedness. As Irving Horowitz argues, his later interest in American pragmatism is not so peculiar, for he stresses from the beginning that ideas be subject to the rule of action, and, like William James, he adapted from Bergson the assurance that intelligence cannot predict where things will go since action creates its own route. 18
I have already invoked a re dwelling somewhat mysteriously in the moment when modernism formulates itself: the anarchist bomber. In fiction and the popular imagination this re contains a multitude of possibilities that might be realized through violence and that define the spectral limit of democracy. Americans of both the Left and Right have always betrayed an acute anxiety concerning their own potential for anarchy, despite anarchists and libertarians never having established any real foothold in the political mainstream. Representations of either a fringe minority or "mobocracy" stand in for the despotism of the popular, wherever it has been suppressed and ignored. 19
The American labor movement in its early years was a ferment of conflicting ideologies, from which the anarchist stood out as the most dangerous, foreign, and volatile element. The Haymarket affair, which created in the public mind an uneasy conration of labor, anarchy, and violence, effectively quelled the dominance of the Knights of Labor and cleared a path for the more conservative American Federation of Labor. 20 Any remote possibility of a mass anarchical movement was perhaps laid to rest by this time, as labor chose accommodation over revolution. 21 It is probably overly simplistic to view the Haymarket affair as an opportunity missed or lost to the forces of repression: while it is clear enough that an organized repression of anarchists took place, the "movement" had never consisted of more than a handful of members. Anarchism was effectively suppressed sometime later by the sedition acts of World War I, when fear of treason was invoked to justify the prosecution of pacifists like Goldman and Eugene Debs. Anarchism attracted hysteria, as Thorstein Veblen, defending the I.W.W. against the Wilson administration, argued. 22
The doctrine of "propaganda by deed" was demonstrably poor public relations, effectively turning public opinion against strikers and anarchists, and it is not surprising that there are few theoretical attempts to justify the practice of violence in the annals of American unions. Union violence, at Homestead for example, was generally a form of self-defense, however much it may have seemed to be the dawn of the revolution to a maverick like Alexander Berkman. 23 Sorel had understood violence in imaginary terms, as defining a cause in concrete imagery, and theories of anarchy generally deferred the actual practice of violence to the imagination, to the ripeness of time. In many cases, proponents and perpetrators of violence within the union halls were plants, double agents, private detectives, the hired guns of industry itself, who wished either to provoke strikers to violence or to prove afterwards in court that violence was the intent of the strikers. Violence in any form generally culminated in a rhetorical and economic victory for industry; the language of the disenfranchised became the political instrument of their overlords, for, in a sort of ironic reversal of Sorel, it galvanized the public consciousness with the fear of anarchy.
Emma Goldman became involved in promoting an American version of syndicalism, although she disagreed with Sorel explicitly about the "mythical" quality of a general strike. 24 Goldman fought somewhat quixotically to dispel the hysteria surrounding the anarchist, although her own role as "firebrand" played on that same public image. An immigrant herself, she railed against the ideology that constituted the anarchist as "foreign," and sought to link anarchy to the Emersonian philosophy of self-reliance. A tension arises in Goldman's thought between the heroic singular consciousness, irremediably at odds with its peers (thus in some structural sense "foreign"), and the social unit that is as likely to disintegrate as to coalesce under the pressure of violent individualism. The paradoxes that emerge imitate the exclusionary structures of the "foreign," and the act of violence becomes the equivocal seal of otherness. Goldman moves uneasily from this point into the theory of communal action on which she comes to rely for its praxis, thereby underscoring the radical ambivalence of her hopes.
Moreover, she became increasingly dismissive of the debates about the practicality of acts of violence. According to her biographer, violence was for Goldman "not a phase of anarchy, and indeed anarchy absolutely opposed violence; yet organized force--that is, government--left no other method of propaganda than acts of violence." 25 The "subjective" space opened up by the confrontation with one's own violent condition--making one a foreigner to one's own self--is inherently contradictory, even chaotic, and may be why anarchism, unlike scientific socialism, could never evolve into a coherent theory. Here we have some preliminary indications as to why anarchism can be considered "fantastic" in its own terms, as a besieged ideology compelled to fabricate the threat of a consuming anarchy.
Goldman's own reflections on violence suggest that the actions of the bomb-carrying "Attentatur" (assassin) are a defensive and spontaneous act compelled by the inhuman circumstance in which the anarchist finds himself. Keeping to the line of thinking that argues for the perversion of an essentially good human nature by civil injustice, she insists that acts of political violence are a response to an already intolerably violent situation. Any uprising, as Kropotkin argued, must be spontaneous, and will have little to do with anarchist ideology. Theory must follow practice: "as if Syndicalism had been discovered by the philosophy of Bergson or the theoretic discourses of Sorel and Berth, and had not existed and lived among the workers long before these men write about it" (RE, 65).
Such arguments fail to distinguish adequately between political and what might be called "prepolitical" acts of violence, for it would certainly take a raised consciousness and propitious circumstances to lash out at a representative of the capitalist order rather than at one's wife, say, or fellow worker. Hence the agitator's task is a pedagogical one: she aims to raise the naive consciousness of the untutored, and here she encounters violence--if indeed it is violence, as Sorel has suggested--that seals solidarity and divides or strengthens public opinion. But public education makes a chimera of spontaneity, and the paradoxical pursuit of spontaneity is already one of the defining acts of modern subjectivity. In the gray area of communal consciousness between sentiment--already there, if anarchism is to have any sound footing at all--and politically sophisticated group action, revolutionary anarchism must grope in perplexity. The muddied well of anarchy, a repository of fears, a reservoir of dreams, offers itself as the model of a tense and dissonant collective "subject."
It will come as no surprise, then, that Goldman became increasingly preoccupied with aesthetic issues, and was extremely interested in drama. The public performance is at once a form of public relations, open to a variety of propaganda techniques acting directly on the audience, and an arena of intensely subjective experimentation. Performance is given its edge by the concrete enactment of this confrontation, which both defines bodies and destroys them. In The Social Significance of Modern Drama , Goldman writes of theater's volatility, looking to Henrik Ibsen, August Strindberg and other European dramatists (even, incredibly, William Butler Yeats) to explode oppressive traditions: "the social significance of modern drama . . . is the dynamite which undermines superstition, shakes the social pillars, and prepares men and women for the reconstruction." 26 The dynamite metaphor is hardly coincidental, and it emphasizes Goldman's faith in cultural forms capable of demolishing ideologies that, if they were institutionally enforced, would be incorporated and lived out in the crippled bodies of working women and men: thus her crusade on behalf of free love. Freedom must be lived and performed prior to becoming an articulate concept. The theater of anarchy is likewise charged with the tension of the public violently interpenetrating the private. Theater, a fleshly carnival, enacts the form of violence Sorel had in mind.
During the Progressive era, American fiction writers--unless they were hired to write propaganda for a particular party--seldom felt the need to discriminate precisely between varieties of leftist thought in this country. Few concerned themselves with the vexed internal debates among anarchists, Socialists, Communists, or the various factions in the trade union movement. Goldman laments the muddleheadedness of the American Left itself, deploring that in the "indefinite, uncertain mind of the American radical the most contradictory ideas and methods are possible. The result is a sad chaos in the radical movement, a sort of intellectual hash, which has neither taste nor character" (RE, 65). But this muddleheadedness was less a failure of taste or determination than an inevitable product of the inherent tensions in radicalism and the labor movement. It manifests itself to Goldman as a result of the unresolved distinction between the proclaimed natural inevitability of revolution and the need to shape consciousness in a way that rejects all authoritarian techniques. What looms as a failure for political action becomes in fiction a wealth of imagined possibilities.
The "radical" in fiction is generally a stereotype and a foreigner, marked by the extreme "autonomy of the will" of Zola's Souvarine. 27 This unlikely and fantastic autonomy distinguishes him, especially to the bourgeois novelist, as an extreme re, one whose appeal lies in his capacity to remove apocalyptic desires from the frustrating determinants of history. Consequently, he (and it usually is a he; women become a special--"apolitical"--case in fictions of anarchism) transgresses the limits of good sense and responsible behavior. 28 The writer, whether aiming to disparage the radical, or enter into some kind of sympathy with him, is at any rate granted a poetic license to move via his writing beyond the social limits positioning the anarchist under the sign of the other.
If, as Lionel Trilling argues, the desire to escape society altogether is the chief modern element in literature, then we should expect to find res of this desire in a variety of places. 29 The anti-social anarchist is one such. Joseph Conrad suggests as much when he identifies, perhaps wrongly, with anarchist ressentiment: "I agree with the extreme anarchist: I want total destruction. That's good; above all, it's clear." 30 The dread that attaches to these cryptic res also signals their investiture with an unthinkable energy, ferocious, libidinal, and charismatic.
Henry James's The Princess Casamassima is a case in point. James's dreamlike rendition of a vague conspiratorial London underground is a meditation on both the charismatic promise of violent transformations as well as their inaccessibility. Although Trilling emphasizes the "naturalism" of James's account of the ethical struggle of a young revolutionary assassin, terming the novel "a brilliantly precise representation of social actuality," his judgment merely indicates the ways in which anarchic extremes present themselves as fantasy, the fantasy at the limits of "social actuality." 31 The everyday imagination partakes of the fantastic when it attempts--as it so often does--to imagine its own abolition. Trilling upholds the verisimilitude of James's novel in order to refute Rebecca West's judgment that the book is a "mad dream," and although West speaks perhaps more to the point, I would stress that the debate between them is conducted in precisely the terms through which anarchy enters the domain of lived circumstance. 32 Anarchy offers a utopian fantasy of violence that dramatizes, on the one hand, the troubled structures of subjectivity, and, on the other, the possibilities that lie beyond our assumed condition, whose realization would shatter any comfort we might take in the familiar. In short, violence is a mystery; confrontation with that mystery demolishes the will to know that motivates the revolutionary promise. In the same way, violence poses a mystery at the limits of representational verisimilitude (realism, naturalism); faced with that mystery, fiction resolves itself into the "textualization" of political violence.
Adumbrated in such novels as The Princess Casamassima are many of the endemic "social" concerns, the repression of which formed one of the great projects of modern aesthetic consciousness. John Carlos Rowe argues that James comes to define and regulate his chosen aesthetic form during the composition of The Princess Casamassima; an elaborate "artistic" value withdraws from the social commitments and pedestrian values of various "realisms" shared by both anarchism and bourgeois politics. 33 High modernist irony marks a pointed retreat into the formal, away from the base politics of philistines.
Modernism is often characterized as a threat to positivist knowledge, and the emergence in the sciences and arts of a network of alternatives to positivism--the theory of relativity, the Heisenberg principle, the postimpressionism of Cézanne, cubism, the "cubist prose" of Gertrude Stein, the formal experimentation of poets and fiction writers--can be seen as signifying an extensive crisis of representation, the deterioration of foundational systems of knowing. Though this crisis had much to do with the devastation of World War I, there are other political considerations central to the narrative of emerging modernism. At the epistemic faultline of the modernist aesthetic is the anarchist, who challenges the political engines of the will-to-knowledge. Before these fantasies of violence, positivist knowledge is compelled to retreat. Modernism might thus be called the formal version of the textualization of violence. Within the endeavor to create a modernism capable, as Jameson says, of holding a deep-rooted "political" realm at bay, is an attempt to manage--initially through the power of personification--those extremes of the tortured political sensibility sheltered by the abstract "anarchist" or secret agent. 34 The strangely charismatic volatility represented by such caricatures is shunned and then refabricated as a precise textual dynamic, evident as much in Sorel and Benjamin as in the dislocated consciousness of the classic high modernist novel.
This is not so far from Emma Goldman's social dynamite as it at first might seem. Jameson notes that Joseph Conrad's conservative novels are complicitous with an exhaustive strategical attempt to define a dangerous and irrational ressentiment as the "true source of all revolutionary behavior," thereby removing anarchism from the field of legitimate politics (PU, 268). By exiling "extreme" or "fanatical" positions and focusing obsessively on their cruelty and terror, Conrad fabricates a nostalgic "whole" distinct from the threat of disorganization embodied in the terrifying re of the anarchist. In line with Benjamin's famous contention that fascism is the aestheticization of politics, the formalized reworking of fantasies of violence is followed by a formalization of violence itself. Violence is thus fantasized on two fronts of consciousness: what assumes fantastically threatening proportions can be effectively internalized and neutralized by the accommodation of threat as fantasy. A formal device, this evasion participates in the production of the modern temper and is involved in the artist's attempt to distance his own products and services from those of mass production. Critics today point to the irony of such an attempt, for it follows the very methods of the marketplace it has rejected, and one notes as well that postmodern packaging is merely the hyper-acceleration of such a process. As Guy Debord and Jean Baudrillard have argued in different ways, "aesthetic" simulacra come to supplant the "real," a real still understood as violent--as in Jameson's dictum that history, however inaccessible it has become, is what hurts.
It seems strange to speak of a withdrawal from politics on the part of modern writers before the enthusiasm generated by the Russian revolution, and before the great experiments in proletarian fiction and social realism by American writers during the 1930s. 35 Each of these episodes had its own political and cultural history, during which the field of politics was specifically reoriented for the purposes of cultural appropriation. Lenin, indeed, condemned and purged "petit bourgeois" anarchist tendencies. A lingering effect of the Soviet Revolution, cultural no less than historical, was to foreclose certain possibilities for the anarchist Left.
Although a certain anarchist cult, centered around Goldman and Big Bill Haywood, survived among the Greenwich Village literati until World War I, this foreclosure was taken up later by novelists of the socialist realist school. This project did not differ so much from the efforts of protomodernists like James and Conrad, even if the aesthetic and political purposes of the earlier writers and the later were radically opposed to one another. The common ground was a participation in the regulation, organization, or resistance of libertarian impulses. For later social realists, such impulses were generally condemned as a historically useless adventurism characteristic of bourgeois individualism; for modernists that same adventurist ethos--understood as leading inevitably to catastrophic violence if left to its own devices--was therefore curtailed, captured, and reframed as an aesthetic temperament.
By the 1930s, there was little interest on the Left in the possibilities of anarchism; except for the occasional piece, such as Louis Adamic's curiously nostalgic Dynamite , everyone was interested in collective action and solidarity to the point of obeisance. This was true despite the support generated among intellectuals for Sacco and Vanzetti, whose execution may have sealed the fate of U. S. anarchism for the next several decades. An underground anarchism can be glimpsed through the 1930s and 1940s, buried in the pages of The Catholic Worker, the Yiddish Freie Arbeter Shtimme, as well as in several Italian-language newspapers. 36 The reasons for the near extinction of anarchist thought are numerous, ranging from the expulsion of anarchist agitators from the U. S., the successful public demonization of anarchism, the catastrophe of the Great Depression, the threat of fascism as an organized response to world-wide depression, the willingness of Roosevelt to offer labor a slice of the economic pie by way of the New Deal, and the defeat of the coalition of anarchists with other factions in Spain. Though the Spanish and their allies on the American Left felt betrayed by the Soviets in the Spanish Civil War, as well as by Stalin's other activities, it was not until the late 1950s that anarchism emerged once again as a response to the Cold War impasse, as the testimony of the skeptic Dwight MacDonald suggests. Indeed, the question remains as to why reformed leftist intellectuals in the U. S., other than MacDonald, Paul Goodman, and a handful of West Coast pacifists, felt constrained to embrace Cold War liberalism in opposition to Stalinism without ever examining the anarchist heritage. The oversight is evident across the Atlantic as well: in France, Albert Camus was the only major intellectual to put forth anything like a case for anarchism. 37
In Language and Symbolic Power, Pierre Bourdieu analyzes the complex relationships among symbolic violence, the varieties of cultural capital, and the economic structure. He emphasizes the material nature of language, and insists its power cannot be abstracted from the extralinguistic world that validates language as power. 38 Spoken violence is not simply a question of power relations that will somehow be "negotiated," nor is the violence merely linguistic. The threats of violent speech, violent language--the repertoire of "dirty" words available to the satirist and the rebel--are more powerful than threats to ideological illusions. Narrative shies away from the violence that everywhere threatens its exclusive legitimacy, and the modern imagination, an historical construct, distances itself from the violence of the world while seeking to manage real threats by assigning them the name "terror." Terror in fact goes by different names; repressed, mutilated, commodified, it re-emerges insistently, often as "text" (but a deeply somatic text), according to the dictates of several traditions, a few of which I have sketched out above.
It is not enough to explain these cultural and social reckonings of violence as mere mechanisms of rearguard ideologies. Theories of ideology have rarely considered the dense materiality of ideological formations, even as they have seldom, until Gramsci, appreciated the radically hegemonic and potentially infinite formations constitutive of ways of being. But ideology is much more than a head game. Jameson, after writing that modernism can be "read as a Utopian compensation for everything reification brings with it" by opening up new perceptual and imaginative possibilities (PU, 236), hints at an epilogue: libidinal utopian impulses, buried in modernist texts, come to be resurrected and transformed by the New Left, and the same energies help to fabricate the postmodern:
This vocation of the perceptual, its Utopian mission as the libidinal transformation of an increasingly dessicated and repressive reality, undergoes a final political mutation in the countercultural movements of the 1960s (at which point the ambiguity of the impulse also becomes more pronounced, and the remainder of the accompanying "ideological" value of the perceptual as the expression of psychic fragmentation is once more politically timely). [PU, 237]
The dramatic staging of perceptual utopias entails the elaboration of a somatic counterfantasy, a passage through the violent constraints in which we find ourselves. The beginnings of such a counterfantasy can be found in the anarchist imagination, which, when it accepts its own confusions as a virtue, is able to leap violently beyond the limits of satire.
The lessons learned from an analysis of the modern reaction to the nature of violence might also help to situate a study of the renewed interest in the possibilities of (a libidinized) chaos. Postmodern writers reveal the anarchic political possibilities explored by the New Left. Truly, most of the speculation surrounding postmodernism is useless nailbiting, particularly when viewed from the context of the former Soviet Bloc (I write this in Brno, Czech Republic). The exhaustion of the New Left provides the unstable platform upon which the present generation of writers and critics stands, when the notion strikes us, to survey the world.
Arthur Redding works for the International Institute of Intercultural Studies and is currently a lecturer in English at Charles University in Prague. He is working on a book entitled Raids on Human Consciousness: Writing, Anarchy, Violence.
1 Alice Yaeger Kaplan, Reproductions of Banality: Fascism, Literature, and French Intellectual Life (Minneapolis: University of Minnesota Press, 1986), 68; hereafter abbreviated RB.
2 Elaine Scarry, The Body in Pain: The Making and Unmaking of the World (New York: Oxford University Press, 1985), 5.
3 Gilles Deleuze and Félix Guattari, A Thousand Plateaus: Capitalism and Schizophrenia, trans. Brian Massumi (1980; reprint, Minneapolis: University of Minnesota Press, 1987), 91.
4 Walter Benjamin, "Critique of Violence," in Reflections, ed. Peter Demetz, trans. Edmund Jephcott (New York: Schocken Books, 1986), 284.
5 This is particularly true of Bakunin and his followers. There are, of course, many varieties of anarchism, and many anarchists bent over backwards to disassociate themselves from their violent reputation.
6 Georges Sorel, Reflections on Violence, trans. T. E. Hulme (1906; reprint, New York: Peter Smith, 1941), 127; hereafter abbreviated RV.
7 Émile Zola, Germinal, trans. Havelock Ellis (1885; New York: Heritage, 1942), 99.
8 Sorel means not the fine arts, but rather what we think of as crafts or the work of artisans. Kaplan points out, however, that these myths as described sound very much like Futurist paintings look. One should not forget the impact of Sorelismo on Italian fascism, nor the incendiary language of Futurist manifestos, which claimed the revolution in their own terms.
9 Michael Bakunin, God and The State (1916; New York: Dover, 1970).
10 Zola, Germinal, 99.
11 Walter Benjamin, "The Destructive Character," in Reflections, 302.
12 Larry Portis, Georges Sorel (London: Pluto Press, 1980), 37.
13 See Ernesto Laclau and Chantal Mouffe, Hegemony and Socialist Strategy: Towards a Radical Democratic Politics (London: Verso, 1985).
14 See Antonio Gramsci, Selections from the Prison Notebooks, trans. Quintin Hoare and Geoffrey Nowell Smith (New York: International, 1971), 127.
The influence of Sorel upon Gramsci is usually overlooked. However, it may explain, as Laclau and Mouffe suggest, part of Gramsci's popularity with the postwar Left, for Sorel sketched out models of collective consciousness that eluded some of the theoretical problems of Marxist notions of "ideology."
15 Sorel himself likened his style to a Bergsonian "process" of experimentation, a roughing out of the active and mobile contours of thought: "I put before my readers the working of a mental effort which is continually endeavoring to break through the bonds of what has been previously constructed for common use" (RV, 4).
16 Sorel later became an ardent admirer of Lenin, however, and dedicated the fourth edition of Reflections to him.
17 Portis, Georges Sorel, 12.
18 See Irving Louis Horowitz, Radicalism and the Revolt Against Reason: The Social Theories of Georges Sorel (New York: Humanities Press, 1961).
19 On anarchism in America, see David DeLeon, American as Anarchist: Reflections on Indigenous Radicalism (Baltimore: Johns Hopkins University Press, 1978); William O. Reichart, Partisans of Freedom: A Study in American Anarchism (Bowling Green, Ohio: Bowling Green University Press, 1976); and Eunice Minette Schuster, Native American Anarchism: A Study of Left Wing American Individualism (New York: DaCapo, 1970).
20 In 1886, in Chicago, a bomb went off at a rally for an eight-hour work day. While no one was ever accused of throwing the bomb, eight anarchists were arrested and four hanged for inciting a riot. The episode is fictionalized in Frank Harris's The Bomb . For a history, see Bruce C. Nelson, Beyond the Martyrs: A Social History of Chicago's Anarchists (New Brunswick, N. J.: Rutgers University Press, 1988).
21 See, for example, Bruce Laurie, Artisans into Workers: Labor in Nineteenth Century America (New York: Noonday, 1989), 186-87, or the essays by John H. M. Laslett, Philip S. Foner, and Robert L. Tyler in Failure of a Dream: Essays in the History of American Socialism, ed. Laslett and Seymour Martin Lipset (Berkeley: University of California Press, 1974).
22 Thorstein Veblen, "On Sabotage," in The Portable Veblen, ed. Max Lerner (New York: Viking, 1948), 431.
23 For an account of this incident, see William Serrin, Homestead: The Glory and Tragedy of an American Steel Town (New York: Random House, 1992).
24 Emma Goldman, Red Emma Speaks: Selected Writings and Speeches, ed. Alix Kates Shulman (New York: Random House, 1972), 73; hereafter abbreviated RE.
25 Alice Wexler, Emma Goldman: An Intimate Life (New York: Pantheon, 1984), 101.
26 Emma Goldman, The Social Significance of Modern Drama (1916; New York: Applause, 1987), 3.
27 Graham Holderness, "Anarchism and Fiction," in The Rise of Socialist Fiction, 1880-1914, ed. H. Gustav Klaus (New York: St. Martin's Press, 1987), 125.
28 For an analysis of the role of women in anarchist movements and the special fear of them in the public imagination, see Margaret S. Marsh, Anarchist Women, 1870-1920 (Philadelphia: Temple University Press, 1981).
29 See Lionel Trilling, "On the Modern Element in Modern Literature," in Beyond Culture (New York: Viking, 1961).
30 Joseph Conrad, quoted in Holderness, "Anarchism and Fiction," 132-33.
31 Lionel Trilling, "The Princess Casamassima," in The Liberal Imagination (New York: Viking, 1950), 79.
32 Ibid., 73.
33 See John Carlos Rowe, The Theoretical Dimension of Henry James (Madison: University of Wisconsin Press, 1984), 188.
34 Fredric Jameson, The Political Unconscious: Narrative as a Socially Symbolic Act (Ithaca, N.Y.: Cornell University Press, 1981); hereafter abbreviated PU.
35 I will be forgiven, I hope, for this cavalier dismissal of the political writers of the 1930s. I plead the excellent critiques done recently in this area. Along with Daniel Aaron's reissued Writers on the Left (New York: Columbia University Press, 1992), the reader should consult the following: David Madden, Proletarian Writers of the Thirties (Carbondale: Southern Illinois University Press, 1979); Richard Pelis, Radical Visions and American Dreams: Culture and Social Thought in the Depression Years (Hanover, N. H.: University Press of New England, 1984); Paula Rabinowitz, Labor and Desire: Women's Revolutionary Fiction in Depression America (Chapel Hill: University of North Carolina Press, 1991); and Walter Rideout, The Radical Novel in the U.S., 1900-1954: Some Interrelations of Literature and Society (New York: Columbia University Press, 1991).
36 DeLeon, American as Anarchist, 37.
37 See Albert Camus, The Rebel, trans. Anthony Bower (New York: Knopf, 1956).
38 Pierre Bourdieu, Language and Symbolic Power, trans. Gino Raymond and Matthew Adamson (Cambridge, Mass.: Harvard University Press, 1991), 37.
.


Category Data
New
Edit
Delete
Category ID
Category Code
Category Name
×
New Category
Category Code
Category Name
×
Edit Category
Category Code
Category Name


SmartAPI Documentation
What is a SmartAPI?
The SmartAPI project aims to maximize the FAIRness (Findability, Accessibility, Interoperability, and Reusability) of web-based Application Programming Interfaces (APIs). Rich metadata is essential to properly describe your API so that it becomes discoverable, connected, and reusable. We have developed a openAPI-based specification for defining the key API metadata elements and value sets. SmartAPI's leverage the Open API specification v3 and JSON-LD for providing semantically annotated JSON content that can be treated as Linked Data.
Why do we need SmartAPIs?
Data analysis is increasingly being performed using cloud-based, web-friendly application programming interfaces (APIs). Thousands of tools and APIs are available through web service registries such as Programmable Web, BioCatalogue and cloud platforms such as Galaxy. Searching these and other API repositories to find a set of tools to retrieve or operate on data of interest presents a number of formidable challenges: users must not only supply the right combination of search terms, but must also closely examine the API outputs to determine whether they can be connected together. SmartAPIs tackle this challenge because they contain the rich metadata needed to precisely describe the service and the data that it operates on or provides.


WELCOME
The Official El Camino Boys Lacrosse Website
2016
Wildcat's Lacrosse Schedule
-
SATURDAY | March 5, 2016
Canyon Crest Academy
2015 SCORE
L12 - 13
2016 SCORE
W10 - 7
-
MONDAY | March 7, 2016
Vista Murrieta
2015 SCORE
N/A
2016 SCORE
W6 - 3
-
SATURDAY | March 12, 2016
Olympian
2015 SCORE
N/A
2016 SCORE
W3 - 1
-
WEDNESDAY | March 16, 2016
Mt. Carmel
2015 SCORE
L9 - 22
2016 SCORE
L7 - 18
-
FRIDAY | March 18, 2016
Chapparal
2015 SCORE
N/A
2016 SCORE
W10 - 7
-
TUESDAY | March 22, 2016
Mira Mesa
2015 SCORE
N/A
2016 SCORE
TBD
-
THURSDAY | March 24, 2016
La Jolla Country Day
2015 SCORE
L10 - 11
2016 SCORE
TBD
-
MONDAY | March 28, 2016
Sage Creek
2015 SCORE
N/A
2016 SCORE
TBD
-
WEDNESDAY | April 6, 2016
Mission Viejo
2015 SCORE
L4 - 10
2016 SCORE
TBD
-
THURSDAY | April 14, 2016
Temecula Valley
2015 SCORE
N/A
2016 SCORE
TBD
-
MONDAY | April 18, 2016
Fallbrook
2015 SCORE
L2 - 5
2016 SCORE
TBD
-
FRIDAY | April 22, 2016
Valley Center
2015 SCORE
L4 - 11
2016 SCORE
TBD
-
TUESDAY | April 26, 2016
St. Augustine
2015 SCORE
N/A
2016 SCORE
TBD
-
FRIDAY | April 29, 2016
Del Norte
2015 SCORE
W6 - 4
2016 SCORE
TBD
-
TUESDAY | May 3, 2016
San Dieguito
2015 SCORE
W13 - 7
2016 SCORE
TBD
-
FRIDAY | May 6, 2016
Fallbrook
2015 SCORE
L2 - 5
2016 SCORE
TBD
2016 Wildcat Roster
Defense
- Jaden Casey
- Quinn Kerwin
- Ethan Lamping
- Mathias Madsen
- Jake Smith
- Mason Smith
- Nathan Williams
- Tyler Wilhelm
Attack
- Nick Colvin
- Kyle McPartland
- Daniel Ortner
- Garrett Brubaker
- Liam Faughnan
Midfield
- Matt Agado
- Blake Amiatu
- Drew Campaigne
- Robert Ramos
- Ryan Ratermann
- David Tran
- Vance Weatherman
- Jagger Knapp
Goalies
- Damien Cracchiolo
- Joshua Chavira


Notebooks
Story: The Lion and the man's story; what the Lion formerly did to the man or The young man of the Ancient Race, who was carried off by a Lion, when asleep in the field
The Lion and the man's story; what the Lion formerly did to the man or The young man of the Ancient Race, who was carried off by a Lion, when asleep in the field
Title
The Lion and the man's story; what the Lion formerly did to the man or The young man of the Ancient Race, who was carried off by a Lion, when asleep in the field
Collection
Summary
The young man of the ancient race, who was carried off by a Lion, when asleep in the field. A very affecting legend, in the Katkop dialect, related to Dia!kwãin by his mother ≠kámme–an (L V.-7. 4457-4525). The Lion places the young man in a tree and goes off to get water to drink. The Lion spies on the man and sees him move and decides to drink quickly and run back to eat him. The man springs from the tree and runs home where the people wrap him in hartebeest skins and mats and hide him in the house's 'bush-screen'. The Lion comes and the people shoot at it, but it is not harmed. Eventually the people tire of trying to kill the Lion and ask the man's mother to give her son to the Lion. As the Lion kills the man the people shoot and stab it and it dies.
Comments
1) Dia!kwain heard this story from his mother (≠kamme-an), 2) Date on p.4457: 29 March; p.4503: 4 April, 3) p.4461v: about the Swart-Storm tree (in Dutch) (the tree the man was placed in by the Lion), 4) p.4498v: the baking of !kui-sse roots in a heated and covered hole in the ground, 5) p.4499v: the old woman's fire will be on top of the hole that contains the baking !kui-sse, 6) See also The man who went to sleep when out hunting alone, 7) This story is found in Book V-7
Contributors
Date
29 March – April 1875
Categories
Keywords
lions (the Lion and the man's story) , lions (are sorcerers) , lions (the nature and habits of) , lions (make people sleepy) , lions (won't leave their prey) , lions (are cunning) , lions (die only when the man they seek is dead) , lions (the Lion wants the man whose tears it licked) , lions (the Lion and the man of the Early Race) , lions (and the man who falls asleep while out hunting) , lions (habits of) , lions (the Lion licks the man's 'eye's tears') , lions (are sorcerers) , young man (of the Early Race) , young man (the Lion makes him sleepy) , young man (falls asleep on the hunting-ground) , young man (is taken away by the Lion) , young man (is put in a tree by the Lion) , young man (feigns death) , young man (runs home in a zigzag direction) , young man (tries to fool the Lion) , young man (looks through his eyelashes at the Lion) , young man (his people protect him) , young man (hides in hartebeest skins) , young man (hides in the bushes of the house) , Early Race ('ancient race') , Early Race (the young man of, who falls asleep and is taken away by the Lion) , skin (hartebeest) , skin (young man hides in from Lion) , man (of the Early Race who was carried off by a Lion, when asleep in the field) , man (young) , sleep (lions make people sleepy) , sleep (the young man of the Early Race who was carried off by a Lion, when asleep in the field) , sleep (a cautionary tale about falling asleep on the hunting-ground) , sorcerers (lions are)
Story Pages
4457-4525


:: com :: sun :: star :: plugin ::
|
| struct PluginDescription |
|
- Description
- Describes a specific plugin. If there are multiple mimetypes and/or
extensions, multiple PluginDescriptions will be created.
|
| Elements' Summary |
| PluginName |
the plugin's name (usually the shared object file name) |
| Mimetype |
a mimetype for which this plugin should be registered |
| Extension |
the file extension for files the plugin can handle |
| Description |
text description of the plugin |
| Elements' Details |
PluginName
string PluginName;
- Description
- the plugin's name (usually the shared object file name)
|
|
Mimetype
string Mimetype;
- Description
- a mimetype for which this plugin should be registered
|
|
Extension
string Extension;
- Description
- the file extension for files the plugin can handle
|
|
Description
string Description;
- Description
- text description of the plugin
|
|
Top of Page
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


---
layout: default
title: Past Winners
permalink: /winners/
---
Past Winners by APG event
{% for post in site.categories.winners %}
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{{ post.date | date: date_format }}
{{ post.title | escape }}
{% endfor %}


Log In
Home
About Us
Pricing
About Us
Ben Feole
Web UI Developer
Max David Metelus
Team Lead
Tom Exarhakis
Front End Developer
Triston Armstrong
Front End Developer
Steve Lanier
Back End Developer


isambard.ampal.protein module¶
AMPAL objects that represent protein.
-
class
Polypeptide
(monomers=None, polymer_id=' ', ampal_parent=None, sl=2)[source]¶ Bases:
ampal.base_ampal.Polymer
Container for Residues, inherits from Polymer.
Parameters: - monomers (Residue or [Residue], optional) – Residue or list containing Residue objects to form the Polypeptide.
- polymer_id (str, optional) – An ID that the user can use to identify the Polypeptide. This is used when generating a pdb file using Polypeptide().pdb.
- ampal_parent (ampal.Assembly, optional) – Reference to Assembly containing the Polymer.
- sl (int, optional) – The default smoothing level used when calculating the backbone primitive.
-
id
¶ str – Polypeptide ID
-
ampal_parent
¶ ampal.Assembly or None – Reference to Assembly containing the Polypeptide
-
molecule_type
¶ str – A description of the type of Polymer i.e. Protein, DNA etc.
-
ligands
¶ ampal.LigandGroup – A LigandGroup containing all the Ligands associated with this Polypeptide chain.
dict – A dictionary containing information about this AMPAL object. The tags dictionary is used by AMPAL to cache information about this object, but is also intended to be used by users to store any relevant information they have.
-
sl
¶ int – The default smoothing level used when calculating the backbone primitive.
Raises: TypeError
– Polymer type objects can only be initialised empty or using a Monomer.-
backbone
¶ Returns a new Polymer containing only the backbone atoms.
Notes
Metadata is not currently preserved from the parent object. Sequence data is retained, but only the main chain atoms are retained.
Returns: bb_poly – Polymer containing only the backbone atoms of the original Polymer. Return type: Polypeptide
-
backbone_bond_angles
¶ Dictionary containing backbone bond angles as lists of floats.
Returns: bond_angles – Keys are n_ca_c, ca_c_o, ca_c_n and c_n_ca, referring to the N-CA-C, CA-C=O, CA-C-N and C-N-CA angles respectively. Values are lists of floats : the bond angles in degrees. The lists of n_ca_c, ca_c_o are of length k for a Polypeptide containing k Residues. The list of ca_c_n and c_n_ca are of length k-1 for a Polypeptide containing k Residues (These angles are across the peptide bond, and are therefore formed between successive Residue pairs). Return type: dict
-
backbone_bond_lengths
¶ Dictionary containing backbone bond lengths as lists of floats.
Returns: bond_lengths – Keys are n_ca, ca_c, c_o and c_n, referring to the N-CA, CA-C, C=O and C-N bonds respectively. Values are lists of floats : the bond lengths in Angstroms. The lists of n_ca, ca_c and c_o are of length k for a Polypeptide containing k Residues. The list of c_n bonds is of length k-1 for a Polypeptide containing k Residues (C-N formed between successive Residue pairs). Return type: dict
-
c_cap
(cap='acid', cap_dihedral=False)[source]¶ Caps C-terminus of polypeptide chain.
Notes
Default behaviour is to add an oxygen atom to create a carboxylate function at the C-terminus without changing the psi angle of the C-terminal residue. Alternative psi angles can be accessed through the cap_dihedral parameter. Will not remove an existing cap if one is present, though altering a cap of the same type will overwrite the original one.
Parameters:
-
c_join
(other, psi=-40.76, omega=-178.25, phi=-65.07, o_c_n_angle=None, c_n_ca_angle=None, c_n_length=None, relabel=True)[source]¶ Joins other to self at the C-terminus via a peptide bond.
Notes
This function directly modifies self. It does not return a new object.
Parameters: - other (Residue or Polypeptide) –
- psi (float, optional) – Psi torsion angle (degrees) between final Residue of self and first Residue of other.
- omega (float, optional) – Omega torsion angle (degrees) between final Residue of self and first Residue of other.
- phi (float, optional) – Phi torsion angle (degrees) between final Residue of self and first Residue of other.
- o_c_n_angle (float or None, optional) – Desired angle between O, C (final Residue of self) and N (first Residue of other) atoms. If None, default value is taken from ideal_backbone_bond_angles.
- c_n_ca_angle (float or None, optional) – Desired angle between C (final Residue of self) and N, CA (first Residue of other) atoms. If None, default value is taken from ideal_backbone_bond_angles.
- c_n_length (float or None, optional) – Desired peptide bond length between final Residue of self and first Residue of other. If None, default value is taken from ideal_backbone_bond_lengths.
- relabel (bool, optional) – If True, relabel_all is run on self before returning.
Raises: TypeError: – If other is not a Residue or a Polypeptide.
-
fasta
¶ Generates sequence data for the protein in FASTA format.
-
get_slice_from_res_id
(start, end)[source]¶ Returns a new Polypeptide containing the Residues in start/end range.
Parameters: Returns: slice_polymer – Polymer containing the residue range specified by start-end
Return type:
-
helices
¶ Returns a new Assembly containing only the alpha-helices.
Notes
Metadata is not currently preserved from the parent object.
Returns: hel_assembly – Assembly containing only the alpha-helices of the original Polymer. Return type: Assembly
-
isoelectric_point
¶ Returns the isoelectric point of the Assembly.
-
molar_extinction_280
¶ Returns the extinction co-efficient of the Assembly at 280 nm.
-
molecular_weight
¶ Returns the molecular weight of the Assembly in Daltons.
-
n_cap
(n_cap='acetyl', cap_dihedral=None)[source]¶ Adds an N-terminal acetamide cap.
Notes
Default behaviour is to duplicate the dihedral angle of the succeeding residues such that the orientation of the carbonyl of the acetyl will resemble that of the first residue. This can be adjusted by supplying a cap_dihedral value. Currently only acetyl cap is supported, but this structure should work for other caps.
Parameters:
-
n_join
(other, psi=-40.76, omega=-178.25, phi=-65.07, o_c_n_angle=None, c_n_ca_angle=None, c_n_length=None, relabel=True)[source]¶ Joins other to self at the N-terminus via a peptide bond.
Notes
This function directly modifies self. It does not return a new object.
Parameters: - other (Residue or Polypeptide) –
- psi (float) – Psi torsion angle (degrees) between final Residue of other and first Residue of self.
- omega (float) – Omega torsion angle (degrees) between final Residue of other and first Residue of self.
- phi (float) – Phi torsion angle (degrees) between final Residue of other and first Residue of self.
- o_c_n_angle (float or None) – Desired angle between O, C (final Residue of other) and N (first Residue of self) atoms. If None, default value is taken from ideal_backbone_bond_angles.
- c_n_ca_angle (float or None) – Desired angle between C (final Residue of other) and N, CA (first Residue of self) atoms. If None, default value is taken from ideal_backbone_bond_angles.
- c_n_length (float or None) – Desired peptide bond length between final Residue of other and first Residue of self. If None, default value is taken from ideal_backbone_bond_lengths.
- relabel (bool) – If True, relabel_all is run on self before returning.
Raises: TypeError: – If other is not a Residue or a Polypeptide
-
pack_new_sequence
(sequence)[source]¶ Packs a new sequence onto the polymer using Scwrl4.
Parameters: sequence (str) – String containing the amino acid sequence. This must be the same length as the Polymer Raises: ValueError
– Raised if the sequence length does not match the number of monomers in the Polymer.
-
primitive
¶ Primitive of the backbone.
Notes
This is the average of the positions of all the CAs in frames of sl Residues.
-
rise_per_residue
()[source]¶ List of rise per residue values along the Polypeptide. .. rubric:: Notes
Calculated from Polypeptide.primitive.
-
sequence
¶ Returns the sequence of the Polymer as a string.
Returns: sequence – String of the Residue sequence of the Polypeptide. Return type: str
-
strands
¶ Returns a new Assembly containing only the beta-strand atoms.
Notes
Metadata is not currently preserved from the parent object.
Returns: strand_assembly – Assembly containing only the beta-strand atoms of the original Polymer. Return type: Assembly
-
tag_ca_geometry
(force=False, reference_axis=None, reference_axis_name='ref_axis')[source]¶ Tags each Residue with rise_per_residue, radius_of_curvature and residues_per_turn.
Parameters: - force (bool, optional) – If True the tag will be run even if Residues are already tagged.
- reference_axis (list(numpy.array or tuple or list), optional) – Coordinates to feed to geometry functions that depend on having a reference axis.
- reference_axis_name (str, optional) – Used to name the keys in tags at Polypeptide and Residue level.
-
tag_dssp_solvent_accessibility
(force=False)[source]¶ Tags each Residues Polymer with its solvent accessibility.
Notes
- For more about DSSP’s solvent accessibilty metric, see:
- http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
References
[1] Kabsch W, Sander C (1983) “Dictionary of protein secondary structure: pattern recognition of hydrogen-bonded and geometrical features”, Biopolymers, 22, 2577-637. Parameters: force (bool, optional) – If True the tag will be run even if Residues are already tagged.
-
tag_residue_solvent_accessibility
(tag_type=False, tag_total=False, force=False, include_hetatms=False)[source]¶ Tags Residues wirh relative residue solvent accessibility.
Notes
THIS FUNCTIONALITY REQUIRES NACESS. This function tags the Monomer with the relative RSA of the whole side chain, i.e. column 2 of the .rsa file that NACCESS writes.
References
[1] Hubbard,S.J. & Thornton, J.M. (1993), ‘NACCESS’, Computer Program, Department of Biochemistry and Molecular Biology, University College London. Parameters: - force (bool, optional) – If True, the ta will be run even if Residues are already tagged.
- tag_type (str, optional) – Specifies the name of the tag. Defaults to ‘residue_solvent_accessibility’. Useful for specifying more than one tag, e.g. if the Polymer is part of an Assembly.
- tag_total (bool, optional) – If True then the total rsa of the Polymer will be tagged in the ‘total accessibility’ tag.
- include_hetatms (bool, optional) – If true then NACCESS will run with the -h flag and will include heteroatom solvent accessibility where it can. Helpful if your file has MSE residues that you don’t convert to MET, but best check if they are there before using the flag.
-
tag_secondary_structure
(force=False)[source]¶ Tags each Residue of the Polypeptide with secondary structure.
Notes
DSSP must be available to call. Check by running isambard.external_programs.dssp.test_dssp. If DSSP is not available, please follow instruction here to add it: https://github.com/woolfson-group/isambard#external-programs
For more information on DSSP see [1].
References
[1] Kabsch W, Sander C (1983) “Dictionary of protein secondary structure: pattern recognition of hydrogen-bonded and geometrical features”, Biopolymers, 22, 2577-637. Parameters: force (bool, optional) – If True the tag will be run even if Residues are already tagged.
-
tag_sidechain_dihedrals
(force=False)[source]¶ Tags each monomer with side-chain dihedral angles
- force: bool, optional
- If True the tag will be run even if Residues are already tagged.
-
tag_torsion_angles
(force=False)[source]¶ Tags each Monomer of the Polymer with its omega, phi and psi torsion angle.
Parameters: force (bool, optional) – If True the tag will be run even if Residues are already tagged.
-
valid_backbone_bond_angles
(atol=20)[source]¶ True if all backbone bond angles are within atol degrees of their expected values.
Notes
Ideal bond angles taken from [1].
References
[1] Schulz, G. E, and R. Heiner Schirmer. Principles Of Protein Structure. New York: Springer-Verlag, 1979. Parameters: atol (float, optional) – Tolerance value in degrees for the absolute deviation away from ideal backbone bond angles.
-
valid_backbone_bond_lengths
(atol=0.1)[source]¶ True if all backbone bonds are within atol Angstroms of the expected distance.
Notes
Ideal bond lengths taken from [1].
References
[1] Schulz, G. E, and R. Heiner Schirmer. Principles Of Protein Structure. New York: Springer-Verlag, 1979. Parameters: atol (float, optional) – Tolerance value in Angstoms for the absolute deviation away from ideal backbone bond lengths.
-
class
Residue
(atoms=None, mol_code='UNK', monomer_id=' ', insertion_code=' ', is_hetero=False, ampal_parent=None)[source]¶ Bases:
ampal.base_ampal.Monomer
Represents a amino acid Residue.
Parameters: - atoms (OrderedDict, optional) – OrderedDict containing Atoms for the Monomer. OrderedDict is used to maintain the order items were added to the dictionary.
- mol_code (str, optional) – One or three letter code that represents the monomer.
- monomer_id (str, optional) – String used to identify the residue.
- insertion_code (str, optional) – Insertion code of monomer, used if reading from pdb.
- is_hetero (bool, optional) – True if is a hetero atom in pdb. Helps with PDB formatting.
- ampal_parent (ampal.Polypeptide, optional) – Reference to Polypeptide containing the Residue.
-
mol_code
¶ str – PDB molecule code that represents the Residue.
-
insertion_code
¶ str – Insertion code of Residue, used if reading from pdb.
-
is_hetero
¶ bool – True if is a hetero atom in pdb. Helps with PDB formatting.
-
states
¶ dict – Contains an OrderedDicts containing atom information for each state available for the Residue.
-
id
¶ str – String used to identify the residue.
-
reference_atom
¶ str – The key that corresponds to the reference atom. This is used by various functions, for example backbone primitives are calculated using the atom defined using this key.
-
ampal_parent
¶ Polypeptide or None – A reference to the Polypeptide containing this Residue.
dict – A dictionary containing information about this AMPAL object. The tags dictionary is used by AMPAL to cache information about this object, but is also intended to be used by users to store any relevant information they have.
Raises: ValueError
– Raised if mol_code is not length 1 or 3.-
backbone
¶ Returns a new Residue containing only the backbone atoms.
Returns: bb_monomer – Residue containing only the backbone atoms of the original Monomer. Return type: Residue Raises: IndexError
– Raise if the atoms dict does not contain the backbone atoms (N, CA, C, O).
-
side_chain
¶ List of the side-chain atoms (R-group).
Notes
Returns empty list for glycine.
Returns: side_chain_atoms Return type: list(Atoms)
-
side_chain_environment
(cutoff=4, include_neighbours=True, inter_chain=True, include_ligands=False, include_solvent=False)[source]¶ Finds Residues with any atom within the cutoff distance of side-chain.
Notes
Includes the parent residue in the list.
Parameters: - cutoff (float, optional) – Maximum inter-atom distance for residue to be included. Defaults to 4.
- include_neighbours (bool, optional) – If false, does not return Residue at i-1, i+1 positions in same chain as Residue.
- inter_chain (bool, optional) – If false, only includes nearby Residue in the same chain as the Residue.
- include_ligands (bool, optional) – If true, Residue classed as ligands but not identified as solvent will be included in the environment.
- include_solvent (bool, optional) – If true, Monomers classed as categorised as solvent will be included in the environment.
Returns: sc_environment – List of monomers within cutoff distance of side-chain.
Return type: list
-
unique_id
¶ Generates a tuple that uniquely identifies a Monomer in an Assembly.
Notes
The unique_id will uniquely identify each monomer within a polymer. If each polymer in an assembly has a distinct id, it will uniquely identify each monomer within the assembly.
The hetero-flag is defined as in Biopython as a string that is either a single whitespace in the case of a non-hetero atom, or ‘H_‘ plus the name of the hetero-residue (e.g. ‘H_GLC’ in the case of a glucose molecule), or ‘W’ in the case of a water molecule.
For more information, see the Biopython documentation or this Biopython wiki page: http://biopython.org/wiki/The_Biopython_Structural_Bioinformatics_FAQ
Returns: unique_id – unique_id[0] is the polymer_id unique_id[1] is a triple of the hetero-flag, the monomer id (residue number) and the insertion code. Return type: tuple
-
align
(target, mobile, target_i=0, mobile_i=0)[source]¶ Aligns one Polypeptide (mobile) to another (target).
Notes
This function directly modifies atoms of the mobile Polypeptide! It does not return a new object.
Parameters: - target (Polypeptide) – Polypeptide to be aligned to.
- mobile (Polypeptide) – Polypeptide to be moved during alignment.
- target_i (int, optional) – Index of Residue in target to align to.
- mobile_i (int, optional) – Index of Residue in mobile to be aligned.
-
find_ss_regions_polymer
(polymer, ss)[source]¶ Returns an Assembly of regions tagged as secondary structure.
Parameters: - polymer (Polypeptide) – Polymer object to be searched secondary structure regions.
- ss (list) – List of secondary structure tags to be separate i.e. [‘H’] would return helices, [‘H’, ‘E’] would return helices and strands.
Returns: fragments – Assembly containing a Polymer for each region of specified secondary structure.
Return type:
-
flat_list_to_dummy_chain
(atom_list, atom_group_s=1)[source]¶ Converts flat list of coordinates into dummy C-alpha carbons
Parameters: Returns: polymer – Polymer object containing atom coord converted Monomers with ‘DUM’ atom name.
Return type:


Alice 3
In 1995, we built a Z80 computer, the Alice 2. We could download programs to it and display images in an NTSC bitmap. It didn't work very well.
In 2015, Brad cleaned up his house and tried to power on the Alice 2. Although it powered on, we couldn't reliably run any programs on it.
After trying to make it work again for a few months, we scrapped all the old hardware and decided to use modern chips and tools, with the goal of running CP/M 2.2 on a silicon Z80.
The Alice 3 uses a Propeller for VGA video and an ARM Cortex M4 for SD card and PS/2 keyboard. The Propeller takes individual ASCII bytes from the CPU and writes them to the VGA screen, pretending to be a VT-100 terminal. Reverse video is also supported. As a bonus, the ARM can use the same mechanism to write to the screen, which has been useful when debugging I/O problems.
Our first version was on three breadboards. It was pretty flaky, working sometimes and then not working two minutes later after we had brushed up against some wires. We got it working intermittently but decided that we wouldn't make any more progress with stability until we moved to a PCB.
Our second version used through-hole components on a PCB, with off-the-shelf daughter boards for the ARM, VGA connector, and SD card connector. We accidentally forgot to connect a bunch of ground and power sections (thanks to a terrible user interface in KiCAD). That was painful to fix by hand, but it then worked on the first try.
Our third and final version used surface-mount components, getting rid of all daughter boards. When we started to assemble it we realized that we had ordered the wrong SRAM part from Digi-Key. This turned out to be fine, though, since the ARM, at 168 MHz, is more than fast enough to monitor the 2 MHz Z80's address and data bus and simulate 64 KB of memory.
The computer boots to a CP/M prompt, where the SD card provides several megabytes of original software. You can run WordStar, Turbo Pascal, MBASIC, and Sargon Chess.
The GitHub repository contains the ARM and Propeller firmware, Z80 boot ROM, Z80 CP/M BIOS, KiCAD project for the PCB, and an emulator.
We produced the PCBs at OSHPark (through-hole, surface-mount). Let us know if you want the BOM so you can build it yourself.


From: {{from}}
To: {{to}}
| Receipt Type | Customer Name | Amount |
|---|---|---|
| {{row['name']}} | {{row['customer']}} | {{row['amount'] | number }} |
| Invoice ID | Order Amount Before Discount | Discount (%) | Discount Amount | Discount Remarks | Discount By | ST (%) | ST Amount | Net Amount |
|---|---|---|---|---|---|---|---|---|
| {{ i + 1 + startingNumber }} | {{row['order_amount_before_discount']}} | {{row['discount_percent']}} | {{row['discount_amount']}} | {{row['discount_remarks']}} | {{row['discount_given_by']}} | {{row['sales_tax_percent']}} | {{row['sales_tax_amount']}} | {{row['receivable_amount']}} | Total | {{ reportData | pluck:'order_amount_before_discount' | sum | number }} | {{ reportData | pluck:'discount_amount' | sum | number }} | {{ reportData | pluck:'sales_tax_amount' | sum | number }} | {{ reportData | pluck:'receivable_amount' | sum | number }} |


How To Order
Men Suits
Women Dresses
Shoes And Accessories
Cart Page
Product
Price
Quantity
Total
Booking Form
Feedback


Go
Movies
Recently Added
Genre
Top Rated
TV Shows
Recently Added
Genre
Top Rated
Games
Recently Added
Genre
Top Rated
link 1
link 2
link 3
link 4
link 5
link 6
link 7
link 8
Highly rated movies


Helper object to reduce boilerplate code when unit testing angular controllers, services, directives, etc.
The 'controllerScope' builder returns the $scope.
p.s. Example when the 'building' of the controller under test ('YourCtrl') is not done in a beforeEach block, so that you can setup some mocking before the controller is initialised.
'use strict';
describe('YourCtrl:', function() {
var $scope;
var buildController = function() {
$scope = iceUnit.builder
.controllerScope('YourApp', 'YourCtrl')
[.withMock(<injectKey>, <mock>)]
[.withParentScope({...})]
[.skipModuleLoad()]// if you loaded the module already (e.g. to setup mocking)
.build();
};
it('some scope test', function() {
buildController();
expect($scope...).toBe(...);
});
});
The 'controllerAs' builder returns (by default) the view model.
If 'returnScope()' is called on the builder, the $scope is returned instead. By default the var $scope.vm will then contain the 'view model'.
By passing the optional 'asName' parameter, the view model varName can be changed.
'use strict';
describe('YourCtrl:', function() {
var vm; //view model
beforeEach(function() {
vm = iceUnit.builder
.controllerAs(<moduleName>, <controllerName>[, <asName>])
[.withMock(<injectKey>, <mock>)]
[.withParentScope({...})]
[.skipModuleLoad()]// if you loaded the module already (e.g. to setup mocking)
[.returnScope()]// if you want the builder to return the $scope (vs. the view model) (e.g. if you want to test a $watch)
// By default the unitTester puts the 'view model' on $scope.vm
// If the optional <asName> was provided, the 'view model' will be on $scope.<asName>
.build();
});
it('some test', function() {
expect(vm...).toBe(...);
});
});
p.s. Example when replacing a dependency (in this case the $log service) of the service under test ('yourService') with a mock/stub of your own.
'use strict';
describe('yourService:', function() {
var yourService;
var logMock = {
info: function() {},
error: function() {}
};
beforeEach(function() {
yourService = iceUnit.builder
.service('ServiceModule', 'yourService')
[.withMock('$log', logMock)]
.build();
});
it('test where the $log service is replaced with my own logMock object', function() {
yourService.callSomeMethod(...);
expect(...).toBe(...);
});
});
If you need to verify (spy) if 'yourService' calls another service during service instantiation:
...
beforeEach(function() {
otherService = iceUnit.builder
.service('ServiceModule', 'otherService')
[.withMock('$log', logMock)]
.build();
spyOn(otherService, 'functionToSpy'); // jasmine
yourService = iceUnit.inject('yourService');
});
...
Based on your needs, iceUnit offers two options for testing a directive:
'use strict';
describe('yourDirective:', function() {
var $scope;
var element;
beforeEach(function () {
var directiveTester = iceUnit.builder
.directive('YourApp', 'HTML of element')
[.withScopeField('someFieldName', 'some initial value')]
[.skipModuleLoad()]// if you loaded the module already (e.g. to setup mocking)
.build();
$scope = directiveTester.$scope;
element = directiveTester.element;
});
it('some directive test', function() {
element. ...
});
});
'use strict';
describe('yourDirective:', function() {
var yourDirective;
beforeEach(function () {
yourDirective = iceUnit.builder
.directiveConfig(<directive module>, 'yourDirective')
[.withMock(<injectKey>, <mock>)]
.build();
});
it('is configured as an attribute name', function() {
expect(yourDirective.restrict).toBe('A');
});
it('some other test based on the link method', function() {
var scope = {};
yourDirective.link(scope);
expect(scope. ...). ...
});
});
With the 'componentController' builder you get the controller by providing the module- and componentName as input.
'use strict';
describe('yourComponent:', function() {
var yourComponentCtrl;
beforeEach(function () {
yourComponentCtrl = iceUnit.builder
.componentController(<directive module>, 'yourComponent')
[.withMock(<injectKey>, <mock>)]
[.skipModuleLoad()]
[.withBindings({<...>)}]// You can provide an object with properties to add to the controller before invoking the constructor. This is used to simulate the bindToController feature and simplify certain kinds of tests.
[.doNotInitializeImmediately()]// If you do not want the controller's $onInit() to be invoked automatically
.build();
});
it('...', function() {
yourComponentCtrl. ...;
});
});
Angular automatically appends 'Filter' to the name of your filter provider, e.g. for the filter 'personFilter' you would have to inject 'personFilterFilter' to unit test the filter.
But iceTest covers that automatically.
'use strict';
describe('yourFilter:', function() {
var yourFilter;
var logMock = {
info: function() {}
};
beforeEach(function() {
yourFilter = iceUnit.builder
.filter('FilterModule', 'yourFilter')
[.withMock('$log', logMock)]
.build();
});
it('does something to the input', function() {
expect(yourFilter(<filterInput>)).toBe(<filterResult>);
});
});
you can do
var $httpBackend;
beforeEach(function() {
$httpBackend = iceUnit.inject('$httpBackend');
});
instead of
var $httpBackend;
beforeEach(inject(function(_$httpBackend_) {
$httpBackend = _$httpBackend_;
}));
Need to test code that behaves differently based on a promise?
With the 'iceUnit.mock.[...]' functions you can mock a promise and simulate its success- or error callback.
iceUnit.mock.promise(callbackObject) supports following promise methods:
.then(successCallback, errorCallback, notifyCallback)
.catch(errorCallback)
the callback functions are stored in the input callbackObject:
callbackObject.success
callbackObject.error
callbackObject.notify
The angular $http service returns a special promise. This promise can also be mocked without using $httpBackend in all your unit tests.
p.s. $httpBackend should only be used in the test of the actual service that is doing a $http call, otherwise you're tightly coupling all your service/controller tests to the rest contract.
iceUnit.mock.$httpPromise(callbackObject) - specifically made to mock the promise result of an angular $http call - supports following promise methods:
.then(successCallback, errorCallback, notifyCallback)
.catch(errorCallback)
.success(successCallback)
.error(errorCallback)
the same callback functions are stored in the input callbackObject as the regular promise (see above)
Example where 'myService.myMethod()' behaves differently based on the promise returned by the 'getSomething' method of 'anotherService'.
'use strict';
describe('myService:', function() {
var myService;
var getSomethingCallBacker = {};// success and error callbacks will be stored in this object
var anotherServiceMock = {
getSomething: iceUnit.mock.$httpPromise(getSomethingCallBacker)
};
beforeEach(function() {
myService = iceUnit.builder
.service('ServiceModule', 'myService')
.withMock('anotherService', anotherServiceMock)// replace the service dependency with the promise mock
.build();
});
it('test when anotherService.getSomething() runs successfully', function() {
myService.myMethod();
getSomethingCallBacker.success({something: 'some value'});// simulate promise success (pass success data)
expect(...).toBe(...);
});
it('test when anotherService.getSomething() fails', function() {
myService.myMethod();
getSomethingCallBacker.error('service is down', 404);// simulate promise error
expect(...).toBe(...);
});
});
The angular $resource service can be used in several ways and is rather complex, but iceUnit can take care of it's mocking for you (again, if you do not want to use $httpBackend all over your unit tests).
Example: You want to unit test 'YourCtrl' that interacts with the $resource object returned by the 'openweatherResource' service.
In this case the $resource returns an empty reference object (stored in $scope.currentWeather) that will automagically be populated once the server returns the data.
'use strict';
angular.module('...').factory('openweatherResource', function openweatherResourceFactory($resource) {
return $resource('http://api.openweathermap.org/data/2.5/weather?q=:cityName,:countryCode');
});
angular.module('YourApp').controller('YourCtrl', function ($scope, openweatherResource) {
$scope.currentWeather = openweatherResource.get({
cityName: 'Leuven',
countryCode: 'be'
}, function successCallback() {
$scope.promiseReturnedOk = true;
}, function errorCallback(httpResponse) {
$scope.errorData = httpResponse.data;
$scope.errorStatus = httpResponse.status;
});
});
The $resourceMock builder fluent api mocks the $resource object internals.
'use strict';
describe('YourCtrl:', function() {
var $scope;
var openweatherResourceCallBacker = {};
var openweatherResourceMock = iceUnit.builder
.$resourceMock(openweatherResourceCallBacker)
.build();
beforeEach(function() {
$scope = iceUnit.builder
.controllerScope('YourApp', 'YourCtrl')
.withMock('openweatherResource', openweatherResourceMock)
.build();
});
it('currentWeather is populated with the return data on rest call success', function() {
expect($scope.currentWeather.temperature).toBeUndefined();
var successData = {
temperature: '30 degrees Celsius'
};
openweatherResourceCallBacker.get.success(successData);// simulate $resource 'get' call returns successfully
expect($scope.currentWeather.temperature).toBe('30 degrees Celsius');
});
});
iceUnit.builder.$resourceMock(callbackObject).build() supports by default the following $resource methods:
// prior to iceTest version [0.5.3] these methods are only supported when they are called in your code with all parameters
.get([parametersObject], [successCallback], [errorCallback])
.save([parametersObject], postData, [successCallback], [errorCallback])
.query([parametersObject], [successCallback], [errorCallback])
.remove([parametersObject], postData, [successCallback], [errorCallback])
.delete([parametersObject], postData, [successCallback], [errorCallback])
// instance methods
.$save([parametersObject], [successCallback], [errorCallback])
.$remove([parametersObject], [successCallback], [errorCallback])
.$delete([parametersObject], [successCallback], [errorCallback])
// The success and error callback functions are stored in the input callbackObject within an object named after the $resource method
// e.g. callbacks for the 'get', 'save' and '$delete' methods
// The payload/postData of non-GET actions is also stored in the same method object (so that the payload can be verified in your tests)
callbackObject.get.success
callbackObject.get.error
callbackObject.save.success
callbackObject.save.error
callbackObject.save.payload
callbackObject.$delete.success
callbackObject.$delete.error
callbackObject.$delete.payload
etc.
optional $resourceMock builder options:
iceUnit.builder
.$resourceMock(callbackObject)
/* Mock a custom action that was defined extra on the $resource.
*
* actionName: must match your custom $resource action + will be used to store the success/error callbacks on the callbackObject
* isArray: boolean - If true then the returned object for this action is an array, otherwise an object
* isPayload: boolean - Use true if action can receive payload, so use false for GET actions
* hasInstanceAction: boolean - Use true if you want the action also to be available as an instance action ('$' will be prefixed automatically)
*/
.withCustomAction('actionName', <isArray>, <isPayload>, <hasInstanceAction>)
.build();
Usefull if you want to mock a single action/method of a $resource object.
Example: You want to unit test 'YourCtrl' that interacts with the $resource query action returned by the 'githubResource' service.
'use strict';
angular.module('...').factory('githubResource', function githubResourceFactory($resource) {
var githubRes = $resource('https://api.github.com/users/:username/repos');
return {
getUserRepos: function(username, successCallback, errorCallback) {
return githubRes.query(
{ username: username },
successCallback,
errorCallback
);
}
};
});
angular.module('YourApp').controller('YourCtrl', function ($scope, githubResource, user) {
$scope.githubReposOfUser = githubResource.getUserRepos(
user.getName(),
function successCallback() {
$scope.promiseReturnedOk = true;
}, function errorCallback(httpResponse) {
$scope.errorData = httpResponse.data;
$scope.errorStatus = httpResponse.status;
});
});
The $resourceActionMock builder fluent api mocks the $resource action internals.
'use strict';
describe('YourCtrl:', function() {
var $scope;
var getUserReposCallBacker = {};
var githubResourceMock = {
getUserRepos: iceUnit.builder
.$resourceActionMock('query', getUserReposCallBacker)
.acceptsPayload(false)
.returnsArray(true)
.build();
};
beforeEach(function() {
$scope = iceUnit.builder
.controllerScope('YourApp', 'YourCtrl')
.withMock('githubResource', githubResourceMock)
.build();
});
it('githubReposOfUser is populated with the return data on rest call success', function() {
var successData = [ { repoName: 'angular-ice' }, { repoName: 'bower-angular-ice' } ];
getUserReposCallBacker.query.success(successData);// simulate $resource 'query' call returns successfully
expect($scope.githubReposOfUser.length).toBe(2);
});
});
See some _test.js files in the angular-ice github code