text:
Subjective Fault as a Basis of Delictual Liability
Janno Lahe
Fault is an element of delictual liability that contains a reproach on the person who has behaved wrongfully and has thus caused damage. So far, the law in force in the Republic of Estonia has relied on the definition of fault that was used in the Soviet civil law theory according to which fault is the relationship between a person's consciousness and the consequences of his or her action. *1 Hopefully, the Riigikogu (Estonian parliament) will pass the Law of Obligations Act *2 (hereinafter: LOA) in this year. The draft of the LOA is a modern draft that follows the traditions of continental Europe. Chapter 54 of the LOA regulates the infliction of damage by tort and draws a distinction between three elements of delictual liability: general elements of delict, risk liability and manufacturer's liability. In the preparation of the draft, there was no serious doubt as to whether the general elements of delict should include fault as one of the preconditions for liability because fault is generally recognised as a basis of delictual liability. *3 What was definitely more interesting was the other aspect of fault which concerns the objectivity and subjectivity of fault. The authors of the LOA have taken as a basis the concept of subjective fault, which means that when deciding whether a person has behaved wrongfully not only the objective circumstances but also the personal qualities of the tortfeasor should be taken into consideration.
This article aims to find out if the choice made in the LOA in favour of subjective fault is justified or not. To achieve the aim, it is reasonable to compare and analyse the corresponding legal regulations and theoretical standpoints of other countries.
Origins of the problem
It is possible to draw a fundamental distinction between two main theories of delictual liability. Firstly, there is the so-called classical theory, which claims that fault is an obligatory element for the creation of liability, and secondly, there is the so-called objective theory, which does not consider the existence of fault to be the necessary precondition for the creation of delictual liability. The LOA is based on the classical theory. However, it should be noted that the concept of fault varies within the classical theory, the variations being based namely on the approach to fault as objective or subjective fault. It is a matter of dispute on which the jurists have not reached a common view.
In case of subjective fault the focus is on the tortfeasor, on his or her individual qualities and peculiarities. However, this approach may often lead to a contradiction between theory and practice. Namely, it cannot always be assumed that when making the judgement, the judge is actually able to evaluate adequately the personal qualities of the tortfeasor, and yet it is on this basis that the diligence standards for this specific person are established. Therefore, the development of the law of tort led to the exclusion of personal qualities from the evaluation of a person's behaviour.
In case of the so-called objective fault the emphasis is laid on the violation of a behavioural norm. Here, the behaviour of a person is evaluated according to the question of whether he or she should have been able to foresee and avoid the infliction of damage. The answer to the question is generally found on the basis of the behavioural standard of a normal, reasonable man in the same situation in which the damage was caused on this specific occasion.
The concept of fault in the civil law in force in the Republic of Estonia
The Civil Code of the Estonian SSR passed on 12 June 1964 *4 (hereinafter: Civil Code) does not provide the definition of fault. Section 227 of the Civil Code provides intention and incautiousness as types of fault. The Soviet civil law theory explained fault as the relationship between the tortfeasor's consciousness and the consequences of his or her action. Thus, the question was posed whether the person wished or did not wish the consequences to emerge, whether he or she foresaw the consequences or had to foresee them. *5
Levels of incautiousness (incautiousness and severe incautiousness) were determined on the basis of specific circumstances. The aspects that were taken into account were the nature and conditions of the action as well as the personal qualities of the tortfeasor. *6
It can be concluded from the above that the law in force as a law reflecting the standpoints of the Soviet civil law theory relies on the concept of subjective fault with an emphasis on personal qualities rather than the violation of a behavioural norm. Judging the fault on each specific occasion, the primary task is to evaluate how the person himself or herself understood his or her action and whether he or she as an individual was not only obliged to foresee but was actually able to foresee that his or her behaviour might result in damage.
In my opinion, a great drawback of the Soviet law theory and thus also of the law in force is the overestimation of one aspect of negligence ― the subjective attitude of a person to his or her action and its consequences. Resulting from this, not enough attention has been paid to the issue of whether and to what extent the person was able to avoid damage or mitigate the damaging consequences. Besides this, it is questionable if in case of unaware passivity it is possible to speak about the subjective attitude of a person to his or her action (inaction).
The concept of fault in the legal orders of continental European countries
In the civil law theory of the Federal Republic of Germany there is a multitude of opinions on the issue in question.
Sentence 2 of subsection 276 (1) of the Civil Code of the Federal Republic of Germany *7 (hereinafter: BGB) provides that a person is negligent if he or she fails to fulfil the general duty of care (allgemeine Verkehrspflicten). This is the concept of objective fault. J. Esser claims that since negligence, for the purposes of sentence 2 of subsection 276 (1) of the BGB, is connected only with the general duty of care, the fault is no longer a precondition for liability in the sense of personal reproachability. *8
B. S. Markesinis explains the fulfilment of the general duty of care provided in sentence 2 of subsection 276 (1) of the BGB as follows: "It means doing something which a reasonable man would not have done, or not doing something which a reasonable man would have done". He claims that similar to common law, the standard of diligence in the law of the Federal Republic of Germany is objective and its test ― bonus pater familias ― sufficiently wide, leaving ample room for legal creativity. If a tortfeasor belongs to the representatives of a profession, he or she must exhibit the diligence required from the representatives of this specific profession. As a rule, the personal limitations of the tortfeasor are not taken into consideration, which the German authors often illustrate with the example of an amateur driver, who makes a mistake of the kind which a driver with his or her experience would not have been able to avoid in the first place. *9
Having emphasised the objective standard of the test, Markesinis adds that in pursuit of equalisation, there is still room for certain subjective elements in the determination of the existence of fault. Namely, the tortfeasor's behaviour is evaluated against the background of the behaviour of the hypothetical reasonable man who has been put in the same external situation as the person who has caused damage. *10
The author of this article believes that what was mentioned above does not add a subjective element to the concept of fault from the point of view of the personal qualities and abilities of the tortfeasor.
Evaluating the justification of the concept of objective fault, Markesinis notes that the objectification of negligence is in itself an intrusion into the principle of fault, but at the same time it is needed as a factor ensuring the modern law of tort. *11
P. Schlechtriem maintains that it is necessary to exhibit the "required" but not the "usual" diligence. According to the prevailing theory, the general duty of care is objectified and it requires the observance of standards applied to a specific profession. Therefore, there is no individual measure on which the obligated person could rely and claim that he or she was unable to meet the standards applicable to his or her profession due to his or her insufficient training, being in a bad mood at the specific time, etc. *12
According to Schlechtriem, it is extremely debatable if the violation of these objectified standards of diligence has to be accompanied with a subjective reproach in order to presume the creation of liability. He refers to the fact that the prevailing theory does not require the subjective reproachability. *13 Based on the administration of justice and the prevailing view, the internal negligence (different from criminal law) is determined not according to the individual abilities of the tortfeasor but according to the abilities of the communication circle in which the tortfeasor acts. In most cases, the result of the objectification of internal diligence this way achieved is that the requirements come closer to external and internal diligence. *14 Schlechtriem adds that a new theory tends to treat the violation of objective ("external") standards of diligence only as a basis to the determination of tort *15 , while the reproach for fault must be accompanied with subjective reproachability as a violation of internal diligence. *16
One of the representatives of the trend that considers both the external diligence and the subjective reproachability (from the point of view of internal diligence) to be necessary is E. Deutsch, who holds the view that diligence is formed by a behaviour programme consisting of external and internal components.
The external or objectively required diligence lies in appropriate behaviour. Behaviour can be considered appropriate if behavioural norms are followed or a required attitude to the benefit of law is expressed. *17 According to E. Deutsch, the civil law generally deems behaviour to be negligent if it fails to meet the objectified and typified requirements for diligence, which result from the principle of "objective undertaking": each person is expected to fulfil the duty of care which is commonly expected from him or her or his or her position. For this purpose, the so-called "groups of duty" (Verkehrsgruppen) have been composed on the basis of different professions and risk areas. The representatives of a certain profession must observe the diligence of a proper representative of the profession. Nevertheless, there are exceptions to the objectively required diligence ― old people and youngsters are not subject to normal requirements of diligence, for their diligence has to be evaluated in the context of their own kind. *18
In Deutsch's opinion, however, the internal or subjectively possible diligence reflects an intellectual/emotional process that may consist of several parts. The internal diligence is based on the sense of the possible realisation of the necessary elements of the act, and thus also on the observance of external diligence. A person must control himself or herself in a way that would enable the realisation of the behavioural obligation resulting from external diligence. *19 Thus, according to the aim of the norm, it is possible that the subjective/individual obligation of diligence is violated. A person can only be obliged to behave in a way that he or she is able to behave in. Physical, intellectual and emotional abilities are presumed only if they really exist. *20
Deutsch finds that negligence only exists when both the external and the internal diligence (in the sense of personal reproachability) have been violated. If the external diligence has not been observed, we are dealing with a violation of an obligation. As a rule, it can be said on the basis of empirical knowledge that in this case, the internal diligence has also been violated. *21
In Deutsch's view, it is necessary in case of violation of the defence law to check the disregard of internal diligence at the third element of delictual liability, which is the fault. Upon violation of external diligence (which must be proved by the damaged person), the violation of internal diligence is presumed. *22
The fact that the different approaches of Deutsch and Schlechtriem to fault may lead to different solutions in specific cases is illustrated by the example in which it is asked if a doctor can be reproached for negligence if his or her hand is trembling during an operation because he or she went to play tennis right before work. During the operation, the doctor observes his or her internal diligence and controls his or her behaviour as required ― which is why the only violation is that of the external diligence obligation. E. Deutsch believes that in this case, the doctor cannot be reproached for negligence. *23 Schlechtriem, on the contrary, finds that in this event the subjective fault of the doctor lies in undertaking an activity at which he or she is unable to meet the objective standards of diligence *24 required for the activity ― it is the so-called undertaking fault. *25
Thus, it can be claimed on the basis of legal literature that so far, the theory of objective fault has been generally accepted in the law of tort of the Federal Republic of Germany, but several distinguished jurists have lately started to have doubts about its expediency. While Schlechtriem supports the concept of objective fault, Markesinis basically "comes to terms" with the concept of objective fault, considering it necessary for the modern law of tort. Deutsch, on the other hand, is a convinced supporter of the so-called "double fault" concept.
Articles 1382 and 1383 of the French civil code (Code Civile) establish the general clause of delictual liability. Article 1382 prescribes that any damage wrongfully caused to another person is liable to be compensated by the tortfeasor. Thus, unlike the general practice of German civil law, the unlawfulness resulting from damage to the benefit of law is not the most important precondition for delictual liability. What matters is the violation of the behavioural obligation to avoid causing damage to another person. The intentional infliction of damage in itself is against the obligation, but any violation of an obligation generally paves the way for fault. Article 1383 provides that a person is not only liable for damage caused intentionally, but also for damage caused negligently and incautiously. *26
In French civil law theory, the principles of the classical and the objective theory are opposed, the latter of which represents an innovatory approach to the foundations of liability law.
Similar to their German colleagues, the supporters of the classical theory divide the concept of fault into two elements: the objective fault and the subjective fault. The theory of objective liability, which says that the tortfeasor's fault is not at all necessary for the creation of liability, has also received remarkable support. *27
The concept of fault in common law
British jurists P. J. Cooke and D. W. Oughton note that the subjective study of each person's abilities and competence would not be sufficient and efficient. *28 It is the dominating opinion that obligations applied to the acting party have no place in the law of tort. *29 Therefore, decisions on fault are made on the grounds of the forms of expression of external behaviour. The standard behaviour, which is the target, is described as the "behaviour of the reasonable man" in the law of England as well as the United States of America. The reasonable man is a fiction to which the judge gives a meaning in each separate case on the basis of his or her set of values. *30 The reasonable man knows the things that are generally known at the time. *31 Negligent behaviour is that below the required standard which has been established to protect other persons from an unreasonable risk of damage. This standard of behaviour has been usually measured in the light of what the reasonable man with common foresight would have done under the same circumstances. *32 D. Howarth poses a control question or a test, the answer to which enables to solve the issue of fault in each specific case, the question being: "How would the reasonable man behave?" It has often been said that the reasonability of the tortfeasor's behaviour is the matter of fact. *33
The question of what kind of behaviour can be expected from an underage person has been a matter of dispute. In the judgement of the court case McHale v. Watson it was noted that the correct diligence standard for an underage tortfeasor is of the kind that is expected from a reasonable minor of the same age, intelligence and experience. *34 In addition to this, the standard of the reasonable man has certain subjective features if the person has a physical disability: in that case, the basis is the behaviour of a reasonable man with a similar physical disability. *35
With regard to the question if fault has to do with the relation of the tortfeasor's consciousness to the cause of damage, J. G. Fleming has claimed that it is important to proceed from the fact that negligence is not a state of mind but rather a kind of behaviour that is below the standard which is considered normal or is required in the society. He maintains that the subjective meaning of a person's fault has long been renounced in favour of the impersonal standard ― how the reasonable man would have behaved under the same circumstances. *36
Markesinis also believes that there is a crucial difference between negligence as a state of mind and delictual negligence. Different from intention and recklessness, negligence as a state of mind means the failure to foresee the consequences of an action that creates the risk of damage to other persons. *37 Foresight is one side of the concept of the violation of an obligation. The violation of an obligation *38 exists if the defendant's behaviour is also unreasonable in the sense of the non-observance of a proper diligence standard. *39
G. H. L. Fridman asserts that for several reasons it cannot be said that the law of tort is firmly based on the idea that liability may not be created without fault, be it intention or negligence. On the other hand, wrongful behaviour may not always lead to delictual liability, either: there is no congruence between wrongful behaviour and delictual liability and there is no reason to believe that such a congruence will eventually occur. *40 According to Fridman, the use of subjective fault is not justified for the above-mentioned reasons.
Consequently, it can be claimed on the basis of special literature that in common law, similarly to the Federal Republic of Germany, the concept of objective fault is dominating and it seems to be relatively deeply rooted and steady in legal science as well as in the administration of justice. There are no sufficiently convincing arguments that would lead the common opinion to the acceptance of subjective fault.
The concept of fault in the draft Law of Obligations Act
Section 1155 of the LOA provides the definitions of intention, negligence and severe negligence. Pursuant to the first sentence of subsection 1155 (2) of the LOA, a person is negligent if he or she fails to observe the general duty of care expected from him or her under certain circumstances, taking into consideration, among other things, the situation, age, education, knowledge, abilities and other qualities of the person. Pursuant to the second sentence of subsection 1155 (2) of the LOA, severe negligence is the considerable non-observance of the general duty of care expected from a person. Subsection 1155 (3) of the LOA provides that intention is a person's wish for the unlawful consequences of his or her behaviour to realise. Subsection 1155 (1) provides an important rule about the division of the duty to prove the fault, according to which the tortfeasor will not be liable for the damage he or she has caused if he or she proves that he or she is not guilty of causing the damage, unless otherwise provided by law. *41
Thus, the LOA has abandoned the approach to fault that was favoured in the Soviet legal theory (see above). It should be noted that the abandonment of the hitherto dominating approach is well justified because the approach that considers the fault to be the tortfeasor's attitude to his or her unlawful act and its consequences represents subjectivity in the extreme. In addition to this, it is obvious that what has occurred in a person's consciousness cannot be objectively grasped and evaluated by other persons, including judges as the main administrators of justice, and that the respective judgements have to be made on the basis of circumstantial evidence. *42
On the basis of the comparison and analysis of the concept of negligence contained in the LOA and in BGB, we can draw the conclusions below. Taking as a basis the first two clauses of subsection 1155 (2), we will come to the first part of the definition of negligence, which says that negligence is the non-observance of the general duty of care expected from a person under certain circumstances. Virtually the same meaning has been given to the concept of negligence in the second sentence of subsection 276 (1) of the BGB. The difference stems from the fact that the LOA prescribes directly that a person's situation, age, education, knowledge, abilities and his or her other qualities must also be taken into consideration when determining the degree of care generally expected from the person.
The enumeration of aspects to be considered is the cause of a split between the standpoint that is generally accepted in German legal science and practice and what has been provided in the LOA: while the German civil law theory relies on the diligence standards established for the specific profession (the fault is objective), the LOA considers it necessary to provide general guidance to the administrators of justice (not leaving the solution of the matter to theory, either) and enacts the concept of subjective fault taking into account the individual abilities and other qualities of a person.
In my opinion, professional standards of diligence have to be taken into account in some cases on the basis of the LOA, too, as it is done in the legal practice of the Federal Republic of Germany. The definition of negligence provided in the second sentence of subsection 1155 (2) of the LOA does not exclude the possibility. For this purpose, groups of the respective typical cases have to be established by legal practice. An example could be a case in which a hiker who has been trained for this is negligent when making a campfire and the forest catches fire. In this case, we could proceed from the diligence standard of hikers as a social group. In the event of the violation of the standard, it should be considerably harder for the tortfeasor to prove his or her innocence than it would be for a casual hiker who does not belong to a hiking club and who has not been trained for hiking.
Although I consider the subjective approach to fault to be more reasonable, the following analysis of the pros and cons of this approach should enable the readers of this article to evaluate whether or not the decision made in the LOA is justified.
The first argument in favour of objective fault could be the fact that objective fault has been accepted in all countries studied. *43 Therefore, the opposite position of the LOA would need a special justification. Secondly, it is reasonable to claim that the determination of subjective fault in each separate case would be definitely more complicated and time-consuming than the establishment of behavioural standards for our own "reasonable man". Consequently, it is more comfortable to implement the objective fault in practice. It has also been claimed that checking the subjective fault (if we assume its possibility) in each separate case is not sufficient and efficient. The last (although, perhaps artificial) argument could be the fact that in case of the fault of a legal person, for instance, it is not possible to take subjectivity into consideration. *44 This, on the other hand, would lead to different solutions in the determination of the fault of natural and legal persons, although pursuant to the first sentence in section 12 of the Constitution of the Republic of Estonia, everyone is equal before the law. Thus, the supporters of objective fault could raise a question of the unequal treatment of people that occurs together with the application of subjective fault.
Despite the arguments above, I still support the theory of subjective fault. First of all, we should take into consideration the discussion among German scientists. As was mentioned earlier, the dominating opinion is no longer absolute in Germany ― several well-known jurists (e.g. E. Deutsch) wish to abandon the concept of objective negligence.
I think that an important argument in favour of subjective fault lies in the fact that the society is not entitled to require a person to behave in a manner in which the person is subjectively unable to behave and then impose liability on him or her for the non-observance of the kind of behaviour that is impossible for the person. This takes us to the following argument according to which only the consideration of the personal qualities of an individual in the determination of his or her fault can result in real liability for fault and in a fair judgement. The objectification of negligence, on the other hand, would often lead to the violation of the principle of fault, as a result of which the so-called faultless liability for fault might occur, which should not be allowed at least until we recognise fault as a basis of delictual liability.
Hence, even if the use of the concept of objective fault in practice is a comfortable solution, it is difficult to find an answer to the question of what remains of delictual liability if we remove personal reproachability from the essential elements of delictual liability.
The definition of fault as provided in the LOA must also be favoured for the reason that the consideration of the tortfeasor's personal qualities helps to achieve a more fair judgement in separate cases (at least if certain persons are involved such as children, disabled persons, elderly people, but probably also other persons). *45
To conclude, it is worthwhile referring to two jurists whose ideas are worthy of support. So, for instance, T. Honore believes that the standard of objective diligence has more in common with risk liability than with the real principle of fault because it makes a person liable for mistakes which he or she is subjectively unable to avoid. *46 Markesinis is also right when he asserts that the objectification of negligence is an intrusion into the principle of fault. In practice, the theoretical distinction between delictual liability and risk liability is often very vague. This change has been accompanied with the transformation or even unnaturalness of the traditional doctrine and the concept of fault. *47
As an objection to the assertion of the advocates of objective fault that the checking of subjective fault is not sufficient and efficient (if it is possible at all), it should be remarked that as a rule, the supporters of objective fault also acknowledge the need to take into consideration the subjective peculiarities of certain persons (e.g. underage people, disabled persons). *48 It could be asked why it is possible and acceptable to take into consideration the personal qualities of certain people and why it is impossible or at least insufficient in case of all the others.
The authors of the LOA have made a choice between subjective and objective fault at a time when the issue of the concept of fault is an object of discussion in many countries.
Although there are strong arguments in favour of both, the author still supports the solution of the LOA whereby subjective factors are taken into consideration for the determination of fault in case of delictual liability.
On the grounds of arguments provided in the main part of the article, another interesting conclusion can be drawn: namely, while the arguments in favour of subjective fault are theoretical in nature, the arguments that support objective fault are of a more practical nature. I believe that the concept of objective fault cannot be considered justified for the sole reason that this is the more efficient and comfortable way to administer justice. Efficiency and comfort should not be the arguments that make us abandon the traditions of the law of tort and distort the principle of fault as the main basis of delictual liability.
Since the LOA has not yet been passed by the Riigikogu, it is the optimum time to have a wider discussion on the issue herein tackled. Knowing the differences in the solution of separate cases resulting from the objective and subjective approach to fault and the importance of the issue for the law of tort as a whole, it is difficult to overestimate the need for relevant discussion prior to the final resolution of the matter.
*1 J. Ananjeva et al. Nõukogude tsiviilõigus. Üldosa (Soviet Civil Law. General Part). Tallinn: Valgus, 1975, lk. 421 (in Estonian).
*2 Võlaõigusseaduse eelnõu (Draft Law of Obligations Act). Justiitsministeerium, 2001 (in Estonian).
*3 It should be noted that in the composition of the general elements of delictual liability, the LOA is largely based on the German model which specifies three elements as grounds to the creation of delictual liability: the objective elements of the act, unlawfulness and fault.
*4 Eesti NSV tsiviilkoodeks (Civil Code of the Estonian SSR) – ENSV Ülemnõukogu Teataja 1964, 25 (234) lisa (in Estonian).
*5 J. Ananjeva et al. (Note 1), p. 421.
*7 Bürgerliches Gesetzbuch. 6. Aufl. München: C. H. Bech, 1991.
*8 J. Esser, H.-L. Weyers. Schuldrecht. Band II. Besonderer Teil. 7., neuarbeitete Aufl. Heidelberg: C. F. Müller Juristischer Verlag, 1991, S. 561.
*9 B. S. Markesinis. A Comparative Introduction to the German Law of Tort. Oxford: Clarendon Press, 1986, p. 44.
*11 Ibid.
*12 P. Schlechtriem. Võlaõigus. Üldosa (Law of Obligations. General Part). 2., ümbertöötatud trükk. Tallinn: Õigusteabe AS Juura, 1994, lk. 107 (in Estonian).
*13 Ibid., p. 108.
*14 P. Schlechtriem. Võlaõigus. Eriosa (Law of Obligations. Special Part). 4., ümbertöötatud trükk. Tallinn: Õigusteabe AS Juura, 2000, lk. 262 (in Estonian).
*15 About different theories of the determination of tort in the Federal Republic of Germany see: K. Kraavi. Generaaldelikti võrdlus Prantsuse ning Saksa õiguses ja võlaõigusseaduse eelnõus, piiritlemine alusetu rikastumisega (Comparison of general tort in French and German law and in the draft Law of Obligations Act; determination with unjust enrichment). Lõputöö. Juh. dots. H. Sepp. Tartu, 1999, p. 24–33 (in Estonian).
*16 P. Schlechtriem (Note 12), p. 108.
*17 E. Deutsch. Academia Iuris. Unerlaubte Handlungen, Schadenersatz und Schmerzengeld. 3., ergänzte Aufl. Köln-Berlin-Bonn-München: Carl Heymanns Verlag KG., 1995, S. 65.
*24 If the "average" doctor had been able to perform the operation successfully, the theory of objective fault would really suggest that we recognise the wrongful behaviour of the doctor whose hand was trembling.
*26 C. Autexier, H. J. Sonnenberger. Einführung in das französische Recht. 3., umarbeitete Aufl. Heidelberg: Recht und Wirtschaft, 2000, S. 138.
*27 K. Kraavi (Note 15), p. 12–13.
*28 P. J. Cooke, D. W. Oughton. The Common Law of Obligations. London-Edinburgh-Butterworths, 1984, p. 169.
*29 D. J. Cooke, D. W. Oughton. The Common Law of Obligations. 2nd ed. London-Dublin-Edinburgh: Butterworths, 1993, p. 173.
*30 P. J. Cooke, D. W. Oughton (Note 28), p. 169.
*31 E. J. Kionka. Torts. 2nd ed. Minn: West Publishing Co. St Paul, 1933, p. 137.
*32 J. G. Fleming. The Law of Torts. 9th ed. The Law Book Company Limited, 1992, p. 105.
*33 D. Howarth. Textbook on Tort. Buttenworths-London-Dublin-Edinburgh, 1995, p. 37.
*34 D. J. Cooke, D. W. Oughton (Note 29), p. 174.
*35 E. J. Kionka (Note 31), p. 138.
*36 J. G. Fleming (Note 32), p. 102.
*37 B. S. Markesinis, S. F. Deakin. Tort Law. 4th ed. Oxford: Clarendon Press, 1999, p. 75.
*38 Ibid., p. 74. The concept of obligation in the view of Markesinis has been sometimes used in a different and more specific meaning: for the diligence obligation to be created in a specific case, the occurrence of damage must be foreseeable namely in connection with the individualised damaged person.
*39 B. S. Markesinis, S. F. Deakin (Note 37), p. 75.
*40 G. H. L. Fridman. Torts. London-Ontario-Canada: Waterlow Publishers, 1990, p. 18.
*41 On account of the limited volume of this article, the problems of the division of the duty to prove the fault will not be tackled here.
*42 It can be noted that there is no fundamental difference between the solution of a case according to the LOA or the present law: if a person behaved incautiously according to the Civil Code, we would in most cases deduce from the LOA that he or she has behaved negligently. Both regulations take account of the specific person and first of all his or her personal qualities. The only difference lies in the different meaning given to the concept of fault, but both the LOA and the Soviet civil law theory proceed from the concept of subjective fault.
*43 Similar to the principles commonly accepted in the Federal Republic of Germany, in France and in common law, the liability in the codes of the three Scandinavian countries (Finland, Sweden and Norway) is based on personal fault, i.e. on the so-called rule of fault. The standard of diligence in the law of these countries is completely objective, even children and mentally ill people may have behaved wrongfully in this sense. See W. V. Gerven, J. Lever, P. Larouche, C. v. Bar. Common Law Europe Casebooks. Torts. Scope of Protection. Genevieve Viney. Oxford: Hart Publishing, 1998, pp. 44–45.
*44 The liability of a legal person may arise from (1) the delict of a member of the organisation ― in this case, the main emphasis is on the fault of the natural person as a tortfeasor, or (2) from organisational deficiencies – in this case, it is not possible to consider the subjective fault at all.
*45 In favour of the supporters of objective fault, it should be said that the correction of the judgement from the point of view of fairness is also possible pursuant to subsection 129 (1) of the LOA which provides that the court may decrease the legal compensation for damages if, taking into consideration the circumstances and mainly the nature of liability, the relationship between persons and their financial situation, including insurance, the full compensation for damages would be extremely unfair to the obligated person or reasonably unacceptable for any other reason.
*46 S. R. Perry. Symposium: Corrective Justice and Formalism: the Care One Owes One's Neighbors: the Moral Foundation of Tort Law. – Iowa Law Review, 1992, p. 14.
*47 E. Deutsch (Note 17), p. 45.
*48 About common law, see: P. J. Cooke, D. W. Oughton (Note 28), p. 174; E. J. Kionka (Note 31), p. 138; about the Federal Republic of Germany, see E. Deutsch (Note 17), p. 68.


We aspire to be the very best for you! Our team of dental professionals is committed to providing the best dental care for you and your family. We take pride in offering the most advanced and appropriate treatments by keeping current with continuing education and technological advancements. Together we have over 100 years of combined dental experience and a lot of passion for our profession.
Dr. Ben H. Britt, Jr., was raised in Rich Square, a small town in eastern North Carolina. He moved to Raleigh to attend North Carolina State University where he graduated with an undergraduate degree in Biochemistry. Dr. Britt worked as a Genetic Toxicologist at GlaxoSmithKline in Research Triangle Park for a few years before attending the University of North Carolina at Chapel Hill School of Dentistry.
Dr. Jessica Forestier grew up in Grand Haven, a small town on the shores of Lake Michigan. She attended the University of Michigan where she received a Bachelor of Science in Health Studies. Dr. Forestier's long-standing interest in the medical field led her to explore a career in dentistry. She found that the ability to work with patients to improve their oral health and confident smile was a perfect fit.


After many years where cycling was our job, we are doing our best to break out of that mindset, to get back to the roots of why we fell in love with cycling in the first place. Rekindling that fire, finding the simple joy of discovering new roads together, that's what our Collecting Cycling Memories motto is all about. And it's what took us to the cycling jewel that is Montenegro.
In case the story of our trip inspires you to give Montenegro a try, below you will be able to find detailed information about our stay in the country, including the Strava GPX files to download.
And don't forget to join the Isadore Strava Club!
We had read about Montenegro in a few articles, and were intrigued by the fact that it was a beautiful place that had remained largely undiscovered and off-the-beaten track. Though it used to be a prime holiday location, the war in the Balkans had dulled a lot of interest in flying to this corner of Europe, even though Montenegro largely avoided the main conflict.
But now, we wanted to see what it had to offer as a cycling destination. It was very easy to get there with a relatively cheap direct flight from Vienna to the capital of Podgorica. This being just outside the peak summer season probably helped. And we had no trouble finding pleasant places to stay through Airbnb or booking.com. There are lots of placed from which to choose at all price points.
Spoiler alert: We were amazed at what Montenegro had to offer for a cyclist. The roads were good quality and pretty empty, the views were breathtaking and the terrain challenging. The food was enjoyable as a mixture of Mediterranean and Middle Eastern cuisine, and the coffee was excellent every place we stopped. What more does an adventurous cyclist need?
Once we landed in Podgorica, we drove to Kotor, which is a charming small port town in the southwest of the country. We can highly recommend spending at least a day in Kotor itself, just to give yourself a chance to walk around and explore the old town with tiny medieval streets.
We used a beautiful 40km ride around the Kotor Bay as a way to warm up for the climbing ahead. Ringed by pretty tall hills and mountains on several sides, the Kotor Bay offered a beautiful and reasonably flat road to ride with motorists who were polite and respected our space while riding. After a pleasant 40-50 km loop around the Bay, which included a ferry transfer, we ended up back in the central part of Kotor from where we were able to start the climb up to the Lovcen National Park.
It's a good thing we were all warmed up since this could very well be nearly the longest climb we have ever done. Around 27 km long, the climb leads up to the Mausoleum of Petar II Petrovic-Njegos at 1749 meters in elevation. But though the climb is super long, the gradient is never too steep, and remains pretty regular.
The traffic was a touch on the heavy side, but that most likely is because we were actually climbing it on Montenegro's Independence Day, which could account for all the traffic heading up to visit the famous mausoleum dedicated to this important Prince-Bishop who was also a poet and philosopher.
After enjoying our first day around Kotor Bay, we traveled north in the direction of the town Pluzine. From there we were able to start our ride on the Mratinje Dam, which at 220 meters high is one of the highest concrete arc dams in Europe. Riding back south along Lake Piva (Pivsko), the largest reservoir for drinking water in the Balkans, the spectacular scenery looked like something out of a James Bond film. The road was practically empty and there were a series of short but epically dark tunnels that alternated with the view over the lake.
The first 15km was mainly flat along the lake, but then the climb towards Žabljak and Trsa started. It's quite a dramatic entry into the climb with a sharp left turn off the main road taking you into a raw dark tunnel while the gradient kicks up pretty steeply.
The difficult gradient continues for most of the first part of the climb towards the Durmitor National Park. Once we passed through the forests and entered the high pasture lands on the plateau, we could start to see the rocky peaks of the Durmitor. Imagine if the Dolomites and Alps merged together in a fraction of the area, and that's about what you can expect from this intense scenery with dramatic vistas.
About half way up the Sedlo climb, which is the main pass thru the Durmitor National Park, we were advised not to go any further because the road was blocked with snow. But being intrepid cyclists who are super happy not to be following a training plan anymore, we took a chance as we were drawn by the promise of even more breathtaking views.
Yes, okay, so we did hit the snow wall at some point, and our crew could not follow us in the car any further. Undaunted, as our crew had to turn around and meet us all the way on the other side of the national park, we continued through the snowy sections on foot carrying our bikes. There were a few of these snowy areas blocking the road before we finally reached the top of the Sedlo climb at an altitude of 1907 meters.
Spectacular hardly describes it. And after a long descent towards the town of Savnik, we were able to meet back up with our crew and call it a day.
Having saved the longest and hardest day for last, we started the morning in the town of Kolasin in central part of Montenegro. Heading southeast towards the border with Albania, we had to get over the first climb called Tresnjevik. Climbs of over 45 minutes felt pretty normal by now since we had spent so much of the previous two days climbing.
We stopped for lunch just before reaching the Albanian border. And although the place did not have a set menu, they assured us that they would have anything we would need. To our amazement, they were right. Even though we were in the middle of nowhere, we enjoyed one of the best meals we had had during the entire trip.
We then crossed the border into Albania and hit what turned out to be the best road of our journey. Tracing along border with Montenegro, this was a deep canyon road with epic views that are nearly impossible to describe. And best of all, we were practically alone with perhaps a couple adventure motorcyclists occasionally passing. It felt like the road was built for our exclusive use so we could go out there and hammer each other!
We finished the ride at the top of the Grabom climb, exhausted, soaked by a fresh summer storm, but totally amazed by how epic the last three days had been.
The roaming charges for the phones are high, so best option is to buy a local sim card. Happily the coverage was very good even in the most rugged terrain. We opted for the Telenor provider.
Most of cafés, restaurants and airbnbs provided wifi, which was usually pretty strong. Not sure why, but the majority of places lock their networks with very simple passwords. It was usually the name of the network with 123 added at the end, and there you go.
You should definitely try the local beer Nikšičko. It's light and refreshing with a low alcohol content which makes it a perfect refreshment during a bike ride.
Another local ''must try'' is the white wine made from the Krstač grape. It's a variety only grown in Montenegro. A very crisp and balanced wine.
And one final gastronomic tip: In addition to the amazing seafood and many varieties of cheeses that are excellent choices thanks to Montenegro's geographic position, one of the local specialties we tried and loved was the deep fried pancakes filled with cheese. If you are planning a big ride, this is a great option for fueling up ahead of time.
It's a pleasure to read and view your epic bike adventures to unknown territories. Thank you for sharing the stories. Keep it up!
Wau, iba slintám. Krásne fotky, magické scenérie a sympatickí ľudia. Výborný článok, len ma trošku mrzí, že si nemôžem rozkliknúť fotky.
Fantastic Montenegro write up,looking at heading there with the wife and bikes next year. Thanks so much,keep up the good work.


text:
Q: Why are Redux actions implemented as functions?
I'm studying how Redux works, and there is something I can't fully understand.
Usually Redux actions are implemented as functions. For example:
const ACTION_INCREMENT = 'INCREMENT'
const increment = function(amount) {
   return {type: ACTION_INCREMENT, amount: amount}
}

store.dispatch(increment(2));

Why aren't action implemented as classes? I mean, I find more natural something like this:
class ActionIncrement {
    constructor(amount) {
      this.amount = amount;
    }
}

store.dispatch(new ActionIncrement(2));

It's very strange that nobody does this. Is there an issue with this approach I haven't seen?

A: What you are referring to are action creators, which are functions that return actions (JS objects).
Here are some disadvantages I can think of right now:

*

*Classes are syntactically more complex, leading to longer boilerplate code, more room for misuse/mistakes (eg. forgetting to assign a type property for the reducers to identify).

*Action creators are meant to be stateless. Using classes might lead to more misuse/misunderstanding. Granted, you can use this on functions as well, but that's less common (and not possible for functions declared with ES6 arrow syntax).

*It will be incompatible with many existing Redux libraries, such as redux-thunk. redux-thunk delays the dispatching of the action to the reducers, allowing asynchronous calls in action creators. For such libraries to support classes, all classes must agree to have a common async method that will be called and awaited. This leads to more boilerplate and room for misuse/mistakes.

A: I will suggest reading the Motivation section in the documentation.

Following in the steps of Flux, CQRS, and Event Sourcing, Redux
  attempts to make state mutations predictable by imposing certain
  restrictions on how and when updates can happen. These restrictions
  are reflected in the three principles of Redux.

You could create Classes as they are just syntactic sugar for creating Objects, however, what would be the benefit of doing that over more explicit Object literal?
An action is a simple configuration object with no side-effects which gives a lot of benefits like time-travel and more predictable debugging which is one of the main advantages of using redux. Having Classes IMO besides introducing extra code could point people to creating some state-mutating functionalities.

redpajama_set_name: RedPajamaStackExchange


Ep. 37 Time Management- Stop Multitasking and Get Focused!
Time Management- Stop Multitasking and Get Focused!
• Don't try to multitask, it doesn't work, Trust us, we're Nice Guys.
Please visit our very cool sponsor- Stickerjunkie.com and use Promo code "niceguys10" to get $10.00 off of any sticker order.


The faces on these dolls are screened on to insure good likenesses and then the suits are hand painted. Your favorite Russian composers are included in this stacking doll: Tchaikovski, Rachmaninoff, Rubinstein, and Mussorgsky. The outside doll is 7 inches tall and has a matte finish.


J. Luke Bennecke is a native Californian and a 25-year veteran civil engineer who has spent his career helping people by improving transportation systems in Southern California. Like most commuters, he longs for the day when traffic congestion is a thing of the past and highway fatalities are a distant memory. He has a BS in civil engineering from Cal Poly Pomona, an MBA from Cal State San Bernardino, a private pilot's certificate, and is a partner in the successful firm, Southstar Engineering, based in Riverside.
He has been happily married to the woman of his dreams, Tammy, for nearly three awesome decades and enjoys spending time with his grown daughters.
July 2019 - J. Luke Bennecke is interviewed on the largest morning television show in Los Angeles.
Enjoy this short book trailer about Civil Terror: Gridlock.
Civil Engineer Dr. Jake Bendel is forced into the FBI world of terrorism, espionage, and betrayal, using his engineering mind to save American lives.


Clay. Late 5th — early 4th centuries BCE.
Height 7.5 cm. Saint Petersburg, The State Hermitage MuseumInv. No. Б. 7014.
Unknown; from the Bobrinsky collection, acquired in 1931.
Side A represents a naked athlete taking part in a torch race with a burning torch in his left hand. "The torch he bore with rapid steps in this sacred contest played out among young men in memory of the fire stolen by Prometheus..." (AP VI 100). He wears a wreath and is running towards the right. On the other side, the goddess Athena appears with all her attributes: shield, spear and helmet. The statue of Athena represented in her "Promachos" type (she who fights in the front line) decorated the amphora awarded to the victors in the Panathenaic Games.
K. S. Gorbounova, The Attic black-figure Vases at the Hermitage, (Leningrad, 1983) no. 193 p. 213.
© 1993. Photo, text: Olympism in antiquity. Olympic Museum Lausanne. Bertelsmann UFA. Industria Gráfica S. A. Barcelona, 1993, p. 60 cat. no. 3.


Dr. Laurie Williams, professor and interim head of the Department of Computer Science at North Carolina State University, has been elected as a Fellow of the Institute of Electrical and Electronics Engineers (IEEE).
Williams, who joined the NC State faculty in 2000, was recognized by IEEE for her contributions to reliable and secure software engineering.
Williams is internationally known as one of the foremost researchers in agile software development and the security of healthcare IT applications. Additionally, she leads the Software Engineering Realsearch research group at NC State, which focuses on the development of reliable, secure software and collaboration with high-tech companies such as ABB Corporation, Cisco, IBM, Microsoft, Nortel Networks, Red Hat and numerous healthcare IT organizations.
Amongst her many awards, she has received the Carol Miller Graduate Lecturer Award, NC State Alumni Association Outstanding Research Award and National Science Foundation Faculty Early CAREER Award. Williams is an IEEE senior member and NC State faculty scholar.
She received a B.S. in industrial engineering from Lehigh University, an MBA from Duke University's Fuqua School of Business and a Ph.D. in computer science from the University of Utah.


text:
Wolverton: A wish list for iOS
By Troy Wolverton | Bay Area News Group
With Apple set to unveil a host of new features for the software underlying the iPhone and iPad, I've got some ideas on what it ought to include.
On Monday, the computing giant kicks off its annual Worldwide Developer Conference in San Francisco. The company uses the event each year to show off the latest versions of its operating systems, which now include OS X for Macs; iOS for iPads and iPhones; Apple TV's tvOS; and watchOS for Apple Watch. Of those, iOS is the most important because, by far, it's used by the most people.
I own and use Apple products all the time and have had an iPhone since the second model. I'm very familiar with the strengths and weaknesses of iOS.
Here's a quick rundown of some of the things I'd like to see Apple fix in iOS or features I'd like to see it include:
Sucky Siri. It's been widely reported that Apple's intelligent assistant will be the star of the show at Monday's keynote. The company is reportedly bringing Siri to the Mac. It's also supposed to finally be opening up Siri to outside developers, allowing them to link their apps to the technology. That's something that Apple should have done a long time ago. In the meantime, Amazon's Echo has shown how useful it can be to control apps and glean information from a wide range of sources using just your voice.
But I'd like Apple to also spend some time focusing on something more basic with Siri — just getting it to work better and more consistently. I find the "Hey Siri" function, which is supposed to allow you to activate the assistant by just speaking those words, works about half the time at best. Siri frequently misunderstands me when I ask it to do basic things, like set a timer. I recently asked Siri to rewind a podcast by 15 seconds while I was running only to have it restart the podcast from the beginning, which meant I had to pull my phone out of my pocket to try to get back to where I was.
And that's not to mention that Siri often doesn't understand context and frequently can't answer basic questions. Siri can tell you who Barack Obama is, but you'll stump her if you ask an immediate follow-up question like, "When was he elected president?" Siri needs work.
Laptop lite. When Apple launched the jumbo-sized iPad Pro last fall, it touted the device as a laptop replacement. While Apple's tablets are great, they can't truly replace laptops until Apple adds some features.
One big missing piece: You can't use a mouse with an iPad or any iOS device. Instead, Apple forces you to position a cursor or interact with apps using your fingers on their touch screens. That's difficult and not particularly ergonomic if you are typing on an external keyboard. It would be much easier and more comfortable to use a mouse.
Another missing element is that Apple doesn't support multiple user logins on iOS devices. That's long been a basic feature of personal computers, including Apple's own Mac line. Apple may not like the fact, but people share tablets just like they share computers, whether within a family or in an office. And it would be nice to be able to do that without allowing other people to see your email or text messages.
One other idea: Creating more of a desktop-like interface for iOS. Microsoft learned this lesson the hard way with Windows 8, but an interface designed for a touch screen doesn't work so well when you are interacting with the device using a keyboard. With Windows 10, Microsoft allowed users to switch between tablet and desktop modes depending on how they were using their device. Apple would do well to follow suit.
Power to the people. iPhones and iPads come with a handful of applications preinstalled, including a web browser, a mapping program and an email app. Many of these apps are just fine, but in many cases you can find better ones in Apple's own App Store. Unfortunately, there's no way to replace Apple's apps as the default ones on your device.
If you tap on an address in an email, it's generally going to open up Apple's Maps application, not Google Maps. If you click on an email address on a web page, it will generally create a new message in Apple's own Mail program, not the Gmail app or Outlook. On Windows PCs, Macs and Android devices, users can choose their default programs; iOS users ought to finally have the same option.
But they also ought to have an additional power: the ability to delete some of the default apps. Over the years, the number of apps that Apple ships with iOS devices has gotten ever longer, and the latest apps, particularly ones you use with Apple Watch, have started to verge on "crapware," existing only to promote other services. Many users have taken to hiding all the unwanted Apple apps in a folder, but they shouldn't have to do that. They should be able to get rid of them.
And there's one other place I'd like to see users have more ability to customize their devices: in the Control Center. That's the feature you access by swiping up from the bottom of the screen that allows you to turn your Wi-Fi or Bluetooth radios on and off. I'd like to see more choice in what settings you can access through Control Center. And I'd love to be able to connect or disconnect to particular Wi-Fi hot spots through Control Center rather than having to go through the Settings app.
More openness. I'm excited at the prospect of Apple opening up Siri. I'd like to see it open up another of its mobile features: its near-field communications (NFC) antenna.
Right now, you can only use the iPhone's NFC antenna to make wireless payments with Apple Pay. But outside the iPhone, NFC technology is used in a lot of other things, including security cards, transit passes, ski lift tickets and more. It would be great if the iPhone could replace not only your credit cards but also your bus pass. But that will happen only if Apple opens up the NFC feature.
Apple has already opened up TouchID, its fingerprint sensor, to app developers. But I'd also love to see it opened up to websites. Right now, to log in to a webpage on an iPhone or iPad, you have to type in your username and password; tapping your thumb on the home button would be a lot faster and easier.
Contact Troy Wolverton at 408-840-4285 or twolverton@bayareanewsgroup.com. Follow him at www.mercurynews.com/troy-wolverton or Twitter.com/troywolv.
APPLE'S DEVELOPER gET-TOGETHER
What: Apple's annual Worldwide Developer Conference
Where: Bill Graham Civic Auditorium and Moscone West, San Francisco
When: Monday, June 13 to Friday, June 17
Of Note: Keynote address on Monday at 10 a.m., when Apple executives will likely unveil new features for software underlying the iPhone and other devices.
Troy Wolverton
Troy Wolverton writes the Tech Files column and covers consumer technology as the personal technology columnist for the Bay Area News Group. Previously, he covered Apple and the consumer electronics industry. Earlier, he reported on technology, business and financial issues for TheStreet.com and CNET News.com.
69-year-old bikini-clad California woman missing in Mojave Desert
Bay Area earthquake: Magnitude 3.5 quake rattles Morgan Hill
SF Giants: MLB trade deadline's 'top sellers' may not sell
Kendall Jenner's NBA boyfriends irks Ben Simmons' sister
California pledges millions to battle enormous swamp rats
Carolyn Hax: Girlfriend's anxiety over food makes me anxious
U.S. Army recruiter allegedly solicited girls as young as 10 for sex while calling himself "Colorado batman"
San Jose: Car crashes into home, driver flees
Facebook defends cryptocurrency plan after lawmakers' sharp criticism
The strong words from lawmakers on both sides came as Congress began two days of hearings on the currency planned by Facebook, to be called Libra.
Elizabeth Warren gets big bucks from employees of the tech companies she wants to break up
The Massachusetts senator came in second among the Democratic presidential candidates in donations from employees of Amazon, Apple, Facebook, and Google over the last three months.
Google denies ties to Chinese military after Peter Thiel's accusation
President Trump said his administration will 'take a look' after 'brilliant' Thiel's speech, in which the Facebook board member raised concerns about Google.
Twitter's 'shiny new' desktop site aims to make tweeting easier
If you logged on to Twitter today and found your desktop site looking a little different, you weren't seeing things.

redpajama_set_name: RedPajamaCommonCrawl


text:
<?php

/**
 * @see Zend_Loader_Autoloader
 */
require_once 'Zend/Loader/Autoloader.php';

/**
 * @see Zend_Tool_Framework_Registry_EnabledInterface
 */
require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php';

/**
 * @category   Zend
 * @package    Zend_Tool
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framework_Registry_EnabledInterface
{

    /**
     * @var Zend_Tool_Framework_Registry
     */
    protected $_registry = null;

    /**
     * @var callback|null
     */
    protected $_interactiveCallback = null;

    /**
     * @var bool
     */
    protected $_isInitialized = false;

    /**
     * @var Zend_Log
     */
    protected $_debugLogger = null;

    public function __construct($options = array())
    {
        // require autoloader
        Zend_Loader_Autoloader::getInstance();

        // this might look goofy, but this is setting up the
        // registry for dependency injection into the client
        $registry = new Zend_Tool_Framework_Registry();
        $registry->setClient($this);

        // NOTE: at this moment, $this->_registry should contain the registry object

        if ($options) {
            $this->setOptions($options);
        }
    }

    public function setOptions(Array $options)
    {
        foreach ($options as $optionName => $optionValue) {
            $setMethodName = 'set' . $optionName;
            if (method_exists($this, $setMethodName)) {
                $this->{$setMethodName}($optionValue);
            }
        }
    }

    /**
     * getName() - Return the client name which can be used to
     * query the manifest if need be.
     *
     * @return string The client name
     */
    abstract public function getName();

    /**
     * initialized() - This will initialize the client for use
     *
     */
    public function initialize()
    {
        // if its already initialized, no need to initialize again
        if ($this->_isInitialized) {
            return;
        }

        // run any preInit
        $this->_preInit();

        $manifest = $this->_registry->getManifestRepository();
        $manifest->addManifest(new Zend_Tool_Framework_Client_Manifest());

        // setup the debug log
        if (!$this->_debugLogger instanceof Zend_Log) {
            require_once 'Zend/Log.php';
            require_once 'Zend/Log/Writer/Null.php';
            $this->_debugLogger = new Zend_Log(new Zend_Log_Writer_Null());
        }

        // let the loader load, then the repositories process whats been loaded
        $this->_registry->getLoader()->load();

        // process the action repository
        $this->_registry->getActionRepository()->process();

        // process the provider repository
        $this->_registry->getProviderRepository()->process();

        // process the manifest repository
        $this->_registry->getManifestRepository()->process();

        if ($this instanceof Zend_Tool_Framework_Client_Interactive_InputInterface) {
            require_once 'Zend/Tool/Framework/Client/Interactive/InputHandler.php';
        }

        if ($this instanceof Zend_Tool_Framework_Client_Interactive_OutputInterface) {
            $this->_registry->getResponse()->setContentCallback(array($this, 'handleInteractiveOutput'));
        }

    }

    /**
     * This method should be implemented by the client implementation to
     * construct and set custom inflectors, request and response objects.
     */
    protected function _preInit()
    {
    }

    /**
     * This method *must* be implemented by the client implementation to
     * parse out and setup the request objects action, provider and parameter
     * information.
     */
    abstract protected function _preDispatch();

    /**
     * This method should be implemented by the client implementation to
     * take the output of the response object and return it (in an client
     * specific way) back to the Tooling Client.
     */
    protected function _postDispatch()
    {
    }

    /**
     * setRegistry() - Required by the Zend_Tool_Framework_Registry_EnabledInterface
     * interface which ensures proper registry dependency resolution
     *
     * @param Zend_Tool_Framework_Registry_Interface $registry
     * @return Zend_Tool_Framework_Client_Abstract
     */
    public function setRegistry(Zend_Tool_Framework_Registry_Interface $registry)
    {
        $this->_registry = $registry;
        return $this;
    }

    /**
     * getRegistry();
     *
     * @return Zend_Tool_Framework_Registry_Interface
     */
    public function getRegistry()
    {
        return $this->_registry;
    }

    /**
     * hasInteractiveInput() - Convienence method for determining if this
     * client can handle interactive input, and thus be able to run the
     * promptInteractiveInput
     *
     * @return bool
     */
    public function hasInteractiveInput()
    {
        return ($this instanceof Zend_Tool_Framework_Client_Interactive_InputInterface);
    }

    public function promptInteractiveInput($inputRequest)
    {
        if (!$this->hasInteractiveInput()) {
            require_once 'Zend/Tool/Framework/Client/Exception.php';
            throw new Zend_Tool_Framework_Client_Exception('promptInteractive() cannot be called on a non-interactive client.');
        }

        $inputHandler = new Zend_Tool_Framework_Client_Interactive_InputHandler();
        $inputHandler->setClient($this);
        $inputHandler->setInputRequest($inputRequest);
        return $inputHandler->handle();

    }

    /**
     * This method should be called in order to "handle" a Tooling Client
     * request that has come to the client that has been implemented.
     */
    public function dispatch()
    {
        $this->initialize();

        try {

            $this->_preDispatch();

            if ($this->_registry->getRequest()->isDispatchable()) {

                if ($this->_registry->getRequest()->getActionName() == null) {
                    require_once 'Zend/Tool/Framework/Client/Exception.php';
                    throw new Zend_Tool_Framework_Client_Exception('Client failed to setup the action name.');
                }

                if ($this->_registry->getRequest()->getProviderName() == null) {
                    require_once 'Zend/Tool/Framework/Client/Exception.php';
                    throw new Zend_Tool_Framework_Client_Exception('Client failed to setup the provider name.');
                }

                $this->_handleDispatch();

            }

        } catch (Exception $exception) {
            $this->_registry->getResponse()->setException($exception);
        }

        $this->_postDispatch();
    }

    public function convertToClientNaming($string)
    {
        return $string;
    }

    public function convertFromClientNaming($string)
    {
        return $string;
    }

    protected function _handleDispatch()
    {
        // get the provider repository
        $providerRepository = $this->_registry->getProviderRepository();

        $request = $this->_registry->getRequest();

        // get the dispatchable provider signature
        $providerSignature = $providerRepository->getProviderSignature($request->getProviderName());

        // get the actual provider
        $provider = $providerSignature->getProvider();

        // ensure that we can pretend if this is a pretend request
        if ($request->isPretend() && (!$provider instanceof Zend_Tool_Framework_Provider_Pretendable)) {
            require_once 'Zend/Tool/Framework/Client/Exception.php';
            throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - provider does not support pretend');
        }

        // get the action name
        $actionName = $this->_registry->getRequest()->getActionName();
        $specialtyName = $this->_registry->getRequest()->getSpecialtyName();

        if (!$actionableMethod = $providerSignature->getActionableMethodByActionName($actionName, $specialtyName)) {
            require_once 'Zend/Tool/Framework/Client/Exception.php';
            throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - actionable method not found');
        }

        // get the actual method and param information
        $methodName       = $actionableMethod['methodName'];
        $methodParameters = $actionableMethod['parameterInfo'];

        // get the provider params
        $requestParameters = $this->_registry->getRequest()->getProviderParameters();

        // @todo This seems hackish, determine if there is a better way
        $callParameters = array();
        foreach ($methodParameters as $methodParameterName => $methodParameterValue) {
            if (!array_key_exists($methodParameterName, $requestParameters) && $methodParameterValue['optional'] == false) {
                if ($this instanceof Zend_Tool_Framework_Client_Interactive_InputInterface) {
                    $promptSting = $this->getMissingParameterPromptString($provider, $actionableMethod['action'], $methodParameterValue['name']);
                    $parameterPromptValue = $this->promptInteractiveInput($promptSting)->getContent();
                    if ($parameterPromptValue == null) {
                        require_once 'Zend/Tool/Framework/Client/Exception.php';
                        throw new Zend_Tool_Framework_Client_Exception('Value supplied for required parameter "' . $methodParameterValue['name'] . '" is empty');
                    }
                    $callParameters[] = $parameterPromptValue;
                } else {
                    require_once 'Zend/Tool/Framework/Client/Exception.php';
                    throw new Zend_Tool_Framework_Client_Exception('A required parameter "' . $methodParameterValue['name'] . '" was not supplied.');
                }
            } else {
                $callParameters[] = (array_key_exists($methodParameterName, $requestParameters)) ? $requestParameters[$methodParameterName] : $methodParameterValue['default'];
            }
        }

        $this->_handleDispatchExecution($provider, $methodName, $callParameters);
    }

    protected function _handleDispatchExecution($class, $methodName, $callParameters)
    {
        if (method_exists($class, $methodName)) {
            call_user_func_array(array($class, $methodName), $callParameters);
        } elseif (method_exists($class, $methodName . 'Action')) {
            call_user_func_array(array($class, $methodName . 'Action'), $callParameters);
        } else {
            require_once 'Zend/Tool/Framework/Client/Exception.php';
            throw new Zend_Tool_Framework_Client_Exception('Not a supported method.');
        }
    }

}

redpajama_set_name: RedPajamaGithub


TADQ is a non profit organisation that accepts requests for assistance from clients or by referral through professional or self referral. Volunteers design, construct, adapt, install and maintain technical aids for people with disabilities where such suitable aids cannot be otherwise obtained. TADQ sells fully refurbished computers to people with disabilities. There are regional coordinators throughout the state.


text:
Q: INotifyPropertyChanged vs IObservable - RxExtensions, which one for observer pattern Massive re-factoring at business layer core here, and I need some help with choosing/implementing the better design pattern, and implementation.
Question:

*

*in the ASP MVC, business layer context, when does IObservable dominate INotifyPropertyChanged

*Which one is a better implementation for the design pattern for a genericObserableFactoryObject

*I really like the weakEventListener because of the lower prob on memory leaks, http://msdn.microsoft.com/en-us/library/hh199438.aspx, does this apply only to threads and thread dispatching

My due-diligence:
I understand INPC is at property level and the other is ~more at an conceptual object level, but with the LINQ it seems IObservable might be the choice. However, the simplicity and flexibility to embedded inside any object is tempting.
So, I just need some help in understanding the design intent/purpose/motive of both, and which one would be the best reuse for an observer pattern factory.
Also, know any place, I can get the code snippet for observer factories

A: MSDN says pretty clear.
IObservable

The IObserver<T> and IObservable<T> interfaces provide a generalized mechanism for push-based notification, also known as the observer design pattern.

INotifyPropertyChanged

The INotifyPropertyChanged interface is used to notify clients, typically binding clients, that a property value has changed.

As far as I understand, INotifyPropertyChanged was added long ago (for example, it had been used in WS clients and later it because most important interface in WPF binding handling).
So I assume that answer is fuzzy and clear: if you really need observer pattern, use IObservable.

A: As far as I know, the primary usage of INPC is for clientside view data-binding (i.e. WPF, Silverlight). You can definitely use INPC in apps that are not for view binding, but you have a clunky string thing (PropetyName) happening here. The upside of using that is you only need one event for the whole object and the the property name is specified in the event (or empty string for the whole object should be considered changed). Alternatively you could have a XXXPropertyChanged event for each event
IObservable<T> is just an alternate implementation of the Observer pattern (ie. an alternate to .NET events). Instead of exposing an event from your class, you would expose an IObservable<T>. Instead of raising the event, you just OnNext values to the observable sequence. IObservable<T> also has the extra benefits of having the concept of a sequence termination via OnError or OnCompleted. So in this case, a better question would be should I use Events or IObservable<T>. To answer this question I would suggest favouring IObservable<T> unless the target audience/consumer does not want to concern themselves with learning Rx.
That was a fairly naive differentiation between the two, however I expand the concept more here http://introtorx.com/Content/v1.0.10621.0/01_WhyRx.html#WhyRx


We are recruiting for fitness brand who have gyms all over the UK and they are looking for a Manager for their club in Wirral. They provide great opportunities to develop through giving opportunity and with a great learning and development program. There is genuinely a huge amount of industry leading talent to work for, alongside and develop.


When they asked me to write a blog about the shift from traditional to modern accounting, I asked myself: what kind of message should my readers get to differentiate my blog post from the many others. My idea of a blog post, was to inspire people in co-shaping their ideas and to do what Dynatos stands for: "Being a trusted advisor".
Back to my topic then, Continuous Accounting. It is a revolutionary way for finance organizations to reduce costs, risks of accounting errors, and liberate accountants to provide value-added analysis.
It transforms the accounting department from a strictly processing environment to an agile department where analytics and business-driven decisions are backed by near real-time data.
Virtually closing books at the business pace, CFO's can access financial data to make informed capital decisions that seize momentum and evade market risks down the stream. CFO's become the most valuable strategic advisor of the CEOs.
Companies implementing Continuous Accounting (CA) principles will realize competitive gains from the great ability to forecast more accurately than market peers. It all comes to the following statement: If you can determine what your company's state is earlier than at the end of the accounting period, your financial decisions are aligned with your business performance and your resources are better optimized.
These are just some of the benefits of CA, other include improved data accuracy through process automation, high efficiency, lower labor costs and more engaged accountants. Towards closing of the accounting period, accountants suffer under these short high-pressure deadlines, with most of the work compressed into low number of days. And the rest of the time, they are recovering from the stress.
Do you get the best of them under these circumstances? And do they love what they do? With certainty, the answer is negative, as they need to get the time to do what they love most: understanding numbers to advise senior leaders to drive the business forward.
The principles of modern accounting were developed in the early 1800's. That's right, the 1800's. This record-to-report model—an accounting cycle that starts with the booking of transactions and concludes with the publication of the financial statements—remained solidly in place.
The globalization waves, internet, digitized data, mobile applications have reshaped how the business is conducted. In this fast-pace global economy, the record-to-report process cannot keep pace. Having a powerful engine, and not the means to track the speed with an odometer – is contradictory to our natural behavior to complete the proportionality rule.
Still, most finance organizations still work with rigid accounting systems, and accountants will admit to the hardships of their period-end tasks, working long days into evenings, eating dinner at their desks – exhausted, they're more likely to errors at a time when data accuracy counts most. Combined with the pressure on the finance directors to identify potential risks which is not easy without accurate financial data. And the financial planning and budgeting are still forced to wait until the end of month to build these forecasts – instead having day-to-day abilities to fetch near real-time data.
Continuous Accounting neutralizes these experiences. Thanks to the automation of traditional accounting tasks like journal entries, variance analysis, account reconciliations, and intercompany transactions, the period-end tasks and controls that are traditionally performed at the end of the accounting cycle are executed as the days go by, in the cloud.
With the tasks broken down into smaller bits, the completion of these elements becomes routine. Accountants now have the means to virtually close the books on a daily basis, diminishing the strain they normally experience during the closing process.
Don't do fence sitting. Break free from the traditional process, and modernize your financial organization with Dynatos empowered by Blackline.


Yes, I know. The warranty paragraph sounds pretty harsh. Unfortunately, most people don't read (or have lost) their warranty statement and expect the equipment to be repaired at no charge for any and all reasons. We are not the manufacturer, and are not legally responsible for fulfilling the warranty. We perform warranty repair services under contract as a convenience for the owner and the manufacturer. In most cases, any amount you will be charged will be considerably less than the cost of shipping the unit back to the manufacturer (after which you may still be charged).
Units that are under warranty MUST be declared as such when you deliver it to us for service. Procedures for warranty service are different than for post-warranty service. If you fail to tell us when you bring it in that a unit is under warranty, and only inform us of that when we call you to tell you what the charges are, it is too late to claim a warranty repair. You will be required to pay us the repair bill and then work out whatever you can with the manufacturer.
which channel, or all channels?
were any effects boxes being used?
did it occur only on peaks?
were you doing anything special at the time?
Finally, re-check your operating instructions and be sure you are following proper operating procedures.
The exceptions to the warranties described are fairly consistent between manufacturers, with a few individual variations. The deciding question on a repair is "Was the failure caused by a manfuacturing defect?" Claims for problems caused by dirty switch contacts, noisy controls, broken jacks and other physical damage can reasonably be denied. We will do our best to fairly evaluate the situation, and will make every effort to have the manufacturer cover any failure for which they are responsible. Most manufacturers now have their warranty statements posted on their websites, so you should look them up and check the terms of the warranty for your equipment to avoid surprises. Where available, links to the manufacturer's warranty statement can be found by clicking on the manufacturer's logo on the warranty services page. If you still have any questions, give us a call.


F-3708	| Write the first review!
The Finnlo Aquon Competition Rowing Machine Black will take you go to your limits and beyond!
The sturdy, high-quality rowing machine is particularly durable thanks to the chain puller technology and offers an even more realistic rudder experience due to the direct power transmission.
In addition, you can choose your personal training out of the 10 training programs on the training computer.
Excuses and boredom have no chance!
The Slider has been designed to be the ultimate rowing machine for rowers. However the best equipment should not be for rowers only. Our aim was to go well beyond the expectations of rowers and design a rowing machine that everyone can use and for good reason, your body.
The Waterrower Rowing machine natural oak wood demo is hand crafted in solid Ash and stained Honey Oak for consistency of color. Each rowing machine has been hand finished with Danish Oil giving a deep lustre and warmth to the wood. Wood has been chosen due to its marvellous engineering properties, primary amongst these is its ability to absorb sound and vibration enhancing the WaterRower's smooth and quiet operation. Ash, like all woods used in WaterRower construction, is a premium hardwood with incredible longevity and dimensional stability. For reasons of ecology, all of our woods are harvested from replenishable forests.
The Waterrower Rowing machine oxbridge solid cherry wood is hand crafted in solid Cherry wood. Like all woods, Cherry wood may vary in color from a red-brown to deep red. The wood will darken in color with exposure to light. For this reason all WaterRower Cherry wood components are kept in light free rooms to protect from shadowing.


text:
In a country with dozens of dialects and languages, this organization has held an English-language spelling bee for the last 10 years.
Can you spell these 12 challenging words? Scripps National Spelling Bee finalists could
Ryan W. Miller, USA TODAY
The 2019 Scripps National Spelling Bee finals are set, and out of a massive field of more than 550 spellers, just 50 students remain.
» RELATED: Meet the 9 Georgians competing in the Scripps National Spelling Bee
This year spellers faced a slew of difficult words in the nation's premier spelling contest, hosted at the Gaylord National Resort and Convention Center in National Harbor, Maryland.
The first part of the finals kick off Thursday at 10 a.m. EDT on ESPN 2. After the field is whittled down even more, the second part of the round of top spellers remaining will air at 8:30 p.m. EDT on ESPN.
Do you think you have what it takes to make it to Scripps finals? Here are some of the most challenging words this year's finalists (somehow) spelled correctly in earlier rounds:
Crystallographer is a noun, related to the word crystallography, meaning "a science that deals with the forms and structures of crystals," according to Merriam Webster dictionary.
Calvin Franke of Chicago correctly spelled it in Round 3.
Parvenuism
Parvenuism is a noun, meaning "parvenu nature or behavior." Parvenu is also a noun, meaning "one that has recently or suddenly risen to an unaccustomed position of wealth or power and has not yet gained the prestige, dignity, or manner associated with it."
Atman Balakrishnan of Chicago correctly spelled it in Round 3.
Plumbiferous
Plumbiferous is an adjective, meaning "containing lead."
Anisha Rao of Dublin, California, correctly spelled it in Round 3.
Woebegoneness
Woebegoneness is a noun, related to the word woebegone, meaning "strongly affected with woe."
Melodie Loya of Oneonta, New York, correctly spelled it in Round 3.
Neutercane
Neutercane is a noun, meaning "a subtropical cyclone that is usually less than 100 miles in diameter and that draws energy from sources common to both the hurricane and the frontal cyclone."
Brendan Pawlicki of Clinton Township, Michigan, correctly spelled it in Round 3.
Oyez
Oyez is an imperative verb, "used by a court or public crier to gain attention before a proclamation."
Erin Howard of Birmingham, Alabama, correctly spelled it in Round 2.
Pince-nez is a noun, meaning "eyeglasses clipped to the nose by a spring."
Montessorian
Montessorian is an adjective, meaning "of, following, or relating to a system for training young children emphasizing free physical activity, informal and individual instruction, early development of writing and reading, and extended sensory motor training."
Navneeth Murali of Neptune, New Jersey, correctly spelled it in Round 2.
Xenarthra
Xenarthra is a noun, meaning "a suborder or other division of Edentata comprising the American anteaters, armadillos, sloths, and usually the extinct ground sloths."
Heiau
Heiau is a noun, meaning "a pre-Christian Hawaiian temple or other place of worship (as a stone platform or an earthen terrace)."
Enya Hubers of Ontario, Canada, correctly spelled it in Round 2.
Oryzivorous
Oryzivorous is an adjective, meaning "feeding on rice."
Abhijay Kodali of Dallas correctly spelled it in Round 2.
Kittiwake is a noun, meaning "either of two cliff-nesting gulls (Rissa tridactyla and R. brevirostris) that winter on the open ocean."
» RELATED: How to watch the Scripps National Spelling Bee
Nilla Rajan of Athens, Ohio, correctly spelled it in Round 2.
Follow USA TODAY's Ryan Miller on Twitter @RyanW_Miller


text:
Q: Classificaion with fitcsvm in matlab produces an error I had tried the following code
clear all;close all;
data =  [27 9   2
11.6723281  28.93422177 2
25  9   2
23  8   2
5.896096039 23.97745722 1
21  6   2
21.16823369 5.292058423 2
4.242640687 13.43502884 1
22  6   2];
Attributes = data(:,1:2);
Classes = data(:,3);
train = [1 3 4 5 6 7];
testInds = [2 8 9];
test1 = data(testInds,1:2);
YTest =data(testInds,3);
%%# Train
svmStruct = svmtrain(Attributes(train,:),Classes(train),'ShowPlot',true);

 SVMModel = fitcsvm(Attributes(train,:),Classes(train))
 classOrder = SVMModel.ClassNames
sv = SVMModel.SupportVectors;
figure
gscatter(data(:,1),data(:,2),Classes)
hold on
plot(sv(:,1), sv(:,2),'ko','MarkerSize',10)
legend('good','bad','Support Vector')
hold off
[label,score] = predict(SVMModel,test1);
% [predict_label, accuracy, prob_estimates] = predict(SVMModel,test1)
table(YTest(1:2),label(1:2),score(1:10,2),'VariableNames',...
    {'TrueLabel','PredictedLabel','Score'})

I tried the above code. First two column are my data and last column is the group id. SVMModel is the classification. I'm getting error as
Index exceeds matrix dimensions.
Error in Untitled (line 34)
table(YTest(1:2),label(1:2),score(1:10,2),'VariableNames',...
I tried to test an instance. But both statements produces an error
[label,score] = predict(SVMModel,test);
 label           = svmclassify(SVMModel, test);

A: You simply flipped predictors and labels - it is fitcsvm(predictors,labels), or in your case fitcsvm(Attributes(train,:),Classes(train))
edit:
plot(sv(:,1), sv(:,2),'ko','MarkerSize',10) % you obviously do not want to plot the same data twice in the same plot...

For the prediction: [predict_label, accuracy, prob_estimates] = svmpredict(Classes(test), Attributes(test,:), SVMModel); looks fine.


text:
package api

import (
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"reflect"
	"testing"
)

var (
	testAnnotation = Annotation{
		CID:            "/annotation/1234",
		Created:        1483033102,
		LastModified:   1483033102,
		LastModifiedBy: "/user/1234",
		Start:          1483033100,
		Stop:           1483033102,
		Category:       "foo",
		Title:          "Foo Bar Baz",
	}
)

func testAnnotationServer() *httptest.Server {
	f := func(w http.ResponseWriter, r *http.Request) {
		path := r.URL.Path
		if path == "/annotation/1234" {
			switch r.Method {
			case "GET":
				ret, err := json.Marshal(testAnnotation)
				if err != nil {
					panic(err)
				}
				w.WriteHeader(200)
				w.Header().Set("Content-Type", "application/json")
				fmt.Fprintln(w, string(ret))
			case "PUT":
				defer r.Body.Close()
				b, err := ioutil.ReadAll(r.Body)
				if err != nil {
					panic(err)
				}
				w.WriteHeader(200)
				w.Header().Set("Content-Type", "application/json")
				fmt.Fprintln(w, string(b))
			case "DELETE":
				w.WriteHeader(200)
				w.Header().Set("Content-Type", "application/json")
			default:
				w.WriteHeader(404)
				fmt.Fprintln(w, fmt.Sprintf("not found: %s %s", r.Method, path))
			}
		} else if path == "/annotation" {
			switch r.Method {
			case "GET":
				reqURL := r.URL.String()
				var c []Annotation
				if reqURL == "/annotation?search=%28category%3D%22updates%22%29" {
					c = []Annotation{testAnnotation}
				} else if reqURL == "/annotation?f__created_gt=1483639916" {
					c = []Annotation{testAnnotation}
				} else if reqURL == "/annotation?f__created_gt=1483639916&search=%28category%3D%22updates%22%29" {
					c = []Annotation{testAnnotation}
				} else if reqURL == "/annotation" {
					c = []Annotation{testAnnotation}
				} else {
					c = []Annotation{}
				}
				if len(c) > 0 {
					ret, err := json.Marshal(c)
					if err != nil {
						panic(err)
					}
					w.WriteHeader(200)
					w.Header().Set("Content-Type", "application/json")
					fmt.Fprintln(w, string(ret))
				} else {
					w.WriteHeader(404)
					fmt.Fprintln(w, fmt.Sprintf("not found: %s %s", r.Method, reqURL))
				}
			case "POST":
				defer r.Body.Close()
				_, err := ioutil.ReadAll(r.Body)
				if err != nil {
					panic(err)
				}
				ret, err := json.Marshal(testAnnotation)
				if err != nil {
					panic(err)
				}
				w.WriteHeader(200)
				w.Header().Set("Content-Type", "application/json")
				fmt.Fprintln(w, string(ret))
			default:
				w.WriteHeader(404)
				fmt.Fprintln(w, fmt.Sprintf("not found: %s %s", r.Method, path))
			}
		} else {
			w.WriteHeader(404)
			fmt.Fprintln(w, fmt.Sprintf("not found: %s %s", r.Method, path))
		}
	}

	return httptest.NewServer(http.HandlerFunc(f))
}

func TestNewAnnotation(t *testing.T) {
	bundle := NewAnnotation()
	actualType := reflect.TypeOf(bundle)
	expectedType := "*api.Annotation"
	if actualType.String() != expectedType {
		t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
	}
}

func TestFetchAnnotation(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	t.Log("ivnalid CID [nil]")
	{
		expectedError := errors.New("Invalid annotation CID [none]")
		_, err := apih.FetchAnnotation(nil)
		if err == nil {
			t.Fatalf("Expected error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("invalid CID [\"\"]")
	{
		cid := ""
		expectedError := errors.New("Invalid annotation CID [none]")
		_, err := apih.FetchAnnotation(CIDType(&cid))
		if err == nil {
			t.Fatalf("Expected error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("invalid CID [/invalid]")
	{
		cid := "/invalid"
		expectedError := errors.New("Invalid annotation CID [/invalid]")
		_, err := apih.FetchAnnotation(CIDType(&cid))
		if err == nil {
			t.Fatalf("Expected error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("valid CID")
	{
		cid := "/annotation/1234"
		annotation, err := apih.FetchAnnotation(CIDType(&cid))
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotation)
		expectedType := "*api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}

		if annotation.CID != testAnnotation.CID {
			t.Fatalf("CIDs do not match: %+v != %+v\n", annotation, testAnnotation)
		}
	}
}

func TestFetchAnnotations(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	annotations, err := apih.FetchAnnotations()
	if err != nil {
		t.Fatalf("Expected no error, got '%v'", err)
	}

	actualType := reflect.TypeOf(annotations)
	expectedType := "*[]api.Annotation"
	if actualType.String() != expectedType {
		t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
	}

}

func TestUpdateAnnotation(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	var apih *API

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	t.Log("invalid config [nil]")
	{
		expectedError := errors.New("Invalid annotation config [nil]")
		_, err := apih.UpdateAnnotation(nil)
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("invalid config [CID /invalid]")
	{
		expectedError := errors.New("Invalid annotation CID [/invalid]")
		x := &Annotation{CID: "/invalid"}
		_, err := apih.UpdateAnnotation(x)
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("valid config")
	{
		annotation, err := apih.UpdateAnnotation(&testAnnotation)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotation)
		expectedType := "*api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}
	}
}

func TestCreateAnnotation(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	t.Log("invalid config [nil]")
	{
		expectedError := errors.New("Invalid annotation config [nil]")
		_, err := apih.CreateAnnotation(nil)
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("valid config")
	{
		annotation, err := apih.CreateAnnotation(&testAnnotation)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotation)
		expectedType := "*api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}
	}
}

func TestDeleteAnnotation(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	var apih *API

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	t.Log("invalid config [nil]")
	{
		expectedError := errors.New("Invalid annotation config [nil]")
		_, err := apih.DeleteAnnotation(nil)
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("invalid config [CID /invalid]")
	{
		expectedError := errors.New("Invalid annotation CID [/invalid]")
		x := &Annotation{CID: "/invalid"}
		_, err := apih.DeleteAnnotation(x)
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("valid config")
	{
		_, err := apih.DeleteAnnotation(&testAnnotation)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}
	}

}

func TestDeleteAnnotationByCID(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	var apih *API

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	t.Log("invalid CID [nil]")
	{
		expectedError := errors.New("Invalid annotation CID [none]")
		_, err := apih.DeleteAnnotationByCID(nil)
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("invalid CID [\"\"]")
	{
		cid := ""
		expectedError := errors.New("Invalid annotation CID [none]")
		_, err := apih.DeleteAnnotationByCID(CIDType(&cid))
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("invalid CID [/invalid]")
	{
		cid := "/invalid"
		expectedError := errors.New("Invalid annotation CID [/invalid]")
		_, err := apih.DeleteAnnotationByCID(CIDType(&cid))
		if err == nil {
			t.Fatal("Expected an error")
		}
		if err.Error() != expectedError.Error() {
			t.Fatalf("Expected %+v got '%+v'", expectedError, err)
		}
	}

	t.Log("valid CID")
	{
		cid := "/annotation/1234"
		_, err := apih.DeleteAnnotationByCID(CIDType(&cid))
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}
	}
}

func TestSearchAnnotations(t *testing.T) {
	server := testAnnotationServer()
	defer server.Close()

	var apih *API

	ac := &Config{
		TokenKey: "abc123",
		TokenApp: "test",
		URL:      server.URL,
	}
	apih, err := NewAPI(ac)
	if err != nil {
		t.Errorf("Expected no error, got '%v'", err)
	}

	search := SearchQueryType(`(category="updates")`)
	filter := SearchFilterType(map[string][]string{"f__created_gt": {"1483639916"}})

	t.Log("no search, no filter")
	{
		annotations, err := apih.SearchAnnotations(nil, nil)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotations)
		expectedType := "*[]api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}
	}

	t.Log("search, no filter")
	{
		annotations, err := apih.SearchAnnotations(&search, nil)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotations)
		expectedType := "*[]api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}
	}

	t.Log("no search, filter")
	{
		annotations, err := apih.SearchAnnotations(nil, &filter)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotations)
		expectedType := "*[]api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}
	}

	t.Log("search, filter")
	{
		annotations, err := apih.SearchAnnotations(&search, &filter)
		if err != nil {
			t.Fatalf("Expected no error, got '%v'", err)
		}

		actualType := reflect.TypeOf(annotations)
		expectedType := "*[]api.Annotation"
		if actualType.String() != expectedType {
			t.Fatalf("Expected %s, got %s", expectedType, actualType.String())
		}
	}
}