text
stringlengths
454
608k
url
stringlengths
17
896
dump
stringclasses
91 values
source
stringclasses
1 value
word_count
int64
101
114k
flesch_reading_ease
float64
50
104
Originally posted by Kelvin Lim: Hi Sapana, Both are valid ways of achieving the same end result, so there's no clear-cut right or wrong here. However, you should know that it's always the Thread class that does the real work of starting a new thread of execution. When you call a Thread object's start() method, the Thread object will create a new thread and always execute its own run() method. But here's how the Runnable comes into the picture: if you had passed the Thread constructor a Runnable object, Thread's run() method will then in turn call the associated Runnable's run() method. It's probably easier to understand this by studying a sample implementation of the Thread class. Here are the key sections of Thread's code relevant to this discussion, adapted slightly from the open-source GNU Classpath implementation of Thread: /** Adapted from <a href="" target="_blank" rel="nofollow"></a> **/ package java.lang; public class Thread implements Runnable { /** The object to run(), null if this is the target. */ final Runnable runnable; // other instance variables here public Thread() { this.runnable = null; // other initialization } public Thread(Runnable target) { this.runnable = target; // other initialization } public void run() { if (this.runnable != null) { this. runnable.run(); } } // other methods here } Why would a programmer ever want to use a separate Runnable job class instead of just extending Thread and overridding its run() method? The most common reason is this: Java allows each class to extend only one other class, but your program design requires that your job class inherit from a different class. So you can't extend Thread... but you can implement as many interfaces as you want. Hence the designers of Java provided this mechanism where you can just implement Runnable and use the Thread(Runnable) constructor to execute your job. Originally posted by Burkhard Hassel: Howdy Sapana! Welcome to the ranch! Simple example, the runnable is one class and the threads are created in the main method of another class: class Runner implements Runnable { public void run() { Thread current = Thread.currentThread(); System.out.println("Current thread: " + current); System.out.println("runs " + this); } } class MainClass { public static void main (String[] args) { Runnable runner = new Runner(); // or Runner runner = new Runner(); Thread[] threads = new Thread[5]; for(int k=0; k<threads.length; k++) { threads[k] = new Thread (runner); threads[k].start(); } } } Output: Current thread: Thread[Thread-0,5,main] runs Runner@1e63e3d Current thread: Thread[Thread-1,5,main] runs Runner@1e63e3d Current thread: Thread[Thread-2,5,main] runs Runner@1e63e3d Current thread: Thread[Thread-3,5,main] runs Runner@1e63e3d Current thread: Thread[Thread-4,5,main] runs Runner@1e63e3d There are five threads, but they use all the same runnable object. Yours, Bu. Originally posted by Mohit Jain: Hi In order to create a thread we always need an object of java.lang.Thread. While creating this Thread object we call a Thread constructor that accepts a Runnable object. When we start this thread using start(), it calls the run() method of java.lang.Thread class which further passes the call to the run() method of current Runnable object. (Look into jdk source code for "Thread.java" and it will be understood) For example - class X implements Runnable { Thread t; X() { t = new Thread(this); t.start(); } public void run() {} ... } By passing "this" we specify the object whose run() method will be ultimately executed. If we split classes and specify run() method in a different class, we have to pass that class object instead of "this" as follows - class X { Thread t; X() { t = new Thread(new Y()); t.start(); } } class Y implements Runnable { public void run() {} .. } Hope this answers your question.
http://www.coderanch.com/t/266331/java-programmer-SCJP/certification/Instantiating-Thread-page
CC-MAIN-2015-35
refinedweb
619
63.09
05 March 2010 10:55 [Source: ICIS news] LONDON (ICIS news)--INEOS Olefins & Polymers Europe has restarted its 320,000 tonne/year C6-grade linear low density polyethylene (LLDPE) plant at Grangemouth, UK, but force majeure restrictions will remain in place for some time, a company source confirmed on Friday. “We will be starting up fairly gingerly,” said the source. INEOS restarted the plant on 4 March, the source said. An “agglomeration”, or build-up of product in the reactor, brought the unit to a halt during the Christmas holiday period. INEOS declared force majeure on supplies from the plant on 8 January. PE prices in Europe have been rising in March after two months of steady increases amounting to €150-180/tonne ($203-243/tonne). Sellers were looking for price hikes of €50-80/tonne in March, and they were more or less successful, depending on the PE grade they were selling. Low density PE (LDPE) was the strongest sector, with high density PE (HDPE) beginning to suffer from increased imports in ?xml:namespace> Prices of C6-grade LLDPE at the end of February were around €1,220-1,250/tonne FD (free delivered) NWE (northwest PE producers in ($1 = €0.74) For more on polyethylene
http://www.icis.com/Articles/2010/03/05/9340184/ineos-restarts-grangemouth-lldpe-plant-force-majeure.html
CC-MAIN-2015-22
refinedweb
207
60.85
Get the highlights in your inbox every week. Add jumping to your Python platformer game | Opensource.com Add jumping to your Python platformer game Learn how to fight gravity with jumping in this installment on programming video games with Python's Pygame module. Subscribe now In the previous article in this series, you simulated gravity, but now you need to give your player a way to fight against gravity by jumping. A jump is a temporary reprieve from gravity. For a few moments, you jump up instead of falling down, the way gravity is pulling you. But once you hit the peak of your jump, gravity kicks in again and pulls you back down to earth. In code, this translates to variables. First, you must establish variables for the player sprite so that Python can track whether or not the sprite is jumping. Once the player sprite is jumping, then gravity is applied to the player sprite again, pulling it back down to the nearest object. Setting jump state variables You must add two new variables to your Player class: - One to track whether your player is jumping or not, determined by whether or not your player sprite is standing on solid ground - One to bring the player back down to the ground Add these variables to your Player class. In the following code, the lines above the comment are for context, so just add the final two lines: self.frame = 0 self.health = 10 # jump code below self.is_jumping = True self.is_falling = False These new values are called Boolean values, which is a term (named after mathematician George Boole) meaning either true or false. In programming, this is a special data type indicating that a variable is either "on" or "off". In this case, the hero sprite can either be falling or not falling, and it can be jumping or not jumping. The first variable (is_jumping) is set to True because I'm spawing the hero in the sky and need it to fall immediately to the ground, as if it were in mid-jump. This is a little counter-intuitive, because the hero isn't actually jumping. The hero has only just spawned. This is theoretically an abuse of this Boolean value, and it is admittedly "cleaner" code to have True and False statements that actually reflect reality. However, I find it easier to let gravity help the hero find the ground rather than having to hard code a spawn position every level. It also evokes classic platformers, and gives the player the sense of "jumping into" the game world. In other words, this is a small initial lie that serves the program, so set it to True. The other variable (is_falling) is also set to True because the hero does indeed need to descend to the ground. Conditional gravity In the real world, jumping is an act of moving against gravity. In your game, though, gravity only needs to be "on" when the hero sprite isn't standing on solid ground. When you have gravity on all the time (in Pygame), you risk getting a bounce-effect on your hero sprite as gravity constantly tries to force the hero down while the collision with the ground resists. Not all game engines require this much interaction with gravity, but Pygame isn't designed exclusively for platformers (you could write a top-down game instead, for example) so gravity isn't managed by the engine. Your code is only emulating gravity in your game world. The hero sprite isn't actually falling when it appears to fall, it's being moved by your gravity function. To permit your hero sprite to fight gravity and jump, or to collide with solid objects (like the ground and floating platforms), you must modify your gravity function to activate only when the hero is jumping. This code replaces the entire gravity function you wrote for the previous article: def gravity(self): if self.is_jumping: self.movey += 3.2 This causes your hero sprite to fall right through the bottom of the screen, but you can fix that with some collision detection on the ground. Programming solid ground In the previous article, a quick hack was implemented to keep the hero sprite from falling through the bottom of the screen. It kept the hero on screen, but only by creating an invisible wall across the bottom of the screen. It's cleaner to use objects as objects, and besides it's pretty common in platformers to allow players to fall off the world as a penalty for a poorly timed jump. In the update function of your Player class, add this code: This code block checks for collisions happening between ground sprites and the hero sprite. This is the same principle you used when detecting a hit against your hero by an enemy. In the event of a collision, it uses builtin information provided by Pygame to find the bottom of the hero sprite (self.rect.bottom), and set its position to the top of the ground sprite (p.rect.top). This provides the illusion that the hero sprite is "standing" on the ground, and prevents it from falling through the ground. It also sets self.is_falling to 0 so that the program is aware that the hero is not in mid-jump. Additionally, it sets self.movey to 0 so the hero is not pulled by gravity (it's a quirk of game physics that you don't need to continue to pull a sprite toward Earth once the sprite has been grounded).The if statement at the end detects whether the player has descended below the level of the ground; if so, it deducts health points as a penalty, and then respawns the hero sprite back at the top left of the screen (using the values of tx and ty, the size of tiles. as quick and easy starting values.) This assumes that you want your player to lose health points and respawn for falling off the world. That's not strictly necessary; it's just a common convention in platformers. Jumping in Pygame The code to jump happens in several places. First, create a jump function to "flip" the is_jumping and is_falling values: def jump(self): if self.is_jumping is False: self.is_falling = False self.is_jumping = True The actual lift-off from the jump action happens in the update function of your Player class: if self.is_jumping and self.is_falling is False: self.is_falling = True self.movey -= 33 # how high to jump This code executes only when the is_jumping variable is True while the is_falling variable is False. When these conditions are satisfied, the hero sprite's Y position is adjusted to 33 pixels in the "air". It's negative 33 because a lower number on the Y axis in Pygame means it's closer to the top of the screen. That's effectively a jump. You can adjust the number of pixels for a lower or higher jump. This clause also sets is_falling to True, which prevents another jump from being registered. If you set it to False, a jump action would compound on itself, shooting your hero into space, which is fun to witness but not ideal for gameplay. Calling the jump function The problem is that nothing in your main loop is calling the jump function yet. You made a placeholder keypress for it early on, but right now, all the jump key does is print jump to the terminal. In your main loop, change the result of the Up arrow from printing a debug statement to calling the jump function. if event.key == pygame.K_UP or event.key == ord('w'): player.jump() If you would rather use the Spacebar for jumping, set the key to pygame.K_SPACE instead of pygame.K_UP. Alternately, you can use both (as separate if statements) so that the player has a choice. Landing on a platform So far, you've defined an anti-gravity condition for when the player sprite hits the ground, but the game code keeps platforms and the ground in separate lists. (As with so many choices made in this article, that's not strictly necessary, and you can experiment with treating the ground as just another platform.) To enable a player sprite to stand on top of a platform, you must detect a collision between the player sprite and a platform sprite, and stop gravity from "pulling" it downward. Place this code into your update function: plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) for p in plat_hit_list: self.is_jumping = False # stop jumping self.movey = 0 # approach from below if self.rect.bottom <= p.rect.bottom: self.rect.bottom = p.rect.top else: self.movey += 3.2 This code scans through the list of platforms for any collisions with your hero sprite. If one is detected, then is_jumping is set to False and any movement in the sprite's Y position is cancelled. Platforms hang in the air, meaning the player can interact with them by approaching them from either above or below. It's up to you how you want the platforms to react to your hero sprite, but it's not uncommon to block a sprite from accessing a platform from below. The code in the second code block treats platforms as a sort of ceiling or pergola, such that the hero can jump onto a platform as long as it jumps higher than the platform's topside, but obstructs the sprite when it tries to jump from beneath: The first clause of the if statement detects whether the bottom of the hero sprite is less than (higher on the screen) than the platform. If it is, then the hero "lands" on the platform, because the value of the bottom of the hero sprite is made equal to the top of the platform sprite. Otherwise, the hero sprite's Y position is increased, causing it to "fall" away from the platform. Falling If you try your game now, you find that jumping works mostly as expected, but falling isn't consistent. For instance, after your hero jumps onto a platform, it can't walk off of a platform to fall to the ground. It just stays in the air, as if there was still a platform beneath it. However, you are able to cause the hero to jump off of a platform. The reason for this is the way gravity has been implemented. Colliding with a platform turns gravity "off" so the hero sprite doesn't fall through the platform. The problem is, nothing turns gravity back on when the hero walks off the edge of a platform. You can force gravity to reactivate by activating gravity during the hero sprite's movement. Edit the movement code in the update function of your Player class, adding a statement to activate gravity during movement. The two lines you need to add are commented: if self.movex < 0: self.is_jumping = True # turn gravity on self.frame += 1 if self.frame > 3 * ani: self.frame = 0 self.image = pygame.transform.flip(self.images[self.frame // ani], True, False) if self.movex > 0: self.is_jumping = True # turn gravity on self.frame += 1 if self.frame > 3 * ani: self.frame = 0 self.image = self.images[self.frame // ani] This activates gravity long enough to cause the hero sprite to fall to the ground upon a failed platform collision check. Try your game now. Everything works as expected, but try changing some variables to see what's possible. In the next article, you'll make your world scroll. Here's ''' # x location, y location, img width, img height, img file class Platform(pygame.sprite.Sprite):.is_jumping = True self.is_falling = True self.images = [] for i in range(1, 5): img = pygame.image.load(os.path.join('images', 'hero' + str(i) + '.png')).convert() img.convert_alpha() img.set_colorkey(ALPHA) self.images.append(img) self.image = self.images[0] self.rect = self.image.get_rect() def gravity(self): if self.is_jumping: self.movey += 3.2 def control(self, x, y): """ control player movement """ self.movex += x def jump(self): if self.is_jumping is False: self.is_falling = False self.is_jumping = True def update(self): """ Update sprite position """ # moving left if self.movex < 0: self.is_jumping = True self.frame += 1 if self.frame > 3 * ani: self.frame = 0 self.image = pygame.transform.flip(self.images[self.frame // ani], True, False) # moving right if self.movex > 0: self.is_jumping = True self.frame += 1 if self.frame > 3 * ani: self.frame = 0 self.image = self.images[self.frame // ani] # collisions enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) for enemy in enemy_hit_list: self.health -= 1 # print(self.health) plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) for p in plat_hit_list: self.is_jumping = False # stop jumping self.movey = 0 if self.rect.bottom <= p.rect.bottom: self.rect.bottom = p.rect.top else: self.movey += 3.2 if self.is_jumping and self.is_falling is False: self.is_falling = True self.movey -= 33 # how high to jump self.rect.x += self.movex self.rect.y += self.movey def bad(lvl, eloc): if lvl == 1: enemy = Enemy(eloc[0], eloc[1], 'enemy.png') enemy_list = pygame.sprite.Group() enemy_list.add(enemy) if lvl == 2: print("Level " + str(lvl)) return enemy_list # x location, y location, img width, img height, img file def platform(lvl, tx, ty): plat_list = pygame.sprite.Group() ploc = [] i = 0 if lvl == 1: ploc.append((200, worldy - ty - 128, 3)) ploc.append((300, worldy - ty - 256, 3)) ploc.append((550, ''') gloc = [] tx = 64 ty = 64 i = 0 while i <= (worldx / tx) + tx: gloc.append(i * tx) i = i + 1 ground_list = Level.ground(1, gloc, tx, ty) plat_list = Level.platform(1, tx, ty) ''''): player.jump() if event.type == pygame.KEYUP: if event.key == pygame.K_LEFT or event.key == ord('a'): player.control(steps, 0) if event.key == pygame.K_RIGHT or event.key == ord('d'): player.control(-steps, 0) world.blit(backdrop, backdropbox) player.update() player.gravity() player_list.draw(world) enemy_list.draw(world) ground_list.draw(world) plat_list.draw(world) for e in enemy_list: e.move() pygame.display.flip() clock.tick(fps) This is the 8th installment - Add platforms to your game - Simulate gravity in your Python game 1 Comment, Register or Log in to post a comment. I love this article. It's so helpful and insightful. This is the best way to learn python!!
https://opensource.com/article/19/12/jumping-python-platformer-game
CC-MAIN-2020-45
refinedweb
2,396
67.35
Details Description HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet. Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost. One way to get around it is to use fault-injection in order to replace the real hostname with localhost. Activity I have compiled and ran the test without any issues. A couple of nits: - please have messages for the asserts - remove commented code - these imports aren't used anywhere and can be removed as well import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSClient; import org.apache.hadoop.hdfs.DFSTestUtil; import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.hadoop.hdfs.HftpFileSystem; import org.apache.hadoop.hdfs.MiniDFSCluster; Looks good otherwise. Also, I have discussed with Nicholas why he didn't use Mockito to simulate the server side and his point was that with MiniDFSCluster he's getting a real webserver without any extra effort to emulate it, which makes sense. Thanks Cos for reviewing it. h1304_20100922.patch: > please have messages for the asserts The assert messages will be printed only when the test failed. In such case, we can check the stack trace. > remove commented code Moved the commented codes to a method. > these imports aren't used anywhere and can be removed as well ... Removed. ] I also have run the new unit test. It works fine. +1 patch looks good. I have committed this. Integrated in Hadoop-Hdfs-trunk-Commit #396 (See) h1304_20100921.patch: fault injection unit test.
https://issues.apache.org/jira/browse/HDFS-1304
CC-MAIN-2015-18
refinedweb
266
61.83
This action might not be possible to undo. Are you sure you want to continue? T H E S O C I O L O G Y O F TA S T E The roles of fashion and taste are central to our understanding of the social dynamics in any modern society. In this treatise on the aestheticization of social life, Jukka Gronow uses the insights of Veblen, Simmel and Lyotard, among others, to show how fashion operates as a form of play binding modern society together and allowing an equilibrium between the opposing forces of individualization and socialization. Drawing on Georg Simmel’s original sociological interpretation of Immanuel Kant’s aesthetics, this book argues that in a society characterized by a high degree of individuality, we judge everyday life on its aesthetic qualities. This book offers an analysis of the social mechanism of fashion and the role of the ‘community of taste’ as it appears in social life. Gronow illustrates this thesis with a rich range of examples and case studies including the dominance of kitsch in late nineteenth-century Europe; the shifting nature of luxury in the Soviet Union from the 1930s; the growing influence of western ideas of the good life from the 1960s; and the food scares and food fashion of the late twentieth century. Jukka Gronow is Lecturer in Sociology at the University of Helsinki. THE SOCIOLOGY OF TA S T E Jukka Gronow London and New York without permission in writing from the publishers. Includes bibliographical references and index. or in any information storage or retrieval system. or other means. New York. HM299. mechanical. 3. NY 10001 This edition published in the Taylor & Francis e-Library. Popular culture. 4. The sociology of taste / Jukka Gronow. Jukka. Aesthetics–Social aspects. including photocopying and recording. G75 1997 96–25692 306–dc20 CIP ISBN 0-415-13294-0 (hbk) ISBN 0-415-13295-9 (pbk) ISBN 0-203-15815-6 Master e-book ISBN ISBN 0-203-17891-2 (Glassbook Format) . No part of this book may be reprinted or reproduced or utilized in any form or by any electronic. I. Fads. Title. London EC4P 4EE Simultaneously published in the USA and Canada by Routledge 29 West 35th Street. 2001.First published 1997 by Routledge 11 New Fetter Lane. Fashion. British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Cataloguing in Publication Data Gronow. 1. now known or hereafter invented. © 1997 Jukka Gronow All rights reserved. 2. the fruit fly. True taste is universal. provide. which overlays and obscures most other manifestations of human activity. extending to beauties of every kind.One has no taste if one has a one-sided taste. Lessing. On Human Finery . but expecting from none no more satisfaction and enchantment than it can. Quentin Bell. E. in the science of genetics. Hamburg Dramaturgy In sociological studies fashion plays the role which has been allotted to Drosophila. that the deceptive force of inertia. G. according to its kind. Here at a glance we can perceive phenomena so mobile in their response to varying stimuli. is reduced to a minimum. so rapid in their mutation. . CONTENTS Preface Acknowledgements 1 INTRODUCTION: Need. fashion and the corruption of taste Kitsch and luxury in the Soviet Union Fashion and plenty in the post-industrial society 4 TASTE AND FASHION Fashion as a self-dynamic social process The social function of style and fashion Taste and the process of collective selection Food fashions and social order 5 THE BEAUTY OF SOCIAL FORMS Simmel on social forms Play and beauty vii ix xiii 1 1 13 13 18 31 31 49 69 74 74 82 101 111 131 131 144 . KITSCH AND FASHION Kitsch. Taste and Pleasure – or understanding modern consumption 2 PHILOSOPHICAL AESTHETICS AND THE REFINEMENT OF TASTE Sociological aesthetics or aesthetic sociology What is good taste? 3 LUXURY. CONTENTS 6 CONCLUSION: The aesthetic sociology and the aestheticization of everyday life Notes Bibliography Index 158 158 172 180 190 viii . A similar parallel can be drawn between the discourse of need and luxury. many of the examples and case studies presented deal with the consumption of food. gradually lost its privileged position in aesthetic discourse. The sense of taste. ix . it is not mainly concerned with the social determination of taste or with the differences in tastes in various groups and classes of society. were held up as the senses capable of mediating pure.P R E FA C E This book is a treatise on taste. Both operated with a seemingly clear and self-evident conception based on universal human needs. however. were treated with suspicion because they were thought to be capable of serving only lower sensual pleasures. or taste as judgment power. on the one hand. taste and smell. Therefore. and therefore more noble. between gastronomy and aesthetics. In the classical humanistic tradition of philosophical aesthetics there was a strong parallel between the physiological sense of taste and aesthetic taste. and morally condemned as unnecessary luxury all such acts of consumption that exceeded those needs. and the discourse of nutrition science. The physiological sense of taste acted as the model for the judgment power. Unlike many other publications on the sociology of taste. as well as conceptions of nutrition and gastronomy. Its object is the role of taste – or the aesthetic reflection – in society at large and in modern society in particular. in particular. In Kant’s thinking. the ‘near’ senses. this is a book on aesthetic sociology and not on sociological aesthetics. however. One can easily recognize a trend of social and cultural critique of modern patterns of consumption continuing both of these parallels up until the present day. on the other hand. Also. Both were regarded as equally self-evident and universal. this book includes a modest history of aesthetic ideas. In other words. whereas hearing and sight. aesthetic pleasures. Both Terry Eagleton and Pierre Bourdieu. Different socio-economic groups or classes have different tastes. be shown that there was a historical stage of mass production and marketing which produced mainly kitsch. Consequently. however. This has also been supposed to be the main reason why people today are willing to consume and buy more. whose ideas and theories are discussed in the second chapter. However. and always the newest and latest things. spoke about ‘conspicuous consumption’. In doing so Bourdieu also joined – in a very eloborate way – the long tradition of sociological critics of modern consumer society who have explained the dynamics of consumption and the eagerness of modern consumers to exceed their previous or traditional patterns of consumption by their eagerness to imitate social superiors. In sociological tradition fashions have often until recently been understood to be class fashions and the dynamics of novelty inherent in fashion explained also as the result of this social mechanism of emulation: the lower classes imitate the models of the higher echelons of society. as an explanation for the dynamics of modern consumption there is serious doubt about this. in society taste is an empirical category. regulated by the state. at the turn of the present century. There are strong empirical and theoretical arguments in favour of another theoretical model of fashion and consumption – some of which are discussed in this study. however. Pierre Bourdieu’s sociological critique of ‘pure’ aesthetics is especially interesting since it identified the mechanism of social emulation which constantly reproduces these standards of good taste. Modern consumers are. The presumed ‘distortion of human taste’ caused by kitsch and the gradual democratization of consumption was. to use the phrase coined by Vance Packard. in their understanding. ‘status seekers’. cheap imitations of finer models that carried easily recognizable signs of culture which could be identified as part of the lifestyle of ‘high society’ or the social nobility. something that could be called ‘democratic x . In Stalin’s time. It can. The consumption patterns in the former Soviet Union. the main target both of the various reform movements of industrial design and of early sociological critics. In his classical study Theory of the Leisure Class (1961 [1899]) Thorsten Veblen. and Soviet kitsch. it presented the taste of the ruling class as the only universally valid or legitimate taste.PREFACE Instead of arguing for or defending a universal human sense of beauty it has been almost a commonplace in sociology to presume that taste is socially determined. were good examples of another ‘undeveloped’ culture of consumption which was. as is argued in the second and third chapters. criticized Kantian aesthetics because. moreover. A discussion of the role played by consumers in the transition processes of the former socialist states ends the third chapter of this book. only the ‘cloud of a community’. is both totally private and universal. Nowadays. at the same time. taste. is not properly understood and analysed. In fashion. This duality was. fashion operates equally in various commercial (from cars to cultural products) and non-commercial (from science to first names) fields of social activity. in Simmel’s opinion. only provisionally and tentatively overcome the duality or opposition between the individual and the social. This antinomy is solved daily in everyday life in various social formations which. fashion does not have to decide whether to be or not to be. As is argued in the fourth chapter. One of the main theses of this book is that one cannot understand the modern consumer society and the meaning of consumption in a modern society if the social mechanism of fashion. The second applies the fashion approach to the recent developments in our food culture. In a modern abundant consumers’ society. it is not only operative in the fields of clothing and decoration. There are interesting and important criteria for its existence. analysed by Herbert Blumer among others. The first case concerns the self-understanding of fashion designers about their role in the fashion industry. xi . as one could say following – somewhat freely – Lyotard’s suggestion. According to the famous antinomy of taste formulated by Immanuel Kant in his Critique of Judgment. subjective and objective. the extension of fashion has greatly increased. between the particular and the general. it both is and is not. The fourth chapter includes two empirical or historical excursions and case studies about the role of fashion in different fields of society. To claim that fashion can be found everywhere would obviously be trite. One of the main ideas in Georg Simmel’s sociological thinking was to show how a sociological solution was to be found to this theoretically and conceptually unsolvable antinomy. the modern fashion pattern is one of the main and. that can be applied and identified in different social settings. the greatest problem facing modern human beings. It is an ethereal social formation. As Simmel said. or the judgment power. or. however.PREFACE luxury’ was created. the most typical social formation used to cope with this antinomy. As Simmel has taught us. the antinomy is overcome on a daily basis: fashion is based on private and subjective preferences of individual taste and yet it forms a socially binding standard of conduct. a self-dynamic social process. both individual and social. The fifth chapter of this book is an attempt to develop further this idea of Simmel’s. insofar as the richness in the forms of social interaction in which individuals can choose to take part is increasing. By analysing and paying attention to the pure forms of sociation. one could claim that social forms can be beautiful. reflexive communities as typically aesthetic communities is also discussed. The problem and possibility of understanding post-traditional. All social activities and games. Following Simmel. Such forms he often called the play forms of sociation. Friedrich Schiller’s famous programme of aesthetic education is. he identified an inherent aesthetic dimension in all social interaction.PREFACE Simmel’s ‘formal sociology’ was also strongly indebted to Immanuel Kant in another way. art included. in principle. With a certain caution. xii . for the sake of the pleasure received from the very act of taking part. The book ends with a discussion about the relevance and different possible interpretations of the thesis of the aestheticization of everyday life. following Simmel. too. that were played only for their own sake. Fashion was to Simmel such a typical play form of sociation which was not instrumental in achieving any other ends. in fact. were typically aesthetic by their nature. and potentially more beautiful. one could claim that our social world is becoming aestheticized. It was the main task of Simmel’s sociology to understand the nature and importance of such aesthetic forms in society: therefore. we can. realized daily by ordinary people in the most frivolous forms of social interaction. recognize an aesthetic dimension in the more ‘serious’ social formations. his sociology was aesthetic sociology. like economic or political competition. But. are Pasi Falk. In the 1980s. The Romantic Ethic and the Spirit of Consumerism. was kind enough to share his immense knowledge with me and gave precious hints about Simmel’s publications previously unknown to me. a series of international seminars on consumption was started. Johanna Mäkelä. Arto Noro’s insightful reading of Simmel’s works based on a long-lasting interest has also been a helpful guide to me in my efforts. who took part in the seminars from the beginning. Among the many personal friends and colleagues. and Pekka Sulkunen. From the beginning of the 1990s I have conducted post-graduate seminars on the sociology of consumption at the Department of Sociology. Anyone familiar with Campbell’s study will certainly recognize to what extent my own thinking was inspired and influenced by it. Per Otnäs. then. presented the main ideas of his. University of Helsinki. who also took an active part in the seminars. xiii . Kaj Ilmonen. Keijo Rahkonen. this book would certainly never have been written or received the form it has today. David Frisby. on the initiative of Kaj Ilmonen.ACKNOWLEDGEMENTS This study was inspired by the intercourse in two important scientific seminars. the participants of which were mainly Scandinavian and British. Riitta Jallinoja. were characterized by an informal and friendly atmosphere and offered an excellent opportunity both to learn what was going on in the minds of other scholars interested in similar problems and to present one’s own views to a critical audience. and Aino Sinnemäki. These seminars. the living encyclopedia on Simmel’s work. I owe them all my deepest gratitude. This study was also inspired by reading Georg Simmel’s sociology. new book. Colin Campbell. among others. Arto Noro. Without the enthusiasm and the contributions of them and the students. Daniel Miller. Aino Sinnemäki. Oslo. and Pleasure: Understanding Modern Consumption’. Taste. The section ‘Food Fashions and Social Order’ in Chapter 4 is a slightly modified translation of my article ‘Moden des Speisens und “Geschmack an der Gesundheit”’. The chapter ‘Taste and Fashion’ is. It is reprinted with the permission of Solum Förlag AS. originally published in German in Österreichische Zeitschrift der Soziologie 1993 (18): 4–18 and is reprinted with the permission of Österreichische Gesellschaft für Soziologie.ACKNOWLEDGEMENTS I am also grateful to Alan Warde who read the manuscript and offered invaluable advice of an improving nature. Oslo. Part of the Introduction is based on the article ‘Need. reprinted from Jukka Gronow. both as my research assistant and as an experienced editor of scientific texts. Acta Sociologica 1993 (36): 89–100. ‘Taste and Fashion: The Social Function of Fashion and Style’. has been of great help at various stages of this work. xiv . et al. Oslo: Solum: 33–52. An earlier version of the section ‘What is Good Taste?’ in Chapter 2 was published as an article with the same title in Social Science Information 1993 (36): 279–301 and is reprinted with the permission of Sage Publications. published in Fürst. London. by permission of Scandinavian University Press. Norway. Earlier versions of some sections of the chapters in this book have been published elsewhere. (eds) Palatable Worlds. E. with minor alterations. there are major conceptual problems involved with each of these approaches which are particularly evident in the ways we understand food and eating. its taste and the pleasures connected with it. in modern discussions the concept of pleasure has also become more diffuse and less sensual. taste and pleasure – or understanding modern consumption The parallel between philosophy and gastronomy In the following discussion. the more it was separated from immediate sensual pleasure. three aspects of our relationship to consumption are going to be analysed. on the other. They can be compressed into three concepts: need. and gastronomy and nutrition science.1 I N T R O D UC T I O N Need. There is a strong parallel between the development of the discourses of need and taste. The two concepts. Different ways of talking about consumption are centred around these concepts. On the other hand. on the one hand. its effects on health. need and taste. They are unavoidably present in the different attempts to analyse and explain the development of the modern food culture and its various features. Whereas need and taste constitute two distinct and antithetical discourses on food. taste and pleasure. 1 . The two discourses on food were also differentiated in seventeenthcentury Europe. pleasure cannot be separated from taste (taste is a source of pleasure) nor taste from pleasure (tastes are either pleasant or unpleasant). were still discussed inseparably in various cookbooks and dietary recommendations (see Falk 1990). in their pure and classical form can be identified in the philosophical discussion during the latter part of the eighteenth century. Before then. all aspects of food. As will be shown in more detail later on. the more reflexive the concept of taste and the more refined the sense of taste. However. these different aspects of modern culture in fact complement each other: ‘The seemingly contrary activities of hard-headed accounting and dreamy eyed fantasizing merged as business appealed to consumers by inviting them into a fabulous world of pleasure. Bourdieu 1984). Such a demand ‘required the nurture of qualities like wastefulness. cf. can also be interpreted as not being real. There is a stronger conceptual relation between them.’ As has already been claimed. the new middle class. has been replaced by a culture of personality which emphasizes being liked and admired (see Sussman 1984: xxii). and hedonism is also functional in a modern economic system. however. An action oriented to the principle of hedonistic pleasure is often thought to emerge as a result of a drastic transformation of cultural values (cf. broader meanings. It is accompanied by historical changes that often are thought to be caused by the emergence of some new social group or class (e. on the other hand.INTRODUCTION: NEED. The modern consumer is essentially a hedonist. TASTE AND PLEASURE The discourse of need can first be identified in discussions about necessary needs versus luxury in moral philosophy preceding classical political economy (see Springborg 1981). the contrast between efficiency and pleasure. Bell 1976). It can mostly be identified in various critiques of modern culture. or with the birth of a new personality type (the narcissistic personality. The older culture of character. or the so-called moral sense theories (see Caygill 1989). This ‘paradox’ of modernity. comfort. but in modern discussions it has gained new. and amusement. and between the need discourse and modern nutrition science.g. on the other hand. on the one hand. The question of consumer hedonism is. by analysing the 2 . more problematic. Hedonism is naturally also an old theme in problematizing what constitutes a virtuous and decent life. Consequently. Lasch 1978). self-indulgence. which directly negated or undermined the values of efficiency and the work ethic on which the system was based’ (Marchand 1985: 158). The older culture of work and rationality is also often understood to be threatened by this new ethic of consumption which. and artificial obsolescence. hedonism is contrasted with asceticism. Modern consumption is often thought to be caused by the desire for pleasure. The former parallels are not only historical and contingent. which stressed moral qualities. cf. there is a close parallel between the aesthetic of taste and gastronomy. As stated by Rosalind Williams (1982: 66). The new ethics of pleasure or ‘fun ethics’ is often contrasted with the earlier dominant ethic of work. The discourse on taste can be identified in the tradition of the aesthetics of taste. is thought to be essential in creating predictable and expanding consumer demand. there similarly still exists a gastronomic discourse which classifies and evaluates food and foodstuffs according to their taste and tastefulness (cookery books. RDAs should be provided from a selection of foods that are acceptable and palatable to ensure competition. respectively. vitamins and minerals. the seemingly natural and self-evidential nature of the need for food made it an exemplary model for any argumentation following the logic of needs.INTRODUCTION: NEED. The ideas about the physiological sense of taste were crucial to the development of ideas about the sense of taste as the power of judgment (Urteilskraft) until Immanuel Kant. Among the specialists. Taste is also scientifically analysed in sensory evaluation studies. in food guides and dietary recommendations based on the standards of modern nutrition science. result only from inadequate methods of measurement. suddenly seem to remember that humans do not simply ingest dietary allowances but that they eat food: ‘However. This deviation from the norm – or surplus – is often thought to be in need 3 . books on etiquette. however. Such an argument also leads to postulating a norm or standard of right or decent conduct. from which any deviation is either pathologized or labelled indecent.g. The difficulty did not. TASTE AND PLEASURE argumentative logic of gastronomy and nutrition science. The taste of food offered the paradigmatic example of the aesthetics of taste in the seventeenth and eighteenth centuries (see e. and vice versa. In a similar way. at least. emphasizing the beneficial or detrimental effects of eating on health. These two discourses are not only separate but antithetical to each other as evidenced by the difficulty in taking any considerations of the taste of food into account in present-day nutritional recommendations and health food guides. gastronomic guide books and magazines). Schümmer 1955). it is possible to shed light on the parallel logic of argumentation in social sciences. In earlier recommendations. The antinomy concerning the simultaneous self-evident and private nature of taste was shared both by the concept of taste in the ‘narrow’ sense and by the concept of taste as Urteilskraft (see Kant 1980 [1798]: 349–78). One can still today clearly recognize a discourse of needs.’ In both the gastronomic and sociological discourses on need and taste a problem emerges: they produce a certain surplus – or luxury – an action orientation that cannot be reduced either to the principle of good taste or the principle of need satisfaction. after a lengthy discussion of all the necessary nutrients. ‘elaborate methods of food preparation and dazzling combinations of ingredients were anathema to those who wanted to develop easy recipes whose nutritional content could be calculated’ (Levenstein 1988: 83). In the latest edition of the official Recommended Dietary Allowances (1989: 13) the authors. INTRODUCTION: NEED. Hedonism – according to this logic – is something which is in need of explanation contrary to any ‘natural’ or need-oriented behaviour. consumption can be understood in terms of an expanding capitalist commodity production: consumption is functional to the demands of economy. with the dreams and desires associated with the world of goods. Insofar as the analyses have been more ambitious and are not simply satisfied by naming or recognizing some new cultural features. First. some such social mechanisms are often postulated which are supposed to nurture a hedonistic orientation of action. It is reminiscent of the second perspective mentioned by Featherstone. The question of the identity-value or socio-symbolic value of goods is actualized whenever people engage in consumption with a view 4 . use-value and exchangevalue. The different characterizations of this new hedonism. but the third class of identity-value is more original and interesting. In the discussions concerning the modern hedonistic consumer the whole setup is turned upside down. Hedonism can also be considered a social problem as a pathology. see also Featherstone 1991) identified three different approaches to the study of consumer culture. TASTE AND PLEASURE of an explanation in terms of cultural factors or social interaction. The third perspective is concerned with the emotional pleasures of consumption. Mike Featherstone (1990. however. are often rather vague: either the desire for pleasure is meant to explain any irrational form of action or its explanatory power is lost in tautology: modern hedonism becomes identical to anything that is demanded by modern consumption. The concept of hedonism is to explain the formation of this surplus part of consumption. The need for food and nutrition science In a recent article. are familiar from political economy. in their turn are determined by values guiding them. Warde’s first two alternatives. which is not an exception any more but the main object of concern. The second approach is mainly interested in the different ways in which people use goods in order to create social bonds or distinctions. in his turn. This superfluous part or ‘luxury’ consumption (or eating) is then thought to be somehow artificial and even unnatural. divided the different approaches to the sociology of consumption into three classes according to the functions or meanings attached to consumption which. Any consumer or eater who exceeds the standards of nutrition determined by the ‘natural need’ of food is thought to be indecently seduced by the world of goods or to be stimulated by social competition. Alan Warde (1991). you with me. in many other respects disparate. ‘Status seekers’ – to use an expression made popular by Vance Packard (1960) – brought an element of irrationality – or another type of rationality – into the economists’ view of homo economicus. today. people define themselves through the messages they transmit to others through the goods and practices that they process and display. in general. Anthony Giddens and Zygmunt Bauman is the notion that. and with the increase in the division of labour and commerce. 5 . Discussing the social theories of Anthony Giddens. in a world in which traditional social bonds and class boundaries are weakening. (I compare myself with you. also Miller’s (1987: 114) emphasis on the recontextualization. (Warde 1994: 878) It is the use of goods to express one’s social identity and to distinguish oneself from others. TASTE AND PLEASURE to expressing their social identity (cf. A person is able to measure and control those needs which stem from genuine self-love. it is inseparable from private property as well. identity becomes more than ever a matter of the personal selection of self-image. Rousseau. as well as the appropriation. Jean-Jacques Rousseau separated two forms of self-love: genuine self-love and selfishness. 1980 and Schmidt 1987). It is the second form of self-love that leads to the emergence and development of artificial needs (see Springborg 1981: 35–41). Alan Warde identified a common theme in these.INTRODUCTION: NEED. contrary to most other Enlightenment philosophers.) The development and maintenance of artificial needs is thus for Rousseau intimately tied up with social interaction. of goods taking place during any act of consumption). Consequently. was a critic of civilization (see Carlsen et al. In a world where there is an increasing number of commodities available to act as props in this process. In his tract on social inequality. which has been the proper field of sociological consumption studies. Social emulation leads to a state of endless insatiability. selfishness is caused by social interaction. and so on ad infinitum. Ulrich Beck and Zygmunt Bauman. in particular. conceptions: One feature common to the social theories of Ulrich Beck. it has been the role of sociology to complement the often one-sided picture of consumption presented by economics. Increasingly. They manipulate or manage appearances and thereby create and sustain ‘self-identity’. individuals are forced to choose their identities. 1 In England. and the accompanying social problems. was the most common theme in analysing the causes of new social problems. which was caused by gluttony and luxury. The best-known representative and promoter of these new dietetics was a physician named George Cheyne (1991 [1733]). there would be no limits to man’s needs. A new dietetic regimen was born (see Turner 1982. Certain items of consumption (or foodstuffs) have a high social status or value because their consumption is restricted to the higher echelons of society. and the professional man in particular. during the eighteenth century. 6 . or even if they are detrimental to their health – because of this higher social value or status associated with them. Previously. Thorsten Veblen’s (1961) study of conspicuous consumption is often mentioned as the classical example. about superfluous consumption which exceeded necessities. The problem with artificial needs was rather that once stimulated they could never be satisfied. They represent a lifestyle which is seen as worth imitating. It still followed the principles of classical humoral medicine. Often a similar conception of social comparison and emulation. Even then. but at the same time it invented a new disease. the discussion about luxury. The detrimental effects of luxury were not being recognized for the first time.INTRODUCTION: NEED. which was first recognized by Rousseau. it was thought. equally among advertising men and cultural critics. There is a more specific parallel to this general discussion concerning luxury. Such explanations of the irrational elements of consumption seem to have been extremely common in the United States at the turn of the century. the English Malady. see also Falk and Gronow 1985). Both Featherstone and Warde mention Pierre Bourdieu’s Distinction (1984) as a recent and sophisticated version of such an approach. Once liberated from the constraints of tradition. Many diseases of both the body and the soul (from gout to melancholy). too. whose peace of mind was disturbed by insatiable needs. In the middle of the eighteenth century a new interest in the relation between food. no one seriously claimed that the lower estates were actually indulging in pleasures. Aronson 1984. This new malady threatened all the members of the middle class. TASTE AND PLEASURE Making a difference between natural and artificial needs is typical of sociological discussions operating with the concept of need and analysing modern consumption. but they certainly gained currency in Europe. but were then thought especially likely to corrupt the common people. eating and health emerged in England. luxury had posed a threat to gentlefolk. figures in the background of such analyses. The lower classes are tempted to buy and eat these foodstuffs or prepare meals from them – even though they actually cannot afford to. were thought to be caused by overeating and obesity. Its practical recommendations were. they could save money and still keep their ‘labour machines’ running. the director of Human Nutrition Studies of the Office of Experiment Stations in the US.INTRODUCTION: NEED. the only way to improve the lot of the wage worker was to teach him to spend his money more economically. and many contemporary nutritionists’. Increasing foreign trade and the import of colonial goods were among the most important ones. thus. rather concretely identified with increasing international and colonial trade and commerce. In Cheyne’s dietary recommendations. The major issue in Atwater’s. If only workers could be persuaded to substitute cheaper food. O. More generally. warning that once the traditional and limited structure of needs had been overstepped there was no return to it – at least not without a new kind of a discipline of the body.2 Contrary to older dietetics. introduced the concepts of the physiological economy and the money economy of food. was based on the ideas of scientific chemistry. Natural science had learned to analyse and separate proteins. which was thought to seduce Englishmen to loosen the constraints of their behaviour and promote a lack of self-discipline. and the standards of living improved without any need for higher wages (see Aronson 1982: 52–3). with equal nutritional value to that of more expensive food. however. a belief shared by many experts. recommendations was the consumption of meat (see also Hirdman 1983). If only workers would learn to buy and eat cheaper cuts of meat (say meat soup cooked with bones and offal). Dr Cheyne evidently shared Rousseau’s ideas about the corrupting influence of social interaction. The money saved could then be used for better housing and clothing. exchange and commerce. which included as much 7 . born at the turn of the present century. fats and carbohydrates from each other. New strange and exotic foodstuffs and seasoned food – hot spices – were seducing Englishmen towards overeating. taking into account the economic resources of different groups of people. inspired by the Arbeiterfrage or by the hope of conclusively solving the problem posed by the iron law of wages: if real wages could not permanently rise. the emergence of new – and artificial – needs was. the New Nutrition. Physiological economy aimed at determining the minimum needs of nutrition and energy for different social groups. The need for protein was estimated relatively highly compared to modern standards. TASTE AND PLEASURE According to Cheyne. Meat was seen to be the main source of protein in workers’ diets and it was rather expensive. As a solution to this problem W. divided according to the amount of energy expended in different foodstuffs. major social changes had been taking place in Britain which stimulated gluttony. Atwater. who is able to recognize his or her needs. and to interpret unerringly the needs of their bodies. gastronomy introduced another and even more finely divided system of classifications based on the taste of food. early example of the problem.) Good taste. among others. raw or cooked. In their hopes for dietary reforms the nutritionists were disappointed time and time again. and with the help of new kinds of specialists. TASTE AND PLEASURE or more protein than finer cuts (steaks etc. The classification of different foodstuffs. and the analysis of their usefulness or uselessness to the human body.). Instead of classifying different foodstuffs or meals according to their nutritional components. Modern gastronomy has been equally active in disciplining and controlling the bodily needs of the modern individual.). They are equally able to avoid the temptation of gluttony. Although the New Nutrition understood the need for nutrients to be natural. (The dispute over the right amount of protein is a good. really. The question of false or genuine needs. they could radically cut down on their food expenses. and in this respect unproblematic and universal.INTRODUCTION: NEED.g. gradually. was in possession of the right kind of knowledge? Experts’ opinions varied and changed from time to time. have been conducive to restraining the human passion for food and eating. could only be solved by scientific expertise. the American worker was not particularly receptive to the arguments of the new science – because of the bad example set by ‘the overfed middle-class and the beautiful people’. Individual people could no longer know or recognize their ‘natural needs’. They could be ‘cured’ only with the help of the right kind of instruction. This marked a decisive rupture with the older tradition of dietetics. It can be claimed that gastronomy has civilized the modern consumer’s taste by introducing new distinctions and classifications of food and drink which. and to satisfy them rationally within the limits of his economic resources. as Edward Atkinson. and new false or superfluous needs were continuously discovered. gastronomy and social distinctions Nutrition science has been active in creating a modern food consumer. had to admit (see Levenstein 1988: 201–2). fresh or spoilt food. etc. But who. This process of the 8 . the nutritionists. These could only be recognized with the help of experimental science. a new problem emerged. red or white meat. thus. no longer followed the properties which could be recognized by taste or sight (e. Ideal rational consumers are also able to recognize their false or artificial needs. False or wrong needs could now be explained as resulting from ignorance. Gastronomic literature – cookery books. Good taste is also an expression of decency. They were as self-evident as the tastes of sugar and salt. it is both useless and impossible to teach anyone the standards of good taste. for the French struggle over European culinary hegemony with the MediterraneanArabic cuisine during the Renaissance. This paradox or antinomy led gradually. during the eighteenth century. It also offers a good example of the theoretical paradox of which at least some of its leading representatives were conscious. In the same way that we do not usually make mistakes in our judgments of the taste of food and drink. One could not legitimately have differing opinions about it. What felt or tasted good was both good and beautiful. Any parvenu who tried to act as a gentleman could always be put in his proper place by letting him know – through small gestures – that even though he thinks he is acquainted with the right etiquette. Good taste in dressing or eating. but has strong moral connotations as well (see Schümmer 1955 and Grean 1965. see also Campbell 1987).INTRODUCTION: NEED. (See Revel 1979 and Mennell 1985. Caygill 1989). as well as the right and the wrong.) The old saying that one cannot dispute over matters of taste (De gustibus disputandum non est!) did not originally refer to the fact that taste is a private matter for every individual. if the possibility of a mistake is ruled out. A virtuous man shows good taste in his behaviour and his outward appearance. As the tradition taught. only a fool could fail to distinguish between the beautiful and the ugly. On what grounds could any particular scale of taste be preferred to another. What is of equal importance. Instead. a man simply possesses a sense of good taste expressed in his conduct and choices. and how could 9 . not only indicates one’s sense of beauty. Taste was an ideal means for making social distinctions. TASTE AND PLEASURE refinement of taste is often thought to have achieved its peak in the French cuisine of the eighteenth and nineteenth centuries. Taste was thought to be based on one’s sense of taste alone. As Edmund Burke (1987 [1757]) saw it. see Peterson 1994. to the dissolution of the whole tradition of the aesthetics of taste – or common sense theory (see Hooker 1934. he still does not master the requirements of good taste. which had been gradually diverging into a literary genre of their own – often operated with such an unproblematic concept of good taste. judgments of taste cannot be reflected upon rationally and one cannot legitimately formulate any maxims or rules concerning them. guides and books on etiquette. we are equally unerring in our judgments of taste in general. Educators and instructors were posed with a practical problem: if a person is the best judge of his or her taste. it was taken to mean that taste – or good taste – was somehow self-evident and beyond dispute. thus. whereby one classifies oneself and is classified by others’. both food preferences and table manners are important indicators of lifestyles and class tastes in his study (ibid. he shared Nietzsche’s anti Kantian position (Rahkonen 1995). Bourdieu criticized the ‘pure’ aesthetics of the beautiful and the sublime. Furthermore. but how could something that was exclusively based on the subjective feeling of pleasure be universally valid.:77). In this respect. however. As a matter of fact. in his opinion. of the members of a society and identifiable solely through empirical studies. see also Schümmer 1955). for which.3 Good taste and the problem of the aesthetics of taste Taste and legitimate or good taste are the basic concepts of Pierre Bourdieu’s social theory of distinctions (see Bourdieu 1984: 56). he gives a specific sociological interpretation. the standards of which were shared by the majority. or it was to be the taste of a specific social group.INTRODUCTION: NEED. is exemplary and binding by its nature? Gastronomers tried to solve this puzzle by claiming that not everyone is a connoisseur. In so doing he actually used the argument of the old aesthetics of taste. taste is always a disposition forming part of the habitus of any person. if not all. A born connoisseur is not in need of any rules of conduct. TASTE AND PLEASURE it alone demand the status of legitimate or good taste that. Bourdieu (ibid.) could be echoing the classical tradition. 10 . In his third critique Kant formulated the famous antinomy of taste which the tradition had not been able to solve and to which no possible conceptual solution could be found: the feeling of beauty requires that it be shared universally. somehow. His main critical argument against Kant’s pure aesthetics is that it conceals its class origins and interests behind its seemingly objective and disinterested façade. Good taste was understood either to be an empirical category. To Bourdieu. too (Kant 1987: §31)? In the tradition of the moral sense theory there were various attempts to solve this dilemma. Immanuel Kant is mainly to be blamed. The intellectual tradition of the aesthetics of taste came to an end or to a final fulfilment in Immanuel Kant’s Critique of Judgment (see Caygill 1989. but food grammars are needed for those who do not possess a natural mastery of good taste. to which. or moral sense theory. By writing that ‘taste is the basis of all that one has – people and things – and all that one is for others. Bourdieu does not explicitly refer to the classical discussion about good taste which flourished in Europe in the seventeenth and eighteenth centuries. and as such an ideal of education and emancipation. According to the understanding of representatives of the moral sense theory. In this tradition of thought. good taste was increasingly understood not to be predetermined by the privilege of birth or social origins. in particular (see Hooker 1934). Kant 1987: §18). regardless of one’s social standing. On the other hand.INTRODUCTION: NEED. the old saying that it is useless to dispute over matters of taste was not originally understood to refer to the private nature of judgments of taste. the empirical generality and validity of a taste had nothing to do with the universal validity expected from a genuine judgment of taste.4 As mentioned in the previous section.5 As Gadamer (1975: 33) pointed out. in other words. questioned or defended (cf. taste was always understood to be a reflection of genuinely individual preferences alone: something was tasteful and good because it really felt good (see e. taste was based on a sense or feeling about the goodness or badness of objects or forms of conduct. there could not possibly be any genuine good taste. If they were to be disputed. matters of taste were beyond dispute because there could not in principle be any general rules governing them. Legitimate taste pretends to be the universally valid and disinterested good taste. in whose opinion. But in his opinion this legitimate taste is not genuine good taste: in fact. taste was basically a Bildungsbegriff. Sole reliance on one’s sense or ‘instinct’ of good and bad. within this tradition of thought. was both an indicator of belonging to ‘good society’. the ruling class. there would have to be presuppositions that there were some general standards which could be criticized. it was both futile and unnecessary to argue about it. impossible to formulate any general maxims of good taste. This could not be reflected upon conceptually. tasteful and tasteless. Taste was essentially both an aesthetic and a moral category. It was something that could be adopted by learning. Good taste. in principle. whereas in reality it is nothing more than the taste of one particular class. It was. these solutions were not theoretically satisfying and they were criticized by Kant. Anyone who showed good taste in their choices and conduct was a gentleman (or gentlewoman). thus. and the main criterion of entry into it. More importantly. Because taste was something self-evident and shared by all. TASTE AND PLEASURE ‘high society’. Bourdieu adopted one possible empiricist solution to the antinomy of taste by claiming that the taste of the ruling class is always the legitimate taste of a society. However. The meaning was rather the opposite.g. precluded distinction between beauty. Burke 1987). these senses could not be separated 11 . goodness and virtue: ‘sense of beauty’ and ‘sense of right and wrong’ were inseparable. In gastronomy. TASTE AND PLEASURE from each other. 12 . too (see Grean 1965). it has played a prominent role to date.INTRODUCTION: NEED.) fall largely outside the formal schooling and education system. furnishing one’s home. in particular. What was tasteful was both decent and virtuous. in the aesthetics of the ‘lower’ arts. Whereas the criterion of good taste gradually disappeared from the aesthetics of fine arts during the eighteenth century. In this sense. etc. Bourdieu shared the basic postulates of this tradition. dress and decorum were all indicators of an individual’s moral and aesthetic value. As has already been pointed out. it retained its role in the aesthetics of everyday life and popular culture. or good taste. eating. They are made on the basis of pure taste dispositions rather than following any explicit rules and norms of conduct. decent conduct. too. both food preferences and table manners are important indicators of lifestyles and class tastes in Bourdieu’s study because all such choices (like dressing. Thus. even though ephemeral. . ideology raised to the second power . community of universal taste. Immanuel Kant shared this conception with many of his contemporaries. ’. public opinion and social cohesion In the classical European humanistic tradition fashion was always thought to be antithetical to good taste. in Hegelian terms. Kant’s ‘sensus communis is ideology purified. by imposing 13 . tries to come to terms with the dilemma of the ‘bad’ particularity of the individual living in the civil society and the ‘bad’ – because abstract and coercive – universality of the laws of the state. The tradition of European aesthetic thought exemplified and culminated in Kant’s and Schiller’s writings presents a hegemonic bourgeois project which. Terry Eagleton. A person blindly following the whims of fashion was without style. universalized and rendered reflective. whereas a man of style – or a gentleman – was using his own power of judgment. His evaluation of Schiller’s teaching is even more critical: ‘Schiller’s aesthetic is in this sense Gramsci’s hegemony’ (1990: 106). came to a conclusion reminiscent of Bourdieu’s and Veblen’s sociological positions. . To Eagleton (1990: 96) as well as to Bourdieu. Georg Simmel’s famous essay on fashion can best be understood as a somewhat ironic commentary on Kant’s idea of a sensus communis: the community of fashion is the real. Bourdieu expressed the same idea by claiming that the good or legitimate taste conceals its real class origins behind its seeming objectivity and disinterestedness. in his ideological-critical history of European aesthetic thought.2 P H I L O S OP H I C A L AESTHETICS AND THE R E F I N E M E N T O F TA S T E SOCIOLOGICAL AESTHETICS OR AESTHETIC SOCIOLOGY Custom. determined by sentiments or taste. . intuition and opinion must now cohere an otherwise abstract.: 97–8) 14 . a spiritualized version of the abstract. piety. that of spontaneous habits: Custom. In doing so. in some mysterious fashion. double edged concept [cf. . absolved from all sensual motivation. gives the law to itself. . it figures as a genuinely emancipatory force – as a community of subjects now linked by sensuous impulse and fellow-feeling rather than by heteronomous law. the bourgeois subject is autonomous and self-determining. the aesthetic signifies what Max Horkheimer has called a kind of ‘internalised repression’.: 28) It is this hegemonic side of the ‘aesthetic’ that mainly interested Eagleton in his history of the European classical aesthetic thought. . . On the other hand. (ibid. and so operating as a supremely effective mode of political hegemony. the law becomes the form which shapes into harmonious unity the turbulent content of the subject’s appetites and inclination. . (ibid. To him Kant’s selfless aesthetic judge. . who cancels the concrete differences between himself and others as thoroughly as does the levelling. Moreover.]. each subject must function as its own seat of self-government. homogenizing commodity. acknowledges no merely extrinsic law but instead.PHILOSOPHICAL AESTHETICS and postulating a third sphere of social relations in between the individual and the state. inserting social power more deeply into the very bodies of those it subjugates. . G. also Luhmann’s (1981: 60) parallel critique of Simmel’s formal sociology – J. atomized social order. Like the work of art as defined by the discourse of aesthetics. once absolutist power has been overturned. Culture is thus part of the problem to which it offers itself as a solution. is among other things. On the one hand. the aesthetic is from the very beginning a contradictory. (Eagleton 1990: 23) As Eagleton admits. . serialized subject of the market place. each safeguarded in its unique particularity while bound at the same time into social harmony. It is this ‘bad’ and too hasty fusion of the general and the particular – at the cost of the particular individuality with its unique interests and sensitivities – which is time and time again repeated in the following aesthetic tradition from Edmund Burke and David Hume to Kant and Schiller. and imperceptibly changes the force of authority into the force of habit. class. Bellah et al. not even Lenin could offer any other recipe for the organizing principle of the future stateless communist society than these very same ‘habits of the heart’ which would be adopted automatically and 15 . but in citizens’ hearts. when other laws decay or become extinct it revives or replaces them. and above all to public opinion: a part of law that is unknown to our political theorists. although success in every part depends on it. As Arto Noro (1993: 58) has pointed out. cited in Eagleton 1990: 18–19) As Eagleton reminded us. the middle class has exceedingly little time’. it maintains in the nation the spirit of its constitution.PHILOSOPHICAL AESTHETICS Eagleton even presented as an empirical. Rousseau wrote in it about a law which is not graven in marble or bronze. G. 1986) in his Social Contract (1994). its strength augments day by day. Hegel’s approach to the social mediation between the bourgeois individual and the state through the ‘complex [and conceptual – J. historical fact that the solution offered to the middle class by the adoption of a common culture ‘depends on an activity for which. He recommends us to adopt ‘a properly dialectic form of reason. One of the very starting points of Terry Eagleton’s critical interpretation of the aesthetic tradition was Rousseau’s famous dictum about the social and moral importance of ‘the habits of the heart’ (cf. but now in the form of a disinterested commitment to a common well-being’ (Eagleton 1990: 25). I refer to moral standards. Thus. and the like’ is more promising an approach than the ‘abstract immediacy’ and the resulting ‘aestheticized morality’ offered by Kant’s and Schiller’s aesthetic projects. to Eagleton. in it lies the true constitution of the state. and so to break with aestheticization in the sense of mere intuitive immediacy’ (Eagleton 1990: 147).] mediations of family. As also explicitly cited by Eagleton. to custom. (Rousseau 1994: 89–90. corporations. Summa summarum : the sought after aesthetic harmony is hardly anywhere to be found! It is only an ideological illusion (Eagleton 1990: 99). as Karl Marx wryly commanded. according to Rousseau’s conception the citizen can surrender his ‘bad’ particularization only by identifying through ‘the general will’ with the good of the whole: ‘he retains his unique individuality. G. But his total dismissal of the importance of these ‘customs’. savagery. . They will become accustomed to observing them without force. how much the ‘middle classes’ of Marx’s day had any time to spare for cultural activities or the admiration of works of art. Only habit can . . In criticizing classical aesthetic thought Eagleton certainly is right in emphasizing the strong and active utopian element which aimed – through Bildung.e.e. admired and promoted fashion. was full of social interaction which was not only instrumental and regulated by the purposive activity of realizing their interests – 16 . is defensible only from his perspective of a totally transparent and rational social order. In such an order people’s social conduct would be regulated only by moral laws. As Gramsci understood hegemony. What is even more important. of common habits and public opinion – J. In fact. their daily life. ‘habits’ and common sensitivities. But what is more important. they quite evidently did enjoy aesthetic artefacts in their everyday lives. have such an effect. at the highest communist stage of social development the state can totally wither away as soon as men learn to follow the basic and similar rules of decent social life ‘out of pure habit’: freed from capitalist slavery. It certainly is an historical and empirical question. Gramsci only reminded us that there is a cultural and social dimension to every society which cannot be reduced to the laws of the state or the functioning of the economic order. To judge from contemporaries’ reports they certainly did – more or less regularly – visit the opera. from the untold horrors.PHILOSOPHICAL AESTHETICS without any outer coercion – purely out of the force of habit – by every common worker: as Lenin wrote in his The State and Revolution. . absurdities and infamies of capitalist exploitation. the source and validity of which are directly accessible to the reasoning of all the members alike. in a similar way to ours. Kunst and Kultur – at reconciling the contradictions of the bourgeois social order. (Lenin 1980: 467) Neither does Gramsci’s famous concept of hegemony offer much more. . . people will gradually become accustomed to observing the elementary rules of social intercourse that have been known for centuries and repeated for thousands of years in all copy-book maxims. though by no means an easy one to solve by any empirical study. often adopted by the actors through unreflective imitation. as Edmund Burke knew. i. it is a stage of consensus (i.) plus cultural leadership of the intellectuals (see Gramsci 1975: 235). or at least a cabaret or a popular concert hall. direct our attention to the various aesthetic forms of sociation. differentiated society. The charm of novelty offered by fashion is a purely aesthetic pleasure. ‘communities of taste’. their daily conduct was not only oriented towards obtaining a profit. it was the great merit of the philosophical aesthetics to be the first school of thought to try to come to grips with these phenomena. In an important sense. in this sense. To Simmel (1981). In a sense. it was also governed by a ‘useless’ etiquette and numerous ‘irrational’ habits and customs. Studying fashion offers an excellent opportunity of understanding this important dimension of modern life. or played cards. and their spouses organized dinners. Fashion is a play form of sociation. to distinguish and recognize their independent role and to understand their full importance. 17 . In this respect. However. following the example set by Georg Simmel. This can also help us better to understand the role of aesthetic pleasures in our everyday life in general. Fashion is such a social formation par excellence. sociology is the legal and sole inheritor of this interest or orientation in the present day intellectual world. and to try to understand their role in society. salons and balls. no social formation could survive without them. speak of the aestheticization of the social world in modern times. fashion was a social formation always combining two opposite forces. In this treatise it is suggested that instead of ‘simply’ empirically identifying the carriers and promoters of ‘good’ or legitimate taste or the role of taste in status competition. In other words. It is an open question whether such ‘useless’ cultural artefacts and idle social forms have become exceedingly important in modern culture and whether we can really.PHILOSOPHICAL AESTHETICS businessmen met at public houses and cafés. where such forms have become less ritualized. These ‘frivolous’ elements and ‘ephemeral’ forms of social life can neither be reduced nor submitted to a rational morality or objective economic interests. one could claim that it has only become possible in the modern. and instead of studying the empirical generality of a taste or an ‘opinion’ in a society – an approach already proposed by David Hume – we should. The main thing is to note and acknowledge the great social and cultural importance of such play forms of sociation at all times. 1 Why did France – more obviously and earlier than any other part of Europe – give birth to a particular ‘high’ culture of food and why was its development and its renewal more rapid during those centuries? Haute cuisine or ‘royal cuisine’ was developed in France. a position it has been able to retain to some extent up to the present day (cf. political power and social function of the old noblesse d’épée were gradually declining. The same process which marked the gradual development of increasing individual self-control at the beginning of modern times also manifested itself in the gradual restraint of appetite and refinement of table manners. see also Mennell 1987) identified the social mechanism which led to the development of royal or haute cuisine in France and to its rapid and continuous revival. 1983). Parts of the old 18 . Wheaton 1985)? Mennell’s interpretation relies to a great extent on the theory of civilization developed by Norbert Elias (1978.PHILOSOPHICAL AESTHETICS WHAT IS GOOD TASTE? The refinement of taste in France In his inspiring study. Following Norbert Elias’ interpretation. while those of the bourgeoisie and of the essentially bourgeois noblesse de robe were increasing. More markedly medieval habits prevailed and tastes preserved their ancient flavour even among the higher orders of society. Stephen Mennell (1985. Revel 1979. All Manners of Food. Mennell was mainly interested in the differences in the development of food culture in France and Britain and in their gradual process of differentiation during the seventeenth and eighteenth centuries. Ostentation with regard to food and drink was increasingly regarded as a sign of bad manners and was not considered to be in accordance with the demands of etiquette. He was especially interested in an issue which has been widely discussed by gastronomes: why did French cuisine achieve such a prominent role in Europe during the seventeenth and eighteenth centuries. The process of change was much slower and less noticeable in England during the same period. Stephen Mennell identified the mechanism of the renewal and refinement of food culture with the peculiar process of rationalization of a court society: The revenues. It was characterized by extremely refined meals and dishes and by a very complicated order or hierarchy of tastes. a cuisine which was clearly different from bourgeois or peasant cuisine. cuisine and cooking methods made it possible to make more and more refined distinctions and to establish an elaborately differentiated system. Only an expert on etiquette and a real gourmet could always infallibly decide what was good or bad. Lifestyle and etiquette became arenas of social competition and emulation (see also Luhmann 1980:128–9). according to Mennell’s testimony. but it was never able to displace traditional English country cooking on the tables of noble houses. The wings of royal power had already been clipped during the seventeenth century. a complicated hierarchy of tastes and even the ability to discuss and argue about taste. Mennell characterized court nobility as a group of virtuoso consumers and even referred to Veblen’s concept of conspicuous consumption (see Veblen 1961). Relations between the various groups of nobility and between nobility and the higher bourgeoisie remained more open and their boundaries more flexible. They became in effect specialists in the art of consumption. A court nobleman was continuously obliged to set himself apart from his equals and to emphasize the superiority of his lifestyle to members of other social groups and estates. especially the rural aristocracy and the prosperous bourgeoisie of the towns. The English bourgeoisie was much more inclined to economize than to indulge in extravagance in eating. Complex small but expensive dishes. In England.PHILOSOPHICAL AESTHETICS nobility acquired positions at court and became highly dependent on royal favour. what was valuable and what was valueless. For part of the eighteenth century the influence of French cooking was noticeable in England. the process of the refinement of taste was much slower during the same period. A gentleman’s choice was an expression of good taste and he could always ‘smell’ people with bad taste. (Mennell 1987: 389–90) The lifestyle of the court nobility was thus not only an indicator of its social position but rather determined it. The impetus for the continuous renewal and refinement of ‘the manners of food’ was weaker. The pleasures associated with taste and food also became important elements or stakes in this game of social competition. entrapped in a system of fine distinctions. Pretenders or would-be gentlemen were easy to detect. 19 . and consequently the royal court and court nobility never played such influential roles as their French counterparts. The main purpose of a nobleman was the maintenance and accentuation of his own social prestige. status battles and competitive expenditure from which they could not escape because their whole identity depended upon it. In the following section Bourdieu’s study is mainly discussed as a prominent example of a certain type of theoretical analysis which. There are many similarities between the aesthetic dispositions found in Bourdieu’s present-day France and the court society of the ancien régime analysed by Mennell. Elias’ and Mennell’s analyses of the rationality of court society were restricted to a specific historical constellation in European societies. obesity and gluttony gradually fell ‘out of fashion’ and ostentation in matters of food and drink was regarded as bad taste. Distinction and class tastes It is interesting to compare the general results of Bourdieu’s study of modern France with Mennell’s historical research on England and France in the seventeenth and eighteenth centuries. It would be tempting to claim that emerging nutritional science and various dietetic regimens. is more revealing of the general theoretical problems connected with this kind of approach. Bourdieu’s Distinction (1984) further develops many of the ideas presented by Simmel. not by developing a system of tastes but by emphasizing the different nutritional values of foodstuffs and by classifying them accordingly. played to some extent a similar role to that of gastronomy in France (see Falk and Gronow 1985. Even though these recommendations about diet were presented in the spirit of humoral medicine. Such regimens were certainly not unknown in France either. fashions and tastes and even consumption patterns in general. Veblen and Elias. Dietetics aimed at restraining people’s appetites. they dealt with the problems of overeating in a new way. such explanations are common enough. Many diseases – both physical and social ones – were found to be caused by unhealthy eating habits. The best known and classical examples in sociology were presented by Georg Simmel (1981) and Thorsten Veblen (1961) (for a more specific analysis of food culture see Simmel 1910). 1984). because of the sophisticated level of argument. see also Turner 1982 and Aronson 1982. In this respect.PHILOSOPHICAL AESTHETICS Even in Britain. In general. in England at least. The modern working class keeps up the traditions of the medieval common people: its members drink and eat 20 . A short presentation inevitably fails to do justice to the complexity of Bourdieu’s analyses and the richness of his ethnographic observations concerning modern French culture. The aping of one’s superiors and the almost compulsory impetus to distinguish oneself from one’s equals and inferiors are offered in different theoretical traditions as valid explanations of changing lifestyles. and which the other classes are eager to imitate. to become rather static. a similar system of lifestyles and class tastes would emerge and a similar mechanism of distinctions would be in operation. As Claude Fischler (1990: 170) has pointed out. but rather the fact that it takes more than that to make a gentleman. is the fact that it is in the nature of a society which is understood to be functioning through social competition and emulation. however. a country squire or a nouveau riche who longs for rules and guidance in etiquette. The modern French petit bourgeois is a typical parvenu. In another context altogether – in discussing the problem of the emergence of the modern consumer and the logic of modern consumption – Colin Campbell (1987) claimed that the kind of aristocratic aesthetics of a ruling class. for gastronomic guide books. In such a society the different classes have different positions according to their respective economic and cultural capital and the boundaries separating the classes are relatively open but hierarchically ordered. in any ‘class society’. He only reveals his real social origins by the insecurity of his conduct and by following the rules of etiquette all too rigorously. All the sensual and corporeal aspects of eating are concealed behind the strict formality of table manners. The main problem is not the thickness of the wallet. What makes this kind of an analysis problematic. It would be completely possible to argue that. Their taste pleasures are simple and sensual. To support Bourdieu’s argument one does not have to postulate any long tradition of French culture which is still evident despite the somewhat clandestine structures of its present-day counterpart. in such a social order manners and mores are continuously descending down the social ladder. of which Bourdieu’s bourgeoisie is a good example. The classification of tastes tends to become more and more refined and subtle. but the hierarchical structure of tastes and their criteria are never really challenged by social competitors. necessarily leads to conforming and static lifestyles. Pleasure is anticipated and constrained rather than satisfied. It is certainly not surprising to find such a close correlation between these two descriptions or analyses. The lifestyle of the modern ruling class or bourgeoisie resembles that of Mennell’s court nobility: knowledge of etiquette is self-evident and its members are sovereign in their mastery of good manners. in order to be able to live à la mode but never really succeeding in his efforts.PHILOSOPHICAL AESTHETICS without regret and live only for the present. 21 . The continuous refinement of an order of classification does not lead to the questioning of the prevalent cultural code but rather to endless variations within it. (ibid. . Bourdieu also claims that the new petite bourgeoisie is predisposed to play a vanguard role in the struggles over everything concerned with the art of living. on ethical as much as on scientific grounds’ (ibid. pleasure is not only permitted but demanded. too. In so doing it legitimates both itself and the taste and the lifestyle of the ethical avant-garde. Competition between the different groups within these classes is of special interest. put forward as a model by the avant-garde of the bourgeoisie. In particular.: 311). In all essentials. They cherish the hedonistic ethic of consumption which is based on loan taking and waste. relations between sexes and the generations. . the new ruling class or the new bourgeoisie is presented as the vanguard of all aesthetic and ethical renewal in society. It is opposed on almost every point to the repressive morality of the declining petite bourgeoisie . Its disposition even satisfies the demands of economic development. is essentially an ethic of hedonism: ‘the new ethical avant-garde urges a morality of pleasure as duty . the members of the new middle class help both to legitimate and to spread it through society.: 367). domestic life and consumption. This new ethic of hedonism is also functional to the economic system by judging people as much by their capacity to consume and by their lifestyles as by their capacity to produce (ibid. this new class is the direct opposite of the classical bourgeoisie which was an ascetic saver willing to sacrifice the present for the future (see Bourdieu 1984: 310). The members of the new petite bourgeoisie are ‘perfect consumers whom the economic theory has always dreamed of’ (ibid. This new ethic.: 366–7) 22 . the reproduction of the family and its values. Bourdieu is mainly interested in analysing the social groups which can be considered new in some respect and show an upward trajectory in social space. . The new petite bourgeoisie acts for Bourdieu (ibid. .: 365) ‘as a transmission belt and pull into the race for consumption and competition those whom it means to distinguish itself from’. By eagerly adopting this disposition. Its members are ideal consumers. in particular.PHILOSOPHICAL AESTHETICS The hedonism of the new classes and the emergence of the ideal consumer What makes Bourdieu’s analysis more interesting and exceptional is the fact that his analysis of lifestyles and tastes is not restricted to the characterization of these three hierarchically ordered classes.: 371). It is opposed to the old middle-class morality of duty: the old morality of duty. . a fear of pleasure and a relation to the body made up of ‘reserve’. It is the main consumer of all kinds of therapeutic service which provide ‘scientific’ solutions to moral questions: Guided by their anti-institutional temperament and the concern to escape everything redolent of competitions. theoretical abstractions or technical competences. On the other hand. these new intellectuals are inventing an art of living which provides them with the gratifications and prestige of the intellectual at the least cost: in the name of the fight against ‘taboos’ and the liquidation of ‘complexes’ they adopt the most external and most easily borrowed aspects of the intellectual lifestyle. induces a generalized suspicion of the charming and attractive. (ibid. As emphasized by Featherstone (1991: 91). see also Sulkunen 1992: 152–3). ‘modesty’ and ‘restraint’. through tradition or habit. based on the opposition between pleasure and good. (Bourdieu 1984: 367) It succeeds in concealing its moralizing tone behind a pseudoscientific analysis of everyday practices. it could be claimed that the willingness to consume the latest thing already presupposes that there are no traditional constraints on behaviour. liberated manners. The ethic of the new middle class is the ethic of fun (Bourdieu 1984: 364. . These ‘new heroes of consumer culture’ make style a life project: the new petite bourgeoisie is not promoting a particular style but rather catering for an interest in style itself. . . emancipated poses and postures . The main ‘merit’ of the new ethic is that it produces isolated consumers whose demands are not constrained any more by any traditional moral order.: 370–1) 23 . Bourdieu’s analysis of the lifestyles and ethos of this new middle class and the new bourgeoisie are the most interesting parts of his extensive study.PHILOSOPHICAL AESTHETICS In Bourdieu’s opinion the new petit bourgeois is not an ideal consumer simply because of her or his willingness to consume and to consume the latest thing. Bourdieu’s new petite bourgeoisie does not adopt a lifestyle unreflectively. cosmetic or sartorial outrages. hierarchies of knowledge. He makes the new middle class representative of almost everything that is ‘modern’ in the modern society. and associates every satisfaction of the forbidden impulses with guilt . In particular. who is functional to the capitalist economy. The new professionals have created their professions by themselves from the very beginning. That the previous ethics of work and asceticism has been displaced by hedonism is a common theme in various critiques of everyday life in post-industrial society. They fall outside all formal hierarchies. Thus they are challengers of the old culture. however. on the contrary. from Daniel Bell to Christopher Lasch. the core of the new petite bourgeoisie is comprised mainly of various cultural intermediaries and new craftspeople (ibid. Strictly speaking. first emerged in late capitalism. they tend to establish a completely new hierarchy of tastes demanding the status of legitimate or good taste. Furthermore. any analysis of the social mechanism of distinction and 24 . his diagnosis resembles the analyses of many cultural critics who were anxious to prophesy the victory of the new hedonist over the old ascetic (cf. In this respect. He makes it seem as if the hedonistic consumer was born in France only yesterday in the guise of these new professionals. Bourdieu draws historically and socially close narrow boundaries around the possible representatives of the ethics of fun. Its members do not try to ascend along the same scale or hierarchy of values as their predecessors. their dispositions and preferences tend to deny the importance and relevance of the old order. they are selling mainly ‘symbolic goods or services’ and are working in a ‘substitution’ industry which sells words instead of goods (see Bourdieu 1984: 365). this fun ethic is essentially part of a game of distinctions. Bourdieu’s hedonistic consumer. To Bourdieu. By explaining the new ethic in terms of social positions which can be identified by certain objective criteria.: 300). and by putting itself in direct ethical – and aesthetic – opposition to the ruling class it can challenge prevalent legitimate taste. no reports or certificates asked for. not social climbers trying to ascend its ladders. He also reduces the ethos and lifestyle of the different classes to their respective social positions. To him. whose ethical and aesthetic standards the new middle class only helps to universalize – this game of distinctions functions in a particular way. In disregarding the tastes and lifestyles of their superiors. the social positions occupied by the new classes are of a totally new kind. It is not very surprising that Bourdieu recognized hedonism as one of the main characteristics of the culture of the new middle class. this new class can distinguish itself from its social competitors. Bell 1976).PHILOSOPHICAL AESTHETICS Bourdieu does not only characterize the main features of this new aspiring taste. No formal entry qualifications are required. Through adopting a new lifestyle based on hedonism. For the new middle class – or rather the new bourgeoisie. These tastes always present themselves as new and different from the old ones but they do not by any means have to challenge the previous taste and style in such a drastic way (however. Hannah Glasse’s The Art of Cookery Made Plain and Easy (1747) and John Farley’s London Art of Cookery (1783) – offers excellent examples of Bourdieu’s two possible processes of taste formation. in reality. seem to be rather ill-suited to characterize the rapidly changing tastes and styles of a modern fashion cycle. In order to qualify as legitimate taste. At the same time. consequently. It was bad taste to try to imitate good taste. the bourgeoisie still did not have the resources to eat on such a lavish scale and they were therefore under more pressure to choose. cf. it must also be presented as falling outside all classifications and hierarchies (see Bourdieu 1984: 370). as presented by Bourdieu. Vincent Chapell’s The Modern Cook (1733). the situation was different. two ways of social ascent open to any group in a society: strict adherence to the rules of the game. The cookery books and gastronomic treatises were mainly directed at members of the ascending and increasingly prosperous bourgeoisie and the members of lower nobility who aspired to live à la mode. in reality. The old fashion of yesterday is simply forgotten today. even if one could afford it.PHILOSOPHICAL AESTHETICS competition alone will show that there always are. would. the new taste represents just another competing system of classifications and distinctions. Seemingly. one did not have good taste. In addition Bourdieu seems to assume that new taste which aspires to become the new legitimate or good taste always has to take a totally different or opposite form from the old one. there gradually 25 . denying the relevance of all classifications only conceals the fact that. Such a system of competing tastes. Bourdieu 1986). Marin’s Les Dons de Comus (1739). Menon’s La Cuisinière bourgeois (1746). however. Eliza Smith’s The Complete Housewife (1727). In the ‘classic’ class society systematically analysed by Mennell. The demand for gastronomic guidance and. As pointed out by Mennell. or the creation of new rules. was therefore also more urgent among them (see Mennell 1987: 391). in principle. the demand for cookery books. it was continuously emphasized that it was always better to live according to the demands of one’s own social position rather than to ape and imitate the manners of one’s superiors. The gastronomic literature of the eighteenth century analysed by Mennell (1985: 69–101) – cookery books like Massialot’s Le Cuisinier roïal et bourgeois (1691). By presenting well-chosen examples describing the menus of famous dinners and banquets they taught their readers what was in accordance with good – or latest – taste. if. At the same time. Even though it is more concerned about the selection of raw materials and despite its minimalistic ideals in matters of taste and decoration.PHILOSOPHICAL AESTHETICS appeared new arguments demanding the return to more simple and natural table manners and ways of eating. the boundaries between them are flexible. be interesting to analyse in more detail the emergence and the functioning of the opposition between these sub-fields of restricted production (art for art’s sake) and large-scale production (commercial or popular art) (see Bourdieu 1983: 333). the ‘consecrated avant-garde’. it still hardly questions the prevailing scale of good taste. it was a commercial art form from the very beginning. In a sense. Levenstein 1988: 14). But still it certainly is possible to identify those ‘artists’ who aimed their products only at genuine connoisseurs or a strictly restricted audience. however. Once the art of cookery became public and retreated from the private kitchens of the nobility and entered the open Parnassus. It is. Excessive refinement and cultivation of taste. nouvelle cuisine still operates to a great extent within the same scale of tastes.g. it tended to direct its ‘good message’ to as broad an audience as possible. There are no fixed lines separating refinement.) One can thus easily identify in the gastronomic field many examples of the oppositions typical of cultural production in Bourdieu’s sense (see Bourdieu 1983). even if the new recipes often were direct plagiarisms of earlier works. The adoption of the French haute cuisine by the nouveau riche on both sides of the Atlantic during the latter part of the last century has been cited by many studies as an excellent case proving the importance of social competition in the development of taste in culinary culture (see e. (This accusation of artificiality and excessive refinement could more often be read in English than Continental cookery books. While it presents its own naturalness as an alternative to the artificiality of the old cuisine. were in fact wholly artificial and consequently expressions of bad taste. examples of which could all too easily be recognized in certain social classes. variation and innovation. be kept in mind that even though it is always in principle possible to identify different mechanisms of legitimating and questioning the ideals of good or legitimate taste. Even in this field of cultural production it would. The avant-garde – or practically every new generation of cookery book authors – was inclined to present its ideas as totally antithetical to the ideas of its predecessors. rather doubtful if the process that began at the end of the eighteenth 26 . It should. The very development of nouvelle cuisine as a challenger to haute cuisine is an excellent example. thus. however. was being imitated by the rich. the tempo of change in fashion and style has increased enormously since the French Revolution (see Mennell 1985: 161). which included food products and services. it was already produced for the market. Even though its etiquette and recipes were partly borrowed from the court. counts. It was Escoffier. had to admit in 1903 that ‘novelty is the universal cry – novelty by hook or crook! It is an exceedingly common mania among people of inordinate wealth to expect incessantly new or so-called new dishes’ (cited in Mennell 1985: 161). Rosalind Williams has pointed out that even though the French were nearly as preeminent in the nineteenth century in pioneering a new style of mass consumption as they had been in developing the courtly model of the earlier century. one could claim that the cuisine which. can be attributed to the further and gradual diffusion of the table manners of the former court nobility at Versailles. Horowitz 1975a) and mass consumption than the model which was originated at the court. and of which the establishment of the modern restaurant is a good example (see Mennell 1985: 135–43). too. The methods used in early modern advertising provide an interesting example of this fact: the prominent figures (earls. The emergence of a new commodity market. 1982 and Campbell 1987). One can. who. one of the creators of modern French restaurant cooking. and it shared more of the properties of a mass fashion (cf. the new democratized luxury was quite different in character from the upper-class paradigm (see Williams 1982: 11). and regulated the renewal of food culture in Europe and North America.) recruited to guarantee the goodness of numerous products in advertisements. Novelties were demanded at food markets. princesses. were little known before advertising made them so (see Richards 1990: 84). It would seem to be this ‘chronic’ demand for novelty which is typical of modern consumption patterns alone (cf. with some reluctance. centreless universe’. was already shaped by the new market forces. etc. Applied to the case of French cuisine. would seem to demand another kind of theoretical approach. 27 . McKendrick et al. agree with Rosalind Williams (1982: 57) that the ‘heliocentric world of consumption’ had already started to be replaced by ‘a vast. or to any similar process of competition and emulation.PHILOSOPHICAL AESTHETICS century. Even within food culture. which still openly copied many of its models from the high society – and produced mainly kitsch – was rather an intermediary form before the development of a full-fledged democratized mass fashion. thus. after the revolution. The fashion mechanism of the late nineteenth century. over the determination of the good or legitimate taste. Similarly. This view was aptly summarized by Quentin Bell’s classical study On Human Finery: in any stratified society you are almost certain to have a classification of dress. The analyses that understand consumption mainly in terms of a ‘social identity model’ (cf. in which social esteem is at stake. and in this situation you ‘fashion’. it has been argued that the understanding of modern consumption as a game of distinctions and distinction strategies is often associated with a conception according to which lifestyles and tastes are hierarchically ordered and determined by the social position of their representatives. as understood by Georg Simmel. to challenge the situation of its social superiors by adopting that form of dress which in principle was reserved for its betters. social classes are waging a continuous struggle. perpetually striving after improvement. only has to claim that it is something new and different from the old. however. the new taste must always be understood to be totally opposed to the old. Warde 28 . more sumptuous than the hoi polloi. Fashions are class fashions almost always originating in the higher echelons of society. the upper ranks being. of course. demanding hegemonic position in culture. whereas a fashion. problematic. for instance. In such a theoretical scheme. In both cases you have a situation in which it is possible for the lower strata to compete with the higher strata. Tastes are class tastes. In a society conceptualized along these lines. The legitimate taste of a society is identified with the taste of its ruling class. fashions and styles.PHILOSOPHICAL AESTHETICS From the social hierarchy of tastes to mass fashion In the above discussion. the lifestyles of the members of a social class are more or less homogeneous. in the sense of incessant fluctuations. the modern hedonistic consumer is understood to be a relatively new historical phenomenon with a narrow social basis: the new hedonist is a member of the new middle class. Such an ‘aristocratic’ society would tend to be rather static and its consumption patterns more conformist than creative and dynamic. The pattern of social emulation leads to a process of the continuous refinement of taste and to the development of more subtle classifications rather than to the emergence of radically new tastes. (Bell 1992 [1947]:113) As far as modern mass consumption is concerned such a theoretical perspective is. Lyotard 1988: 38). Fashion does not have to decide ‘whether to be or not to be’ (Simmel 1986: 47). in effect. After all. to analyse the dynamics of consumption and the social institution of fashion together with the processes of taste without postulating any hierarchically ordered lifestyles and tastes.PHILOSOPHICAL AESTHETICS 1991) often fail to allow for the main characteristic of modern consumption: the continuous demand for novelty and the resulting dynamics of consumption and production expressed in rapid stylistic innovations. is whether this ‘generation’ or ‘class’ was the first hedonistic generation of consumers. Such a consensus. McCracken 1988. it is rather allusive and elusive. Like fashion. impossible demands’ entered the consumer market. combining both life and death.’ What can be seriously questioned. As Wark (1991: 64) has put it: ‘It was. can never be actualized. cf. It would also seem to be quite reasonable to claim that an important change took place in consumption patterns in the 1960s when a new post-war generation of young consumers – the ‘new hedonistic middle class’ – with its ‘unpredictable. or the ‘Republic of the United Tastes’ (cf. (Lipovetsky 1994: 45–6) There is another approach in understanding modern consumption and the social significance of taste which would seem to be more promising and in the preliminary formulation of which Georg Simmel’s and Colin Campbell’s contributions. making differences is what fashion is all about. It both is and is not! It cannot be denied that in creating his own identity a modern individual also makes more or less free and rational use of the language of the signs of goods in order to stand out from others (cf. This aspect of fashion was particularly emphasized by Lipovetsky: What caused the rule of lavish expense to turn into an excess of precious elegance? Always the same question: why the move beyond sumptuosity itself to the escalation of change and extravagance? In opposition to the prevailing theories. As Herbert Blumer (1969) suggested. It can also be argued that the mechanism of social 29 . a demand for production of difference on an expanded scale. among others. that is. also Goffman 1951). it is necessary to reassert that class rivalries are not the principle underlying the incessant variations of fashion. the secret of fashion consists of the formation of a collective taste – or as Immanuel Kant (1987: §20) would have it: a ‘sensus communis’. instant. have proved to be fruitful. however. 30 . in European history a historical stage between court society with its social competition between estates on the one hand. on the other. and the society of a fully fledged mass consumption with its developed fashion pattern.PHILOSOPHICAL AESTHETICS differentiation adopted by this ‘new class’ operated within the pattern of an ‘antihierarchical’ mass fashion from the very beginning. These commodities can best be characterized as kitsch. There was. in which consumption goods were often provided with status symbols copied from the lifestyles of supposedly more prestigious figures. however. ) It often happens that a mechanism of social comparison and competition. On the contrary. This was certainly not the first time that the corrupting influence of luxury was recognized. It is unlikely that many people thought that the common people were rolling in luxury – rather. the idea dates back to the old traditions of Roman and Christian moral philosophy. it was now increasingly seen to corrupt common people. their needs could no longer be satisfied at all: once people got what they wanted. was the fear that once liberated from their traditional restrictions. whose peace of mind might be disturbed by unsatisfied needs. John Kenneth Galbraith and Herbert Marcuse are good examples. figures in the background of these contemporary diagnoses. The distinction between genuine and artificial needs has been typical of many sociological and culturo-critical explanations of modern consumption that operate with the concept of need. their behaviour had become improper in the sense of what were the proprieties of a particular social class or estate. they would never cease to want more. As has been discussed 31 . The problem. FA S H IO N A N D T H E C O R R U PTI ON OF TA S T E How social interaction is apt to corrupt taste The discussion on luxury or unnecessary consumption – consumption that goes beyond necessities – was particularly widespread in eighteenth-century England in analyses of social problems and efforts to understand their origins. KI T SC H AN D FA S HI O N KI TS C H . The writer Smollet was one of the last and best-known representatives of this tradition (see Sekora 1977). (Vance Packard.3 L U XU RY. But whereas it was earlier thought to concern only gentlefolk. The corrupting influence of luxury was enough to explain almost any social problem from highway robbery to work-shyness to mob violence. similar to the one first identifiable in Rousseau. therefore. from his work with the same title. Such ideas concerning the fundamental irrationality of consumers’ behaviour – in the sense of ordinary economical rationality – seem to have been fairly widespread. According to them. for example) even when they could not really afford them.g. represented a taste and lifestyle that was worth imitating. a good example of moralizing by means of consumption is provided by the discussion on nutritional science which took place at the turn of the century. ornaments. Levenstein 1988: 99). After the Second World War. Stuart Ewen has collected an impressive set of examples. the status symbol school of sociology describes just this situation by showing how (1) people express their personalities through symbols (mannerisms. Such status competition was apt to corrupt the taste of ordinary people. Veblen’s work The Theory of the Leisure Class (1961 [1899]) was a classic in this discussion. although their nutritional value – particularly in proportion to their price – may be low. dress. Because of this. These foods. Nutritional advice about how to choose foodstuffs in each income group in order to ensure a healthy diet remained ineffective for this reason. What was worrisome was that American workers tended to buy these foodstuffs (such as steaks. which shows how this angle was shared by both the cultural critics and the marketing and advertising people of the time. people tend to buy objects that symbolize their effort to climb up the social scale (see Ewen 1988: 123). Both groups shared the conviction that – as Fortune magazine put it in the 1950s – a substantial part of the American population now had the real possibility to choose an entire lifestyle relatively freely. property) rather than through words. 32 . and how (2) most people are increasingly worried about what other people think of them and their social status. Vance Packard (1960) became known for his term ‘status seekers’.LUXURY. In the United States. In his work All Consuming Images (1988). Edward Atkinson summed up the ideas of many of his colleagues by saying that the only way to change the Americans’ eating habits was through the stomach of the upper classes (see Levenstein 1988: 47). The concern over the corrupting influence of ‘misplaced social pride’ on taste and its harmful consequences to national health appears to have been widespread among the early nutritional scientists (see e. But they clearly also found a response in Europe. therefore. particularly in the United States both at the turn of the century and again in the 1950s (see Riukulehto 1995). just because the upper classes ate them. According to the magazine. KITSCH AND FASHION earlier. certain foodstuffs and dishes have a high value as social symbols. based on the differentiation between the form and content (or function) of the product. the technical planning and manufacture of a product became almost completely 33 . These status symbols are efficacious only insofar as there are restrictive mechanisms limiting their ‘fraudulent’ use (see also Fisher 1986). By fraudulent Goffman meant that members of a society can no longer be certain that ownership of these symbols deserves a certain level of status (see also Dawson and Cavell 1986). Ewen. the new middle class. Once the ‘refined taste’ has been adopted by the lower echelons of society (in Bourdieu’s case. they could not possibly ‘trickle down’ the social ladder. generally adopted by sociologists from Georg Simmel and Norbert Elias to Vance Packard and Pierre Bourdieu. when the idea of design in industry came to denote the decoration of the surface of artefacts with ornaments and other adornments. very widely spread among intellectuals during the ‘Gilded Age’ in the USA. even went so far as to claim that all sectors of consumer goods manufacturers began to furnish their products with easily recognizable status symbols during the 1950s. (A good deal of the Veblenian critique of ‘conspicuous consumption’. the most refined version of such a theory is offered by Bourdieu (1984). Ewen may be interpreted to mean that this was a kind of logical conclusion to the process that had begun sometime in the 1830s. is actually directed against such a fraudulent use of status symbols. starts from the presumption that goods are primarily appropriated as status symbols. In this process. As has already been pointed out. but there are several others. The most obvious one is their money price. and ability to family history.) In Goffman’s analyses of status symbols there are different mechanisms that can limit the inappropriate use of such objects. the dynamics of cultural change and fashion can best be explained by the eternal flow of status symbols – and tastes – along the social ladder. KITSCH AND FASHION According to Goffman’s (1951) classical thesis – still widely referred to among consumer research literature – goods may be said to take the properties of status symbols if the purchase of them is indicative of membership in a particular status group. who himself adopted the ideas of the social status school rather uncritically.LUXURY. ranging from time. In addition. The sumptuary laws of the mercantile state were an obvious example of such restrictions. the ruling class must invest its financial or cultural capital in new signs of distinction. it also presumes that their ‘fraudulent’ use is the normal case: if the restrictions limiting the appropriation of status symbols are too strict. In his opinion. social skills. in particular). The theory of class fashion. where the new building technology (the walls were no longer primary structures) had made the façade in a way constructionally unnecessary and thus able to provide a mere surface for ornamentation. The endless variety of fronts presented by the better class of tenements and apartment houses in our cities is an endless variety of architectural distress and of suggestions of expensive discomfort. the dead walls of the sides and back of these structures. has been especially effective in the development of architecture. Social competition produces beauty which is not real beauty. It would be extremely difficult to find a modern civilized residence or public building which can claim anything better than relative inoffensiveness in the eyes of any one who will dissociate the elements of beauty from those of honorific waste. According to Ewen. (Veblen 1961: 115) Why do the standards of the respectability of the leisure class become the general standard of decency? Veblen agrees with Rousseau that social competition creates something artificial in people. That is why they become superficial and artificial. KITSCH AND FASHION separated from its decoration. and manners which are not decent. Veblen’s (1961) criticism of contemporary architecture is characteristic in this respect and still makes altogether hilarious reading: This process of selective adaptation of designs to the end of conspicuous waste. they can never really do so properly. taste which is not good taste. are commonly the best feature of the building. On the one hand. In Veblen’s case. Veblen seems to share the rather prevalent view that when lower classes and the nouveau riche try to imitate and adopt the manners and taste of the upper class. Considered as objects of beauty. 34 . the question is not so much the deformation of needs as the corruption of taste and beauty. left untouched by the hands of the artist. and the substitution of pecuniary beauty for aesthetic beauty. Contemporaries felt that the paradox was particularly evident in architecture. this separation of form from content was the peculiar paradox of nineteenth-century capitalism (see Ewen 1988: 33). Veblen’s Theory of the Leisure Class (1961) is hopelessly obscure in many ways and it combines several different themes of criticism.LUXURY. Traditionally. proof of the family’s wealth. Rich people are respected by everyone. In addition to this ‘pecuniary sense of beauty’. and this is what their sense of their own worth is based on. According to him. who. but rather that the upper ones should be lowered (see Simmel 1950). however. housewives have taken the place of servants as an indication of social respectability. For wealth to be evaluated and estimated. makes him conclude that the more expensive an object is the more beautiful and desirable it is considered.e. genuine beauty. after all. that people value wealth and money. for example. i.LUXURY. This conception of Veblen’s becomes particularly manifest in his studies on fashion. as are kept as proof of their masters’ wealth and leisure. the more necessary pecuniary power becomes. do not so much carry out necessary tasks and services. namely that middle-class husbands are prepared to work themselves to death (at the risk of a coronary) to support a respectable home. wealth is not an absolute but a relative measure of value: an individual’s value is determined in comparison with that of others. in fact. A mere bank account or share portfolio is not a very good investment in this respect. a contemporary of Veblen’s. in principle. it can never be satisfied and it surpasses all other motives of acquiring and accumulating goods. On the other hand. Veblen writes that refraining from work is a conventional sign of high social status. expressed this concern of many critics of mass society by saying that equalization does not generally mean that the lower classes should come closer to the upper ones. which aims at revealing the fact that pecuniary beauty is not. Among those whose lot it is to work in order to meet the immediate necessities of life. a hard-working person is also respected. an individual’s moral and aesthetic value is always determined on the basis of his or her wealth in society. The basic elements of Veblen’s thinking are rather simple. a 35 .. inborn sense of beauty. Ehrenreich 1983) which Americans have long persisted in sharing. people generally have another. However. It has also been associated with the idea of a respectable and proper way of life. but the more work loses its essential nature. according to Veblen. Another relatively visible indication of pecuniary power is the employment of domestic servants. The desire for wealth is infinite. according to Veblen. In the modern middle class. KITSCH AND FASHION Georg Simmel. The head of the family’s ability to support an idle wife is. leisure time has been such a visible indication of wealth. it must be visible. Veblen’s basic starting point. or in his term ‘pecuniary power’. be regarded as the originator of an idea (cf. Therefore. Veblen may. people value wealth and power based on money. Knowing one’s etiquette and manners as well as taking an interest in art and sport. because good building requires time. All the manifestations of leisure time that aim at showing pecuniary power are called. According to Veblen. The more time-consuming certain manners or hobbies are. and its manner of life and its standards of worth therefore 36 . During leisure. consequently. application and expense. indeed. but rather those of the group directly above them. no work is done and. They are all forms of waste. and children. Veblen presents very clearly the way in which the taste and etiquette of the upper class become prevalent in society. the ultimate object of all respect. so modest and realistic that they do not all aim at adopting the taste and manners of the social elite directly. and can therefore not be compassed by those whose time and energy are taken up with work’ (Veblen 1961: 38). Social groups or classes are. ‘Refined tastes. sport or even race horses. nothing is produced. are in themselves a sign of wealth. a common standard of good taste which everyone tries to adopt. manners and habits of life are a useful evidence of quality. trimmed lawns. a wife who stays at home. the higher their social respectability and reputability. leisure also has a more indirect significance from the point of view of the development and popularity of the standards of social esteem or taste – or respectability. They are socially respected. etiquette and factors which have to do with outward appearance and which express the individual’s habitus was presented by Bourdieu (1984). During leisure. but it is not the same thing as inactivity. a hierarchic. Veblen sums up his own view in the following words: The leisure class stands at the head of social structure in point of reputability. In this way. which again is a direct indication of wealth and as such. etiquette. people are busy with quasi-aesthetic achievements and such ‘tasks’ as have nothing to do with supporting life as such: art. as we have seen. KITSCH AND FASHION house in the suburbs. legitimate taste and cultivated manners require time (and this. by definition. in Veblen’s terminology. because the acquisition of these hobbies or the skill and ability to know how to behave and dress requires leisure. is what makes them respectable). The idea of the significance – in the system of social distinctions – of manners. multi-graded system of tastes and manners is created in society. Even according to Bourdieu.LUXURY. however. but it is directly related to Veblen. for example. conspicuous leisure. however. But many forms of consumption which appeared as luxury at first. Consequently. may have been used as an indication of social superiority. according to Veblen. waste and luxury do not only involve everything that is not shared by all (in shared consumption. The result is that the members of each stratum accept as their ideal of decency the scheme of life in vogue in the next higher stratum. becomes incumbent upon all classes lower in the scale.LUXURY. In modern civilized communities the lines of demarcation between social classes have grown vague and transient. Workers. (Veblen 1961: 63–4) In modern society. Like nearly all theoreticians of consumption who operate with some notion of luxury. part of necessary consumption. even Veblen becomes confused in his attempts to define what really belongs to conspicuous consumption. it is increasingly replaced by conspicuous consumption or such buying and accumulation of goods as only serves the ‘need’ to display. in a way. historically determined and therefore relative. even according to Veblen. luxury only belongs to the leisured class. as an indication of social value. Colin Campbell (1994) has pointed out how this puts Veblen’s example of an American millionaire who donates money to a hospital or university into a 37 . Veblen also claims that even all the consumption that has become common and ordinary is indeed waste and can be historically deduced from the habit of making pecuniary comparisons aimed at creating envy and achieving esteem (see Veblen 1961: 75). Therefore. luxury and – consequently – waste. slowly become common and thus.1 However. at some time in history. First. no one can be in a better position than the other) but also everything that. in some degree of approximation. KITSCH AND FASHION afford the norm of reputability for the community. In these conditions it becomes difficult to notice leisure. he claims. and bend their energies to live up to that ideal. people become anonymous and their encounters are often short-lived and sporadic. Veblen sets another condition to luxury: it must not serve human well-being as a whole. This would seem to refer to the fact that whatever is considered necessary or at least important in society at any given period of time is. and wherever this happens the norm of reputability imposed by the upper class extends its coercive influence with but slight hindrance down through the social structure to the lowest strata. obviously. The observance of these standards. only consume what is necessary. because as far as the objects purchased express. Yet if this is so. but the matter is not so simple as far as manners and hobbies are concerned: one does not become a good golfer overnight. is in principle guilty of similar waste as the millionaire mentioned above. KITSCH AND FASHION strange light: Veblen had thought that this was an example of the same kind of conspicuous waste as keeping a personal servant. or are part of. however. Conspicuous waste is a problem. on what grounds could Veblen then criticize the ‘unnecessarily’ ornamental façades of buildings? Why are they not really beautiful. ostentatious. if anything expensive is indeed considered valuable and beautiful? In emphasizing that the desire for wealth is limitless and in considering any consumption that goes beyond the merely necessary as waste. pay much attention to such things. Veblen has often been interpreted as if the objects of his implicit criticism were. The wide scope of Veblen’s concept of conspicuous consumption also becomes clear from his other famous example of an itinerant journeyman printer. or buying a new car every year. which in fact serve the same purpose.). And then it should follow that the one who gets the most respect is the one who uses his money in the most useless. banquets. even if one has the leisure time required for it. they tried to find a short cut to a respected social status by acquiring certain visible and conspicuous signs of a high social position (there is the typical example of a millionaire who buys a castle in France and has it put up in the middle of his farmland in Texas) or mannerisms (butlers. Like all people who have suddenly become very rich. in fact. Anyone who has money can buy things. conspicuous and therefore wasteful way. From his own starting point. Veblen does not 38 . the nouveau riche of the end-of-the-century United States. who only meets people accidentally and for short periods and who for this reason. it should be only the amount of money and waste that determines who is the most respected and esteemed person in the country. Veblen’s indignation or irony would appear to direct itself rather towards so-called conspicuous consumption than to a life of leisure and good manners. for example. however. a more or less comprehensive way of life or style – such as a knight’s castle – just buying things is still not enough to guarantee social esteem: you have to know how to consume them and use them: for example. in Veblen’s experience. Veblen himself does not. too. in particular. is particularly generous in buying drinks for his mates at the bar: he.LUXURY. how to use the golf club. etc. We can only guess that something like this must have been going on in his mind. LUXURY. In spite of our inborn sense of beauty our objects are not getting more beautiful As was mentioned above. talking about the development of culinary art. people have. Overeating is no longer waste or luxury if all. especially the United States at the turn of the century. it was only towards the end of the century that a clearly distinctive upperclass culture was born – or rather. The link between beauty and price is certainly not conscious. which could not be entered just by paying the price of a ticket. anything hand-made is not only more expensive but also more beautiful than an object made mechanically. We do not at first look at the price tag and then 39 . forcibly made to develop – in the United States. the qualitative possibilities were inexhaustible’ (Mennell 1987: 389). it is often thought that small quality-based distinctions become important indications of social respect. Veblen is not that vulgar. but also required the ability to dress for the occasion and display acceptable behaviour when in the presence of such great art. As Stephen Mennell says. according to Veblen. two senses of beauty: pecuniary beauty and what could be called genuine or inborn beauty. KITSCH AND FASHION have to postulate such additional conditions which are typical of many later scholars who follow the Veblenian line of argumentation: as wealth becomes more widespread in society it becomes more difficult to show off with simple amounts. Besides. because there was no upper class consisting of old aristocracy which could have acted as the proper role model for good manners. The more expensive an object is. But now Shakespeare was transferred to separate theatres. Consequently. is considered the epitome of nouveau riche vulgarity. ‘when the possibilities of quantitative consumption for the expression of social superiority had been exhausted. The popularity and widespread adoption of the cultivated and fine cuisine created by French culinary art in the nineteenth-century ‘civilized’ world has often been said to be based on this phenomenon. It is probably no surprise that Northern America. In a situation like this. the more beautiful it is generally considered. of the population are guilty of it. which was interspersed with occasional vaudeville song numbers. if we can believe Levine (1988). To use Levine’s example: the rich and poor alike once sat in the same tent or saloon – even if on differently priced seats – for a performance of Shakespeare’s King Lear. to replace the existing relatively homogeneous culture. or at least a major part. This. visible – but Veblen sees fashion in other areas as well. outrageous and grotesque. it only followed the other principle of beauty. Fragile. Dressing is a major forum of conspicuous consumption – it is. the product is useless even if it is still in perfect condition (see Veblen 1961:132– 4). the physical characteristics related to it no longer have the same importance as before. obviously. If.:133) 40 . in fact. This is important from the point of view of Veblen’s rather peculiar description of the mechanism of fashion (see also Wilson 1985: 52). In fashion. Fashion is a typical form of waste. Yet besides this. it is a question of the interaction of these two different principles of beauty. the objects we use would become more and more expensive. however. such things are beautiful. properly – beautiful from this mere ‘pecuniary beauty’. ethereal women with narrow waists are likewise more beautiful than robust women who are capable of work. The link is more subtle and more unconsciously made. however. therefore. Veblen has many funny and more or less telling examples of this. above all.LUXURY. this immediately reduces its aesthetic value. which is why we generally consider a race horse as more beautiful. again. (ibid. although it may be difficult to tell them apart with the naked eye. Veblen calls this concept of beauty pecuniary beauty. which is why natural taste corrects the excesses of fashion from time to time as something inherently repulsive to it: Our transient attachment to whatever happens to be the latest [in fashion – J. If fashion only followed the principle of pecuniary beauty.] rests on other than aesthetic grounds. It leads to a faster exhaustion of products: when the style is out of fashion. Fashion involves a permanent variation between these two principles. and lasts only until our abiding aesthetic sense has had time to assert itself and reject this latest indigestible contrivance. has never happened. G. is beautiful. Even pedigree dogs and cats may be of use as domestic animals. A lawn mowed by a gardener is more beautiful than a pasture. it would gradually lead to the perfection of beauty. too. Changes in fashion may. our natural pursuit of beauty. KITSCH AND FASHION decide how beautiful a product is. result from other things. What is expensive. If an object has some practical use in addition to its duty to be aesthetically pleasing and ornamental. losing its importance: as leisure has become common among women of different social classes. Veblen’s examples related to female beauty are more conventional: since it is impossible to work wearing high heels and a corset. This difference is. people also have the ability to distinguish something that is truly – as it were. slightly different. see also Norbert Elias and Mennell) – which were probably also directly influenced by his ideas.2 Vulgar taste is born when consumption and consumer goods become more and more important status symbols and yet anyone can buy them – as long as they have enough money. As Molière knew. If this is what Veblen’s criticism is actually all about. Veblen’s analysis resembles many later studies of social competition. In this. They become in a way freely exchangeable and movable signs of lifestyles and social value (cf. At any rate. This is exactly what creates the powerful impression of superficiality and tastelessness. Although what is expensive is also beautiful and even respectable. Goffman 1951). however. and the result is what Campbell (1987) called aristocratic aesthetics. 41 . it is not really so. on the contrary. We might well say that Veblen has created a theory of kitsch and kitsch fashion.LUXURY. described by Veblen. after all. because the upper class is always committed to distinguishing itself from the lower classes which are trying to imitate it. The others – we might perhaps even talk about a European tradition here – emphasize how the competition over social respect related to different lifestyles is apt to improve and cultivate taste. a genuine nobleman is always more honourable than a nouveau riche millionaire. As was pointed out above. emphasizes another aspect of the same thing. distinction and valuation (in addition to Bourdieu. it is. And apparently the money or time put into learning good manners – when it is not only a question of imitating but of a genuine integration – is valuable and. it seems that Veblen’s critical comments on conspicuous consumption and waste are fundamentally based on the idea that the principle of pecuniary beauty leads to excess and grotesque manifestations (not only in fashion but elsewhere too) which our natural sense of beauty tends to reject. Veblen. even if the latter has more pecuniary power. worthy of higher social respect than wasting money in buying all kinds of things. leisure and the manners and quasiaesthetic hobbies related to it are not as clearly an object of Veblen’s scorn as a millionaire living in an expensive but tasteless house and offering expensive but tasteless dinners. relatively conventional. this separates them from their original link with lifestyle. ultimately. small differences of quality and style become important. or at least not always and everywhere. Taste becomes vulgarized as the standards of good taste are lowered in the social hierarchy. KITSCH AND FASHION All in all. Veblen’s emphasis is. empire. for example). suddenly arisen need. placed on the mantelpiece or shelf. which are a classic example of an ornamental object commemorating a particular institution. and decorated with all kinds of symbols and emblems of the queen and her reign.) In this more limited sense of a souvenir. they keep the memory of a ceremonial moment or institution. the miniature copies of the Eiffel Tower.LUXURY. Richards’ more narrow 42 . As Richards’ examples show. . monarchy) for middle-class home use. who analysed the material culture of nineteenth-century Britain. the pure. kitsch proliferated particularly in conjunction with the great World Exhibitions of the last century. according to Richards. What makes an object kitsch is that it is a cheap. ‘In various guises our idea of kitsch comprises every article that was ever exhibited in the nineteenth century and signifies our determination that Victorian commodities are no longer capable of performing the cultural work they once did’ (Richards 1990: 91). (Cf. In their more limited sense. kitsch objects have been designed to satisfy a momentary. But why should this have happened to many of the products of the nineteenth century in particular? According to Ewen. state. . Kitsch is a short-order charisma .e. be characterized as follows: ‘Kitsch may be defined as elaborately aestheticized commodities produced in the name of large institutions (church. ’ (Richards 1990: 88). They are commemorative and ornamental objects which are useless in themselves. all knickknacks and different ‘useless’ memorabilia produced in honour of Queen Victoria’s Jubilee Year. classic example of kitsch is the so-called Jubilee kitsch. 1887. Kitsch would in this way relate to all the objects whose cultural significance has in some way become incomprehensible and strange to us. yet at the same time make it trivial by turning it into an article of daily use (a provincial coat-of-arms reproduced on the handle of a spoon. For Richards. kitsch can. KITSCH AND FASHION Why does the entire material culture of the late nineteenth century create an impression of kitsch? One way of approaching the rather obscure phenomenon called kitsch is to say that we often have a feeling that almost all the material culture of the nineteenth century – or of the England of the Victorian era at least – was kitsch. kitsch is related to the products of last century. mass-produced copy of some original object or model which was considered elegant. especially those that were imitations of elite style aimed at the middle class and produced by mass production (see Ewen 1988: 64). i. was in a sense more realistic and far-sighted than many contemporary artists or designers. ‘Novelty is a universal cry. for example. Their express purpose was to improve the taste of both designers and consumers and. was kitsch. These movements of art reform in the nineteenth century can well be seen as an early movement of critique of consumption – or even of consumer policy. As McCracken (1988: 94) has pointed out. Escoffier. He seems to have been better aware of the laws of the marketplace and the importance of fashion in his statement that in modern times. launched his new style which was more rational in preparation and less ornamental in style. Escoffier. was based on the belief that consumers. which led to ostentatious showing off with goods. or at least threatened to destroy it. however. The war against kitsch in the name of democracy At the beginning of this century. This is why they feel like kitsch – somehow artificial and superficial. often simply created by the fact that the models in question have been removed from their original context. blinded by social respectability. He was clearly inspired by the same spirit as the one found in many better-known representatives (such as William Morris) of fields that were more traditionally perceived as design or arts and crafts. foods and dishes had to satisfy the requirement for novelty and variety above anything else. to make everyday life more aesthetic.LUXURY. KITSCH AND FASHION categorization of kitsch makes it possible to understand the phenomenon more widely. imitated those above them. to make consumption more democratic. What had destroyed that taste. The art industriel movement wanted to turn articles of everyday use into objects of art and. it was 43 . The impression of kitsch is. at the same time making it more trivial by making them accessible to anyone who can afford to buy them. according to these critics. in this way. it is only relatively few products that act as status symbols at any given time. the creator and developer of modern French restaurant cuisine. At the same time. mass-produced articles of daily use (such as dinner sets or furniture) which imitate the earlier elegant models and styles also borrow from the ‘charisma’ attached to the way of life of the nobility. which is one of the reasons why their programmes were never carried out widely enough for them to have been able to change ordinary people’s sense of style and consumer habits in any essential way. however. whose popularity. in this way.’ This was generally ignored by the reformers of art. Ordinary. which craved prestige by means of imitating the style of the elite. This wrong aestheticization and ornamentation was represented by the typical industrial design of the time and the prevalent style in the production of mass consumer goods: it consisted of ornamentations and decorations freely copied and superficially added to anything from dishes to building façades. physical needs. was the power that made the designers continue to design and the buyers continue to buy kitsch? Why did artificial ornamentation often seem to gain 44 . A typical representative of this cause was Camille Mauclair. in its essence. and who was active in Paris towards the end of the nineteenth century. The purpose of the art social programme was a kind of democratization of luxury by means of a democratization of art. those that were shared by all and sundry. The first thing to do was to liberate consumption from its dominant aristocratic mentality. or perhaps rather the extinction of all luxury as useless and unnecessary. This principle of the appropriateness and usefulness of objects was. an aesthete excellently characterized by Rosalind Williams (1982). the aestheticization of objects of use was considered possible in two opposite ways: When art is attached to concrete. The basic need of consumers had to be brought to light and they were to guide design (see Williams 1982: 164). then. Disgust at anything ornamental. respect the needs that were shared by all. fanciful or exotic was in this way not only an aesthetic but also a social question. the beauty of an object could be reduced to three principles: it should be modern. where again beauty may be added either by an ornamentation which hides the function of the object or by giving it a functional form reduced to style. Popular taste must be liberated from the corrupting influence of the bourgeoisie. where the cultivation of taste ultimately served the cause of social justice. According to this thinking. after all. the integrity of objects was based on their ability to satisfy everyday human needs.LUXURY. According to Mauclair. As Georg Maag has pointed out. KITSCH AND FASHION obviously directed against another way of making everyday life more aesthetic – one that it considered wrong. appropriate and democratic. It was the appropriateness of the object that was to replace prestige as the general principle governing its design. democratic – it did. its primary manifestation is l’objet d’usage. What. (Maag 1986:71) Art industriel was also a movement of art social. people did not put their money into opting for this kind of beauty. decent way of life guaranteed by corporations. had to be re-established (see Ewen 1988: 13). First. which continued to prefer kitsch to modern design. as a consumer. A mere consumer reform was bound to fail. moral art education. many of the objects which were in accordance with the new design. soon turned into objects of art and 45 . the virtual annihilation of all modern mass production and the re-establishment of a secure. besides a moral education of the modern consumer. one where the consumers themselves could participate in the planning of the products. and were meant as objects of use. the purpose of which had been the aestheticization of modern mass production and everyday life. The reason for a corrupted sense of beauty was the separation of both spiritual and manual labour from consumption and production. Mauclair ended up by demanding a completely new. That was the reason why most modern architecture only consisted of ‘imitations of imitations of imitations’. The democratic reform of art. It is only by making things oneself that one can learn to appreciate beauty. The reformers were repeatedly disappointed in people’s taste. thus ended up by demanding. again. the separation of manual and spiritual labour had corrupted people’s taste. KITSCH AND FASHION the upper hand in the contest over the consumer’s soul? According to Mauclair. the whole era had to be redefined in a completely different way and the unity of thought and action. found a very similar solution. a consumer. consequently. in his rejection of social anomie. Only corporations could control lifestyle and consumption in an effective way. Morris ended up by admiring gothic style and the ancient English community. as Rosalind Williams (1982) has pointed out. Mauclair. as well as design and material. This central problem of modern life cannot be solved only by finding a style suitable for the modern era. model and its representation. Raising the useful and functionally appropriate to the highest aesthetic principle and seeing it as the guideline of modern design produced results that were paradoxical in two ways. can never adopt an aesthetic taste (see Williams 1982: 177). as did Emile Durkheim. Even in William Morris’ thinking. In addition to that people again had to be able to make their own articles of everyday use in small workshops. According to Morris. the models produced by it could not be modern. the final reason was that planning itself was not democratic and. a contemporary sociologist.LUXURY. the re-establishment of the unity of consumption and production – and the creation of a new morality related to it – required a revival of the trade guilds. Besides. With the lack of more exact studies of material culture. Second. 1982). As such. the reformers actually came to demand the annihilation of this aesthetic dimension and turned objects into mere instruments in the satisfaction of needs. when Queen Victoria herself often appeared in advertisements as the role model of 46 . Objects were seen primarily as representing social status to the consumer and containing the promise of a social climb. KITSCH AND FASHION collectors’ items. Wedgwood’s china factory manufactured its products in different series. stating in its advertising that the set already decorated the dinner table of Lord or Lady So-and-So (see McKendrick et al. there is a major paradox in the basic starting point of the whole art reform. Yet it has never been the only or even the dominant form of advertising. As is shown by Richards’ study. on the other hand.LUXURY. it is difficult to say to what extent such points of view were really taken into account in planning and manufacturing products. If the product was sold. that this kind of advertising became more common in the 1920s. this type of advertising seems to have been fairly common in England at the end of the century. they again became inaccessible to the ordinary consumer and acquired their value and price from the aura of high culture. Daniel Pope (1983). however. Wedgwood marketed a less expensive version of the same product to the middle class and bourgeoisie. Those who were responsible for marketing the products. By demanding that consumers assume the producer’s perspective in their material object environment. among others. The perspective of object culture which aims at aestheticizing articles of everyday use is the consumer’s and not the traditional producer’s perspective. as had decorative everyday art before them. when the emphasis was more generally shifted from productoriented to more personalized methods. a historian of advertising. The earliest known marketing strategy based on this thinking dates back to the middle of the eighteenth century. and to what extent the producers actually furnished their products with such status symbols. Misplaced social pride corrupted taste. says. seemed to have adopted the idea quite widely as a useful strategy of sales promotion by the end of the century at the latest. Marketing kitsch What early ideologists of industrial art and early sociologists criticized in the mass consumption and style of consumer goods of the turn of the century was that it emphasized social hierarchy based on money and wealth even in material culture. offering the first to the upper class as an ‘option to buy’. see King and King 1980. where the elite class attempts to differentiate itself by means of visible signs. and this is the basis both of the more or less rapidly spreading fashion and the fashion cycles in society. evident that sociologists have found it very difficult to consider this simultaneous identification and differentiation without considering some kind of hierarchy attached to it. rather surprisingly. a theoretician of the turn-of-the-century mass society. many prominent figures who advertised the various products were not all that well known until they became so thanks to the advertisements (ibid.: 84). however.LUXURY. Blumer. the one who has most clearly emphasized the difference between mass and elite fashion may.3 Herbert Blumer (1969) was one of the first sociologists to emphasize the democratic aspect of fashion and its independence from class hierarchy: the mechanism of fashion even acts against the hierarchies. tries to identify itself with the elite by adopting these signs. in fact. it does inevitably smuggle in a kind of concept of hierarchy even in Blumer’s framework. The lower class. But as Richards also points out. there is a prevailing conception among sociologists that fashion ‘is born as a form of class differentiation in a relatively open class society. such as certain distinctive ways of dressing’. Kitsch as a historical stage between class and mass fashion As Arto Noro (1991: 66) has pointed out. Although this prestige does not have to be linked with people’s class status. be Horowitz. who speaks 47 . In fact. mentions a condition that would seem to be in conflict with his own ideas.) Of all fashion theoreticians. When studying the conditions in which fashion may appear in some particular field. as he is obviously afraid that it would only lead to the old vision of class differentiation (see Noro 1991:104). It is. The fifth condition of fashion in his list is that there must be such prestige figures in the field that are acknowledged to be capable of evaluating the value and appropriateness of competing models (see Blumer 1969: 286–7). the paradoxical pair of concepts introduced by Gabriel Tarde (1962 [1890]). KITSCH AND FASHION (women) consumers (see Richards 1990: 91–104). (For a discussion of the role of fashion innovators – or ‘fashion change agents’ – in contemporary clothes fashion. as it may be based on other kinds of models as well (such as film stars or beauty queens). Blumer does not emphasize the role of fashion as a mechanism of differentiation at all. for its part. A good example of this is ‘imitation without a model’. : 289). In thus moralizing modern consumption.LUXURY. Although these different types of fashion may exist simultaneously. in fact. of those women who accepted their “betters” as their reference group’ (ibid. they would inevitably decrease in value. even though they are. at least in principle (see Horowitz 1975a: 290). imitates highly valued models. down the class pyramid. on the contrary. and who were at the same time afraid that this would lead to a vulgarization of taste. It is obvious that it is this historically specific form of fashion that has been in the minds of many sociologists and cultural critics who have presented theories of fashion and consumption – and who have been discussed earlier – acting as a kind of general model of fashion for them. Examples of this are boutiques which emphasize the uniqueness of the products they sell and the individual nature of those who wear them. has to do with products aimed at mass consumption. however. semi-mass fashion can be considered a new kind of phenomenon that has grown on mass fashion but resembles elite fashion in some respects. elite fashion that is historically the earliest form. If they became more widespread. is limited) and they have been directed at a selected group of consumers. were in fact studying kitsch fashion. we may recognize both the wise old saying that everyone should live in a way that is 48 . kitsch can now be interpreted as an intermediary stage between elite fashion and democratic mass fashion. do not represent the upper class or elite of society. Age groups are often important factors of differentiation in the mass fashion of clothes (see Horowitz 1975a: 289). in particular. Mass fashion. seem that many of those who thought that fashion spreads in society from the top. ‘The basis of the communication of elite fashion to wider groups in the society was essentially a process of imitation which reflected the social aspiration. elite or class fashion is characterized by the fact that it tends to strengthen status differences. as there is a limited number of products (or their availability. These models.4 Historically. indeed. According to Horowitz. and expresses a pursuit of conformism. however. at least. accessible to all consumers. and in doing so. They are as genuine as the King of Denmark’s Chest Lozenges in Finland during my childhood. Horowitz emphasizes the different spreading mechanism of this fashion as compared with modern mass fashion. It would. KITSCH AND FASHION of clothes fashion. It resembles class fashion in that it operates with status symbols emphasizing social hierarchy. According to Horowitz. and the fashion does not imitate the style of any existing upper class. it is. but nothing prevents us from generalizing these ideas to apply to other fields as well. What did this traditional or democratic luxury consist of? What does this paradoxical expression mean? The luxury consisted of such products as champagne. October Revolution) for a moderate price. May Day. two specific types of cakes. Most of them were available in great quantities before public holidays (New Year. caviar sandwiches. Was the Soviet Union the workers’ paradise after all? The fact that these products could be bought for the same stateregulated price 49 . or to celebrate a public holiday. chocolate and fruit. too. amber necklaces. One could add several other items to this list and the place in the process of consumption of every item could be seriously discussed. guided by rational thinking and functionalism. They are also very feminine goods. The following considerations are but a preliminary attempt at understanding Soviet consumer culture. These were all products that were especially bought to be consumed at family parties. cognac. It was in particular expressed in the numerous public and personal feasts or celebrations that were typical of Soviet life. and perfumes. Many goods sold in special state gift shops in the cities. as birthday presents. All these goods are meant to be enjoyed. When and why this luxury was invented is an intriguing problem for researchers. before the anti-alcohol campaigns. but the important thing is that there existed such a limited group of products which had preserved their status throughout several decades of Soviet history. KITSCH AND FASHION appropriate to their class (because everything becomes mediocre when spread too widely). welcome gifts for women. One could add still more. in fact. even though that would be possible for the first time now that the old restrictions have tumbled down. such as crystal glasses and vases. and the more modern concern that consumers’ choices and judgments of beauty are not. by eating. assorted chocolates. In the 1960s.LUXURY. belonged to this group. KITSCH AND LUXURY IN THE SOVIET UNION The secret of the caviar sandwich In the Soviet Union a historically specific culture of consumption was born. scarfs and fur hats. or smelling. a worker on his way to work early in the morning could stop at a kiosk and enjoy a glass of champagne and a caviar sandwich – a pleasure of which workers in the capitalist world could only dream. Democratic luxury was an essential part of the everyday life of the Soviet people. drinking. (In the 1930s. which were enjoyed by a wider circle of people. extending the political elite: directors and leaders had cars with chauffeurs. building of new shops and cafés. It also meant that someone. Parker pens and imported cigarettes played a similar role in Soviet culture. too. These luxury goods were by no means all that was regarded as luxury – in the sense of transcending everyday needs – by the Soviet people. buy products of foreign origin. As early as the beginning of the 1930s special shops were opened to serve a privileged clientele. from Archangel to Odessa. and that their range was kept more or less intact from year to year. summer villas. Almost any foreign and imported goods were turned into a luxury. not only of the rather narrow political elite.LUXURY. vacations in health spas on the Crimea. somewhere had once made a decision about their production on a mass scale. Even though the gross value of all the cakes produced yearly within the territory of the Soviet Union was small compared to the value of the produce of bread factories. The black market trade in jeans or nylon stockings in the post-war decades are probably the best known examples of this phenomenon. but also of a rapidly growing group of ‘privileged’ people consisting of educated specialists and top workers. KITSCH AND FASHION everywhere from Leningrad to Vladivostok. difficult to achieve due to the policy of creating socialism in one country and the strong reliance on its own resources and raw materials. for instance. the reliable and centralized production and distribution of cakes demanded huge investments. For instance when a meeting of Stakhanovite workers was held in Moscow in 1936. factories and transport facilities. 500 cycles. In these shops one could. meant that they were an integral part of state economic planning. – later even trips abroad and access to valuta. It was almost self-evident that this was not a question of any continuation of prerevolutionary traditions or a prolongation of the culture of the NEP (New Economic Policy) period of the 1920s. They were not necessarily the most valued or cherished items either. 150 gramophones. 25 motor cycles.) In the 1930s there were already many examples of ‘real’ privileges and luxury. As late as 50 . The old and the new luxury Since the mid-1930s these real luxury goods and services were part of the lifestyle. Ordzhonikidze presented the participants with 50 cars. separate houses. 200 hunting rifles and 150 pocket watches (see Siegelbaum 1988: 228). etc. big flats in the centre of the city. foreign currency that could buy practically anything. etc. but was a reward to be earned by hard work or exceptional talents. Such ‘luxury’ products were then still relatively rare in the homes of Western Europe too. a home that could be decorated and furnished according to one’s own private taste. be bought with money (so-called cooperative houses had been built in the 1930s but this programme was rescinded on Stalin’s orders). refrigerators. KITSCH AND FASHION the 1960s such luxury belonged to one’s ‘office’. At least in principle. a small family car. (In 1940. television sets and stereo players as the United States. (For an interesting discussion of the nature of such ‘luxury’. but also – even though it was not stated explicitly – to achieve the standard and the model of Western consumption – at least in some respects.4 million radio receivers in the 38. it could not be bought with money. however. but they could. coal and electricity. New microcities (suburbs) with huge housing complexes were also built at an increasing speed to help overcome the very serious housing shortage which had worsened during the whole of Stalin’s reign. It was reasonable to believe that the gap could be overcome within a decade or two. it was estimated that there were not more than 4. New flats were often distributed according to the needs of families. a summer cottage. The establishment of the giant Togliatti car factory producing Zhigulis under licence from FIAT marked an important turn in history – and not only symbolically. It became possible to dream of buying a motor cycle. The most remarkable change in housing policy was. be remembered that in the beginning of the 1960s this aim was not as far-fetched as it was later.LUXURY. to some extent. the new target of providing every single family with a private home. At the same time. refrigerators.4 million city households in the Soviet Union. televisions and entertainment electronics in general. however. it should be able to produce as many cars. 51 .) It should. These new luxuries and the production of modern consumer goods mostly imitated in a rather crude manner the life and consumption model of the middle classes which had become common in the USA and the most prosperous countries of Western Europe after the Second World War. see Beriya 1995: 5–6. The aim of the peaceful economic competition declared by Khrushchev was not only to ‘overcome’ (exceed) the production figures for steel.) It was in the 1960s that it first faced a serious challenge. Of these the biggest part were loudspeakers tuned to receive only one radio station. a small private flat. etc. portable radios and hi-fi sets began their – at first very slow – intrusion into Soviet homes. and the property of well-to-do people. In order for socialism to prove its superiority. all the raw materials were produced in Russia. It was typical of this Soviet luxury that it was basically home-made and not imported. In any case. or in the new Soviet showpiece. They were ‘cheap’ imitations of products that had been expensive and rare under capitalism and were out of reach of the proletariat toiling under its yoke. it would have been difficult to combine these elements of a ‘good life’ with the ideal socialist way of life. Armenian cognac or Russian champagne naturally had very little in common with the drinks produced in the French départements of Champagne or Cognac. And the prices were moderate. caviar. built at the end of the 1930s. KITSCH AND FASHION The new ideal of Soviet luxury was based directly on the standard of living of the Western middle class and prosperous workers. vodka. Natsional or Prag restaurants.LUXURY. the Hotel Moskva next to the Kremlin Wall. Chocolate excluded. cognac. was not part of this luxury. On the other hand. Whereas the new was borrowed from the West. shared the aura of all foreign products. the old luxury characterized earlier was totally different. In this respect. perfume: only lackeys. If the above catalogue of luxury goods is representative at all. What made the situation rather peculiar was the fact that these were hardly the products that a wage worker living under capitalism in the 1930s dreamed of or was eager to achieve. it was in principle possible for a Soviet worker to dine à la Parisienne under a crystal chandelier and enjoy the services of a butler in a tailcoat. champagne or caviar) or from sumptuary laws (perfumes. chocolate. in the Metropol. the most popular Russian stimulant. courtesans and roulette are missing from the catalogue. chocolate). Beer is a bit more difficult to classify. the high value of which was derived from their uniqueness or rarity which in part stemmed either from ‘natural’ limitations (cognac. Therefore one can speak of a genuine Soviet culture and style of material goods. Soviet beer was not highly valued but imported beers. horse carriages. They imitated models and artefacts that were thought to be valued or belonging to the world of ‘high 52 . It is easy to see that old and ‘genuine’ luxury products had acted as models for the Soviet luxury goods. On the other hand. they represent a way of life that was lived by rich people sometime in the middle of nineteenthcentury Europe – or rather a life which the Bolsheviks thought the rich had lived: champagne. It was an everyday necessity. and it is interesting to try to analyse what kind of a conception of a good life or of luxury it expressed. like the Czech Urquell. say. the old was homemade and based on a more original conception of a good lifestyle: it did not have any existing models. They could be called Soviet kitsch. there are good reasons to believe that it was in February– March 1934. compared with their lives under the First Five Year Plan. including bread. around the time of the Seventeenth Party Congress during which the Second Five Year Plan received its final form. during the course of the Party Congress which discussed the new economic plan. The Great Retreat (1946). According to this version.LUXURY. This change also meant giving up many of the earlier basic and ‘holy’ aims of the Bolsheviks. who had made a speech the day before. KITSCH AND FASHION society’. The First Five Year Plan had been completed in 1932 but the new plan was officially adopted one and a half years later. The foundations of heavy industry had been created at great human cost. Their propagandistic message was thus obvious: they were meant to show that every Soviet worker lived like a real bourgeois or aristocrat. The great retreat When was this new Soviet luxury invented? Even if conclusive proof is not available. went back on the words of the head of Gosplan. According to Eugene Zaleski’s (1980) close examination of the conditions of 53 . in which Timasheff claimed that a major change took place in Communist Party politics and in the building of socialism in the Soviet Union. The First Five Year Plan with its programme of enforced industrialization had been ‘successfully’ completed. This was what led Timasheff to claim that a major reorientation had taken place in the politics of the party. and set new economic policy tasks and aims. The deportations and famine following enforced collectivization of farming were also part of history. One can reach this conclusion by reading Timasheff’s famous work. the minister of heavy industry. The rationing of basic provisions was cancelled first in 1935 – only to start again after the outbreak of the war! To buy a bottle of champagne certainly was beyond the reach of millions of kolchoz peasants: it has been estimated (Gordon and Klopov 1989) that the average wage of a kolchoznik – including the income from a private plot – did not exceed 20 roubles in 1940 (in the currency of 1989). promising for instance more investments in consumer goods industries. But at the same time there were already before the war hundreds of thousands – if not millions – of peasants and workers who were clearly more prosperous. Ordzhonikidze. At the same time there was a constant deficit of basic daily necessities. Ordzhonikidze would thus have made concessions and promised people some relief. Such beliefs. Mikoyan for the food industry and by I. Nor were these reductions spontaneous. I. produced a more positive mood. The general atmosphere might also have become more optimistic and relaxed. the total yearly national product would hardly have been enough to cover them all. Ordzhonikidze. (As mentioned by Zaleski these figures should not be taken too seriously since the possibility of the full realization of the plan was from the very beginning negligible. (Zaleski 1980: 129–30) The change in politics did not include any promise of relief as far as the Soviet consumer was concerned. still common enough in Western analyses.) The standard of living did not improve during this five year period. it is obvious that the standard of living of many – if by no means all or even the great majority – improved remarkably due to the consciously promoted increase of income differentials. was exaggerating and dramatizing the 54 . According to Barber: In the mid 1930s the atmosphere appears to have improved.LUXURY. the three good years of 1934–6 in industry. (Barber 1990: 9) On the other hand. Molotov announced to the congress that they had been approved by the Party Politburo. Higher living standards. Had not Stalin himself promised in 1935 that life would become better and happier? It is thus obvious that Timasheff. whose information was mainly gained from the contemporary Soviet daily press. The revisions proposed by A. a series of better harvests. either. E. together with a temporarily more relaxed political atmosphere. Lyubimov for light industry were hardly more substantial. the end of rationing. proposed the reduction of the average rate of growth of industrial production from 18. KITSCH AND FASHION the birth and realization of the Second Plan the picture given by Timasheff was strongly exaggerated and dramatized. are obviously wrong. According to Zaleski: the revisions made in the draft of the Second Five Year Plan at the Seventeenth Party Congress seem minor. People’s Commissar of Heavy Industry.9 to 16. If all the planned investements were summed up.5 per cent and small reductions in the 1937 goals for machine-building and the principal metallurgical products. KITSCH AND FASHION general importance of this Party Congress and the new Five Year Plan. much more convincing in showing that around the year 1934 a crucial change took place in the cultural politics of the party and more broadly in the conception of a proper Soviet way of life. and not the party. It was as if the history of literature. The authority of the university professors had been reactivated a bit earlier: they. however. But the revisions that were made and the discussion waged about the new plan still prove there was some kind of insecurity of orientation. In the autumn of 1934. and the old regime was rehabilitated. thus cancelling the ideals of proletarian culture.LUXURY. movies. Timasheff is. were entitled to give credits to students. the party leadership condemned all kinds of asceticism (self-induced pauperism) and libertarianism (free love).) In this sense the year 1934 signalled an almost total about-turn. (Stites 1992: 65) It was a culture bearing ‘solemn hallmarks of high culture’. and express a need for reorientation on behalf of the party leadership and economic planners. School reforms were also stopped the same year. At the same time they helped fashion a ‘mass culture’ of socialist realist fiction. mass song. and didactic painting. ballet. parades. a regime reminiscent of the system that had been established during the most reactionary period of Russian cultural policy in the 1880s and 1890s. What is even more important. The end of the 1920s and the beginning of the 1930s were dominated by the conception of proletarian culture and the ideal of the ascetic self-sacrificing Soviet worker. In 1933 the Central Committee of the Party declared socialist realism to be obligatory in art. military bands. music and art had stopped sometime in the mid-eighteenth century – all the newer developments were declared to be incomprehensible and condemned 55 . and radio – accessible to all. state-sponsored folk lore. and architecture. (The famous leather jacket of the commissar was the fashionable garment of the 1920s. the doctrine of egalitarianism which had dominated the party ideology faced the same fate. The school reforms of the proletarian phase were now criticized and shown to be a total catastrophe – backed by research data according to which university students could hardly read or write when starting their courses. It was now strongly condemned as a petit bourgeois deviation opposed to real socialism. realistic theatre. Richard Stites (1992) has aptly summarized the meaning of this turn in art as follows: they canonised classical music. adopted folk art and Soviet popular songs. To learn to dance became obligatory for officers of the Red Army. On the eighteenth anniversary of the October Revolution (1935) Stalin attended an evening of popular music and dances. Numerous dance schools were opened up in Moscow. in 1933. reaching its climax in the centennial of Pushkin. the breakthrough of tango and folk music followed. The abruptness and unexpectedness of this change in party politics is well documented 56 .LUXURY. for instance. Recordings of popular music were also published on a new scale. Finally the eclectic Soviet ‘mass song’ was born: ‘Schlagers’ written and composed by adopting popular folk melodies and styles. By the end of the 1930s the basic elements of the new Soviet Culture were thus created. The new happy life Once classical music was declared as the prototype of Soviet music. The following day an article was published in Pravda in which it was claimed that folk art is ‘the great source of inspiration of our artists’. It was a mixture of light classics. It was furthermore characteristic of the period that in the middle of the 1930s dancing was not only allowed but actively encouraged by party politicians. was the great ‘top ten’ hit of the year 1938 (see Stites 1992: 75–8). ‘joyous life’ was not only allowed but positively encouraged. Voroshilov and Molotov set a good example by learning to dance the tango! As many reminiscences of the 1930s recall. That such had not always been the case is demonstrated by a fact mentioned by Timasheff (1946: 272): the production of accordions now recommenced. a combination that was still easily recognizable a few years ago to anyone visiting the Soviet Union or listening to the ‘Mayak’ radio station. Blanter’s ‘Katyusha’. There were very few musicians who knew how to play the accordion. After a short period of Soviet jazz. but some were found. After the show he applauded eagerly. It was regarded almost as the duty of every Komsomol boy or girl. declare that Tolstoy was almost useless because of his classless attitude (see Timasheff 1946: 264). It is characteristic of the abruptness of the change that whereas one could. folk art and music were also rediscovered. in 1937 a festival of Russian art was celebrated. The Soviet citizen was supposed to be happy. They were then given the important task of teaching the young generation how to play this previously popular instrument (see Timasheff 1946: 272 and Stites 1992). KITSCH AND FASHION as damaging to human values and taste. Volga. by the nightly 57 . Perfume and make up belong to the “must” of a good Komsomol girl.LUXURY. It caused a minor ‘cultural war’ but was soon released and became a great success. slow and fast fox-trot. The importance of washing one’s hands and cleanliness in general was a continuous theme in youth papers. The comedy Volga. by the Ferris wheel. KITSCH AND FASHION in a letter cited by Timasheff (1946: 314–15) which was sent to the editor of a youth journal by a group of Komsomol members living in the countryside. Their leader. as well as the somewhat later Volga. . Now it was allowed to be different and to distinguish oneself from the group without getting into trouble: ‘We endorse beauty. Such recommendations could be found frequently in newspapers and journals in 1934–5. . a journey full of amusing occurrences due to misunderstandings with local bureaucrats. a hundred thousand participants in costumes and masks were dancing waltz and tango. They asked whether it really was now allowed to visit friends. showed how this idea of having fun was central to the new cultural policy. Aleksandrov and Orlova. smart clothes. Girls should be attractive. manicure. Clean shaving is mandatory for a Komsomol boy’ (cited in Timasheff 1946: 317). play the accordion and have fun. who has published an interesting history of these festivities. the famous film by the threesome Dunayevsky. the fountains which resembled burning asters. chic coiffures. . still demanded that they should stay at home and listen to instructive programmes on the radio. they were enchanted by the torch processions of the carnival heroes. Volga describing the journey of a village orchestra along the river Volga to a folk music olympiad in Moscow. Merry Boys was a conscious imitation of Hollywood musicals accompanied by Soviet jazz played on accordions. compressed all the themes of the period together into a harmonious whole. ‘Happiness lives in the country of plenty’ Merry Boys. Rosalind Sartorti. It is also characteristic of the period that from the mid-1930s carnivals and popular festivals were organized in the cities. obviously loyal to the old politics. . . A new journal of fashion was also established in Moscow which gave instructions on how to dress and how to furnish one’s own home. . described the carnival organized in August 1936 as follows: In the night of 5th to the 6th of August. Walking across the square one could get a giant appetite. for instance. . these carnivals were organized under conditions of a huge deficit of many basic foodstuffs and consumer goods. (cited in Sartorti 1990: 66–7) As Sartorti also said. The following is a report of the May Day celebrations in Moscow in 1936 published in Komsomolskaya Pravda. and marble white bacon. tension or necessity. as an indicator or proof of the increasing weight of a new middle class in 58 . The festivals were. The coming into being of the new middle class In the analyses of Stalin’s times it has been common to interpret the ‘value transformation’ in cultural politics which started in the middle of the 1930s and continued well into the 1950s with occasional periods of tightening cultural climate.: 42). KITSCH AND FASHION sky brightened by the play of projectors.LUXURY.) But this was not the case: they were simply typical examples of socialist realism. . melting Swiss cheese. . At these carnivals food and drinks were usually plentiful. amusement and forgetting’ (ibid. . did they get all the textiles to make the carnival outfits? How did this ‘Garden of the Plenty’ of the Stalinist carnival relate to Soviet reality at the end of the 1930s? Was it after all the carnivalesque world turned upside down. We have to talk about the garden of the plenty behind the Manezha building. by the fireworks and the rockets. very disciplined and absolutely no expressions of spontaneity were allowed. this garden where sausages and Wurst were growing on the trees. but quite the contrary. Where. (Sartorti 1990: 41) These carefully planned and organized carnivals were something totally new in Soviet society. a world of overabundance. They tried to transmit an atmosphere of Soviet society ‘characterized by a holiday mood which knows nothing of scarcity. . and they went down the river Moskva in boats decorated with pennants. an unconscious parody of Soviet reality? (See Sartorti 1990: 70. the task of which was to show concretely how a grain of the future had already been sown in the present. . Where a mug of foaming beer was accompanied by delicious Poltava sausages. after all. by pink ham. 4 May 1936: It is hard to describe how Moscow enjoyed itself in these joyous days of the May Day celebrations. Once again a gentleman was allowed to look like a gentleman! This new way of life was characterized by a special cultural consciousness. the Soviet political elite made a ‘big deal’ with this new middle class by yielding to its demands and aspirations in cultural politics and lifestyle and received as a reward its undivided political loyalty (Dunham 1976). According to Vera Dunham’s famous interpretation. (The Stakhanovite movement was an expression of these emerging trends. A ruralization of cities and city culture became evident. a new Soviet middle class was being born. The condemnation of the principle of egalitarianism which had dominated the First Five Year Plan was a result of the pressure exercised by these young and industrious peasants and workers and the new specialists. enforced collectivization and deportations.) As a result. for the first time given rise to a large working class that was young and of rural origin. offered a possibility of social ascent to millions of others – and education was a central channel of this ascent. etc. Economic stimuli were taken into account. It was offered almost cost-free to talented and industrious young people. which were responsible for the deaths or removal of so many people. The ideal of equal pay was given up. artists. They often originated from among the ranks of poor peasants and workers. Stakhanovite workers. who did not belong to the party hierarchy as the old political elite did but who could still earn and live well. At the same time a new group of experts and specialists was schooled by the Soviet system itself. The city population increased dramatically: millions of people moved into Moscow and Leningrad alone from the countryside. ‘non-party Bolsheviks’. talents and skills that were thought to be useful in building the socialist society. KITSCH AND FASHION Soviet society.LUXURY. The Stalinist terror. in the 1920s and 1930s. With the help of various systems and after many experimentations the system started to reward industriousness. Stalin’s programmes of industrialization had. traditional channels of mobility and easily recognizable symbols of success and achievement as well as rewards in the form of traditional goods which could be consumed and displayed. As many observers witnessed. 59 .. scientists. the upwardly mobile parts of the population wanted a well-ordered society with stability. According to Sheila Fitzpatrick (1979: 252–4) who has studied the relation between education and social mobility in the Soviet Union.g. Stalin seemed to be enjoying great popularity among the citizens of the time (see e. educated professionals. Volkogonov 1989). Income differentials increased greatly. As Stites (1992: 65) argued.LUXURY. and an affirmation of their values’ (Stites 1992: 65). . which it could create by itself. .). ‘In the Dugout’. This atmosphere was characterized in a condensed form in a now famous citation from a popular novel according to which ‘tea was served under an orange lampshade in red. This new middle class had been produced and demanded by the structural changes taking place in the society. In this small. . Those who had been promoted from among the working class were encouraged to wear a black suit and carry a briefcase: ‘the newcomers were invested with privilege and expected to develop respectable habits and tastes. It adopted light classical arts as its status symbol. uplift. etc. The personal – even the most personal. these newcomers appreciated privileges. A large part of all rewards were still being paid in natura and not in cash: holiday trips. and invested in the future of its children and their education. etc. private homes or houses. gay and bright paradise. Stalin bought the loyalty of the new middle class with ‘trinkets’ – as taught earlier by Adam Smith – but also with real privileges and by allowing for widening status differences. KITSCH AND FASHION ‘kulturnost’ (see Boym 1994 and Volkov forthcoming. According to this interpretation. summer cottages. In her study based on the analyses of popular literature of Stalin’s times. The new elite had its own tailors and barbers and it liked to put its status symbols on display (such as Parker pens and imported cigarettes) in order to show its social status and prestige. It was good to display and make use of one’s prosperity – otherwise material stimuli would have been of no use – but it would have been indecent to ‘show off’. 1997). ‘Dark is the Night’. which was proof of not being sufficiently cultured. everybody was pleased with life and discussed how good it was that work in the club was becoming well organized . But the new middle class also appreciated cosiness and a homely atmosphere. . such as a happy and harmonious family life. polka-dotted cups. They thirsted for old high culture as a badge of distinction. ’ (cited in Dunham 1976: 43). They were expected to develop decent manners and good taste. Vera Dunham (1976) has shown how the possession and acquisition of goods and services was a pertinent moral problem that was discussed time and time again in 60 . to act in a cultured way. . for entertainment they enjoyed sentimentalism. together with an eclectic collection of symbols of middle-class normality. fun. the happiness of a man and woman – was no longer in contradiction with the happiness of the state (cf. in particular the sentimental popular wartime songs. generously rewarded artists and scientists. The corrupting influence of unearned and undeserved luxury was a permanent theme in Soviet art and media in the years after the war. the problems of decorating and furnishing a home were hardly the problems with which most Soviet people were struggling daily in the 1950s. was rumoured to have been one of the richest men in the pre-war Soviet Union. Even more morally indefensible was the behaviour of the smooth-tongued and well-mannered student who seduced an innocent young female colleague. and the whole period of Stalin’s regime. Most literary examples presented and quoted by Dunham could. and stole the manuscript of the doctoral thesis of an older. the theme seemed to be a particularly acute and perplexing one among contemporaries. Dunham wondered why many authors who quite obviously adopted a positive attitude to these new values of life also showed a clear distaste for material possessions and condemned Soviet citizens who were all too eager to possess such material goods. or the dream worlds of popular literature. enormous sums of roubles. be interpreted to demonstrate that any luxury that was not deserved was to be morally condemned. talent or effort. As Dunham claimed. Tsfasman. in the eyes of their contemporaries. the use of the director’s office car by his wife for shopping trips was to be condemned. more experienced and industrious colleague in order to get a promotion – the plot of a novel by young Yury Trifonov from the year 1951). (Thus. were well deserved. But on the other hand. 61 . it is obvious that many more prudent objects of ‘the good life’ were already within the reach of vast sectors of the population. are legitimate insofar as they are righteously earned by one’s own labour and/or talents. for instance. as a result of corruption alone. Such luxuries clearly were out of the reach of ordinary people living in kommunalkas or in country shacks without any modern conveniences at all. (The winners of the Stalin Prize were handed. KITSCH AND FASHION these books. the aspirations of higher income and better material living standards. The Jewish-Ukrainian leader of a Moscow jazz band. They were only ideals. however.LUXURY. and a better life. The morals of the new Soviet middle class could thus be summarized as follows: inequality.) Democratic luxury and the pleasures of the few As has already been pointed out by Vera Dunham. The last mentioned reservation is important in particular because the 1930s. On the other hand. all such luxury possessions which had been rightfully earned by one’s own labour. say.LUXURY. The only thing that was new was the art and entertainment produced by means of new technology: radio. This was a Biedermeier culture. Ladies’ and gentlemen’s ateliers were opened in big cities to provide an alternative to the cheap. table utensils and other modest domestic or personal decorations. There were attempts to re-establish more refined ways of dressing and behaviour. It is worth questioning whether these consumer goods can be analysed as status symbols or as signs of belonging to the ‘better classes’ in the Soviet Union. In addition elements of a more collective nature were part of it too: restaurants with music and dancing. The word ‘kulturnost’ captures the inner meaning of this taste. Pocket watches. (Watches had been a cherished war souvenir or loot among the Soviet troops returning from the Western front. too individualistic. for instance.) 62 . ugly. full of the smell of Sauerkraut. safe and stable. in which any poor but respectable Soviet citizen could in principle take part and enjoy. a glass of foaming beer with Wurst before returning to his or her communal kitchen. were regarded with suspicion as signs of bourgeois mentality. but inexpensive. The material culture of their ‘good life’ is therefore best characterized by the seemingly paradoxical concept. These were all parts of the imagined ‘high life of the past’. KITSCH AND FASHION Happiness did not only consist in collective feasts and celebrations. fine. silk stockings. Why did not the industry producing consumer goods supply the country in a similar way with. concerts. but in 1947 the production of wristwatches (trade mark ‘Pobeda’) was started on a mass scale. ready-made garments mass-produced by the clothes industry. cinema and gramophone. These are people full of good cultural will. gloves. public festivals and feasts. artefacts were available to ordinary customers.? To some extent they had already been available in the late 1930s. etc. pocket watches. theatre and ballet performances. neckties. democratic luxury. They want to distinguish themselves from the masses but do not dare to be too different from their neighbours or colleagues. it only imitated imagined historical ideals or models. The taste expressed in them certainly is petit bourgeois in the classical meaning of the word: conservative. evening gowns and costumes. the classical sign of a prosperous worker in Western Europe. This democratic luxury consisted mainly of food and drink. A lot of beautiful. But this taste did not imitate anything better than itself – or if it did. Beautiful furniture and other artefacts of domestic interior decoration belonged probably more to the post-war period of Soviet life. these items were associated with festivals or parties: they were concrete proof of the fact that everyday life in the Soviet Union was a feast. one could just as well regard them as a cynical joke: ‘Why don’t they eat cake?’) Third. According to Zhukov we. The author. (On the other hand. In this sense. an interesting article about style and design – or the total lack of them in the Soviet Union – appeared in the cultural journal. the year following the death of Stalin. N. it was part of the very nature of this democratic luxury that it included only a limited number of items. are faced with the task of elaborating a new style of material culture which would better answer the demands of the masses or population and express better the character of our great times. as well as the new shop windows and neon signs of Moscow. a socialist utopia come true. (Zhukov 1954: 159) 63 . The author referred to the authority of the philosopher Alexandrov. they should be cheap enough and quotidian enough so that anyone could at least sometimes think of being able to buy them. In a country in which there was an almost permanent deficit of the most basic foodstuffs. Novy Mir. cheap imitations of real or imagined finer models. the toys and cakes sold at the famous children’s department store. In the autumn of 1954. In addition.LUXURY. when the whole culture and philosophy was under scrutiny in the Soviet Union. a new evening gown was still for most women a dream not within reach. who for some time acted as the minister of culture and who recently had emphasized that everything that surrounded people in their daily lives was an essential part of their culture and had a decisive influence on their taste. Zhukov (1954). Was there any Soviet design? Democratic luxury was already per definitionem kitsch. but almost anyone could think of buying at least occasionally a bottle of perfume or a make-up kit. the men living during the age of the building of a Communist society. Second. First. Detsky mir. they did not change much: novelties were rare. not to mention champagne or caviar or a box of chocolates. used his keen eyed judgment of taste on the whole of Soviet material culture: furniture as well as women’s wear. it was easy to understand the function of champagne and caviar as a ‘promise of a better future already realized in the present’. KITSCH AND FASHION There are some general features common to all these items of luxury. How easily and quickly will they leave it behind? Today the latest stop is the ‘industrial aesthetic’. Zhukov compared in an ironic tone the industrial aesthetics of cars and railways with the anachronistic aesthetic of the goods sold in the shops in Moscow: sofas with pompoms. who in the preface to the second edition of his Critique of Everyday Life (published in 1958) referred – without mentioning the name of the author – to Zhukov’s article. (Lefebvre 1991: 45) Today we can only try to guess what this new socialist design and taste longed for both by Zhukov and Lefebvre could have been – hardly the streamlined industrial design of machine aesthetics. not even in countries like East Germany and Czechoslovakia. a fashionable restaurant during the old regime (ibid. who live in a capitalist country. . As far as the style of everyday life is concerned.: 165). which did not satisfy Lefebvre who already knew the dead end this style had led to. It remains a simple fact that neither in the Soviet Union nor in the other countries of the socialist bloc was much attention ever paid to the design of consumer goods. The Czech art historian. could still write in1989 that ‘moderately said. They have attained petty-bourgeois mediocrity as though that were progress. Jan Michl. Henri Lefebvre. no one seemed to care. an old chestnut which is liable to involve them in more than one lapse of taste . . imitations of the mirrors and decorations of the Restaurant Savoy. have been aware of for a long time (which does not mean that we have solved them). could claim that the Soviets are thus discovering problems which we. the Soviets have not progressed far beyond 1900. which within the mutual socialist division of labour were more specialized in producing consumer goods and which were held up by Zhukov as ideal models for future Soviet design. socialist countries are not well known for 64 . They are discovering social needs which are already known and which have already been explored (which is not the same thing as saying that they have been satisfied or fulfilled). marital beds with flower and fruit decorations. As a model for new and better designs Zhukov – not surprisingly – offered both the new streamlined industrial aesthetics and folk decorative art inspired by Russian fairy tales.LUXURY. KITSCH AND FASHION The author implied that no aesthetics were adequate to the building of communism as far as consumer goods were concerned – moreover. The system promoted mediocrity and decency under the banner of ‘kulturnost’. More interesting are his other observations concerning the fact that it is not – or at least was not during the period dominated by ideology – regarded as decent to emphasize and show off one’s own social position if it violated the principles of egalitarianism which were widely shared in the society. It included all the 65 . The development of the Soviet culture of commodities was also – and probably to an even greater extent – restricted by the very rigid system of social distinctions with its inherently imposed self-limitations. innovation and differences. The resulting modest demand for the signs of distinction was satisfied by the supply of goods characterized as democratic luxury and by the consumption of cultural goods. which could almost be translated as conformism. It is thus obvious that one should have some reservations concerning this thesis and its general importance in the development of material culture. He or she preferred to live in conformity with the general standards of the society – just like all the other good comrades. KITSCH AND FASHION the quality of their producer goods. Extremely seldom have these products reached the highest standards on the international market’ (1989: 69). Distinctions were not totally forbidden by common morality.LUXURY. consisting both of well-to-do workers and educated specialists. The product differentiation in socialism was not only restricted by the inflexibility of the system of production or by the fact that there was a guaranteed market for most products under the conditions of relative scarcity created by low prices. thought to be more ‘common’. With only slight exaggeration one could claim that in the Soviet Union there existed just one single class. and display its own prosperity with status symbols – then one would imagine that there would have emerged a more acute social demand for a new ‘design industry of taste’. the so-called intelligentsia. A good Soviet citizen did not show offor experiment with life. at least since the 1950s. more than cultural dynamism. but only distinctions that did not violate respectable and cultured manners were allowed. a huge middle class. The explanation for this lack of style and design given by Michl is not very surprising: there is no economic competition nor any freedom of enterprise in socialism. The socialist way of life: decency and small delights If the above thesis concerning the increasing importance of the educated middle class in the Soviet Union from the late 1930s to the early 1950s is true – that it was inclined to distinguish itself from other people. but in the 1960s and 1970s these were still exceptional people. drunks.. as those of the 1930s and the 1950s were. Of course there were those who were different. artists. According to this interpretation. gypsies. who had a car and a summer villa and the right to travel abroad. in fact – enlivened by small delights and indulgences such as visiting the ballet or a concert of popular music with an occasional glass of champagne and a caviar sandwich enjoyed during the interval. Thus the good life of a Soviet citizen was stable and conformist. A private flat. anything more demanding. It is possible that the contradictions inherent in such a regulated and planned lifestyle. champagne and caviar. scientists. Even though it was increasingly possible to aspire to a good private life. adequate to socialism. In many respects it conformed to the stoic ideals of humanistic education predominant in Europe since the Renaissance. high civil servants or party bureaucrats. and was from time to time – quite often. a single mass of the lumpenproletariat. with private chauffeurs and bespoke tailors. bohemians. Stalin’s ‘Great Retreat’ or the ‘Big Deal’ did not yet mark the end of socialism but rather the beginning and the development of a particular lifestyle and taste which was. with modern conveniences and set in a new suburb. wasters. in turn led to the gradually deepening crises of commodity culture which since the 1970s had helped to weaken the authority of the Soviet leadership. Consumers and the end of socialism A new period of Soviet middle-class culture began in the 1960s when the new aspirations and standards adopted from the Western capitalist world began their slow but victorious procession through Soviet society. Everything else. from the history of ‘high society’. was apt to corrupt a man. however small. etc. with its limited luxuries. people did not ask for too much – not for much more than their comrades had. television sets and even private cars (without a chauffeur) were 66 . kosmonauts.LUXURY. KITSCH AND FASHION people who had adopted a rather homogeneous conception and ideal of what was a good life. became the central symbol of this new ‘luxury’. These aspirations were no longer derived from an imagined past. An original conception of socialist ‘good life’ was being born. indeed. The above interpretation was based on the role of the caviar sandwich and other popular luxuries in the Soviet culture. which was almost identical to the rigid lifestyle of the old estates. etc. Everyday life usually held few great surprises. All the rest of the population were without a culture: criminals. Refrigerators. KITSCH AND FASHION gradually coming within the reach of ordinary citizens. After the 1960s the development of the commodity culture in the Soviet Union followed well-known paths. Once consumers’ demands and wants multiplied and diversified in earnest.LUXURY. The reasons for its failure were not technical ones. In Bauman’s opinion. For instance. The only classical European luxury. of cosmetics and cheap decorations. satisfy such demands. The old conception of luxury survived right up to the present day. in principle. One could probably even claim that socialism was functional as long as the logic of needs in general was concerned. the government could not. but the assortment has otherwise remained more or less intact. insatiable and individual demands of a modern consumer (the self-illusory hedonist. gradually penetrated the everyday life of Soviet citizens. In other words. alongside the new one. socialism was relatively competitive in mobilizing national resources in the service of industrialization and in organizing and planning economic growth. even in principle. the kiosks of Russia now all have an abundant variety of liquor and wine. neither did they result from the 67 . Once it was faced with the. of chocolates and cigarettes. Along with Agnes Heller (1976). which gradually became popular during the 1960s. satisfy them any more. Any disappointment experienced by any consumer could be interpreted as resulting from the inability or negligence of the government and the state to run the economy properly (see also Pastuhov 1991). A socialist society of mass consumption is a contradictio in adjecto. but it was unable to cope with the rapidly increasing diversity of demand. one could say that socialism led to the establishment of a dictatorship over needs. most often Turkish-style coffee – although American instant coffee has lately taken its place. In a recent article ‘Communism: a post mortem’ (1990–1) Zygmunt Bauman suggested that the main reason for the collapse of the East European socialist states was the incompatibility of socialism with a modern consumer society. But it faced a serious and insurmountable problem as soon as it had to answer the increasing demands of the population. in principle. Campbell 1987) it was doomed to failure. Western habits of consumption. in a strictly regulated manner. was coffee. It could. cf. socialism was still capable of satisfying people’s basic needs relatively effectively. It was central to Bauman’s argument that in socialism the state took full responsibility for the gratification of the consumer. which were universal and common to all. new imported brands that still to some extent enjoy the ‘aura’ of rare Western imports have largely been substituted for the old Soviet brands. A great proportion of all products simply ‘disappear’ into these networks and are distributed anew through unofficial channels. It also effectively prevents the development of a new. As Srubar has pointed out. Only capitalism. In this sense. a socialist society shared many features related to consumption which made it particularly resistant to change and prevented any possible disappointments being directed towards state power. Srubar’s interpretation of the development of a specific socialist individuality would thus give further support to the above thesis about the basic decency and conformism of the Soviet consumer expressed in the material culture as the 68 . during scarcity the most important problem for the consumer is how to get information about the existence and the whereabouts of a commodity (cf. As students of the economy of scarcity have pointed out (see Kornai 1982). the emergence of socialist states did not end the era of revolutions. A planned economy can only follow the logic of needs. As a consequence. Anyone who knows how to get hold of a particular good is in possession of valuable ‘social capital’. a shadow economy emerges out of necessity. their morality is a morality of egalitarianism characterized by resentment. The workings of such networks can in many respects be compared with the primitive institution of gift. consisting of various. unofficial and more or less complicated networks for distributing provisions. Rather. a socialist society is unstable and very politicized. which leaves it to the private initiative of the individual. KITSCH AND FASHION inability or corruption of its politicians and leaders. Such networks may be based on family or friendship networks. money is a necessary but not a sufficient condition for getting hold of goods. can live with the individuality of demands. Srubar 1991). They tie their members into a network of mutual obligations and loyalty. the social identity of a socialist individual was strongly tied to its own ‘clan’ or ‘family’. In Srubar’s opinion. Consequently. Under such conditions. the bourgeois political order is very stable (see Bauman 1990–1: 268). not that of desires. A clear and strong distinction was therefore made between ‘us’ and ‘others’ (see also Vinnikov 1994: 1229–30). whereas in the West the state cannot usually be blamed for disappointments experienced by the consumer.LUXURY. It opposes any change which promotes rewards based on individual achievements. this era was inaugurated by their emergence. Under such conditions. but their basic activities are the mutual obligations created by gifts and services. strong individual identity. As has also been discussed above. It creates ‘artificial’ or unnecessary needs. The main historical turning points in this transition were the new cultural politics adopted by Stalin in 1934. I hope. However. one could speak of a very slow erosion of the socialist collectivist culture in the Soviet Union. very slow and unsteady turn towards producing some basic durables which were generally regarded as symbols of the Western way of life (private cars in particular). According to these critics. there has been a strong trend of cultural criticism in Western society that has blamed modern society for the very thing which. actually proved victorious. as postulated by Bauman. shown. People 69 . even today one can easily observe many remnants of the old democratic luxury living in peace side by side with the new and more individualistic consumption patterns. according to Bauman (1990– 1). are thus open to serious doubt. the new housing policy of the 1960s and the simultaneous.LUXURY. Thus. KITSCH AND FASHION dominance of democratic luxury. This conclusion is supported by the fact that the fight against corruption was one of the most permanent and pertinent features of the Soviet political system. people to exceed or overstep their needs. probably since the 1960s. The demands for change caused by the emergence of modern consumers in socialism. FASHION AND PLENTY IN THE POSTINDUSTRIAL SOCIETY Consumer society as an abundant society Paradoxically. modern commercial society continuously encourages. since the latter part of the last century. even in the socialist world there gradually emerged elements of a new middle-class culture with its more individual patterns of consumption which at least to some extent allowed and even promoted possessive individualism and private acquisitions. as the above preliminary analysis of the development of the material culture since Stalin’s times has. On the other hand. and – to use an old expression – the demand for luxury. Since most citizens believed that the prosperity and higher standards of living of other groups could only have been gained through corruption and criminal deeds – and other people’s wealth was usually thought to be achieved by wrongdoing – the dissatisfaction of consumers is by no means directed first towards state power but can just as easily be channelled into hatred and bitterness against alien privileged groups. or even forces. And the main characteristic of this new type of society would seem to be that consumer demands have become much more difficult to predict and. social reformers understood many social problems to emerge from the fact that people were tempted by false and artificial needs which they could not satisfy – and some of which could never be satisfied. At the same time. democratic needs. capital and private property. If only people would learn to regulate and recognize their genuine needs they would not only be able to live a more satisfying life. modern commercial society is not to be blamed because it leaves the basic needs of the greatest number unsatisfied and permits them to live in misery. but rather should be blamed for its tendency to make them continuously exceed their needs. One could also say that industrial society has been transformed into post-industrial or mass consumption society (Bauman even speaks of a post-modern society). in principle. KITSCH AND FASHION are persuaded to consume more than they really need. The critics seemed to fear that once the limits set by the ‘natural’ or real (as opposed to artificial) needs (traditionally set by the sumptuary laws or standards of the estate to which they belonged) are by-passed. a similar break was usually associated with the end of scarcity (hunger and disease) and it was thought to have taken place much earlier in Europe. there are no limits at all to people’s demands. Zygmunt Bauman seemed to suppose that sometime during the last 70 years in Europe a major change or even a rupture in the functioning of modern commercial society has taken place. In other words. But on the other hand.5 Implicitly at least. too. common to all). In the analyses of the early critics of consumer society. and this is a cause of much of – if not all – the misery in modern society. and related health problems. as the early socialists believed. but – as the early utopian socialists thought – to get rid of money. As has already been shown. In early industrial society consumption was still predominantly oriented to needs. and the inequality which accompanied these social evils. impossible to satisfy.LUXURY. the demands of this 70 . whereas now there are no limits to the demands and wishes of a consumer. at the turn of the century this theme can be found in various disciplines among the pioneer critics of the consumer society: in early modern nutrition science in its efforts to understand the problems both of overeating and malnutrition. These changes have somehow even influenced the development of socialist societies.e. in the various democratic arts reform programmes – ‘art social’ or ‘art industriel’ – propagating a reform of industrial design which – at least in its more extreme forms – would have eliminated all ‘useless’ decorations not functional to the satisfaction of needs (i. 6 The development of consumption was mainly described in quantitative terms. post-industrialism held a promise of more leisure for all and an economy of abundance which could sustain everyone in comfort and economic security whether or not they engage in what is commonly recognized as work. more free time. among other things. an age of abundance and plenty. The expected changes were more of a quantitative character: higher real income. In his comprehensive study of the theories of postindustrial societies. In 1987 Herman Kahn and Anthony J. Most people would enjoy high living standards and would have more free time – to use. For the first time in the history of humanity. Krishan Kumar (1983: 195) has pointed out that the general idea of an economy beyond scarcity was shared both by the radical critics of the consumer society like Herbert Marcuse and Christopher Lasch. They all agreed that the progress of productivity had created a historically unique situation. higher living standards. even though already in a state of continuous growth. and nine others would be knocking at the door. Post-industrial societies were certainly supposed to be societies beyond scarcity – or affluent societies.LUXURY. The forecast presented by Keynes in the 1930s had thus become a reality. the leisure and culture of a small minority was not dependent on the toil and misery of the great majority. In this sense there was a limit – even though this limit was never totally rigid. its technocratic propagators like Herman Kahn and Anthony Wiener and the ecologically-oriented anarchists like Murray Bookchin. but by the year 2000 Kahn expected twelve nations to have reached the ‘visibly post-industrial stage’. for instance. these visions were rather vague and not at all concrete. In their opinion industrial societies would be followed by mass consumption or advanced industrial societies. still somehow thought to be limited or regulated by the consumption pattern set by the example of the upper social strata which it was supposed to imitate. Prophecy and Progress. What these authors disagreed about were the possible cultural and social consequences of this state of affairs. in their famous The Year 2000 (1967: 149–60) classified societies according to the level of their GNP per capita. In the theories of post-industrial society of the 1960s and 1970s (and in their radical critiques) consumption does not seem to have played a very important role. 71 . for consumption. KITSCH AND FASHION early modern consumer were. Wiener. which in their turn would be superseded by post-industrial ones. In 1965 only Western Europe and the USA – and perhaps Japan – had reached the massconsumption stage. As far as the character of modern consumption was concerned. To Kahn. rather vague – in fact. Somehow it did not pose any problem for these utopias until more recently. but that they are cheaper. G.7 Bell’s The Coming of Post-industrial Society also included some amusing considerations about the possible scarcity of free time in the future due to increasing consumption. (One could easily continue the list: cars. According to Bell. before modernization people lived close to subsistence level. To take a more recent example: according to Eva EtzioniHalevy’s Social Change (1981).LUXURY. we can speak of a society of abundance only in a very limited sense: the problems of hunger and disease need no longer exist. Etzioni-Halevy stated that ‘western societies have indeed become affluent’ (ibid. As Bell formulated it in economic terms: ‘Scarcity is a measure of relative differences of preferences at relative costs’ (Bell 1974: 466). the standards of living and of consumption have been rising drastically. a complete set of golf 72 . No imaginable economic system or society can ever solve the problem of scarcity: our resources will always be scarce relative to our desires or wants. Since then real wages have risen remarkably and almost continuously. CD-players. consequently. A man who owns. consumer durables have gained in importance: ‘There was a marked proportional increase in expenditure on consumer durables stretching from stoves to iceboxes and sewing machines’ (Etzioni-Halevy 1981: 105). the role of consumption in future society remained. only basic needs are satiable and. KITSCH AND FASHION If one reads these modern utopias it becomes clear that it was widely presumed that somehow the role of consumption is bound to become more important in the future – at least in quantitative terms – and at the same time people need no longer be bothered with the economic problems of their daily life. who more sharply than most others formulated the basic dilemma of an affluent or mass-consumption society. More specifically. In these visions. however. To Bell the economist. – J. in this sense only ‘the possibility of abundance is real’. etc. Consequently. Vance Packard and Herbert Marcuse) than for its protagonists. one could almost claim that consumption had been a more important target for the critics of modernization (ever since Veblen. too. one of the initiators of the whole discussion about postindustrial societies. In other words: abundance is always a relative state of affairs. video recorders.).) As a general conclusion. for instance. But as Bell also argued. There are other changes in the consumption patterns. It was Daniel Bell. abundance essentially means not that goods are more plentiful in physical terms. a sailing yacht and a summer cottage has to hurry during his summer vacation in order to have time to make use of or consume all these articles and goods. Bell. many commentators seem to think that even some kind of a ‘qualitative’ change has taken place in the nature and role of consumption in the advanced industrial societies since the Second World War or during the last few decades – a change which Zygmunt Bauman seemed to take for granted in his analysis of the collapse of socialism. It seems to be rather difficult to find any interesting comments concerning a possible change or rupture in the nature of consumption in modern society in the theories of modernization discussed above. KITSCH AND FASHION clubs. in particular if their proper use demands. 73 . This is partly predetermined by the nature of their argumentation: their predictions often are based on quantitative extrapolations of present tendencies. These studies do not. which is particularly important in Bourdieu’s analyses of lifestyles and ‘habitus’. at least intuitively. Yet. thus. does not further develop this last-mentioned fact. We live in an age of plenty.LUXURY. training or schooling. a tennis racket. as is often the case. however. have much to offer to a sociological understanding of modern consumption. instead of want. or there is a change from material production to the supply of services. However. The ethics is an ‘ethics of fun’. as well as to 74 . or the longing for something new and unexperienced. been thought to have resulted from transformations in the emotional make-up of the family (e. As is well known.1 Usually.g. The wants of modern human beings are different. there is no mention of fashion in the theories and utopias of postindustrial society. the consumer in the affluent society is no more satisfied than were the suffering poor of earlier times. the fashion mechanism was to Georg Simmel. fashion does offer a natural explanation for the fact already problematized in economic terms by Daniel Bell: the crucial characteristic of the abundant or affluent societies cannot be comprehended simply through the contrast between plenty and want. absent fathers). Bourdieu (1984: 365– 72) emphasized that the new consumer wants everything at once and without having to sacrifice anything.4 TA S T E A ND FAS H I ON FA S HI ON A S A S E L F . the cultural importance of youth. A new hedonistic consumer has come into being. especially in the American tradition.D Y N A M I C S O C IA L P R O C E S S The modern fashion pattern Many analyses of modern society share the idea that some crucial change has taken place in the action orientation of the modern consumer. or the growing importance of free time and the subsequent erosion of the work ethic. It seems to have been too ephemeral and frivolous a social phenomenon to have been taken seriously in such rational analyses of social change. In characterizing the new middle class as the main carrier of the hedonistic ethos of consumption. whose demands are no longer regulated by an ‘economy of needs’ but by an ‘economy of desire and dreams’. The emergence of this new ethos of consumerism has often. but what is even more important. it was also an essential companion to the process of individualization of the Western world which started with court society. also generally acted as the ideal model for the classical sociological or philosophical analyses of fashion. fashion was a mechanism of social distinction and identification and offered a provisional shelter from the threatened levelling influence of money. In a modern society with a money economy it helped the individual to cope.TASTE AND FASHION the leading literary prophet of modernity. still. in which the fashion mechanism was institutionalized earlier. even at the heart of an aristocratic age. it is manifested nowhere more strikingly than in personal appearance. at least tentatively. At all events we and we alone have given it that dizzy speed which we now take for granted. As Quentin Bell wrote in his classical treatise on fashion. (Lipovetsky 1994: 29) In the clothing industry. fashion has aestheticized and individualized human vanity. it has succeeded in turning the superficial into an instrument of salvation. it became a regular pattern. Through it we can comprehend the contingent and ephemeral nature of modernity. sometime during the early part of the nineteenth century. with the tension which emerged between principles. a goal of existence. The first major mechanism for the consistent social production of personality on display. ‘it is we in the west who are peculiar. fashion is probably our invention. As Lipovetsky formulated it: it has been a vector of narcissistic individualization. On Human Finery (1992: 63). and makeup are the most obvious signs of self-affirmation. because dress. an instrument for enlarging the aesthetic cult of the self. (Lipovetsky 1994: 33) 75 . between self-realization and independence). and demands of equality and difference. or between the principles of positive or negative freedom (in other words. The mechanism combining mimesis and individualism occurs over and over at various levels. an important social phenomenon as far as the experience of modernity was concerned.’ It is generally thought that the modern fashion mechanism started in the West sometime during the Renaissance or early modern period. in all the spheres where fashion operates. during which the French fashion houses played a leading role. Charles Baudelaire. to expect biennial changes. To Simmel (1981). The hundred-year reign of Parisbased haute couture. hairstyles. It is further typical of processes like these that it is difficult for any individual or social institution to regulate or to foresee their outcome in advance because it is part of their very nature that they are realized despite. is superficial and mundane. The main difference between our modern age and traditional cultures would thus not be the very existence of fashion but rather the rapidity and regularity of these transformations. and projects group identity and membership. and often against the will of. but only within the bounds of an intangible repertory fixed by tradition: there were plays of combination and permutation. the 76 . however. in earlier times and other cultures – despite the fact that one certainly can identify changes and even novelties in dress and decorum which deviate from the standard costume and which resemble our fashion mechanism – these changes are deviations from a pattern and do not form a pattern of their own as is the case with the modern Western fashion pattern: ‘An individual might vary and combine figures. claim that. The two are defined in opposition to each other: western dress is fashion because it changes regularly. Following Lipovetsky’s (1994: 35) suggestion one could. The difference would thus be more of a quantitative than qualitative nature.TASTE AND FASHION Jennifer Craik has recently criticized the conception common in fashion studies according to which fashion is a peculiarly Western and modern phenomenon: Symptomatically. but there was no formal innovation’ (Lipovetsky 1994: 35). It is typical of such processes that they are kept in motion without any causes that are created or originated outside the system itself. According to Renate Mayntz and Birgitta Nedelmann (1987) such a fullyfledged mechanism of fashion is a typical – and as such a particularly good – example of self-dynamic social processes (‘eigendynamische soziale Prozesse’). From the point of view of the social actors involved in such processes the motivations which keep them going are continuously being born and strengthened within the very same process. and projects individual identity. the term fashion is rarely used in reference to nonwestern cultures. non-western dress is costume because it is unchanging. encodes deep meanings. (Craik 1994: 18) In Craik’s opinion one can recognize fashion-like changes in outer appearance in various cultures and ages – whenever and wherever people express their individuality in decoration and an openness to change. cf. The pleasures of novelty The fashion pattern satisfies the demand for novelty.TASTE AND FASHION individual actors involved in them – as if they were following some hidden plan unknown to the individuals. fashion. in the sense of experiencing something new. As Immanuel Kant (1980: 572) knew. In this sense they resemble the economic market for which Adam Smith’s ‘invisible hand’ and Immanuel Kant’s ‘Naturabsicht’ were metaphorical expressions. they are willing to distinguish themselves from others and emphasize their own individuality and uniqueness by adopting something new. in fact. Mandeville was the first to believe that private vices could. a perpetuum mobile. innovation and imitation constantly and eternally follow one another. in fact. is a typical self-dynamic (or autopoietic. also giving them a free hand to act or choose as they want. rather. As Mayntz and Nedelmann (1987: 654) understood it. which is essential to fashion. it is the demand for novelty. they are willing to be integrated into a social group by imitating others. The mechanism of fashion is like a merry-goround or. A novelty adopted by everyone is no more a novelty and has to be supplanted by another ‘real’ novelty. The activity of individuals is motivated by two opposing social forces or goals. they seemed to be something which belonged to the very sociability of human nature. As Mayntz and Nedelmann claimed. The merry-go-round of fashion which Mayntz and Nedelmann described (developing Simmel’s ideas) does not. As Appadurai (1986: 22) pointed out. To individual actors such processes appear socially coercive while. be public virtues. On the one hand. realize all the criteria of a selfdynamic process. and in so doing give rise to one another. Thus. there is a question of both social identification and distinction in fashion. on the other. as recognized and analysed by Georg Simmel. the resulting process is self-dynamic because these opposite stages of making a distinction and emulating others automatically follow each other. not shared by others. Luhmann) process. fashion 77 . According to Simmel. paradoxically. In Simmel’s opinion. Even though the actors’ motives emerge from the process – in the sense that imitation always gives rise to a new phase of distinction and the subsequent stylistic innovation – the basic social motivations behind imitation and distinction cannot be explained by this process alone. always giving rise to a new cycle of imitation and innovation. The hedonism of the modern consumer is inherently selfillusory because total fulfilment can never be achieved (cf. 1982: 334). It is thus quite feasible to claim. even referred to the fact. There cannot be any progress in fashion. had to be new. the demand for novelty assumed almost manic features. well known from other sources of the history of ideas. Members of the middle classes were understood to be people – certainly with a generous income – who adopted the new lifestyle or. All the commodities were ‘new’ and they were advertised as such. which formed the main market for the new mass products in England. also Falk 1994: 129– 45). Barthes 1983: 300) is a desire which can never be fully satisfied: ‘The desiring model constitutes a state of enjoyable discomfort. the demand for novelty is satisfied over and over again. who were modern people. In fashion. ‘improvements’. The potential of nature and man to produce endless variations was not doubted for a moment: florists offered new plants and flower seeds. (1982: 332) have pointed out. at the latest. during the eighteenth century at the latest. rapid turnover. It is. As economic historians have shown. As McKendrick et al. Even Campbell identified the new consumer with the middle classes. the illusion of total access and high convertibility’. As the authors said. The ‘novelty mania’ (cf. One could claim tentatively that the main characteristic of a modern consumer society is that in it the extension and social influence of fashion has greatly increased. Everything. that contemporaries shared the common consciousness of belonging to a new age. ‘no consumer society could exist without the belief in modernity’ (McKendrick et al. became guarantees of a good product and were widely used in advertising and marketing. McKendrick et al. that the new hedonist was born during the eighteenth century.TASTE AND FASHION ‘suggests high velocity. ‘Good taste’ is always being followed by another ‘good 78 . despite – or because of – the fact that fashion often only repeats and varies old styles and models. as Campbell did. however. the demand for novelty was characteristic of the markets for mass consumption goods from the very beginning. in other words. even the products of nature. ‘produced according to the latest method’ and ‘latest fashion’. In such a society new collective tastes are being born – and are dying – at an increasing tempo. not possible to try to reduce the determinants of these new classes to any well-defined social positions. Even dogs and horses had to be new. During the eighteenth century. and wanting rather than having is the main focus of pleasure seeking’ (Campbell 1987: 86). the Weber parallel could even be extended to question whether the commodity market and fashion mechanism. was to find the intellectual origins of the spirit of modern consumerism. In such a case. fashion is created intentionally by designers and producers. he wanted also to be a self-illusory hedonist. Originally fashion was not consciously created. fashion can be experienced and lived as a mechanism of social coercion. of his or her subjective motivations. once firmly established as a self-dynamic process. it cannot be conceived of without the spirit of modern hedonism. could completely do without this spirit. If this ethos was institutionalized in the market of mass consumption goods in the same way as the spirit of 79 . Mayntz and Nedelmann shared Simmel’s opinion that it is the novelty in fashion which enchants. at least partly. the early puritan did not just want to be a devoted professional. Under the influence of a fashion industry. Even if his interpretation of the intellectual origins of the modern consumer was adequate. The desire for change can become a duty. however. As such it can also lose the charm it exercises over consumers. one could thus claim that the modern hedonist was not born during the period of late capitalism but had already played an important role in the genesis of this modern economic system. Once it has been institutionalized. He put forward the provocative thesis that it emerged from the same source as Max Weber’s spirit of capitalism. To paraphrase Weber.TASTE AND FASHION taste’ creating order in an increasingly individualized and aestheticized (cf. he did not analyse in detail the possible future destiny of this romantic ethic. ‘Berufsmensch’. There are some interesting problems related to Campbell’s thesis. from the inner tensions of the Protestant ethic of the seventeenth century. fashion becomes. The more rapid the transformation of fashion the more enchanting and seducing it becomes. independent of an individual’s will of distinction and imitation and. Schulze 1992) modern society. The actors can. The main purpose of Campbell’s study. in general. Following Campbell’s argumentation. Just as capitalism could not have emerged without the ascetic spirit analysed by Weber. However. Werner Sombart was an early critic of Weber who paid attention to this fact (see Sombart 1986 [1913]). The Romantic Ethic and the Spirit of Modern Consumerism (1987). Such a fashion resembles a formal scheme. In fact. it was born as a side-product of purposive social action which had totally different aims of its own. together with other similar self-dynamic processes fashion has a tendency to become routinized and formalized. gradually learn to recognize and make use of this ‘objective’ formal mechanism. In other words. Such complaints of manipulation certainly are common enough in popular criticisms of advertisements. or novelties are too few and predictable. an ordinary outfit is chosen by the consumer. Following Simmel’s social psychological formulation one could express the same thing as follows: either there can be too many stimuli and they can change too often. But this would presuppose that every fashion style returns eternally in more or less exactly the same form. one can understand Mayntz and Nedelmann to be arguing that consumers do not want the marketing and advertising agencies to force novelties on them by excessive persuasion and manipulation.TASTE AND FASHION capitalism was thought by Weber to be institutionalized in the functional mechanism of the capitalist firm. in fact. (See Mayntz and Nedelmann 1987: 654. In the first case irritation and withdrawal would follow as a natural consequence. Or is it possible that the hedonistic ethic still needs to be revitalized from time to time and emerge anew as the ethic of a ‘new’ middle class? In Mayntz and Nedelmann’s opinion. only dullness would reign. consumers can get tired of continuous change and ‘eternal’ novelties and resort to something which is known and safe. instead of a fashionable set of clothes. Second. however. in the second. it could be a reaction to another and theoretically more interesting phenomenon: one could imagine that the consumer simply gets tired of the eternal ‘Sisyphus’ labour of fashion.) In the above example concerning the possible reactions to fashion one should. be new and would lose its power to enchant and seduce. such a fully developed fashion mechanism can provoke a counter-reaction as is the case if. First. By doing so. they can feel ‘at home’ in their clothes and oppose the alien social forces which tie them to a mechanism of perpetual change. distinguish between two different alternatives. Then the new would not. would it not imply that it would be transformed into a purely mechanical principle? Fashion would become an objective mechanism alien to the individual and forcing him or her repeatedly and eternally to consume the latest thing – and the same article as all the others – irrespective of personal desire. the whole analysis would end up in the rather common and trivial conception of manipulation which explains consumer behaviour in terms of – more or less automatic – responses to the demands and imperatives of a capitalist economy. Fashion could therefore increasingly get rid of all individual subjective motivations and aspirations. 80 . thus depriving them of the personal joy of invention and the chance to express their own genuine choice. In this case. g. As retrofashions have taught us (see also Matthiesen 1988) fashion is hardly ever repeated in totally the same way.TASTE AND FASHION What is then the opposite of fashion. fashion can never be petrified. anti-fashion? According to Simmel as well as to Mayntz and Nedelmann it would be a uniform. The proper reaction to coercive and forced change is ‘a combinatory self-stylization’ (Noro 1991: 112) or the free and creative combination of the various elements offered by contemporary fashion at any one time. 81 . a unified dress worn by all. functionally differentiated society. Thus. but seldom is it presented as something absolutely new either. Those who love a uniform long for reason and order. Even though Mayntz and Nedelmann are cautious in their evaluations they seem to think that such self-dynamic processes as fashion are due to become more common in the modern. the second would make everyone a completely separate personality. the old is never exactly the same and. it could just as well be a totally individual set of clothes worn by every single person alone. in any case. By doing this retro-fashion can increase our sense of history and – in the best cases – make our relation to fashion and change more reflexive. As Arto Noro (1991:110–13) has pointed out. the ignorance and avoidance of fashion would demand the restriction of all social interaction to its minimum. e. anti-fashion is not the only and not even the most convincing reaction to the modern fashion mechanism and to the over-excitement or the threat of repetition alternately associated with it. unconnected by any social ties at all. Both on the basis of Simmel’s visions and her own empirical studies about fashion. The first case would be synonymous with total lack of individuality. more subtle distinctions. Highly individual styles emerging from this process can thus be transformed into ideals or models of new fashions and targets for further stylization. In principle. it is presented in another and new context. by the contemporary ‘street fashion’ which takes its designs from the modern ‘dandies’ of the street. Ann-Mari Sellerberg (1994: 60) has listed six dualisms characteristic of modern fashion: 1. it generates complexity. When it repeats the old. Fashion reduces social complexity and at the same time. as has been proved. those who prefer uniqueness are afraid of losing their individuality. for instance. It continuously gives birth and demands perpetual self-criticism and innovation. due to its way of functioning. In the same way as Rousseau thought that a person should grow up in social isolation in order to be able to recognize his real needs and develop his sense of true self-love. characterized as it is by many ambivalences concerning social goals and aims. a consumer society conceptualized along such lines is. Thus. one could say that the very intensification of fashion. the new and functional is exhausted and transformed into old and useless in an increasing tempo. In its functioning. 6. and these styles are formed without any earlier models or ideals. fashion feeds on and lives through the concrete. Less attention has been paid to the fact that many of Simmel’s essays on various social phenomena can also be 82 . a consumer society – or an abundant society – is a society of fashion and mass fashion in particular (cf. On the other hand. because there cannot possibly be any objective criteria which could determine what is really needed or what is superfluous. Fashion is both accessible and inaccessible. influenced by his reading of Immanuel Kant’s aesthetic writings. Fashion involves responsibility as well as freedom from responsibility. In a preliminary manner. fashion is subversive of every convention and authorized rule. however. Fashion contains very precise rules and regulations regarding what is ‘in’. of necessity. New styles follow one another. and Critique of Judgment in particular (see Frisby 1992 and Davis 1973).TASTE AND FASHION 2. because its members can never be satisfied. What separates us from the previous centuries is that the cycle of fashion has become more rapid. 5. Such a society cannot actually recognize and has no answer to the problems of excessive or superfluous consumption. they are both willing and eager to approve and consume the ‘newest’ article in the numerous fields of commercial life. modern consumer-hedonists have a positive attitude towards fashion and its eternal supply of novelties. both its spread into new fields and the increase of its influence in old fields. is the most typical feature of a consumer society. Horowitz 1975a). always a society of scarcity. 4. 3. Consequently. Furthermore. Our attitude towards fashion today consists both of intense involvement and detachment. On the one hand. in many ways. THE SOCIAL FUNCTION OF STYLE AND FASHION Immanuel Kant and Georg Simmel on fashion Georg Simmel’s idea of a formal sociology was. fashion is indifferent to the material and practical. This. Fashion is a living antinomy: it does not have to make up its mind whether to be or not to be.TASTE AND FASHION understood and read as extended commentaries on Kant’s ideas or suggestions – often not forming any essential part of Kant’s own thinking and mentioned only in passing. ‘the pretended merit or value of the competing models cannot be demonstrated through open and decisive tests’ (Blumer 1969: 286. is the case with Simmel’s famous essay(s) on fashion. in particular. no hint in Kant’s treatment of fashion to suggest that he would have thought the social significance of fashion to be even nearly as important as Simmel later thought it to be. but obviously this social phenomenon was not considered to be worth any extensive treatment. fashion has nothing to do with genuine judgments of taste (‘Geschmacksurteil’) but is a case of unreflected and ‘blind’ imitation. moreover. Fashion regulates only things that could just as well be otherwise or. however. fruitful to read Simmel’s essays on fashion as critical commentaries on Kant’s Critique of Judgment or as ironic comments on his ideas about taste and beauty. As Kant also knew. According to him. As such it is opposed to ‘good taste’. It is. To Simmel. It is. however. it is interesting to note that Kant shared Simmel’s opinion that it is far better to try to follow fashion than to try to avoid or totally neglect it – an effort as futile as it is impossible (‘It is better to be a clown of fashion than to be a clown without fashion’ – Kant 1980: 572). fashions are transitory – otherwise they would be transformed into traditions.2 As Colin Campbell (1987) has suggested there is an important affinity between fashion and taste. Frisby 1985: 40–1)). Rather. see also Gadamer 1975: 34). There is. fashion helped to overcome the distance between an individual and his society and it was a phenomenon of modernity par excellence (Simmel shared Baudelaire’s idea about fashion as ‘contingent. he shared an attitude towards fashion common among learned men of his time (cf. Immanuel Kant made a short comment on the significance of fashion in his writing on anthropology (Kant 1980 [1798]: 571–2). transitory and fugitive’ (cf. Still. It stems only from man’s vanity and social competition in which people try to get the better of each other and improve their social standing. because it can both be and not be at the same time. Fashion can be understood to be a de facto solution to the main – and theoretically unsolvable – problem inherent in the aesthetics of taste of the 83 . the principle of novelty which enlivens fashion and lends it its special charm (Kant 1980: 572). Gadamer 1975: 34). Kant discussed fashion in the context of taste. Kant’s ideas cannot be said to be very original either. as Herbert Blumer put it. (Simmel 1981 [1904]: 6–7) In Simmel’s opinion it was Immanuel Kant who. it can be said to form a universal standard of taste which. Fashion offers a socially valid standard of taste which is only based on the individual preferences and choices of the members of the ‘community of tastes’. even though he did not formulate it in quite the same terms or quite as explicitly. allows for the singularity and subjectivity of individual tastes. At the same time it modifies to no lesser degree the need for differentiation. . In the same way. It is a socially acceptable and secure way to distinguish oneself from others and. it leads the individual along the road which all travel. more clear-sightedly and more profoundly than any other before him. it furnishes a general condition. and in a sense exemplary. Sociology could thus make an invaluable direct contribution to the philosophy of life. which resolves the conduct of every individual into a mere example. There is strong evidence that Simmel was aware of this parallel. had in his Critique of Judgment formulated this great problem facing every modern individual.TASTE AND FASHION eighteenth century. was obviously the main problem facing people in modern society. In order to avoid misunderstandings it should be pointed out that fashion obviously does not share the ideal. however. In the most general terms. at the same time. it satisfies the individual’s need for social adaptation and imitation: Fashion is the imitation of a given example and satisfies the demand for social adaptation. the modern city offered an ideal arena for the two principal ways – which are always in opposition to each other – of allocating roles to individuals. Both principles are logically exclusive – but their opposition is overcome daily in modern society. in his opinion. . In The Metropolis and Mental life (1950 [1903]: 423). character of ‘good taste’. In this sense Simmel read Kant 84 . the tendency towards dissimilarity. whereas the second principle dictates that every human being is unique and irreplaceable as such. fashion is a societal formation always combining two opposite principles. According to the first principle. all men are equal and share a common substance of humanity. but still can be said to be equally binding or obliging in relation to the individuals concerned. the desire for change and contrast on the one hand by a constant change of contents . Simmel’s analysis of social formations often aimed at showing how they all offer – at best – provisional societal solutions to a problem which. A false judgment of taste was caused either by ignorance or error. Still. The antinomy of taste As Howard Caygill has recently shown (1989). the old saying ‘De gustibus disputandum non est’ did not originally mean that every man had a taste of his own which was of no concern to others. Expressed in the most general terms: ‘Two social tendencies are essential to the establishment of fashion. judgments of taste concerning the beauty of objects were ultimately based on feelings of pleasure and 85 . thus. the need of union on the one hand and the need of isolation on the other’ (Simmel 1981: 8). at least in principle. generally shared by all. in a sense. To him Kant was not a bourgeois ideologist who tried to reconcile the unreconcilable: on the contrary.’ As Simmel tried to show in great detail. Kant’s aesthetics try to show how it is possible for the individual to be genuinely free and autonomous without degenerating into a state of isolation and lawlessness (Simmel 1905a: 168–9): ‘In any case. the modern fashion pattern constitutes a social formation which operates like an over-individual scheme through which an individual can express his loyalty to and strengthen his social ties with the ‘norms of his time’ without losing his ‘inner freedom’ (see Simmel 1986: 57). the two parallel traditions of thought (German Polizeiwissenschaft and British empiricist aesthetics) which Kant confronted in writing his Critique of Judgment and which. he had. There could. According to this interpretation. Aesthetics were not in any straightforward manner understood to be dealing with a political question. namely. posed a real and serious problem. On the contrary. matters of taste were thought to be self-evident and judgments of taste.TASTE AND FASHION in the same spirit as Terry Eagleton today. As argued earlier. be no reason or ground to argue about them. But Simmel was not an ideology-critical thinker. in fact. he tried both to unite and to overcome in formulating his famous antinomy of taste. the opposition between individual autonomy and social order could not only be discussed but was obviously also thought to be felt and experienced in the most tangible form in the aesthetic sphere. it is one of the first and one of the most profound attempts of reconciliation in the aesthetic sphere between the indispensable individual subjectivity of the modern man and the equally necessary overindividual community. can be understood to be dealing with exactly the type of questions emerging from Simmel’s reading of Kant. even people of similar origin were seldom seen to agree on their judgments. of which its representatives were only partly aware. According to Kant’s definition of (pure aesthetic) taste. And practice obviously demanded time. We can dispute about taste but not present reasons for or against it. in principle. a problem inherent in the tradition. Hutcheson and Addison. at least potentially. In these discussions. however. only a fool could fail to make the proper judgment. As Dr Armstrong wrote in 1702: ‘As of beef and port. it is the ability to judge or choose in a universally valid way (‘allgmeingültig zu wählen’) (Kant 1987: 86 . There was. could be shared by all regardless of social origins. As Edmund Burke (1987) quite seriously claimed in his treatise concerning the beautiful and the sublime – probably the best-known work on aesthetics during the eighteenth century – once the possibility of error had been overruled. presenting his famous antinomy of taste.TASTE AND FASHION displeasure: what felt good was both right and beautiful (see Hooker 1934 and Campbell 1987). whereas the second claims that the basis determining such a judgment cannot be expressed in any determinate concepts. the physiological or gustatory sense of taste often acted as a model for the aesthetic judgment of taste. even though it had to be admitted that its proper exercise demanded practice and the presence of suitable examples to be followed. and distinguishing beauty from ugliness. For the first time it was now possible to think that all human beings had similar taste: the hunger of a king did not. the revolutionary nature of the standard of ‘good taste’ should not be forgotten. making judgments of taste. On the contrary. was as self-evident and easy as telling salt from sugar. The first amounts to saying that any judgment of taste is merely subjective. for example Hume. and report of wit’. In particular. Kant said that there are two commonplaces: (1) everyone has his own taste and (2) there is no disputing about taste. judge for yourself. Still. Good taste was a Bildungsbegriff. differ from the hunger of a beggar. In his Critique of Judgment. Thus. were by no means so naive as to think that people’s choices and preferences actually tended to converge. only men of considerable wealth could be expected to show good taste in their daily manners. It was something which. The representatives of this tradition. It was explicitly formulated first by Kant: how could something which was exclusively based on the subjective feeling of pleasure (see Kant 1987: §31) be universally valid? The feeling of beauty requires that it be shared universally. TASTE AND FASHION §20). But what kind of universal validity of judgments is it which shares only the universality of a single judgment (‘die Allgemeinheit eines einzelnen Urteils’) and cannot, consequently, be equal to any logical and conceptual universality, and for which there cannot possibly be any a priori grounds of acceptance (ibid.: §31)? The universality cannot be gained by means of a concept that deals with the contents of the judgment of taste (see Lyotard 1988: 37). In Kant’s own words, we are dealing here with something which can be referred to as ‘non-conceptual subjective universality’: We want to submit the object to our own eyes, just as if our liking of it depended on that sensation. And yet, if we then call the object beautiful, we believe we have a universal voice, and lay claim to the agreement of everyone . . . (Kant 1987: §8) In particular, there cannot possibly exist any general standards or criteria according to which one could judge an object to be beautiful. The power of judgment operates ‘as if’ with examples (see ibid.: §18). Kant emphasized time after time that this subjective universality had nothing to do with the empirical generality of a belief or a preference: ‘Since a judgment of taste is in fact of this sort, its universal validity is not to be established by gathering votes and asking other people what kind of sensations they are having’ (ibid.: §31). The fact that something is generally liked does not justify our calling it beautiful. The universality of aesthetic judgments which Kant had in mind is totally of another kind. In his opinion, we should be equally careful not to blend genuine aesthetic (disinterested) pleasure with sensual pleasure: it is, in principle, a different matter to say that one likes oysters than to say that Titian’s paintings are beautiful. Kant’s community of the united tastes As Kant pointed out, in presenting an aesthetic judgment, despite the fact that it is ultimately based on our subjective feelings alone, we cannot avoid expecting others to join in our appreciation of the object of beauty – otherwise, the judgment would not be a real judgment of taste. The judgment of taste must have a ‘subjective principle, which determines only by liking rather than by concepts, 87 TASTE AND FASHION though nonetheless with universal validity, what is liked or disliked’ (Kant 1987: §20). But how can such a claim to universality be justified? Kant’s ‘solution’ to the problem is the postulation of a ‘sensus communis’, a communal sense, or a community of feeling and taste. Every time we make a judgment of taste we are, in fact, presuming that such a community exists. It is this idea of a community of taste that makes Kant’s discussion especially interesting as far as a sociology of fashion is concerned, even though Kant would without doubt dismiss the whole question by saying that a community of fashion is only empirical and, as such, it cannot possibly have anything to do with the universality expected from aesthetic judgments. The different characterizations of this sensus communis given by Kant are rather problematic and difficult to interpret, as evidenced by the long history of commentary. At some points, Kant seemed to define it in purely negative terms: such a community must be postulated, otherwise judgments of taste would be impossible; but, on the other hand, it is only constituted if the judgments – or feelings – are, in fact, universally shared (see Kant 1987: §20). At first glance, Kant’s argument would seem to be almost a circular one. The idea of a communal sense, ‘Gemeinsinn’, obviously gets some support from the fact that we are indeed able to communicate both our knowledge and feelings (ibid.: §21). In the traditional interpretation which was presented by Georg Simmel in his lectures on Kant, the question of the possibility of a shared ‘Gemeinsinn’ was reduced to the rather metaphysical idea of a community of souls. Aesthetic experiences, find a common basis of resonance in all human beings because they all, in the last instance, have a soul with similar spiritual functions: And this vague awareness, that the most basic functions of our spirit are here in operation, functions that are identical in all souls, lets us believe, that these judgments are not ours alone. As a matter of fact, we do believe that every one would judge in a similar way, if only he could approach the object (‘das Object zulassen’) in the same way. (Simmel 1905a: 168) There are some formulations in Kant’s own writing which certainly would lend support to such an interpretation: 88 TASTE AND FASHION A judgment of taste is based on a concept . . . but this concept does not allow us to cognize or prove anything concerning the object because it is intrinsically indeterminable and inadequate for cognition; and yet the same concept does make the judgment of taste valid for everyone, because . . . the basis that determines the judgment lies, perhaps, in the concept of what may be considered the supersensible substrate of humanity. (Kant 1987: §57) There is, however, another possible interpretation which is less orthodox but more interesting and which has recently been suggested by Lyotard, in particular (see Lyotard 1988; see also Weber 1987 and Santanen 1991). According to this interpretation, Kant’s community of taste is only a regulative idea or, rather, a promise which can never be realized. The community can never come into being: The aesthetic community, therefore, remains, as Kant puts it, only an idea, or as I would say, a horizon for an expected consensus. Kant used the word ‘promise’ in order to point out the non-existent status of such a republic of taste (of the united tastes?). The community concerning what is beautiful has no chance of being actualized. But every judgment carries with it the promise of its universalization as a constitutive feature of its singularity. (Lyotard 1988: 38) The universality should be sought only in the form of the demands (ibid.). Or, as Kant put it, in making a judgment of taste we do not, in fact, postulate that everyone agrees with us on the matter; we only, so to speak, propose that everyone joins in the same community of feeling.3 Everyone else must, at least, be able to experience the same aesthetic feeling. When we call an object beautiful we make a call to the other and ‘believe ourselves to be speaking with a universal voice and lay claim to the consensus of everyone’ (Kant 1987: §8). In Kant’s own words: The judgment of taste itself does not postulate everyone’s agreement (since only a logically universal judgment can do that, because it can advise reason); it merely requires this agreement from everyone (sinnet jedermann), as an instance of a rule. . . . Hence the universal voice is only an idea. (ibid.) 89 TASTE AND FASHION Fashion and taste If asked, Kant – and Lyotard too – would certainly hasten to add that this kind of a ‘non-existent’ consensus or harmony of feelings has absolutely nothing to do with the universality of fashion which is always ‘only’ empirical by its nature. Still, Simmel’s characterization of the fashion pattern includes features resembling, to an amazing extent, Kant’s idea of sensus communis as interpreted by Lyotard: The kind of consensus implied by such a process, if there is any consensus at all, is in no way argumentative but is rather allusive and elusive, endowed with a special way of being alive, combining both life and death, always remaining in statu nascendi or moriendi, always keeping open the issue of whether or not it actually exists. This kind of consensus is definitely nothing but a cloud of community. (Lyotard 1988: 38) Like Kant’s consensus of taste, fashion, too, is in a perpetual state of coming into being and dying. It never actually exists. ‘To be in fashion’ is constantly transformed into being ‘out of fashion’. There is a tendency towards universalism inherent in every fashion, but this tendency can never be fully realized. As soon as a fashion permeates everything, it stops being a fashion: As soon as the example has been universally adopted, that is, as soon as anything that was originally done only by a few has really come to be practised by all – as is the case in certain portions of our apparel and in various forms of social conduct – we no longer speak of fashion. As fashion spreads, it gradually goes to its doom. . . . Fashion includes a peculiar attraction of limitation, the attraction of simultaneous beginning and end . . . (Simmel 1981: 9) Colin Campbell (1987: 154–60) suggested – without explicitly referring to Kant’s antinomy – that there is a problem inherent in the aesthetics of taste which cannot be solved theoretically: Fashion became the de facto answer to the problem which none of the eighteenth-century writers on taste would solve; that is, how to find a commonly agreed, aesthetic standard which, while catering for people’s 90 Strictly speaking. potentially applicable to all members of a society. Fashion does not share the same ideal and. in fact.TASTE AND FASHION real preferences. without actually being one. Blumer 1969). made it sound almost as if the social pattern of fashion had. It offers a universal standard. the fashion pattern cannot satisfy all the criteria presented by Campbell. One would be on firmer ground by claiming only that fashion is a functional equivalent to the principle of good taste. in modern society. could also continue to serve as the basis for an ideal of character. Campbell was able to catch something essential in the role played by fashion in modern society: fashion does function as a substitute for the standard of taste. fashion fulfils a social role similar to the one originally expected from the standard of good taste. (ibid. as suggested by Claude Fischler (1990: 204–17). At the same time. whose main preoccupation was the search for the intellectual origins of the self-illusory. fragmented world (cf. in this sense. Thus. Everyone is supposed to choose what feels good. it can be said to create order in the modern. But. hedonistic. the modern consumer – or modern eater – does not necessarily live in a state of permanent anomie. obliging.: 158) The only solution available is a practical one: the contemporary fashion pattern. it is a standard which is socially communicable even though it can never be conceptually determined. Gadamer 1975: 34–5. Campbell. they are functional equivalents (cf. Fashion provides a socially binding standard of taste which effectively influences and directs individual consumer choices. modern consumer. Taste always refers to the preferences and choices of an individual and is totally private by its very nature. been invented in order to satisfy the theoretical need to solve the antinomy of taste. It is an ideal which everyone is supposed to follow. Campbell’s thesis should rather be read to claim that. Appadurai (1986: 32) who compared the role of fashion with that of sumptuary laws). in other respects. despite his autonomy and freedom. also see Simmel 1981). the ideal of good taste is meant to be beyond the individual. If Campbell is right. it also means that. To a great extent. Thus. contemporary fashion plays a role similar to traditional norms – or 91 . nature as the principle of good or legitimate taste. and to be socially binding. It cannot possibly ‘serve as the basis for an ideal of character’ in the sense demanded by the tradition (cf. Furthermore. Veblen 1961) in believing that the creations of fashion were more often ugly and. disgusting.TASTE AND FASHION standards – of good taste in guiding the modern consumer in the perplexing task of selecting proper meals and socially accepted foods and drinks. identified aesthetic with ‘other’ objective expediency. it shares precisely that peculiar feature which was suggested by Kant to distinguish aesthetic pleasure from both sensual pleasure and every utilitarian consideration: ‘Beauty is the object’s form of purposiveness insofar as it is perceived in the object without the presentation of a purpose’ (Kant 1987: §17). or other expediency. or an end dictated by 92 . However. Simmel. this necessarily means that all such considerations which have to do with the usefulness or purposiveness (‘Zweckmässigkeitsbeziehungen’) of objects are totally out of place in fashion: This is clearly proved by the fact that very frequently not the slightest reason can be found for the creations of fashion from the standpoint of an objective. The world of fashion is full of ephemera. On the contrary. The charm of novelty and transitoriness offered by fashion (see Simmel 1981: 47) is a purely aesthetic pleasure. In Simmel’s understanding. for example. The objects of beauty have a form of finality as if they had an objective end. The parallel between fashion and judgments of taste goes even further. aesthetic. whether wide or narrow trousers. Fashion is a thoroughly aesthetic phenomenon in the Kantian sense. as far as the individual is concerned. But it would be impossible to defend such a stance once Simmel’s other and more principal formulations about fashion are taken into account. In other words. colored or black scarfs shall be worn. either serving an outer purpose or need. Simmel certainly shared the prejudice of his contemporaries (cf. there is not a trace of expediency in the method by which fashion dictates. from an aesthetic point of view. Kant also dismissed the relevance of such classical criteria of beauty as harmony and perfection. they are transitory and constantly changing. curiously enough. While in general our wearing apparel is really adapted to our needs. (Simmel 1981: 7) In the quotation presented above. fashion does not recognize any objective criteria or reasons. To Simmel – as well as to Kant – fashion only regulates things that could just as well be otherwise. These guidelines offered by fashion are not fixed. If fashion does not obey the criterion of objective reason. the norms can still be felt to be almost equally binding and obliging as were traditional norms – or eating habits and table manners. ‘formal’ one (see Simmel 1981: 7). It is also a different thing to say that fashion has consequences for social stratification. It is. furthermore. the function of the whole fashion pattern. But even though one can find in Simmel’s later essays formulations and ideas which make it clear that he did not think that the only distinctions making up the dynamics of fashion were class distinctions (see Noro 1991: 70–5). The usefulness of objects as markers of social distinction is obviously different from. than to claim that individuals consciously make use of objects of fashion in order to climb up the social ladder. modern mass fashion operates in a rather different way. a criterion which. than to claim that they consciously make use of them in order to promote their own social standing. a different thing to say that people enjoy fashionable consumer goods because of the feeling of novelty associated with them. Fashion.TASTE AND FASHION its inner nature. is of a different kind than any judgment of their aesthetic worth. in principle. The whole secret of fashion consists of the process of collective taste formation. their ability to satisfy needs. In Blumer’s own opinion. It is. But still it would offer an independent criterion according to which one could judge their merits. say. in fact. however. it still cannot be denied that he shared with many of his contemporaries the model according to which fashions have their origins in the upper strata of society from which they then descend – more or less slowly – the social ladder: the fashions of the upper stratum of society are never identical with those of the lower. hence. as characterized by Simmel. But Simmel also seemed to think that consumer goods are used to satisfy the ‘social-psychological’ need of individuation or distancing oneself from others. fashion does have a ‘purpose’ – or function – but it is a purely social and. Class fashion or mass fashion? Simmel’s essay has dominated much of the sociological discussion about fashion up to now to such an extent that Herbert Blumer (1969) made him responsible for the generally held conception that fashions are class fashions. And it is not always clear whether Simmel has in mind the first or the second process or mechanism. Blumer obviously was only familiar with Simmel’s first essay. and not of any single object of fashion. but they do not have either end. seems also to have such a form of finality without satisfying any needs. only the form of finality (see Kant 1987: §§11–15). they are abandoned by the former as soon 93 . As a matter of fact. Blumer’s (1969) analysis of fashion comes closer to Kant’s idea of a sensus communis than Simmel’s does. The main problem with Blumer’s characterization of the fashion pattern is that he does not give any reasons for its continuous dynamics: once the collective taste 94 . according to Simmel. Whereas Simmel strongly emphasized the demarcating role of fashion. . has proposed. . (For a recent discussion. is a product of class distinction . see Jones 1991. The dynamic of the fashion pattern has been understood to result from the fact that once the lower classes have succeeded in adopting a new style or mode of social conduct. Blumer is. certainly studied the movement of fashion in the class hierarchy from the top down in most of his examples. right about Simmel in that he. who used the Paris fashion market and fashion shows as empirical examples. and the second mainly within. In at least one respect. What was primary in fashion. the function of which is to accentuate one’s individual uniqueness – a tendency becoming more important because of the great levelling impact of money in modern society – Blumer. Georg Simmel did not see fashion only in this way. too. Simmel also laid special emphasis on how fashion abides in the middle stratum of society. Such a view is certainly supported by historical evidence concerning the operation of fashion in earlier capitalism. was its form. . In his remarks concerning the latest development of contemporary fashion. It is only the middle stratum – the vast middle class – that follows and initiates the rapid changes which characterize the movement of fashion (see Noro 1991: 72–3). . . classes. . which does not in principle require a class hierarchy.)4 Simmel’s idea of fashion as combining the opposite motives of distinction and imitation is thus often understood as if the first motive would operate mainly between. the upper ones have hastened to abandon it in order to find new styles to mark their superiority and distinctiveness. was mainly interested in the process through which a collective and uniform taste was distilled out of numerous individual tastes. Fashion. among others. it has been typical to think that fashions unite members of a social class while demarcating classes from one another. however. . (Simmel 1981: 7) Following Simmel’s ideas. Contrary to what Herbert Blumer (1969: 277). the simultaneous movement of social identification and differentiation. .TASTE AND FASHION as the latter prepare to appropriate them. Once works of art are appreciated for their novelty and surprise value – as is increasingly the case in modern art – the problem becomes even more accentuated: what makes an object a work of art? Style is something that is common to different works of art. And the impetus to set oneself apart as an individual by choosing differently is already given by the fact that once a taste has been generally adopted it becomes impossible to recognize it as one’s own and to identify oneself with it. suggested that style makes art a distinct functional social system. The function of style is to organize the contribution of a work of art to 95 . would be the dissolution of a drop of liquid in a basin containing a liquid of a different colour. more apt than that of the social ladder. It has become completely anonymous. Lifestyle. in an article written in 1986.TASTE AND FASHION has been reached there would not actually seem to be any reason to break away from the consensus. They are understood to be closed and self-sufficient entities that only have a goal in themselves. style makes it possible to determine which objects are to be regarded as art. new works of art. the opposite version. Art objects as such are characterized by a high degree of autonomy. Without style there would not be any separate system of art at all. In setting themselves apart in order to emphasize their individuality and uniqueness. and what is their special contribution to the system of art: It is the style of a work of art which makes it possible to recognize what it owes to other works of art and what is its importance to further. it nevertheless is not without significance in the characterization of the individual. If one reads Simmel’s writings on fashion through Kantian eyes one could suggest that the ‘need of differentiation’ does not only include a ‘tendency towards dissimilarity’ but also a ‘tendency towards similarity’. individuals also expect others to approve of their choice and share their taste. style of art and fashion Niklas Luhmann. for it emphasizes his personality not only through omission but also through observance’. shared by many. A metaphor for the spread of fashion. which emphasizes the logic of distinctions in fashion formation. Thus. ‘while fashion postulates a certain amount of general acceptance. On the other hand. As Simmel (1981: 10) wrote. often leads to the conception that the actors in this game are closed social groups which set themselves strictly apart from other social groups (see Simmel 1983: 63). applied art is supposed to have the character of style. can never be stylized. so to speak. One could then perhaps venture to say that ‘style’. otherwise they would lose their uniqueness and individuality. of broad generality . and to a certain extent. ‘Instead of the character of individuality. To use a concept taken from another tradition of thought it is a ‘real abstraction’ (‘Realabstraktion’). (Luhmann 1986: 632) Luhmann’s characterization of the function of style could have been taken from Simmel. . .: 65). In order to share a common style objects of applied art – or any objects – must have been produced in a special manner: they must be stylized. on the other hand. they cannot be unique. the particularity of the individual work is subjugated to a general law of form that also applies to other works. Genuine works of art. In some respects it comes closer to the older concept of ‘maniera’ traditionally designating the way to make things (see Link-Heer 1986). similar ideas: By virtue of style. 96 . to Simmel.TASTE AND FASHION the autopoiesis of art. . relieved of its absolute autonomy. Simmel quite obviously would not have wanted to deny the usefulness of the concept of style in art history. In Simmel’s words. But Simmel’s own concept of style is more ambitious. against the intention of the very work of art. Simmel’s concept of style differs from Luhmann’s in one important respect: Simmel thought that genuine works of art could not share a common style (cf. He must have been well aware of the common use of the concept of style which became established in the middle of the eighteenth century by Baumgarten. which aims at the closure of a single work. ’ (see Simmel 1991b: 67). Because objects of applied art are always meant to be used. . The style both corresponds to and contradicts the autonomy of a single work of art. Simmel 1985). Because it shares its nature or a part of its design with others it thus points to a common root that lies beyond the individual work . (Simmel 1991b [1908]: 64) However. is something more than a mere thought abstraction. it is. Only works of applied arts (arts and crafts) or designed products can have a style. They already have something in common: they all serve a specific useful purpose and satisfy a need that is common to many people (ibid. In his little known essay ‘The Problem of Style’ Simmel presented what are. in many respects. ’ (Simmel 1991b: 70). in the same way as one can speak of a personal fashion (see Simmel 1981: 13–14). which is not located in any of them alone. . see also Noro 1991: 92–3): ‘anyone who is not that strong must adhere to a general law. by his doing the objects receive a new centre. How is this possible? The suggested solution is a typical ‘Simmelian’ societal solution to a theoretically unsolvable antinomy.TASTE AND FASHION Simmel’s discussion of style is sociologically particularly interesting because he draws a direct parallel between the style of objects of use. in Simmel’s opinion – at least in an ideal case – consist of a compilation of pieces of furniture all representing different but generally approved and common styles. An attempt to try to surround oneself with objects that would have a strong personal flavour of their own would only end in total stylelessness (see Simmel 1908: 314. or even all. The furniture of a living room should. a member of the modern middle class) should be stylized in order to obey a common law and to be shared by others. and lifestyle. On the contrary. . but which they all manifest through the particular way they are united. As has already been pointed out. Simmel’s concept of a style has more to do with objects of consumption: the objects or commodities are stylized and not the way of life or the individual taste in themselves. one can also speak of a personal style. even though their lives are stylized. fields of life. in most. the possibility of which is reserved only for strong personalities (like Goethe). a borderline case. What makes Simmel’s comment so remarkable is the fact that he does not seem to think that the whole life of a person (say. or rather many different but common styles. Neither does he think that members of a society have to share a common lifestyle with other members of their class or other social group. In his opinion. We common folk have to be satisfied with something far less ambitious. Simmel does not postulate the necessity of any general principle. of stylized objects: as soon as the individual constructs his environment of variously stylized objects. if he fails to. criteria or disposition which would regulate his behaviour. however. his work fails to have style . Such a personal style is. (Simmel 1991b: 69) 97 . Simmel’s own example of furnishing a room can here serve to illustrate what he had in mind. all individuals are able to retain both their full individuality and uniqueness and to share a common style. In other words. Simmel did not explicitly discuss the relation between style and fashion. and universal and general on the other (ibid. the result would only show total lack of taste and find no response among his peers (see Simmel 1991b: 69–70). the difference is of no consequence: in producing consumer goods. However. Luhmann even has to admit that it is difficult – especially as far as the modern art world with its rapid stylistic innovations is concerned – to find any difference between style and fashion at all: The autopoiesis of art should thus resemble the change of fashion. Otherwise. but rather: how does the style of a fashion provoke the next one (Luhmann 1986: 655) The only difference that remains is the fact that art does not tolerate copies. and one should not ask so much what is the contribution of a work of art to a certain style. The community of fashion Simmel’s analysis of fashion – read through the correcting eyes of both Kant and Blumer – has taught us how a person can be a homogeneous part of a mass without losing his individuality – or how he can both stick to his own private taste and 98 . How can an individual belong to a ‘higher’ totality without losing his individuality? One could also imagine Simmel agreeing with Luhmann in arguing that style and fashion are. Only a genius of Goethe’s calibre – to use Simmel’s favourite cultural idol – could succeed in such an effort. But once the world of art is abandoned and the styles in applied art or of consumer goods are considered. indeed. functional equivalents. whereas copies make a fashion even more striking (see Luhmann 1986: 656). It would be an equally big mistake for a person to try to produce all the furniture totally according to his own private taste in order to create a private style of his own.TASTE AND FASHION If the room of a contemporary house consisted only of items representing a single style it would create a very sterile impression and the individual would not find any natural place in it. In the end. he obviously understood both style and fashion – in their particular fields – to make their contribution to solving the great problem of our times: how to unite or bridge the gap between something which is totally individual or private on the one hand. models are copied and style is something that characterizes the unifying features of both the copies and their original models.: 70). But to Simmel all such solutions to the conflict between the principles of individuality and sociability are only provisional. The bridge crossing the gap between the individual and his society has to be built over and over again. which is by far the most important standard99 . Alan Warde claimed that they all share the common idea that people living in a modern society are relatively free to choose and. Warde came to the conclusion that in general these currently dominant approaches to consumption assume far too individualistic a model of a consumer (ibid. In Simmel’s opinion the concept of style should be reserved only to the objects of design. Objects of art are always unique. Warde does not. and that in this process consumption plays a significant role (‘people define themselves through the messages they transmit to others through goods and practices that they possess and display’.5 Fortunately. Warde compared the situation with Durkheim’s famous study on suicide: it almost seems as if the modern consumer were a suitable candidate for the role of would-be suicide today. either. operating without any guidance or rules. in particular. however. to the persistence of conventions. Warde 1994: 878). The concept of style has more to do with the characterization of the objects of consumption. mention or pay any attention to the fashion mechanism. In discussing the social theories of Giddens. at the same time. Warde mentioned five different compensatory mechanisms from the advice given by mass media and personal contacts and networks. Social harmony is never within reach. As Lyotard said: the community of the united tastes is only a ‘cloud of a community’. Left to himself the modern consumer. Beck and Bauman.: 892). The importance of such conventions. contacts and influences cannot be denied. Finally. the symbols of respectability and all kinds of rules of etiquette. almost forced to construct their own identity. there are compensatory mechanisms. in Warde’s opinion. and they are not only remnants of a more traditional way of life.TASTE AND FASHION expect others – who also have a taste of their own – to share it. or even will assert their sense of personality against the trappings and fripperies of display and presentation’ (Warde 1994: 892). would be faced with anxiety. processes and institutions which reduce the anxiety arising from personal consumption. Otherwise Simmel’s and Luhmann’s conceptions of style do not differ from each other: in the modern society of mass consumption. there is the role played by complacency: ‘Many people appear content with their self-image. they are functional equivalents. whereas fashion characterizes the whole social pattern of distinction and adaptation. was a possible and even typical response to the problems caused by the increasing fragmentation of modern society. fragmented into separate moments which are not or only superficially linked. however. . needs and hopes. The individuality of individual taste is expressed in the relative weight which objects of different styles or fashions have in a compilation of objects. one would simply lose one’s social integrity (see Lohmann 1992:352–3) It is not surprising that a recent characterization of the consumer in post-modernity in Advances in Consumer Research (Firat 1991) could equally well be read as a ‘modernized’ summary of the results of Simmel’s analyses of fashion and style: The consumption life of the consumer is segmented. . . who is still free to choose what he or she likes. and can use the world of goods to help build and express his or her own identity. In Simmel’s understanding. and adopting the same consumption pattern represented by these 100 . interests. . that to represent the different images people will be acquiring and consuming the same products . The idea of style as ‘bricolage’ (see Hebdige 1983) would not then be restricted to modern youth culture but would rather characterize the whole of modern consumption culture from the very beginning. Even though their lives are stylized. members of a society are able to retain their full individuality and share a style or styles with others. The catch in the capitalist market system is. The taste expressed in a collection of goods surrounding a person is always both private and universal at the same time. Such a solution is in line with Simmel’s more general idea about modern individuality as an intersection of many spheres of life (see Noro 1991).TASTE AND FASHION setter in modern consumption. Social differentiation threatens the totality of the individual’s life by pulling it in opposite directions. Simmel’s suggestion of the necessity for a ‘stylized lifestyle’ in modern society can equally be seen as a further development of the idea concerning the role played by the various objects of consumption in the life of a modern person. in Simmel’s opinion. offering guidelines and models of orientation to the consumer. The development of a stylized lifestyle can be seen as a concrete example of the attitude of superficiality which. If one were to get involved with equal seriousness in every field of life. the division of labour – or social differentiation in general – had created a situation in which the individual is faced with conflicting demands. Each instance may well be cultivated to represent a different image of oneself. . formation. the setting or determination of fashion actually takes place through an intense process of selection. according to Blumer. and careers of collective taste constitute the huge problematic area in fashion’. At the beginning of such openings. The actual selection of about six to eight designs is usually done by the buyers representing sellers of designer women’s wear. Herbert Blumer analysed the formation of a collective taste based on his personal observations concerning the women’s fashion industry and the great fashion houses in Paris shortly before the war. TASTE AND THE PROCESS OF COLLECTIVE SELECTION Fashion as Zeitgeist In his seminal article of 1969. ‘the origin. . First. . He would probably be tempted to remind the reader that ‘the difference appearing at the level of symbolic culture’ is just as real and important a characteristic of modern consumer culture as its ‘underlying’ uniformity. Furthermore. but they are typically unable to predict the smaller number on which the actual and final choices converge. the managerial corps of the fashion houses are generally able to point out as potential successes about 30 of the original lot of 100 or more designs presented to the audience. What is even more important for the sake of Blumer’s argument. In his opinion. This selection process can best be observed at the seasonal opening of major fashion houses.: 278). According to him (Blumer 1969: 284). there may be a hundred or more designs of women’s evening dress before an audience of from 100 to 200 buyers. . So what appears to be difference at the level of symbolic culture turns out to be an underlying uniformity.6 In consuming goods people are both expressing their own aesthetic preferences and sharing a collective taste with others. (Firat 1991: 71) The only thing that Georg Simmel would probably consider somewhat strange in reading the above quotation would be its slightly moralizing overtone. ‘Fashion: From Class Differentiation to Collective Selection’. there were three matters in particular which seemed to provide the clues for an understanding of fashion in general (ibid. these choices are made usually by buyers 101 .TASTE AND FASHION products. in Blumer’s interpretation. Becker 1982). but above all. G. in a sense. in fact. particularly the direction of such styles over the recent span of a few years. engaged in translating these areas and media into dress designs (Blumer 1969: 279). One could also say that these people were experts or insiders in the social world of fashion (cf.] pick up ideas of the past. they are seeking to catch the proximate future as it is revealed in modern developments.TASTE AND FASHION independently of each other and without knowledge of each other’s preferences. G. takes place not only among the buyers but among the designers themselves. According to Blumer’s interpretation.: 280) 102 .). Thus the process of collective selection. recent literature. they all were actively participating in ‘a world of lively discussion of what was happening in women’s fashion. the amazing convergence of these independent choices is explained by Blumer by the fact that ‘the buyers were immersed and preoccupied with a remarkably common world of intense stimulation’ (Blumer 1969: 279). Blumer summarized the three results of his analysis as follows: they [the designers – J. Because of this ‘intense immersion’ the buyers developed common sensibilities and appreciations and expressed a common taste in their preferences. Blumer was interested in the sources of their new ideas. The shared influences and common experiences explain why the designers themselves create – independently from each other – remarkably similar designs. ‘the unwitting surrogates of the [much broader – J. Second. The insiders had developed ‘an intimate familiarity with the most recent expressions of modernity as these were to be seen in such areas as the fine arts.] fashion public’. designers were. The third source was. (ibid. According to Blumer. of fervent reading of fashion publications. from the exotic costumes of people in far-off countries. but always through the filter of the present. the most important one. and from the reflection of more recent and current styles of dress. The third observation made by Herbert Blumer pertained to the dress designers themselves. as described by Blumer. and of close observation of one another’s lines of products’ (ibid. According to the designers’ own testimony these ideas came mainly from three sources: from historical fashions. At the same time these buyers were. political debates and happenings. they are guided and constrained by the immediate styles in dress. and discourse in the sophisticated world’. on the one hand. clearly described and identified by him. impossible to describe the process more concretely. In this sense.: 280). The analysis of this relationship or homology is the most mysterious or obscure part of the understanding of the whole process. the incipient and inarticulate tastes which are taking shape in the fashion consuming public’ (ibid. Blumer certainly does make the process of catching the core of the Zeitgeist look rather mysterious and obscure – evidently he thinks that it is. Blumer’s description and understanding of the formation of collective taste and its relation to the mechanism of fashion has been criticized for its vagueness and unspecificity (see Davis 1992: 119). that this is the same problem as identifying the different stages in fashion process or the problem of the identification of the key actors in the process. as Davis did. propagating 103 . There are evidently other fields in which fashion is equally operative but where one cannot find such elaborate and tightly organized institutional apparatuses of creating. which in many ways resembles the treatment of the problem of taste in the classical aesthetic discourse to which Kant’s ‘sensus communis’. they are free to choose from among a greater variety of models and designs. on the other hand. In the case of the Paris seasonal shows they consisted of the designers. It is true that Blumer does not pay much attention to the fashion cycle or to the different stages through which fashion has to pass. The key actors of this process are. on the contrary. It simply does not belong to the task he has set himself. representing the larger public. unavoidably vague. as Davis points out. was the most subtle answer.TASTE AND FASHION For the sake of Blumer’s argument it is important that the buyers still have far more alternatives from which to select than the number they actually are buying. however. the expressions of modernity to which the dress designers are so responsive and. despite the earlier process of selection. The realm of dress is today. in fact. in principle. Davis’ critique is more justified concerning Blumer’s failure to consider the ‘palpable influence of the elaborate institutional apparatus surrounding the propagation of fashion in the domain of dress’ (Davis 1992: 120). in a way. Zeitgeist. expressions of some deeper and. extremely institutionalized. It is.7 During this process of collective selection there is somehow established ‘a relation between. not totally justified to claim. the administrative staff of the fashion houses and the international buyers who worked for big department stores and were. were all. fashion among them. discussed earlier. at least in the concrete process under examination. It looks almost as if the various expressions of modernity in culture. inaugurated an era which combined the domination of the bureaucratic apparatus of institutions with mass democracy. without doubt. This mechanism had a bright future: it was to become the preponderant form of social control in democratic societies . instead of prescriptive programming and minutiae of rules. as Davis himself admits. fashion offered guidelines that left enough room for personal choice and encouraged personal initiative: instead of stylistic uniformity there is a plurality of models. bureaucratic regulation. . . or rather alongside. fashion. (ibid.: 78) Lipovetsky’s formulations refer to the early stage of fashion which came to an end before the 1960s (see also Horowitz 1975b and Craik 1994: 210–11) and which 104 . haute couture inaugurated a new type of supple power that functioned without issuing rigid injunctions and that incorporated into its processes the unpredictable and varied tastes of the public. Lipovetsky (1994) has recently formulated this dilemma – without explicitly referring to this particular discussion – in an elegant way which gives credit to the relative validity of both Blumer’s and Davis’ positions. Fashion is. conceiving of it as a whole while simultaneously offering an array of choices. fashion can be said to present an early paradigmatic example of such social processes which came to characterize our society even more generally during this century: Programming fashion while remaining unable to impose it. impersonal coercion. As such. . the phenomenon of fashion cannot simply be reduced to the effects of manipulation by the economic apparatus to promote its interests even though there is no doubt that fashion is functional to the economic system of capitalism. an ideal and extreme case of waste. In this sense. in the form in which it appeared in the classical haute couture represented by the French fashion houses. there is the seduction of the metamorphosis of appearance . by transforming otherwise perfectly useful (in the narrow functional sense of the word) objects into totally useless ones (in the aesthetic sense). after all. it promotes sales and accelerates the turnover of capital. constant. According to Lipovetsky. Obviously. . there is an appeal to personal initiative. instead of regular.TASTE AND FASHION and distributing fashion (see for instance the case of first names in Lieberson and Bell 1992). (Lipovetsky 1994: 80) Despite. There is no longer any hierarchical structure in the fashion mechanism with models originating in haute couture and gradually descending lower in the hierarchy. some of the great fashion houses (Chanel. the democratic character of fashion has become far more accentuated and evident. Fashion was generally understood to be a visual and remarkably compressed expression of various streams of modern culture. and more concretely by the great Paris fashion houses. Fashion was thought to be influenced also by other forms of art. to an amazing degree. In general. to be responding to the question about the possible sources of new ideas along similar lines to the Parisian designers interviewed in the late 1930s by Blumer. and the role of these bureaucratic institutions as taste setters has somewhat diminished. It was thought to be influenced by almost anything that is taking place in the modern world: politics. observation of street life. As such. in order to satisfy a mass demand for novelty their creations must still be stylized by designers and offered to the buying public at an increasing tempo. finally reaching street fashion.8 The themes of the interview were inspired mainly by Blumer’s article even though we were fully aware of the differences both in the historical and geographical setting of our objects of research. during the more democratic stage of mass consumption of cheap ready-to-wear clothes and with the increasing importance of product brands. theatre and literature. movies. was mentioned as an equally important model or source of inspiration. Finnish fashion designers in the 1990s seemed. The Finnish study of fashion design In the autumn of 1992 we conducted interviews among Finnish fashion designers. wars and catastrophes as well as major cultural events and happenings. marketed and advertised by economically more powerful enterprises. 105 .TASTE AND FASHION was dominated by the haute couture. Later. There are professional designers working in the mass fashion industry who take ideas and models directly from the street. This transformation. Alternatively. then. from where new ideas and images that need to be visualized were often received. often described by observers of the fashion process since the 1960s. Even though dresses are designed. etc. Lagerfeld. it is a mirror of our time. On the contrary. ‘people walking in the city streets’. fashion was understood to be an expression of a Zeitgeist.) were transformed into companies marketing not only women’s wear but other goods as well. does not make the role of designers obsolete. fashion innovators sketch out possible lines along which the incipient taste may gain objective expression and take definite form. This is even more the case if one is trying to translate this media message into the visual language of fashion. inarticulate. enough just to be able to feel and interpret the pulse of the time. collective taste is initially a loose fusion of vague inclinations and dissatisfactions that are aroused by new experiences in the field of fashion and in the larger surrounding world. The task of the designer would thus be to sketch and concretize in visual and easily recognizable images the loose and vague ideas shared by the larger public. it would be a relatively easy profession to learn. we receive so much information all the time that it has become increasingly difficult to identify the sources of new ideas or models. To live in this permanent flow of information is as self-evident as it is important to follow international fashion magazines. In this initial state. and awaiting specific direction. As one of the interviewed designers formulated it. other forms of mass media or popular culture are hardly mentioned at all: only music. the main problem for a fashion designer is rather to know when to distinguish him or herself from the trend 106 . the time keeps up with you! But. in particular since there are professional agencies and trend setters from which you can buy your ‘weather prognosis’. Some even felt that in the world we live in. (Blumer 1969: 289) If the whole secret of the trade simply consisted of being able to follow the common ‘trend’. Through models and proposals. of course. Today it is more difficult to avoid the ‘touch of the Zeitgeist’ than to try to grasp it. television and videos are occasionally mentioned. They are already inhabited by ‘fashion models’. however. This could probably be explained more by the fact that television and other forms of mass media are understood to be part of the same world as fashion. For a successful designer it is not. collective taste is amorphous.TASTE AND FASHION Amazingly. a successful design is based on the happy coincidence when consumers are willing to identify with and adopt the ‘trend’ which was interpreted and visualized by the designer. vaguely poised. you still have to be sensitive to the message of the media in order to be able to interpret it actively. As such they cannot possibly provide inspiration in the sense of idols or models but rather as competitors or accomplices in the same trade. In the contemporary situation. You do not have to bother to keep up with the times. According to Blumer (1969). TASTE AND FASHION followed by others and when to follow it. In other words, in order to be successful you have to be able to see further than others and already be able to ‘smell’ the next trend or the next cycle of the trend, otherwise you only repeat the present fashion. The trend prognosis can tell you whether or not hemlines are rising or falling, but designers are time after time taken by surprise when the whole ‘look’ is totally changed or the trend reversed. In other words, there is no single reliable method or device to prognosticate the fashion of tomorrow. Despite all the methods of following trends and new ideas in various fields, the secret of final success – to be just one step ahead of others – always remains a mystery – or is finally determined by chance and by contingent factors. In the discussion conducted with Finnish designers Blumer’s two other sources of new ideas, exotic or historical clothes, were not mentioned. (Even though travelling and tourism were often mentioned as important sources of inspiration.) This could be explained both by the peripheral position of the Finnish fashion industry – on the whole it is on the receiving end of international influences – and by the fact that Blumer’s historical study had as its target the great Paris fashion houses creating articles of haute couture which were more or less unique creations, whereas the experience of the Finnish designers was received mainly from industrially produced mass fashion. In the study conducted by Horowitz (1975b) in the 1950s in England, one of the main questions concerning the self-image of the designer, or the perception of his or her role, was to what extent the designers understood their position in the way suggested by C. Wright Mills in an article with the same title as Horowitz’s: ‘The Man in the Middle’ (1963: 378): ‘His art is a business, but his business is art.’ Among the designers interviewed by Horowitz (1975b: 29), ‘about half regarded their occupation as an art, while the other half preferred to regard it as a craft’. Even among those designers who were occupied with haute couture and understood their occupation as creative art, commercial success was still often regarded as the main sign or criteria of a successful career as had been envisaged by Mills. Horowitz’s designers, at least a good part of them, were among the last occupied in the traditional haute couture and employed by the great fashion houses who acted as trend setters in relation to mass markets. As noted by Horowitz, by the time of the publication of the article the situation had totally changed and haute couture had lost its hegemonic position in relation to the mass market which now received its ideas directly from the street and had its own professional designers who designed directly for the mass market without any finer models to imitate. 107 TASTE AND FASHION The question whether fashion design is an art certainly had occupied the minds of the Finnish designers – as a matter of fact, it had been an important issue in their trade association a few years earlier but by the time of the interviews it seemed to have been, at least provisionally, resolved. Whereas some quite evidently thought of their profession as real art others just as evidently regarded it as a craft. There was not, however, such a big contradiction between these views: designing was considered by all to be a creative occupation, and in this sense it was close to ‘real’ art. At the same time, in most cases designers did not aim at creating unique objects of art, but industrially produced objects of use. The self-evident nature of these responses could possibly be explained by the fact that all the Finnish designers had a long formal schooling behind them at a school of industrial design and consequently shared a strong professional identity which set them apart both from pure craftsmen and artists. In general, the designers felt that they were relatively independent in their creative work. Despite some organizational and commercial restrictions they were relatively free to choose the proposed models through their own best understanding and liking. From the dress designer’s point of view, in addition to the more obvious commercial interests and restrictions presented by the managerial staff of the firms that employed them, there were also some interesting preconditions which they had to take into account in planning the models of a coming fashion. First, the producers of textile fabrics and threads offered new products to the market each year, and the variety of their supply was naturally limited. Thus, in designing clothes and dresses one usually had to use whatever was offered by these producers. Second, you had to take into account the forecasts of the trend agents. (Promostyle was the agent most often mentioned.) Their guidelines were often felt to be too vague and general, but the colours of the new designs were often said to be determined, at least to some extent, by these agencies. Thus, given the typical patterns and colours of fabrics it was, to put it crudely, left to the imagination and creative capacity of the designers to create the final models or patterns and the final cutting or shape of the garment. Obviously, the trend agents as well as the textile and thread manufacturers, with their own professional designers, had to propose their ideas and designs a year or a year and a half earlier than the dress designers. They had a fashion cycle of their own which had to be synchronized with the latter. In a similar way, the fashion designers themselves felt strongly that their ‘fashion’ was different from the 108 TASTE AND FASHION ‘fashion’ of the buying public. They had to ‘know’ or to be able to determine it one or two years before their public. Professional fashion is different from street fashion and precedes it by a considerable span of time. Designers’ fashion is the innovation which still is in the process of coming into being and only some parts of which are generally adopted by the buying public once finally offered for sale in department stores and boutiques. Designers’ fashion also naturally includes many more varieties and models than are offered to the buying public, or are then bought and consumed by it, or finally become really fashionable. In a sense, one could say that today the social institution of fashion design – or the world of commercial fashion and trade – consists of several different layers or steps. At each step the variety of possible items or models from which to choose becomes more limited from the perspective of the next step. The guidelines offered by garment manufacturers or the trend agencies’ advice (the colour for the autumn or spring season) restrict the fashion designers’ freedom of innovation and choice only in certain respects. On the other hand, the buying public has to be satisfied with the assortment of clothes finally offered for sale each season at the shops. But even to consumers a large assortment of goods is offered, only some of which find a demand big enough to become economic successes. At least the buyers always have the freedom of a combination of different clothes, shoes and hats, and, consequently, of their contextualization. In this respect the mechanism of the selection of models that finally are presented to the customers, and the associated formation of a collective taste, resembled the Paris fashion shows as analysed by Blumer. The main difference is that a further division of labour has taken place in the process. Instead of two (designers and buyers) or three (if the managerial staff is included) different influential actors or groups of actors taking part in the process of collective selection, there are now, in the industry of ready-made clothes, at least five or six different sets of key actors. First, textile fabrics and threads are designed by manufacturers; second, trend setters present the results of their efforts of coming to grips with the collective taste of the time (e.g. of colours); third, the fashion designers make their suggestions and propose their sketches of future models; fourth, they are discussed with the managerial staff who pick their own favourites and take them into the final process of production, to be presented to department and chain store buyers; and finally, the buying public with its money power makes the final selection, thus evolving and expressing its own collective taste. Each of 109 TASTE AND FASHION these stages precedes the earlier one by several months or even a year or two. At each of these stages the potential array of choices is further restricted. The final crucial test of the commercial success of the product proves whether all the processes of the formation of a collective taste have been synchronized well enough. What is important in the sociological analyses of this social formation is that, in principle, the process taking place at each of these stages can be described along the lines already presented by Herbert Blumer: somehow, in an almost mysterious way, a collective taste, in a more or less compressed and clear form, is distilled out of a myriad of individual tastes, and expressed in a concrete form in the models presented to the market by the designers and the producers, and in the choices made by the buyers. The belief in the total autonomy and freedom of the customer is an ideologically distorted conception. No one can act in the market of today without previous limitations restricting his or her choices, or create a personal style in total isolation with unlimited possibilities, according only to his or her own individual taste. Customers can choose only from among the, often very limited, number of items that are at the moment offered in the shops. Even though the new and advancing technologies of production would make it possible to mass produce individually designed products, as is the case already, for instance, in the car industry, the difference between this new flexible mode of production and the old more rigid mass production is still only one of degree and not of kind. The customer can choose from among a greater number of possible combinations but still the parts are predesigned and the possible array of choices always consists of a limited number of items. It is, however, equally distorted to believe that all our choices, as autonomous and independent as they often seem to be, are, in the final instance, more or less totally predetermined by alien social and commercial influences, like marketing and advertising. Modern customers are free to choose, to accept or to reject, the products offered to them and since these choices and customers’ preferences obviously do not fall randomly on all the possible goods offered, but, on the contrary, are often clearly and strongly concentrated, favouring one or another model or item, one can with confidence say that a process of collective taste formation is taking place in everyday consumption. A modern fashion mechanism is constantly created and kept going. Following the formulation suggested by Lipovetsky (1994), ours is a society in which bureacratic control, represented by 110 TASTE AND FASHION big institutions like the whole fashion world, and big organizations like the fashion industry (which has already become much more multi-faceted since the days of haute couture), is more or less successfully combined with democratic aspirations, leaving room for numerous expressions of the individuality of taste and the creative initiative of the customer. As Simmel noted, only in a society of people wearing uniforms or in a society consisting of totally unique and isolated individuals not sharing any common characteristics or features, could this process ever come to an end. In modern Western societies such alternatives are not in sight at present. FOOD FASHIONS AND SOCIAL ORDER The confusing picture of modern food culture It would be quite trivial simply to claim that there are fashions in the modern food market and in the culinary culture in general as in almost any other commercial field of human activity. However, frequently repeated food scares follow exactly the logic typical of fashions. It is easy to point out several recent and good examples of the appearance of food fashions: for instance the rapidly changing popularity of various national cuisines or the life history of many convenience foods on the shelves of a supermarket. They are often first introduced as a delicacy, then become part of the daily menu and often – if they do not share the destiny of a fad – finally become part of the ‘traditional’ diet. In the following, however, a more demanding position is defended according to which the role of fashion is crucial in understanding modern food culture. The major changes in diet, like that towards a ‘healthier diet’, are essentially changes of fashion. Harvey Levenstein (1988) summarized some of the results of his study of changing food consumption patterns in the contemporary United States as follows: Perhaps as a result of confusing signals being emitted by the ‘experts’, a few middle class Americans seem to stick to one set pattern of eating. Buffered from food scare to food scare, enticed by the convenience (and, let it be said, the taste of) fast food, unable to resist snack foods and ‘grazing’, yet still 111 The testimony of another contemporary observer of American food culture is even more striking: American society – and the observation could well be extended to other Western societies – has become increasingly ‘confused about what is food and what is not food. Levenstein’s and Schwartz’s conclusions about the general confusion reigning in food culture are shared by many experts. and are certainly confirmed by many of our own everyday experiences. (Levenstein 1988: 209–10) Levenstein’s work is titled Revolution at the Table and it is mainly concerned with the changes in American diet influenced by the development of modern nutrition science. what is real and what is imitation’ (Schwartz 1986: 267). as characterized by Levenstein: vitaminized corn flakes in the morning. and created a situation where we feel: that taste is not a true guide to what should be eaten. Homo Americanus and family present a confused picture. that the important components of food cannot be seen or tasted.TASTE AND FASHION relishing occasional Julia Child-like triumph in the kitchen. ‘very strong forces are at work’ in such a society. the whole menu crowned with an occasional gourmet dinner with friends on Sunday afternoon. one could also claim that the increasing homogenization of eating habits (diminishing national and class differences) has been followed by a greater differentiation and individualization: the increasing supply of food has made possible the formation of various subcultures. Following Stephen Mennell’s (1985) suggestion. from vegetarians and macrobioticians to connoisseurs of French cuisine. According to Schwartz. (Levenstein 1988: 210) 112 . as well as the ‘anomic’ situation facing every individual and family in their food choices. that one should not simply eat what one enjoys. and that experimental science has produced rules of nutrition which will prevent illness and encourage longevity. but are discernible only in scientific laboratories. Despite the confusing picture offered by modern food culture. The development of scientific knowledge about nutrition – and the parallel numerous pseudoscientific schools of thought – have permanently transformed our ideas about food and eating. vegetarian health food for lunch and hamburgers in the evening. Levenstein is willing to argue that there is at least one permanent factor which definitely – and more than others – has helped shape our attitude towards food. the relative differences between the social (educational) groups diminished remarkably during the study period (see Prättälä et al.g. Trends in other individual food consumption patterns were similar: consumption of sugar in coffee and high-fat milk decreased. causing cardiovascular disease). (Prättälä et al. see also Prättälä et al. in 1990. In Finland. 1993) the Finnish diet has become much ‘healthier’ during the last twelve years: Both men and women displayed a shift towards healthier food consumption patterns in 1979–1990.and lowerclass women are approaching the level of the upper-class women’ (Prättälä et al. 1992. There is thus a strong temptation to interpret 113 . Even so the diet of the higher social classes is nutritionally better than the diet of the lower groups. practically all women now have a “good diet”. 1992: 282–3) As the authors admit. 1992: 285). Prättälä et al. nutrition education and nutrition-related health campaigns (the so-called North Carelia project has been the most spectacular one in Finland) have been an important part of the public health policy during the last decades.TASTE AND FASHION The ideal diet of the Finns? As has been shown in a recent comprehensive study conducted by Ritva Prättälä and others (Prättälä et al. 1992: 284. the results are still very promising since the relatively high consumption of butter and high-fat milk are generally regarded as among the main risk factors in the Finnish diet (e. Karisto et al. In the authors’ opinion. high-fat milk. The diet of Finnish women is now approaching the ‘ideal’: ‘particularly in the highest social class. and women eat on the average better than men do. and weekly consumption of vegetables increased. vegetables and sugar in coffee). These results are in line with the results of several earlier studies. The middle. 1993). Not only did the average diet become more healthy. but the social differences obviously first started diminishing in the 1980s (cf. as in many other European countries. 1986). The observed absolute change in the proportions of men and women spreading butter on bread was most dramatic: in 1979 63 per cent of men and 56 per cent of women preferred butter. yet women’s food choices were consistently more health oriented. the figures were 17 per cent and 12 per cent respectively. the report deals only with a limited number of nutritionally relevant food consumption patterns or factors (butter. e. in this area of ‘health-related habits’. Health sells. are passed’ (Karisto et al. Smoking. These results are even more spectacular if one keeps in mind that at the same time changes in other health-related habits (smoking. the farmers in particular. If the representatives of the food industry are to be believed.g. part of a more general orientation in which health has become something of a super-value or ‘a common sieve prism of wellbeing. mainly because it conceals its moralizing tone behind a pseudo-scientific analysis of everyday practices (cf. Gusfield’s general conclusion that ‘beginning sometime in the 1950s and continuing into the present. there has been a quickening of interest in nutrition as a means to achieve good health and prevent illness’ (Gusfield 1992: 91). women are mainly responsible for the deterioration of the situation (see Karisto et al. New products can best be marketed if they can claim to make an important contribution to a healthier diet: ‘A decisive factor in the wider acceptability of novel proteins may be their contribution to a healthier diet in the form of new products which fulfill some perceived nutritional needs’ (Richardson 1990: 149). 1993 and Rahkonen 1992). Moreover. in particular. drinking and the frequency of physical exercise) have been much smaller. They have traditionally been regarded as valuable nutrients in the Finnish diet. health sells too. quality of food. ‘irrational habits of eating’ and scientifically unsound beliefs about nutrition are general among the public as is perhaps best evidenced by the numerous and repeated ‘food scares’ which can sometimes gain ‘alarming 114 . On the other hand. 1993: 194). has increased despite several very visible antismoking campaigns. Bourdieu 1984: 384–5). or almost negligible (Karisto et al. to admit that their consumption could have more detrimental than beneficial effects. 1993: 187).TASTE AND FASHION these results as giving support to the thesis that the ‘message’ of the health educators has reached its public. This interest in the nutritional value of food is. The widespread use of butter and high-fat milk (‘unsaturated fatty acids’) has been the main target of these propaganda campaigns in Finland. The new ethics of health appears to offer a universal and generally accepted norm to the modern consumer. through which the values of different things. and it has been very difficult for their producers. but education is needed Many observers would certainly agree with Joseph R. in the opinion of many. ‘Only through extensive efforts of health education will scientists be able to convince the American public that good nutrition is easily obtained from a wide variety of foods readily available from our grocery stores. There are unfortunately relatively few studies on what people living in a modern society think. In discussing eating and food in the family. They are aware of the fact that the food they eat can have a decisive effect on their future health. if only people knew . Finnish women regularly refer to the nutritional value of foodstuffs and meals (see Mäkelä 1994). But from the rather modest sources of information at our disposal one can draw the conclusion that people increasingly care about their health and physical fitness. However. However. these ideas do not. 1983: 129). the more important these motives became. Unfortunately there is no data about Finland that could be compared with the general development of the diet discussed above. health matters. . the older the girls grew. the practical guidelines which people say they follow in selecting their daily menu often are in line with the recommendations of the experts. or only incidentally.’ as the American nutritionists Stare and Behan wrote in 1986. coincide with the prevalent scientific orthodoxy. In this respect nutritionists certainly are no exception: ‘Everything would change for the better. In a study based on interviews conducted with mothers living in East London. . ’ Scientific and folk models of nutrition Obviously. Laymen also seem to have relatively clear ideas about which foods are good. the general health orientation of the public can have dangerous sideeffects.TASTE AND FASHION measures’. The public’s interest in health can often become too intensive and be led in the wrong directions. girls who experienced weight problems were more eager to avoid milk fats (see Rimpelä et al. (According to Richardson (1990: 150). Gail Wilson (1989: 179) reported that ‘nearly two thirds of the women spontaneously said that they were influenced by health considerations when they 115 . In a Finnish study about the consumption of milk fats among girls it was found out that ‘health motives’ had relatively little to do with the reasons given for their eating habits. which bad and why they are so.) As many nutritionists seem to think. However. In particular. The natural scientists often tend to believe in the power of scientific knowledge to change people’s habits for the better. know and believe about food. ‘in the UK worries about food have become something of a national preoccupation’. (1993): it is easier to add something new to the diet than to take something away. Instead of hunger and appetite. Women often felt that primarily they had to please the other members of the family. in Ekström 1990).: 177). when speaking about infants’ diet the nutritional emphasis was even stronger. the women also felt that they could exercise an influence on what was eaten at home (cf. which had to be met by providing appropriate ‘nutrients’. However. stressing that it must above all be ‘balanced’. The women interviewed would also often have liked to change the eating habits of their families but they felt themselves to be ‘subject to a range of constraints’ (ibid. ‘needs’ or ‘requirements’ were discussed. Babies were treated as living organisms whose nutritional needs must be satisfied. The ‘folk models of nutrition’ or layman’s beliefs about good diet were the explicit object of Claude Fischler’s study (1986). Wilson also found out that women were more amenable to dietary change than men were. not necessarily competing with the traditional items on the menu. (Fischler 1986: 948) In many respects the practical recommendations made by laymen were similar to 116 . This would seem to support an observation made also by Karisto et al. . He interviewed French mothers about the food that is good for children and compared the results with ‘scientific dietetics’. Statements rarely mentioned ‘food’ (nourriture) as such. They simply could not afford to experiment with food and buy items that could be rejected (Wilson 1989). New items are more easily accepted if they are served as something ‘extra’ or ‘luxury’. similar observations in Sweden. . At first glance the mothers studied seemed to be influenced to a high degree by scientific knowledge about nutrition and had adopted many knowledgeable ways of talking about food.TASTE AND FASHION chose food’. women living on a ‘tight budget’ reported that they did not dare to buy any new foods not normally eaten in the family. The fact that they were speaking about the food they thought was good for their children probably further emphasized this tendency: they obviously felt very strongly that they were responsible for the wellbeing of their children. In particular. ‘starches’ and ‘fats’ were pervasive in discourse on child feeding. . In particular. but the mothers tended to speak in a similar way about food in general: ‘calories’ and ‘vitamins’. An expanding economy in which consumption is increasing promotes change. they rather discussed ‘diet’ (alimentation ). Thus. rules or criteria. but vegetables and ‘greens’ had an important function to fulfil in their diets. their function in the diet was a strategic one. overconsumption of which was seen as selfindulgence or conspicuous consumption’ (ibid.TASTE AND FASHION those of scientific nutritionists. One of her main results was that ‘rules for good food involve the notion of a “balanced” 117 . When asked to explain what they meant by ‘balance’. reliable principles for behavioural organization and food choices’ (Fischler 1986: 962). whereas meat was conceived ‘as a somehow special food. In Fischler’s opinion. They helped to restore the ‘balance’.: 952). The vitamins they possessed were seldom mentioned by mothers. Counihan’s results would seem to support Fischler’s thesis in many ways. They symbolized something (‘freshness’) that was opposed to meat. In the mothers’ opinion. but again for different reasons. Milk products were valued for their calcium. the modern society is in a state of gastro-anomie. In Fischler’s opinion it has become a quasi-ethical value or a meta standard of a proper diet. In an earlier article (1980) Fischler had already suggested that our modern culinary culture is in a state of a crisis. Vegetables were valued equally by laymen and experts. starches were mainly responsible for children’s obesity.) The need for a balanced diet was the overall criterion by which French mothers tended to evaluate the contribution of different foods to the diet of their children. In such a society there is a need for new norms to guide our eating habits. wider meaning. Carole M. but milk as a drink. (In Fischler’s interpretation. it was neither a proper drink nor a food. ‘that of a cultural construct reducing anxietyproducing symbolic disorder’ (Fischler 1986: 963). but the reasons given often differed. was treated with suspicion. The desired balance would then take another. Even though she does not draw the same conclusions. even for children. Counihan’s study is based on the analysis of the ‘food diaries’ kept by her students in the USA. Since the traditional food rules have lost much of their power to convince. the mothers often referred to the rule of the golden mean: ‘Eat a bit of everything and not too much of anything!’ The demand for a balance could be used as an argument in favour of an ingredient that was felt to be missing in the diet (say ‘greens’) as well as against any item that was felt to take up too big a portion of it (say starches or meat). Fat was never mentioned as a dangerous substance by the mothers. the standard of a balanced diet – for lack of anything more concrete – served exactly such a function: ‘What was perceived as necessary was in fact some form of order. To a health food virtuoso.: 59). American students were concerned about their health and physical fitness and – not surprisingly – bodily thinness. to eat wholesome food and to avoid all the numerous dangerous substances food can contain becomes the major occupation of his life and a means of achieving the supreme moral goal of his life. In the words of Friedrich Nietzsche (1990: II §3). these rules favoured restraint in eating. fix’). allgegenwärtig. One of the possible reasons suggested by Counihan for the relative ease with which the rules could be broken. The ascetic procedures and exercises serve the purpose of absolutizing these ideals and making their following an automatic process not to be questioned. which according to Counihan is the crucial criterion of attractiveness in the peer culture (ibid. it is worthwhile comparing this ‘spontaneous rule of dietetics’ with the arguments of the ‘religious virtuosi’. As was the case with French mothers. This could be one of the reasons why openly utilitarian arguments (‘it’s in your own best interest’) in favour of a healthier diet or against smoking often do not sound very convincing. In general. figure as a general quasi-ethical value or meta value for choosing food. an observation obviously supported by everyday experience (ibid. an ascetic is a man who singles out just a couple of rules and makes them ‘stable. in terms of the basic four food groups’ (Counihan 1992: 57). 118 . They could often give a number of possible excuses or special conditions under which it was thought permissible to break the rules (such as to grant a reward to oneself for what one had accomplished or to comfort oneself). the students were not much upset by their regular failure to follow these rules and to eat in a nutritionally proper way (ibid. . in fact.). The possible detrimental health effects take a long time to manifest. Health food ascetics and the management of the body If the argument or the criterion of a balanced diet (also often used in official health propaganda in the form of the nutrition circle with a sector of one’s own for all the basic nutrients a human body needs) does. The rules were almost made to be broken. As Counihan observed. the founding fathers and representatives of health food movements. was that the students seemed to think that there were no real consequences. unvergessbar. .: 58). They also often spoke about food in terms of its nutritional value and often formulated in scientific terms the rules to be followed in selecting food. everpresent. unforgettable and fixed’ (‘unauslöslich.TASTE AND FASHION diet . The refined flour [the main target of critique for Graham. It was a paradigm of the nineteenth century’ (ibid. As a result. often more utilitarian and hedonistic. Quite obviously this was not only a paradigm of the nineteenth century. but this would seem to be a difference of degree only. In particular. George Cheyne. Graham equated the moral and the medical. To Graham the exercise of self-discipline was a quasi-religious exercise and health was both a reward for the pilgrim’s progress and a sign of his moral superiority. but has deep roots in European intellectual history. It was also the effects of sexual desire and sexual intercourse on health.: 84). the ideals and goals of the Grahamite movement of the 1830s with the new health food movement which began sometime in the 1950s. As Gusfield noted: the excitement that certain foods created was dangerous to the body. the inventor of Graham biscuits – J. In her opinion. as were limits to gluttony. be found in the teachings of the famous society physician. Carole Counihan identified the basics of this paradigm very much alive in the writings about food of present day university students in the USA. (The emphasis of the modern students was. the inventor of the ‘English Malady’ (gluttony) in the middle of eighteenth-century England (see Falk and Gronow 1985). for instance. A balanced diet was an essential component of such a state of harmony. and dominance’ (Counihan 1992: 60). moral superiority. It is a paradigm that can. he suggested that the main preoccupation of these – often nostalgic – movements is to teach people the exercise of self-restraint in eating. the pseudo-scientific rules adopted by the students favoured restraint in eating ‘because it is a path to personal attractiveness. the older movements often looked for a ‘more natural society’ in which men could live in harmony with themselves without the temptations offered by the modern society. (Gusfield 1992: 83) In Gusfield’s opinion. no doubt.] produced in commercial agriculture deprived the body of needed coarse fiber.) 119 . G. health and good character: ‘The self-discipline demanded by healthy diet was itself an act of moral virtue. Limits to lust were essential to human health. But it was not only the direct effect of diet on the body that alarmed Graham. high status. Gusfield (1992) compared the philosophy of the earlier and contemporary American health movements.TASTE AND FASHION Joseph R. Whereas the Grahamites still often referred to science in support of their principles. is a recent phenomenon and not an integral part of the ideology of this health food movement. the movement has been part of a broader ecological movement.: 89) Gusfield (1992: 99–100) is certainly also right in emphasizing that the outcome of these anti-modernist movements was paradoxical. In the contemporary movement the dangers and temptations of indulgence and overeating also threaten every individual. they helped to create ‘a body brought under the control of the rationalized soul. in many ways different from the older one. The willingness to exercise self-control has not disappeared. from which the causes of good health and right living are derived. in the present movement ‘the philosophy of self-help is accompanied by the rejection of medicine and often of academic and scientific writings’ (Gusfield 1992: 96). By emphasizing the ideas of self-control. (ibid. from market and city. Since the 1960s at the latest. and the laws of God and nature. The ‘rational’ fear of AIDS. i. and work are declining [as in the USA of Grahamite times] the body is an area of struggle between the tempting forces of market and city.e. but still the righteous have more reason to worry about other kinds of influences which threaten the balance of their body and their health. In the Grahamite philosophy the emphasis was put on the temptations and excitement emanating from the outside. but the very foundations which make it possible are threatened. the civilizing process described by Adam Smith was turned upside down. George Cheyne concretized such temptations to the ‘alien products’ of a rapidly increasing colonial trade which aroused Englishmen’s appetite: i. Gusfield probably had the same thing in 120 . As Gusfield has pointed out. restraint and individual autonomy to the utmost. Sexual desire is no longer a source of danger.TASTE AND FASHION The modern health food movement which began in the 1950s is. surprisingly not mentioned at all by Gusfield. in Gusfield’s opinion. the philosophy of both of these movements can best be understood as a response to a world in which social norms are in a rapid change: In a society in which the institutional controls of family. the central symbol of modern life’.e. The new movement is also more populistic (anti-science) by nature. the modern commercial society. into a critique of civilization. church. which draw the person into immediate physical gratifications. trust per se is impossible to produce according to plans. whereas in Graham’s thinking the danger lay more in the fact that such bread tasted too good to be resisted. To take an example. when adulteration of food was so common that the Cooperative Society hired a lecturer to tour the country giving advice as to what genuine food should really taste and look like (see Burnett 1966: 202). What is signified and symbolized in the Grahamite movement is the attempt to restore moral authority’ (ibid. The representatives of the contemporary health movement obviously think that the development of science and technology has led us into a situation in which the individual has no independent way of knowing or testing the value of the things he is eating. however. even though struggling on the lower stages of the pilgrim’s 121 . One simply has to try to avoid everything the ‘purity’ of which has been spoiled by the touch of modern technology. science and modern technology. to a certain extent. This is because. in the eyes of the public. and not unscrupulous businessmen. of the situation in Britain in the nineteenth century.TASTE AND FASHION mind in writing somewhat cryptically: ‘What is signified and symbolized in the contemporary health movement is a return to control over one’s body. in fact. are chiefly responsible for the ‘adulteration’ of food. Only now. The contemporary movement would thus seem to be mainly occupied with the task of avoiding risks which one cannot. that no formal rules possess the fundamental ability to draw limits for the general public between the food it should trust and those that are less trustworthy. ‘Ordinary’ eaters are not simply less devoted ascetics who are all still going in the same direction. reveal – in an accentuated form – the truth about modern food culture and the dilemmas facing the modern eater. in the final analysis. the real difficulty is. a modern health faddist would avoid bread made of refined flour mainly because of its negative (almost poisonous) nutritional value. The purpose of the above discussion about the philosophy of the health food movements has not been to claim that they could. even in principle. (Sellerberg 1991: 199) The situation is reminiscent. foresee or control. The rules made by science are often not felt to be valid and legitimate. He has to rely blindly on the judgment of experts and the scientific institutions.: 98). According to Sellerberg’s (1991) observation. using the standards they have elected as the unquestionable principles to guide their lives (‘to eat only living food’. according to Mildred Blaxter’s (1990) results. nor as a remedy for a disease or a deficiency: their permanent use is rather understood to be necessary for the 122 . There is. The main thing is that their minds are constantly preoccupied with eating and food. ‘not to eat animal fats’. Neither is the health food ascetic necessarily consuming less food and drink or using less money in order to buy them. an interesting lesson to be learnt from the life and philosophy of health food ascetics. However. controlling and transforming their eating habits. however. For instance. And it certainly is no joke that today the majority of women – probably as many as 80 to 90 per cent – are constantly monitoring their daily calorie intake and eat less than is required to stop them feeling hungry (Mennell et al. Most women also perceive their own figures to be heavier than the figure they consider attractive. new laboratory experiments have been able to prove the vital importance of many new vitamins to the functioning of the human organism. They are continually monitoring. The interesting thing about ascetics is not so much whether or not they have succeeded in reaching their ideals (their ideal diet). Vitamin deficiency and the ‘hidden hunger’ At the beginning of the century. approved in the USA in 1906. or on average. have by no means lost weight. The major task of the nutritionists was to control and prevent the use of dangerous foodstuffs. was the main result of these concerns. the major issue – besides protein consumption – in the discussion over dietary needs was mainly concerned with hygiene and dangerous additives or surrogates used by the food processing industry. This marked a crucial change in the practical role of nutrition science and in nutrition consciousness. testing. Life is an eternal struggle. in the advanced capitalist countries women in general. which.TASTE AND FASHION progess. The invention of vitamins. minerals and other micro-nutrients changed the scene in many respects. smokers are even more aware of the perils of smoking than non-smokers. and later various micro-nutrients. is not often determined in terms of the maintenance of the balance of the body. ‘to avoid eating refined flour’.). In public discussions the need for vitamins. Total balance or harmony is never within reach. etc. and to prohibit the sale of alcohol and other drugs widely used in patent medicines. The Pure Food Act. in fact. they almost never do. 1992: 51–2). Since the 1920s. TASTE AND FASHION maintenance of good health in general. Falk 1994: Chapter 6). dyspepsia. In this respect. Vitamins do not satisfy a ‘hidden hunger’ and help to recover the disturbed balance of the 123 . it was then introduced as an important source of vitamins.g. an ideal cure for the ‘American disease’.10 One could thus claim that vitamins and vitaminized food were among the first modern commodities of consumption in a market where fashions could now freely follow one another. One fashion criteria. the new consciousness concerning the effects of vitamins no longer follows the logic of a discourse of needs (see Falk 1990). the same essentially homogeneous goods could be differentiated into different products or brands. they mainly promote longevity. With the help of vitamins.: 18). Fleischman’s Yeast combined ‘the necessity for frequent purchase and the almost complete absence of quickly apparent results’ (ibid. Fleischman’s Yeast had been losing markets due to the diminishing interest in home baking. vitamins became ideal products for a food processing industry once the consumption of food ceased to increase in quantity. Although laboratories learned to measure and determine the vitamin need more accurately. scientific) tests which can decide whether one commodity is better than another. and their effects were often hard to evaluate. some minerals and other micro-nutrients have taken their place in promising more or less mysterious effects – there is a decisive shift in nutritional argumentation. was that there are no crucial (e. Advertising and marketing could now refer to such properties which. One of the early advertising successes in the 1920s can be used to illustrate this point (see Marchand 1985: 18). According to Levenstein’s (1988: 152) interpretation. and even though no vitamins are totally tasteless – in this respect. they could take the place of the old patent medicines (which had been banished shortly before) as ideal commodities. for a new mass market. In Marchand’s words. were rather inessential. Vitamins – and products like Fleischman’s Yeast – also helped to transform the scientifically grounded argument in dietary recommendations. vitamin products became ideal commodities. The amounts of different vitamins needed were often difficult to quantify and measure. to be ingested daily. in terms of their use. not unlike the old patent medicines. It was alternatively advertised as a remedy for vitamin deficiency and as a laxative. Strictly speaking. and exemplary products of a new kind of marketing and advertising (cf. suggested already by Georg Simmel (1981). Supported by a forceful advertising campaign.9 At the same time. there is a balance to be maintained – self-control is an important value to a human being – but hardly any need to win back any lost area of individual autonomy.). Even though health matters to most people today. eating and the question of food selection can hardly. If one were to believe the advertisers. in most cases. the circle is completed. It is always practically impossible to decide whether the goods ingested have kept their promise of general well-being and alertness. have increasingly to compete with advertising and other popular media about the soul of the modern consumer as well. In the women’s views on food discussed above. In speaking about ‘good and bad food’ the representatives of the natural food movement as well as ordinary eaters are defining themselves as moral subjects and delimiting that part of themselves that will form the object of their moral practice. . If a good and long life is the prize for following recommended habits of eating and diet. just ordinary believers. In the philosophy of ascetic dietetic movements as in sexual discourse. but they are presented without any particular anti-modernistic and antiscientistic zeal. be regarded as the principal area where ‘the individual delimits that part of himself that will form the object of his moral practice and decides on a certain mode of being that will serve as his moral goal’. however. in principle. ’ (ibid. The spontanous ethical rules and precepts to be followed are often an esoteric combination of scientific and folk dietetics. As Foucault pointed out.TASTE AND FASHION human organism. 124 . ‘moral conceptions were much more oriented towards practices of the self and the question of askesis than towards codifications of conduct and the strict definition of what is permitted and what is forbidden’ (Foucault 1987: 30). to maintain a mastery and superiority over them . in the same sense as in the discourse on sexuality in Greek and Greco-Roman antiquity reported by Foucault. In this respect. the promises of modern science do not differ all that much from those of classical dietetics. always vague and indeterminate. The new dietetics. The new scientific dietary instructions. has one major drawback compared to the old one: the promise of a good life has become increasingly abstract and empty of meaning unless longevity is regarded as valuable as such (see Falk 1990). Most of us are not health ascetics. ‘the accent is placed on the relationship with the self that enabled the person to keep from being carried away by the appetites and pleasures. . their recurrent use would have a preventive function and be necessary for the maintenance of the body in order to keep oneself in good health – the criteria of which are. with their promises of a good life. in the recent decades. These changes were certainly not easy to accomplish. As we all know. but in many areas the resistance offered by traditional tastes and the public’s suspicion has been difficult to overcome.11 As a matter of fact. low-calorie drinks in particular (low-fat milk is a good example). It has produced foods and foodstuffs that help us live according to the ascetic ideal without hardly having to change our eating or drinking habits at all.TASTE AND FASHION The product as the real ascetic Fortunately. table top sweeteners. The list compiled by Richardson (1990: 151). decades to convince the Finnish people – some still express strong doubts – that margarine was as good or even better than butter (see Pantzar 1992). And they could still go on drinking milk with it. and in changing from butter to margarine people often felt that they were forced to abandon their earlier eating habits and transform their diet drastically. a nutritionist employed by Nestlé. salad creams. In this substitution industry there are many success stories. soft drinks. ‘light’ or ‘low-cal’ alternatives to almost every imaginable food or drink. low-calorie soups. The struggle between butter and margarine went on for decades and is not totally over yet. It tastes different. the food industry has done a lot to relieve us of any further need to struggle and from the burden of all moral responsibility. It took. But still the introduction of butter mix or margarine as a substitute for butter – or even as an improvement over butter – in many ways allowed people to maintain their old cherished habits of eating. yoghurt. The early introduction of soya meat after the Second World War never succeeded. for instance. is convincing even though far from complete: ‘calorie-controlled recipe dishes. People could still go on eating their voileipä (bread and butter – the Finnish national dish) as before. there are now ‘health’. We can go on eating just like before and still our diets become almost ‘ideal’. It will be interesting to see whether the recent technological 125 . One could for instance say that the remarkable change in butter and whole milk consumption observed by the Finnish nutritionists during the 1980s was not caused by any conscious acts of abstinence. wines and beers are now widely available as attractive alternatives to conventional food items’. One could at least try to convince oneself that one did not have to ‘abstain’ from anything important. What changed was that instead of whole (‘red’) milk they now drank low-fat (‘blue’) or skimmed milk and spread margarine (in daily parlance often still referred to as butter) or a butter mix on their bread. dressings and spreads. margarine is not really the same as butter. As Päivi Lehto (1993) pointed out in her analysis of Finnish margarine advertisements. 126 . On the other hand. contrary to the claims made by many nutritionists and health researchers (e. People also eat (snacks. like French fries. Sweetened yoghurts (nowadays admittedly often ‘light’) which have become extremely popular since the middle of the 1960s are a good example. cited in Rozin et al.g. At the same time. a major change has taken place in cigarette smoking. and the only element missing from the new product is one that is worth avoiding. the advertisements for many low-calorie drinks and sweets.TASTE AND FASHION innovations and improvements of new protein products can accomplish what soya meat could not. even though the motivation has been largely the same. As Somogyi (1990: 106) has shown. In many respects this transformation has been more total than. Earlier studies about the promotion of soya meat as a healthier alternative to meat do not support it (see Woodward 1945. chips and – in Switzerland – rösti (covering almost 27 per cent of the total market value). the substitution of margarine and vegetable oil for butter.) It is also interesting to observe that. the loss of the market share has been almost totally compensated by convenience potato products. Marketing the ‘fashion for health’ Strong doubts have been expressed whether a direct reference to the healthpromoting qualities of a new product really does sell to a wider public. The reason why much less attention has been paid to it in the studies of ‘health-related habits’ probably is that the estimated benefits of ‘light’ cigarette smoking for national health are not very high. Karisto et al. it is difficult to combine pleasure with health. These examples would seem to suggest that the process of substitution has been successfully accomplished primarily in cases where the public has become more or less convinced that the new product has at least as many benefits as the old. 1986: 86). sweets and fruits) more often during the day than before. potato consumption has diminished drastically in Switzerland during the last decades. but there are many examples to the contrary (cf. for instance. 1993). but they are more children’s food. too: from strong non-filter to filter and finally to ‘light’ cigarettes. see Falk 1991). (The totally ‘artificial’ shrimp sticks produced with the help of this new technology have already proved to be a success. it is easy to point out many changes in the consumption of food commodities in which the products that are successfully marketed are anything but health foods. As is well known. can come into special focus at any one time. the presence of which introduces a competitive situation and sets the stage for selection between them. (b) the introduction of new participants into the area. in particular. the area is open for recurrent presentation of models and proposals of new social forms. First. with people ready to revise or discard old practices’. the last condition. Two of the six conditions mentioned by Blumer are more problematic in the case of food culture. According to Blumer. Second. fashion cannot operate. but there is no doubt that most of these conditions are also present in the modern food culture and market. and (c) changes in internal social interaction. In such cases there is a widely shared belief that some single item is responsible for all the perils of the whole nation. Or alternatively. The lack of selenium in food in Finland or the sudden fear of getting an overdose of vitamin A by eating pigs’ liver are good recent examples. Blumer studied the Paris fashion market. In any area where there are strong traditions or things believed to be sacred. like vitamins or other micronutrients. This seems to be true about food scares in particular. is chiefly responsible for the shifting of taste and the redirection of collective choice which together constitute the lifeline of fashion. The area is obviously also open for the emergence of new interests and dispositions in response to (a) the impact of outside events. in particular. The opening of national borders and general social mobility should take care of most of these conditions in any modern society. As he argued (1969: 286) ‘the area in which fashion operates must be involved in change. a newly invented nutritional wonder-stuff can save future generations from the plague of illness. The popular interest in food is often rather casual: new worries seem to follow each other at regular intervals and whenever a new topic of discussion is introduced the old is soon forgotten. The overall result of these changing moods would be rather difficult to predict. The role of fashion in food culture Herbert Blumer (1969: 286–7) named six conditions for the appearance of fashion in any possible area. in any culinary culture and practice there are many strong traditions and even things considered to be sacred (cf. the notorious 127 .TASTE AND FASHION The analysis of contemporary food discourse would seem to indicate that the logic of the food market is such that only some items or some nutritional ingredients. there is a relatively free opportunity for choice between the competing models. is one of the decisive factors that have promoted the appearance of the first of the above two conditions. By questioning traditions and destroying ‘sacred’ beliefs (e. often mentioned in jokes about married couples in Scandinavia. In Blumer’s opinion (ibid. there cannot possibly be any single criterion to determine the relative merit of various foods. First. if it is true that the means to achieve the 128 . The second argument is more important: people do not eat nutrients but food. candidate to fill the vacuum as any. Hence. which effectively resist change.TASTE AND FASHION meatballs. science leaves too much room for individual choice. the increasing importance of scientific knowledge and technology – which is supposed to be acting against fashion – in deciding what food is good to eat. Furthermore. Paradoxically. the advice given by science is simultaneously too liberal and too authoritarian. the science of nutrition opens the area to change. In other words. be any objective tests with unambiguous results to decide what foods are good to eat. however. a society in which there is a general distrust of food and no reliable guidelines could not survive for a long period of time. in which case there would again seem to be less room for fashion to operate? As has already been mentioned. if scientific nutrition is to be believed. but there cannot. science does not give us very good advice as to what foods to eat. 1986 and 1990: 204– 7) suggested that scientific rules have increasingly taken the place of traditional guidelines in modern food culture. As has been pointed out by Sellerberg (1991). But what about the other condition? Have the results of objective scientific tests increasingly been substituted for traditions as reliable guides to food choice.) fashion cannot survive in such an area either.g. As the data collected by interviewing the representatives of modern culture referred to earlier would seem to suggest. On the other hand. Thus. scientific knowledge of nutrition is as good. in earlier times butter was a highly valued – almost a sacred – commodity to most Finns). Most diets are good enough. Many foods and foodstuffs have practically the same nutritional value. it can advise us to avoid eating some – poisonous – foods. two reservations that should be made about the possibilities of the science of nutrition taking the role of the new religion of modern society. there are also objective tests through which the relative merit of the competing models can be demonstrated and evaluated. in principle. There are. or even a better. Claude Fischler (1980. which only the husband’s mother knows how to cook). At best. Women have taken up many of the traditional masculine habits. the recent masculinization of female fashion). the function of fashion is to introduce ‘order in a potentially anarchic and moving present’. As we have seen the reasons given for the selection of food are nowadays often expressed in the vocabulary of science. a society in which food selection and intake are increasingly a matter of individual. for instance. To a great extent fashion plays a role similar to traditional norms – or standards of good taste – in guiding the modern eater in the perplexing task of selecting proper meals and socially accepted foods and drinks. not social. Even in the area of clothing. constantly changing. Furthermore. seem that in the area of food the feminine influence has been a particularly dominant one. like drinking and smoking – although at the same time making them ‘lighter’ and more ‘civilized’. Fred Davis (1992) has recently presented an interesting interpretation of contemporary styles of clothing and recent changes in sartorial manners. For instance. From the contingent and transitory nature of the standards of fashion it does not by any means follow that people do not give good reasons for their food choices. as suggested. But despite the lack of firm traditions or norms. then it means that the modern consumer – or modern eater – does not live in a state of anomie.TASTE AND FASHION goal of health are not easy to name.) According to Blumer (1969: 289). even though they are often rather empty of meaning (‘I like it because it is fashionable’). It would. cf. reasons are constantly given. ‘fashion nurtures and shapes a body of common sensibility and taste’ (Blumer 1969: 290). decisions. These guidelines offered by fashion are not ‘fixed’ (see Campbell 1987: 157). contingent. (In most cases one could probably simply substitute physical attractiveness or even slimness for health. He suggested that the main trends in contemporary fashion are a result of the increasing ambivalence of sexuality and gender (cf. the classical area of the appearance of fashion. Fashion is an elusive social formation and the community of taste is only a ‘cloud of a community’. As Fischler understood it. on the contrary. faces the danger of a food crisis. also Schwartz 1986: 267). Neither does it mean that one could not identify stylistic changes in eating habits and interpret them in the light of broader social and cultural developments. however. transitory. If Blumer was right. In the same way one could probably interpret the observed changes in health-related habits as expressions of the changing and ambivalent role of women in modern society. They are. 129 . the modern eater is by no means left alone in deciding what to eat and drink in a rapidly changing modern world. nor is the goal itself by any means unambiguous. by Fischler (1990: 204– 7. The naturalness and self-evidence of the present fashion is always contrasted to the oddness and incongruity of past fashions. There is a taste for health in modern society.TASTE AND FASHION The principal contingent nature of fashion means that there cannot be any progress – once poverty is overcome and the age of abundance has begun – in food culture. They are predominantly based on taste. ‘Fashion nurtures and shapes a common sensibility and taste’ (Blumer) and obviously health has become an area of common sensibility. As such they are a particularly good example of a wide and important social phenomenon: the aesthetic dimension inherent in practically all social interaction. As suggested by Mayntz and Nedelmann (1987). Science is not making our food culture more rational – whatever that means. The rules of scientific nutrition compete among other models as candidates for the formation of this collective taste. 130 . This also means that these choices are aesthetic. That they are taken by many as the only possible and natural ones only proves the point. fashion is a self-dynamic social process which continuously creates its own social conditions. William B. They have no doubt that the pleasures of wine are not only sensual and subjective: 131 . we cannot reach any other conclusion if we apply the criteria that feel natural in the case of an art object: ‘The beauty of wine is a controlled abstract beauty expressing the intentions of the artist.’ In discussing the aesthetics of wine in the introduction to their work. Fretter claimed that wine. can be an art object just as much as can a painting or a piece of music.5 T H E B E AU T Y OF SO C I A L FORMS SIMMEL ON SOCIAL FORMS Can a taste or a smell be beautiful? In the Journal of Aesthetics and Art Criticism. They are complex and rich in the varieties of sensual impressions they make. almost self-evidently. . . In Fretter’s opinion (1971: 100). And for full appreciation they require a competent observer who can fuse the meanings of past experiences into a present experience.’ Fretter does not hesitate to call wines beautiful since they give me maximum aesthetic satisfaction. these sensory characteristics combine to stimulate the one sense that provides the most enduring pleasure and appreciation – the aesthetic sense. Amerine and Roessler formulate in an almost classical manner the question about the relation between mere sensual pleasure and pure aesthetic pleasure. . (Fretter 1971: 100) The classical guide book of wine tasting written by Amerine and Roessler (1976: xii) is almost as unreserved in this respect: ‘In the proper balance. For a more lasting judgment however.: 449). consciously or unconsciously. As he argued in his anthropological writings. is directly touched by a foreign particle. even less would he have approved of wine as an art object. . Coleman constructs a dialogue between an imaginary proponent of ‘Kantian’ aesthetics and an opponent who demands that taste and smell also have a right to beauty.2 Francis Coleman’s (1965) defence of the beauty of wine is explicitly directed against the ‘Kantian’ position. who was a great friend of white wine. both Fretter and Amerine and Roessler are implicitly polemizing against the ‘traditional’ stance. however. in the latter case foreign particles floating in the air are ingested (see Kant 1980: 451). In so doing Coleman simultaneously formulates a typical Kantian position about the conditions of beauty. Immanuel Kant.1 Kant shared with many of his contemporaries a reserved attitude to ‘lower’ senses and the pleasures associated with them. the tongue. would not have approved of describing a taste or smell as beautiful. Our enjoyment of wine is thus essentially a learned response and is a complex mixture of intellectual and sensory pleasures.THE BEAUTY OF SOCIAL FORMS Our first reaction to an aesthetic object such as wine is apt to be purely subjective: we like it or dislike it. These conditions were also recognized by Pierre Bourdieu (1984) as the main criteria of a ‘pure’ Kantian aesthetics. In the best tradition of philosophical argument. For instance. Coleman comes to the conclusion that there are no sound reasons to exclude either the senses of taste or smell or the sense of touch from aesthetic experience. we have to ask whether there really are any good arguments 132 . . (Amerine and Roessler 1976: 5) The fact which Fretter as well as Amerine and Roessler regard as self-evident has by no means been self-evident in the European aesthetic tradition. There certainly is no reason to try to change this common usage of language – it would hardly be possible. This argument is not. . The sight is the most noble of all the senses because its impressions are formed farthest away from its object (ibid. As Coleman (1965: 319) admits. In fact. we do not usually call tastes or smells – like the smell of a wine or the taste of a chateaubriand – beautiful but rather good smelling or good tasting. we apply certain objective criteria. Instead. a basic one. both taste and smell are subjective because they only function when objects are near to them: in the former case the sensory organ. He does not even acknowledge a single colour or a single tune as a proper source of aesthetic pleasure. According to Coleman (1965: 321– 2) we should. beauty always has to do with the form of the object. they cannot as such act as the criteria of genuine aesthetic experience. This would not. What we can do 133 . make any difference because.’ just as we sometimes do with a painting. however. Since such relations can also be observed in other than aesthetically beautiful objects.: 321) Let us assume that tastes and smells can be complex and. fall within the class of sensations that are merely pleasurable? There is. This presupposes that there must be at least two such elements and that they must somehow (spatially or chronologically) be related to each other. They can be equally complex. together with single colours or sounds. we are obviously talking about the relations between the elements of which the object consists. however. (ibid. resemble one another. Is it a better counter-argument to say that tastes and smells are usually simple sensations which would. but only that both are fit subjects of an aesthetic judgement. or follow each other. ask what we really mean when speaking about the form in this respect. In doing so. the sense impressions of sight. Our imaginary Kantian opponent would not rest his case so easily: he could continue his attack by saying that even though these sensations can be complex there is no possible order within them. say. Tastes and smells are formless. according to the proto-Kantian argument. that ‘there is something missing. Even this argument can be questioned. we can analyse our sensations in regard to the complex and many-sided relations they include (see Coleman 1965: 320).THE BEAUTY OF SOCIAL FORMS against calling a wine beautiful. Let us think for a moment about a delicious culinary dish. for instance. or they can form a sequel that is repeated at definite intervals. for instance. however. etc. This is not to say that as far as their aesthetic merit or worth are concerned a well-prepared dish and a well-conceived painting are the same. We often find that a dish ‘needs something’. as such they can add to the pleasure we receive from the observation of an object. form an ‘organic whole’. no reason whatsoever to claim that smells and tastes would in this respect radically differ from. They can. In saying. at least in some cases. Its different flavours can form contrasts and complement each other: A well-prepared dish is an ‘organic whole’ in basically the same sense as a well-conceived painting: elements are contrasted with each other but not contrasted so sharply that they fail to cohere. that the touch of silk is beautiful. but we do not – at least under certain conditions – hesitate to call a painting or a piece of music beautiful. After such a devastating argument our imaginary Kantian proponent has to take refuge in his last and. and the sensations they receive often serve practical purposes too. The conditions under which these senses are employed are thus decisive: according to an old saying. for instance. strongest counter-argument. but it is enough to admit that it is not totally impossible either. this argument is no more defensible than the previous ones. in tunes. Such resemblances and differences can be observed in tastes and smells too. which was intended as a cruel parody of gastronomy. in order to distinguish a putrid fish from a fresh one. that there is no similar ‘natural’ scale or order in tastes and smells as there is. The same is true of taste and smell: some observations can be made in a disinterested way and these sensations do not serve any practical purpose. in order to really enjoy food. even though we undoubtedly use these tastes more often in an instrumental manner. takes this distancing to the limits of disgust by combining together foods that are not at all edible and by using ‘unnatural’ colours in the dishes in its menus and cooking instructions. however. like the satisfaction of hunger. smells or even touch should be excluded from the possible objects of real aesthetic judgments: 134 . It must be admitted. Unlike colours and tunes. however. one should neither be too hungry nor too satiated when coming to the table. Under closer scrutiny. but we can observe contrasts and complements in tastes and smells too. Our senses of sight and hearing are equally useful and functional. One could probably defend the position of Coleman’s imaginary opponent by admitting that it certainly is more difficult and less common to free the pleasures of taste from their practical purposes than it is in the case of sight. some of which we feel are pleasant while others are not. It is thus easy to agree with Francis Coleman that there is no a priori reason – in opposition to what Kant and many of his contemporaries obviously thought3 – why tastes. only to ‘touch’ it with the taste buds in the mouth. One is not supposed to drink or ingest the wine at all. and as such they cannot act as proper objects of aesthetic contemplation. for instance. The tasting of wine offers a good example of such a disinterested observation. undoubtedly. smells and tastes always serve some practical purpose.THE BEAUTY OF SOCIAL FORMS is to observe resemblances and differences. Marinetti’s famous Futurist Cookbook (1989). one’s needs must already be in part satisfied. . the beauty of the meal is almost inversely related to the importance of the sensory-physiological aspects of eating and drinking. ‘more aesthetic’ the more purified it becomes from its contents or the physiological aspects of eating. in emphasizing how our sensations of taste and smell can be both complex and consist of many mutually dependent. rather than a taste or a smell as such. Georg Simmel drew almost the same conclusions about the meal as Coleman did – and his conclusions are even based on similar criteria. in particular. and when the data are of a certain intensity. though not to the point of satiety.THE BEAUTY OF SOCIAL FORMS When the data from our senses of smell. be called beautiful. Even to Simmel the aesthetic aspect of the meal is associated purely with its form. published in 1910. consequently. can figure as the objects of pure aesthetic contemplation. In other words. It would probably therefore be safer to claim that combinations of smells and tastes can be beautiful and. But in Simmel’s case this beauty has nothing to do with the taste or the smell of the dish or the foods and drinks served at a meal – not even with the visual appearance of the dish or the meal. however short-lived they may be. It is purer and. which derives from sociability. at least under certain conditions. the less it serves the satisfaction 135 . . . In his essay on the sociology of the meal. To take aesthetic delight in one’s senses. (Coleman 1965: 324) As a matter of fact. or merely to satisfy our wants with them. Coleman actually proves that a dish or a meal can be beautiful. because in rejecting a deeply rooted prejudice about culinary delights he formulates in a compressed form the central criteria that are usually presumed in ‘Kantian’ aesthetics. smell and touch is interesting. complementary or contrasted elements. which always deal with the form of the object and are characterized by disinterestedness. On the contrary. thus. The beauty of a meal Coleman’s discussion about the aesthetic delights associated with the senses of taste. taste. then they can be beautiful. when we entertain them not to learn something on the basis of them. and touch are attended to for their own sake. but this form does not consist of the harmonious totality of tastes and smells but of the social form or interaction of the meal. In this essay Simmel came to the conclusion – even though he does not explicitly say so – that a meal can. because every guest sitting at the table can choose according to his own inclination from the many ‘vessels and bottles’ without any need for others to be compelled to enjoy the same foods and dishes (see Kant 1980: 452). In order for this form to become independent from its ‘contents’ and. as understood by Simmel. Simmel formulated this paradox or antinomy in another way too: the absolute selfishness of eating is connected with the regularity and frequency of being together. The ‘pure’ or aesthetic pleasure produced by the meal is based on two mutually dependent conditions.THE BEAUTY OF SOCIAL FORMS of needs and hunger. in order for the participants to be able to experience pleasure that is aesthetic. gives the meal a social form. among other things. These rules can. closely connected to each other. The more table manners are accentuated. the more its formal aspects are emphasized. like listening to music. Kant stated that taste is a particularly sociable sense. Simmel started his discussion of eating and drinking with a paradox: namely. ‘The Sociology of the Meal’ was inspired by and included an implicit comment on Immanuel Kant’s anthropological writing. consequently. In a manner typical of him. As is the case with so many of Simmel’s essays. concern the people with whom one is allowed to share a meal. that. When eating becomes a ‘sociological’ occasion. it must be characterized by disinterestedness. and second. and this feeling is pleasure’ (ibid. of which the best proof are the innumerable rules and prohibitions that regulate it everywhere. It is this antinomy of eating as simultaneously something totally universally human and completely individual. First. it concerns the social form of the meal. according to both Kant and Simmel. The sensual pleasure of eating is. it is 136 . to Simmel. Because eating combines this completely egoistical interest in an exemplary manner with social interaction and being together. Individuality and the freedom to choose. thus. are. the more independent this social interaction and the forms of sociation at the table are from any satisfaction of needs. he stated that eating and drinking are common to all human beings but at the same time they are the most selfish and individual activities. others can hear and see whatever I hear and see but no one can strictly speaking taste – or ingest – the same articles as I do. In a similar manner. completely individual. a state which is seldom reached in connection with the so-called higher senses and more spiritual occasions. the necessary preconditions of sociability: ‘because the sociability with others precludes freedom.: 563). this form must be developed without serving any physiological purpose. According to Simmel’s understanding. it exercises an enormous importance in all communities. eating has to serve also the purpose of aesthetic satisfaction. In Simmel’s case this ‘history of the civilisatoric process’ should not. follows directly from the chronological regularity of eating but it is greatly increased by the socialization of the meal: With all such changes a formal norm is raised above the changing individual needs. and the cultivated dinner guest who is able to follow a complicated set of rules or etiquette and who does not come to the table in order primarily to satisfy his ‘lower’ instincts. however. The necessity of such rules. Insofar as the social nature of eating becomes more evident. obviously thought that these two dimensions were in inverse relation to each other: in so far as one of them is emphasized. As this process advances the subjective or the natural purpose of eating. the satisfaction of hunger. however. The social form and the rules of interaction are first transformed into more complicated ones among the higher echelons of society where this can take place to such a degree that the original purpose of the meal. an excuse is needed. The historical development of the meal is described by Simmel as a kind of a civilizing process. The selfish eater who satisfies his hunger all by himself. Simmel described a kind of process of civilization or cultivation of eating which is in some respects reminiscent of the analysis of the process of civilization by Norbert Elias. besides the purpose of satisfying needs. be taken too seriously. In such cases. are compressed together. The sociability of eating presumes social rules. only caring for his own purely physiological needs.THE BEAUTY OF SOCIAL FORMS transformed into something that is both more regulated and more ‘overindividual’. or at least of a certain regularity of action. and a community of several persons is not 137 . are only conceptual abstractions in which the two significant dimensions of a meal. which in its turn influences back on it. Simmel. To Simmel. can almost totally be forgotten. because if. eating is from the very beginning social by nature and eating alone is rather a rare exemption or almost a perverse occasion. the satisfaction of hunger. the meal also becomes more stylized. the importance of the other is diminished as far as both the participants of the meal and its sociological observer are concerned. the satisfaction of physiological-sensual needs and social interaction. a more and more regulated and complicated etiquette regulates both the very act of eating and the social interaction taking place during a meal. the socialization of the meal elevates it into aesthetic stylization. is gradually forgotten until it finally becomes an almost negligible quantity. In his opinion. as is the case in table d’hôte. at table d’hôte only sensual. fashion. To Simmel. A social form that has been set apart or has become independent from its contents. is according to Simmel’s understanding always aesthetic by its nature and the pleasures associated with it are aesthetic pleasures. (Simmel 1910) Simmel’s sociology of the meal clearly shows that he always thought that an aesthetic dimension is combined with any social interaction – or. Simmel also explicitly argued that any step that ‘elevates the meal into the higher and more synthetic social values in the immediate and allegorical expression’ also lends it a higher aesthetic value. the very social interaction is always aesthetic by its nature. as analysed earlier. (Simmel 1910) In his essay on the sociology of the meal. Simmel 138 . Under such circumstances all social interaction becomes totally instrumental. As such it makes possible that people gather around meals and through the socialization mediated by this the mere naturalism of eating is exceedingly overcome. To use a conceptual distinction made by Kant. in fact. in Simmel’s opinion it is better than no form at all. and not aesthetic. At table d’hôte people are offered a meal of prearranged courses at a fixed price leaving no room for individual preferences. Simmel’s ‘The Sociology of the Meal’ ends with a typical aphorism. This aesthetic aspect of the meal can also totally disappear when the social ‘good’ form disappears. the lowest expressions of life can form not only the starting point but the very basis of higher values: The fact that we have to eat is in the development of our values of life so low and primitive that it is self-evidently shared by all. Aesthetic pleasure must always be combined with socialized eating including some kind of social interaction and freedom of choice. However. Even if the social form of eating were only a habit that no longer has any meaning and has become a ‘mere’ form. In such a case social interaction has become an end in itself – it is totally disinterested – and it does not serve any ‘outer’ or alien purposes. the discussion has proved that as in all the other walks of life.THE BEAUTY OF SOCIAL FORMS only able to take better care of such an excuse. is both a typical and important example of such a social formation. pleasure counts. like a meal as a social occasion. a form of eating which disgusted Simmel. but it also acts much better as its legitimate carrier and performer. Alfred Salz (1959. at least to some extent. . which was the very starting point of sociability.4 According to a recent interpretation by David Frisby it can be argued that Simmel’s emphasis upon the forms of interaction (‘Wechselwirkung’) or sociation (‘Vergesellshcaftung’) in his programme for sociology – first tentatively announced in 1890 – indicates interest in revealing an aesthetic dimension of all social interaction that we do not immediately perceive in our everyday life. But whoever 139 . cited in Davis 1973: 320) who once said that he had learned from his teacher Georg Simmel the following about society: ‘[Simmel] conceives of sociology as the study of forms of sociation. ‘formalization’. gave up his earlier Nietzschean programme of the genealogy of the morale. (Frisby 1992:135–6) Frisby also claimed that a change in emphasis from ethics to aesthetics took place in Simmel’s sociological thinking in the 1890s when Simmel. on the contrary they make it possible and further develop it. The aesthetic sociology of Georg Simmel Many contemporaries recognized an aesthetic dimension in Georg Simmel’s sociology. . Simmel 1991a).THE BEAUTY OF SOCIAL FORMS warned us that under certain circumstances this form – for instance the etiquette of eating – can be transformed into a pure formality. Murray Davis (1973) analysed systematically what Simmel could have meant by treating society as a work of art. nor the development or cultivation of an etiquette by any means restricts the freedom of the individual. . and can thus develop into an alien scheme. The sociologist can reveal and analyse aesthetic constellations and configurations that both exist in and are originally hidden in ‘the flat surface of everyday life’. the attempt to analyse the social origin of moral categories (cf. A concrete example of this is offered by the utensils used by cultivated people while eating. despite the multitude of rules and restrictions concerning their use. into something that is too much an end in itself. In normal cases or under normal circumstances Simmel seemed to be thinking that neither stylization. Davis referred to an earlier statement by a student of Simmel’s. Simmel thought. composed as it is of a multiplicity of diverse and intersecting interactional frames. do not restrict the freedom and elegance of movement in the same way as the coarse mugs and cutlery of the poor. which. who were contemporaries of Simmel. In so doing Frisby has in mind mainly Simmel’s writing on ‘Soziologische Ästhetik’ from the year 1896. on the other hand. This aspect of Simmel’s aesthetic sociology. and not to Immanuel Kant’s Critique of Judgment. dates back to early modernistic art theories typical of Baudelaire and his successors. in life. they have to draw their contents from social life (ibid. become estranged from ‘real’ life. Simmel even claimed that the attraction which socialism exercised for his fellow men as a social formation lay in its inherent harmony and beauty (see Simmel 1986). On the other hand. in fact. In this sense. in the last analysis. While speaking about the aestheticism of Simmel’s sociology. ‘Harmony’ and ‘order’ are such criteria which prove how far both aesthetic forms and social forms have. All the same. Frisby has aptly characterized Simmel’s sociology as impressionist sociology. emphasized both by Frisby and Davis.: 342): ‘each of these separated processes has a place outside itself. and an artistic method (1973: 320). Social forms resemble artistic products. the recognition of a totality in its various fragments and the interpretation of a deeper meaning from a fleeting moment. from which to draw materials that it can reshape with its own forms in its own medium’.THE BEAUTY OF SOCIAL FORMS speaks of forms moves in the field of aesthetics. The third aspect mentioned and analysed by Davis. a particular conception of the artistic product.’ In Davis’ opinion three different dimensions can be distinguished in Simmel’s aesthetic sociology: the artistic modality. which is always disorganized. in observing social interaction a sociologist has an aesthetic relation to his or her object. the participants of social interaction experience pleasures that resemble aesthetic pleasures because they react subjectively to the form of things. is the same as Frisby’s sociological impressionism. In this article Simmel explicitly wrote that ‘the meaning of aesthetic observation and interpretation lies in the fact that one can recognise the typical in the unique. David Frisby refers to two different dimensions of aestheticism. In Davis’ opinion this means that its modality is visual. is a work of art. While they are created by life itself they can still become separated from it. ‘to the mere image of things’ or ‘to their appearance and form’ with an internally harmonious feeling. has given a decisive impulse to the understanding of sociology as a study of pure or ‘play’ forms of sociation. the 140 . On the one hand. The first dimension stems from Simmel’s idea according to which formal sociology resembles geometry in its analysis of abstract or pure social forms. Kant. Society. the artistic method. spontaneous and impulsive. This connection is self-evident and it was explicitly pointed out by Simmel. that is experienced both by the individuals in interaction and the sociologist . sociability (‘Geselligkeit’) or social intercourse was exactly 141 . Aestheticism is. As a matter of fact. This could be interpreted as refering to the aesthetic character of such knowledge: ‘The subject is not related to the object gradually to form a theoretical picture of it.THE BEAUTY OF SOCIAL FORMS lawlike in the occasional and the [deeper – J. too. In this respect. Simmel presented his own ideas and the consequences to be drawn from them concerning the study of social forms. Simmel does not solve this tension between these two “perspectives” on behalf of the other’ (Frisby 1992: 53).] meaning in the superficial and the transient’ (Simmel 1896: 206). its constitution is not dependent upon any alien observer as is the case with nature: ‘it is realized immediately by its own elements. instead every consciousness of sociation is immediately its own carrier and inner meaning’ (Simmel 1992: 47). this theme was Simmel’s best example of ‘pure’ sociology or sociology that studies the forms of sociation (‘Formen der Vergesellschaftung’). as such. by distancing themselves from the society. As Frisby said. . since these elements themselves are conscious and synthesizing units’ (ibid. Simmel’s sociology is ‘pantheistic’: while every fragment can reveal the real inner meaning of a totality. or between natural science and sociology (or ‘human sciences’ in general). thus. Sociability and pleasure It is certainly not difficult to recognize the aesthetic nature of Simmel’s sociology or its close parallel with Kant’s aesthetic writings. In Frisby’s opinion. Simmel treated these two aspects inseparably as of equal importance: ‘Society is an aesthetic nexus. . G.5 As Arto Noro has pointed out. no fragment as such is more important than any other (see Frisby 1985: 58). both a manner of observation and interpretation and a feature that is common to social relations and to the consciousness of the acting individual. in his programmatic writing ‘The Sociology of Sociability’ (1949 [1910]). Simmel explicitly claimed that the social cohesion takes place in the consciousness of the individual actors and.: 49). By emphasizing the difference between nature and society. It is also interesting to notice that in emphasizing how social actors are equipped with the needed social categories. Simmel also argued that such participants’ knowledge is not conceptual in the ordinary sense (‘nicht Erkennen aber Wissen’). the play-form of association and is related to the content-determined concreteness of association as art is related to reality’ (Simmel 1949: 255). which can best be compared with plays. called society. When both play and social interaction are abstracted from all their particular contents a common element remains or is preserved. (Noro 1991: 39) Simmel’s own salon. Even though social interaction in general – or in most cases – has a particular purpose. which draw their form from these realities but nevertheless leave their reality behind them’ (Simmel 1949: 254). or out of it. it is typical of both art and play that even though they have grown from and are created by concrete reality they are estranged from it and. everything that is true of a play or of art. then. In sociability. In this sense his sociology comes very close to aesthetics: ‘Within this constellation. for instance in the social intercourse in a literary salon. one can even speak of the impulse of sociability. the pure form of social interaction is realized and can be observed: ‘Sociability is.THE BEAUTY OF SOCIAL FORMS such a form and even a form in which the object of pure sociology was presented in the clearest manner because in it free individuals are engaged in pure interaction. is also true of sociability: And what joins art with play now appears in the likeness of both to sociability. In ‘The Sociology of Sociability’ Simmel explicitly said that in his sociology there is a strong parallel between social forms and works of art. This. which in their turn have a lot in common with art. From the realities of life play draws its great. The same is true of sociability. This element is the residue of satisfaction which has to do with the fact that they are all forms of art or play. there is always a feeling of satisfaction which only stems from social association. from the fact that things are done together. which was one of the most famous and exclusive literary salons of Berlin. there develops a special sociological structure corresponding to those of art and play. According to Simmel. in a somewhat mystifying way. leave it behind them. essential themes: 142 . in a way. More often and with more emphasis Simmel referred in this essay to the fact that sociability is a play-form of association. can be regarded as his private experimental laboratory for the study of social interaction. is called ‘the impulse of sociability’ by Simmel. for instance the satisfaction of needs or the realization of interests. makes a contribution to social intercourse. Sociability just as much as table manners. and receives some satisfaction from it. or love and hatred on the other. if it has totally lost touch with the reality of life. but also his or her own. through which these activities make up the seriousness of life. play gets its cheerfulness but also that symbolic significance which distinguishes it from pure pastime. at least in the long run. Freed of substance. like wealth and social position on the one hand. e. sociability and social interaction in general have to fulfil certain conditions: something is ‘abstracted’ or taken away from ‘real’ social interaction. it is essential that sociability is always a reciprocal process in which every participant. as it shows itself in the flow of a lightly amusing play. (Simmel 1949: 255)6 In order to be like art or play. This means that neither the most subjective nor the most objective features or characteristics of the participants. .THE BEAUTY OF SOCIAL FORMS the chase and cunning. a symbol of life. aim at the development of a mutually satisfactory social intercourse in Simmel’s salon. sociability both stylizes and reveals the inner reality of life. whose likeness it only so far alters as is required by the distance from it gained in the play . In this respect. must be allowed to interfere with sociability. both gives something and gets something. the contest and reliance on chance and the favour of forces which one cannot influence. Anyone who uses wealth or power or cheats in order to benefit from the intercourse not only spoils the pleasure of everyone else. (Simmel 1949: 261) That the art in question is understood in a proto-Kantian spirit is shown by Simmel’s two programmatic criteria and social conditions of pure social interaction: it must be disinterested and it is only the form that matters. can be transformed into a pure shell or an empty scheme. In addition. the proving of physical and mental powers. . by telling a good story.g. is that social interaction must be disinterested and impartial. all sociability is but a symbol of life. A form turned into a scheme is a pure formalism and as such it should be strictly 143 . which created it and from which it draws its energy. The common denominator of all these practical instructions of abstraction which. Just like art. And just this will show itself more and more as the essence of sociability . . Sociability must be ‘fair play’. at least half-seriously. . but even so. or the etiquette governing them. They are transformed into empty forms only if they become petrified or solidified. The development of court etiquette is presented by Simmel as a historical example. Simmel’s fear of the petrification of the forms of social interaction can well be seen to correspond to Immanuel Kant’s critique of classicism in art: an art of judgment which relied on some universal criteria or rules of beauty would be totally independent of any subjective feeling of pleasure. In a similar way social interaction which faithfully follows rules is experienced as coercive and cannot possibly give anyone any subjective pleasure. and social forms According to Simmel’s own interpretation. In social intercourse following an etiquette is as problematic as eternal rules of beauty. exactly the same features are emphasized as are strongly present in his formal sociology. In such cases play is in danger of turning into ‘empty farce. It guards in us a typical gratification of human existence in all its purity and irreality. (Simmel 1905a: 163) In the interpretation of aesthetics presented by Simmel in his lectures on Kant. One does not take part in it because of the pleasant feelings it can arouse but out of obligation or under constraint. are all activities and forms of intercourse that do not serve any end. i. is something which arouses in us the subjective reflex of purposiveness without being able to say whom or what it serves. as well as Simmel’s sociability. Art and play. Kant had suggested that what we call beautiful. In art as in social interaction what matters is the pure form of purposiveness which does not serve any purpose at all. to a lifeless schematization proud of its woodenness’ (Simmel 1949: 261). but they are not totally empty either. art. PLAY AND BEAUTY Play.THE BEAUTY OF SOCIAL FORMS distinguished from Simmel’s basic idea of pure forms of sociation.e. only if following the rules of the game has become a pure convention or a forced habit. harmony. are to art: they are always in danger of becoming transformed into a strait-jacket. According to Kant’s famous definition (1987: §17) ‘beauty is an object’s form of purposiveness insofar 144 . because it furthers our feeling of health. it is ordered as if it served some purpose. As he saw it. Again. there are three different kinds of play or games that produce a pleasure resembling the aesthetic pleasure: the play (or game) of chance. and is satisfied only with itself. Play acts for Simmel as a model for experiencing beauty – and not the other way around as is the case with Kant: ‘only in play.THE BEAUTY OF SOCIAL FORMS as it is perceived in the object without the presentation of a purpose’. Similar definitions are familiar from Simmel’s characterizations of art. in his Critique of Judgment Kant analysed the differences and likenesses between these pleasures in detail. In clarifying the principles of his sociology Simmel obviously did not feel any need to distinguish between them. Kant also saw a likeness between the pleasure created by art and by play. In this respect Simmel seemed to be following the famous dictum of Friedrich Schiller (1982: 107) according to whom ‘man only plays when he is in the fullest sense of the word a human being. (Kant 1987: §54) In Kant’s opinion. Most often they are simply given as parallel examples of social interaction that has an end in itself. They are both examples of disinterested and self-purposive pleasure and. and he is only a fully human being when he plays’. and it does not matter whether in our rational judgment we like the object of this play. we are absolutely ourselves. different from pure sensual pleasure. as is the case with games where money 145 . but still not formless. when our activity circulates only around itself. play and any such pure social interaction: it is without purpose and disinterested. many of Simmel’s observations could have been made by Kant. according to whom: any changing free play of sensations (that are not based on an intention) gratifies us. In fact. they require an interest either in vanity or in our own profit. in Simmel’s writings social forms are compared with play or games more often than with art. or like this gratification itself. the play of tunes (in music) and the play of thought (or of wit). this gratification can increase to the level of an effect even though we are not taking an interest in the object itself. Kant did not totally identify them as Simmel seemed to be doing. we are totally “men”’ (Simmel 1905a: 163–4). In fact. It is relatively easy to understand what Kant meant by games of chance. Nevertheless. as such. Moreover. at least not one proportionate to the effect’s degree. the pleasures of which are clearly aesthetic. which. It is. Kant did not have much more to say about the other two types of play. By the former. Unfortunately. as is proved by how sprightly the mind becomes as a result. alternating constantly – and are so lively that they amount to an inner motion that seems to further all the vital processes in the body. According to Grimm’s Dictionary. and a person who plays only in order to win is often regarded as slightly abnormal. Simmel could refer to the enchantment of sport which is provided by its own dynamics and by the opportunities provided by this ‘even sociologically important way of acting’. even though nothing has been won or learned. According to Kant the pleasure of playing is caused by quickly changing observations. he obviously meant riddles and jokes and other such games played at social occasions which demand wit and inventiveness. The solution of a riddle is unexpected and the end of an amusing story surprising. anger. fear. Playing the game is what matters. like laughter. as importantly and self-evidently as painting. this interest alone could not explain the great popularity and success of such games among ‘high society’ of which the best evidence is that no evening party could do without the entertainment provided by them. It is more problematic to understand what Kant meant by ‘play of tunes’ (‘Tonspiel’). and their revelation produces something akin to bodily pleasure. however. by their surprise effects and the liveliness they promote. published in the eighteenth century. Music is a form of art. But as Kant argued.THE BEAUTY OF SOCIAL FORMS is at stake. and not by winning or by utility alone (see Simmel 1949: 258). which are totally independent of the end result of the game. those of thought (or wit) and of tune (or music). quite obvious that Kant wanted to emphasize that ‘the play of tunes’ was not the same as music. It is the explicit purpose and in the selfish interests of the players to win the game. The pleasure of listening to music is based on quite different features 146 . If sporting games had been invented Kant could certainly have taken them as a more ‘decent’ example. of winning or losing it: But many effects are at play there – hope. (Kant 1987: §57) Because in his opinion games of chance are not ‘beautiful’. promotes health. and scorn. joy. This is best explained by the fact that interest in the way the game is played far exceeds the interest in winning. a Tonspiel is simply the same as music. Kant does not want to discuss them in this context any further. However. however. on the contrary. it is merely the chance they involve that still enables them to gratify us in a lively way. Unfortunately Kant’s description on this point is meagre. the effect that agitates the intestines and the diaphragm. G. in a word the feeling of health . (Kant 1987: §57) Did Kant. . table music (‘Tafelmusik’) and – not surprisingly – sociability all belong to the latter group: Agreeable arts are those whose purpose is merely enjoyment. Just before presenting his ‘theory of the games’ in The Critique of Judgment Kant divided arts into two groups. merely serves as a necessary vehicle – but the furtherance of the vital processes in the body. in painting the drawing. the fine arts or.THE BEAUTY OF SOCIAL FORMS from the pleasure of Tonspiel which originates from the rapid and unexpected change of tunes and impressions: But music [in the sense of Tonspiel – J. . literally. mechanically reproducible music? Or perhaps these ‘plays of tunes’ were some. based on the recognition of a form of harmony and not on any surprise effect. The main thing is that even in Kant’s opinion the pleasures of such activities are reminiscent of those associated with real art in many ways but also differ from them at least in one crucial way: these pleasures are not a priori universally shared by all the players of the game. (Kant 1987: §57) The aesthetic pleasure promoted by ‘real’ music is. now totally forgotten. with its beauty. The delights of the dinner table. in music the composition is important. . They include 147 . the rapid change of observations and impressions awakens feelings that are close to genuine aesthetic ideas: It is not our judging of the harmony we find in tones and flashes of wit – this harmony. formulate the first aesthetics of popular music and culture? Or did he have in mind the kind of music found in musical boxes and other such machines that were enormously popular at the time – in other words. in his ‘aesthetic theory of play’. arts of beauty (‘shöne Künste’) and agreeable arts (‘angenehme Künste’). The first alternative is. the most probable one. form of game played at social gatherings in Kant’s time. .] and something to laugh about are two kinds of play with aesthetic ideas . not any material for future meditation or quotation. And if we grant that the urge to society is natural to man but that his fitness and propensity for it. sociability. In Kant’s thinking there is also a connection between a ‘purely empirical interest in beauty’ and social intercourse. (Such art also includes the art of furnishing a table so that people will enjoy themselves. or using jest and laughter to induce a certain cheerful tone among them – a tone such that. at large banquets. animating the group to open and lively conversation. Thus one could reasonably argue that Kant’s discussion of ‘play’ included an aesthetic of ‘light’ music or popular arts. i.). it would seem legitimate to conclude that all play and games actually belong to this category of ‘agreeable arts’. Table music. The most decisive difference between fine arts and arts that are merely agreeable seems finally to be whether the pleasure can be shared with others or. and includes. then we must also inevitably regard taste as an ability to judge whatever allows us to communicate even our feeling to everyone else. there may be a lot of loose talk over the feast. is a good example of ‘play with tunes’. mentioned in passing by Kant. Robinson Crusoe apparently would not have been interested in what he or his dwelling looked like: Only in society is the beautiful of empirical interest. presumably even the table-music – a strange thing which is meant to be only an agreeable noise serving to keep the minds in a cheerful mood.THE BEAUTY OF SOCIAL FORMS the art of providing all those charms that can gratify a party at table. is a requirement of man as a creature with a vocation for society and hence is a property pertaining to his humanity. whether it has universal communicability and validity as its precondition.e. as is said. because the whole point is the entertainment of the moment. Thus. without anyone’s paying the slightest attention to the music’s composition. rather.) (Kant 1987: §44) Kant ends the discussion of these agreeable arts by saying that all games which have no other purpose than that of making time pass unnoticeably belong here (ibid. Kant’s description of table music is reminiscent of the muzak played in department stores and cafés today: it contributes to a pleasant and sociable feeling without demanding that any attention is paid to its composition or performance. such as telling stories entertainingly. and hence regard taste as a 148 . and which fosters the free flow of conversation between each person and his neighbor. and no one wants to be held responsible for what he says. . According to Kant we could even define taste as the ability to judge something that makes our feeling in a given presentation universally communicable without mediation by a concept. . Simmel did not seem to pay much attention to this demand of universal communicability in his explicit comments on Kant’s critique of judgment nor in his sociological ‘adaptation’ of Kant’s ideas (cf. The condition of the universal and a priori communicability of a judgment of taste demanded by Kant is. . as if there existed something like a ‘social contract’ concerning the communicability and sharing of pleasure (ibid. As has already been pointed out. People who are willing and ready to share their pleasure with others and who are not satisfied with pleasures they cannot share have good reason to expect others to share their gratification. He was mainly occupied with the criteria of disinterestedness and with the form of finality or purposiveness. or between art and play. Hence taste is our ability to judge a priori the communicability of the feelings that (without mediation of a concept) are connected with a given presentation. always automatically fulfilled.7 Simmel did not need to emphasize this aspect of universal communicability included in any judgment of taste because in his sociological aesthetics – or in the ideal world of play and pure social interaction – this condition is.THE BEAUTY OF SOCIAL FORMS means of furthering something that everyone’s natural inclination demands. (Kant 1987: §40) The beautiful is that which can be imagined ‘without the mediation of concepts’ to be the object of general pleasure. This may also explain why Simmel did not seem to think it important to distinguish between fine arts and agreeable arts. totally different from the empirical connection between beauty and social association. In Kant’s analysis it is this very demand of a priori communicability which separates them from each other: the gratification offered by a game or by a dinner table or table music is not associated with any such demand. The principle of reciprocity is always built into the game as well as into sociability: my enjoyment or my gratification is always dependent 149 . for example the essay on sociability). since in the first case the universal communicability is a precondition of the aesthetic pleasure.). however. (Kant 1987: §41) Only a person living with other human beings is interested in looking good. in fact. It is thus safe to claim that in his own aesthetic sociology Simmel is obviously after something else. however. the feeling is shared by all. but in the analysis of which Kant’s ideas still could be fruitfully adopted. Simmel intended to show that in the world of sociability the whole antinomy of taste between the subjectivity of the feeling and its general communicability in a sense disappears or is made obsolete since we can be assured that. The presumption that all the players or participants share the feeling is built as a constitutive condition into the very logic of the play of free social interaction. totally antithetical to theirs. but every player or participant can safely make the – in a sense stronger – assumption that all the other players or participants are sharing a similar feeling of pleasure. as long as the game is played or the sociable gathering goes on. This is by no means the same as the universal. In such games and social gatherings the totally subjective and individual feeling of pleasure is not necessarily universally communicable. at least as long as the social formation exists or is preserved. (Simmel 1949: 257) 150 . His intention was. This also explains Simmel’s reformulation of the categorical imperative in the world of sociability. This assumption is furthermore not based on empirical evidence alone. which is also discussed by Kant in the Critique of Judgment. I unavoidably spoil my own. According to this new ‘imperative’ everyone is entitled to as much pleasure in social interaction as is in harmony with the gratification of everyone else’s impulse of sociability: If one stands by the sociability impulse as the source or also as the substance of sociability. Like Pierre Bourdieu and Terry Eagleton.THE BEAUTY OF SOCIAL FORMS on the joy and gratification of all the other participants of the game or all the members of a social gathering. Simmel turned Kant’s problem into a sociological one. something that Kant did not deal with. It only takes one to spoil the joy of all and by spoiling the joy of others. but neither is it only a question of an empirically observable relation between social interaction and the promotion of beauty or a question of how the communication of the experience of beauty makes it more pronounced. a priori validity of a judgment of taste presumed by Kant. the following is the principle according to which it is constituted: everyone should have as much satisfaction of this impulse as is consonant with the satisfaction of the impulse of all others. Simmel can be understood to claim 151 . pure social interaction in the form of sociability and cultivated social intercourse became ideals of social conduct among the ‘high society’ in early modern times because it made it possible – in a sense in an ideal form – to practise in a stratified society for the coming society of equals: status which is recognized as such is at the same time marginalized. Niklas Luhmann has criticized Simmel’s analyses of sociability for exactly this abstractness. In other words. Thus. Only in them this maxim of sociability – the gratification of all is the necessary condition of the gratification of each – is automatically realized and only in them is. This was made possible because the desired socialization is based on nature and morality alone and is freed from more serious social functions like religion.THE BEAUTY OF SOCIAL FORMS The ideal world of play and art The worlds of sociability and the corresponding worlds of play and art are ideal worlds and in this sense ‘artificial’. the very premises negate the aimed-for conclusion (ibid. in fact. Simmel’s programme of formal sociology is. What is wrong with such an attempt is that the individuality of the participating individuals is.). thus. this kind of a pure social interaction is possible only among equals.] sociability (“Geselligkeit”) is understood as an association (“Sozialität”) reduced to a pure form which is practiced as an end in itself (and not because of its contents or results)’ (Luhmann 1981: 255). In this respect Luhmann’s critique comes close to Terry Eagleton’s critique of the whole aesthetic ideology as discussed earlier. a late revival of such an attempt which is therefore doomed to failure: ‘[In Simmel – J. One can give Simmel’s formal sociology another interpretation: namely. But Luhmann’s argument is not as devastating as it would seem at first glance. According to Luhmann’s analysis. and accumulation of capital (see Luhmann 1980: 87). which is a condition which Simmel hardly thought would reign in normal social interaction in the ‘real world’. G. Luhmann is certainly justified in doubting the success of Simmel’s formal sociology as a final solution to the conflict between the antinomy of full individuality and fully developed socialization. What Luhmann wanted to point out is that in Simmel’s ideal world individuality is rather empty of meaning. As Simmel explicitly stated. In Luhmann’s opinion. politics. In all other social worlds reciprocity precludes moral maxims and ethical principles. necessarily very restricted. the moral imperative substitutable for the aesthetic imperative. in such interaction full individuality cannot possibly be constituted. as explicitly stressed by Simmel. play is essential for understanding what the aesthetic experience is about. it and only it can be called beautiful without any reservations. It is a part of the essential process of representation and is an essential part of play as play.THE BEAUTY OF SOCIAL FORMS something less ambitious and at the same time more interesting. the aesthetic attitude is more than it knows of itself. Even in Gadamer’s understanding. It is interesting to compare Simmel’s position. This kind of play of nature is art’s model (ibid. What is even more important. It leads to a relativism which Gadamer would want to avoid. on the contrary. One can also speak about play or games without any players at all.: 92). is that the being of art cannot be determined as an object of an aesthetic awareness because. with the aesthetic theory presented by Gadamer in his study Truth and Method (1988).: 97). in this respect. with every other kind of social interaction – even if they are not ‘pure’ – an aesthetic element is associated. with all its consequences: My thesis. This is true of pure social forms or pure forms of sociation alone. Play is important in understanding art and the aesthetic experience. independent of the consciousness of those who play (ibid. There are many parallels between their conceptions. Play and games become art as soon as they are presented to others or performed 152 . in the Kantian sense of the word. Games can be regarded as selfdynamic processes – even though Gadamer does not use the concept – in which the movement ‘backward and forward’ is important. A subjective experience is not suited to act as the starting point of aesthetics. as is the case with the play of colours or of light. they only perform or present it. too – a moment or a possibility of experiencing a genuine aesthetic pleasure. (Gadamer 1988: 104) Gadamer suggested that the proper ‘subject’ of the experience of art is not in a normal sense the observing and experiencing subject but the work of art itself. a movement which does not serve any purpose or end result. As the example of fashion shows there are important and general social phenomena which come close to such pure forms. Because pure social interaction in the shape of sociability or play is necessarily reciprocal. This is true also of such ‘normal’ social interaction which is subsumed under other – ‘more serious’ – social purposes and interests and in which the aesthetic moment is not pronounced. then. The players of a game do not create or give birth to it. because – in the same sense as a work of art – play has its own essence. however. and thus the play is represented. In Gadamer’s own words. But does this not. The difference between ‘a natural game’ and art is. The performers and the spectators are not in a different position in this respect. in fact. Basically the difference between the player and the spectator is removed here. but he does not play it before an audience. on the other. comprising players and spectators’ (ibid. In interpreting the play the spectators are privileged only in the respect that the play is presented for them: it becomes apparent that it bears within itself a meaning that must be understood and that can therefore be detached from the behavior of the player. but the play itself is the whole. however. denies such an interpretation most emphatically. The requirement that the play itself be intended in its meaningfulness is the same for both. as such. e. not very great since self-presentation is a part of every game or play: ‘The players play their roles as in any game. both in a cult play and in a ‘regular’ theatre performance the ‘players’ or actors present a certain totality of meaning to an audience. one condition which must be demanded from a game before it is transformed into a work of art: it must become a separate and independent formation (Gebilde). Even a child presents something while playing. they both construct and interpret a meaningful totality.g. can always be repeated. To paraphrase Gadamer. In this sense there is a difference between a play at a theatre or a cult play. plays a role. mean that the spectators have to interpret and construe a totality of meaning by themselves? In this case. would not the art experience once again be created in the consciousness of the spectator alone? Gadamer. The main difference between Simmel’s and Gadamer’s interpretations obviously is that while Gadamer attempts to preserve the objectivity of the aesthetic experience by stressing the similarity between the social formation of a game or play and a work of art. In contrast. which. ‘The play of art’ is meant to be presented to others. Simmel tries to identify an aesthetic dimension in 153 . and children’s play.THE BEAUTY OF SOCIAL FORMS before an audience. whenever art is presented to others it reveals its specific nature as play. on the one hand.: 98). in the end. one could almost claim that it must be a social formation with a certain stability – or a social institution. which is already present both in the play and the game independently of the activity of the players. (Gadamer 1988: 99) There is. in his opinion. They cannot be realized at the same time or merged together. there are two basic instincts: the first instinct is sensual and has to do with the satisfaction of needs and wants. This means that the aesthetic pleasure associated with it can only be experienced by the participants of the game – unless the possible sociologist-observer is not counted. But even the observing sociologist is a member of the salon – or more generally. the realization of such universally valid laws or norms. Normally. Friedrich Schiller’s programme of aesthetic socialization The social world of play and games analysed by Simmel resembles in many respects the ideas of Friedrich Schiller. which our reason alone could tell us to follow. an aesthetic dimension included in a play or a game is essential both in the process of socialization of every human individual and in the development of the whole of humanity from animal to man. Schiller’s main problem is that. in every man. presented in his famous and influential work On the Aesthetic Education of Man (1982 [1795]). there is no means of conciliation between them. The aesthetic sphere is a necessary intermediary stage between the stage of nature and the human community observing moral laws. more generally and ambitiously. The sociability of a salon and the ‘game’ of sociation is not meant to be presented to anyone. the social association – that he or she is observing. Thus one could say that for Schiller the ‘play instinct’ is the main socializing agent. There is no possibility of reaching a compromise between them. even more than those presented by Immanuel Kant himself. in any case. per definitionem. It cultivates and moderates the human being who naturally only attempts to follow his own instincts like an animal. The second instinct is called the form instinct or formal drive. Both of these instincts are equally strong and are opposed to each other. the second to the sphere of reason and morality (‘Sittlichkeit’). According to Schiller. and not a spectator of a sports event. It is essentially intellectual by its nature. The aesthetic ‘play’ drive or instinct (‘Spieltrieb’) has the important task of moderating our instincts – or perhaps it would be better to speak of the moulding and stylizing of the wants of man without the use of violence or force. although it inevitably also includes a dimension of self-presentation.THE BEAUTY OF SOCIAL FORMS every game or play and. To Schiller. The first instinct belongs to the sphere of needs. in every social formation or form of interaction. 154 . there are no spectators or audience following the performance of the play of sociability. published shortly after Kant’s Critique of Judgment. and one could interpret it as an instinct for order. This play – or aesthetic – instinct resembles in many respects the form instinct because it too aims at a form. (Schiller 1982: 215–17) In this light it is not very difficult to see the close parallel between Simmel’s sociology of social forms and Schiller’s programme of aesthetic education of mankind. only beauty can grant us a sociable character (‘Gesellige Charakter’. By doing so he also. as representatives of human genus.e. because we cannot eliminate traces of individuality from the judgments of others as we can from our own. at an order or uniformity. Individual action and the individual’s instincts receive their form. The pleasures of knowledge we enjoy merely as genus. Simmel. in fact. without us having any share in them at all. no need for aesthetic education. hence we cannot make the pleasures of reason universal. and by carefully removing from our judgment all trace of individuality. Social interaction without at least the most elementary of forms (i. In arguing that sociology should study the pure forms of sociation or the play forms of sociation. or are cultivated. Beauty alone do we enjoy at once as individual and as genus. in a way.e. some simultaneity of action) would not be possible at all – it could not be called social interaction – and would end up in chaos. as if automatically. Schiller 1982: 214). i. Only a message (‘Mitteilung’) about beauty can unify mankind. turns Schiller’s aesthetic programme into a sociological one.THE BEAUTY OF SOCIAL FORMS would inevitably restrict the realization of the sensual instinct and the satisfaction of individual needs and wants. all the time. and that still can be enjoyed individually: The pleasures of the senses we enjoy merely as individuals. the play instinct. even though our needs already have a socializing effect on man and even though reason teaches us the elementary laws of social interaction. like sociability. because we are unable to universalize our own individuality.8 As was argued by Schiller. because it alone refers to a factor that really is common to all as genuine members of the human species. It differs from the form instinct in one important respect: it does not in a similar manner violate the ‘wild’ or animal instincts that belong equally and naturally to everyone. The task of the play instinct is to create order or to give a form to social interaction without suppressing our sensual instincts and drives. after all. in 155 . hence we cannot make the pleasures of sense universal. proved that there is. The only possible solution is reached with the help of Schiller’s third instinct. In this letter Rousseau stressed the difference between the indirect communication of the theatre. The alternative to an ethical community governed by laws or reason is not a totally atomized and disintegrated social world but the eternally changing. It seems as if Simmel would like to remind both Kant and Schiller that this reconciliation is not only possible in the narrow aesthetic sphere or in the ‘artificial’ world of play. art and games. But neither are socialization and individuality eternally irreconcilable opposites. That is why social formations are in a continuous state of change. thus. not only preforms or training grounds for a ‘higher’ ethical community governed by moral laws.THE BEAUTY OF SOCIAL FORMS every social interaction and every social association without the need of any outer force and without moral imperatives or laws of morality based on reason. social interaction is based on reciprocal aesthetic pleasure which is experienced subjectively by individuals. Simmel’s aesthetic communities are what socialization is really about. Luc Ferry (1992). but equally ordered. The ‘elementary’ or everyday forms of sociation are. in his interpretation of Kant’s Critique of Judgment. social reality of the multitude of social formations. example of this. and by no means the least important. In the feast. These social formations do not generally repress the genuine individuality of their members. There is a permanent tension between the individual and the social totality and their final reconciliation is not within reach. transferred into the aesthetic sphere the opposition presented by Rousseau in his famous letter to d’Alambert (1948 [1758]). any social solution is only a temporary one. be called genuinely beautiful. by emphasizing in his antinomy of taste the problem of the universal communicability of subjective pleasure. realized only through the scenes of a play (the symbol of monarchy). the spectator’s eye is not directed towards an alien object: the spectator is just like all the other participants who are their own 156 . and the direct communication of a feast (the symbol of democracy). Such reconciliation takes place in modern society daily in any possible form of interaction. On the contrary. furthermore. While interpreting the deeper meaning of Kant’s Critique of Judgment Simmel concluded: ‘In any case it is the first and deepest attempt of reconciliating in the aesthetic sphere the unique individual subjectivity of man with his equally inevitable overindividual communality’ (Simmel 1905a: 168–9). They can. The practical solution to the antinomy of taste offered by the modern fashion pattern is a good. has recently pointed out that Kant. not only in the exceptional situation of a feast or a revolution but – to interpret Simmel narrowly – of the sociability of cultivated people or – to interpret him more broadly – of the everyday social interaction of ordinary people. and in fashion in particular. in fact. playing and performing only for each other. This was done by emphasizing and analysing the dimension and possibility of reciprocal and equal aesthetical pleasure and freedom inherent in almost all everyday social intercourse in general. part of any social intercourse.9 157 . In other words. According to Ferry: here a theme becomes evident which is – mutatis mutandis – adopted by Kant in his third critique. was. the actor and the spectator are merged together. (Ferry 1992: 119) It seems as if Simmel wanted to point out that ‘this space of free communication’. and which lays the foundation for an aesthetic conception of free communication concerning a public space which is not conceptual nor regulated by rules.THE BEAUTY OF SOCIAL FORMS actors. which the aesthetes thought belonged exclusively to art. one should not look for the ‘original source of energy’ in social forms. In discussing Simmel’s essay on the sociology of the meal. First. much of Simmel’s analysis of different social phenomena consisted of his attempt to show that this theme of ‘separation from life’ runs through such diverse social forms (among many others) as ‘faithfulness’. obviously be wrong to interpret Simmel as thinking about the history of mankind as a kind of a process of civilization in terms of aestheticization. ‘sociability’. however. a schema. Even this idea has an interesting parallel in Kant’s thinking: since aesthetic pleasure always has to do with the free play of imagination and the world of 158 . Simmel always thought that there was a danger with such an aestheticization or ‘stylization’: the etiquette is always in danger of becoming an empty formula. As Davis (1973: 324) pointed out. like the etiquette of eating. we referred to the fact that Simmel obviously thought that social formations could gradually become more and more independent from the process of ‘real life’ and the satisfaction of instincts and needs which originally they were meant to serve. social formations become more complicated and differentiated.6 C O NC L U SI O N The aesthetic sociology and the aestheticization of everyday life Does money beautify social relations? Simmel’s sociology of social forms could easily be interpreted as including an almost utopian dimension in claiming that an element or a possibility of aesthetic pleasure is connected to every social form of interaction. but in the vitality of ‘real individuals’ (see Simmel 1949: 261). It would. and the aesthetic dimension of social interaction increases. At the same time. which is far removed from the living forces of ‘real life’. or a mere outer cage. and the ‘adventure’. In Simmel’s words. different and simultaneous forms of sociation. money. David Frisby (1985) understood aestheticization as resulting partly from the increasing cultural influence of money in modern society. they can only act as a limitation on the free play of imagination (see Kant 1980: 483). one social phenomenon. and the cultural influence of which reaches most social phenomena (as analysed by Simmel in his Philosophy of Money). Simmel’s society consists of innumerable. Simmel feared that objects of art would face the danger of becoming empty of meaning if they lost their ties with reality. Simmel seemed to use the concept of style and stylization in two separate ways. One could almost say that it permeates the whole of modern society. Stylization can. stylization would be one of the cultural side-effects of the increasing use of money (see also Böhringer 1984). to make a total evaluation of the degree of complexity or purity of social forms and in Simmel’s opinion it would certainly not be of interest.: 675–6). which to Simmel’s mind is the symbol of modern society. the second to art. this meant that all personal relations and nuances become objectified (Simmel 1989: 664). Money makes things equal by making them commensurable. either. Once exchange is mediated by money. Second. The argument is not. To Simmel. Money is the ‘medium of all media’ or a kind of a super medium which creates a distance between us and our ends in somewhat the same way as all instruments do (ibid. products are no longer made in order to satisfy the specific needs or wants of a particular person but in order to be sold and exchanged for money in the anonymous market. It is fixed to or grows from every style of life almost like a part of the body. however. Simmel characterized the effects of style in very 159 . often be interpreted as synonymous with aestheticization. Money is a symbol – an empirical and narrow one – of the unity of all being. indeed. and overcomes all ‘one-sidedness’ (Simmel 1989 [1900]: 695). even in principle. According to such an interpretation. In The Philosophy of Money. of which the first is connected to money.CONCLUSION imagination is always ‘richer’ than reality. of which no single one is self-evidently more important than another: every form can be taken as an object of social analysis. as simple as that. According to Simmel. There is. however. beautiful works of art. one can rightly ask for what purpose are the objects of beauty. but it is not possible. money creates a distance both among men and between men and things. needed? After all. shared by many. it is the opposite of a single work of art. Money is compared with the intellect and the law. A work of art is always unique and irreplaceable.: 660). somehow more delicate. think that the whole life of a person should be stylized in order to be shared by others. In ‘The Problem of Style’ Simmel discussed mainly the problems of the style of art. Simmel did not. all the individuals concerned are able to preserve their full individuality and to share a 160 . But neither the style of art nor the style of life belongs to this list of abstracting factors. and in this respect it resembles money. in the best case. Despite these similarities. can simultaneously belong to something higher. even promote it. penetrate the totality of interests of existence and try to determine them anew from its own standpoint. and they are all characterized by indifference towards everything that is individually specific and original. Style both simplifies and generalizes. the style of art is general. In his essay ‘The Problem of Style’. already referred to earlier. In style we can once again recognize a living antinomy: it preserves the singular and specific while at the same time combining and equalizing things that in reality are different. As Simmel wrote: ‘finally style is the aesthetic attempt to solve the great problem of life: an individual work or behaviour. In this sense. which is closed. there is a parallel between lifestyle and the style of an object of use in Simmel’s thinking. to speak of a personal style.CONCLUSION much the same way as the effects of money: ‘The inner meaning of an art style lies in the series of successive distances which it creates between us and things’ (Simmel 1989: 659). on the one hand. there is an important difference between Simmel’s concepts of style and money. As has already been pointed out. develop according to its own rules and. In addition to everything else. a shared style. It is thus possible. however. for instance. They all try to abstract from the totality of life one feature that is common to all. in The Philosophy of Money the broader concept of the style of life. on the other. Simmel thought that there had been a recent growing interest in stylization or in aestheticization which is achieved by creating a distance between men and objects (ibid. On the other hand. Simmel made a distinction between two principles of generalization which both belong to style: ‘style is a principle of generality which either mixes with the principle of individuality. which would then. a whole. displaces it or represents it’ (Simmel 1991b: 65). according to Simmel. characterizing works of industrial design or arts and crafts. On the contrary. a unifying encompassing context’ (Simmel 1991b: 70). Their relation to the individual and the specific is different. does not suppress their individuality but can. the opinion that the increasing importance of an aesthetic dimension is an essential part of the process of reflexive modernization. modern reflexivity. mainly to the role of the sphere of signs that have recently gained in independence: ‘Both these aspects. If such a connection exists. rather than in the one-dimensionality caused by money. Again. according to Guggenberger (1993): aestheticization runs as an important imprint of the Zeitgeist throughout all the areas of existence. In The Philosophy of Money one cannot find any general vision about the general aestheticization of modern culture followed by the increasing influence of money. It is almost impossible to solve in any single case what is already part of culture and what is a commodity and. which is typical 161 . even though he referred. in the plurality and complexity of all those social forms in which an individual takes part. good grounds for claiming that the distances created by money and style are different and the relation between them – if it exists – is more empirical than conceptual by nature. The aestheticization of everyday life Among recent German cultural theory and critique it has been almost as common to speak about the aestheticization of everyday life and culture as it has been among Anglo-Saxon cultural critics to speak about post-modernity. the other way around. It has often referred to the same or similar cultural changes. In Lash’s opinion. thus. both the poietic nature of reality and the fictional nature of the means of poiesis. It is promoted by the fact that the borderline between culture and the world of commodities becomes more and more ephemeral. it is much more indirect and complex and one should look for it in the general differentiation of modern culture. The culture levelled out and made commensurable by money is not at the same time automatically an aestheticized culture in the Simmelian sense. Welsch interpreted rather different kinds of phenomena to be examples of such aestheticization. For instance. in an article published in 1992. not unlike Baudrillard.CONCLUSION common style – or rather many different styles – each of which is shared by a different group of people. what is still culture. There are. (Guggenberger 1993: 147) Scott Lash also shared. can be combined and summarized into the following formulation: reality is an aesthetic product’ (Welsch 1991: 173). furthermore. consequently. consumers’ choices are essentially aesthetic. Schulze emphasized the fact that the inner orientation of the actors becomes more important in interpreting the meaning of things. the choices of taste are always situated in between the individual and subjective. in any affluent society. self-reflexive. It is often best to share one’s experiences 162 . Gerhard Schulze’s sociological study Die Erlebnisgesellschaft (1992) is probably the most systematic empirical study of lifestyles that attempts to analyse processes of aestheticization explicitly and systematically.CONCLUSION of modern individuals. Schulze’s interpretation is particularly interesting – from the point of view of the present argument – in claiming that the need for schematization and stylization expressed in different lifestyles stems from the very logic of these inner experiences. In such a case the individual does not only control and dress him or herself according to some specific picture or model of the self but also interprets anew. objects and actions and. Like Scott Lash. the interpretation of inner experiences becomes important: ‘The person who experiences things must first transform the objective state of affairs into his own subjective system of signs before he can react to it aesthetically’ (Schulze 1992: 97). Both individuals themselves and those who are observing them are apt to interpret their actions and experiences and to classify them accordingly. In such a ‘society of inner experience’. Even according to Schulze. It is transformed into an aesthetic phenomenon as soon as this control becomes hermeneutic or interpretative – in other words.: 99). a greater part of social activity resembles a play or a game’ (ibid. In Schulze’s opinion. on the other (ibid. has in general to do with self-control and self-observance.: 99). Schulze’s study is. and the general and objective. Schulze’s argument is that this helps to minimize insecurity. Such a conception of self-reflexivity is essentially aesthetic. and continuously works upon this picture or ideal: ‘Control and observance are changed into subjective interpretation of a subject who can suppress the objects only to a certain degree’ (Lash 1992: 267). According to his interpretation. Interestingly Schulze also referred to the fact that in such an aestheticized everyday life ‘games and plays have become more common or. as the book’s title indicates. action becomes self-reflexive. at least implicitly inspired by the ‘Kantian’ problem about the universal validity and communicability of these subjective experiences. like Germany in the 1980s. in such a situation there necessarily arises a need for schematization – or stylization – and classification of experiences. rather. on the one hand. Schulze referred on many occasions to the aestheticization of lifestyles. or to their aesthetic nature. nor does it refer to the dubious generalization made by Kant that only people living in a community are interested in beautifying themselves. on the contrary. This idea can. however.] is to make orientation easier. Furthermore. As Maffesoli said in a very Simmelian way. As the above. to follow the example of one’s own social milieu is now important for a different reason than it was in the nineteenth century: today people are more afraid of missing something important or particularly exciting. very sketchy presentation of some of his main ideas shows. To Michel Maffesoli (1993) style serves a similar purpose in modern society: it guarantees the synthesis of values and therefore preserves the order and form of society.: 436). both individual and general. They put together an amorphous but by no means undetermined number of signs into a syndrome of everyday aesthetics. something that others have already experienced. One could. then these pleasures are always both private and socially shared and communicable. which is normal in a certain social group’ (ibid. people both live their styles together with others and. be explicated best by referring to the analogy 163 . As Kant said. as Schulze claims. a man living in solitude would have no need for stylization. To guarantee one’s satisfaction it is best to follow an example set by people who in other respects resemble oneself and who seem otherwise to like or enjoy the same things (see Schulze 1992: 122–3). take the thesis of aestheticization even more seriously and claim that if the subjective pleasures of such a Erlebnisgesellschaft are really aesthetic pleasures. in the end. In this respect his analysis of lifestyles resembles Herbert Blumer’s study of fashion: both fashion and style function as necessary guidelines both for the people in question and for those who are observing or interacting with them: ‘The purpose of them [different styles – J.: 123). Schulze is inclined to interpret the need for schematization and stylization functionally. Lifestyles are ‘played’ for others and in front of others and thus are always formed in a reciprocal relation with others. G. create them only by themselves. Stylization is a typical response in the most varied fields of society – from the most frivolous to the most serious ones. This thesis is not the same as the empirical fact that people often increase their own pleasure by sharing it with others.CONCLUSION with others and enjoy what others seem to be enjoying. The schematizations and stylizations of everyday life serve the purpose of orientation in an unfamiliar social situation of which it is difficult to form a clear picture. than of acting foolishly and getting embarrassed because of behaving in a manner which is unsuitable under the given conditions (ibid. however.CONCLUSION between play and art. which makes it possible to adopt a disinterested and noninstrumental attitude to things. however. Just like all plays it too has its own unwritten. or an ‘etiquette’ which make it possible to say when the play is fair. According to Huizinga any form of free or autonomous activity can be called a play if the player understands that it takes place outside normal life – it was not meant to be ‘real’. One can and must ‘play’ with lifestyles. one does not only observe but also performs them. Just as a good football player is not the one who follows the rules most rigidly. such a shared world of meanings and experiences does not serve any purpose. in Huizinga’s analysis play is closely associated with art. but it is not enough: a great variety of social formations are also necessary. more or less complicated and delicate rules. It can still totally absorb. or The Playing Man (1984). no part of material interest is attached to it and from it no utility is to be expected. with its shared experiences. These ‘rules’ of the game are not. is like a play. Johan Huizinga’s famous essay Homo ludens. that we could speak of something like a more or less gradual process of aestheticization. it is an end in itself. Despite the liberty of improvisation and the freedom of individual performance it is possible to judge who is the master of the game. during which aesthetic pleasure becomes more important as a criteria of social action. in many ways shared Simmel’s interest in identifying the play forms of everyday culture. (Huizinga 1984: 23) Not surprisingly. A self-evident and unquestionable precondition of this process is general affluence and the overcoming of scarcity. He 164 . in which we have to deal with inner experiences which. the virtuoso of a lifestyle is not the one who simply follows as faithfully and as closely as possible the example set by others. The part played by self-reflexion and fantasy is important. who plays it best or most beautifully without referring to any explicit standards or norms of conduct. It can set the play-like dimension of social interaction free. Schulze’s scenes of lifestyles are just like Rousseau’s feasts turned into everyday life – or daily life turned into a feast. If Schulze’s and others’ argumentation is taken seriously it would mean that our everyday life is becoming more aesthetic. to other people and to the social world in general. The shared world of lifestyles. so rigid and forced as not to allow for a lot of individual improvisation and virtuosity. Just like a play or a game. are always attached to outer objects. which deals exclusively with play and games. it is doubtful whether Simmel shared the view of the increasing aestheticization of the social world – in particular. As has already been argued. acquire more play elements. The sociological study by Roger Caillois (1961). and I will tell you what kind of a culture you belong to. rather. games are indicative of the culture in which they are embedded: tell me what games you play. At the same time that the element of play is losing ground in its former strongholds. culture is born through play and games. some other fields. is not equally determined by their preference for one or another of the basic categories into which I have tried to divide games. traditionally regarded as being more instrumental and distant from play. (Caillois 1961: 67) In other words. By categorizing and systematizing different classes of play and games Caillois aimed at understanding the differences between and even the ‘destinies’ of various cultures: it does not seem to me unreasonable to find out whether the very destiny of cultures. In Caillois’ opinion. is more strict in separating the field of games and play from everyday social life. and identified elements of play in most forms of cultural and social life. it is not that play makes an important contribution to culture. Simmel’s intention in analysing play forms of sociation is closer to Huizinga’s than to Caillois’. a ‘playing man’ is a real human being. What makes social forms beautiful and what it is in them that produces aesthetic pleasure – besides disinterestedness and the subsequent independence – 165 . His sociology of play and games is. Huizinga even set it as his task to evaluate the relative importance of the play element in modern culture as compared to earlier times. to Huizinga.CONCLUSION analysed various elements of games in various cultural and social activities from war and sport to art and economy. their chance to flourish or stagnate. But what is more important to Huizinga is that no culture can exist without play. the results of this comparison are not straightforward. nevertheless. mass communication or trade. categories that are not equally creative. sport in particular. if one keeps in mind that Simmel thought that any such process of the separation of social forms from ‘real life’ was permanently threatened by an empty schematism. like economic competition. In other words. as ambitious as those of Huizinga or Simmel. In fact. play and ordinary life always take place in domains that are incompatible (Caillois 1961: 64). In his opinion. and. but as the ‘unwritten rules’ of ‘good conduct’. soon. One can claim that Simmel followed here the footsteps of Friedrich Schiller. fashion – which realizes some other purpose or end. he demands something over and above this: to begin with. an artistic performance. however. The social mechanism of fashion with its rapidly changing patterns creates the ‘superfluity in material things’.g. (Schiller 1982: 1205–7) In conclusion. as Schiller pointed out. a superfluity in material things (‘Überfluss an dem Stoffe’).CONCLUSION is their richness of variation. second. in order to conceal from appetite the fact that it has limits. As Schiller claimed. It cannot 166 . demanded by Friedrich Schiller. only then is the demanded multiformity possible: Not just content with what satisfies nature. or with pure sociability. It is also possible to understand better the great fascination that fashion exercises over modern man. Only then can the ‘form instinct’ be satisfied. in order to satisfy the formal impulse too. as in the versatility and subtlety of the etiquette in the case of the meal analysed by Simmel. only a ‘playing man’ is truly a man. and richness in life orientations. such as the realization of economic profit. it is not enough that there is an abundance of material things. In this sense it is probably safe to claim that modern society is characterized by an increasing aestheticization. There should exist a great variety of things. and meets his instinctual needs. of ‘Stoff ’. only a superfluity of material things (‘Überfluss des Stoffes’). They can consist of independent forms as such – as is the case with sport. too. (Etiquette should be understood not as a strict collection of rules or a code. the more different forms of association – or social worlds – there are in general in a society. and extend enjoyment beyond satisfaction of every need. one could say that the importance of aesthetic pleasure in social interaction is more pronounced. he is interested not only in the world of solid reality but also in appearance. an aesthetic surplus.) What counts here is the multiplicity of the forms of nonpurposive social interaction. with their own ‘rules of beauty’. admittedly. the richer and simultaneously more lenient the rules of these games are. and ensure enjoyment beyond the satisfaction of immediate needs. but they can equally well be present in an interaction – e. first. which allow a lot of variation and play and which therefore cannot be codified into a collection of laws. To play with appearances presumes affluence but. Georg Simmel – and later sociologists who have been interested in the process of aestheticization – can be said to have solved this paradox or problem of classical humanist programmes by identifying. in particular. However. subculture or ‘lower arts’. be functional to social competition. in the sense of youth culture. (It cannot be created by ‘culture’ alone either. or at least. or art in the true meaning of the word. his programme is reminiscent of Herbert Marcuse’s The Aesthetic Dimension (1978) which elevated art into the last and only stronghold of human emancipation. Gadamer believed that the ‘hermeneutically closed anthropological basis’ of art can survive over modern times and even today it is capable of creating a ‘communal sense’ or meaning (‘Gemeinsinn’) and of securing social integration and cohesion. in everyday social intercourse and forms of sociation.CONCLUSION be denied that fashion can also serve the function of social differentiation and. aesthetic pleasures in the exact sense of the European philosophical tradition. This function of art could be preserved in modern society only by sacrificing the very foundation of modern society. to act as a living example of such a community. its differentiation. a dimension of art and play. or at least predominantly. a community which could be shared collectively without suppressing the individuality of its members. however. Modern art forms a separate sphere of reality and has lost its ‘eternal value’ (cf. Max Weber). The community of art and the art of a community Hans-Georg Gadamer (1975) is probably the best example of a contemporary philosopher who explicitly followed the aesthetic-humanitarian programme of Kant and Schiller and emphasized the utopian task of art in modern society. In his opinion the function of art and aesthetic experience in general is to establish and develop a community. Such an art would act as a genuine experience of communality and make our world more genuine and more easy going. does not guarantee the experience of communality which could act as a real integrating force in society. Gadamer (1975: 84) criticized. In this respect.) The only chance to save Schiller’s and Kant’s programme 167 . As Brunkhorst (1988: 89) has pointed out. the pleasures of novelty associated with it are purely. at times. the relativistic aesthetic stance for destroying the main task of ‘Bildung’: to raise man into a state of universality. Gadamer’s programme and the task it presents to art is suspect. in the opinion of many contemporary critics. Such a position starts from the presumption that ‘fine art’. Thus it could not possibly play the role of creating such strong communality. In his opinion (Lash 1994: 144). under the star of such mimetic critique of the concept’ mainly because of the underlying aesthetic subjectivity. which to his mind has been a common way of understanding the peculiar nature of modern communities in opposition to the so-called traditional communities. based on ‘radical individualism – not a utilitarian but aesthetic individualism. who in his opinion all are – despite their otherwise different points of view – part of ‘the tradition of allegory’. to Derrida. Because of the basic individualism and subjectivity of this approach any attempt at developing the ideas of a community starting from this tradition. Not surprisingly. into part of everyday social relations. Rorty and Bauman. in this respect. Sensus communis is being born – and is dispersed – every day in the most multi-faceted lifestyles and in the etiquettes of the most diverse social worlds. any privileged position among the multiplicity and variety of different social worlds. The cultural and social richness of modern society has. to have a better access to ‘community’. first constitute the facticity of a community. in fact. The target of his critique included diverse authors and thinkers extending from Nietzsche to Benjamin and Adorno. which was supposed to act as an example of communality.CONCLUSION is not to deny the diversity of modern culture and the genuine individuality (and the subsequent experiences of heterogeneity and contingency) and demand the return (which naturally is possible only as a thought experiment) to the pre-modern unified culture of classicist art. are doomed to failure. in fact. the idea of aesthetic communities. Within this aesthetic approach there is no way to come to terms with the shared meanings which. Lash 1992). This certainly does not make art obsolete as such. aesthetic sociation In his recent contribution to the book Reflexive Modernization. Lash’s discussion could also be read as an attempt at self-criticism of his own earlier views (cf. transformed the separate aesthetic sphere. but neither has art. in order to analyse the social formations of a modern society. The understanding of the ‘we’ of the unifying factors of a community is impossible under the ‘star of aesthetic reflexivity. in Sitten. individualism of a heterogenous desire’ (Lash 1994: 144). the remedy offered by Lash to this conceptual fallacy is an old one: hermeneutics: ‘This sort of interpretation will give access to ontological foundations. The facticity of a community vs. in habits. ‘it may be necessary to break with such abstract aesthetic subjectivity’. Scott Lash (1994) criticized what he called aesthetic individualism. in background practices of cognitive and aesthetic 168 . understood in the hermeneutic meaning of the term. for example. are collectivities of shared background practices. by both Lyotard and Bourdieu. the genuine taste community. shared meanings. It is interesting to note that. but only by wishfully thinking away what had caused it: the modern differentiated society.). shared obligations and practices. This automatically means that such communities are rare. The problem disappeared. it is obvious that any single community of this kind is realized only occasionally and for a fleeting moment of time. The most interesting thing about Lash’s argument is not whether we can think in general of any social life beyond or outside a common ‘life world’ (‘Lebenswelt’). Only communities based on ‘shared background meanings’ share the ‘facticity of a community’. which was discussed earlier: the only effective remedy suggested was to overcome the distinction between producer and consumer. hermeneutic approach is the right one. in the sense of Maffesoli’s neotribes. or are on the fringes of the modern differentiated society. in the sense of Sittlichkeit. communities can be understood to resemble tribes. But the remedy would have killed the patient it tried to save because it presupposed the dissolution of the essential conditions of modern society. cultural communities. It will at the same time give us some understanding of the shared meaning of community’ (ibid. one can recognize three different ways of understanding the character of modern communities. the cultural “we”. thus leaving no individual tastes to be worried about. communities of taste as analysed.: 147). In the various examples taken from contemporary sociological literature and presented in his critical analysis. What Lash arrives at in his critical discussion is that without shared meanings. in Lash’s opinion. without some shared meanings in the hermeneutical sense of the 169 . entails transgressing the distinction between consumer and producer (ibid. Second.: 161). shared routine activities involved in the achievement of meaning’ (ibid. there cannot be any real communities – whether modern or traditional: ‘That is. These two ways of understanding modern communities are obviously evaluated by Lash to be inadequate and only the third. there are so-called aesthetic communities proper.CONCLUSION individualism. in otherwise very different contexts. First. united by a collective euphoria like the spectators at a sports event. Even though Maffesoli finds examples of such tribes everywhere in modern society. Lash is basically faced with the same dilemma as the early modern critics of industrial design and the enlightened propaganda aimed at cultivating consumers’ tastes. This is basically an empirical question. the explicit purpose of Simmel’s sociological thinking was to overcome the duality of the individual and the social. whether there are communities of this type that are at the same time ‘reflexive’ and non-traditional – that is. amusements and social gatherings the totally subjective and individual feeling of pleasure is not necessarily – as was demanded from the real aesthetic judgment of taste by Immanuel Kant – universally communicable. while being of an aesthetic character. as well as sociability and other play forms of sociation: my enjoyment or my gratification is dependent on the joy and gratification of all the members of the social collectivity in question. which might play an increasingly important role in the constitution of modern society or the sociation of the individual and which. communities into which one is not born or ‘thrown’ but which are freely chosen.CONCLUSION word already presumed by the definition of the concept of social action in Max Weber’s (1968: 22–3) system of the basic sociological categories. As has been pointed out earlier. in the tradition of sociological thought since Georg Simmel.d. which may be widely stretched over ‘abstract’ space. as the – rather limited – number of examples which Lash has taken mainly from alternative milieus gives us to understand. still overcome the solipsism of aesthetic subjectivity criticized by Lash. or. ways of analysing social interaction have been developed in which the opposition between the ‘I’ and the ‘we’ is overcome without sacrificing the subjectivity and reflexivity of the modern individual. It has been one of the main tasks of this study to show that. Such communities might indeed exist in the modern world. What is the most interesting question. at least from the point of view of the main argument of this study. such as the modern fashion mechanism or groups united by a common lifestyle. but every ‘player’ or participant can still safely make the assumption that all the other ‘players’ or participants are sharing a similar feeling of pleasure. Thus aesthetic sociology is not necessarily faced with the dilemma of Lazarus’ (n. and which consciously pose themselves the problem of their own creation and re-invention (see Lash 1994: 161). In such games.) or Gabriel Tarde’s (1962) mass psychology: people who watch the same opera or read the same newspaper – or wear similar clothes – do not just happen to 170 . to formulate the question more precisely. is whether there are in a modern society other kinds of social collectivities or formations. Neither is the real question whether or not one can really find living examples of such ‘hermeneutic’ communities even in a modern society. The principle of reciprocity is always built into play. 171 . does not necessarily ‘entail shared meanings. but still it is equally binding and obliging in relation to the people concerned. however. What is characteristic of such ‘communities of taste’ is that they are in a constant state of being born and dying out. In order to avoid overloading this concept it would therefore be better not to call them communities at all but to use Simmel’s phrase. each one totally independent of all the others. The standards of taste are in a perpetual state of change – yet they can still create order in a rapidly changing society.CONCLUSION do so routinely or for some mysterious. there is an in-built condition of reciprocity in such social formations. Fashion offers a socially binding and valid standard of taste which. practices and obligations’. of which the modern fashion mechanism is the best example. at least not in the sense presumed by Lash (1994: 160–1). forms of sociation. Lyotard 1988). To be in such a taste community. It does not share the ideal and in a sense exemplary character of ‘good taste’ as demanded by the aesthetic and hermeneutic tradition. the laws of which could never be discovered. but are only a ‘cloud of a community’ (cf. Instead they share a common taste and. form a taste community. As has been shown earlier. inexplicable reason. ‘which takes on the facticity of community’. In this sense they do not share the ‘facticity of a community’. thus. is only based on the individual ‘preferences’ and choices of taste of the members of such a ‘community of taste’. It was only natural that gastronomers were taking sides with the defenders of civilization and commerce. gastronomy is the set of rules which govern the cultivation and education of taste. was widely shared by nutritionists during the first decades of the present century as evidenced by Levenstein’s (1988) study (see also Levenstein 1993). The worry about the unwise and detrimental habits of consumption. Mandeville and Adam Smith in defending the cultivation and development of taste. Luxury – or in Smithian terms. is the gastronome a pedant? . de Pressac’s Considérations sur la cuisine (1931. As Schwartz (1986: 313) concluded. TA S T E A N D P L E A S U R E – O R U N D E R S TA N D I N G M O D E R N C O N S U M P T I O N 1 See Ewen (1988) whose exposition of the history of the theme is fascinating despite the fact that even he rather uncritically adopts such a perspective of cultural critique. Gastronomy is to the taste as grammar and literature are to the literary sense. . And this brings us to the heart of the problem: if the gourmet is a delicate connoisseur.NOTES 1 I N T R O D U C T I O N : N E E D . caused by false social pride. between one who can always decide and choose what is tasteful and good without reflecting on it and one who only follows the rules and standards of goodness. was formulated extremely well in P. In his Physiology of Taste (1975 [1825]). The gourmet is 172 2 3 . Whereas taste is the natural gift of recognizing and loving perfection. the gourmand’s good cheer at the table strengthened the bonds of society’. cited in Bourdieu 1984: 68): Taste must not be confused with gastronomy. The difference between a connoisseur and a gastronome. the great gastronomer was convinced that ‘the gourmand’s love of new tastes united the World in international commerce. Jean-Anthelme Brillat-Savarin joined the eminent ranks of philosophers like Voltaire. . the development of needs and the increasing division of labour – was conducive to human happiness. In the present context Mennell’s study is. The different explanations given for this affinity all amount to the fact that the sense of taste is somehow privileged to make distinctions. . 2 PHILOSOPHICAL AESTHETICS AND THE R E F I N E M E N T O F TA S T E 1 In Mennell’s study there are historical details and interpretations that could be discussed (e.NOTES his own gastronome. As Hower and Lalonde (1991) have pointed out. Among the eighteenth-century thinkers the physiological sense of taste – not eyesight or hearing – evoked the operation of judgment. The physiological sense of taste had a priviledged position among the human senses. Consequently. just as the man of taste is his own grammarian. is disposed to make distinctions. however. Not everyone is a gourmet. as he preferred to call them. and persons of refinement know this instinctively. Immanuel Kant’s (1980: 567–8) explanation. Ong (1967) and Falk (1994) have both suggested that of all the sense organs the mouth is disposed to make distinctions because whatever is introduced has to pass two gates before definitely entering the body. . They argue that in the emerging modern society it was becoming both more important and more difficult unerringly to make the proper distinctions both concerning social relations (with whom to socialize) and food (what to eat). 5 173 . ‘high culture’ expressed only the taste of a welleducated segment of society. however. there is such a thing as bad taste . unlike sight or hearing. Gans was interested in defending. the sense of taste. mainly treated as a coherent and interesting example of a theoretical interpretation of the social formation and development of taste in European societies. As has already been pointed out. that is why we need gastronomes . . Gans (1974) identified empirically in the United States five different taste classes or ‘taste publics’. rules are needed. as regularly and in such a pleasant way. against the critics of mass culture. . exercise one’s power of judgment as at a good dinner in good company. there is simply no other occasion on which one can. he did not acknowledge the hegemonic aspirations of the representatives of ‘high culture’.g. . is still the best – if one does not take it too seriously. the right of existence of an independent popular culture. For those who do not. To him. In his opinion. whether the modern European cuisine originated in Italy instead of France? Was it a more bourgeois phenomenon from the very beginning than Mennell gives us to understand?). there was a close parallel between the gastronomic literature and aesthetic discourse in the eighteenth century. . . 4 In the 1970s Herbert J. the production of consumer goods and services has become more important. in his Grundrisse (Marx 1973 [1857–8]: 325). Needs are common to all men and. however. In the production process. outdoor barbecues. etc. it is. For the impression of a continuous social climb to be created. Karl Marx was a rather exceptional critic of the modern commercial – or capitalist – society. As McCracken (1988: 94) has remarked. Simmel’s idea is not in itself in conflict with what Pierre Bourdieu (1984) has said. their recognition would pose no problem in the future communist society (see Gronow 1986). He also regularly emphasized that human needs are not historically constant and in this sense universal. sartorial fashion became the means by which the bourgeoisie separated itself from aristocracy and its values during the nineteenth century. radios. She wanted to be both feminine and modest in her outfit. On the one hand. According to Wilson. in this respect. Instead of production. social conflicts are often centred around consumption. K I T S C H A N D FA S H I O N 1 The same difficulty concerning the determination of the historical nature of needs was also faced by the theory of increasing misery in orthodox Marxism (see Gronow 1986). the first manuscript version of Capital. a question of social ascent rather than descent – an attempt to achieve the distinctive signs of a higher social status. From the point of view of goods. on the other hand. televisions. but represented a conservative family unit. there is no doubt that in another sense Marx remained faithful to the doctrine of human nature common in the Philosophy of Enlightenment. 2 3 4 5 6 174 . however. Even according to Simmel. This is called the trickle-down effect by marketing people. see Chapter 6 in particular).NOTES 3 L U X U R Y. On the other hand. Lloyd A. Elizabeth Wilson’s study of modern dressing. from the point of view of customers. he welcomed the future rich individuality of the modern wage worker with its many-sided and unrestricted needs. it is a question of decline. and has become a central area of social life which makes an appearance in many different ways. In many respects. attractive but prudent (Wilson 1985. See. The new middle-class woman did not imitate an aristocrat at all. – gradually ‘descend’ the pyramid. it is the middle class and especially the so-called new middle class that constitutes the cleverest distinction strategist of all. it obviously is sufficient that some – even relatively few – consumer durables such as cars. In Kumar’s own opinion the social significance of consumption has greatly increased. Fallers (1966: 403) has a typically functionalistic explanation for this: ‘the appropriation of status symbols offers an illusion of success to those who are without any real opportunity of social ascent’. . a kind of historically preceding natural need economy in which the principle of the satisfaction of needs has reigned. (Lyotard 1991: 218) In Lyotard’s words. The demand for possible communication as it is given in the feeling of the beautiful induces a sensus communis as its condition of possibility. (ibid. but.: 191) 175 . Communicability is a transcendental supplement. In his Lessons on the Analytic of the Sublime Lyotard’s (1991: 18) emphasis is slightly more ‘orthodox’: in criticizing or denying the possibility of all empirical interpretations of the idea of the taste community he declares that in Kant the possibility of communicability is founded upon the ‘supersensible’ principle of harmonious accord: Thus it is easy to show how the presupposition of a sensus communis owes nothing to experience. without any extrinsic mediation. One could say that taste immediately demands to be communicated immediately. Social movements have also emerged which are concerned not only with consumption itself but also with leisure time. general well-being and family life (see Kumar 1983: 313). This does not mean in the same instant. the critical procedure returns to the given order to legitimate or delegitimate that for which it ‘gives’ itself. taste is a sensation that immediately demands to be communicable. do not differ remarkably from each other (see Noro 1991: 68–9). 4 TA S T E A N D FA S H I O N 1 2 3 These kinds of ‘stage theories’ often postulated. the idea of the supersensible. Simmel wrote three different essays on fashion (1983 [1895]. It demands this immediately. however. This exigency or expectation is inscribed in the sensation. . . An interpretation of this order interferes with the critical procedure.NOTES 7 which again promotes a consumerist way of life. Consequently a ‘psychological’ but also a sociological interpretation of the aesthetical community is to be rejected. i.e. Schwartz (1986: 307) for whom the fear of never being satisfied forms the other side of the fear of abundance. which in turn. rather. 1905b and 1986 [1911]) which. is founded upon the supersensible principle of harmonious accord. For a critique of such conceptions. as if by a direct transitiveness. Cf. without the mediation of any argument. which cannot be inductive and must begin with the given in order to establish the conditions of its possibility. see Falk (1994: 113–14 and 138–41). in contrast to the modern consumer. Among the 18 fashion designers who were interviewed with open-ended questionnaires there were two men. To Simmel.NOTES 4 5 6 7 8 9 To Bourdieu (1984: 59–60. those groups which have a tendency to high stylization (youth. In Simmel’s words. In this sense the industry is characterized by permanent and heavy overproduction. one in the School of Industrial Design in the city of Lahti. it is an individual law. A great part of all the important Finnish fashion firms and factories were represented among the employers of the people interviewed. see also Rahkonen 1995: 15) taste is always primarily determined through negation. It can best be understood as a parallel to the harmonic unity of a painting in which every detail serves as an expression of a totality (see Lohmann 1992: 361–2). These would also be the groups that pay a lot of attention to fashion. The main criterion in selecting the interviewed designers was that they had been professionally active in the fashion industry for at least five years. and all the rest at the Helsinki University of Art and Design. from underwear to shoes. Simmel. The record industry offers a good example of this mechanism. more through disgust than liking. The most vulnerable groups would be those with the greatest investment in self-identity achieved through adornment or consumption in general. It has been estimated in the music industry that only 10 to 20 per cent of all the records produced for the market make a profit (see Burnett 1990: 77 and ESEK 1994). Taken together they had experience in various fields from ribbons and buttons to furs. from uniforms and work clothes to evening dresses. The difficulties in understanding the role of vitamins in nutrition and in argumentation concerning their ‘need’ are aptly illustrated by the attempt to come to terms with their importance with the help of a new concept: 176 . As Lohmann (1992: 355) has pointed out. It is in most cases extremely difficult to foresee which of the future products of a recording company will become ‘hits’. Arto Noro and the author of this book (see also Sinnemäki 1994). in fact. At the time these designers were occupied either with industry or with trade. It is an individual principle. cultural intermediaries. Two had completed their schooling abroad. All the respondents had received their professional schooling between the 1950s and 1980s. The study was conducted by Aino Sinnemäki. unique to the individual and not shared by others. Similarly. It makes it possible also to recognize even the most superficial expressions of his life as expressions of his life. this individual law obviously was a central principle of his philosophy of life (‘Lebensphilosophie’) and as such it cannot be determined in any more concrete terms. presumed that there is some unifying principle which determines or first creates the uniqueness and totality of an individual’s life span. This would also mean that the ‘push’ exercised by the lower classes is stronger than the positive ‘pull’ of the upper strata. conformists) are likely to feel anxiety (see Warde 1994: 892). in opposition to the classicist conception criticized by him. it is in contradiction with Kant’s other principle according to which judgments of taste cannot be based on any universal standards or general criteria. such a position is very suspect. By adding the correct amount of vitamins to their diets. 11 Päivi Lehto (1993). the object of eye and ear a form we engender. on the contrary. Friedrich Schiller was even more polemical. 10 On the role of patent medicines in the development of early advertising. claimed that the ‘fight’ was already over in the 1960s when margarine ‘came of age’ and started an independent life with a good character of its own. 5 THE BEAUTY OF SOCIAL FORMS 1 As Zammito (1992: 119–20) has pointed out. claiming that when touched an object executes an act of violent force against us whereas in the case of sight and sound our role is both more active and more distanced: What we actually see with the eye is something different from the sensation we receive. Mika Pantzar (1992) has. which butter now tries to imitate. see Richards 1990: 196–203. the real problem with Kant’s conception is not the fact that smells and tastes do not really fit into the sphere of aesthetic pleasure. only the drawing and the composition are the proper objects of the real judgment of taste (Kant 1987: §14). The object of touch is a force to which we are subjected.NOTES ‘hidden hunger’. people overeat and become fat because they have a hidden hunger for something which they could not possibly feel or recognize themselves. In the case of a smell or a taste Kant does not even believe it necessary to try to argue that they belong to the sphere of aesthetic pleasures. for the mind leaps out across light to objects. Even though Kant obviously thought that the colours of a painting or the typical sound of an instrument can add to the enchantment of the painting or the composition. Not even colours or tunes are beautiful without certain reservations. In addition. came to the conclusion that the standard margarine spread (FLORA) still concentrates its efforts on convincing the public that it is as good as butter. who has analysed television advertisements of margarine since the 1960s in Finland. they could be satisfied and could stop eating too much (see Schwartz 1986: 229). According to this theory. (Schiller 1982 [1795]: 195) 2 177 . As has been pointed out by Zammito. Something invisible was missing from their food. on the other hand. the first of which is based on a mere variety of impressions and the gratification of totally random change.d. in its attempt at a free form. which is still of a wholly material kind. however. the concession of life. what is totally opposite to silence characterized by the stupid state of the flow of all interniry. consequently. According to such a conception the aesthetic freedom would be best realized whenever the individual’s inclinations and the demands of society would 178 . (Lazarus n. the philosopher and Völkerpsycholog Moritz Lazarus. And it is this very aesthetic ideal that determines his interpretation about the whole life and. During our pastime we do not want to be totally idle. but he.: 36) 7 Like Simmel. One of Simmel’s teachers in Berlin. even the context in which this essay was first presented at the First German Conference of Sociology in 1910 gives support to the thesis that it should be taken seriously as Simmel’s programme of sociology.’ As has been pointed out by Noro (1991: 29–31). In Kurt’s opinion they both share a conception according to which it is not enough for an individual to be adopted into a society by performing a norm-conforming action or by following ‘beautiful norms’. separates two different forms of play. and to be explained by purely natural laws. argued in his lecture Über Gespräche in 1876 how the most important effect of discussion or social intercourse is the fulfillment of life. to strengthen our own being. instead we have something to do. a motion. Kurt’s interpretation of Schiller’s play instinct as designating only an empty social form – or an etiquette – can. In this respect our discussions remind us of plays. In a recension of Simmel’s Philosophie des Geldes Rudolf Goldscheid (1904: 411) wrote: ‘Simmel’s whole work is characterized by an aesthetic ideal. Schiller does not make such an explicit difference between play and art. the imagination. be questioned. (Schiller 1982: 209) 8 Kurt (1991) has attempted to show that there is an interesting parallel between Talcott Parsons’ voluntaristic theory of action and Schiller’s aesthetic programme. finally makes the leap to aesthetic play. The second is different from this play of freely associated ideas. besides. reading plays and discussion fill our pastime.NOTES 3 4 5 6 Despite the fact that culinary delights were obviously the only kind of aesthetic pleasures that Kant expressed any strong personal feelings about – he obviously loved to drink and dine well with friends – his philosophical aesthetic was strongly prejudiced against them (see Onfray 1990: 67–83). all his scientific activity. as of the necessity to shed their Dignity in order to manifest Grace. Schiller’s answer to his own question whether the state – or the society – of the beautiful appearance exists anywhere at all: As a need it exists in every finely attuned soul.NOTES 9 fit together. like the pure Church and the pure Republic. deception or counterfeit (see Schiller 1982: 197–9). (Schiller 1982: 219) 179 . with undismayed simplicity and tranquil innocence. this interest in the appearance has nothing to do with fraud. we are likely to find it. On the other hand. as was emphasized many times by Schiller himself. but by the aesthetic nature we have made our own. where men make their ways. This interest in the appearance (‘Schein’) and the following negligence of the demands of reality is something which is typical of culture and its development. as a realized fact. Cf. follow ‘the good form’ and to conform to the demands of the society. Schiller does speak about the joy of appearance (‘Freude am Schein’) which together with the play instinct is a universal human inclination which differentiates man from animal (see Schiller 1982:191– 3). not by some soulless imitation of the manners and morals of others. where conduct is governed. through even the most involved and complex situations. as if by nature. only in some few chosen circles. Such conduct would deserve to be called beautiful which would. free alike of the compulsion to infringe the freedom of others in order to assert their own. Sullivan. Böhringer. A. (1941) ‘Veblen’s Attack on Culture’. N. —— (1991) Modernity and Ambivalence. M. (1969) ‘Fashion: From Class Differentiation to Collective Selection’. 1: 62–5. Media. M. Frankfurt am Main: Suhrkamp. Blaxter. The British Journal of Sociology 35. (1995) Moi otets – Lavrenti Beriya. Their Sensory Evaluation. Blumer. Barber. D. New York: Harper & Row. Madsen. H. —— (1984) ‘Comment on Bryan Turner’s “The Government of the Body: Medical Regimens and the Rationalization of the Diet”’.: University of California Press. (1990) Health and Lifestyles. and Tipton. T. Bauman. Appadurai. Dahme and O. S. Freeman & Company. A. —— (1976) The Cultural Contradictions of Capitalism. R. Amerine. London: Macmillan. 2: 57–61. (1974) The Coming of Post-industrial Society. Cambridge: Cambridge University Press Aronson. Swidler. Günther (ed. Barthes.BIBLIOGRAPHY Adorno.. (1986) Habits of the Heart. (1976) Wines. H. San Francisco.) The Culture of the Stalin Period. (1992) On Human Finery. Becker. Praxis International 10. Q.: W. A. W. H. (1984) ‘Die “Philosophie des Geldes” als Ästhetische Theorie’. (1983) The Fashion System. 3: 389–413. Food Needs 1885–1920’. Cal. S. J. London: Allison & Busby. Z. (1986) The Social Life of Things.. Bell. and Roessler. W. in H-J. B. 1: 275–91. M. E. R. in H. London: Heinemann. 3– 4: 185–92. Bell. 180 . Culture and Society 4. New York: Basic Books.. Berkeley. Rammstedt (eds) Georg Simmel und der Moderne. London: Tavistock and Routledge. The Sociological Quarterly 10. Cal. (1982) ‘Social Definitions of Entitlement. Moskva: Sovremennik. (1990–1) ‘Communism: a post mortem’. Bellah. (1990) ‘The Working-Class Culture and Political Culture in the 1930s’. N. R. H. New York: Hill & Wang. London: Cornell University Press. Zeitschrift für Sozialforschung 9. Beriya. M. (1982) The Art Worlds. Ekström. Schanz. H. R. (1994) Common Places. Brillat-Savarin. J. 1: 37–47. (1990) Kost. V. Cheyne. 181 . Caillois. and Thomsen. P. (1978) Über der Prozess der Zivilisation. —— (1984) Distinction. N. Class and Gender). Gothenburg: Kompendiet. C. (1990) Concentration and Diversity in the International Record Business. Oxford: Basil Blackwell. (1992) ‘Food Rules in the United States: Individualism. Craik. Bidrag till en teori om magin’. Burnett. London: Pluto Press. Poetics 12. C. Brunkhorst. —— (1983) The Court Society. Mythologies of Everyday Life in Russia. Boym. (1961) Man. —— (1986) ‘Modeskaparen och hans märke. Sweden: University of Umeå. (1973) ‘Georg Simmel and the Aesthetics of Social Reality’. (1980) Kapitalisme. (1965) ‘Can a Smell or a Taste or a Touch be Beautiful?’. (1990) The Ideology of the Aesthetic. H. in P. Sweden: Salamander. Counihan. Denmark: Modtryk. Advances in Consumer Research 14: 487–91. S. Oxford: Basil Blackwell.. 1: 55–65. New York: The Free Press. L-H. H-J. Leviathan 16. (1992) Fashion. (1983) The Hearts of Men: American Dreams and the Flight from Commitment. Schmidt. Umeå. Eagleton. Århus. Lidingö. Play and Games. E. 1: 320–9. F. Carlsen. or: the Economic World Reversed’. London: Routledge. M. (1986) ‘Status Recognition in the 1980s: Invidious Distinction Revisited’. 1: 77–96.: Harvard University Press. Caygill. S. J. J-A. (1987) The Romantic Ethic and the Spirit of Modern Consumerism. London: Tavistock and Routledge. Frankfurt am Main: Suhrkamp. (1983) ‘The Field of Cultural Production. Paris: Heiman. (1987 [1757]) A Philosophical Enquiry into the Origin of Our Ideas of the Sublime and Beautiful. (1988) ‘Die Ästhetische Konstruktion der Moderne’. S. London: Routledge & Kegan Paul. (1991) The English Malady. Oxford and New York: Basil Blackwell. G. and Cavell. Sociological Theory 13. Campbell. J. behov og civilisation. J. T. (1994) The Face of Fashion. R.) Kultursociologiska texter. Chicago and London: University of Chicago Press. Dawson. Burnett. 4: 319–24. A Social Critique of the Judgement of Taste. Culture and Identity. and Hierarchy’. American Philosophical Quarterly 2. M. 4/5: 311–56. Ehrenreich. Oxford: Basil Blackwell. Mass. (1975) Physiologie du goût. Dunham. (1966) Plenty and Want: A Social History of Diet in England from 1815 to the Present Day. —— (1991) ‘Conspicuous Confusion? A Critique of Veblen’s Theory of Conspicuous Consumption’. Bourdieu (ed. Elias. Control. B. (1976) In Stalin’s Time. Davis. klass och kön (Food. Anthropological Quarterly 65.. Cambridge: Cambridge University Press. H-J. Davis. F.BIBLIOGRAPHY Bourdieu. London: Scolar Press. Oxford: Basil Blackwell. Burke. Social Forces 51. Cambridge. Coleman. (1989) The Art of Judgment. M. Tiede & Edistys 10. London: Heinemann. —— (1988) Truth and Method.BIBLIOGRAPHY ESEK (1994) ESEKin tuotantotukijärjestelmän seurantatutkimus (A Follow-up Study of the System of Production Support by ESEK). Kracauer and Benjamin. C. Vol. Cambridge: Cambridge University Press. —— ( 1985) Fragments of Modernity. 1: 5–22. London: Routledge. M. Cambridge: Polity Press. (1992) Der Mensch als Ästhet. L.B. A. Social Stratification in Comparative Perspective. S. Foucault. —— (1991) Consumer Culture and Postmodernism. (1979) Education and Social Mobility in the Soviet Union 1921– 1934. Helsinki: MV. W. Falk. Status. Mohr (Paul Siebeck). 6: 937–53. London: Sage. A. (1966) ‘A Note on the “Trickle Effect”’. (1985) ‘Ravintotiede ja ruokahalun disiplinointi’ (Nutrition Science and the Disciplining of Appetite). (1988) All Consuming Images. (1975) Wahrheit und Methode. The History of Sexuality. E. J. London: Sage. Fitzpatrick. L. Frisby. (1990) ‘Perspectives on Consumer Culture’.) Maailman merkkejä. (1987) The Use of Pleasure. Bendix and S. (1990) ‘“Oikean” elämän ongelma’ (The Problem of ‘Real’ Life). Fischler. Sosiaalilääketieteellinen aikakauslehti 27. P. 4: 314–18. Ferry. Featherstone. Fallers. in V. B. B. Advances in Consumer Research 18: 70–6. Fretter. Sociology 24. Metzler. Germany: J. S. 2. New York: The Free Press. The Advent and Maturation of Modern Society. New York: Basic Books. Advances in Consumer Research 14: 492–6. Le Goût. 182 . Tübingen. Die Erfindung des Geschmacks im Zeitalter der Demokratie. Fisher. (1981) Sociological Impressionism. London: Routledge & Kegan Paul. London: Sheed & Ward. J. —— (1986) ‘Learned versus “Spontaneous” Dietetics: French Mothers’ Views of What Children Should Eat’. C. Falk. H-G. in R. Social Science Information 19. Helsinki: Esittävän säveltaiteen edistämiskeskus. la cuisine et le corps. (1986) ‘Social Class and Consumer Behavior: The Relevance of Class and Status’. (1980) ‘Food Habits. D. —— (1994) The Consuming Body. (1981) Social Change. Gadamer. 1: 97–100. —— (1990) L’homnivore. Harmondsworth: Penguin. Paris: Odile Jacob. P. (1991) ‘The Consumer in Postmodernity’. Ewen. (1971) ‘Is Wine an Art Object?’. Etzioni-Halevy. 1: 47–53. —— (1992) Simmel and Since. A Reassessment of Georg Simmel’s Social Theory. Social Change and the Nature/ Culture Dilemma’. Firat. and Gronow. Theory of Modernity in the Works of Simmel. and Power. Salin (ed. —— (1991) ‘Miten “hyvää” myydään’ (How to Sell the ‘Good’). Lipset (eds) Class. 4: 945–65. F. M. Journal of Aesthetics and Art Criticism 30. Social Science Information 25. E. Stuttgart: J. Essays on Georg Simmel’s Social Theory. BIBLIOGRAPHY Gans, H. J. (1974) Popular Culture and High Culture, New York: Basic Books. Goffman, E. (1951) ‘Symbols of Class Status’, The British Journal of Sociology 2, 4: 294–304. Goldscheid, R. (1904) ‘Jahresbericht über Erscheinungen der Soziologie in den Jahren 1899–1904’, Archiv für Systematische Philosophie 10: 397–413. Gordon, L. A. and Klopov, E. V. (1989) Shto eto bylo? Moscow: Izd. Polititseskoi literatury. Gramsci, A. (1975) Letters from Prison, London: Jonathan Cape. Grean, S. (1965) Shaftesbury’s Philosophy of Religious Ethics, s.l.: Ohio University Press. Gronow, J. (1986) On the Formation of Marxism, Commentationes Scientiarum Socialium 33, Helsinki: Societas Scientiarum Fennica. Guggenberger, B. (1993) ‘Die Politische Aktualität des Ästhetischen’, Leviathan 21, 1: 146–61. Gusfield, J. R. (1992) ‘Nature’s Body and the Metaphors of Food’, in M. Lamont and M. Fournier (eds) Cultivating Differences. Symbolic Boundaries and the Making of Inequality, Chicago: University of Chicago Press. Hebdige, D. (1983) Subculture. The Meaning of Style, London and New York: Methuen. Heller, A. (1976) The Theory of Need in Marx, London: Allison & Busby. Hirdman, Y. (1983) Magfrågan. Mat som mål och medel, Kristianstad, Sweden: Raben & Sjögren. Hooker, E. N. (1934) ‘The Discussion of Taste from 1750 to 1770. Trends in Literary Criticism’, PMLA 49: 577–92. Horowitz, T. (1975a) ‘From Elite Fashion to Mass Fashion’, Archives Européennes Sociologie 16, 2: 283–95. —— (1975b) ‘The Man in the Middle’, Journal of Market Research Society 17, 1: 26–40. Hower, D. and Lalonde, M. (1991) ‘The History of Sensibilities: of the Standard of Taste in Mid-Eighteenth Century England and the Circulation of Smells in Post-revolutionary France’, Dialectical Anthropology 16, 2: 125–35. Huizinga, J. (1984) Leikkivä Ihminen (Homo ludens), Juva, Finland: WSOY. Jones, P. L. (1991) Taste Today. The Role of Appreciation in Consumerism and Design, Oxford: Pergamon Press. Kahn, H. and Wiener, A. J. (1967) The Year 2000, London: Macmillan. Kant, I. (1980) ‘Anthropologie in Pragmatischer Hinsicht’, in I. Kant Werkausgabe Bd. XII, Frankfurt am Main: Suhrkamp. —— (1987) Critique of Judgment, trans. W. S. Pluhar, Indianapolis: Hackett. Karisto, A., Prättälä, R. and Berg, M-A. (1993) ‘The Good, the Bad, and the Ugly? Differences and Changes in Health Related Lifestyles’, in U. Kjearnes, L. Holm, M. Ekström, E. Fürst and R. Prättälä (eds) Regulating Markets, Regulating People, Oslo: Novus Forlag. King, C. W. and King, L. J. (1980) ‘The Dynamics of Style and Taste Adoption and Diffusion: Contributions from Fashion Theory’, Advances in Consumer Research 7: 13–16. 183 BIBLIOGRAPHY Kornai, J. (1982) Growth, Shortage and Efficiency, Oxford: Basil Blackwell. Kumar, K. (1983) Prophecy and Progress. The Sociology of Industrial and Postindustrial Society, Harmondsworth: Penguin. Kurt, R. (1991) ‘Die Ästhetische Dimension des Parsonschen Voluntarismus’, Zeitschrift für Soziologie 20, 1: 64–76. Lasch, C. (1978) The Culture of Narcissism, New York: Norton. Lash, S. (1992) ‘Ästhetische Dimension Reflexiver Modernisierung’, Soziale Welt 42, 3 : 261–77. —— (1994) ‘Reflexivity and its Doubles’, in U. Beck, A. Giddens and S. Lash (eds) Reflexive Modernization, Cambridge: Polity Press. Lazarus, M. (n.d.) Über Gespräche, s. l.: Henssel. Lefebvre, H. (1991) Critique of Everyday Life, Vol. 1, London: Verso. Lehto, P. (1993) ‘Nautinnon ja itsekurin kamppailu. Margariinimainokset maalailevat mielikuvia’ (The Struggle between Pleasure and Self Control), Kulttuuritutkimus 10, 1: 21–8. Lenin, V. I. (1980) The State and Revolution, in V. I. Lenin Collected Works, Vol. 25, Moscow: Progress Publishers. Levenstein, H. (1988) Revolution at the Table. The Transformation of the American Diet, New York and Oxford: Oxford University Press. —— (1993) The Paradox of Plenty, New York and Oxford: Oxford University Press. Levine, L.W. (1988) Highbrow/lowbrow: The Emergence of Cultural Hierarchy in America, Cambridge, Mass.: Harvard University Press. Lieberson, S. and Bell, E. (1992) ‘Children’s First Names. An Empirical Study of Social Taste’, American Journal of Sociology 98, 3: 511–54. Link-Heer, U. (1986) ‘Überlegungen zur Manier und Stil’, in H-U. Gumbrecht and K. L. Pfeiffer (eds) Stil. Geschichte und Funktionen eines Wissenschaftlichen Diskurselementes, Frankfurt am Main: Suhrkamp. Lipovetsky, G. (1994) The Empire of Fashion, Princeton, NJ: Princeton University Press. Lohmann, G. (1987) ‘Georg Simmel yhteiskunnallista indifferensiä purkamassa’ (Dismantling Georg Simmel’s Social Indifference), Sosiologia 24, 2: 83–96. —— (1992) ‘Fragmentierung, Oberflächlichkeit und Ganzheit Individueller Existenz. Negativismus bei Georg Simmel’, in E. Angehrn et al. (eds) Dialektischer Negativismus. Michael Theunissen zum 60. Geburtstag, Frankfurt am Main: Suhrkamp. Luhmann, N. (1980) ‘Interaktion in Oberschichten: Zur Transformationihrer Semantik im 17. und 18. Jahrhundert’, in N. Luhmann Gesellschaftsstruktur und Semantik, Bd. 1, Frankfurt am Main: Suhrkamp. —— (1981) ‘Wie ist Soziale Ordnung Möglich’, in N. Luhmann Gesellschaftsstruktur und Semantik, Bd. 2, Frankfurt am Main: Suhrkamp. —— (1986) ‘Das Kunstwerk und die Selbstreproduktion der Kunst’, in H-U. Gumbrecht and K.L. Pfeiffer (eds) Stil. Geschichte und Funktioneneines Wissenschaftlichen Diskurselementes, Frankfurt am Main: Suhrkamp. 184 BIBLIOGRAPHY Lyotard, J-F. (1988) Peregrinations. Law, Form, Event, New York: Columbia University Press. —— (1991) Lessons on the Analytic of the Sublime, Stanford, Cal.: Stanford University Press. Maag, G. (1986) Kunst und Industrie im Zeitalter der ersten Weltausstellungen. Synchronische Analyse einer Epochenwelle, Munich: Wilhelm Fink Verlag. McCracken, G. (1988) Culture and Consumption, Bloomington, Ind.: Indiana University Press. McKendrick, W. J., Brewer, J. and Plumb, J. H. (1982) The Birth of a Consumer Society, London: Europa Publications. Maffesoli, M. (1993) La Contemplation du Monde, Paris: Bernard Grasset. Mäkelä, J. (1994) ‘Kunnon ateria: naisten käsityksiä ruoasta’ (The Proper Meal: Women’s Ideas about Food), unpublished licentiate thesis, University of Helsinki. Marchand, R. (1985) Advertising the American Dream: Making Way for Modernity 1920–1940, Berkeley, Cal.: University of California Press. Marcuse, H. (1978) The Aesthetic Dimension: Toward a Critique of Marxist Aesthetics, Boston: Beacon Press. Marinetti, F. (1989) The Futurist Cookbook, London: Trefoil Publications. Marx, K. (1973) Grundrisse, Harmondsworth: Penguin. Matthiesen, U. (1988) ‘Outfit & Ichfinish. Zur Beschleunigten Wandlung-Stypik der gegenwertigen Bekleidungsmoden’, Soziale Welt Sonderband 6:413–48. Mayntz, R. and Nedelmann, B. (1987) ‘Eigendynamische Soziale Prozesse. Anmerkungen zu einem analytischen Paradigma’, Kölner Zeitschrift für Soziologie und Sozialpsychologie 39, 4: 648– 68. Mennell, S. (1985) All Manners of Food. Eating and Taste in England and France from the Middle Ages to the Present, Oxford and New York: Basil Blackwell. —— (1987) ‘On the Civilizing of Appetite’, Theory, Culture and Society, 4, 3: 373–403. Mennell, S., Murcott, A. and van Otterloo, A. (1992) ‘The Sociology of Food: Eating, Diet and Culture’, Current Sociology 40, 2 (special issue). Michl, J. (1989) ‘Industrial Design and Social Inequality’, in S. Parko (ed.) Den stoda nordiska utställningen i Köpenhamn 1898, Helsingfors: Nordisk forum för formgivningshistoria. Miller, D. (1987) Material Culture and Mass Consumption, Oxford: Basil Blackwell. Mills, C. W. (1963) ‘The Man in the Middle’, in L. Horowitz (ed.) Power, Politics and People, Oxford: Oxford University Press. Nietzsche, F. (1990) ‘Zur Genealogie der Moral’, in F. Nietzsche Das Hauptwerk IV, Munich: Nymphenburger. Noro, A. (1986) ‘Simmel, muoti ja moderni’ (Simmel, Fashion and the Modern), introduction to G. Simmel Muodin filosofia, Helsinki: Odessa. —— (1991) Muoto, moderniteetti ja ‘kolmas’. Tutkielma Georg Simmelin sosiologiasta (Form, Modernity and the ‘Third’. A Study of Georg Simmel’s Sociology), Jyväkylä, Finland: Tutkijaliitto. 185 BIBLIOGRAPHY —— (1993) ‘Simmelin salonki: ideaalinen sosiaalinen maailma’ (Simmel’s Salon: the Ideal Social World), in A. Noro Postfranzenia, Helsinki: Tutkijaliitto. Onfray, M. (1990) Der Bauch der Philosophen, Frankfurt am Main: Campus. Ong, W. (1967) The Presence of the Word, New Haven, Conn.: Yale University Press. Packard, V. (1960) The Status Seekers. An Exploration of Class Behaviour in America, London: Longmans. Pantzar, M. (1992) ‘Voin ja margariinin julkinen dialogi Suomessa 1923–1987’ (The Public Dialogue between Butter and Margarine in Finland 1923–1987), Sosiaalilääketieteellinen aikakauslehti 29, 3: 146–55. Pastuhov, V. (1991) Obshtchestvennoye dvizheniye Rossii v epohu Perestroiki, Moscow: Institut mezhdunaradnogo rabotchego dvizheniya. Peterson, S. T. (1994) Acquired Taste, Ithaca, NY: Cornell University Press. Pope, D. (1983) The Making of Modern Advertising, New York: Basic Books. Prättälä, R., Berg, M-A. and Puska, P. (1992) ‘Diminishing or Increasing Contrasts? Social Class Variation in Finnish Food Consumption’, European Journal of Clinical Nutrition 46: 279–87. —— (1993) ‘Työntekijä-ja toimihenkilömiesten elintavat 1978–1990’ (The Living Conditions of Male Blue Collar and White Collar Workers 1978–1990), Sosiaalilääketieteellinen Aikakauslehti 30, 2: 122–33. Prättälä, R., Rahkonen, O. and Rimpelä, M. (1986) ‘Consumption Patterns of Critical Fat Sources among Adolescents in 1977–1986’, Nutrition Research 6: 485–98. Rahkonen, K. (1995) ‘Maku taisteluna: Bourdieu ja Nietzsche’ (Taste as Struggle: Bourdieu and Nietzsche), Sosiologia 32, 1: 12–25. Rahkonen, O. (1992) ‘Tupakoiva suomalainen’ (The Smoking Finn), in A. Karisto et al. (eds) Terveyssosiologia, Juva, Finland: WSOY. Recommended Dietary Allowances (1989), Washington, DC: National Academy Press. Revel, J-F. (1979) Erlesene Mahlzeiten, Frankfurt am Main: Propyläen. Richards, T. (1990) The Commodity Culture of Victorian England. Advertising and Spectacle 1851–1914, Stanford, Cal.: Stanford University Press. Richardson, D. P. (1990) ‘The Acceptance of Novel Foods in the Market’, in J. C. Somogyi and E. H. Koskinen (eds) Nutritional Adaptation to New Life-Styles, Bibliotheca Nutr. Dieta Vol. 45, Basel: Karger. Rimpelä, M., Rimpelä, A. and Paronen, O. (1983) ‘Maidon ja voileipärasvojen laatu’ (The Quality of Milk and Vegetable Fats), in M. Rimpelä et al. (eds) Nuorten terveystavat Suomessa. Nuorten terveystapatutkimus 1977–79. Lääkintöhallituksen julkaisuja. Sarja Tutkimukset 1983: 4, Helsinki: Lääkintöhallitus. Riukulehto, S. (1995) ‘Luxury and Waste in American Discourse at the Turn of the Century’, unpublished licentiate manuscript, University of Jyväkylä. Rousseau, J.-J. (1948) Lettre à M. d’Alambert sur les Spectacles, Ed. Critique par M.Fuchs, Textes Litteraires Français 22, Lille: Librairie Giard. 186 (1987) Den Sociale eksorsisme. Schmidt.: Free Press. Århus. Wolff (ed. Sproles (ed. E. New York: The Free Press. Porvoo. Günther (ed.: 120–99. Baltimore and London: Johns Hopkins University Press. A. —— (1950) ‘The Metropolis and Mental Life’. B. Salz. Rozin. —— (1920) Grundfragen der Soziologie: Individuum und Gesellschaft. Die Zukunft.) Georg Simmel 1958–1918. —— (1983) ‘Zur Psychologie der Mode. A Cultural History of Diets. Wolf (ed. 1935–194l.BIBLIOGRAPHY —— (1994) Discourse on Political Economy and the Social Contract.: Burgess (originally published in International Quarterly (1904) 10: 130–55). Schiller. New Brunswick. in A. (1955) Die Entwicklung des Geschmacksbegriffs in der Philosophie des 17. Huomioita Kantin Arvostelukyvyn kritiikistä’. in E. Vorlesungen. Fürst et al.) The Culture of the Stalin Period. Columbus. November: 254–61. Frankfurt am Main: Campus. R. in K. London: Macmillan. Jahrhunderts. in K. F. Kultursoziologie der Gegenwart. (1959) ‘A Note from a Student of Simmel’s’. Sartorti. P. Sellerberg. Ohio: Ohio State University Press. (1986) ‘Psychological Factors Influencing Food Choice’. —— (1910) ‘Soziologie der Mahlzeit’. S. Fantasies and Fats. 17: 204– 216. (1977) Luxury: The Concept in Western Thought. Schulze. G. —— (1994) The Blend of Contradictions. 16. Bd. NJ: Transaction Publishers. L. and Pelchat. Göttingen: H. Soziologische Studie’. in C. —— (1908) ‘Problem des Stiles’. (eds) The Food Consumer. Ill. in G. H. Archiv für Begriffsgeschichte. und 18. Minneapolis.) Taiteen kritiikistä. Oxford: Clarendon Press. Oslo: Solum. Denmark: Modtryk. Oxford and New York: Oxford University Press. Chicago. (1992) Die Erlebnisgesellschaft. Finland: WSOY. (1896) ‘Soziologische Ästhetik’. 1. Siegelbaum. (eds) Palatable Worlds. Fr.) The Sociology of Georg Simmel. G. Chichester: John Wiley. A. Sekora. Sociocultural Food Studies. (1986) Never Satisfied. Haapala (ed. —— (1905b) Philosophie der Mode. —— (1949) ‘The Sociology of Sociability’. (1982) On the Aesthetic Education of Man. Bouvier & Co. (1991) ‘Kritiikin lapsu(u)s.) Perspective on Fashion. Berlin and Leipzig: de Gruyter. H. L. (1990) ‘Stalinism and Carnival: Organisation and Aesthetics of Political Holidays’. 10 October. (1991) ‘In Food We Trust: Vitally Necessary Confidence and Unfamiliar Ways of Attaining It’. J. Dahme 187 . L-H. Leipzig: Duncker & Humblott. Simmel. Eden to Smollett.. Berliner Tageblatt. in H. Dekorative Kunst 16: 307–16. —— (1905a) Kant. Santanen. in H-J. Berlin: Pan. Cambridge: Cambridge University Press. American Journal of Sociology 55. Schwartz. Schümmer. (1988) Stakhanovism and the Politics of Productivity in the USSR. —— (1981) ‘Fashion’. Fallon. A-M. M. Minn. Ritson et al. 1: 2. —— (1984): ‘Die Grossstädte und das Geistesleben’. 3: 415–32. S. —— (1986) ‘Die Mode’. 7: 1215–30. and Behan. D. New York: Random House. A. Frankfurt am Main: Suhrkamp. Kelly (eds) Introduction to Russian Cultural Studies. 1997) ‘The Concept of Kul’turnost’: Notes on Stalinist Civilizing Process’. E. Volkogonov. Culture and Society 8. Polititsesky portret Vol. (1946) The Great Retreat. Berlin: Klaus Wagenbach. Bibliotheca Nutr. (1982) ‘The Government of the Body: Medical Regimens and the Rationalization of the Diet’. Muoto 14. (1984) Culture as History. F. V. Timasheff. Oxford: Oxford University Press. A. Berlin: Klaus Wagenbach. Untersuchungen über die Formen der Vergesellschaftung.BIBLIOGRAPHY and O. (1961) The Theory of the Leisure Class. G. Eine Kritik der ethischen Grundbegriffe 1–2 Bd. —— (1985) Rembrandt: ein Kunstphilosophischer Versuch. C. Entertainment and Society since 1900. Somogyi and E. Dieta Vol. J. Bibliotheca Nutr. I. (1986) ‘Food Fallacies and Food Faddism’. Dutton. (1989) J. Theory. in G. Somogyi. Frankfurt am Main: Suhrkamp. Sombart. in G. —— (1989) Philosophie des Geldes. (1991) ‘Notes on the Relationship between Production and 188 . Sinnemäki. (1986) Liebe. Schriften zur Soziologie. S. Cambridge: Cambridge University Press. W. (1990) ‘Convenience Foods and the Consumer – Current Questions and Controversies’. I. Gloucester: Peter Smith. (forthcoming. Shepherd and C. Koskinen (eds) Nutritional Adaptation to New Life-Styles. (1981) The Problem of Human Needs and the Theory of Civilization. The Growth and Decline of Communism in Russia. New York: E. Kölner Zeitschrift für Soziologie und Sozialpsychologie 43. 3: 56–7. Berlin: Klaus Wagenbach. Turner. Basel: Karger. Aldershot: Avebury. Stare. Dieta Vol 36. 3: 63–71. C. (1994) ‘Muodin luojien muoti’ (The Fashion of Fashion Designers). Basel: Karger. Simmel Das Individuum und die Freiheit. New York: Pantheon Books. (1992) The European New Middle Class. Europe–Asia Studies 46. Springborg. in D. Eine Auswahl. —— (1991b) ‘The Problem of Style’. in J. R. 2: 254–69. N. V. T. Volkov. Stites. Tarde. 45. Sussman. The Transformation of American Society in the Twentieth Century. (1992) Russian Popular Culture. Rammstedt (eds) Georg Simmel. (1991) ‘War der Reale Sozialismus Modern? Versuch einer Strukturellen Bestimmung’. Srubar. Munich: Matthes & Seitz. P. Luxus und Kapitalismus. —— (1992) Soziologie. P. (1962) Laws of Imitation. London: George Allen & Unwin. H. Warde. Veblen. Sulkunen. Simmel Philosophische Kultur. W. Stalin. P. J. Vinnikov. —— (1991a) Einleitung in die Moralwissenschaft. Frankfurt am Main: Suhrkamp. (1994): ‘The End of Soviet Power in St Petersburg: An Insider’s View’. Frankfurt am Main: Suhrkamp. B. A. The British Journal of Sociology 33. Moscow: Novosty. B. Zhukov. London: Virago. 2: 167– 85. W. 30. G. St Paul. E.: University of Minnesota Press. Cultural Studies 5. (1968) Economy and Society. M. (1982) Dream Worlds. London: Macmillan.: University of California Press. in R. Zammito. 189 .BIBLIOGRAPHY Consumption’. Clothing. Weber. 4: 877–98. (1989) ‘Family Food Systems. 3: 164–77. E. (1991) ‘Esteettisen Ajattelun Ajankohtaisuudesta’ (On the Actuality of Aesthetic Thinking). Wark. R. London: Chatto & Windus. Mass Consumption in Late Nineteenth-Century France. Cal. Wheaton. N. Preventive Health and Dietary Change: A Policy to Increase the Health Divide’. S. (1987) Institution and Interpretation. (1985) Adorned in Dreams: Fashion and Modernity. Minn. Wilson. Sociology 28. Burrows and C. Wilson. H. and the Manufacturing of Post-Fordist Culture’. London: Macmillan. Chicago: University of Chicago Press. (1985) Savouring the Past. Zaleski. The French Kitchen and Table from 1300 to 1789. (1991) ‘Fashioning the Future: Fashion. (1992) The Genesis of Kant’s Critique of Judgment. New York: Bedminster Press. 1: 61– 6. M. (1980) Stalinist Planning for Economic Growth 1933– 1952. Novy Mir. Tiede & Edistys 16. J. Welsch. Weber. —— (1994) ‘Consumption. Berkeley. (1954) ‘Vospitanye vkusa’. Marsh (eds) Consumption and Class: Divisions and Change. Identity-Formation and Uncertainty’. 10: 159–78. Journal of Social Policy 18. Williams. J. 129 Carlsen. 163 Böhringer. 172 Brunkhorst. 132–5 Counihan. 11. x. Q. 37. 84. 33. 6. v. M. 127–30. G. 20–6. 102 Behan. 168 Baumgarten. W. 75. M. 93–4. 15 Benjamin. 121 Burnett. 150. D. H. x. F. 60 Barthes. W. 41. C. A. 172. 83. 120 Coleman. 104 Bell. H. J. J-A. 150. A. 57 Amerine. 109–10. G. I. 96 Beck. 105 Davis. S. 36. 7–8 Barber. 56 Blaxter. T. 168 Dunayevsky. 75 Bellah. 72–4 Bell. xiii. 21. F. 120 Craik. V. 130 Davis. 167 Burke. 10–11 Chapell. E. 122 Blumer. R. 25 Cheyne. I. R. 29. 33 Derrida. N. 10–13. J. 86 Burnett. 76. 174–5 Boym. 73–4. 86. 60 Brillat-Savarin. H. 84. 101–7. E. J. H. 161 Bauman. T. 9. 91. 33 Caygill. 103–4. O. A. 71 Bourdieu. 114. M. U. 140. 119. 85. J. Dr 86 Aronson. 115 Bell. 78–9. 91 Armstrong. S. J.NAME INDEX Addison. 41. S. 83. M. 8. 168 d’Alambert. 2. 8. N. H. 165 Campbell. 32 Atwater. 57 Dunham. W. 7. 99 Becker. 51 Blanter. 68. J. 99. 28. E. 90–1. xi. 78. S. 158 Dawson. R. 168 Beriya. 5. 156 Aleksandrov. C. 86 Adorno. 131–2 Appadurai. 47. 2. P. 29. M. E. 13–16. 15–16. M. 9. E. M. 132. 159 Bookchin. 24. 99. 67–71. 6. 27. 6 Cavell. 140 Baudrillard. 45. V. 99 Eagleton. 78 Baudelaire. J. 54. R. G. C. 73. Z. 176 Caillois. 152 190 . 2. 20 Atkinson. 118. 5. 59–62 Durkheim. P. V. 16 Grean. 126. P. H. 71. M. 20. 86 Hutcheson. 178 Lalonde. 123–4. 161 Gusfield. C.NAME INDEX Ehrenreich. 138. K. 174 Farley. 116–18. 161–2. 53 Graham. A. 177 Gordon. 97–8 Goffman. B. 134. 45. 173–4 Guggenberger. 72 Ewen. 82. 24. 53 Kornai. E. 120. M. 100–1 Fischler. L. 1. A. 64–5 Lehto. M. 15 Heller. I. 100 Hegel. 17. 174 Kurt. 7. 86 Ilmonen. M. 177 Karisto. J. 7. 121 Gramsci. G. 172 Falk. 60 Foucault. R. H. L. 32. 9. W. N. 35 Ekström. 29. 72 Kant. 10–11. L. 107–8 Hower. 68 Kumar. 91. 120. N. 32–4. 42. R. 178 Lefebvre. J. 171. 13. F. S. J. 83. 23 Ferry. K. M. 14 Horowitz. 41. 124 Fretter. 71. L. 21. B. A. E. 167 Galbraith. 71 Khrushchev. 25 Featherstone. 175 Fallers. 20. 173 Giddens. 173 Lasch. M. 103. 33. J. 140– 141. B. 132. 10–11. S. I. 8. 105. 116 Elias. J. E. 128–9 Fisher. 77–8. 144–50. D. 33. 27. A. J. 12 Gronow. 51 King. 20. H. 173. 31 Gans. J. 29. S. W. L. 15–16 Levenstein. L. R. 114. H. xiii Jallinoja. 4–6. 15. A. 2. U. 13–15. 152–4. 163–4. E. F. 99 Glasse. 175. 119–21 Hebdige. 25 Goethe. 33 Fitzpatrick. H-G. 68 Hirdman. W. 156–9. 111 191 . V. 94 Kahn. D. 136. 5. 167–8. J. F. 41 Goldscheid. S. 176 Lenin. 83–4. 3. E. G. 39 Lieberson. S. 92–4. 92. 116. 48. 119. 137 Escoffier. N. 104–5. 168–71 Lazarus. 172 Levine. A. 99. W. 123. R. 83–90. 126. W. 171. P. A. xiv. 154. xiii Jones. 47 King. T. M. 173 Huizinga. 27. v. 156–7 Firat. 173. 168 Lash. A. ix–xii. S. 27. D. C. 8 Hooker. 43 Etzioni-Halevy. 139–41. J. S. Y. 71. E. 111–13. 47 Klopov. K. 126 Keynes. 131–2 Frisby. C. 78. 86 Horkheimer. J. 164–5 Hume. 75–6. 18. 3. D. 104 Link-Heer. xiv Gadamer. 29. J. 113–14. 96 Lipovetsky. H. 12. 159 Fürst. S. S. W. 167 Marin. G. F. 57 Otnäs. J. 166–8. de 172 Prättälä. 123 Marcuse. C. 28. 130 Nietzsche. 15. 176 Smith. 173 Menon 25 Michl. E. P. 176 Richardson. A. 56 Rahkonen. M. 43. 29. 17. R. V. 173 Ordzhonikidze. 29. 128 Shakespeare. 9 Pope. D. 46. 149–61. 81. 31. 87. 112. 130 Mennell. 174–8 Sinnemäki. 15. 121. 77. D. 19. S. H. R. 99. xiii Packard. 169. 5. S. 41. xi. xi–xiii. 77. 93–4. 32 Roessler. R. J-J. 151–2 Lyotard. 142. 34. 54 Orlova. J-F. 89 Sartorti. 58–9 Schiller. W. 177 Parsons. 46 Pressac. 121. 50. T. 33. 146 Richards. 116 Riukulehto. 5–7. 9. 95–6. 81 Mauclair. 6 Schulze. 32. 54. 43. 46–7. N. 172–4. G. 39 Siegelbaum. 71–2. 112. 129. 135– 46. 77. 98–9. 11. 72 Pantzar. J. W. H. 10. 2. A. 76–7. J-F. 25 192 . F. 5 Mills. 134 Marx. O. 39. M. xiii. D. 113–14 Pushkin. B. 176 Sekora. 131. 162–4 Schümmer. 29. 9. 171. 78 Maffesoli. F. 131–2 Rorty. F. 31 Sellerberg. 65 Mikoyan. 13–14. xiii. 42–3. 111. H. 163–7. 125 Rimpelä. 44 McCracken. F. R. 25–7. 47. 45 Nedelmann. 174 Massialot 25 Matthiesen. K. 140 Santanen. 115 Mandeville. x. 3. 100. L. 18. I. 172 Smith. 18–21. G. A. 168 Noro. G. T. xii. 68 Peterson. 170–1. 163. 172 Marchand. 156. 25 Marinetti. 82. L-H. 88–101. 54 Maag. T. 89–90. B. de 77. V. 20. M. G. xiii–xiv.NAME INDEX Lohmann. 81. 44–5 Mayntz. 174 McKendrick. 100. B. A. K. 79–81. 175–7 (ind_sp> Onfray. J. 27. I. 139. 79. 145. R. 31–3. 122. M. 76–7. 60. 125. E. A-M. L. 169 Mäkelä. S. C. 79. A. 176 Luhmann. 9. 114 Revel. E. P. 13. 79–81. 14. 97. xiii. 57 Morris. 175 Rahkonen. 15–16. W. W. 50 Simmel. 107–8 Molière 41 Molotov. 35. U. 154–6. 54 Miller. 164 Rozin. xiii. 177 Ong. 123. 178 Pastuhov. A. 177–8 Schmidt. P. 175 Lyubimov. S. J. 126 Salz. V. 75. 11 Schwartz. 15. 168 Rousseau. 119. P 115. 81–5. S. M. 23 Sussman. 6. V. R. 34–42. C. A. R. N. A. 19–20. 59–60. J. J. 66. 79–80. E. 127 Springborg. E. 63–5 193 . W. K. 79 Somogyi. 32. 29. 18 Wiener. D. F. V. 61 Tsfasman. I. 46 Vinnikov. 176 Wark. L. 2. 54 Zammito. J. A. J. 5 Srubar. I. 51. S. 55–6. 4–6. 13. J. 27–8. N. 99–100. 72. V. 55–6. P. 68–9 Stalin. Yu. 20 Veblen. 71–2 Williams. W. 60 Sulkunen. xiv. 161 Wheaton. x. 167. 60 Voltaire 172 Voroshilov. P. 53–7 Tolstoy. 30 Weber. G. 92 Victoria. 115 Stites. 6. 89 Welsch. 61 Turner. T. 116 Woodward 126 (ind_sp> Zaleski. 2. A. G. 177 Zhukov. 69 Volkogonov. 171 Timasheff. M. 2 Tarde. N. 63. 69 Stare. 47. 40. 57 Warde. B. 174 Wilson. H. B. 56 Trifonov. xiii. 59 Volkov. 44–5 Wilson. S.NAME INDEX Sombart. Queen of England 42. 170 Weber. W. 3. 96. 102. 14. 167. agreeable art 147. 10. economic 71. objects of 34. 45. 152–4. 168. 12. 149. pecuniary 35. of beauty 147. 147. 93. 95. 158. of everyday life 12. old 39. of popular culture 147. 126 civilization 172. 158. sense of x. 35. see also petite bourgeoisie. 40. 24 capital. 142–8. conditions of 132. declining petite 22. 148. pure x. critic of 6. 164–5. 135. 160 aesthetics ix–x. 156. feeling of 11. 39. rules of 144. of wine 131. 73 art social 44. applied 96. 168. social 68 carnival 58 categorical imperative 150 cigarette 50. 152. new 22. 164.SUBJECT INDEX aesthetic form 140 aesthetic sociology see sociology. 73 arts and crafts 43. 11. 45. 163. 166. 117. 129 architecture 34. 159. 166. 24. avant-garde of 22. 85. 147. 151–4. 150 aesthetization 17. of taste 2. 87. 160 art education 45 art industriel 43. 10. 24. 23. 160. 19. 45 bourgeoisie 18. 139–42. 141 aestheticization 15. 159. 84. 124 beauty. 159. 41. petite 22. reform of 43. 151–3. 45. 178. 44. aesthetic Aestheticism 140. empirical interest in 148. 85. 194 . style of 95. 99. Kantian x. 162. 67. 36. 98. empiricist 85. classical criteria of 92. 44. classicism in 144. 161. classical 22. 167 anomie 91 anomy 45. classical 61. of the ‘lower’ arts 12. cultural 21. theories of 140. work of 14. 108. 95. 44. 156. 46. higher 19. 98. sociological ix. 9. 142. 56. 39. 121. 152. 144. objects of 43. 159. fine 12. 10. 60. 149. 16. its relation to play 142–9. 73. 23. 160 asceticism 2. 46. 33. 39. 163. 90. 44. new petite 22. 39. 148. 25. 17. 96. contemporary 34. English 19. philosophical ix. 21. 98. 174. 95. 140. 56. commercial 26. 41. rural 19 art xii. 132. 107. 159. 45 aristocracy 174. 108. 165. genuine 35. 164. 157. 167. 49. 71. old 26. new ethic of 2. modern x. 125. 43. 68. 28. 116. 89. 31. 103. model of. 17 decoration xi. modern society of 67. 19. 195 . reflexive xii competition 3. 41. 33. 78. 39. national 111. 82. 14. 77. 137. new ethos of 74. 29. 23. 39. irrational elements of 6. 37. 2. 114. sociological 3 disposition. 106. of souls 88. 20. 174. of food 8. economic xii. status 17. 100. in the Soviet Union 51. 43–5. 117. 10. 39. of need 1. 3. peasant 18 culinary culture 27. production 4 community xii. hedonistic ethos f 22. 122. 4–6. 117. Mediterrainean-Arabic 9. 68. 89. 19. 45. 30. 84. 73. 65. 111. 113.SUBJECT INDEX process of 120. 27. dynamics of x. 27. Soviet 49 consumer society x. 79. 117. 123. industrial x. 3. objects of 97. 27. 101. 25. 93–5. 28. 99. 30. culture 67. 172. 46. 174. post-traditional xii. pleasures of 4. 33. 175. 31. 79. 2. pattern of x. 105. process of 101. 65 diet 8. 83. in the Soviet Union 49. balanced 117. 44. 70. 26. 119. 99. of the body 7 discourse. superfluous or unnecessary 4. 6. 64. 124. 44. 51. 26 court society 18. modern European 173. social x cuisine 19. 32 connoisseur 10. 161. 169. cultural ix. 127. 65. 115. 88. 117. 34. 18. gastronomic 3. 22. nouvelle 26. 173. 117. 128 cultural production 26 custom 13. 118. conspicuous 6. of taste 13. French 9. cloud of xi. aesthetic ix. 3. 158. 175. 172 consumer culture 4. 176. 28. 111. 20. critique of 43. 71–3. 80. 102. 19. 1751. 15. 110 commodity. socialist 65. detrimental habits of 172. 70. 74. of fashion 13. 38. 108. aesthetic xii. 9. 20. 32. culture of x. 14. modern 78 consumerism. 88. 66. 173. 5. 37. 82. traditional pattern of x cookbook 1. on food 1. 1. 4. 72. 103. 160. 2. 99. of Finnish women 113 dietary recommendation 1. model of Western 51. 62–4. 8. 20. theory of 18. 29. 71–3. 48. 70. mass 27. 21. necessary 37. 34. 16. 165. 7. 23. 67. sociology of 4. Soviet 63. 137 collective selection. 90. 44. 26. art of 19. infants’ 116. haute 18. modern 101. 99. 27. 111–9. 129. xi. 22. 25. 75 critique. 134 cookery book 25. 29. 123 dietetic movement 124 dietetic regimen 6. individual patterns of 69. theoretical model of x. 70. 116. 125–7. 32. 41. 33. 21. 20 discipline. social 4. 27. 112. spirit of modern 79 consumption 1. 100. 32. 67. of protein 122. 112. 31. 69. 100. 41. of feeling 88. political xii. bourgeois 18. 89. 30. aesthetic 20 distinction 4. 6. 123. 63. 40. 76 design 43. 48. 71. 112. 27–9. 65. 19. fashion show 94. physiological 7 education. 65 emulation 19. 158. 78. 122. mechanism of x. 106. 161. 156. 109 economy. distrust of 121. 22. 84. 92. pure 144. 94. refinement of 18. 1. social x. 6. 91. 31. 168. 120. 36. 122 hedonism 2. 19. 67 fashion 13. signs of 33. extension of xi. criterion of 12. 162. selfillusory 79 hedonistic ethic 80 196 . 111. 28. aesthetic 17. 134. 44. 82. health food 3. scale of 27. 171. of the modern consumer 4. in France and Britain 18. 167. 28. 125. 3. 176 finality. 105. fashion pattern xi. 139. 75–7. 176 fashion industry xii. 17. see also health food. 36. 109. 79. 93. 20. spirit of modern hedonism 79 hedonist. 93. 80. 78. in the Soviet Union 63. 163. 86. 64. professional 109. 16. ideal of 91. 67. 12. 105. 142. role of xii. 140. elite 48. 112. 124 good taste x. gastronomic 3. 122. 48. 122. 49. 119. hedonistic consumer 2. 8. 107. 178. 17. 171. 52. mechanism of xi. 136. mass 27. 159.SUBJECT INDEX game of 24. whims of 13 fashion designer xii. 154. class x. 155. 21. 47. 40. 111. 9. standard of 10. anti-fashion 81. 18. 107. retro-fashion 81. 115. ethic of 22. movement 119. 111. 139. 105. 91. 156. 170. 83. 129 gourmet 19. 28 Erlebnisgesellschaft 162. 165. 47. aesthetic xii. 25. 48. 33. renewal of 27 food market 27. 79. 99. 66. 155 gastronomy ix. 27. 163 etiquette 17. 111. 81. 5. social 8. 79. 4. 156. 149 Five Year Plan 54 food. 60. books on 3. form of 93. 118. 164. 26. 9 food culture. 21. 103. industry 54. 126. 9. 48. 103. 66. 30. of taste 172 egalitarianism. principles of 59. 109. taste of 3. 8–13. 166. modern 79. 30. 25. of wine tasting 131 health food see also food. social pattern of 91. 8. sense of 9. 152. 107. 74. 88. 91. 172 gluttony 7. 62. 82. 28. 86. 75 dress designer 102. 127 forms of sociation 17. 25. 10. 119. 128. ascetic 118. 34. 40. new 78. 170. 4. community of 13. 85. 158. 93. 24. 171. 114. requirements of 10. 120. 168. critiques of 24. 127. 108. 91. 66. 41. 101. 122. adulteration of 121. 120 good life 12. 79. 90. modern 1. 82. 105. 28. 92. 112. 29. street fashion 81. 66. 91. 112. doctrine of 55. 172 guide book. 47. as an empty formula 158. logic of 127 food scares 111. 93. 79. 74. 9. kitsch fashion 48. 76. social institution of 29. priciple of 4. social mechanism of 21. 128. aesthetization of xii. 164. 43–5. 2. theoretical model of x. 83. 10 everyday art 46 everyday life xi. 110. avoidance of 81. 28. 43. 83. aesthetic 161. critics of 72. 36. 42. insatiable 6. 159. 79. 135. 46. 6. life style of 19. 42. 70. 68. 45. 83. corrupting influence of 31. 9. 124. 44. 29. 49. 12 music 136. 172. 136. 68. 66. 138. in the Soviet Union 49. 13. 171. 19. 31. lower 25. 62. 83. 94. 7. 158. 42. 29. 159. 94 moral sense theory 10. 16 humoral medicine 7. 73. new style of 64. 49–52. 22–4. theories of 73 money 7. 93. 46. 81. 45. 71. 106 material culture 42. 13. 95–100. democratic xi mass media 99. critique of 149. 78. 116. 129. 77. 36. 111. 21 longevity 113. 93. 31. 35. 61. 42. 31. 11. aesthetization of 162. 174. 3. of music boxes 147. 142. adequate to socialism 66. 52. superfluous 8. 70. 174. socialist 69 industrial art 46 judgment 3. 44. 9. social 20. 39. 63. 30. 73. 69 middle class 15. 67. 154. 89. 27. of nobility x. 59. table music 147. 197 . natural 4. 6. 44. dictatorship over the 68. old 18 noveau riche 21. deformation of 34. 92. xi. 63. 11. 74. 144. of beauty 49. 175 modernization 72. 133. Jubilee 42 kulturnost 60. 70. 45. 64. 74. 6. 37. physiological 137. in the Soviet Union x. 63. 160. 69. aesthetic 86. 84. 51. 67. new 2. 149. 178 individuality 15. hierarchically ordered 22. 96. 31. 92. 26. 92. 118. 62. 51. 62. 38. 87. 115. of differentation 95. 173 kitsch x. 148. 155. 83. 31. 117. 22–5. 27 novelty 27. 63. 121. 70. 150. particular 15. 67. unsatisfied 31 nobility x. 86. 21. 77. bodily 9. lack of 81. 160. universal 90 judgment power ix. old 23 modern consumer 2. 68. social 64. 77. economy of food 7. 174–6. in the Soviet Union 65. 80. 33. 99. 37 leisure time 35. of demands 68. 149 music industry 176 need ix. 63. as a media 159. 156. 46. 6. 170. 76. 45. 70. 151. 91. court 27. 53. 149. 66 leisure class 34. 53 luxus. necessary 2. economy 75. 70. 112. 82. 71. 16. 47. detrimental effects of 6. 100. of taste 9. levelling impact of 75. 30. 79. false or genuine 8. 49. 48. 174. 10. 177. 20 imitation 16. 66. 70. 171. 155.SUBJECT INDEX hegemony 9. 168. 43. 135. 52. 162–4. 26. 123 luxury 2–4. 11. in the Soviet Union 59–61. 23. 50. 38. 48. 147. 13. 57. 37. 167. 65. 88. 69. democratic 27. physical 44. 66. manifestations of 36 libertarianism 55 lifestyle 6. 81. 50. 7. 160. 146. 161. 9. 140. 43. 66. 178. 35. 67. 49. in the Soviet Union 56–7. Soviet 64. 51. members of 7. 6. basic 44. 53. 92. 21. 136. 88. 46. 166. 1–3. 14. 87. 41. 62. 8. 87. 32. artificial 5. 79. 21. 173 possessive individualism 69 prestige 23. 135. 47. new 22. 36. 46. 131. bodily 146. 17. 86. 99. 116 nutrition science ix. 16. 87. concept of 1. 44. aesthetic 169. 161. genuine 5. pure form of 142 social order 14. of the meal 135. 124 self-discipline 7. 171 popular culture 12. 155. 145. 92. aesthetic dimension of 158. 5. 175 sexuality 124. 158. 2. modern 170. 24. 142. 1. 154. 145. 150–2. 159. aesthetics of 21. of eating 137 Social Contract 15. 155. 29. self-162 ruling class 21. pure 140. 29. 136. social 19 principle of reciprocity 150. 156–8. 149. opposition to the 24. 20. subjective 11. 41 petite bourgeoisie 22. 154. cultural factors of 4. corrupting influence of 7. 142–4. 154. 11. with tunes 148 pleasure xii. 70 social process 104. 149. sensual ix. feelings of 86. 94. 178. 71 public opinion 13. 32. 35. 174 social stratification 93 socialist realism 55. fear of 23. 170. 136. 139. 170. 31. 7. 33. demand for 27. 149 social form xi. of eating 138. 154. 152. 103. 76. 177.SUBJECT INDEX 95. 144. 138. individual feeling of 150. desire of 2. 148. aesthetic form of 17. 90. 92. 23 play. 164. 3. of children 117 patent medicine 122. 60. sociological 198 . 16. new 22. 165. 152 social identity 5. 167. 155. 168. life style of 21. 123. 1. aesthetic ix. 147. 28 self-control 121. of chance 146. 136. 150–2. 112 nutritional recommendation see dietary recommendation obesity 7. xii. 131. 4. folk models of 115. 137. 131–4. 16 rationalization. 158. 156–8. 21. play form 17. 1. play form of xii. taste of x. 106. 176 pathology 4 pecuniary power 35. 140. 155. 78. of interaction 137. 130. 31. 8. 163–4. 138–40. 6. 143. 170 private property 6. 156. 152. 166– 7. 128. 127. 32–3. 88. 60. 132. 38. 81. 59 sociation xii. 136. 19. 130 social status 6. 87. 135–40. 4. 17. xiv. 170. empty 178. 166. 147. 166. form of association 142. 170. bourgeois 16 social problem 4. forms of 136. two forms of 5 selfishness 5 sensus communis 13. ambivalence of 130 sociability 77. self-dynamic 74. 123. 139. modern 2. process of 18 reflexivity. aesthetic 168. 70. 156–7. elementary laws of 155. 141. 127. play-like dimension of 164. 15. instinct 154. of wit 146. 49. 86. 119 self-love. 29. 69 social interaction xii. 16. 105 nutrition. 145. of playing 146. 111. 142–5. 140 sociological aesthetics see aesthetics. individual xi. 95. 94–8. 18. aesthetics of 2.refinement of 9. 48. 150. 52. 97. 28. 132 working class 20. 103. communities of 17. 84. 27. 156. 70. 140. aesthetic ix. 83. 38. judgments of 171. hierarchy of 18. 144. 176. 97. 89. 100. 96. constraints of 6. 175. aesthetic 45. 33. 12. x. 130. 11. concept of 96. 132. cultivation of 26. 84. 99. 128. 161. sense of ix. 1. 127. 59. 43. 79. 98. 151–2 Soviet Union. 87. 122–4. 65. 17. of art 95. 3. xii. 100. 40–5. standards of 84. 159. 54. 69 status seekers 5. of the ruling class x. 52. 20. 25. formal 14. 24. 94. vulgar 41 trade guild 45 tradition 23. 26. 96. design in the 63.SUBJECT INDEX sociology xii. 19. 88. luxury in the xi. 163. 28. 106. 25. aesthetics of 131. 13. 78. 91. 162. of elite 42. 174. antinomy of xi. 171. legitimate x. 83. 46. 92. 91. 23. 91. 136. 10. 109. 21. 60–2. 32. 175. the beauty of 131. 158. 63. 12. 171. 156. 158–60. 163. 85. 80–2. 10. 28. 48. collective 29. 26. lack of 129 trickle-down effect 174 vitamin 3. 26. 19. 171. 15. 65. 70 standard of living 52. 101. 36. 109. physiological sense of ix. 55. 13. school of sociology 32 style 13. 21. self81 sumptuary laws 33. 26. 150. 23. corruption of 31. need for 123 wine. x. 160. 173. 161 199 . classification of 21. 32 status symbol 30. 44. 173. 60 Zeitgeist 101. 103. appropriation of 33. 49. 99. 159. function of 96. 145. 11. 25. as ideal product 123. 41. lack of 98. 34. aesthetic 13. 21. 24. 28. 20. consumption patterns of x. 46. 27. 106. 171. 139–40. 139. validity of a 11. 93. 117. class taste 10. 169. 11. social determination of ix. bad 19. 9. 160. effects of 159. communicability of 149. refinement of 18 taste ix. 86. lack of 65. 11. 52. 175. 44. 170. 91 table manners 10. xi. sense of 43 stylization 81. 3. 9.
https://www.scribd.com/document/155401107/Gronow-Jukka-The-Sociology-of-Taste
CC-MAIN-2017-34
refinedweb
84,234
58.58
A simple module to make functions asynchronous Asynchronizer is simple module that can be used to run multiple functions asynchronously. To convert a function, you just need to add a decorator @asynchronize to the function. This project is still in development, so report any bugs here. For examples, see the examples folder Contents Asynchronizer can be installed using pip: pip install asynchronizer Suppose you have a function like this: import requests def send_requests(): r = requests.get('') print r.status_code for _ in range(20): send_requests() You can modify it like this to make it asynchronous: import requests from asynchronizer import asynchronize, Wait @asynchronize def send_requests(): r = requests.get('') print r.status_code for _ in range(20): send_requests() Wait() This example script will take 55 seconds to run normally, but only 10 seconds when run asynchronously import time from asynchronizer import asynchronize, Wait, setWorkers @asynchronize def func(i): time.sleep(i) print i for i in range(1,11): func(i) Wait() The function Wait() is necessary. If Wait() is not present, your script will end without waiting for any unfinished functions to finish. The function Wait() is also a blocking function, meaning that the execution of your script will pause here till all the async functions called before this are finished. This is why it should usually be added at the end of your script The decorated functions are async to each other, but the code inside the functions is synchronous, which means this is wrong: # wrong way @asynchronize def send_requests(): for _ in range(20): r = requests.get('') send_requests() and this is the correct way: # correct way @asynchronize def send_requests(): r = requests.get('') for _ in range(20): send_requests() Instead of returning values from your functions, send them to a callback. For example: @asynchronize def send_requests(): r = requests.get('') parse(r.text) # instead of return r.text setWorkers(n)at the start of your script, with nbeing the number of concurrent greenlet threads you want. Default is 32. priority=nto the parameters of the function call, with nbeing the priority you want to set. For Example: func(param1,param2,param3,priority=2) If you want to contribute to this project, feel free to send a Pull Request to Github To report any bugs or request new features, head over to the Issues page Licensed under The MIT License (MIT). Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/asynchronizer/
CC-MAIN-2017-30
refinedweb
409
62.38
Tonight I spent some time reviewing the latest batch of sample code for Volume 2 of the SLAR. As you may recall, Volume 2 covers System.Xml, System.Net, System.Reflection namespaces (among others). I really want every type and nearly every member in the book to have a real, compliable and run-able code sample that shows common usage. This poses a little bit of a problem for the System.Net samples. Many of them need to refer to a working webserver and some of them require special behavior from that server. I could just point these all at, but I fear that would mean many of them would not run correctly on most customer’s machines unless they do some configuration. Thoughts on how to handle this? BTW – if you are interested in being a reviewer for Vol2, please let me know… Here are a couple of examples: public class EndPointSample { public static void { IPAddress ip = IPAddress.Parse("127.0.0.1"); IPEndPoint ep = new IPEndPoint(ip, 9999); Console.WriteLine("EndPoint.AddressFamily = '{0}'", ep.AddressFamily.ToString()); SocketAddress sktaddr = new SocketAddress(AddressFamily.InterNetwork); EndPoint newep = (EndPoint)ep.Create(sktaddr); Console.WriteLine("New EndPoint.AddressFamily = '{0}'", newep.AddressFamily.ToString()); } } public class DnsSample { private static bool bDone = false; public static void { String toFind = "microsoft.com"; IAsyncResult dummy = Dns.BeginResolve(toFind, new AsyncCallback(DnsCallback), null); while(!bDone) {} } private static void DnsCallback(IAsyncResult ar) { IPHostEntry host = Dns.EndResolve(ar); ShowHostDetails(host); bDone = true; } private static void ShowHostDetails(IPHostEntry host) { Console.WriteLine("HostName = '{0}'", host.HostName); foreach (IPAddress addr in host.AddressList) { Console.WriteLine("IPAddress = {0}", addr.ToString()); } foreach (String alias in host.Aliases) { Console.WriteLine("Alias = {0}", alias); } } } public class HttpStatusCodeSample { public static void { HttpWebRequest req = (HttpWebRequest) WebRequest.Create(""); HttpWebResponse result = (HttpWebResponse)req.GetResponse(); Console.WriteLine("HttpWebResponse.StatusCode = {0}", result.StatusCode.ToString()); } } For IP addresses, use one of the private IP blocks (10.x.x.x, 172.16.x.x, 192.168.x.x). The 192.168 block is probably the most used for private networks, so I’d stick with 172.16.x.x or pick something from 10.x.x.x that is unlikely to be used (10.150.x.x or something like that). For domain names, use one of the reserved example domain names at. This is a problem that has bitten many companies, including Microsoft. Samples have used things like (warning! pr0n link, obviously not work-safe) as example URLs, and later find out that it’s a porn site (or some entrepeneurial web developer found that the sample domain was unregistered, registered it, and put up some porn). Avoid this at all costs, and use the designated sample domains. Ship a really simple webserver sample and then in your examples connect to that server on localhost private static bool bDone = false; … while(!bDone) {} …. bDone = true; [Off topic] Your example is not good. The while loop does a busy wait and the "read" of bDone could actually be hoisted out of the loop so that it never terminates. Isn’t there a simple Event API you can use? While that is not the topic of your article, this is code people will copy. Instead of the busy wait, it could create a ManualResetEvent and use WaitOne to block. Matthias, I agree with you. Actualy dummy.AsyncWaitHandle.WaitOne(); (or WaitHandle.WaitAny/WaitAll in case if you need to use more that 1 request but less that 65) must be called instead of "while(!bDone) {}" I believe that publishing examples like this one must be allowed only to show/reveal common mistakes. Even if this is not a topic of article – "dummy.AsyncWaitHandle.WaitOne();" is pretty short and readable line. As well – using this line will allow to remove "private static bool bDone = false;" and "bDone = true;" lines. Additionaly – in HttpStatusCodeSample there are a lot of casts without any validation. For example think about this: class MyHack: IWebRequestCreate { public WebRequest Create(Uri uri) { return new FtpWebRequest(uri); } } WebRequest.RegisterPrefix("http://", new MyHack()); As result WebRequest.Create(""“>"); will not return HttpWebRequest Or less tricky situation – instead of ""“>" – user will pass "". There is useless cast in EndPointSample EndPoint newep = (EndPoint)ep.Create(sktaddr); ep.Create already return EndPoint. No needs to cast once more 😉 I believe this cast is an artifact from IPEndPoint -> EndPoint edit. My suggestion is have a separate appendix item that has instructions to configure the webserver that is referenced in the chapters. Then have a disclaimer in the introduction that explains that any code samples are written assuming that the reader has configured their webserver per the instructions in Appendix <insert letter>. I think that would be the easiest way to handle the issue…. I agree with the appendix, but one suggestion might be to have a configuration test program to make sure that not only a web server exists but also that the mail server is turned on, FTP and anything else you need. Just a simple winforms app that checks to make sure they all exist and have the right permissions. It shouldn’t be nearly as complex as it sounds. The trouble is, you probably need more than a web server for demonstrating other protocols etc.. And depending on what you are trying to do, going out to another server may run into firewalls. So the best thing would be: 1) write a program that tests the user’s machine and lets her know what will and won’t run, why, and what needs to be done to fix it; 2) maintain a public server for this book, or list suggestions of what server out there provides the needed functionality; 3) include a simple web server for testing (Webmatrix?). To make all this easier, add a simple program that pops up a dialog to configure all this. Then read the host name you need and whatnot from a configuration file created by this program. Asking people to install all kinds of services for this book is a no starter. One, it’s difficult; two, it opens up all kinds of potential holes; and three, it probably requires expensive software that’s only included with Windows Server. So if you do include a web server, or a simple pop server etc., make it a program the user can start for experimenting, but that exits immediately upon logout. Point to and provide a Windows Installer package on CD or Website that would setup the web server (or machine) as necessary. I’m interested in being a reviewer for Vol2. Re while(!bDone): Strictly speaking, all the comments about mutexes and the like are using elephant guns against fleas. bDone should be declared volatile. You can also check out some helpful info dedicated to butalbital personal loans debt consolidation texas hold em poker rules poker ambien adipex generic viagra student loans private mortgages diet pills … Thanks!!! PingBack from PingBack from PingBack from PingBack from PingBack from PingBack from
https://blogs.msdn.microsoft.com/brada/2004/12/05/dealing-with-urls-in-books/
CC-MAIN-2017-47
refinedweb
1,150
57.67
IRC log of xproc on 2008-02-07 Timestamps are in UTC. 16:01:28 [RRSAgent] RRSAgent has joined #xproc 16:01:28 [RRSAgent] logging to 16:01:36 [ht] zakim, please call ht-781 16:01:37 [Zakim] ok, ht; the call is being made 16:01:37 [Zakim] +Norm 16:01:39 [Zakim] +Ht 16:02:03 [Norm] Meeting: XML Processing Model WG 16:02:03 [Norm] Date: 7 February 2008 16:02:03 [Norm] Agenda: 16:02:03 [Norm] Meeting: 101 16:02:03 [Norm] Chair: Norm 16:02:04 [Norm] Scribe: Norm 16:02:06 [Norm] ScribeNick: Norm 16:02:18 [Zakim] +??P0 16:02:22 [ruilopes] Zakim, ? is me 16:02:22 [Zakim] +ruilopes; got it 16:02:42 [richard] richard has joined #xproc 16:02:58 [alexmilowski] alexmilowski has joined #xproc 16:03:13 [Zakim] + +44.131.467.aaaa 16:03:23 [AndrewF] AndrewF has joined #xproc 16:03:30 [Norm] Regrets: Alessandro, Mohamed 16:03:33 [richard] hmm, i suppose that's me, but it's not the right number 16:03:36 [richard] zakim, ? is mo 16:03:36 [Zakim] sorry, richard, I do not recognize a party named '?' 16:03:41 [richard] zakim, + is me 16:03:41 [Zakim] +richard; got it 16:03:45 [Zakim] +alexmilowski 16:03:58 [Norm] Zakim, who's on the phone? 16:03:58 [Zakim] On the phone I see PGrosso, Norm, Ht, ruilopes, richard, alexmilowski 16:04:09 [Norm] Present: Paul, Norm, Henry, Rui, Richard, Alex 16:04:16 [Zakim] +??P9 16:04:20 [AndrewF] zakim, ? is Andrew 16:04:21 [Zakim] +Andrew; got it 16:04:27 [Norm] Present: Paul, Norm, Henry, Rui, Richard, Alex, Andrew 16:05:35 [Norm] Topic: Accept this agenda? 16:05:35 [Norm] -> 16:05:40 [Norm] Accepted. 16:05:46 [Norm] Topic: Accept minutes from the previous meeting? 16:05:46 [Norm] -> 16:05:57 [Norm] Accepted. 16:06:06 [Norm] Topic: Next meeting: telcon 14 February 2008? 16:06:16 [Norm] No regrets given 16:06:29 [Norm] Topic: Last call comments 16:06:30 [Norm] -> 16:06:30 [Norm] Topic: Last call comments 16:06:30 [Norm] -> 16:06:45 [Norm] Topic: Excluding prefixes on p:inline 16:07:03 [Norm] Norm attempts to summarize. 16:07:44 [Norm] Norm: Do we want to make it possible to exclude prefixes? 16:09:40 [Norm] Henry: What's wrong with telling processors they should construct documents as if serializing the document, removing all inherited namespace bindings from the root, and reparsing? 16:09:55 [Norm] ...That is, remove everything that's inherited. 16:10:20 [Norm] ...In the 0.1 percent case, you'd have to bind a namespace several times because you were using it in several inlines. 16:10:35 [Norm] Norm: That seems way more confusing than just adding the attribute. 16:11:25 [Norm] Alex: Considering we have to produce a document from p:inline, you have to do a little bit of work. So having to do a little more work doesn't seem that bad. 16:11:59 [Norm] Henry: If you've got an infoset, you're going to have to walk through and fix all the nodes. 16:12:10 [Norm] Alex: I don't think so. 16:12:36 [Norm] Henry: In order to prevent serialization from doing the wrong thing further down the line, you're going to have to look at all the namespace information bindings. 16:13:13 [Norm] Some discussion of how complicated this really is. 16:14:25 [ht] 16:14:54 [Norm] Henry: What that says is you've got to walk the tree and prune the nodes. 16:14:59 [Norm] s/nodes/namespace nodes/ 16:16:19 [Norm] Richard: XSLT's mechanism is slightly more complicated than the excluded prefixes; the xsl: prefix is excluded and then there's an alias that lets you put it back in. 16:16:28 [Norm] Norm: Bah. 16:17:23 [Norm] Alex: I wonder if there's a simple thing that we have a problem with: the document element is going to inherit all the in-scope namespaces. The simple question is, do we break that relationship? 16:17:57 [Norm] Henry: The argument that says inline is very-very parallel to literal result elements in XSLT suggests we should make it very parallel. 16:18:08 [alexmilowski] +1 to that. 16:18:21 [Norm] ...We exclude the pipeline namespace, we provide exclude-result-prefixes, and we add the aliasing. 16:18:48 [Norm] ...If we think it's parallel to XSLT LREs, we should change things to make it parallel. 16:18:53 [ht] HST didn't say 'add the aliasing', but might be persuaded. . . 16:20:06 [Norm] Henry: Because we can stand in a better place, I'm going to try to do it the following way: 16:20:24 [Norm] ...what the ... nevermind 16:21:00 [Norm] ...what I was going to say was that we exclude them from this element where they're inherited. But that's too hard and complicated. 16:21:12 [Norm] ACTION: Henry to draft a spec change for providing exclude-result-prefixes on p:inline. 16:21:50 [Norm] Richard: We don't need a dual to the xsl:exclude-result-prefixes attribute, and you only put them on a p:inline element, not on some higher element. 16:22:03 [Norm] Henry: I guess you should be able to put it on the p:pipeline or p:declare-step? 16:22:13 [Norm] Richard: No. Remember that the 90% case is you don't do this at all. 16:23:20 [MoZ] MoZ has joined #xproc 16:23:32 [Norm] Henry: Proposition #1, there's a dont-exclude-pipeline-namespaces attribute which is false by default. Or there's an exclude-pipeline-namespaces attribute which is true by default. 16:23:40 [Norm] Richard: Is it used for anything else in XSLT? 16:23:49 [Norm] Henry asserts its not 16:24:11 [Norm] Richard reads something from the XSLT spec about security and namespace aliasing. 16:27:12 [Norm] Scribe distracted for a moment 16:27:32 [Norm] Richard proposes using another step if you really need to have the pipeline namespace. 16:28:52 [Norm] Topic: p:label-elements proposal from Alex 16:29:02 [Norm] -> 16:30:19 [Norm] Alex summarizes the proposal, including an addition to control replacement 16:31:58 [Norm] Henry: Remind me, did we reach closure on a variable versus a function? 16:32:08 [Norm] Alex: I think those of us who wanted this change wanted the variable. 16:32:50 [Norm] Alex: My rationale is that some APIs make it easier to set a variable than a function. 16:33:41 [Norm] Henry: As we've repeatedly commented, implementations don't have to use XPath at all in the defaulted case. 16:34:02 [Norm] ...It's easy to optimize this if you want to. 16:34:23 [Norm] Alex: One tweak is to say that the label attribute is optional 16:37:13 [Norm] Some discussion of function vs. variable. 16:37:58 [Norm] Alex: Inside a step, it seems like you need an API that you might not otherwise need inside the step. Things like viewport can be very different. The API for steps might be simpler, cleaner. 16:38:44 [Norm] Alex: Writing things in steps seems different than writing things in the core language. 16:39:25 [Norm] Shall we adopt Alex's proposal? 16:39:36 [Norm] Accepted. 16:40:03 [Norm] Alex: With a replace option? 16:40:08 [Norm] Norm: I think so, any objections? 16:40:10 [Norm] None heard. 16:40:30 [Norm] Topic: #108. Serialization parameters as parameter input ports 16:41:29 [Norm] Norm: I think this is a desire to compute serializatin parameters and pass them in dynamically. Maybe useful, but not a V1 feature in my mind. 16:43:02 [Norm] Henry: Besides, there's a workaround. 16:43:19 [Norm] ...You can write the document and the compute the options from that document. 16:43:46 [Norm] Proposal: No change to support this use case in V1. 16:43:54 [Norm] Accepted. 16:44:20 [Norm] ACTION: Alex to reply to the submitter. 16:44:38 [Norm] Topic: 110. Add dates to schema docs 16:45:04 [Norm] Norm: I don't know why I put this on the agenda, it's editorial. Let's just do it. 16:45:12 [Norm] Accepted. 16:45:32 [Norm] Topic: #109. Response headers is in p:http-request 16:46:05 [Norm] Alex: I think we should drop the ommission of content-* headers. 16:46:55 [Norm] ...I don't think I want to go into parsing the headers because the header parsing is dependent on the header, they don't all take parameters. 16:48:22 [Norm] Alex: I think its overkill even if it is generally true. And I don't think you'd gain anything. 16:48:43 [Norm] ..in the case of charset, the parameter has already been used to decode the content. 16:48:54 [Zakim] +Murray_Maloney 16:50:11 [Norm] ACTION: Alex to consider any clarifications that might need to be made to p:http-request. 16:50:42 [Norm] At the very least, go ahead and remove the restriction on content-* headers. 16:51:04 [Norm] Topic #111. Additions to implementation defined section 16:51:56 [Norm] Norm: I suggest that we whatever XPath 2.0 does wrt Unicode versions. 16:52:05 [Norm] ACTION: Norm to add the Unicode version text to the spec 16:52:18 [Norm] Topic: 112. Propose a warning mechanism. 16:52:50 [Norm] Norm: I don't think we need to say anything about warnings, but I'm prepared to be persuaded. 16:53:31 [Norm] Alex: Programs can generate warnings if they want. 16:53:57 [Norm] Proposed: We'll say nothing in the spec about this. 16:53:59 [Norm] Accepted. 16:54:22 [Norm] Topic: #113. Nitpicking p:insert and p:add-attribute 16:55:04 [Norm] Norm is inclined to agree with the commenter 16:56:45 [Norm] Richard: What does add-attribute do if the attribute is already present 16:56:49 [Norm] Norm: We don't say. That we need to fix. 16:57:07 [Norm] Norm: Let's take these one at a time. 16:57:54 [Norm] Norm: Are we going to rename add-attribute to insert-attribute? 16:58:00 [Norm] Alex: I'm not sure insert is the right word 16:58:13 [Norm] Norm: I don't hear any support. 16:59:14 [Norm] Norm: So I'm inclined to leave insert the way it is; we might relax the restrictions in the future. 16:59:40 [Norm] Richard: And if the document has a PI, then that gets inserted, so we can't rename it insert-element. 16:59:48 [Norm] Alex: And we can have before and after, so it isn't a child. 17:00:07 [Norm] Proposal: do nothing. 17:00:31 [Norm] ACTION: Alex to fix add-attribute wrt existing attributes 17:00:41 [Norm] ACTION: Alex to fix insert so that it doesn't always imply child. 17:01:08 [Norm] Accepted. 17:01:15 [Norm] Topic: Any other business? 17:01:22 [Norm] None. 17:01:28 [Zakim] -Ht 17:01:30 [Norm] Adjourned. 17:01:32 [Zakim] -alexmilowski 17:01:33 [Zakim] -Murray_Maloney 17:01:33 [Zakim] -Andrew 17:01:34 [Zakim] -PGrosso 17:01:35 [Zakim] -Norm 17:01:36 [Zakim] -richard 17:01:37 [Zakim] -ruilopes 17:01:38 [Zakim] XML_PMWG()11:00AM has ended 17:01:40 [Zakim] Attendees were PGrosso, Norm, Ht, ruilopes, +44.131.467.aaaa, richard, alexmilowski, Andrew, Murray_Maloney 17:01:43 [Norm] RRSAgent, set logs world-visible 17:01:47 [Norm] RRSAgent, draft minutes 17:01:47 [RRSAgent] I have made the request to generate Norm 17:03:01 [PGrosso] PGrosso has left #xproc 18:23:37 [Zakim] Zakim has left #xproc
http://www.w3.org/2008/02/07-xproc-irc
CC-MAIN-2014-52
refinedweb
2,031
73.78
XML - While some XML tutorials cover XML Namespaces, focus on learning the practical use of namespaces from David Marston in Plan to use XML namespaces, Part 1 (developerWorks, April 2004) and Plan to use XML namespaces, Part 2 (developerWorks, April 2004). - Understand and learn to avoid the real-life pitfalls of namespaces in Principles of XML design: Use XML namespaces with care by Uche Ogbuji (developerWorks, April 2004). - Uche Ogbuji provides an introduction to RDDL in Use RDDL with your XML and Web services namespaces (developerWorks, May 2004). - Ronald Bourret maintains the XML Namespaces FAQ. - James Clark offers a close examination of namespaces and introduces a popular notation for describing namespaces in his essay, XML Namespaces. - Read a stern note of caution from Parand Darugar in Abolish XML namespaces? (developerWorks, July 2005). -
http://www.ibm.com/developerworks/xml/standards/x-namespacesspec.html
CC-MAIN-2014-35
refinedweb
132
52.49
Code Focused The open source library RestSharp is designed to make consuming APIs from .NET easy and work across platforms. Interfacing with a public API from a .NET application is something that many developers find themselves needing to do. They can take several different approaches, but my favorite is an open source library called RestSharp (restsharp.org). RestSharp makes it easy by abstracting away some of the complication of dealing with raw HTTP requests and providing a developer-friendly way of getting at what's important: the data. At its core, communicating with an API simply involves creating and sending an HTTP request to the API, and then doing something with the response. Most modern APIs will return JSON, though you may run into APIs that return only XML. Many also allow the caller to specify which format they'd like to receive data in by specifying the preferred format in the Accept header of the HTTP request. Crafting an HTTP request can be done in several ways, with the most common way being the use of System.Net.Http.HttpClient or the simpler System.Net.WebClient. System.Net.HttpWebRequest is also worth mentioning, though it is flagged as obsolete and not recommended unless you're doing something specific that requires lower-level access. HttpClient is the newest one, requiring the Microsoft .NET Framework 4.5 and exposing only asynchronous methods for sending requests. It's the most similar to RestSharp in that it's easy to use (not overly abstract and not overly complicated either), but because it requires the .NET Framework 4.5, not every application can take advantage of it. WebClient is very simple and a great choice for just making GET requests, but once you need to start using verbs like PUT or DELETE the code starts to get quite a bit messier. RestSharp The reason I prefer to use RestSharp is it's a library that is both easy to use and available across many platforms. It needs only .NET Framework 3.5 (though there is a .NET Framework 2.0 fork of RestSharp on GitHub), and supports Windows Phone and Xamarin. It also has some features allowing automatic deserialization of responses, making it a pleasure to work with. To demonstrate RestSharp, I've created a sample solution, which you can find in the code download for this article, that contains two projects. The first is a Web API project to which I've added a ProductsController. The controller supports all the expected REST calls, persisting changes to an in-memory list of products abstracted behind the interface, like so: public interface IProductRepository { IEnumerable<Product> GetAll(); Product Get(int id); void Create(Product product); void Update(int id, Product product); void Delete(int id); } The second is a console application that calls the API using RestSharp. GET requests Once you've downloaded and referenced RestSharp (from NuGet or otherwise), to begin using it you'll need an instance of a RestClient. It has a default constructor, but a good practice is to pass in your base URL as either a string or Uri object. Because my Web API is listening on port 9075, I will instantiate a RestClient like this: private RestClient client = new RestClient(""); The next step is to instantiate a RestRequest. This can also be created in a number of ways, but the recommended way is to pass in the resource and method. For a Get request I create my RestRequest like this: RestRequest request = new RestRequest("Products", Method.GET); The final step is to use the client to execute the request, which I do like this: IRestResponse<List<Product>> response = client.Execute<List<Product>>(request); Notice that I'm using a generic overload of Execute, which examines the format of the response and tries to convert it to the given type. There are a lot of other methods that execute the request, too. Some specify the HTTP method, while others allow for asynchronous requests. The response has quite a few properties that can be used to get information about the response, but to get the data you'll want to access the Data property. Doing this, my GetProducts method ends up looking like this: public List<Product> GetProducts() { RestRequest request = new RestRequest("Products", Method.GET); IRestResponse<List<Product>> response = client.Execute<List<Product>>(request); return response.Data; } And the corresponding Get method on my ProductsController looks like this: // GET api/products public IEnumerable<Product> Get() { return _repository.GetAll(); } Other Verbs Some requests, like POST requests, for example, will require a body to be sent as part of the request. To create a product through the API, I use the following method: public void Create(Product product) { var request = new RestRequest("Products", Method.POST); request.AddJsonBody(product); client.Execute(request); } I first instantiate a RestRequest but before executing it I use the AddJsonBody method, passing in an instance of the product I want to create. This will cause the execution of the request to serialize my product to JSON before sending it to the API. The Execute method that I use on the client for this is the non-generic one, because I don't expect there to be a response that should be deserialized to anything specific. Updates and deletes work similarly, but because my API expects the Id of the object to be updated or deleted in the URL, I have to append it to the resource string with which I create the RestRequest. My Update and Delete methods are shown here: public void Update(int id, Product product) { var request = new RestRequest("Products/" + id, Method.PUT); request.AddJsonBody(product); client.Execute(request); } public void Delete(int id) { var request = new RestRequest("Products/" + id, Method.DELETE); client.Execute(request); } If you're interested in seeing what the API controller looks like, it's listed in its entirety in Listing 1. public class ProductsController : ApiController { private readonly IProductRepository _repository; public ProductsController() { _repository = new InMemoryProductRepository(); } // GET api/products public IEnumerable<Product> Get() { return _repository.GetAll(); } // GET api/products/5 public Product Get(int id) { return _repository.Get(id); } public void Post([FromBody]Product value) { _repository.Create(value); } // PUT api/products/5 public void Put(int id, [FromBody]Product value) { _repository.Update(id, value); } // DELETE api/products/5 public void Delete(int id) { _repository.Delete(id); } } Cookies and Other Headers Some APIs require cookies for authentication. To enable cookie support with RestSharp, after newing up the RestClient you'll need to set its CookieContainer property. This can be done like this: RestClient client = new RestClient(""); client.CookieContainer = new CookieContainer(); The CookieContainer can then be filled with pre-set cookies, but keep in mind that cookies will be added or removed as specified by the responses to any HTTP requests made. Additional headers can be added to a request by AddHeader method on the request. The method expects a name and value, which will be sent as part of the HTTP request when it's executed. If I wanted to add a header to my request, I could add one like this: request.AddHeader("User-Agent", "RestSharpDemo"); Wrapping Up Hopefully this article will serve as a useful guide to getting started with RestSharp. The included code downloads were created using Visual Studio 2013 and version the .NET Framework 4
https://visualstudiomagazine.com/articles/2015/10/01/consume-a-webapi.aspx
CC-MAIN-2021-21
refinedweb
1,214
54.73
No, I’m not going to fix the relationship with your significant other. One of the common questions I get asked is about relationships between tables. The basic advice is easy – don’t do it. The actual relationship advice is a little more complex than that and today I’m going to cover what is involved in setting up table relationships, what to do and what to avoid. The Node.js / Easy Tables Version This one is easy. The Node.js Server SDK for Azure Mobile Apps does not support relationships in any way, shape or form. If you want to use relationships, use an ASP.NET backend. The ASP.NET Version There are two relationships that are supported - A one-way 1:1 relationship - A one-way 1:Many relationship One way relationships are where a table has a foreign key for another table, but the reverse is not true. Do not do the normal “two-way” relationships as you will run into circular serialization problems. These are both configured with Entity Framework using foreign keys. You need to ensure at you set up your data transfer objects first. Let’s take an example. Let’s say I have my normal TodoItem table, but I want to add a tag to each record. The data transfer objects are configured thus: using Microsoft.Azure.Mobile.Server; using System.ComponentModel.DataAnnotations.Schema; namespace Mobile.Backend.DataObjects { public class Tag : EntityData { public string TagName { get; set; } } public class TodoItem : EntityData { public string Text { get; set; } public bool Complete { get; set; } #region Relationships public string TagId { get; set; } [ForeignKey("TagId")] public Tag Tag { get; set; } #endregion } } The ForeignKey annotation is the key to this – it sets up the linkage between the two tables. Note that the TagId references the Id of the Tag table which is, of course, a GUID in string form when you are in an Azure Mobile Apps DTO. I still need to add a table controller for the Tag entity, and add a DbSet to the MobileServiceContext – so now I have two controllers. The Client Side On the client side, I need to be able to add a Tag to the TodoItem. The Tag must exist before the TodoItem exists. Let’s take a look at one of the TodoItem records when I request it through Postman – here is the response: [ { "deleted": false, "updatedAt": "2016-05-25T03:01:53.33Z", "createdAt": "2016-05-25T03:01:53.33Z", "version": "AAAAAAAAB9Q=", "id": "183df2a2-abed-4f60-bde5-ebb157343462", "tagId": "e6782065-6ec4-4042-a0b7-3dcfc1c334a0", "complete": false, "text": "First item" }, { "deleted": false, "updatedAt": "2016-05-25T03:01:53.345Z", "createdAt": "2016-05-25T03:01:53.345Z", "version": "AAAAAAAAB9Y=", "id": "e1291e16-c8e1-440f-ae6e-4ec9835302c4", "tagId": null, "complete": false, "text": "Second item" } ] My first record has a linkage to a specific tag – this is shown via the tagId being filled in. My second record does not have a linkage to a specific tag. On the client, you will need to do the join of the tables yourself. The client does not know about relationships. Each table is independent. This means that your model (assuming a C#/.NET client, like UWP or Xamarin) should look like this: using ClientApp.Helpers; namespace ClientApp.Models { public class Tag : EntityData { public string TagName { get; set; } } public class TodoItem : EntityData { public string Text { get; set; } public bool Complete { get; set; } public string TagId { get; set; } } } In general, things will just work. However, that’s because you will naturally create a Tag before using it. You must ensure that you insert the tag before inserting the Todoitem that references it. Again, you do the join in code – don’t expect a Tag item to magically be populated in your TodoItem as a linked reference – it won’t happen. 1:Many Relationships You can also do one-way 1:Many relationships with the ASP.NET Server SDK. An example of a one-way 1:Many relationship is that my TodoItem may have multiple tags. As long as I am not doing the reverse (give me all todo items that use this tag, which would indicate a two-way relationship), you should be ok. In this case, the Tags would be an array. Let’s take a look at the new models on the server side: using Microsoft.Azure.Mobile.Server; using System.Collections.Generic; namespace Mobile.Backend.DataObjects { public class Tag : EntityData { public string TagName { get; set; } } public class TodoItem : EntityData { public string Text { get; set; } public bool Complete { get; set; } public virtual ICollection<Tag> Tags { get; set; } } } Sending the same query as before will result in" } ] Note that there is no tag. OData requires you to send the $expand parameter to expand the collection – something like. The Azure Mobile Apps Client SDK (currently) doesn’t support $expand, so I have to do something on the server to support this. The first thing is to provide a new annotation called the [ExpandProperty]: using System; using System.Linq; using System.Web.Http.Controllers; using System.Web.Http.Filters; namespace Mobile.Backend.Helpers { [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public class ExpandPropertyAttribute : ActionFilterAttribute { string propertyName; public ExpandPropertyAttribute(string propertyName) { this.propertyName = propertyName; } public override void OnActionExecuting(HttpActionContext actionContext) { base.OnActionExecuting(actionContext); var uriBuilder = new UriBuilder(actionContext.Request.RequestUri); var queryParams = uriBuilder.Query.TrimStart('?').Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries).ToList(); int expandIndex = -1; for (var i = 0; i < queryParams.Count; i++) { if (queryParams[i].StartsWith("$expand", StringComparison.Ordinal)) { expandIndex = i; break; } } if (expandIndex < 0) { queryParams.Add("$expand=" + this.propertyName); } else { queryParams[expandIndex] = queryParams[expandIndex] + "," + propertyName; } uriBuilder.Query = string.Join("&", queryParams); actionContext.Request.RequestUri = uriBuilder.Uri; } } } When applied to a table controller method, this will automatically add the $expand property. Use it like this on the TodoItem controller: // GET tables/TodoItem [ExpandProperty("Tags")] public IQueryable<TodoItem> GetAllTodoItems() => Query(); // GET tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959 [ExpandProperty("Tags")] public SingleResult<TodoItem> GetTodoItem(string id) => Lookup(id); You can specify this multiple times so that you can expand multiple properties. You generally only need to add this to the “Read” methods – GetAll and GetSingle. Now, when I do the same Postman query as before, I get", "tags": [ { "tagName": "Urgent", "id": "3257f559-1c09-40a8-a633-df60f0970ac7", "version": "AAAAAAAAB9Q=", "createdAt": "2016-05-25T21:17:05.059Z", "updatedAt": "2016-05-25T21:17:05.064Z", "deleted": false }, { "tagName": "Question", "id": "7c2f4467-973f-464e-88a8-584c7becd37c", "version": "AAAAAAAAB9Y=", "createdAt": "2016-05-25T21:17:05.091Z", "updatedAt": "2016-05-25T21:17:05.091Z", "deleted": false } ] }, { ", "tags": [] } ] Note that the tag result is embedded in the result. For client platforms that support models, you can now do something similar to the following: using ClientApp.Helpers; namespace ClientApp.Models { public class Tag : EntityData { public string TagName { get; set; } } public class TodoItem : EntityData { public string Text { get; set; } public bool Complete { get; set; } public List<Tag> Tags { get; set; } } } The tags will be included in the todoitem. The data is denormalized. Say you have a tag called “Urgent” and it is used six times – there will be six copies of the “Urgent” tag – not one with references. While this is not a problem for most applications, if your data is large you actually want to deal with this a different way. This may include using a TagId list instead and then linking the models when you do a refresh, for example. Wrap Up I hope you take away from this a few points: - Relationships is strictly an ASP.NET function. - Relationships are hard and you must work at them to ensure the proper outcome. - 1:1 and 1:Many relationships are doable if they are one-way (i.e. table1 refers to table2, but the reverse is not true) - You have to deal with expansion in the 1:Many case, and data is denormalized (which may not be desirable) - Avoid Many:Many relationships - You really need to understand how Entity Framework implements these relationships The final thing to remember is that the client does not know about relationships. That is a SQL concept and SQL is spoken only on the server. Finally – my advice is to try and avoid relationships on your mobile backend – use projections mechanisms (such as SQL Views and/or automatic expansion with the ExpandProperty attribute) to denormalize the data prior to it getting to the client. You can see the 1:Many code for the backend in the relationship-backend solution on my GitHub Repository.
https://shellmonger.com/tag/sql/
CC-MAIN-2017-13
refinedweb
1,392
56.55
optional Optional (“nullable”) value library for Go Requirements - Go 1.18 or newer Installation go get github.com/heucuva/optional How to use Import this library into your code: import "github.com/heucuva/optional" Then, you can easily add an optional value like so: var testValue optional.Value[string] func Example() { // testValue should be 'nil', as it's initially unset // the expected result here is that `value` is "" and `set` is false value, set := testValue.Get() // this will set the testValue variable to a new value // NOTE: setting an optional.Value to nil does not cause it to return `set` as false // the preferred behavior for clearing a Value is to call Reset, as shown below testValue.Set("Hello world!") // testValue should now be set // the expected result here is that `value is "Hello world!" and `set` is true value, set = testValue.Get() // this will unset the testValue variable // essentially setting the value to 'nil' // do not confuse this with setting a Value to actual `nil` testValue.Reset() // testValue should be once again be 'nil', as it's been unset by the Reset function // the expected result here is that `value` is "" and `set` is false value, set := testValue.Get() }
https://golangexample.com/optional-nullable-value-library-for-go/
CC-MAIN-2022-33
refinedweb
200
54.73
bind — bind a name to a socket #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> When a socket is created with socket(2), it exists in a name space (address family) but has no address assigned to it. bind() assigns the address specified: The only purpose of this structure is to cast the structure pointer passed in addr in order to avoid compiler warnings. See EXAMPLE below. On success, zero is returned. On error, −1 is returned, and errno is set appropriately. The address is protected, and the user is not the superuser. The given address is already in use. ). sockfd is not a valid file descriptor. The socket is already bound to an address. addrlen is wrong, or addr is not a valid address for this socket's domain. The file descriptor sockfd does not refer to a socket. The following errors are specific to UNIX domain ( AF_UNIX) sockets: Search permission is denied on a component of the path prefix. (See also path_resolution(7).) A nonexistent interface was requested or the requested address was not local. addr points outside the user's accessible address space. Too many symbolic links were encountered in resolving addr. addr is too long. A component in the directory prefix of the socket pathname does not exist. Insufficient kernel memory was available. A component of the path prefix is not a directory. The socket inode would reside on a read-only filesystem. == −1) handle_error("socket"); memset(&my_addr, 0, sizeof(struct sockaddr_un)); /* Clear structure */ my_addr.sun_family = AF_UNIX; strncpy(my_addr.sun_path, MY_SOCK_PATH, sizeof(my_addr.sun_path) − 1); if (bind(sfd, (struct sockaddr *) &my_addr, sizeof(struct sockaddr_un)) == −1) handle_error("bind"); if (listen(sfd, LISTEN_BACKLOG) == −1) handle_error("listen"); /* Now we can accept incoming connections one at a time using accept(2) */ peer_addr_size = sizeof(struct sockaddr_un); cfd = accept(sfd, (struct sockaddr *) &peer_addr, &peer_addr_size); if (cfd == −1) handle_error("accept"); /* Code to deal with incoming connection(s)... */ /* When no longer required, the socket pathname, MY_SOCK_PATH should be deleted using unlink(2) or remove(3) */ } accept(2), connect(2), getsockname(2), listen(2), socket(2), getaddrinfo(3), getifaddrs(3), ip(7), ipv6(7), path_resolution(7), socket(7), unix(7)
https://manpages.net/htmlman2/bind.2.html
CC-MAIN-2022-21
refinedweb
357
51.55
For the moment, here in Brest, we are working on assisted sail-boat steering for people dependent on electric wheel-chairs. Open-source electronics for wheel chairs is technically speaking very close and is one of my long-term ideas/projects, so I'm very interested. And the way you are doing it, seems not far from what we do here. Your CAN hardware, for example, is very similar to our Arduino compatible CANinterfacer. And just now, we are searching for an appropriate protocol to work just above the raw CAN protocol. We have difficulties to find an open-source protocol for this robotics-like application, and one that is simple enough to work with Arduino-IDE programmed 8-bit AVR processors. And as you, we are just about to abandon search for an existing protocol and to create our own, open-source one. - As it looks now, our protocol will have provisions for synchronization between nodes, a sort of global system clock, which will permit things like respecting real-time constraints of distributed control loops, time-stamping, and collecting distributed sensor data measured at the same moment. (For example : if you want to know if the wheel chair steer left or right while braking, you must be sure to make a speed measurement on each wheel at the same moment.) (Both mechanisms used together can be used to detect node failure, think "timestamped heartbeat" for each node.) Anyway, the CAN frame contains allready a CRC, transmission limited to single CAN frames,should be sufficiently protected. Thank you for having shared your work, We can probably do some stuff together. So this is where that on/off circuit was bound. Looks like a worthwhile and interesting project. int analogRead(uint8_t pin) { uint8_t low, high; if (pin >= 54) pin -= 54; // allow for channel or pin numbers for (byte I = 0 ; I < Damping ; I++) { sumRawThrottle = sumRawThrottle + analogRead(ThrottlePin); } uint8_t stringGetCharAt(string * s, uint32_t offset) { VERIFY_OBJECT(s, OBJID_STRING); if (offset >= s->max_len) { SYS_ERROR (ERR_STRING_BAD_OFFSET); } return (*(s->str + offset));} /* could be #define to reduce RAM use */// for joystick drivingbyte AttendantFwdSpeed = 100; // percent, reduce if headroom needed for turning or to get lower top speed Next I looked at the cost of joining the CANopen consortium - thousands of Euros/year. There's nothing "open" about CANopen except the name. One of the things mentioned there is something I wish I knew how to do: "reprogramming of the board through the CAN bus when using a previously installed special bootloader ". I would hate to see you drop this project as it does seem worthwhile, I have many things on at present but would like to help a bit if I can. You are right in that CAN has error detection at the low level but you need to implement a higher-level protocol with a lot of fault and general sanity testing of data.I think it's fair to say that the Arduino core code (and maybe most libraries) is not robust enough for a critical system, I've seen all sorts of examples of code that for example takes an input at face value and uses that to index into an array. Case in point ... I've only had a quick look at your code and you do similar, for exampleCode: [Select]for (byte I = 0 ; I < Damping ; I++) { sumRawThrottle = sumRawThrottle + analogRead(ThrottlePin); }The results of analogRead() are use without being tested first. Admittedly you are integrating the result but still, if the current average is 20 and you read a value of 500 it's fair to say something has gone amiss, maybe a wire broke on the sensor. In which case more drastic action is required because if you get 50 of them in a row you are going full speed before you know it. for (byte I = 0 ; I < Damping ; I++) { sumRawThrottle = sumRawThrottle + analogRead(ThrottlePin); } if ((*RawThrottle < 500) || (*RawThrottle > 4500)) { *RawThrottle = 2500; // centered joystick *RawSteering = 2500; // centered joystick if (lastThrottle != 0){ Serial.println (F("Throttle disconnect - send Safety Stop message")); // send safety stop message to Roboteq and "throttle axis joystick error" message to display } } if ((*RawSteering < 500) || (*RawSteering > 4500)) { *RawSteering = 2500; // centered joystick *RawThrottle = 2500; // centered joystick if (lastSteering != 0){ Serial.println (F("Steering disconnect - send Safety Stop message")); // send safety stop message to Roboteq and "steering axis joystick error" message to display } } I may have gone overboard for a simple "return the Nth char from a string" function but probably not, what if the char returned was then used for a critical purpose? Code: [Select]/* could be #define to reduce RAM use */ // for joystick driving byte AttendantFwdSpeed = 100; // percent, reduce if headroom needed for turning or to get lower top speedYes you should use define or const for that lot. /* could be #define to reduce RAM use */ // for joystick driving byte AttendantFwdSpeed = 100; // percent, reduce if headroom needed for turning or to get lower top speed Some other things that are largely stylistic...UPPER_CASE is generally reserved for macros and constants. Using that for function names is slightly confusing. The files are huge, it's time to break the code up into manageable sections in separate files. I have some experience with similar projects (albeit many years ago), for example I designed much of the building monitoring system for the ASIO headquarters (Australia's answer to the CIA) CAN is multi-master but I think you are proposing having a master that processes all info and then tells nodes what to do. While there will always be a nominal master to generally control stuff I think it's more robust to distribute some of the processing to nodes. Thus some functions can continue of the master craps itself or the cable is cut. This is harder to implement of course and may not be appropriate, it depends on the system and you have 4 nodes which may be an appropriate level of distribution for this application. Another thing is a dead man's handle, for example a motor-control node should only drive the motor while it's getting commands to do so, if no command arrives for say 100mS it shuts the motor down or takes other appropriate action. If the Roboteq doesn't implement something similar you should add that function before it. My apologises if you have already covered these issues above, there's a lot to read and I may have missed stuff. As for the hardware if this is a one-off I would be inclined to look at Bernt's board as it seems well designed. If you plan to take this further I think designing your own WC-specific boards might be a better way to go. The attendant joystick on Rachele's chair is in a 6 cm (w) X 11 cm (l) X 5.5 cm (h) die-cast case. It's a good size; much better than the ever-larger joystick pods that are being marketed and that really get in the way. The joystick pot takes up almost 1/2 the available space in this box, yet it would hold my my stacked nano-sized boards and the ON/OFF and MODE buttons, the USR/ATTENDANT toggle and whatever connectors I end up with (even easier with a Hall-sensor joystick as they are shorter than the inductive unit in the DX-ACU). I think Bernt's board might not fit. Please enter a valid email to subscribe We need to confirm your email address. To complete the subscription, please click the link in the Thank you for subscribing! Arduino via Egeo 16 Torino, 10131 Italy
http://forum.arduino.cc/index.php?topic=171236.0
CC-MAIN-2015-11
refinedweb
1,267
54.97
What Are C# Generics? Generics are one of the new features that Microsoft has proposed be added to the C# language. While not a part of the current C# specifications as defined by ECMA or ISO, they could be in the future. Generics are used to help make the code in your software components much more reusable. They are a type of data structure that contains code that remains the same; however, the data type of the parameters can change with each use. Additionally, the usage within the data structure adapts to the different data type of the passed variables. In summary, a generic is a code template that can be applied to use the same code repeatedly. Each time the generic is used, it can be customized for different data types without needing to rewrite any of the internal code. A generic is defined using a slightly different notation. The following is the basic code for a generic named Compare that can compare two items of the same type and return the larger or smaller value, depending on which method is called: public class Compare<ItemType, ItemType> { public ItemType Larger(ItemType data, ItemType data2) { // logic... } public ItemType Smaller(ItemType data, ItemType data2) { // logic... } } This generic could be used with any data type, ranging from basic data types such as integers to complex classes and structures. When you use the generic, you identify what data type you are using with it. For example, to use an integer with the previous Compare generic, you would enter code similar to the following: Compare<int, int> compare = new Compare<int, int>; int MyInt = compare.Larger(3, 5); You could use the type with other types as well. One thing to be aware of is that a declared generic, such Compare in the previous example, is strongly typed. This means that, if you pass a different data type than an integer to compare.Larger, the compiler will display an error. If you wanted to use a different data type, you would need to declare another instance of the generic: Compare<float, float> f_compare = new Compare<float, float >; float MyFloat = f_compare.Larger(1.23f, 4.32f); Because you can use this with different types, you don't need to change the original generic code. The example here is a simplification of what can be done with generics. You will find that, to truly create a generic type that can be used with any data type as a parameter, you will need to ensure that a number of requirements are met. One way to do this—the appropriate way—is with a constraint. A constraint is a class or interface that must be included as a part of the type used for the parameter. For example, in the previous Compare class, to make sure that any data type will work as a parameter when declaring the delegate, you can force the data types to have implemented the IComparable interface from the .NET Framework. You can add a constraint by including it after the generic class declaration. You indicate a constraint by using the proposed new C# keyword where: public class Compare<ItemType, ItemType> where ItemType : IComparable { public ItemType Larger(ItemType data, ItemType data2) { // logic... } public ItemType Smaller(ItemType data, ItemType data2) { // logic... } }. # # # Perfect LanguagePosted by Legacy on 06/30/2003 12:00am Originally posted by: Ratmil Nullable Data TypesPosted by Brad Jones on 08/19/2005 03:10pm You can assign zero to a reference by writing...Posted by Alok Govil on 08/18/2005 11:58pm reference = null; Seems like I am missing something here.Reply Why would you not want to use delegates for this?Posted by Alok Govil on 08/18/2005 11:44pm Why would you not want to use delegates for this?Posted by Alok Govil on 08/18/2005 11:43pm
http://www.codeguru.com/csharp/csharp/cs_syntax/article.php/c5891/What-Are-C-Generics.htm
CC-MAIN-2015-06
refinedweb
641
61.46
My previous articles on the context sensitivity and ambiguity of the C/C++ grammar (one, two, three) can probably make me sound pessimistic about the prospect of correctly parsing C/C++, which couldn't be farther from the truth. My gripe is not with the grammar itself (although I admit it's needlessly complex), it's with the inability of Yacc-generated LALR(1) parsers to parse it without considerable hacks. As I've mentioned numerous times before, industrial-strength compilers for C/C++ exist after all, so they do manage to somehow parse these languages. One of the newest, and in my eyes the most exciting of C/C++ compilers is Clang. Originally developed by Apple as a front-end to LLVM, it's been a vibrant open-source project for the past couple of years with participation from many companies and individuals (although Apple remains the main driving force in the community). Clang, similarly to LLVM, features a modular library-based design and a very clean C++ code-base. Clang's parser is hand-written, based on a standard recursive-descent parsing algorithm. In this post I want to explain how Clang manages to overcome the ambiguities I mentioned in the previous articles. No lexer hack There is no "lexer hack" in Clang. Information flows in a single direction - from the lexer to the parser, not back. How is this managed? The thing is that the Clang lexer doesn't distinguish between user-defined types and other identifiers. All are marked with the identifier token. For this code: typedef int mytype; mytype bb; The Clang parser encounters the following tokens (-dump-tokens): typedef 'typedef' [StartOfLine] Loc=<z.c:1:1> int 'int' [LeadingSpace] Loc=<z.c:1:9> identifier 'mytype' [LeadingSpace] Loc=<z.c:1:13> semi ';' Loc=<z.c:1:19> identifier 'mytype' [StartOfLine] Loc=<z.c:2:1> identifier 'bb' [LeadingSpace] Loc=<z.c:2:8> semi ';' Loc=<z.c:2:10> eof '' Loc=<z.c:4:1> Note how mytype is always reported as an identifier, both before and after Clang figures out it's actually a user-defined type. Figuring out what's a type So if the Clang lexer always reports mytype as an identifier, how does the parser figure out when it is actually a type? By keeping a symbol table. Well, actually it's not the parser that keeps the symbol table, it's Sema. Sema is the Clang module responsible for semantic analysis and AST construction. It gets invoked from the parser through a generic "actions" interface, which in theory could serve a different client. Although conceptually the parser and Sema are coupled, the actions interface provides a clean separation in the code. The parser is responsible for driving the parsing process, and Sema is responsible for handling semantic information. In this particular case, the symbol table is semantic information, so it's handled by Sema. To follow this process through, we'll start in Parser::ParseDeclarationSpecifiers [1]. In the C/C++ grammar, type names are part of the "specifiers" in a declaration (that also include things like extern or inline), and following the "recursive-descent protocol", Clang will usually feature a parsing method per grammar rule. When this method encounters an identifier (tok::identifier), it asks Sema whether it's actually a type by calling Actions.getTypeName [2]. Sema::getTypeName calls Sema::LookupName to do the actual name lookup. For C, name lookup rules are relatively simple - you just climb the lexical scope stack the code belongs to, trying to find a scope that defines the name as a type. I've mentioned before that all names in C (including type names) obey lexical scoping rules. With this mechanism, Clang implements the required nested symbol table. Note that this symbol table is queried by Clang in places where a type is actually expected and allowed, not only in declarations. For example, it's also done to disambiguate function calls from casts in some cases. How does a type actually get into this table, though? When the parser is done parsing a typedef (and any declarator, for that matter), it calls Sema::ActOnDeclarator. When the latter notices a new typedef and makes sure everything about it is kosher (e.g. it does not re-define a name in the same scope), it adds the new name to the symbol table at the current scope. In Clang's code this whole process looks very clean and intuitive, but in a generated LALR(1) parser it would be utterly impossible, because leaving out the special token for type names and merging it with identifier would create a tons of unresolvable reduce-reduce conflicts in the grammar. This is why Yacc-based parsers require a lexer hack to handle this issue. Class-wide declarations in C++ In the previous post I mentioned how C++ makes this type lookup problem much more difficult by forcing declarations inside a class to be visible throughout the class, even in code that appears before them. Here's a short reminder: int aa(int arg) { return arg; } class C { int foo(int bb) { return (aa)(bb); } typedef int aa; }; In this code, even though the typedef appears after foo, the parser must figure out that (aa)(bb) is a cast of bb to type aa, and not the function call aa(bb). We've seen how Clang can manage to figure out that aa is a type. However, when it parses foo it hasn't even seen the typedef yet, so how does that work? Delayed parsing of inline method bodies To solve the problem described above, Clang employs a clever technique. When parsing an inline member function declaration/definition, it does full parsing and semantic analysis of the declaration, leaving the definition for later. Specifically, the body of an inline method definition is lexed and the tokens are kept in a special buffer for later (this is done by Parser::ParseCXXInlineMethodDef). Once the parser has finished parsing the class, it calls Parser::ParseLexedMethodDefs that does the actual parsing and semantic analysis of the saved method bodies. At this point, all the types declared inside the class are available, so the parser can correctly disambiguate wherever required. Annotation tokens Although the above is enough to understand how Clang approaches the problem, I want to mention another trick it uses to make parsing more efficient in some cases. The Sema::getTypeName method mentioned earlier can be costly. It performs a lookup in a set of nested scopes, which may be expensive if the scopes are deeply nested and a name is not actually a type (which is probably most often the case). It's alright (and inevitable!) to do this lookup once, but Clang would like to avoid repeating it for the same token when it backtracks trying to parse a statement in a different way. A word on what "backtracks" means in this context. Recursive descent parsers are naturally (by their very structure) backtracking. That is, they may try a number of different ways to parse a single grammatical production (be that a statement, an expression, a declaration, or whatever), before finding an approach that succeeds. In this process, the same token may need to be queried more than once. To avoid this, Clang has special "annotation tokens" it inserts into the token stream. The mechanism is used for other things as well, but in our case we're interested in the tok::annot_typename token. What happens is that the first time the parser encounters a tok::identifier and figures out it's a type, this token gets replaced by tok::annot_typename. The next time the parser encounters this token, it won't have to lookup whether it's a type once again, because it's no longer a generic tok::identifier [3]. Disclaimer and conclusion It's important to keep in mind that the cases examined in this post do not represent the full complexity of the C++ grammar. In C++, constructs like qualified names (foo::bar::baz) and templates complicate matters considerably. However, I just wanted to focus on the cases I specifically discussed in previous posts, explaining how Clang addresses them. To conclude, we've seen how Clang's recursive descent parser manages some of the ambiguities of the C/C++ grammar. For a task that complex, it's inevitable for the code to become non-trivial [4]. That said, Clang has actually managed to keep its code-base relatively clean and logically structured, while at the same time sticking to its aggressive performance goals. Someone with a general understanding of how front-ends work shouldn't require more than a few hours of immersion in the Clang code-base to be able to answer questions about "how does it do that".
https://eli.thegreenplace.net/2012/07/05/how-clang-handles-the-type-variable-name-ambiguity-of-cc.html
CC-MAIN-2018-13
refinedweb
1,467
52.9
strchr - locate character in string Standard C Library (libc, -lc) #include <string.h> char * strchr(const char *s, int c); The strchr() function locates the first occurrence of c in the string pointed to by s. The terminating NUL character is considered part of the string. If c is `\0', strchr() locates the terminating `\0'. The function strchr() returns a pointer to the located character, or NULL if the character does not appear in the string. index(3), memchr(3), rindex(3), strcspn(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3) The strchr() function conforms to ANSI X3.159-1989 (``ANSI C''). BSD April 19, 1994 BSD
https://nixdoc.net/man-pages/NetBSD/man3/strchr.3.html
CC-MAIN-2022-21
refinedweb
112
67.45
SPAM Discussion in 'VHDL' started by sandeep, Aug 18, 2008. - Similar Threads Reducing Spam Associated with Posting to NewsgroupsMicrosoft Communities Team [MSFT], Oct 14, 2003, in forum: ASP .Net - Replies: - 0 - Views: - 605 - Microsoft Communities Team [MSFT] - Oct 14, 2003 Help Needed with Perl cgi script and spam problemKnute Johnson, Mar 18, 2006, in forum: Perl - Replies: - 11 - Views: - 3,588 - Joe Smith - Mar 22, 2006 from spam import eggs, spam at runtime, how?Rene Pijlman, Dec 8, 2003, in forum: Python - Replies: - 22 - Views: - 1,022 - Fredrik Lundh - Dec 10, 2003 Why 'class spam(object)' instead of class spam(Object)' ?Sergio Correia, Sep 7, 2007, in forum: Python - Replies: - 7 - Views: - 535 - Ben Finney - Sep 18, 2007 - Replies: - 3 - Views: - 705 - Lew - Mar 25, 2008 What is Anti-Spam Filter.(thunderbird spam filter)zax75, Mar 27, 2008, in forum: Java - Replies: - 1 - Views: - 1,312 - Lew - Mar 28, 2008 SPAM: Why are we getting all the spam ??David Binnie, May 22, 2009, in forum: VHDL - Replies: - 2 - Views: - 561 - Rich Webb - May 22, 2009 Re: Updated Spam List 2011 - Largest SPAM Collection Over The Net !!!clamz, Jul 15, 2011, in forum: HTML - Replies: - 8 - Views: - 1,027 - clamz - Jul 16, 2011
http://www.thecodingforums.com/threads/spam.631259/
CC-MAIN-2016-30
refinedweb
202
72.5
Asymmetric crypto Using Symbian Asymmetric Crypto The Symbian crypto libraries have long been unavailable to end users due to the UK's ridiculous export restrictions. This problem was overcome last year, and at long last developers can have access to a trimmed down version of the crypto library for all versions of Symbian greater than v9. Of course, it's not much good having the crypto library if you don't know how to use it, and while it's fairly easy to figure out how to use the symmetric ciphers, asymmetric is somewhat harder. This wiki article goes in to a few common tasks you might want to carry out with RSA, DSA and DH keys. This article assumes you are in general familiar with the theory and practice of asymmetric crypto, PKI and trust. Some notes on the crypto implementation Again, due to the outdated and just plain stupid laws in the UK, the crypto library can be shipped in two "strengths", Strong and Weak. The Weak crypto library is frankly useless, it limits you to Asymmetric keys of less than 512 bits, and symmetric keys of around 40 bits. From a security standpoint, 1024 and 128 bit keys respectively are an absolute minimum. These days, even those are becoming questionable. For a reasonable guarantee of security, one should consider using 2048 and 256 bit keys by default. The crypto library discovers its own strength at runtime. All calls are proxied to strong_cryptography.dll if it exists, or weak_cryptography.dll if it doesn't. Recent S60 SDKs ship with a version of strong_cryptography.dll which is useful. Some recent UIQ SDKs did not. You can solve this problem by simply copying the strong crypto dll from the S60 SDK to the UIQ SDK to get strong crypto everywhere. All actual devices will have strong crypto on board. Then we have the problem that the Symbian released crypto plugin doesn't actually have the same headers as the Symbian internal crypto implementation does. This means that some headers that are publishedAll do not actually parse without modification. A prime example of this is "x509keys.h" This header is actually excluded from many S60 SDKs, and must be modified from the UIQ SDK. This is extremely tedious. Renaming headers in this way is a compatibility nightmare. For your convenience, the include directives at the top of x509keys.h should look like this in order to parse sucessfully: Header files. #include <e32base.h> #include <e32std.h> #include <cryptobasic.h> #include <cryptoasymmetric.h> #include <hash.h> #include <signed.h> Libraries. LIBRARY x509.lib That done, you now have most of what you need to start using asymmetric crypto. X.509 Certificates In the most part, you'll find that the main way public keys are conveyed to people is embedded in a certificate. The certificate not only includes a public key, but also some information on its owner and who issued it that enable you to establish trust. Dealing with X.509 certificates in Symbian is trivial. You must however ensure that a certificate you are attempting to load is raw binary DER encoding, rather than PEM. Symbian has no library for dealing with Base64 decoding PEM certificates, although this is a fairly trivial thing to do yourself should you need to. Some rather contrived code for loading an X.509 certificate from a file follows: #include <f32file.h> #include <x509cert.h> RFs fs; User::LeaveIfError(fs.Connect()); CleanupClosePushL(fs); RFile certFile; User::LeaveIfError(certFile.Open(fs, _L("c:\\certfile.cer"), EFileRead)); CleanupClosePushL(certFile); TInt size(0); User::LeaveIfError(certFile.Size(size)); HBufC8* data = HBufC8::NewLC(size); TPtr8 buf = data->Des(); User::LeaveIfError(certFile.Read(buf)); CX509Certificate* cert = CX509Certificate::NewLC(*data); CleanupStack::PopAndDestroy(4, &fs); //certFile, data, cert Code using the CX509Certificate class must link against x509.lib. Validating certificates TODO: talk about CPKIXCertChain, and the certstore. Extracting a certificate's public key You can query the X.509 certificate to see the type of public key it contains. This is achieved as follows: CX509Certificate* cert = /* blah blah blah */ TAlgorithmId algorithm = cert->PublicKey().AlgorithmId(); Once you know the type of key, to perform any cryptographic operation you'll need to get at its public key. This is done as follows: For RSA keys: #include <x509keys.h> CX509Certificate* cert = /* blah blah blah */ CX509RSAPublicKey* key = CX509RSAPublicKey::NewLC(cert->PublicKey().KeyData()); TODO: DSA keys, possibly fixed DH params too if I get enthusiastic. Once you have a public key, you can use it to encrypt data. Performing asymmetric encryption For RSA encryption, a standard PKCS#15 encryptor class is available, CRSAPKCS1v15Encryptor. This standard method of performing RSA encryption with padding is used by any number of protocols and standards. Its use it pretty trivial: #include <cryptoasymmetric.h> #include <x509keys.h> CX509RSAPublicKey* key = /* blah blah blah */ CRSAPKCS1v15Encryptor* encryptor = CRSAPKCS1v15Encryptor::NewLC(*key); TBuf8<64> plaintext; TBuf8<128> ciphertext; /* fill the plaintext buffer with some data here */ encryptor.EncryptL(plaintext, ciphertext); Of course, asymmetric crypto is designed to be used to encrypt very small amounts of data, typically key for a symmetric cipher which will be less than 512 bytes long. You can get the maximum input and output sizes from the CRSAPKCS1v15Encryptor class via the MaxInputLength and MaxOutputLength methods. Decryption TODO: talk about the ASN.1 library and how to load standard key DER encodings, and the use of those keys. The third operation type you can do with asymmetric cryptography is to sign data, again this is fairly easy. The missing keystore In the full Symbian security subsystem, there exists a component called "keystore" which is responsible for the secure storage of keys. That keystore isn't available to developers is a great shame, because it makes the task of finding keys and signing data trivial. It also means that you aren't responsible for the security of your keys, they are securely stored and managed by the system, which is very convenient. However, simply because you don't have access to the keystore doesn't mean you can't sign data, it just means you have to load your private keys from file and manage them yourself. We have already seen how to do this in the decryption section above how to decode RSA keys, but not DSA keys. DSA is purely a signature algorithm, it cannot perform encryption to facilitate a key exchange. For this purpose, it is often supplemented by either RSA or DH. TODO: ASN.1 dec example for decoding DSA keys that openssl spits out. What to sign If you wish to vouch for a data set, for purposes of ensuring its integrity, etc. It is usual to take the hash of the data, and then to sign that relying on the property of the cryptographic hash that meaningful collisions are monumentally unlikely to provide a guarantee that the signed data has not been tampered with. The signing classes provided by Symbian will not hash the data you provide, that must be done separately. Symbian provides some common hash functions such as MD5 and SHA1 to accomplish this task. TODO: link to an article on hash functions How to sign data TODO: contrived code sample for RSA and DSA signatures. Performing a DH key exchange The DH algorithm is not able to sign data, but is a fairly fast method of performing a secure key exchange. Diffie Hellman key exchange // TODO: DH key exchange example
http://developer.nokia.com/community/wiki/index.php?title=Asymmetric_crypto&oldid=162529
CC-MAIN-2014-15
refinedweb
1,234
56.96
SSL_get_shared_ciphers — ciphers supported by both client and server #include <openssl/ssl.h> char * SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); SSL_get_shared_ciphers() puts the names of the ciphers that are supported by both the client and the server of ssl into the buffer buf. Names are separated by colons. At most len bytes are written to buf including the terminating NUL character. If ssl contains no session, if the session contains no shared ciphers, or if len is less than 2, SSL_get_shared_ciphers() returns NULL. Otherwise, it returns buf. SSL_get_shared_ciphers() is available in all versions of OpenSSL. If the list is too long to fit into len bytes, it is silently truncated after the last cipher name that fits, and all following ciphers are skipped. If the buffer is very short such that even the first cipher name does not fit, an empty string is returned even when some shared ciphers are actually available. There is no easy way to find out how much space is required for buf or whether the supplied space was sufficient.
https://man.openbsd.org/OpenBSD-6.1/SSL_get_shared_ciphers.3
CC-MAIN-2022-21
refinedweb
175
70.94
, this Now that's a long blog post ;) I’m confused. Are we talking about Javascript or JScript here: <i>most languages will heavily optimize this, as Justin talked about on his blog a couple of years ago, but JavaScript doesn’t</i> Surely optimisation is done in the interpreter, not the language? why do I get the suspicion that this is a result of trying to speed up all that AJAX crap thats showing up these days Good tips, but a couple nitpicks: 1) You should point out the main misuses of eval and how they can be avoided. For ex: eval("document.forms." + name + ".value='foo'") should be document.forms[name].value = 'foo' Actually that's a bad example, since document.forms isn't really a JS object; it's a native object. But in general: eval("obj."+prop) => obj[prop] 2) JavaScript's associative array isn't Array; it's Object. Array is just an Object with a magical length property and array methods. can you please fix your sample code, to include proper tags! if you plan for others to learn from this code, it should be a "good" example. e.g. all the "<br>" tags should be "<br/>". Second, can you use a different style text (cough, cough) FIXED FONT for the samples, and make it a different color than the default links in this Blog! You'll want to add [type="text/javascript"] to your script tags too. It is the default, yes, but again, you're trying to lead by example. ps Thanks for not using a single UPPERCASE tag! This actually makes your code sample look much more professional. Paul I don't remember .innerHTML being part of the DOM spec? or even supported by all browsers? Web Developers don't write browser specific code, remember!?* *Well, ok we often have to, to get around quirks, but I would have altered the example to be more x-browser/DOM compliant. I love how your InjectMangle function, so very clearly illustrates the button bug that we've be complaining about in the last thread. so, any chance of some ETA's on these fixes? ETA's on the Bug tracking system? ah, before I get reamed... I meant .innerText, not .innerHTML which every browser seems to support now. I'm repeating myself: beware of browser-specific implementations The fact that string-concatenations are slow in JScript is because of a poor implementation (not keeping a pointer to the end of the string). Only in JScript is the Array.join()-approach faster, in other javascript-capable browsers concatenations using the + operator are much faster. Opera blogged recently ( ) that it is even better to do: a = a + 'something'; a = a + 'something more'; than to do: a = a + 'something' + 'something more'; which is true, except in JScript... As for the 'necessity' of eval for JSON I also disagree; it's quite easy to create a parser for JSON in javascript that doesn't rely on eval() For the last part, the switch block, I will do some testing. It might just be that this is implementation-specific as well. Just another nitpick - your code sample above uses setTimeout("CheckInject()", 1000); wouldn't it be more efficient to just do setTimeout(CheckInject,1000); To nitpick some more: please don't write examples that rely on propriety extensions (innerHTML) or IE-only propriety extensions (innerText and elements with name/id being available in the global namespace*). Also please use valid markup, which means adding a type attribute to your script starttags and properly escaping any endtags within script. You are posting on a high-profile blog so your examples should at least pass a simple validity-check. * document.all should have been deprecated with IE5 and should have been extinguished in IE7. I read the article and understood the concepts, but had a tough time following most of the examples. Having read the comments, it sounds like its for the best. I've read in many places that I should never use X or Y, but nobody seems to be saying the correct way to be doing things. Hopefully you JavaScript masters out there can appreciate that I'm a little wary of blindly going to web sites and trying to learn the right way to do things for fear of actually learning the wrong way to do things. Can anybody recommend any good ones to me? I'm already planning to some day buy the two recent books, one by Jeremy Keith and the other by Peter Paul Koch, in case you were going to recommend those to me. Actually, 'x' + 'y' would resolve to 'xy' during compile-time in some JavaScript engines, including either Spidermonkey (Mozilla's) or Rhino (Java equivalent) - I forgot. By compile-time, I mean the stage where the engine's parser builds up the parse tree before interpreting it (which would be run-time). This only works for adjacent string literals though, not vars containing strings. I'll try to follow up with all of the comments, but the general gut check is that people don't like my style. Some people pointed out the lack of XHTML (yep, sorry IE doesn't support it), we made the mistake of referencing JavaScript in a couple of places which should probably be JScript, as we are clearly talking about our own implementation here and how to speed things up when using IE. I've also noticed that some of the other browsers have their own performance optimizations. For instance, the setTimeout call above, noted as not optimal, is treated in IE in such a way as to be almost optimal (though we do generate one extra anonymous function that isn't needed). The most interesting comment so far is on JSON though. I think there probably are more efficient parsers than the use of eval. In fact, I would hope that someone would provide one for public consumption. If you have something go on over to and convince them to pick it up! If the content of the post here tends to be too much about what not to do, the intent of the code samples is to provide a quick basic work-around for use with IE. These tips if you will are based on common scenarios that we've discovered can be improved and acted upon by the web developer now. These are not and will not be replacements for actual improvements in IE's implementation as we release new versions. Sour, sour, sour. I've come to a conclusion about commenting web developers which I won't share here. I thought the optimizations, particularly the string manipulations, were quite good. I'll remember to use them. For those that look down at various aspects of JScript and its implementation, remember that IE is faster in other ways than Firefox or Opera. Even Superman had issues... If you're going to assign arbitrary properties to an object, as in this example: var o = new Array(); o["DIV"] = Parser_Div; o["SPAN"] = Parser_Span; o["P"] = Parser_Para; Why not instantiate o as an object instead: var o = {}; Since you're not using o as a sequence, why do you instantiate it as an Array? I would like to commend the IE team for publishing this article and developers should be aware as much as possible of these issues. As for myself I intend to write code for readability and maintainability.I use lots of switch statements for preciously this reason, I could change that and make my code slightly quicker in IE but no doubt it would have a detrimental effect in other browsers. Likewise string-concatenations I am not changing my code because of an implementation quirk in one browser. I wish all developers would do the same aim to write clear maintainable code, it is up to browser makers to optimize their iterpreters. If all developers did this the onus would fall on browser makers to sort out these problems. Array.join for string concatenations sounds like a good tip. It is only marginally less readable and I can see why this would speed things up. However using a hash function instead of a case statement makes the code much much less readable. It also restricts the number of values you can have for each case and forces you to create a function for each case statement, neither of which you would allways want. I am sure there are occasions where the optimised code would be needed, but for most cases readability and maintainability should take precedence. Finally I would like to point out that "Most script code used for manipulating the IE DOM requires some sort of string manipulation" is not a good premise to start an article on. There are built in methods for manipulating the DOM which require no string manipulation at all. You really should remove commenting from this web log. All the Mozilla morons are annoying. Don't do this: var markupBuilder = new Array(); but: var markupBuilder = []; setTimeout("CheckInject()", 1000); setTimeout(CheckInject, 1000); > var o = new Array(); > o["DIV"] = Parser_Div; > o["SPAN"] = Parser_Span; > o["P"] = Parser_Para; Man, that's nonsense. What you have here isn't an "associative array" but an array object where you add properties. But then there's no need to use an *array* object. What it should look like: > var o = new Object; > o.DIV = Parser_Div; > o.SPAN = Parser_Span; > o.P = Parser_Para; Which can be optimized further: > var o = { > DIV: Parser_Div, > SPAN: Parser_Span, > P: Parser_Para}; Could you tell me if "new Function(code)" is a good replacement for eval? That could be a way to parse json without the scope latency brought by eval. Example: return eval(json_string); vs. return (new Function("return " + json_string))(); I agree with Dao but can he or someone else explain why using var markupBuilder = []; is better than Surely both do the same and create a new array object. I am talking about array creation here as correctly pointed out an object should have been used in the example. <blockquote>You really should remove commenting from this web log. All the Mozilla morons are annoying.</blockquote> That was funny! Great article by the way, despite it being quite IE flavored. seems that You forget String.concat native method, supported by every browser, IE4 too ... I've tested that var bigString = someString.concat(a, b, 'c', d, e, f, g, h, i(), j) ... is even faster than array creation with a join solution var bigString = [a, b, 'c', .... , j].join('') and both are faster than 'plus sign' concatenations. I often use String.concat starting from empy string too return ''.concat(what, ever, you, need) useful for example with CSS size (first element isn't a string) return ''.concat(myInt32Size, 'px'); @Mike > I agree with Dao but can he or someone else explain why using var markupBuilder = []; is better than var markupBuilder = new Array(); Because it's faster. Sebastian, afaik new Function in no better than eval. You can check: and @Sebastian Werner > Could you tell me if "new Function(code)" is a good replacement for eval? I'm pretty sure it's as inefficient as eval. While reading several posts about JavaScript performance [ 1 ] [ 2 ] I did a simple test, too. My first Excellent post. I could definitely use this as a reference if I needed to do some optimizations. I have a habit of optimizing all my code when I have the time to do it -- a habit I picked up from 3D programming. At the same time, I hope the knowledge you have of these inefficiencies is put to good use in future IE versions. @ Justin Rogers "The most interesting comment so far is on JSON though. I think there probably are more efficient parsers than the use of eval. In fact, I would hope that someone would provide one for public consumption." Can you please elaborate on this? How can a JavaScript JSON parser be faster than a native one? ~ or did I just misunderstand your post? I also find the fact that the article calls for standards when mentioning JSON but uses innerHTML and innerText quite amusing. Microsoft just do not get it. As for Scott: the correct way to add elements to an existing document once it's parsed is through DOM (and no, innerHTML or inner Text are not part of DOM): function BuildDiv(id, text) { var div = document.createElement("div"); div.setAttribute("id", id); div.appendChild(document.createTextNode(text); return div; } The above works even in IE since at least IE5. In the end, this is what using innerHTML will end up in, the browser will parse it and create the objects for you. I don't understand why some people think concatenating strings is a better way to create the objects you need. > How can a JavaScript JSON parser be faster than a native one? Because you don't have to "construct a new script engine, copying the context of the currently executing script". I still doubt a custom parser would be faster, though. Yes, this is DOM compliant: > function BuildDiv(id, text) { > var div = document.createElement("div"); > div.setAttribute("id", id); > div.appendChild(document.createTextNode(text); > return div; > } But this is reality compliant: div.innerHTML = text; When you start generating a large chunk of HTML and want to insert it, using DOM operations is painfully slow and is not atomic (instead of "blitzing" the new HTML into the DOM, you would be gradually updating the DOM, which may have undesirable visual effects). As this article is about improving performance, favoring innerHTML is the right way to go. ***OFFTOPIC*** I'm afraid I found a bug in the IE7 feed functionality: I was (am) subscribed to, but ever since that URL started returning a HTTP 404 error code, ALL my feeds have stopped refreshing their content entirely. I now have to right click and select "Refresh All". I just updated the two 404ed feeds, and don't know yet if they're updating automatically again. What is the current suggested way to report non-critical bugs in IE7? Lots of links: When I have so many browser windows and tabs open it's time to harvest some... here are some links I've found this week that I found interesting, and you may too.... @Stoyan and @Dao, regarding your comments. Have you seen this sentence from the Opera links you have posted? "The Function constructor is not quite as bad as eval, since using it does not affect the code surrounding the use, but it can still be quite slow." I realize it is very fashionable to bash IE these days, but the topic at hand is JavaScript performance not whether people should use "non-standard" innerHTML and innerText in examples. Anyway, it is rather naive, or at least seriously limiting to write JS on browsers and only use "standards" based functions. Standards are great, and I certainly encourage Microsoft to follow them, but as web devs, the reality is we program to what will work for the masses, and innerHTML probably one of mostly widely implemented DOM interactions that is available, regardless of what W3C has to say about it. As far as JSON/evals, I believe that evals generally have a constant time component to their cost, therefore it may be possible to build a non-native JSON reader that is faster on very small snippets of JSON, but I also doubt that non-native reader could be anywhere close to as fast as an eval on all but very small JSON strings. I thought what Justin was referring to with performance degradation with large JSON was applying Douglas Crockford's JSON regex security checking (the JSON.parse function, that prevents functions from being included in JSON). However, if you are getting JSON from a trusted source (and if you are making AJAX calls to your own server, you can generally trust it), then you don't need to run the JSON regex security checker, and the slowness of the regex checks can be avoided. I don't see why an eval on long strings would be non-linear in cost, it is essentially the same parsing that occurs in script parsing. Anyway, I appreciate that Microsoft is providing information about JScript optimization. Paul, "You'll want to add [type='text/javascript'] to your script tags too. It is the default, yes, but again, you're trying to lead by example." Actually, this is misleading on two counts. First, the Content-Script-Type HTTP header can be used to specify the default scripting language for the intrinsic event attributes of elements (like ONCLICK), but that header does not apply to SCRIPT elements. The TYPE attribute of the SCRIPT element is an absolute requirement and has no default value, even if a Content-Script-Type header is included. See the specification for SCRIPT: Second, "text/javascript" is officially obsoleted in favour of "application/javascript". See the IANA media types registry ( ) and RFC 4329: Scripting Media Types ( ). I don't think that media type is supported by Internet Explorer, however. I guess one could hide the reference to text/javascript behind a conditional comment; perhaps Justin Rogers could amend his example above? "Thanks for not using a single UPPERCASE tag! This actually makes your code sample look much more professional." HTML tags are not case sensitive. There is nothing unprofessional about uppercase HTML tags; they appear in uppercase in W3C specifications. Justin Rogers, "people don't like my style" Nothing wrong with using HTML, but adding a TYPE attribute to SCRIPT and escaping end-tag open delimiters (</) within SCRIPT are not matters of style. On the later point, please consult: Your first SCRIPT element technically ends only six lines in, at: markupBuilder.push("</ These are simple matters of writing standard HTML or writing gibberish. Please fix your example before too many people copy and paste it verbatim into their markup. That's what the INS element is for, after all. :) (If I wanted to whinge about "style", I might suggest that it is always better to use external scripts to separate content from behaviour: .) Michael Bolin: "instead of 'blitzing' the new HTML into the DOM, you would be gradually updating the DOM, which may have undesirable visual effects)." Why not use DocumentFragment to build up a DOM section out of sight, then insert it all in one go? TMaster: "What is the current suggested way to report non-critical bugs in IE7?" Phone support and the microsoft.public.internetexplorer.general newsgroup (yes, the closure of the public bug tracker does suck): Kris Zyp, "innerHTML [is] probably one of mostly widely implemented DOM interactions that is available, regardless of what W3C has to say about it." Maybe. But not all implementations are the same, as Ian Hickson has found while trying to write a backwards compatible, cross-browser specification for innerHTML for Web Applications 1.0: ln.hixie.ch/?start=1158969783&count=1 Again, according to the Mozilla Developer Center: "when text is entered into a text input, IE will change the value attribute of the input's innerHTML property but Gecko browsers do not". developer.mozilla.org/en/docs/DOM:element.innerHTML @Benjamin Hawkes-Lewis Lower-case text compresses better than upper-case reducing Internet congestion... Why not make JScript parser more clever, or make a JScript code optimizer? @Jace "Lower-case text compresses better than upper-case reducing Internet congestion" So Web Optimization's study appears to show ( ), although their report confuses upper-case and mixed-case markup. Still, the logical advantage of lower-case markup, as far as I can gather, lies in the facts that: 1. GZIP encoding depends on the repetition of character sequences. 2. Character sequences like "table" are more likely to occur than "TABLE" in the content of the page. However, removing whitespace from your code and obfuscating JavaScript also reduces congestion. But to maximize code readability, such techniques should only be applied to served content and don't really belong in maintained code or code samples. Whether the compression gains are generally worth obfuscating markup and code that users may wish to read and modify could be questioned. But I grant you that using all lower-case markup costs little in readability and gains a little in compressibility. > But I grant you that using all lower-case markup costs little in readability and [...] It doesn't cost anything in readability. In fact, a typography rule is to avoid uppercase text because it's hard to read. Can anybody explaing me the problem with "window.OBJECT" instead of "OBJECT" at this post? Dao, "It doesn't cost anything in readability. In fact, a typography rule is to avoid uppercase text because it's hard to read." Yes, that's a good point, one should avoid upper-case text for lengthy passages because it's hard to read. But upper-case text works GREAT as a formatting to distinguish a special type of text intermixed with other text (see what I did there). So while the tags themselves may be (slightly) less readable, it's easier to distinguish them amidst the text content, which arguably increases the scanability of the HTML as a whole. But like I say, it's only a slight advantage. It's not enough to make me want to use upper-case text personally. (But then I (mostly) switched from XHTML 1.0 served as text/html to HTML 4.01, so I'm habituated to lower-case markup anyway.) Apologies in advance for a lengthy post Justin, first of all I would like to comment on your 'style'. I really do appreciate your effort but their are certain things you need to keep in mind when writing about performance recommendations. Any article about this subject should come with a big red warning label saying 'beware of premature optimization and browser-specific implementations'. Also I object against using the term 'recommendations': most of the examples should not be considered good practices and you should only resort to certain optimization techniques when you have a compelling reason to do so. In 99% of all cases optimization on this level is not required and should be avoided at all cost to maintain readability of your code; f.i. using an array to do simple string-concatenation is completely illogical (more on that later). Secondly I object to using propriety techniques in examples, especially when they are completely unrelated to what you want to explain. You should always try to use standard techniques or when you want to explain something that is related to any propriety technique put another big red label next to it saying that it is browser-specific. Funny thing is that in some of your examples using a standards technique will actually perform far better (more on that later). In general when you use examples to show optimizations you should make sure that the example itself is optimized in every single way. I would like to demonstrate that in the explanation of the Array.join technique where you use the push method: markupBuilder.push('somestring'); now this involves a method call which is actually more costly than doing this: markupBuilder[markupBuilder.length] = 'somestring'; Now I did some research into the general slowness of string concetenation in IE's JScript implementation. It seems that when using strings smaller than 64KB there is no real performance issue, only beyond 64KB concatenation suddenly becomes 15 times slower (but is still linear). This is clearly an implementation issue that is specific to IE's JScript, other browsers don't suffer from this and just using the + operator performs best in these. So basically if you need to work with large strings and run into this IE-specific problem you should also apply this technique for IE only, for instance by using conditional compilation. Now let's look at an example that involves loops: for(var i = 0; i < tokenizer.length; i++) {} here every iteration you need to check the length property of the tokenizer object which is slightly more costly than checking with a local variable. So you may want to rewrite this to: for(var i = 0, l = tokenizer.length; i < l; i++) {} or when order doesn't matter even to this: var i = tokenizer.length; while (i--) {} Onto the use of propriety techniques: innerHTML innerHTML is like a sledgehammer, it's great for manipulating large chunks of markup, but when you need to manipulate only a textNode you really should be using Element.firstChild.nodeValue which is around 6 times faster in IE. In your example you also insert a BR-element but if you had used a PRE-element i.s.o. a DIV for the output messages that would also not be necessary since you can than just use a linefeed. Furthermore in your example each time you reference 'output' a lookup needs to be done. I thought you explained in your previous article that it is much better to cache that reference in a JS variable. That would also unjustify the need to use document.all-like lookups which, I admit, are slightly faster than using getElementById but since backwards compatibility with the ancient document.all object model is the root cause of many problems in IE with regards to DOM compliance it should be avoided at all cost so that one day it can be removed completely from IE. Now I wouldn't want to rewrite my switches just yet. When such rewrite would mean trading a switch for a function call you will only see performance improvement when your switch-block contains more than a hundred or so cases; below that the added cost for the function call is more expensive than the plain lookup of the proper switch-case. So yet another example of premature optimization that should only be used in very specific cases and since HTML only has 91 different tagnames (including Q) I would still use a switch ;) A far better tip would be to put the cases that are likely to occur most frequently 'on top' in your switch. Oh, and yes, don't use an Array for associative properties, use an Object. About my JSON comment: note that I didn't say that a JSON parser that doesn't rely on eval() would be faster. I simply don't know because I haven't made such a parser yet, but I may just follow up on that although I couldn't convince Douglas Crockford to consider my (faster) alternatives for toJsonString() either... One last general remark: I feel that your examples are too big and complex to demonstrate the techniques at hand. Although it is nice to use real world-ish examples that should not be a goal in itself. The optimization tips now get overshadowed by the complexity of the examples themselves. So far for my 'bashing', I hope it's helpfull :) Nice post, Tino. Really helpful. Btw, I just realized that Date is instantiated and thrown away 8 times in perfTestDivs. I know, it's only a test function and doesn't really matter (although the instantiation time adds to each result and thus adulterates the relative result). Anyway, you should take care of things like that while talking about performance. According to the HTML 4.01 spec at: "Element names are written in uppercase letters (e.g., BODY). Attribute names are written in lowercase letters (e.g., lang, onsubmit). Recall that in HTML, element and attribute names are case-insensitive; the convention is meant to encourage readability." Just because the spec says element names should be in all caps (and argues that this improves readability, to boot!), do you expect everyone to start following the spec when lowercase names also work and improve download times? It's the same thing when it comes to using innerHTML instead of DOM operations. Also, Benjamin Hawkes-Lewis, I appreciate the suggestion about DocumentFragment, but I don't believe it's supported correctly on IE6: Also, if you build up a DocumentFragment with DOM operations, then you don't get the performance benefits that you would get from using innerHTML. @Michael Bolin: that phrase you are quoting is about the conventions used within the specification document itself and is not a recommendation about actual markup. When I write about markup I also use uppercase; e.g. TABLE-element and such, but in actual markup I use lowercase tagnames. Andre: Using window.object requires two identifiers to be resolved: firstly "window", then "object". Removing "window" means you only need to resolve "object" (unless you want to circumvent a masking variable called "object" somewhere on the scope chain). Dao: In javascript, new Date() returns a date object set to the instant that it was created. It doesn't keep time with the system clock therefore the only way to get the current time is to create another Date object. Less than optimal? Yes, but what else is there? Don't trust numbers less than 100ms since the resolution of the javascript Date object seems to be only about 15ms on most systems. > Using window.object requires two identifiers to be resolved: firstly "window", then "object". Removing "window" means you only need to resolve "object" (unless you want to circumvent a masking variable called "object" somewhere on the scope chain). But since window is definitely the global scope, using window.foo means that the engine doesn't have to deal with scopes. > In javascript, new Date() returns a date object set to the instant that it was created. True, I forgot that (using Date rather seldom). > Don't trust numbers less than 100ms since the resolution of the javascript Date object seems to be only about 15ms on most systems. > Not sure how this reflects the instantiation time ... What I know is that it doesn't depend on the system only, e.g. SpiderMonkey had a performance issue with Date. In my opinion, since JScript is executed by an interpreter, the JScript interpreter should be able to evaluate the string passed to the function eval without constructing a new script runtime and copying the context of the currently executing script. Is there anything hindering such an execution? Although Dao is correct in saying var o = {}; is the correct way of creating an object, it turns out that this is more likely to trigger the garbage collector in IE than var o = new Array(); Eric Lippert detailed in his blog how the garbage collector in jscript works. It sounds like this may no longer be needed for jscript 5.7 but it definitely provides a noticable impromentent for scripts that create lots of objects in IE 6 and lower. In any case, I am pleased to see that MS is putting effort into was has appeared to me to be a very neglected area. Though I am hesitant to believe that this purely due to customer feedback and more like to do with internal MS projects like atlas (or whatever there ajax toolset is called) - purely speculative on my part though. @all those quibbling about HTML tags, HTML tags in uppercase, is the quickest way to get someone to laugh at your code. Do a view source of any professional site (Google, MSN, Yahoo, etc.) Check out their source. You won't find <BODY> or <TABLE> or <DIV> tags, because they are associated directly with HTML from 1995. "HTML tags in uppercase, is the quickest way to get someone to laugh at your code" If that "someone" judges things by appearances I guess. "Do a view source of any professional site (Google, MSN, Yahoo, etc.) Check out their source. You won't find <BODY> or <TABLE> or <DIV> tags, because they are associated directly with HTML from 1995." Depends what you mean by "professional". Most of the (web) "professional" sites have jumped on the faux-XHTML bandwagon, including MSN from your list. For such sites, upper-case markup is is a matter of conformance not style. If you'd bothered to look at the (allegedly) "professional" source code for this very blog page you're on now, you'd find that despite claiming (laughably) to be XHTML, it includes plenty of elements in upper-case (do a case-sensitive search for <BR>, <P>, <FONT>, <H6>, <B>, and so forth). If I were to look at Google or Yahoo, I would find more important issues with their site than the case of their markup. Google's homepage has 50 validation errors; Yahoo's has 41. (The MSN page validates, so well done whoever did that! You still should have used HTML 4.01 Strict and a much cleaner design though.) If you look at (which purports to be HTML 4.0 Transitional but naturally doesn't validate), you'll see <META>, <SCRIPT>, and <NOSCRIPT> all in upper-case. Or again, if you look at (which likewise claims to be HTML 4.0 Transitional but of course doesn't validate), you'll find <META>, <TITLE>, and <LINK> in upper-case. Or if you look at the homepage of IETF, you'll see <FORM> and <INPUT> in upper-case. Case dismissed. ;) Depends what you mean by "professional". Most of the (web) "professional" sites have jumped on the faux-XHTML bandwagon, including MSN from your list. For such sites, upper-case markup is is a matter of conformance not style. If I were to look at Google or Yahoo, I would find more important issues with their site than the case of their markup. Google's homepage has 50 validation errors; Yahoo's has 41. (The MSN page at least validates, so well done whoever did that!) Gargh... sorry for the repeat postings, folks. :( The site kept throwing up an error page. If anybody could delete the three extra ones that would be good. this really does not seem gto be any more efficienyt.HOWEVER, I suppose it could prove itself to be most benefivcial in the future. It's a real pity neither Peter nor Justin seem to be eager to comment on my feedback even though I tried to bring it mildly this time (obviously they also overlooked my comments in part 1 because that certainly wasn't "good feedback" either). I won't go as far though as to say that I think this is again typical Microsoft behavior... Please consider having your next item on this subject proofread by someone who knows something about the subject but isn't solely Microsoft-minded/oriented. Oh yes, I tried a non-eval based parser for JSON in javascript but preliminary tests show that such a parser would be at least 10x slower than the eval-solution... You are right, lots of large sites don't comply with xhtml, or claim to be one thing, but are actually not.. yeah, you can create a web page/site with Word, but no professional would dream of doing so. Nothing against Word of course, it does help write great documents (once you kick clippy to the curb), but it wasn't designed for making web pages. Lex As for string concatenation using an array, this is the simplest method I suppose: ['you ','can just ','concatenate anything ','like this ','right?'].join('') Another question that's really annoying: IE7 messes up my tooltip script (see link) using a zoomed view. Would there be a hack to disable or modify the page zooming? regards/RK " I'm somewhat suspicious of free-floating arguments from popularity ("Anyone"), authority ("serious"), and fashion ("circa 2006"), which aren't couched directly in terms of either technical merits or at least recommendations from standards organizations (who, we live in hope, have considered such merits). The same relentless pursuit of the novel drives people to create broken "XHTML" pages. "Nothing against Word of course, it does help write great documents (once you kick clippy to the curb), but it wasn't designed for making web pages." Or, rather, it /was/ designed for making web pages, but like most such programs it was designed with the wrong conceptual model for HTML+CSS (in other words, WYSIWIG) and without any serious attention to interoperability and accessibility. How to shield the zoom in and zoom out function for IE7, please tell me using the javascript code, thanks It is maybe OT but how the appendChild work for IE7 ? I am able to add a tr and td to an existing table but IE7 never works with. It is really require to work only with FF2 ? Well, for testings: [code]<html> <head> <title>Test</title> <script type="text/javascript"> <!-- function fillme(){ row = document.createElement('tr'); row.setAttribute('id','trel'); col1 = document.createElement('td'); col1.setAttribute('id','colnl'); col2 = document.createElement('td'); col2.setAttribute('id','coln2'); col3 = document.createElement('td'); col3.setAttribute('id','coln3'); col1.innerHTML = "TD 1 "; col2.innerHTML = "TD 2 "; col3.innerHTML = "TD 3 "; row.appendChild(col1); row.appendChild(col2); row.appendChild(col3); document.getElementById("eingabe").appendChild(row); } //--> </script> </head> <body> <table id="eingabe"> </table> fillme(); </body> </html>[/code] I am really not happy about changes from the IE7-dev-Team between the last Beta and the first RC :( Hello again, this is Peter Gurevich, Performance PM for IE. We have gotten a lot of good feedback from JavaScript est un langage " late binded " c'est à dire que chaque appel d'une propriété aura un coup JavaScript est un langage " late binded " c'est à dire que chaque appel d'une propriété aura un coût Thanks to everyone that attended the December DevCares event in Chicago last week. One of the topics... Recently someone asked me about the best practices for AJAX performance. Though this information is scattered
http://blogs.msdn.com/ie/archive/2006/11/16/ie-javascript-performance-recommendations-part-2-javascript-code-inefficiencies.aspx
crawl-002
refinedweb
6,294
62.48
VOL. XIV. MINNEAPOLIS ABLAZE. The Most Magnificent Gathering That Ever Turned Out to a Great Public Meeting in the Flour City. Cheering Thousands, With Torches and Transpar encies, Give Daniel W. Lawler and Roger Q. Mills the Grandest of Receptions. The Exposition Building Crowded to Its Very Doors and Ten Thousand People Unable to Enter the Building. Sturdy Champions of the People's Interests Discuss the Issues Before an Audience Which Scents the Coming Triumph. Evidences on Every Hand of the Loyalty of Minne apolis Democrats to the Standard Bearer, Daniel W. Lawler. Addresses by Senator Mills, Henry George, Gen. Ewing and Half a Loien Other Leaders of the Democracy. Who said Minneapolis is not for Dan Lawler? Upon what does he b#se his assertion? Was he in Minneapolis last nitrht? No; he couldn't make such an assertion if he were. Thousands of men in line, tens of thousands looking on from the o'er taxed sidewalks, horses prancing, ban ners waving, flaring torches dispelling '1^^^ f==fl DAN W. LAWLER. the gloom of night, rising, swelling resounding cheers merged into one grand outburst of welcome— all these were part and parcel of the demonstra tion in Minneapolis last night. That demonstration was an ovation to Daniel W. LavvJer, the man whom the people of Minnesota will elect governor next month— to him and the Democratic parly for which he stands. Time and again since the 3d day of last August has the story been told that Minneapolis would, by the votes of her citizens, repudiate the nomination of Daniel W. Lawler for governor. Why? No one ever attempted to explain. No one could explain. What is not cannot be explained. Hut the story was told and told again. At last 31iiuicapolis Arose In all her pride as the metropolis of the Northwest and said she would give convincing proof for all time that none stood nearer her heart than Daniel W. Lawler. The magnificent demonstra tion to Lawler seen in Minneapolis last uight, the most spontaneous.enthusiastic ovation ever before accorded a private citizen in the state ot Minnesota, was the answer Minneapolis gave to the calumny that she liked not Daniel W. Lawler. Not like a conqueror did he ride through the streets of this city, while all around him rose and fell the cyclonic outbursts of applause, for where a conqueror rides the afflicted Will be found and the triumph of the conqueror is embittered by the fate of the fallen; rather like a much beloved eoii did he appear, a son chosen by his people to lead them and cuide them, be cause they had implicit confidence that whatever he might do would be well done and done for the people. C?esar had his triumphs, and so had Napoleon, but their triumphal robes were tinged with blood, and beneath the plaudits of the populace could be seen the fear of the lash. A whole cityful assembled to do honor to Daniel W. Lawler, not be cause he had made himself their master at the cost of pain to them, but because they had, of their own will, chosen him to be their leader. To Daniel W. Lawler, as the repre sentative of the principles of the Demo cratic party, this grand reception was given— to him and to the other master ful men who, with him, this year are carryinc to the certainty of victory the banner of the Democratic party, so long theorirlanime of the believers in that golden rule of statesmanship, "The greatest good to the greatest number." Victory for the principles of the Demo cratic party is in the very air. That feeling it was which Tlivongcd the Streets With cheering thousand's and packed Sunday ST. PAUL Globe. the big exposition building to suffoca tion with thousands more, come to drink of the stream of political truth as it flowed from the fountain. For the representatives of the Democracy of the nation, as well as of Minne sota, were in Minneapolis last night. They were, with Lawler, the guests of the city's people. And they were such men as every city delights to honor There was Senator Roger Q. Mills, who for years has. from the floor of the na tional congress fought the battles of the people without hope of other reward than the knowledge that he was right and was doinir his duty, typical of De mocracy; there was \V. G. Ewing, one of a iontr list of men who have made, in the history of American statesmanship, that pace devoted to the territory west of the Allegheny mountains one of the brightest. Last night he stood before the people of Minneapolis as a personal representa tive of Adlai E. Stevenson, the com panion in arms of that leader of the American people, Growr Cleveland. And tliere was Henry George, one of the brightest of minds, a man of whom it can be said that he has. within the memory of the youngest voter, changed the whole trend of political thought in this nation, and awakened the world to a realizing sense of the great problems that must be solved before all men can become what they were created, brothers. These men are all champions of the people. They speak, not for a state, for a collection of states, for a class, for an interest, but for the people, the whole people, the nation which is symbolical of the people, from which it derives its powers. And so they spoke last night. It Was a Multitude. Such a tremendous army of auditors as greeted Gov. Dan W. Lawler and the distinguished gentlemen who to some extent shared the honors with him at Minneapolis last evening, misiht well appal the stoutest-lunged orator that ever addressed an audience in ancient or modern da vs. It was superb in qual ity, magnificent in number, truly multi tudinous in proportions. Its extent and enthusiasm may be imagined when it is stated that such a tiling as a speech was utterly impossible. Stretching away amost to the limit of vision from the platform— front, rear, right, left, on the mam floor and in the galleries- were what seemed millionsof gleaming faces, all beaming with ex pectancy, delight and joyous anticipa tion of the treat in store. But the uncountable multitude itself ended all idea of enjoying the literary feast promised. On the platform were seated hundreds of the most prominent Democrats of Minneapolis, St. Paul and Minnesota at large, and Lawler's admirable, unassail able personality inspired every man of them. Back of the platform were banked other hundreds of deeply interested citizens— Republicans, Democrats, inde pendents, mugwumps, Prohibitionists, waverers— all patriots, all completely in harmony, so far as audible mani festation goes, with Hie spiiit of the universal welcome to the foreor dained successor of William R. Mer riam in the executive office of Minne sota, Daniel W. Lawler. Those in closest proximity to the speakers' stand but reflected the senti ment of the seemingly Countless Thousands who faced the platform. Packed to gether in a crush beyond even the point of ordinary discomfiture— in chairs, standing in the aisles, hanging onto the very edge of the gallery, jammed into the band stand away up under the roof until it seemed as it the swinging structure would fall and • crush those below — the masses of men and women listened with almost painful intensity to catch the echo of every blow struck for economic freedom by the men of world wide fame who, in turn, stepped to the front of the stage in the great Exposi tion hall which witnessed the forced nomination of Harrison earlier in the season. The bewildered eye of the observer could not begin to comprehend the ex tent of the acres of people surrounding Gov. Lawler as he rose to speak on the introduction of Mayor P. B. Winston. The manly, courageous man who has made such a niarvelously successful campaigning tour of Minnesota was visibly affected as he began to deliver his message of encouragement from the yeomanry of the state to the denizens of two of. tfie proudest cities under the banner of freedom. Such an ovation as Democracy's can didate for the governorship received was Calculated to Unnerve any ordinary man; but Lawler, master- SAINT PAUL, MINN., STjNDAY MORNING, OCTOBER 23. 1892.— TWENTY PAGES. ing his emotions and concentrating the forces of his mind, began to speak. Ever earnest, scholarly, patriotic, eloquent, careful and yet ready, he seemed to realize that lie had almost en tered upon the supreme moment of his public life— and he won the love ami tribute of friend and foe. Bearing the apparent signs of the wonderful work lie has been doing for right, for prin ciple, for Democracy, for the people, yet Daniel iV. Lawler perhaps never appeared to better advantage than last night, as he realized in his soul, as the impulses and intuition of his heart im parted to his countenance, the convic tion that he was racing friends, ac quaintances, fellw citizens, who would join later on in proclaiming him chief and worthy magistrate of one of the noblest commonwealths in Christen dom. "From the Canadian boundary to the state line of Democratic lowa," said Mr. Lawler. amid an impressive period of silence in the ocean of listeners; "from Kittson county to Houston: from almost every hamlet, village, town and city; from over two-thirds of the people of this noble state,l brine to the assembled thousands here tonight a message or Success forGrover Cleveland and the Demo cratic state ticket." Then the audience turned itself loose, and while it shouted forth its exuber ant joy the face of the orator relaxed. At the conclusion of the applause, Mr. Lawler went on to say that in the state of Minnesota alone had the wise heads of the .Repub lican . party found it necessary to shirk the main issue of this greatest po litical fight of modern times, tariff re lorm, and to compel their candidate for governor to devote the most of his time on the stump to a fictitious difference on finance, that can never have any ex istence in reality. A vast and consist ent majority of the people of the United States, under Democratic banners, said Gov. Lawler, cherish and support the idea of a sound currency, in which the dollar of paper, silver or gold shall stand equal in the markets of the world. In caiiatic language that aroused the enthusiastic plaudits of the audience. Democracy's intrepid champion referred to the fact that the only fault the Re publicans had thus far laid at his door was that he was a young man. That he could not help, "but it was a fault that could certarnly be remedied if he lived long enough. Mr. Lawler again set his hearers wild by the assertion" that when he is elected he will never be found Pawning the Power of the executive office to further per sonal or party interest. lie would rather, he said. practice law all the days of His life and in the evenings remain at home to play with the babies than to ride into the governor's chair on the cowcatcher of any railroad in the state, of Minnesota. Promising to meet the people of every ward in Minneapolis before the campaign ends, in a fair and intelligent discussion of public questions. Minnesota's next governor, in the midst of a tremendous ovation, was carried away to address a vast . con course of people who could not get within hailing distance of the Exposition hall. At the conclu sion of Senator Mills' address, having returned to the hall, he was again vociforeusly called for, but could only bow his acknowledgements, being too hoarse to be heard ten feet from the platform. It was a great night for Lawler, an auspicious augury tor Democracy in the state and nation", and an audible, demonstrative indication ot a victory tnat will revolutionize Minne sota politics and parties. MINNEAPOLIS ALL RIGHT. The City Apparently Pretty Unan imously Democratic. ..or The mammoth mass meeting at the Exposition building to greet Lawler, Mills, George and Ewing was sufficient to show that Minneapolis is all riahtfor the whole Democratic ticKet. But Min neapolis pride and indignation had been aroused by the slurs cast upon the city's loyalty to Lawier. As a further proof of the falsity of those stories COCO men turned out in parade to show that Min neapolis is. figuratively and literally, * "in line" for Lawler "and the whole ticket. The Parade Was a Dandy. As soon as darkness had fallen over the city shafts of light shot skyward from thousands of torches, bands" filled the air with music, and the earth trem bled under the tread of thousands of marching feet. From every direction they came in converging lines. Marshal Louis K. Hull at the head of his corps of aides, commanded •by J. 11. Waters, was on hand in front of the New York Life building shortly after 7 o'clock. From the hour of 7:30 they were all busy marshalling the divisions. A Dart of the clubs formed on Second avenue south and others on First avenue north. Promptly at 8 a platoon of mounted police started from Second avenue up Fifth street toward the West hotel. Behind rode Marshal Louis K. Hull and his aides. Next came Thyle & Schubert's band of fifty pieces and then the Tenth ward club. There was a body of men to convince any one that the Tenth ward is all right for Democracy. Next came the Ilaynes and Jennings club of the Third ward, one of the biggest clubs in line. Maj. John Land berg walked proudly at the head of the Eighth ward club. This organization bore an eagle with extended pinions and a live rooster, who looked proudly confident. "Didn't know the Eighth ward held so many Democrats," said a bystander. "Wait until November and we'll show Grimes where we stand," an swered a marcher. "If you elect Eustis, Torn Lo wry will be mayor," was the motto the Twelfth ward men carried. The Fifth ward Winston club was there several hundred strong. . "Watch the Seventh Ward" was the admonition, by transparency, the Sev enth ward Gleason club bore. Aid. Woodward saw it and wept in silence. The Eleventh Ward Cleveland club came next, followed, by the St. Paul clubs. "Lawler and Castle" were the names on many of the St. Paul trans parencies. Minneapolis Democrats lustily cheered Doth names, remember ing how glad they were to vote tor J. N. Castle two years ago. Other clubs fell into line at the West hotel corner and the line moved up Hennepin to Tenth street, across to Nicollet,- down Nicollet and over the river to the Exposition building. Every club in the city was there and every ward was represented. The young men from the state university, under whose auspices the meeting was held, rent the air with their "ski-u-mah" yell and di vided with the Ihird ward Tammany the honor of escorting the carriages. The Tammany men . made a fine " ap pearance, it being their first bow to the public, in long coats and white plug hats. They proudly bore the picture of the tiger and, on a high platform, a real tiger. All along the route the sidewalks were thronged. The cheers of the marchers were answered by a chorus of shouts from the spectators. It was a notice able feature of the parade that clubs flayed no favorites in the "matfor-of" andidates. There was .nO " star ring. The transparencies and ban nera borne showed that the Dem ocrats are working for the whole ticket. The names of Grover Cleveland and Daniel W. Lawler, as the heads of national and state tickets, were, everywhere coupled, and everywhere they were received with wild cheering. It was a parade of men, that of last nignt, Intelligent-loosing young men. The small boy, who is usually a large part of a political Daracle, was wanting. Every man in line will cast a vote, and they are the sort of men who vote intel ligently and leach others how to vote intelligently. It was the grandest political demon stration ever seen in Minneapolis. THE GKKAT MtiETIXG. Biggest Crowd Ever Brought To gether in Minneapolis. The meeting at Exposition hall was called to order by W. A. Mathwictr, president of the University Democratic club. In a neatly turned speech he in troduced Mayor P. B. Winston as the chairman of the evening. The mayor was greeted by a lound of applause as he interposed his portly form before the sea of upturned faces and remarked that it was his felicity to introduce three of the greatestest apostles of tariff re form in the country— Roger Q. Mills, Dan W. Lawler and Henry George. These men, the mayor said, were known to all. Their principles hart long been exemplified, and in their ex emplification could be seen the honor of the Democratic party and prosperity of the country. Wi ben Mr. Lawler was in troduced the audience gave vent to its enthusiasm as a unit. The applause was terrific in its fervor, and that, too. in spite of the fact that everybody had been prodigal with vocal demonstra tions, expressive of appreciation of the Cecillan quartette's efforts ptevious to the speech-making. The second speaker to face the audi ence was Harry Hawkins, candidate for lieutenant governor. His remarks were few, but apropos, and made a hit. He said : "If you in counting your votes do as as well as they will do in the rural dis tricts, you will find when the smoke of the battle is brushed away that the state will have been taken from the columns of the Republican party and turned over to Grover Cleveland. By doing so, you will elect that kid. that bud, Daniel W. Lawler, anil all the other kids and buds, including James W. .Lawrence." Gen. W. (i. Ewing, of Chicago, a staunch Democrat and United States district attorney under Cleveland, fol lowed Mr. Hawkins. During his dis course, the general said: "1 have often been toid that Mr. Law ler would be the next governor'of your state, and I believed it. 1 believed it so much that 1 am already calling him governor, and you will have to do so yourself pretty soon. He will, I am sure, lead your hosts to victory. The Democratic party in this state will win. lam sure. Ido not see how it can fail to do so, when it is considered that the difference between the Democratic anrt Republican parties is taxation. This difference is what has raised the Demo cratic party to take the part of the laboring man. who is more directly in terested. In this country of triumph and liberty it certainly is not right that the country should be taxed for indi viduals or combination Of individuals. Our Republican friends urge this protection for the benefit of ' our industries. Ah, well! They have been protecting these industries, these infant industries, until we want a change. It tne protective tariff is to help American labor, I am in favor ot it. 1 am in favor of the laboring man, for I have had ex perience in shops and other places. But how are you going to help Ameri can labor by taxing ft? By taxing it? Our Republican friends >eem to think there is something magical and mysterious in this taxation, and say all that is good has come of taxation. They say they believe this, but 1 don't believe they do. The laboring man is growing tired ot the burden and wants to throw it off. We all know the pros perity of this country is not due to the protective tariff, but because of the grand climate, the grand world and the grand goodness of the Alniitrhty God. who has spread His dews over the land and distributed His infinite goodness over crops, woodland and waters. There appeared to be something mysterious in the tariff, according to the Republican belief, said Gen. Ewing. Then he proceeded to show how fallaci ous these beliefs were and what a "magnificent" falsehood the protective tariff tax'was. He was sarcastic in his reference to the childish arguments ad vanced by the Republican speakers and demonstrated in a humorous manner how he had "found out" Julius Caisar Burrows in his triumphal march of tariff speechmaking in the East. In enumerating the many absurd things placed in the tariff list by the Republic ans, he said: "You find zebras there. Now what on earth good is a zebra to us? The only use he could be put to would be to gather every one in the world together in the center of the Republican party and let them kick it to death." This sally brought down the house, and when Gen. Ewing took his seat he was accorded a generous ovation. At this juncture of ihe meeting several thousand hel meted torch-bearers en tered the hall and crowded so close to the stage that it was impossible to pro ceed on account of the confusion. When quiet was restored Henry George was introduced. It was fully five min utes before the applause ceased and Mr. George could make himself heard. His speech was short, but to the point. He said: "This is the first Democratic meeting I have seen from the stage for many years, and it is a pretty £ood one. lam not a Democrat in the- party sense'— l am not a party man. I care nothing fof the tickets, iam here to tell you briefly' why I propose to vote with "the Demo cratic party. There is more than brass bands and shouting iv this election of ours. All over the nation there is a solemn question pressing. Go anywhere and everywhere and you will find pov erty and want. You will find men who want work, are ready to work, but can not get it. Why is this condition? Not that capital oppresses labor, but that mouopolj oppresses labor. Go into any city of our country and you will see wealth in piles and yet be accosted by the beggar. What, then, is the country prosperous in? I am for Grover Cleveland because, to my mind, he has opened the next great battle. I am for the Democratic partv because, led by its better element, the element in the last session headed by Senator Mills, it has denounced protect ive tariff as a fraud. It has declared It will have no tariff but a tariff for reve nue only. lam not a tariff man ; lam a free trader. In this election Grover Cleveland and the Democratic party stand for opposition to that demoralizing system upheld by the Republican party. They both stand for tne hist step to free, trade. I was a protectiynist until l heard a protectionist speech, i hope every protectionist who goes around speaking for the tariff will make votes for free trade, "H<pW cad this system of protectiojj bring prosperity to our country? What does protection do for national pros periiy? It forms a cordon about the Country and' keeps out everything we want. How can protection protect labor? All that Ja^or wants is freedom. Th^re is something higher still. As Grover Cleveland said, this question is not only a question of markets, but %| vfl^J r^°^** £^? Sir Knight Wheelock===Gadzooks ! Won't anybody give us a lift ? [This accurate sketch of a modern instance is a reminder of the grod old days of the fourteenth century, when the weieht of armor was so great that a fallen knight could not arise unassisted.] • morals. What is the prevailing senti ment of all protection meetings and speeches? To do injury to others. To keep the poor of other countries from enjoying life. "My first vote was for Abraham Lin coln, against that form tof protection which rendered slavery a blot upon our fair country. lam now against that form of protection which has for its purpose the making of slaves of the Laboring man!" When Henry George took his seat everybody knew what was coming, and who the next speaker was to be. The name of Roger Q. Mills was shouted from all parts of the hall, and echoed and re-echoed from the packed gal leries. It was "Mills, Mills," on every 'tongue, and when Mayor Winston arose and struck the table with his j 'gavel the audience anticipated his remarks and shouted "Mills, Mills!" When through the terrible din and shouting the doughty Democrat from Texas managed to make himself heard, Ihe deepest of quiet reigned. He was in bad form, having a severe cold and a hoarseness of speech from the strain of speaking every nk'hi and in all kinds of halls throughout the state. During his brief but excellent discourse, Senator | -Mills said: THE GREAT ADDRESS. Roxer Q. Mills Speaks to a Vast Audience. We are nearing the er.d of a great campaign, one whose result is to leave its impress for good or evil upon our j common country. When the sun sets on the Bth day of November next the American people will have decided whom they shall have chosen to be the chief magistrate of the nation, and whom they shall have chosen to be their representatives in the congress of the United States. In the selection of their public servants, they must necessarily determine the policies upon which the I government is to be administered in the future. The great issue joined between the two parties, and upon which the people of the United Stales are divided, is in reference to the proper exercise of the taxing power conferred by the constitu tion of the United States upon its con gress. The Democratic party today, as it has ever been, is a party of strict con struction. It demands that every grant of power conferred by itself upon its public servants shall be strictiy con strued in the interest of liberty. It therefore contends that this power to levy and collect duties is a power de signed by the grantors to raise revenue to support an honest, efficient ami economical administration of pub lic affairs, and for nothing else. [Ap plauv.] It contends that in the impo- j sitiori of these duties they shall be so laid, and upon such articles,as will pro duce the required revenue with the least possible burden to the taxpayer, and the least possible disturbance of the private business of the people. Our Republican friends, on the other hand, demand a latitudinous construction of j the constitution, not only in this grant, but in every other. We believe in local self-government and individual liberty. [Applause.] They believe in a Vast Concentrated Power in the general government;. They be iieve that this power should so be exer cised by coneress as to prevent thtTiin portatlou of foreign goods into the United States; to restrict, as far as pos sible, and in many cases to prohibit it entirely, in order, as they claim, to pro tect American workmen against compe tition with foreign pauper labor; in jbrder, as they claim, to build up Amer ican industries by fostering and en jpouragTns the domestic production of Jhe article kept out by the high rate of duty. They claim that by keeping out these foreign goods and giving encour agement to the production of tike tcoods in this country by American labor by increasing the price of the domestic production and thus encouraging its development, that they Will naturalize these industries in this 'country and make the American people independent, self-sustaining, and free from any possible contact with any other people on the globe. [Applause.] They say that they want to build up a home market. They promised that if .live would give them this protective policy, they would soon bring the pro dncer and the consumer side by slue; that they would bring manufactures into this country, and manufacturing laborers sufficient to consume all the agricultural product that is made by the agricultural labor of the country, and that after a short time you would see a blast furnace and a woolen mill by the side of every wheat held, turnip patch and pig-pen'in the laud. [Applause.] Now, my friends, vve have had this policy for, Io! these thirty years. We have had protection, and in the latter part of that period Protection Run Had. We have got the highest protective duties today that auy country on ihe globe has ever submitted t,o. Where, is that home inarkej? We are today ship ing out Of this* country 3 thousand mijb ion of dollar jof the surplus product or American labor, lud all these piomises have turned to a^hel oil our- lips.- plause.] We are shipping 70 per cent ©f all trie doiton that is grown in this country. Only 80 per cent finds a home market, while the peo THE PITIABLE PLIGHT OF THE HORNING DEFENDER. pie have been taxed to death for thirty years to enable our Republican '•friends to redeem that promise. [Ap | plause.j If it cannot be redeemed in thirty years, is it not presumptive evi dence, at least, that it can never be re deemed. [Applause.] And, my friends, instead of the country becoming self sustaining, instead of becoming inde pendent of all other countries, instead of bringing the producer and the con sumer and setting them side by side and our country being independent and cut off from all other countries in the world, I our commerce with foreign countries j continues to grow, while the infant mi i udstry continues to grow weaker. [Ap- plausejlt was con ten led in the beginning of ourgovernment,by theold fathers who adopted this policy in the infancy not j only of the government but the infancy of manufactures, that while it was a j burden upon the taxpayers, yet it was one necessary to be borne in the then condition of the country. They claimed it was a poiicy infantile in its nature, and temporary. Tliev were in favor 01 adopting that burden" in order that that might hasten the adoption and the de velopment ot a policy that would give I us munitions of war, clothing and sucli I things as we would need in a foreign contest with one of the great armed powers of Europe. It was supposed, when Una policy was adopted, that in a few years, with the encourage ment of a small amount of protection, that American manufacturers would be able to stand alone; hence, the leaders of the Republican party, up to fifteen and twenty years ago. declared, in ac j cordance with the old doctrines of the fathers of protection, that they were in favor of a Protection That Lead to Free Trade. Mr. Garfieldso proclaimed. You may take all the illustrious chiefs of the Re publican party and you will find them on record for a moderate protection that ; would enable the infant after awhile to come to years of maturity and stand alone against the world. [Applause.] But the McKinley bill is a new de parture in this country. It propounds a new policy for the American people. It declares that the doctrine of protection is permanent in this country, and that the highest rate of taxation is thowisest policy for the people to submit to. What has protection done for our manufacturers? Have the years that we have given them protection enabled them to stand alone? Have they grown stronger and stronger with the encour agement we have given them, or weak er and weaker? In the beginning of the government the protective duty was from 5 to 10 per cent, imposed at the suggestion of Alexander Ham ilton, the father of protection. After they had had that for a number of years they wanted 15 and 20 and got it. Then they wanted 25 and 30. It has gone on up to a hundred, in some cases to 300 per cent, and a few years ago a bill was reported to the house ot representa tives proposing a duty on pearl buttons of 1,400 per cent. [Laughter and ap plause.] Well, my friends, Tills Infant Gets Weaker and weaker. We had better take the bottle away from its mouth before it kills it. [daughter and applause.] Protection, instead of aiding the infant to stand alone, is ma - ing him worse and worse. It is like Col. Seller's eye salve, if you remember the play, in the "GildedAee." There was a very hope fui, sanguine fellow who was always just on the point of malting 81,000,000 He was always assuring his friends that there were millions in every pro ject which lie proposed; all, however, had failed, until he fell upon eye salve,' and meeting his friend, he said": "Now I have got it, and I will tell you. Cy, that there is millions in this thing." "But," he says, "How are you going to make it?" r '\vhy." he says, "the ma- ! terial costs me SI a barrel; each barrel malfes 600 Doxes.afid I can sell each box for $1; that is $500 of profit on SI of in vestment." "But," he says, "where is your market for this : enormous amount of eye salve?" "Why," he says, "China,. Asia— 4oo,ooo,ooo of peo ple in Asia— each one lias two eyes, both eyes sore." [Applause and laughter.} •How he say's, ' Cy. the b£st part of all this thing is that the more oKiny eye salve they take, the more they want. ' [Applause" and lauetiter.] And that is the way of tpfs protective tariff; it is more eye sy^Ve all the lime. And : the people haW. submitted to it up to this good day, too, now it is boldly pro claimed ttiafthis infant will die unless we continue to impose an increased heavy taxation to enable it to live in this country. (Applause.! ''iHSS^SSfS Now, my friends, let us examine the arguments in favor of it a little while. It is contended that we must place duties on foreigti goods coining to" this country so high as to e.he.ck their im portation—to prevent them from coin ing. What effect will that have oh this country ? What effect will that have on tljekj&f and the products of the labor of this Country? Every dollar of prod uct that H checked. Impeded and hin dered froi}i coming 'to this . country checks il dollars worth of the surplus product of Auiefrcan labor frSm going away from this country. [Applause.] syery "req^!re"B~at least two or more persons to make it. No one man can make a '- .'... \ . "■,. .-. Trade With Himself /. 1 —at least no Democrat can do it; maybe r some of these Republican friends can 1 do that sort of business. [Laughter and - applause.] No trade can be made that 1 does not require two things to be ex ■ changed in making the trade. If your • government comes in and intervenes and prevents one part of the trade from • being performed, that very proposition • prevents the other part of the trade . from being performed. Suppose there ■ are two citizens here, and one should 1 have a surplus horse: he is raising ! horses, and has got one more than he , wants; he proposes to exchange it for i cows with a man who is raising cows • and who has more than he wants,but who ■" wants a horse. Suppose thej meet and ; agree, "I will give you my horse for so 1 many of your cows," and the other says, , "I will eive you the number of cows for your horse." the trade is agreed to. both l parties are satisfied, both parties are ; benefited. But the government comes 1 in and says, "I have no objection at all to the man who has the horse parting 1 with him, selling him to anybody, but : he shall not take in exchange the cows ! that the other party to the exchange proposes to give." Now I want to know lif that trade is not broken up. I want to know if the surplus of the man who has the horse is hot thrown back on him. Then, when you stop the importation of manufactured goods from Europe coming here to be exchanged for your breadstuffs— and many of you are producers of breadstuffs, or the rep resentatives of men who are— when they saj you shall not take the manu factures of Germany, of England, of France, you shall not take the steel rails of Belirium. you shall not take the woolen goods of the Netherlands, you shall not take anything coming from a foreign country that can be purchased in this country, what does it Say to the Wheat Grower) It says : "You shall not send out of this country your surplus wheat." That is what it says. What is "surplus?" It is that amount of every one's product over and above that which his own wants require. And when every mouth is fed in this land, when every one of 65,000,000 of people have been satisfied from the breadstuffs produced in this country, then we have left a laige amount of surplus to be disposed ot" to otiier people for value. Our government comes in and says: "You shall not take what the foreigner has to give you." Your surplus must be thrown on the home market, where it increases the supply. The home market is already glutted, and the price of your product falls to the ground. Where is your wheat to day? Certainly not where it was in the old days when your trade was unob structed. Look back to the returns from 1850 to 1800; look back to the last year of free and unobstructed trade — commerce upon which alone no revenue duties were imposed but to iaise reve nue to support an honest eovernment— and you see your wheat was worth over 81.50 per bushel. What is it today? About one-third of that, or a little more. But our friends say— our Republican statesmen — that we must still cling to the idea of the home market. In a report it made to" the senate three years ago. reporting a bill substantially the McKinley bill, or the McKinley law of today, the senate commute on finance said that "We cannot depend on selling ourwheat in foreign markets in com petition with the pauper labor of Eu rope." They say that the only way that we can find a market to consume our wheat is to levy high duties on manu factures and induce an unagricultural population to come to this 'country to consume our wheat— a population to be brought to the country out of a Lore for High Taxation. Well now, let us try that, my friends, and see how it will work. We raised last year 613X00,000 bushels of wheat. The statistician of the agricultural de partment, himself a Republican and a protectionist, says that four and two thirds bushels ol wheat is the average consumption of the people of the United States per head. Let us put it at five, and multiply the 05,000,000 by five, and it gives 325,000,000 bushels of wheat necessary to satisfy the wants of all our people, 'fhat leaves a surplus of 288,000,000 bilshels. What is to be- ! come of it? Why, that com mittee gays that we must import an unagricultural population into the United States sufficient to consume this enormous product. How many peo gle will it take? And you have got to .ring them in one year, because the surplus is all here. They have promised to give you a home market for your sur plus. Five into 285 goes fifty-seven times. Fifty-seven millions of people have to be imported into this country by the influence of a protective tariff, in one year, to eat up the surplus wheat crops. [Applause and laughter.] The McKinley law was passed; it has been in force two years. Where are the 57, --000,000 of people? This is one pf the strongest and most soph istical arguments or the leaders of the protective policy. It is for the Ijoflie market! It is to make ourselves independent of ali other peo ple! The law has been passed, the high duties have been imposed. Wh*»re are the fi^ty-seven millions of people that were to come here to consume our prod ucts? The people are bearing the taxes, but the Wheat Is Going: Away from us; the population is not coming "to this" country to consume it, but the NO. 297. surplus breadstuffs are going, in accord anca with the laws of God and nature, and the laws which are sustained by the Democratic party -going to foreign countries to find consumers. [Applause.] But, my friends, let us suppose that it ' was possible to bring that 57,000,000 of. . people here. 1 want to pursue this ab surdity a little. What would they do to make money to buy the breadstuffs of the people of the United States? There would be no home market at all if you had to give them the wheat. They have got to have profitable employment to enable them to make the money to buy the wheat. They have got to have work. These, remember, are not farm ers. They weie adroit enough to say in their report that these men had to be non-agriculturists, because, if farmers are going to come, they will raise more wheat, and we will have a larger surplus. [Great applause and laughter.] Now then, we find by our census reports that oue-third of our population, about, aro engaged in gainful occupations, and one-third of these that come will be en gaged in gainful occupations. About nineteen mijlious of these people will be engaged in other than agricultural pursuits. One-third of that class of population in the United States are en gaged iv manufacturing. Jff9 will say that one-third of this great migration, will be engaged in tfuwnifactnring. Then there will be six million three hundred and thirty-three thousand per sons engaged in manufactures, of this vast importation of people. Four mill ions of operatives turned out in 1890 a produce valued at eight billion, seven hundred millions of dollars. If four millions turn out eight billion ■ seven hundred million, how much will six million three hundred thirty-three thousand turn out? Between twelve and thirteen billions of product. Where is to be the market for it ? Why, they Consume tlic Same Proportion of their products that we do of ours. We consume about $134 per head, of manufactured products made in the United States. Say they will consume $134 worth of theirs. That will give them somewhere about seven billions of consumption of their own products, leaving as a surplus five billions to find a market somewhere. Where is It go ing ? It cannot go out into the world, because the duty on raw materials keeps our products from for eign markets, keeps us away from com petition with foreigners, compels us to stay and chase the ignis fatuus of a home market. It will compel them to sell, too, in the home market; they cannot go out of it. Then, what are yon to do? If these people cannot sejl their surplus they cannot buy our wheat. Surplus makes the wealth of a people. It is not what they consume; that keeps them alive, but it is thejr surplus that becomes the accumulated wealth of the country. Now, how are they going to dispose of this five millions? Why, according to the principle adopted by these protectionists statesmen, they have got to go then and import about 50,000,000 of fanners to eat or consume the surplus manufactures. [Applause.] And then, when the farmers cpme in, they make another surplus of two hun dred and fifty or sixty million of wheat, and then you will have to import some more non-agriculturists to eat that up, and you have got to swap from one to the other, until eventually iri a few years we will have the entire popula tion of the globe, fourteen hundred millions of people, in this country. [Ap plause.] Tliere will be the Chinese and the Japanese and chimpanzees, ahunll tne rest of them from all over tiie world Crowded Into Tlii.s Country to sustain the home market and vote the Republican ticket. [Great applause.] Now, gentlemen, you see how falla cious all that thing is. We have got to export. Instead of bringing people from all over the earth, away from their homes, confiscating their property (be cause they couldn't find any sale for it —it would have to be abandoned) in stead of pursuing the Republican policy of uprooting entire populations and winging them to the United States we would distribute the surplus products Df our wealth all around the globe, and bring back the surplus products of other people that we want in exchange for the surplus productsof our people that they want. [Applause.] How much do you suppose the farm ers of the United States lose by the. pol icy adopted by the present tariff law? In 1846 a revenue tariff law was passed. Kobert J. Walker, the then secretary of the treasury, and one of the greatest men that ever filled that office, when he prepared that celebrated bill whijch was sent down to congress and afterwards jecame a law, said in his official report hat when the bill was passed agricult^ jral products would rise in value all )ver the Union and manufactured prod ucts would fall. Why? Because the lormal condition which competi tion had established was broken jp by the high tariff law of 1842; nanufactured products were elevated v price, agricultural products were de nessed in price; and wnen the inter vention of the law was removed, the lornial condition would be restored by Tianufactured goods falling and agri-« uiltural products rising to restore the evel. It was A Perilous Prdeiction ! or a man to make if he did not know :xactly what he was talking about—be »" Continued on Stxtli l'nge. xml | txt
http://chroniclingamerica.loc.gov/lccn/sn90059522/1892-10-23/ed-1/seq-1/ocr/
CC-MAIN-2016-50
refinedweb
7,818
69.41
Details - Type: Bug - Status: Resolved - Priority: Blocker - Resolution: Fixed - Affects Version/s: 2.0-rc1 - - - Labels: - Environment:. Description Dynamically loading a JAR that uses log4j2 results in a memory leak when the JAR is unloaded. This can be observed by deploying a web application to tomcat7 and exercising the stop, undeploy, or redeploy actions. The memory leak is believed to be caused by log4j for the following reasons: 1)Heap Dump reveals the classloader instance responsible for the WAR plugin (of type org.apache.catalina.loader.WebappClassLoader) has 2 non weak/soft reference which are of type (org.apache.logging.log4j.core.LoggerContext$ShutdownThread) and (org.apache.logging.log4j.core.jmx.LoggerContextAdmin) after the WAR has been stopped or undeployed. 2)Using SLF4J (slf4j-api, jcl-over-slf4j) to logback-classic logging output is equivalent but all memory is gc as expected (the org.apache.catalina.loader.WebappClassLoader which loaded the WAR is no longer referenced by any hard references) 3)Using the SLF4J NOP logger implementation all memory is gc as expected (the org.apache.catalina.loader.WebappClassLoader which loaded the WAR is no longer referenced by any hard references) This may not be unique to 2.0rc-1 and I have seen similar behavior in previous 2.0 beta releases. This is reproducible with a very simple spring hello world application. Code and/or heap dumps can be provided upon request. Issue Links - is part of LOG4J2-578 JMX Memory Leak in Servlet Container - Resolved - relates to LOG4J2-577 Refactor LoggerContext initialization/destruction code - Closed Activity - All - Work Log - History - Activity - Transitions Well this is turning out to be a bit more complicated than I originally thought! Spawning off a shutdown hook thread in a web container is a bad idea due to problems like this, so I'm looking at alternative ways to shutdown in a web context. I see that we could use a ServletContextListener to shut down when the ServletContext is destroyed, but we'll need to make sure that's only done for the LoggerContext associated to that ServletContext so that if log4j is a server library, it doesn't shut down everyone. Seems like this could work. I think the JMX class that stays loaded is due to the shutdown thread staying behind which references the LoggerContext linked to the JMX class. Scratch that, I found the bug. This is a two-parter: - The shutdown hook is enabled by default. In a web context, this should be disabled using the shutdownHook="disabled" attribute in <Configuration/> (or equivalent in JSON or YAML). - This should be default behavior in a web context; otherwise, the shutdown hook thread will leak, and there doesn't seem to be any way to prevent that without doing server-specific cases (which is also a bad idea). I could add some logic to pre-disable the shutdown hook in o.a.l.l.c.LoggerContext that the web initialization code can use. I'll make a commit, and you can review that to see if it's too complicated to be worth it or not. I've updated the documentation to reflect this setting. I tried working in code that could prevent the shutdown hook from being used, but that turned out to not be feasible based on the current flow of execution. Removing a shutdown hook after it's been added in a web container doesn't appear to work, and said shutdown hook really won't be called until Tomcat (or similar) itself is shutdown. We already clean up using ServletContextListener. The best I can do here is possibly call thread.interrupt(), but I'm not sure if that's even a good idea. I haven't looked at the code, but would it be possible to detect if we're running in a web container before adding the shutdown hook and registering or not registering depending on that? I mean, if it is hard to do this cleanly, but it is important to do it, then we could use something ugly like setting a global flag in the web initialization logic... Not without a bit of refactoring. Right now, when you use the JNDI context selector, that gives you a location to override the hook before going to the Status.STARTING state. In the non-JNDI case, following the call chain leaves you in Log4jContextFactory.getContext(lots of params) where the LoggerContext is started. The only hook existing here would be in the ContextSelector itself, but that's still specified by configuration. Thank you for looking into this Matt. I had a feeling the solution to this issue may be constrained due to existing design and hooks w.r.t to servlet containers. It is unfortunate detection can not be done prior to adding the hook as Remko suggested. Are there usage statistics on log4j/log4j2 to know whether webapp/servlet deployment is a common enough use case to avoid a "no-fix" resolution? If the the proposed workaround (*see followup) does not work then I believe application developers are forced to use logback for this use-case (need to stop/redeploy/undeploy webapp). The difficult part for application developers is that the leak will likely go undetected until disaster strikes (PermGen exhausted), and may be difficult to diagnose for some developers in the webapp/servlet use-case. Given the current state of affairs it may be beneficial to reference the logback code base. They provide an accessor to the LoggerContext for which the stop method can be invoked () to explicitly cleanup. More importantly they have figured out a way to either not start certain aspects of the infrastructure or clean up without explicit configuration or even explicitly closing the LoggerContext as described in their documentation (see code attached which uses logback-classic but does not close LoggerContext). *Can you clarify the proposed workaround? Is the workaround to add an attribute to the "log4j2.xml" <Configuration> element which is 'shutdownHook="disable"'? Is there anything else that needs to be done as I am still seeing a memory leak but with 1 layer of referencing removed. To clarify an instance of "org.apache.logging.log4j.core.jmx.LoggerContextAdmin" classloader is now the only class which still has hard references that remain (to "org.apache.catalina.loader.WebappClassLoader") and is preventing GC from cleaning up resources. Also can you provide a link to the updated documentation? If not already modified/clarified the "Web Applications and JSPs" documentation () states that log4j should "just work" w.r.t to deploying and shutting down. Tomcat wasn't finding that other memory leak, so I'm not sure what to do about that. In regards to the no-fix, that's mainly because I'd like a separate issue raised for refactoring the initialization/destruction code to make this far more automatic. The current problem is the different code paths for JNDI versus an arbitrary ContextSelector. This actually relates a bit to how I'd like to see things get more modular to allow for more use case scenarios to be properly supported (e.g., OSGi, other container/module frameworks, Jigsaw in Java 9, etc). I've added a "big red" warning to the webapp.html documentation page that indicates you need to set shutdownHook="disable" to <Configuration/> (so yes, exactly as you said). I'm not familiar with the JMX code, so that might need to be looked at by someone else. In fact, I'll create a new issue for this because it's a separate but related issue. When you say: "Tomact wasn't finding that other memory leak" do you mean the "Find Leaks" feature provided by tomcat ( )? For my test case this feature was detecting there was a leak (I can provide heap dumps if necessary, are there any notable differences in our environments). This tomcat feature is nice but I'm not sure if tomcat detecting the leak or not is relevant (tomcat's memory leak detection functionality may not be guaranteed to detect all leaks). If you are just looking for ways to detect or inspect the memory leak I can suggest alternatives. It sounds like you have 1 case covered with the <Configuration> node modification, but I'm not confident this covers the whole issue. Could we leave this issue open and/or re-assign (to log4j2 JMX SME) if the new restructuring issue you are suggesting is not designed to capture/resolve this entire issue? Creating a separate issue for restructuring is fine as long as we link (in jira, and in description) the two issues together in such a way that the new issue must address the leak in the process of restructuring. Here's a link to the refactoring. The JMX memory leak sounds like a separate issue. I suppose you could either edit this one or create a new one for that. Any advice on detecting the JMX leak might be helpful. I've got YourKit Java Profiler to use, but if you know of a better tool for finding leaks, I'm open to suggestions. As to the Tomcat thing, I should probably specify my environment, too. Server version: Apache Tomcat/7.0.52 Server built: Feb 13 2014 10:24:25 Server number: 7.0.52.0 OS Name: Mac OS X OS Version: 10.8.5 Architecture: x86_64 JVM Version: 1.8.0-b132 JVM Vendor: Oracle Corporation I have minimal experience with YourKit (no license), and slightly more with Visual VM. Below are some instructions on how to detect if there is a memory leak. My experience with these profiler tools is that it more difficult to actually trace the cause of the memory leak. This is where Eclipse Memory Analyzer ( ) really shines (see other set of instructions below). Regardless if you like eclipse or not the filtering, searching, and object relationships (particularly to GC roots) provided by this plugin are very helpful. Profiler instructions (visual VM and should work for YourKit): 1) Load the test webapp into your servlet container (tomcat). 2) Find your servlet container in your favorite profiler. 3) Take a heap dump. 4) In the heap dump look for all instances of class "org.apache.catalina.loader.WebappClassLoader". There should be 1 instance of this class for each webapp that is loaded (started in tomcat's case). Inspect the "contextName" of each (assuming there is more than 1) instance until it matches your test application name. 5) Stop your test webapp. 6) Take a heap dump. 7) There should now be 1 less instance of class "org.apache.catalina.loader.WebappClassLoader". I am claiming there is not 1 less and this is the memory leak. 8) This is the step where YourKit and Visual VM where not so helpful...You want to find all non-weak/non-soft references from this object to all GC roots. For example Visual VM in the Out References you can right click "this" and "Show Nearest GC Root" but this does not yield very much context (often givens something general like a Task Thread). If you have a way to do this with Your Kit or another profiler tool please let me know. Eclipse Memory Analyzer (Eclipse Kepler) Instructions: 1) Take a heap dump (File->New->Other->Other->Heap Dump) 2) Select your application (Description=org.apache.catalina.startup.Boostrap start). 3) Select anything but "Re-open previously run reports" (i.e. "Leak Suspects Report") 4) Click the "Open Dominator Tree for entire heap" (third button from left in heap report) 5) Search for "org.apache.catalina.loader.WebappClassLoader" 6) Inspect each instance to find the instance which references your web application (look at strings to find paths to your JARs) 7) Trace this instance back to GC roots (Right click->Path to GC Roots->exclude weak/soft references). 8) In this case you should see an instance of class "org.apache.logging.log4j.core.jmx.LoggerContextAdmin" which is holding on to a reference. It is always an option to create an OQL query (with javascript if supported) to answer the same question (find all gc roots exclude soft/weak references) the Eclipse Memory Analyzer can provide with a few button clicks. If you do go this route feel free to post your query here. Here are some references if you are interested: I tried running tomcat under java 8 JVM and the problem still persists. I don't have a Mac OS X machine handy but I don't think it is likely that would make a difference. Tomcat Version: Apache Tomcat/7.0.52 JVM Version: 1.8.0-b132 JVM Vendor: Oracle Corporation OS Name: Linux OS Version: 3.2.0-58-generic OS Architecture: amd64 Let me know how you want to proceed. I know you have suggested opening another issue for the JMX memory leak but I will wait in-case you are still doing more analysis with the updated debugging instructions provided. If JMX is not needed for Log4j2 then a workaround is to disable it. I have verified that disabling JMX in combination with your proposed additional attribute to the log4j2.xml <Configuration shutdownHook="disable"> ... </Configuration> mitigates the memory issue for this use-case. In regard to the logback version, you can already do the same thing: import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LoggerContext; // ... LoggerContext ctx = (LoggerContext) LogManager.getContext(); ctx.stop(); It's actually amusing how similar that is. If you use log4j in a servlet context, there's a ServletContextListener that starts and stops the LoggerContext on init and destroy respectively for the ServletContext. The memory leak was caused due to an additional shutdown hook thread being spawned that won't be called until Tomcat (or whatever server) calls System.exit() (clearly doesn't happen when an application is undeployed). Now if the shutdown hook is preventing the LoggerContext from being cleaned up, I think that could be fixed by using a weak reference in the shutdown thread so that it doesn't prevent clean up. I'm not so sure about the LoggerContextAdmin class. I'll take a look to see if I can find anything obvious, but I'm not experienced with the JMX standard. Sounds promising. Can you explain why 2 shutdown hooks are needed? Is there some way tomcat (or servlet containers in general) can be shutdown where the ServletContextListener contextDestroyed is not called for each listener, but the Tomcat System.exit() event causes the additional shutdown hook to be called? In the simple use cases (stopping/unloading/redeploying, using the tomcat shutdown scripts, and even killing the Tomcat application from Visual VM) the contextDestroyed methods are called (verified via log4j2 log file output). Using a weak reference will likely help for this use-case, but is there a potential this will break other use-cases that are relying on a non-weak pointer? I created another issue for the JMX memory leak ( LOG4J2-578) as per your earlier suggestion. The runtime shutdown hook is just for non-container contexts. I think it would be better to use a more generic start/stop interface for dealing with LoggerContext objects. Selection of the proper context is already implemented through the ContextSelector interface. Initialization and destruction logic is handled in LoggerContext, but the hooks to start and stop them could be handled better. In the servlet context, there is no reason for the shutdown hook to be enabled. Due to the difficulty in overriding that shutdown hook in the current code is why I suggested we refactor that to be more generic to support more contexts. If I understand the above correctly, the shutdown hook is registered before log4j becomes aware that it is running in a web container. If that is the case, how about creating a new a method that unregisters the shutdown hook, and call this method as soon as log4j knows it is running in a web container? I tried that, but I didn't have any luck. Despite removing the shutdown hook, it would still leak the thread for some reason. Might be worth looking into more if I just did it wrong or something. Is there any new developments related to this issue? Were you able to find a more generic way to clean up the shutdown hook and resources dedicated to it (i.e. associated threads)? You mentioned the use of weak pointers...did that help at all? I tried using SoftReference, WeakReference, and PhantomReference (all with explicit use of enqueue() to mark for garbage collection), but the leak still remained. For some reason, there doesn't seem to be a way to unregister a shutdown hook thread in Tomcat. Thanks for the effort you've invested thus far and its unfortunate this issue seems to be a difficult one. What is the next step? The LOG4J2-577 task that was designed to make this issue easier to resolve seems like a longer term project. What release is this task target toward? I fear that with this issue being marked as "RESOLVED" the issue may lose visibility and fall through the cracks. What is your feeling on the issue? Reopened. (We haven't found a solution yet, but that's not a good reason to close the issue.) I began working on the initialization refactoring yesterday. Figuring out an appropriate way to use a sort of LoggerContext start-up strategy is where I'm at. I've got a branch in svn for that, too. In r1592429, I've added a check for the presence of a class from log4j-web. If the class is present, the shutdown hook is not used. This should solve the shutdown hook memory leak. Rather than check for a class I would prefer that we look for a property that can be found by PropertyUtil. The web module should have the appropriate file defined in it so the property is always defined when the jar is present. Wait so like a system property? Or we could even use a service via the META-INF/services/ thing. I am in front of my computer now so I can look at code. PropertiesUtil looks for a resource named "log4j2.component.properties". We need to extend that so it can find multiple instances and concatenate them. Then when you look up a property it can either come from that property file or a system property. So if the web module has a property file named log4j2.component.properties with the property in it we will know Log4j is running in a servlet container. This is much better than relying on a class that someone might decide to rename. This is the code (see README) which demonstrates memory leak. The hprof which demonstrates the before/after memory leak state is too big (>10MB). This can be provided upon request.
https://issues.apache.org/jira/browse/LOG4J2-570
CC-MAIN-2017-39
refinedweb
3,147
55.44
Spring Assert Statements Last modified: August 6, 2020 1. Overview In this tutorial, we’ll focus on and describe the purpose of the Spring Assert class and demonstrate how to use it. 2. Purpose of the Assert Class The Spring Assert class helps us validate arguments. By using methods of the Assert class, we can write assumptions which we expect to be true. And if they aren't met, a runtime exception is thrown. Each Assert’s method can be compared with the Java assert statement. Java assert statement throws an Error at runtime if its condition fails. The interesting fact is that those assertions can be disabled. Here are some characteristics of the Spring Assert’s methods: - Assert’s methods are static - They throw either IllegalArgumentException or IllegalStateException - The first parameter is usually an argument for validation or a logical condition to check - The last parameter is usually an exception message which is displayed if the validation fails - The message can be passed either as a String parameter or as a Supplier<String> parameter Also note that despite the similar name, Spring assertions have nothing in common with the assertions of JUnit and other testing frameworks. Spring assertions aren't for testing, but for debugging. 3. Example of Use Let’s define a Car class with a public method drive(): public class Car { private String state = "stop"; public void drive(int speed) { Assert.isTrue(speed > 0, "speed must be positive"); this.state = "drive"; // ... } } We can see how speed must be a positive number. The above row is a short way to check the condition and throw an exception if the condition fails: if (!(speed > 0)) { throw new IllegalArgumentException("speed must be positive"); } Each Assert’s public method contains roughly this code – a conditional block with a runtime exception from which the application is not expected to recover. If we try to call the drive() method with a negative argument, an IllegalArgumentException exception will be thrown: Exception in thread "main" java.lang.IllegalArgumentException: speed must be positive 4. Logical Assertions 4.1. isTrue() This assertion was discussed above. It accepts a boolean condition and throws an IllegalArgumentException when the condition is false. 4.2. state() The state() method has the same signature as isTrue() but throws the IllegalStateException. As the name suggests, it should be used when the method mustn’t be continued because of an illegal state of the object. Imagine that we can’t call the fuel() method if the car is running. Let's use the state() assertion in this case: public void fuel() { Assert.state(this.state.equals("stop"), "car must be stopped"); // ... } Of course, we can validate everything using logical assertions. But for better readability, we can use additional assertions which make our code more expressive. 5. Object and Type Assertions 5.1. notNull() We can assume that an object is not null by using the notNull() method: public void сhangeOil(String oil) { Assert.notNull(oil, "oil mustn't be null"); // ... } 5.2. isNull() On the other hand, we can check if an object is null using the isNull() method: public void replaceBattery(CarBattery carBattery) { Assert.isNull( carBattery.getCharge(), "to replace battery the charge must be null"); // ... } 5.3. isInstanceOf() To check if an object is an instance of another object of the specific type we can use the isInstanceOf() method: public void сhangeEngine(Engine engine) { Assert.isInstanceOf(ToyotaEngine.class, engine); // ... } In our example, the check passes successfully as ToyotaEngine is a subclass of Engine. 5.4. isAssignable() To check types, we can use Assert.isAssignable(): public void repairEngine(Engine engine) { Assert.isAssignable(Engine.class, ToyotaEngine.class); // ... } Two recent assertions represent an is-a relationship. 6. Text Assertions Text assertions are used to perform checks on String arguments. 6.1. hasLength() We can check if a String isn't blank, meaning it contains at least one whitespace, by using the hasLength() method: public void startWithHasLength(String key) { Assert.hasLength(key, "key must not be null and must not the empty"); // ... } 6.2. hasText() We can strengthen the condition and check if a String contains at least one non-whitespace character, by using the hasText() method: public void startWithHasText(String key) { Assert.hasText( key, "key must not be null and must contain at least one non-whitespace character"); // ... } 6.3. doesNotContain() We can determine if a String argument doesn’t contain a specific substring by using the doesNotContain() method: public void startWithNotContain(String key) { Assert.doesNotContain(key, "123", "key mustn't contain 123"); // ... } 7. Collection and Map Assertions 7.1. notEmpty() for Collections As the name says, the notEmpty() method asserts that a collection is not empty meaning that it’s not null and contains at least one element: public void repair(Collection<String> repairParts) { Assert.notEmpty( repairParts, "collection of repairParts mustn't be empty"); // ... } 7.2. notEmpty() for Maps The same method is overloaded for maps, and we can check if a map is not empty and contains at least one entry: public void repair(Map<String, String> repairParts) { Assert.notEmpty( repairParts, "map of repairParts mustn't be empty"); // ... } 8. Array Assertions 8.1. notEmpty() for Arrays Finally, we can check if an array is not empty and contains at least one element by using the notEmpty() method: public void repair(String[] repairParts) { Assert.notEmpty( repairParts, "array of repairParts mustn't be empty"); // ... } 8.2. noNullElements() We can verify that an array doesn’t contain null elements by using the noNullElements() method: public void repairWithNoNull(String[] repairParts) { Assert.noNullElements( repairParts, "array of repairParts mustn't contain null elements"); // ... } Note that this check still passes if the array is empty, as long as there are no null elements in it. 9. Conclusion In this article, we explored the Assert class. This class is widely used within the Spring framework, but we could easily write more robust and expressive code taking advantage of it. As always, the complete code for this article can be found in the GitHub project.
https://www.baeldung.com/spring-assert
CC-MAIN-2021-10
refinedweb
992
55.54
Question How do i upgrade a helm chart (bitnami/wordpress) that is installed with a one-click app on Kubernetes? I want to upgrade the Helm Chart bitnami/wordpress on my DO live Kubernetes pod in the namespace “wordpress”, where the bitnami/wordpress chart is deployed. Because it installs version Helm Chart 8.0.0.0. I’ve installed WordPress on Kubernetes with the 1-click install and everything is working fine. I can access my WordPress url via the loadbalancer, kubectl & doctl are able to communicate with the live Kubernetes cluster. So, I’ve installed helm v3.1.2. on my local machine (MacOs) and add the bitnami repo. When i enter: helm search repo, i get the list of repositories. But, when i try to install the chart: helm install --namespace wordpress wordpress bitnami/wordpress It says: Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: namespace: wordpress, name: wordpress-mariadb, existing_kind: /v1, Kind=Secret, new_kind: /v1, Kind=Secret And when i try to upgrade the chart: helm upgrade --namespace wordpress wordpress bitnami/wordpress It says: Error: UPGRADE FAILED: "wordpress" has no deployed releases Question: How can i upgrade the standard Wordpress helm chart on my live DO Kubernetes pod? / Sync the charts that are deployed live, with my local machine? These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×
https://www.digitalocean.com/community/questions/how-do-i-upgrade-a-helm-chart-bitnami-wordpress-that-is-installed-with-a-one-click-app-on-kubernetes
CC-MAIN-2021-21
refinedweb
256
62.58
Logistic Regression using Python Logistic Regression is a method to create Machine Learning model for two class problems. It came out of linear regression but used to generate binary output (0 and 1) for making classifications. For example In Linear Regression we use simple linear equation as follows :- Yh = b0 + b1X1 Where X combines linearly with coefficient b1 and bias bo to give us a numeric value as output. Now we modelled the equation in such a way that it lead to binary value. It uses base of natural logarithms (Euler’s number) raised with linear equations as given below. Here we can conclude that the output in defined by Yh will always be a real number between 0 and 1 which will be rounded to a integer value and mapped to a predicted class value. Each column in our data will be associated with the coefficient (b,b1..etc) which will be learnt during the training and needs to be stored for future value predictions. Let’s take an example with 10 samples. Here we define 10 samples of data with two features each and one label. It’s a data representing two classes which are represented by 0 and 1. Each sample is assigned with a label as 0 or 1 defined in 3rd column. import numpy as np data = np.array([[3.87,2.65,0], [2.64,3.63,0], [4.93,5.50,0], [2.83,2.95,0], [4.07,4.00,0], [8.27,3.57,1], [6.36,3.09,1], [7.99,2.97,1], [9.76,1.42,1], [8.76,4.60,1]]) print(data) #Output--- [[3.87 2.65 0. ] [2.64 3.63 0. ] [4.93 5.5 0. ] [2.83 2.95 0. ] [4.07 4. 0. ] [8.27 3.57 1. ] [6.36 3.09 1. ] [7.99 2.97 1. ] [9.76 1.42 1. ] [8.76 4.6 1. ]] Make a plot of it on X and Y coordinates as follow. It will show two categories and two separate colors. import matplotlib.pyplot as plt plt.scatter(data[:,0:1],data[:,1:2],c = data[:,2:3]) plt.show() Mathematics of Logistic Regression Let’s define a function to calculate output using logistic regression equation.Here yhat will be first calculated as as b0 + b1x1 + b2x2 , and then the function will return the output by using yhat into logistic equation using natural logarithm. from math import exp # Make a prediction with coefficients def predict(row, coefficients): yhat = coefficients[0] for i in range(len(row)-1): yhat += coefficients[i + 1] * row[i] return 1.0 / (1.0 + exp(-yhat)) We will trigger this function with data having as follows: – coef = [0.55, 0.45, 1.10] for row in data: yhat = predict(row, coef) print("Expected=%d, Predicted=%.3f [%d]" % (row[-1], yhat, round(yhat))) We had defined some random coefficient to initialise the process. coef[0] is the initial bias value and coef[1] and coef[2] are coefficients values. Using initial bias and coefficient we are getting following Predicted labels which are rounded up to nearest integer value. Expected=0, Predicted=0.995 [1] Expected=0, Predicted=0.997 [1] Expected=0, Predicted=1.000 [1] Expected=0, Predicted=0.994 [1] Expected=0, Predicted=0.999 [1] Expected=1, Predicted=1.000 [1] Expected=1, Predicted=0.999 [1] Expected=1, Predicted=0.999 [1] Expected=1, Predicted=0.999 [1] Expected=1, Predicted=1.000 [1] Out of total 10 samples we are having 5 predictions correct represented by 1 as expected and predicted are same. But first 5 predictions are incorrect which are expected 0 but predicted 1. So, Next process is to calculate the error value and apply error optimisation to rectify the same. The coefficients leading to minimum error value will be stored for future value predictions. The error optimisation process to be used is Stochastic Gradient Descent which will be explained below. As we know we are defining the predicted output with Yh which can be represented as: Our real output value will be defined as Y. Which leads to square of error as mentioned below. Now we need to tune the coefficient b1 in such a way that error can becomes as minimum as possible. We can finish up this process by stochastic gradient descent. i.e we need to partially differentiate error value with respect to coefficient b1 to initiate the convergence. So, we figured out our gradient which can be used over coefficient b1 to converge the error value towards minimum. It is mentioned below with learning rate to regulate the learning processes. Which turned out to be a equation as mentioned below for error optimisation using Stochastic Gradient Descent. Now we can put this thing into python code to calculate coefficient values at minimum possible error. While tuning the bias or first coefficient we will not use any feature value along with gradient. # Estimate logistic regression coefficients using stochastic gradient descent def coefficients_sgd(train, l_rate, n_epoch): coef = [0.0 for i in range(len(train[0]))] for epoch in range(n_epoch): sum_error = 0 for row in train: yhat = predict(row, coef) error = row[-1] - yhat sum_error += error**2 coef[0] = coef[0] + l_rate * error * yhat * (1.0 - yhat) for i in range(len(row)-1): coef[i + 1] = coef[i + 1] + l_rate * error * yhat * (1.0 - yhat) * row[i] print('epoch=%d, lrate=%.3f, error=%.3f' % (epoch, l_rate, sum_error)) return coef Now trigger the coefficients_sgd function as mentioned below to tune our coefficients. for row in data: yhat = predict(row, coef) print("Expected=%.3f, Predicted=%.3f [%d]" % (row[-1], yhat, round(yhat))) #Output epoch=0, lrate=0.300, error=2.355 epoch=1, lrate=0.300, error=2.142 epoch=2, lrate=0.300, error=1.555 epoch=3, lrate=0.300, error=1.245 epoch=4, lrate=0.300, error=1.074 . . . epoch=95, lrate=0.300, error=0.100 epoch=96, lrate=0.300, error=0.098 epoch=97, lrate=0.300, error=0.097 epoch=98, lrate=0.300, error=0.096 epoch=99, lrate=0.300, error=0.095 As output you will see the error converging towards minimum possible value which was initially 2.355. The update value of coefficients can be called as follows. print(coef) [-1.2764743653675956, 1.7436336944686017, -2.4845855816811415] You can make the predictions as done below and this time you see with updated coefficients values the categories had been well classified into two groups. with no error. So we can say that the machine got trained in terms of coefficients for making out predictions using Logistic Regression. for row in data: yhat = predict(row, coef) print("Expected=%.3f, Predicted=%.3f [%d]" % (row[-1], yhat, round(yhat))) Expected=0.000, Predicted=0.247 [0] Expected=0.000, Predicted=0.003 [0] Expected=0.000, Predicted=0.002 [0] Expected=0.000, Predicted=0.025 [0] Expected=0.000, Predicted=0.016 [0] Expected=1.000, Predicted=0.986 [1] Expected=1.000, Predicted=0.894 [1] Expected=1.000, Predicted=0.995 [1] Expected=1.000, Predicted=1.000 [1] Expected=1.000, Predicted=0.929 [1] Using Library– Scikit-Learn provides us a library support to implement Logistic regression in easier way. Let’s have a look. We will use Pima India Diabetic Dataset. import pandas as pd df = pd.read_csv('diabetes.csv') X = df.drop(['Outcome'],axis=1) Y = df['Outcome'] from sklearn.model_selection import train_test_split xtrain,xtest,ytrain,ytest = train_test_split(X,Y) from sklearn.linear_model import LogisticRegression lmodel = LogisticRegression() lmodel.fit(xtrain,ytrain) print('Training Accuracy:',lmodel.score(xtrain,ytrain)) print('Testing Accuracy:',lmodel.score(xtest,ytest)) Training Accuracy: 0.7743055555555556 Testing Accuracy: 0.7239583333333334 So at the end we are getting 77% training and 72% Testing accuracy on diabetic data with 8 features of a person and label representing Diabetic or Non-Diabetic. Now we can get our final coefficients as follows. Since we are having 8 features so 8 coefficients are generated and one bias value. print(lmodel.coef_) print(lmodel.intercept_) [[ 0.14515144 0.04110736 -0.01092623 -0.00195708 -0.00125506 0.09054463 0.12483913 0.00827183]] [-8.76810019] To make predictions on some unknown value we will apply .predict function as follow. status = np.array(['Non - Diabetic' , 'Diabetic']) print(status[lmodel.predict(xtest.iloc[45:46,:])]) ['Diabetic'] So we concluded logistic regression can be used in two categorical predictions mathematically or by using Scikit-Learn Library. You can choose your way of coding. Thanks for being a Patience Learner. Keep Learning… Good luck
http://indianaicouncil.org/logistic-regression-using-python/
CC-MAIN-2021-43
refinedweb
1,438
51.95
See also: IRC log <trackbot> Date: 09 December 2009 no one is chatting bblfish <tinkster> Nobody talking on phone. <danbri> danbri: i propose skipping all admin and going straight to henry <bblfish> ok :-) <danbri> hearing no objections ... <hhalpin> who is scribing? i can scribe <danbri> yes please! <danbri> what's the script notation to say <danbri> scribe: mischat <hhalpin> scribe: mischat <danbri> :) <bblfish> ok, if people want they can download a presentation I have made recently <tinkster> This will be useful, or just "if people want"? <cperey> which one? <bblfish> (it's 45MB, so just start now. I won't go through all of it, but it will make things easier) <bblfish> if you don't have keynote, take the pdf <rreck> yes yes <tinkster> yes <tinkster> +1 skip any actions which people want to talk about ? <danbri> danbri proposing skip admin <danbri> skipping! <danbri> Henry Story <danbri> ---- henry story to talk about foaf+ssl <bblfish> henry works for Sun Mircosystems, and has been travelling around europe talking about distributed social networks <cperey> +1 semantic web helps us solve a problem which is required to have a distributed social network issues with single sites such as facebook, where you have to log in, and then add all your friends one by one there are loads of social networks about recreating your social graph on every SNS is tedious and causes problems such issues, and the notion of ownership of data has led to the data-portablity movement scoble had an issue where he got kicked out of his social network, after attempting to remove all of this data users don't own the data they upload to social networks social graph, and the issue that you only have access to your own social graph, but the service providers have a view of everyones' social graph companies with secrets cant use existing social networks, re: data ownership problems there is a big brother privacy issue, we may not want people to look at what you are doing on a given social networking start <danbri> (2000 even) danbri and libby started foaf in 2000 :) <danbri> timbl: 1989! foaf project enables a distributed social network <danbri> (I have a pile of foaf slides here ) current social networks are really popular, and they have good working UIs, and have engaged users <danbri> for timbl, see The "Personal Skills Inventory". "Personal skills and experience are just the sort of thing which need hypertext flexibility. People can be linked to projects they have worked on, which in turn can be linked to particular machines, programming languages, etc. " <danbri> (ie. this use case was envisaged in the original design for the Web itself) foaf and the semantic web, allows for data to be linked together between different sites foaf allows for people to be linked together people get given a URI a foaf:Person URI <danbri> :) these URIs give you the ability to produce a global namespace for people semantic web, builds on logic allows for sentences to be built about things in the world semantic web, mathematics of merging and mapping information in order to show how foaf works, and how the Semantic Web can work, henry built a foaf-based Address book this address-book allows for webpages to dragged and dropped into the address book app and it grabs your foaf file and it then populates your address book with information about the person just added to your address the address book makes http requests to people's foaf files, and extracts information about that person and adds this information into your address book <danbri> (public's good and all, but not everyone wants to share everything :) the problem people had with the Address Book was that it required that all your information be in public foaf files foaf gives us data-ownership people can host their own info it doesn't solve the action creation complexity problem it solves a bunch of problem by not touching them, i.e. privacy henry has found that in order to support privacy <danbri> (we had some old experiments with PGP ... ... but it was limited to the tiny subset of us who could remember their PGP / GPG passwords and how to use them :) there was a need to implement a form of authentication and identification for the last 20 years we have relied on usernames and password but imagine a distributed social network, where people host their own data, you would have to hold accounts with usernames and passwords on all of your friends servers this just wouldn't work then came openid openid gave each person a global identifier or a URI <danbri> ( slide 53 = openid ) the protocol is a tad complicated there is a lot of back and forwarding when doing an openid login attribute exchange of openid is not restful which makes it hard to link to information there are also known security issues with openid ? openid is very much compatible with the foaf+ssl work foaf+ssl uses the client-certificate infrastructure built into modern web-browsers it is built on top of https <bblfish> you can create your own certificate and your own foaf file <danbri> (is foaf.me down right now?) melvster: ^^ ? <petef> seems to be down for me <melvster> sorry yes it works in FF, opera , safari <melvster> appears down at this second but not IE <danbri> fixable? :) <melvster> im looking ... slide 57 has a UML diagram <tinkster> Generating keys in IE requires ActiveX and none of us have been bothered to look at that yet. <MacTed> yay to links <bblfish> here links to most of the topics covered can be found on the esw wiki ^^ <bblfish> here the protocol description <petef> slide 57 = 59 = 62 ? <tinkster> slide 61 once you have created your certificate, you can log in to a foaf+ssl enabled site by simply presenting your cert to the site in order to attach a URI to a certificate foaf+ssl has used a property in the X.509 header property X? this property should point to your foaf file <tinkster> (And Peter Williams also said that we're using it pretty much how it should be used.) <danbri> ' X509v3 Subject Alternative Name:' thanks <bblfish> here and if foaf file has the public key of the cert in question, then the cert is said to be associated to the foaf:Person URI <melvster> very sorry guys ... seems to be an ISP issue with foaf.me ... trying to trace the issue ... which is now being called a WebID so whoever owns the private key of the public key stated in the foaf file is said to be the person identified in the X.509 certificate danbri asks about the level of security in foaf+ssl and the robustness of the desig <danbri> esp re first step, where you're loading a public foaf file <danbri> ... how much of a difference do we care re https vs http URIs for the public files http resource can be made subject to man in the middle attack so for more security critical applications one should use an https WebId <danbri> wondering role for xmldsig-signed markup here ... <tinkster> Use FOAF+SSL to log into a social network, but not into a bank. <MacTed> since foaf.me is down ... worth noting that this has all been built into Virtuoso & OpenLink Data Spaces ... <MacTed> docs -- -- can be followed against or (which servers are up and running) or you can put up your own pretty quickly. <bblfish> dnssec <danbri> tinkster, that's a nice first step towards getting mother maiden names, birthdays etc... using the WOT <bblfish> HAR back in the day danbri was playing with the signed foaf files with pgp but the issue was that not that many people used pgp danbri asked if henry thought it was a good idea to revisit such things henry started talking about signing sub-graphs in RDF i don't understand why you would want to sign a sub-grapg ? <tinkster> J Carroll paper mentioned by danbri - digitally signing rdf : foaf+ssl makes it easy to have multiple certs you can also easily invalidate a cert if you loose a machine using pgp, if you loose your private key, you will have to ask people to re-sign your key :) danbri proposes a method of pushing data signed data via atom-pub or similar to a site such as facebook <danbri> (with eg garlik as a file-signing intermediary ...) our foaf validator, can tell you if your foaf file is signed properly but yes, signing a foaf file for someone else does sound interesting <danbri> (I'm not gonna hold my breath waiting for dns to be secured :) <danbri> mischa, ... just to say 'garlik saw this, and got it from the party whose openid x checked out...' ... but not necc to vouch for its contents <Zakim> danbri, you wanted to ask about attacks when not https it would be nice to see if there was a method in the X.509 external where you could say only send information to a party if it is signed ? <tinkster> <danbri> <danbri> also understood danbri openid4.me allows you to use an openid login form <danbri> (garlik or other biz-s could also fact check specific claims, like workplaceHomepage ... ) <melvster> AX: not yet programmed <melvster> sreg works openid4.me allows you to use your WebID, and your foaf+ssl cert to log in openid providers one important piece which is yet to be solved, that is content negotiation on foaf files so in openid you can decide which bits of personal information you want to send to a service provider there is no solution as of yet in the foaf+ssl world <melvster> appears to be back ... ? yup it is melvster <bblfish> openid <bblfish> this is a restful implementation of how you may want to interact with a restful web service using your foaf+ssl WebID isn't this a similar example as presented in the openid spec ah yes you are right <danbri> oauth use photo sites as their intro use case <melvster> it's actually closer to oauth WRAP (the newer version) than oauth i recall the oauth example in the spec uses the photo service foaf+ssl wants to be make us of linked data, semantic web, RDF. in the future we can imagine a world where every user has their own website <danbri> sounds like :) :) or mac.com user pages <danbri> see also <bblfish> <danbri> anyone have questions for henry? ack? <bblfish> <danbri> anyone with questions, use "q+ to ask about blahblah" here please <danbri> see <bblfish> here people should join the foaf-protocol mailing list <cperey> me too, bye <danbri> mischa: with foaf+ssl you need something inside your browser ... <danbri> ... do you think we're moving to a world where ppl carry their browser around with them <danbri> ... or they use machines from anywhere, unless you brin your cert <danbri> bblfish: i was a bit worried initially re signing others' foaf files with my pubkey <danbri> ppl can selfsign their certs, ... very easy to create new certs, ... <danbri> foaf.me should let you get a list of certs you have, ... click on them and cancel, ... to create one for 10 mins (eg. a net cafe), ... <danbri> ... also another tech, USB cards, which can be linked with firefox so you can put your key on usb card, they'll do the encryption <danbri> without privkey being shared anywhere <danbri> (missed detail) <danbri> bblfish: by basing on tls/ssl, we build on existing expertise <danbri> ... they relied a bit too much on ldap data structures <danbri> so too much pre-web design <danbri> lacking web-style flexibility/ namespaces <danbri> ldap doesn't allow you to have a global directory <tinkster> Also, too much emphasis on top-down certificate signing, rather than self-signed. <danbri> (x500 did, kinda? -danbri) <danbri> bblfish: so we're supplying a missing piece to make the most of ssl <Zakim> danbri, you wanted to ask about feedback you've had, in your tours/talks <petef> have to duck out now, thanks Henry. danbri askes about the feedback on your tour, and your priorities for the upcoming months <danbri> bblfish: similar questions come up mainly security based questions <danbri> re security, ... was pleased that specialists seemed relatively untroubled by the design services such as foaf.me <danbri> (foaf.me is back btw :) and openid4.me have really helped when trying to see foaf+ssl foaf+ssl is seen as a practical way of showing the semantic web working in a real world context that is a social networking application drupal dev's found it an easy way into Semantic web tech henry thinks we need more use cases for such technology <tinkster> bblfish, ARC2's SPARQL is pretty good in my experience, but can only operate on in-database (MySQL-only in fact) triple stores; not in-memory. we need to have people using it, so that we can identify issues with the foaf+ssl proposition ack? the european tour was very useful, giving talks about the work really helped. Most talks at barcamps, and non-traditional conferences, i.e. not that academic webfinger henry would love the swxg to support foaf+ssl ?ack ?q <danbri> I logged into Jyte: * Signed in as openid4.me/ <tinkster> RDF vCard would be nearly as useful. no offense to danbri <danbri> yeah, it's a fair question <danbri> foaf was designed to be optional! <danbri> original name was rdfweb ... foaf was just the 'utility vocab' <danbri> <- question regarding whether foaf was necessary in the foaf+ssl <tinkster> DNA checksum will be useful when we create FOAF+Blood authentication. semantic web tech allows you to add more namespaces <danbri> 'please spit on the screen' <danbri> 'no, down a bit...' allowing you add more information to your foaf file, as ontologies come about <MacTed> GoodRelations - what do you need, what do you have... danbri asked which properties you need to implement a foaf+ssl <danbri> danbri: exactly which properties (and classes) are needed when implementing a foaf+ssl system <tinkster> cert:identity, rsa:public_exponent, rsa:modulus, cert:hex, cert:decimal. tinkster: a link to a cert:? <danbri> so those 2 namespaces timbl dropped onto w3.org? bblfish: WedID <tinkster> No, the cert links to the FOAF file. The FOAF file doesn't need to link to the cert (it describes it via those properties). for an example ah no my question was, could you give the full URI for "cert:identity" got it and <caribou> member submission? <danbri> Todo: <danbri> - add some classes and relations for DSA <bblfish_> <danbri> - should this all be in one file? Or should this be cut up a little? Say one file for the general CERT ontology, and then files for RSA, DSA, PGP, etc... Or perhaps it does not really matter? <danbri> - expand more on the certification side of things <danbri> - verify this by security experts <bblfish_>> <danbri> - add more todos <danbri> - owl2 has some constructs for combined inverse functional properties. <danbri> This may be useful to use in defining an RSA key which is identified wants a foaf:knows in bblfish's foaf file :) <danbri> by two numbers. <danbri> - when more stable create rdf/xml version <danbri> - also create html version of the spec by using this as a template. <danbri> - should comments such as this be in html? <danbri> we could publish a swig note <danbri> or as caribou mentions, a member sub (if you continue working for a Member) <bblfish> here what is the smallest thing needed for the spec to be useful <caribou> danbri, 1 member amongst the authors is sufficient <tinkster> Smallest thing to be useful = a blog post, though a UN resolution would be nice. <danbri> UN :) danbri asks if Henry would be happy for the work to be published via the W3C ? henry would be happy for the work to be published via the W3C <tinkster> Open Web Foundation is a possibility too. <melvster> graphical example of the ontology (scroll down) the scribe will have to go soon <danbri> mischat, thanks for scribing np This is scribe.perl Revision: 1.135 of Date: 2009/03/02 03:52:20 Check for newer version at Guessing input format: RRSAgent_Text_Format (score 1.00) Succeeded: s/WebId/WebID/ Found Scribe: mischat Found Scribe: mischat Inferring ScribeNick: mischat WARNING: No "Topic:" lines found, but dash separators were found. Defaulting to -dashTopics option. WARNING: No "Present: ... " found! Possibly Present: AX Anita AnitaD MacTed OpenLink_Software P18 P32 Todo bblfish bblfish_ caribou cert cperey danbri hhalpin melvster mischa pchampin petef rreck timbl tinkster trackbot You can indicate people for the Present list like this: <dbooth> Present: dbooth jonathan mary <dbooth> Present+ amy Found Date: 09 Dec 2009 Guessing minutes URL: People with action items: WARNING: Input appears to use implicit continuation lines. You may need the "-implicitContinuations" option.[End of scribe.perl diagnostic output]
http://www.w3.org/2009/12/09-swxg-minutes.html
CC-MAIN-2015-11
refinedweb
2,824
62.11
Intro: Robotic Eye This. Step 1: Materials - An Arduino board - A sensor shield board - 3 infrared sensor modules - A standard servomotor - A Styrofoam ball - wires Step 2: Mounting Cut the Styrofoam ball to hold the arm of the servomotor, paint the Styrofoam ball in the shape of an eye, fit the servo arm in the eye and fit them into the servo. Step 3: Mounting the Shield and Connecting Sensors Mounting the Shield in Arduino, install the sensors with the aid of wires. Step 4: Mounting the Servo and Programing After the sensors installed, install the servo on pin 9 of the shield, programming and testing. The eye works as follows: to detect an object in front of each sensor (up to 40 cm, adjustable), the sensor changes state at the exit from Hi to Lo (of 5volts to zero) then the Arduino realize that there was a change state in one of its ports so, according to the software, the servomotor to rotate the eye to the preset position. This was an application of the didactic use of infrared sensors. Many other applications are possible. The limit is your imagination. Hope you enjoy. Software: #include <Servo.h> // include servo library Servo pescoco; // create servo object to control a servo int pos =0; int irdireita = 10; int iresquerda = 12; int ircentro = 11; int tempo = 50; void setup (){ pescoco.attach(9); // attaches the servo on pin 9 to the servo object pinMode (irdireita, INPUT); // set pin irdireita (pin10) as input pinMode (iresquerda, INPUT); // set pin iresquerda (pin12) as input pinMode (ircentro, INPUT); // set pin ircentro (pin11) as input } void loop(){ int valdireita = digitalRead (irdireita); int valesquerda = digitalRead (iresquerda); int valcentro = digitalRead (ircentro); if (valdireita == LOW){ pescoco.write(180); pos = (180); delay (tempo); } else if(valesquerda == LOW){ pescoco.write (0); pos =(0); delay (tempo); } else if (valcentro == LOW){ pescoco.write (90); pos = (90); delay (tempo); } else { pescoco.write (pos); delay (tempo); } } 18 Discussions 3 years ago on Introduction Muito bom mesmo!! gostaria do manual, documento alguma coisa que me ajude com este sensor, você poderia compartilhar? Adquiri um igual porém não encontro informações relevantes para que funcione da maneira desejada :/ Reply 3 years ago on Introduction Esse é o problema com esses eletrônicos da China. AS vezes encontramos na própria página alguma s dicas dos compradores. 4 years ago on Introduction MAneiro. Gostei mt Reply 3 years ago on Introduction Valeu! 6 years ago on Introduction Great for Halloween!!! Reply 6 years ago on Introduction By placing it in a hallowed toy skull rig the eyes to move when someone tries to get some candy!!! 6 years ago on Introduction I SEE YOU!!!! Reply 6 years ago on Introduction Hehehe.. Reply 6 years ago on Introduction I meant to say "EYE SEE YOU!" 6 years ago on Introduction Looks awesome and like a lot of fun. I'd love to give this a try. As a beginner to Arduino, could you take some time to explain the code to me? It looks somewhat simple but includes some functions I may not be familiar with. Reply 6 years ago on Introduction Hi ! Welcome to Arduino's World! Im a beginner too. I will try to explain it to you (inside the code above) but my english is a little poor. 6 years ago on Introduction I am trying to find the parts for this project. Was wondering where the parts could be found for reasonable prices. The sensors are difficult to find. Reply 6 years ago on Introduction Hi Below is the list of items I bought. Arduino Board: Sensor Sheild: BreadBord Wires: Infrered Sensors: Reply 6 years ago on Introduction I appreciate the info. Looking forward to building this project! Thanks!! Reply 6 years ago on Introduction OK. Then show us some pictures as soon as possible Reply 6 years ago on Introduction Will do. Ordering the parts very soon. 6 years ago on Introduction You should put a wireless camera inside the eyeball! Reply 6 years ago on Introduction Good idea!
https://www.instructables.com/id/Robotic-Eye/
CC-MAIN-2018-43
refinedweb
670
65.12
OAuth2 Provider for Django Project description. Note: If you have issues installing Django 4.0.0, it is because we only support Django 4.0.1+ due to a regression in Django 4.0.0. Besides 4.0.0, Django 2.2+ is supported. Explanation. Reporting security issues Please report any security issues to the JazzBand security team at <security@jazzband.co>. Do not file an issue on the tracker. Requirements - Python 3.7+ - Django 2.2, 3.2, or >=4.0.1 - oauthlib 3.1+ = [ ... path('o/', include('oauth2_provider.urls', namespace='oauth2_provider')), ] Changelog See CHANGELOG.md. Documentation The full documentation is on Read the Docs. License django-oauth-toolkit is released under the terms of the BSD license. Full details in LICENSE file. Help Wanted We need help maintaining and enhancing django-oauth-toolkit (DOT). Join the team Please consider joining Jazzband (If not already a member) and the DOT project team. How you can help See our contributing info and the open issues and PRs, especially those labeled help-wanted. Submit PRs and Perform Reviews PR submissions and reviews are always appreciated! Since we require an independent review of any PR before it can be merged, having your second set of eyes looking at PRs is extremely valuable. Please don’t merge PRs Please be aware that we don’t want every Jazzband member to merge PRs but just a handful of project team members so that we can maintain a modicum of control over what goes into a release of this security oriented code base. Only project leads are able to publish releases to Pypi and it becomes difficult when creating a new release for the leads to deal with “unexpected” merged PRs. Become a Project Lead If you are interested in stepping up to be a Project Lead, please join the discussion. Project details Release history Release notifications | RSS feed Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/django-oauth-toolkit/2.1.0/
CC-MAIN-2022-27
refinedweb
335
68.06
I am having a problem linking that I can't seem to resolve.... There are 3 source files: main.cpp, map.cpp, terrain.cpp There are 3 header files: map.h, terrain.h, vectordtp.h terrain.h looks like: terrain.cpp includes terrain.h and defines all functions in from the classes.terrain.cpp includes terrain.h and defines all functions in from the classes.Code:#ifndef __TERRAIN_DTP_H #define __TERRAIN_DTP_H //Includes #include "SDL.h" ...some constants defined.... class TERRAIN_MANAGER_DTP { friend class TERRAIN_DTP; ...class declaration... } DefaultTileManager; class TERRAIN_DTP { ....class declaration }; #endif map.h looks like such: map.cpp includes map.h and defines all functions from the class.map.cpp includes map.h and defines all functions from the class.Code:#ifndef __MAP_DTP_H #define __MAP_DTP_H #include "terrain.h" #include "vectordtp.h" /********************* MAP_DTP class *********************/ class MAP_DTP { ...class declaration... }; #endif vectordtp.h is a simple header file that defines my own vector and matrix classes....with both the declaration and definitions in the same file (the function definitions are encapsulated inside the class declaration). main.cpp looks like such: This is the error I am receiving:This is the error I am receiving:Code:#ifdef WIN32 #pragma comment(lib, "SDL.lib") #pragma comment(lib, "SDLmain.lib") #endif //Includes #include "SDL.h" //#include "terrain.h" //#include "map.h" //Color masks bool MessageLoop ( SDL_Event &event ); int main(int argc, char **argv) { ...code.... } terrain.obj : error LNK2005: "class TERRAIN_MANAGER_DTP DefaultTileManager" (?DefaultTileManager@@3VTERRAIN_MANAGER_DTP@@A) already defined in map.obj I have tried moving around some include statements and such...but I can't seem to resolve this linking problem. Any ideas?
http://cboard.cprogramming.com/cplusplus-programming/85257-having-linking-problem.html
CC-MAIN-2015-40
refinedweb
264
56.32
Odoo Help This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers. ValueError: "name 'employee_id' is not defined" while evaluating Hello friends :) Please, i have tried to add some fields in the menu Human Ressources. So, i use an on_change function which gave me error that i havent resolve yet. Here is my code: def on_change_contract_id(self, cr, uid, ids, field_name, context=None): if field_name == False: My_error_Msg = 'Please, select your EMPLOYEE' raise osv.except_osv(_("Error!"), _(My_error_Msg)) else: print employee_id obj = self.pool.get('hr.contract') obj_ids = obj.search(cr, uid, [('employee_id', '=', field_name)]) res = obj.read(cr, uid, obj_ids, ['name'], context) res = {'value':{.................................; } } return res The problem is that i need to work with the employee_id but i didnt understand how to be able to use it when i try the inheritance. Need an answer!
https://www.odoo.com/forum/help-1/question/valueerror-name-employee-id-is-not-defined-while-evaluating-88813
CC-MAIN-2016-50
refinedweb
156
66.94
Transition from C to C++ const - 2020-05-27 06:38:56 - OfStack 1. Define constants 1.1 methods for defining constants in the C language In this series, starting from scratch, we looked at how the C language defines constants. For those of you who haven't seen it, please refer to: C language from scratch (5) - constants & variable I'm not going to go into the details of why we define constants, but I'm going to focus on what's wrong with this definition. A common interview question is: write down the results of the following code: #include <stdio.h> #define SUM 5 + 1; void main() { int a = 2 * SUM; printf("%d", a); } People often say 12, but it turns out to be 11. Try running 1 on your computer. Why would it be wrong? Because the constants defined by #define are pseudo-constants, which do literal character substitutions at compile time. It's 2 times SUM which is what the compiler says it should be int a = 2 * 5 + 1; If you want to get 12, the definition should say: #define SUM (5 + 1); Such a classic mistake many people have made, although the truth is known to all, but always because of carelessness into this pit. Thus, the introduction of C++ with the const constant completely solves this problem. Later, some compilers for the C language also began to support the use of const, which fully demonstrates its value. 1.2 const constants In C++, we define constants in the following form: const int MONTH = 12; const int SUM = 5 + 1; Strictly speaking, the const constant should be called a "constant variable", which defines a variable whose value will not be modified. For the sake of code style 1, we still use all uppercase letters for the const constant. The characteristics of There are two major differences between const constant and ordinary constant: You can't change the value Can be used as a definition of array size Such as: const int MAX = 10; int arr[MAX] = {0}; for (int i = 0; i < MAX; i++) { // Do something } 1.3 scope of action The constants defined by const have a scope similar to static and can only be accessed by the current file. How do you write if you want to use it in other files? // file1 const int MAX = 10; // file 2 extern const int MAX; While this is not recommended, it is recommended that you write the const definition in a header file, including this header file in the required files. 2. Pointer with const The modification feature of the const is to modify the nearest part. It can be used in two ways. 2.1 pointer to the const variable Having the pointer point to an const object prevents the pointer from modifying the value it points to. int age = 30; const int* ptr = &age; This code defines a pointer ptr that points to data of type const int and is not modifiable. *ptr += 1; // An error cin >> *ptr; // An error Both are illegal. Note: you can still use the age variable. 2.2 const pointer Declare the pointer itself as a constant to prevent the pointer position from changing int a = 3; int* const p = &a; p++; // error Note: only the const pointer can point to the const variable, for example: const int a = 9; const int* p = &a; // correct int* ptr = &a; // error Special use: const int* const p = &a; This means that both the pointer variable and the address to which it is pointing are immutable 3. Functions and const 3.1 const parameters If you want the parameter not to be modified inside the function, you can modify it with const, as follows: void fun(const int a) { a++; // Illegal operation } Since a is modified by const as a constant variable, an a++ operation on it will report an error. The purpose of this method is to limit the change of parameters within the function, and more and more people like to do it like this: void fun(int a) { const int& b = a; b++; // Illegal operation } The effect is exactly the same. 3.2 const return value If the return value of a function is a primitive data type, it makes no sense to modify it with const. Such as: 00 const int MONTH = 12; const int SUM = 5 + 1; The return value of the fun() function cannot be "left" modified, because no one would use it like this: fun() = 2; The compiler also filters this out first. In general, const is only used to modify the return value to be a function of an object of a class. Such as: 11 const int MONTH = 12; const int SUM = 5 + 1; Can you understand the mystery? In conclusion 1, if the return value of const is an object of the class, then: This return value cannot be left handed (it is assigned to the left of the equal sign or its member functions are called) The alias for this return value must also be modified by const 4. Put 1 against 3 Knowing that 1 general parameter and return value are modified by const, we should be able to derive the case where const modifies pointer parameters and return value. Let's use a piece of code to look at the pitfalls. 22 const int MONTH = 12; const int SUM = 5 + 1; The various assignments in this program actually follow the principles described in part 2. In the process of parameter passing and value assignment, we need to pay attention to: *p is not modifiable when pointer content is modified by const When pointer content is modified by const, it cannot be assigned to a pointer whose content is not const When both pointer variables and content are modified by const, you can only assign values to Pointers in the same situation It's a mouthful to say, but when you think about it, it's similar to what you saw in part 2. OK, that's all for today.
https://ofstack.com/C++/21359/transition-from-c-to-c++-const.html
CC-MAIN-2021-39
refinedweb
1,012
62.11
Slashdot Log In IETF vs. ICANN Posted by michael on Wed May 30, 2001 12:26 PM from the one-root-to-bring-them-all-and-in-the-darkness-bind-them dept. from the one-root-to-bring-them-all-and-in-the-darkness-bind-them dept. Ian Lance Taylor writes: "Two IETF drafts were filed today which fire a shot across ICANN's bows. They say that anybody who introduces a new version of an existing TLD is destabilizing the DNS--even ICANN. These are still only drafts, mind, not standards. They both acknowledge input from Karl Auerbach, the member of ICANN's board who was elected by North America. The drafts are Alternative Roots and the Virtual Inclusive Root and Root Server Definitions." The IETF drafters are attempting to define a system where non-ICANN TLDs can easily be added. ICANN is set to push their one root concept of operations where ICANN gets absolute authority over internet naming. All ICANN PR is geared toward presenting the ICANN-only plan as being necessary for "internet stability". This discussion has been archived. No new comments can be posted. IETF vs. ICANN | Log In/Create an Account | Top | 146 comments (Spill at 50!) | Index Only | Search Discussion The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way. Domain Name Scam (Score:4) How to unravel the ICANN (Score:3) This, however, is not how DNS itself works. The way DNS itself works is like this: To get around the idea of there being only one nameserver, one has to implement a nameserver to, in addition to setting the root namservers when creating a new cache, setting the name servers for alternate non-ICANN TLDs and placing those names and IP addresses in the cache. This way, when one goes to, they ask the ICANN nameservers where to go. When one goes to, they ask the DNS servers that the DNS administrator has specified where to go. Anyone with a reasonable amount of clue can set up their won DNS cache and be in control of what TLDs they wish to resolve. This is very similiar to how USENET works. To create a newsgroup in one of the "big seven" (comp., soc., talk., rec., news., sci., and misc.) hierarchys, you have to get approval from David Lawrence. To create a newsgroup under the "alt" hierarchy, there is much less red tape involved. Less news servers (traditionally) carry the alt. newsgroups, but there is more freedom under the alt. hierarchy. There are also a number of other Usenet hierarchys which have even less propergation than the "big seven" and the "alt" Usenet hierarchys. DNS can be set up in a similiar fashion. The amount of code that needs to be changed is fairly trivial (there is a technical concern about what to do if the "root servers" for shop. give you a referral to different name servers that actually serve the shop domain instead of a referral to an appropriate subdomain, but that is easily enough handled compared to the amount of effort involved in making a caching nameserver). The only thing that has stopped this is mainly Paul Vixie's notion that non-ICANN TLDs are somehow evil. - Sam Re:I may be an old fart but... (Score:3) The point is that at the end of the day, a domain name has to resolve to an IP address. If the same name resolves to two addresses depending on where you are, that's a Bad Thing. Unfortunately, that's exactly what is going to happen now that ICANN has decided to issue a The suggestion in the memo is a good one: abstract the existing DNS away one more layer. All the roots have to play nicely together. ICANN doesn't get to introduce It's a simple solution. The memos (which are far from being official IETF positions) are needed because name issuance has become a business. A very, very big business. Tens if not hundreds of millions of dollars can be made -- if the artificial scarcity of domain names is maintained. ICANN has/had a public trust: to administer the root domain fairly. They have perverted that into a profit-making venture. They have, not to put too fine a point on it, forfeited their privilege as the ultimate arbiters of domain naming. The Virtual Inclusive Root proposal of these memos sidesteps ICANN. Mr. Higgs has written a very clear pair of documents that deserve to be taken seriously, and to have their content codified into one or more RFCs requiring root solvers to treat other root solvers as peers. This is a problem that will have to be engineered away, presenting the US government with a _fait accompli_. The moneyed interests that have hijacked ICANN will never permit foreigners and weirdos to horn in on their cash train through legislative action and the US government will never permit other nations to have an equal say in such legislative action. The IETF way has always been "rough consensus and running code". Now more than ever, we need that. Internet-Drafts are an open process (Score:5) Their publication says ABSOLUTELY NOTHING about how the IETF community as a whole views these matters. Single point of failure necessary for stability? (Score:4) As for a single point of CONTROL, if we're not going to let Microsoft be it, and we're not too happy about the federal government trying that out with encryption exports or various "commnications indecency acts"... Why do they think we're going to let THEM do it? The main problem with alternic type schemes is they need an alternate search engine. But if Google went along with it, there would be NO problem... The argument "grandma doesn't know how to set her nameserver" is kind of bogus if you stop and think about it: five years ago grandma didn't know what the internet WAS. The web was just geeks creating value for other geeks, and then the rest of the world found it and wandered in to our party. If we're over creating value in one corner and the rest of the world isn't doing as much with their 95%, then the rest of the world will find us. Remember Napster? Geeks are being QUIET about AudioGalaxy, this time around... Besides, remember usenet BEFORE AOL found it? A lot of people would consider the exclusivity (while it lasts) to be a good thing. Brains being the price of admission, and all. (Not trying to be bigoted, just saying it's not a BAD thing.) Rob A better solution: eliminate TLDs entirely (Score:5) Unfortunately, the commonly-proposed solution -- adding more gTLDs -- is not going to help. If health-care organizations get their ".med", then sooner or later, someone is bound to want separate gTLDs for doctors, dentists, and homeopaths. If a ".mp3" gTLD becomes widely used and another music format supplants MP3, then people distributing music in the new format will still set up ".mp3" sites for that purpose. And so on and so on, until users are confused by too many gTLDs, and companies afraid of cybersquatting register their names with 20 gTLDs, not just two or three. When people learn vocabulary, they learn the words for genuses first, and learn other levels of classification later. That's why a child, seeing a wolf, says "that's a dog", and not "that's a member of the species Canis lupus in the order Carnivora." That's why so many people set up personal domains under the ".com" TLD, even if they have no intention of making these domains commercial ventures -- they recognize ".com" as the default TLD and don't care about its alleged purpose. Back in the eighteenth century, a number of philosophers tried to construct languages to mirror (their views of) the natural order of things -- their dream was a language where a false statement would be ungrammatical and where related concepts would have similar-sounding words. The people who want to "improve" DNS by adding more gTLDs are falling into the same trap. We need fewer gTLDs, not more. -- Does ICANN hate hospitals? (Score:5) Disclaimer: I'm one of the people that've been petitioning for a Currently, the hospitals of the world are randomly scattered across the DNS. For example, Fox Chase Cancer Center is fccc.edu, and Holy Spirit Hospital is HolySpiritHospital.Com, and the American Hospital Directory is AHD.Org. All these are non-profits except possibly the last. The need for a ICANN has refused to discuss the issue except to say that people who supply a solution to the problem (i.e. alternative registries) are the bad guys, destablizing the Internet (ha! I've been using all the major DNS roots simultaneously for years; just add the additional root entries in BIND). I expect that when the --Charlie Re:How Dare They? (Score:3) Although the Internet allows a high degree of decentralized activities, coordination of the assignment function by a single authority is necessary where unique parameter values are technically required. The phrase "single authority" is never good. If not a single authority, then what? What happens when one authority says is 1.2.3.4 and another says it's 4.3.2.1? What happens when i register my-domain.com through Registry A but someone else beats me to it at Registry B? I can't put that domain in my ads, and i certainly can't use it as my email address. Imagine if you saw an ad for 1-800-FLOWERS, but when you went to call it, you got Joe's Crab Shack because you and the placer of the ad used different "telephone authorities". Imagine if you met some hot chick at the local bar and gave her your number, but when she went to call it, she got someone else. You need an "supreme court" of the namespace or else the namespace is useless. -- Re:How Dare They? (Score:3) -- Re:Dynamic Alternates... (Score:4) Completely disregarding the technical side of that concept, and even disregarding how that would work for email, napster, automatic indexing spiders, etc, you wind up with a big problem: It's no longer a Universal Resource Locator. One of the great things about a URL is that it refers to a single, discrete point somewhere. It can be on your harddrive (file:), on a LAN (MyServer//), or on the internet (ftp:, http:). And as for the fellow up above who said "Just add the nameserver to the url", often DNS does not *have* a URL associated with it. For instance, setting up your POP3 or Napster server, you just enter a Domain name. Also, adding an extra bit of text to the domain name to get it to resolve correctly has already been written into the fundimental archetecture of DNS. It's called a TLD... that's what these things are FOR. Namespace collision is the problem, but a combination of politics and no clear orginzational responsibility is the cause. -- Evan Dynamic Alternates... (Score:3) For instance, if cnn.news was resolved twice, once by ICANN, and once by otherDNS (ficticious) then I could simply choose from a popup which site I want, and depending on it's importants it could cache the results for the session, or flag it permanently. Re:Question Authority (Score:3) But collision of domains would be disastrous. It amounts to taking control of the internet from ICANN and giving it to AOL. AOL could easily decide to point microsoft.com somewhere else. Stink. Just because there are shades of gray, it doesn't mean we can't tell black from white But it can keep you from getting the web sites you want. If there were a second slashdot.org that pointed to microsoft's site, how would you get the slashdot you wanted? DNS would be worthless. Boss of nothin. Big deal. Son, go get daddy's hard plastic eyes. Re:Uh... what's wrong with a distributed root, the (Score:5) Mr connerbd, You are hereby notified to cease and desist from any further such posts. As you must be aware, any more discussion of distributed root servers would violate your Windows XP NDA. Without going into particulars, your public disclosure could jeopardize critical intellectual property that would subject you to immediate and severe litigation that would cause your molars to disintegrate. I am referring, of course, to the new Windows XP name server cache, which is meant to enhance the end user experience with increases in efficiency by caching frequently desired URLs, including advanced aliasing, such asthat provides a richer experience and the innovation that our customers have come to expect. Of course the same product includes our advanced Pr0nKiller/anti-terrorist MShopping Cart that will be pre-announced by our Chief Software Architect. Good day. Sternly, Geoffrey P. Foggbottom, JD Required Reading (Score:3) How Dare They? (Score:4) From the ICANN "one root" doc: This document reaffirms ICANN's commitment to a single, authoritative public root for the Internet Domain Name System (DNS) and to the management of that unique root in the public interest according to policies developed through community processes. I bet they'd change their story if it were decided that the "single, authoritative public root" out to be someone other than them. Although the Internet allows a high degree of decentralized activities, coordination of the assignment function by a single authority is necessary where unique parameter values are technically required. The phrase "single authority" is never good. Over the past several years, some private organizations have established DNS roots as alternatives to the authoritative root. Frequently, these "alternative" roots have been established to support for-profit top-level domain registries that have been unable to gain entry into the authoritative root as managed in the public interest by the IANA or ICANN. 'Don't listen to the "other" guys. We're looking out for you.' Yeah, right. Because these alternative roots substitute insular motives for the community-based processes that govern the management of the authoritative root, their decisions to include particular top-level domains have not been subjected to the same tests of community support and conformance with the public trust. Sound anything like Microsoft's "Open Source is unsafe" theory? In other news . . . (Score:3) IBM buys all rights to all acronyms that contain the letter 'I'. The company then proceeded to sue the ICANN, the IETF, SGI and the RIAA unless they removed the 'I' from their acronym within 24 hours. ICANN promptly issued a statement that the would be switching to AYTBTU (All your TLD belong to us) and the RIAA says that they will fight the move in court. Their spokesperson stated SGI also joined in the response saying: "We got 'Open' and 'GL' but no one here ever thought of just the letter 'I'. Market analysts are predicting that other companies would soon follow this lead and begin copyrighting various letters of the alphabet.Stated one: Several bystanders who heard this quote rushed to the courts in order to claim the letter 'M' More information as it becomes available "One World, one Web, one Program" - Microsoft promotional ad 17576 TLDs (Score:3) This will solve the TLD problem once and for all -- plenty of supply for TLDs and new domain names for everyone... (Of course then ultimate TLD will be Uh... what's wrong with a distributed root, then? (Score:4) I guess there's not too much else to say, except for acknowledging that politics will make a mess of things... /Brian Re:I may be an old fart but... (Score:3) Using your example, look at slashdot, there's a If we did this there would actually be a point to adding additional tld's since you'd sit in whichever one made the most sense; instead of getting every one you can get your hands on, no matter if it made any sense at all. And just be a bastard, why don't you just include that tld information into your domain??? slashdotcom.com there you have your two-thirds of domains back I may be an old fart but... (Score:5) What this would get me is the confidence that I can say a Also we don't have lawsuits between joeblow.biz & joeblow.com, etc. since they couldn't exist because they'd have a domain clash. While I'm on a roll (rant), I'd even like it better if you actually had to show you truley belonged in a certain tld (you have to provide network services to be in the I have no idea how to reverse the mess with all the different organization that are in the mess of having conflicts, but I know it could be implented for any new domains. Of course that's me being an old curmudgeon Re:How Dare They? (Score:5) Lie of the 70's = The check is in the mail Lie of the 80's = Trickle down economics Lie of the 90's = I have not had sex with that woman/man/computer/etc. Lie of the 00's = Monopoly promotes innovation -- .sig are belong to us! All your Cartoons !!! (Score:3) [paradigm.nu] Internet DRAFTS, not RFCs (Score:3) The documents do not therefore represent a fight between the IETF and ICANN, nor do they represent the position that the IETF would take. They are simply one person's personal view. The threads reflect the common misconception that DNS is a yellow pages directory. It is not, it is a name service that maps names that are intended to have a meaning fixed over the long term to Internet Protocol addresses that for various reasons are subject to change over relatively short periods of time. The IETF has developed a yellow pages type protocol - CNRP. With CNRP you can type in 'sex' and the client will search as many catalogue servers as you like for pr0n. Queries can also be made more specific, tailoring your search for strip clubs to your geographic locality, fetishes etc. With CNRP it is possible for multiple people to bind to the same index term. With DNS the entire engineering purpose is lost if that happens. The Internet Drafts contain a massive logical falacy. They assume that conflict between 'alternative' roots can be avoided. This is not the case. Most of the new.net domains are also hosted by other irregular roots. In many cases the other alternate roots were up and running earlier than new.net. The idea that 'destabilization' can be avoided by a central actor presupposes that that actor exists and is respected to some degree. Use of the alternative roots is negligible to nil. Nobody uses an alternative root for hyperlinks in public web sites or for email. The only possible use for the alternative roots is as a poor substitute for CNRP - as a service lookup. Since DNS is designed to support the type of use made of it that hyperlinks and email do and is not designed as a yellow pages the only people to be incommoded should ICANN issue a TLD that collides with an irregular one are the operators of the root and the people who paid them money thinking they would buy names. Question Authority (Score:3) The idea that we need a central authority to dictate nicknames is ludicrous. The idea that if nicknames collide, the internet is "destabolized" is equally silly. If more than one agency want to run a nickname listing service, then fine. If that means that when I type in "sex.com" into a browser, I go to 64.28.67.150 and when you type it in, you go to 209.81.7.23 so what? It's my choice which listing service I use. There are over 40 million registered top level domains. NSI gets anywhere from $6-$35 per year for each one. That's $240,000,000 to $1,400,000,000 dollars anually, and they don't even maintain the servers. If this is a public trust, then I'd like to see a public audit of the books. Just because there are shades of gray, it doesn't mean we can't tell black from white. Stabilizing? (Score:3) Well, that may be true... But it seems to imply that everyone wildly creating new TLDs on their creaky 486 Linux box is a stabilizing thing; therefore anybody who creates the same TLD somewhere else is destabilizing the net. This is one way of looking at things, but why should it imply that the first person to get there has some particular right to run that TLD? I do not believe that ICANN "owns" all TLDs, or should have rights to them own them in the future. I'm simply pointing out that anyone can stake out a TLD, whether they have the resources to maintain it or not. Calling this "stabilizing" is a bit misleading. I don't see a problem with ICANN (Score:3) I really don't see what all the hubbub is about. Currently you can buy a domain name of your choosing for $35/yr, I can't think of anything else that gets you anywhere close to that kind of cost/benefit ratio. The money goes to maintain DNS servers that pretty much never go down, that level of reliability is critical for the Internet to function. I've had enough trouble just dealing with ISP DNS servers, a bunch of competing TLD servers are going to cause all kinds of problems if there isn't a centralized controlling presence. As for the dearth of top level names, I still don't see why anyone would care. .com, .org, and .net stopped being meaningful a long time ago and there really aren't too many reasons not to buy a .com. If your chosen name has already been taken, switching to a different TLD is kind of a piecemeal solution. In terms of branding, corporate or personal, you want as simple a domain name as you can get. There are also the international TLDs to worry about; it seems that these definately require a strong centralized authority to dish out. The Internet may provide the illusion of a united world, but things are still very much focused on individual countries and the international TLDs reflect that. Currently each country is given their own TLD which they can treat as national property, that system makes sense to me. Their sovereignty should not be affected by some random reseller. In my mind ICANN provides a much needed layer of stability and control over the Internet. For the Internet to work well, there needs to be some entity that provides such a stabilizing influence. Postel (Score:3) I think we have to understand that this is not a fight we are going to win. We have lost control of the internet. It is in the hands of the companies now. But now what? I think it's time to look at alternatives to "The Internet." It is well within our means to simply use the Internet as a transport method and develop our own networks and interconnect them if we choose. Ok, so some of our ISP's don't want us VPNing, but we can switch ISP's usually. The question is, is it time to walk away from the public, develop technology, and let the public come to us (again)? -- Darthtuttle Thought Architect Re:ICANN ... not. (Score:4) The internet was founded on the idea of routing around damage. How do we route around the cancer that ICANN is becoming? You really should check out OpenNIC (). It's a (seemingly) democratic organization that recognizes the ICANN root, legitimate alternate roots, and its own namespace. What this means is that you can join immediately, your DNS won't be "broken," and you can have a say in how the DNS namespace will be organized. I've only recently signed up, so I don't know yet whether this is the solution, but at least I feel like I'm no longer part of the problem. P.S. The astute reader will note that I have registered "mozhon.net" in the ICANN root. I can only say that it was done some time ago, before I understood my options. I will not renew it.
http://slashdot.org/articles/01/05/30/1720213.shtml
crawl-002
refinedweb
4,105
62.98
[1.1.0] type() types multiple chars with capital Bug Description This is the 2015-09-25 daily. I need to type a capital "V". I've tried both: type("V") and: type("v", Key.SHIFT) In both cases, my app behaves as if I've typed *both* capital and lower case "v". The only relevant debug is: [debug] TYPE "V" [debug] Region: TYPE "V" Or: [debug] ( Shift ) TYPE "v" [debug] Region: ( Shift ) TYPE "v" (not blocking for me, just fyi…) Ok, I'll check when I update, thanks. This is still happening for me, with the 1.1.0 release. A simple (Python) test function as: def testFun3(): init() MyAppRegion time.sleep(3) ... causes the app to behave as if both a V and a v have been sent. If I manually type V and v, the app does the same thing. But if I type just V, or V and V in quick succession -- the app behaves as I'd expect. Possibly of relevance, the essential part of the init() is: MyApp = App("xxx.exe") MyAppRegion = MyApp.focusedWi The app has exactly one window. (but, btw, I can live with this. Getting OCR working is *much* higher priority!!! ;-) ) Sorry, but I cannot reproduce this behavior with different apps: example: # chrome is running App("chrome" win = App.focusedWindow() wait(1) type("l", Key.CTRL) type("v", Key.SHIFT) wait(3) # time to watch ;-) What I see as result is one uppercase v I wonder if, like the other report, it's something that's not seen with chrome, but more with full-screen graphics apps? I'm running a full-screen graphics app in "windowed" mode. Thanks for the hint, but I did not have any problem with the final version of 1.1.0, which is out now.
https://bugs.launchpad.net/sikuli/+bug/1503550
CC-MAIN-2017-13
refinedweb
300
76.11
Mult. The objective of this document is:. In .NET framework, System.Threading namespace provides classes and interfaces that enable multi-threaded programming. This namespace provides: System.Threading ThreadPool Timer Mutex Information on this namespace is available in the help documentations in the Framework SDK. To get a feel of how Threading works, run the below code: using System; using System.Threading; public class ServerClass { // The method that will be called when the thread is started. public void Instance Method() { class Simple { public static int Main(String[] args) { Console.WriteLine ("Thread Simple Sample"); ServerClass serverObject = new ServerClass(); // Create the thread object, passing in the // serverObject.InstanceMethod method using a ThreadStart delegate. Thread InstanceCaller = new Thread(new ThreadStart(serverObject.InstanceMethod)); // Start the thread. InstanceCaller.Start(); Console.WriteLine("The Main() thread calls this " + "after starting the new InstanceCaller thread."); //; } } If the code in this example is compiled and executed, you would notice how processor time is allocated between the two method calls. If not for threading, you would have to wait till the first method slept for 3000 secs for the next method to be called. Try disabling threading in the above code and notice how they work. Nevertheless, execution time for both would be the same. An important property of this class (which is also settable) is Priority. Priority. ThreadPriority.Normal Thread.Priority available, the scheduler cycles through the threads at that priority, giving each thread a fixed time slice in which to execute. As long as a thread with a higher priority is available to run, lower priority threads do not get to execute. When there are no more run able threads at a given priority, the scheduler moves to the next lower priority and schedules the threads at that priority for execution. If a higher priority thread becomes run able,. After you have started a thread, you often want to pause that thread for a fixed period of time. Calling Thread.Sleep causes the current thread to immediately block for the number of milliseconds you pass to Sleep, yielding the remainder of its time slice to another thread. One thread cannot call Sleep on another thread. Calling Thread.Sleep(Timeout.Infinite) causes a thread to sleep until it is interrupted by another thread that calls Thread.Interrupt or is aborted by Thread.Abort. Sleep Thread.Sleep(Timeout.Infinite) When we are working in a multi threaded environment, we need to maintain that no thread leaves the object in an invalid state when it gets suspended. Thread safety basically means the members of an object always maintain a valid state when used concurrently by multiple threads. There are multiple ways of achieving this – The Mutex class or the Monitor classes of the Framework enable this, and more information on both is available in the Framework SDK documentation. What we are going to look at here is the use of locks. Monitor You put a lock on a block of code – which means that that block has to be executed at one go and that at any given time, only one thread could be executing that block. The syntax for the lock would be as follows: lock using System; using System.Threading; //define the namespace, class etc. ... public somemethod(...) { ... lock(this) { Console.WriteLine(“Inside the lock now”); ... } } In the above code sample, the code block following the lock statement will be executed as one unit of execution, and only one thread would be able to execute it at any given time. So, once a thread enters that block, no other thread can enter the block till the first thread has exited it. This becomes necessary in the kind of database transactions required in banking applications and reservations systems etc. Although multithreading can be a powerful tool, it can also be difficult to apply correctly. Improperly implemented multithreaded code can degrade application performance, or even cause frozen applications. This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below. A list of licenses authors might use can be found here At Least , He tried to show to persons who is not aware of Multithreading. Member 4616173 wrote:So if you have one process and 10 threads you are not allowed to use Mutex? General News Suggestion Question Bug Answer Joke Praise Rant Admin Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
http://www.codeproject.com/Articles/8694/Multithreading-Concepts-in-C
CC-MAIN-2015-48
refinedweb
754
63.7
Unity3D AI and Procedural Generation Framework Getting Started The build4_Data folder and the build4 executable together make up the functioning build of our game demo. It’s meant to serve as an example of what you can do using our framework. To use this, download the build4 executable and the build4_Data folder and put them in the same directory. Run build4.exe to play. The src folder contains just the code that we used in this project, organized by what we wrote it for and whether we got it from an outside source. The Prototype folder contains a buildable Unity project folder, complete with the scenes, art assets, and the code in the src folder. Opening the Prototype folder in Unity 5.6 or later gives you access to everything that we had working on the game. Be sure to include all three scenes in Build Settings before building your own executable. End User Guide This portion of the guide is intended for laypeople who are using our system to play on the simple levels we created, or to explore our work and play around with it. Feel free to use it either to learn or just for fun! If you are a Unity Developer looking to use our framework, please jump to “Developer Guide” section. In order to use our framework, you must have have installed Unity on your machine first. Next, download our files and place them in a directory of your choice. Open Unity, and then hit “Open” and choose the folder where you saved the files. Unity will load and compile all the scripts and the environment. If you only want to play the game, you can download and run the compiled executable and skip the above steps (although you won’t be able to see how the game works under the hood). With either the executable or the Unity project available on your computer, you can test run the three scenes in the game. The first scene, “Companion Demonstration,” serves as Level 1. In here, every time you or the companion character collects a gold piece, you get one point. You can engage the Companion by pressing the Right Mouse Button, and then clicking on him with the Left Mouse Button will make him glow. If he is glowing, he is able to be directed around the map. Left clicking again anywhere will cause the Companion to move to that destination. “ProtectorDemoScene” is Level 2, and you get points by catching up to the red wanderer (WandererAI). Getting caught by the large riot cop protecting it (ProtectorAI) makes you lose a point. So watch out: he can be quite fast! “StalkerPredatorDemo” is Level 3. There are no points in Level 3; you must evade the policemen (PredatorAI) and the security drones (StalkerAI) until you get caught. Any time while running the final build of the game, you can change the level or reload your current level by hitting the corresponding number key (1 for level 1, 2 for level 2, etc). To quit, press the Esc key. All three levels have the same player movement controls. You view the tiled map from a first person perspective, moving with the WASD keys or the arrow keys and looking around with the mouse. You can jump with the Space and sprint with Left Shift. Plugging in a gamepad or Xbox controller will also work. Moving and looking around is done with the left and right analog sticks, respectively. Holding down the B button makes your character sprint, and tapping R1 or the right bumper makes your character jump. Developer Guide This portion of the guide is intended for developers who aim to use our system in their project, build on it, and everything in between. We assume you have basic familiarity with Unity’s physics engine, C# scripting, and have already made a practice game or two in some Unity tutorial on the internet. If you don’t fit these criteria, you can still plow along, but we encourage you to search on the web for any Unity terms like NavMeshAgent, RigidBody, etc. that you haven’t encountered before, understand it first, then resume reading this guide. If you are new to Unity and just want to try out the simple levels we created or explore our work and play around with it, jump above to “End User Guide” section. - Part A: Main Character So, you’re out to create your first game with a bunch of characters. Where do you start? Well, you first need to create your main character. Our demo main character is the one you’ll be controlling. That is, your mouse and keyboard instructions (if any) will be directing it. This is in contrast to the NPC (non-playable characters), which control themselves. They will make up a lengthy part of this guide, but let’s talk about getting that player going first! In Assets/Player, you will find a bunch of files, scripts, and very short audio clips for animation sounds. Most of these files come with Unity’s Standard Assets package. They include settings for camera view (for following the player), movement, speed, actions (such as jump or run). If you would like to change any of these settings (for example, change from 1st person view to 3rd person view or change buttons responsible for character’s control), then that could be done inside the Unity engine itself. If you would like to learn more about the Standard Assets package, we encourage you to take a look at Unity’s documentation of it here. The 3 small scripts in the folder were created by us and simply keep track of basic functions such as the player’s score, level selection, and the whether or not the player has been caught by one of our NPCs. Any new scripts that deal with the player should be put in this folder as well. They can be attached to the player as components, and can add a plethora of functions to what the player is able to do. Also note - this is a small programming detail - some variables associated with the player scripts are set to be static. Take the score variable in the PlayerScore script for instance; it is set to static to be easily accessible from outside the script (we can access it by simply saying PlayerScore.score, rather than having to get the script component and access it by that script instance). Why would we want that? Well, many other items, enemies, and objects can potentially influence our score (gold for instance should increment the score when we collect a piece). That means that we want our gold pieces to be able to quickly get at this score variable, so that is one advantage. We also know we only want one score to be kept for the player, and having that variable static forces that to be the case. This is just a small detail, but it can be very useful for many variables associated with the player, as they often need to be easily accessible and only kept once. Further examples include things like health, level, experience gained, current quest, current ammo, and more depending on the kind of game you’re making. We point this out simply because it might be confusing why we set some of these variables to be static and not others, and also because it may be a useful trick for you to use as well. Part B: NPC AI (Non-playable character artificial intelligence)Now comes the fun part: scripting the NPCs! This section might come across as overly detailed at times, but we only do so to take into account all programming and Unity expertise levels possible in our audience. We will first start with the main components, the so called, “Parent class” of our NPCs, and its two helper classes. If you are not familiar with a parent class, fear not: a parent class in programming is simply a common set of functions or features code-wise that will be shared among all child objects. For instance, each NPC will be a child of its parent class “CoreAI”. CoreAI has functions that will be shared among all NPCs like returning the position of the NPC, or moving towards the player, etc. Having this modular design prevents us from redundantly copying code into each NPC (check out the above link for more details on the concept of modularity). - CoreAI Library: This library contains all basic functions that every NPC character will possess, and will have access to. If you are constructing your own character, you can construct a new character in Unity and attach to it the following script and edit it, where the Update() function and other functions you would write would be specific to the NPC character you have in mind. Having your NPC AI a child of the CoreAI module gives it access to all the instance variable and useful functions available in CoreAI. As good practice, always have the CoreAI.cs file open in another tab in your code editor because you would definitely find its functions useful! using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class Your_NPC_AI : CoreAI { protected void Start() { CoreAIStart(); } // Update is called once per frame void Update() { // insert your own code here } } Our comments for the CoreAI module are pretty thorough, so we will direct you to the CoreAI file should you want to see what it offers. For examples, our NPC AIs we created (CompanionAI, GuardAI, PredatorAI, ProtectorAI, SlendermanAI, StalkerAI, WandererAI) all have some degree of usage of the CoreAI functions and instance variables so you can see them in action. You will notice that there’s a Vision.cs and a Movement.cs file in the AI Library folder as well. These files are the two helper classes mentioned above, and they handle some of the implementations for the functions in CoreAI.cs. If you want to see how some of these functions work, feel free to open those files and take a look. If you just want to use the functions in your NPC AI implementation and don’t care how they work, the CoreAI file will handle all your needs. We would like to note one thing however: movement is implemented with Unity’s built-in NavMesh system, and if you want to use our movement functions, you will need to give your NPCs a NavMeshAgent component. The NPCs that we provide will have this, and anything you build off of them should be fine, but if you make something from scratch and want to use our movement functions, make sure to include that NavMeshAgent! NPC_AI Library: The NPC library is composed of sample scripts for some common NPCs. Our goal when producing these NPCs was twofold: first, provide ready-to-use NPC AI scripts for the most common NPCs, with the intention of alleviating the amount of work novice Unity developers need to do when starting to build their game. Second, and most importantly, have examples for how the CoreAI module can be used when making your own NPCs. Below is a summary of our NPCs and their behavior(s). CompanionAI: This script will make its character act as a companion to the main player. By default, the companion is inactive. However, once the player right-clicks, the companion wakes up and will start following the player around. The player can also left-click on the companion character to make the companion stop in place and await directions. Left-clicking on any object or location afterwards will direct the companion to walk to that object or location. Left-clicking on the companion character while he is waiting for directions will tell him to stop listening and begin following the player again. If the player wants to deactivate the companion, they can just right-click again. PredatorAI: This script will make its character be a predator to the player. The predator will not move unless the player comes in its field of vision, at which point the predator will charge (sprint) at the player. If the predator loses the player, it will move towards the last seen position and start looking from there by rotation to see if the player is near. If it finds the player, it charges again. If it doesn’t, it returns to its neutral state at the beginning. WandererAI: This script will make its character wander around aimlessly, changing direction every 20ish units of in-game space. This is reminiscent of pedestrians found in a lot of open-world games. The Wanderer can also be ‘attacked’ or ‘collected’ by the player, and doing so triggers it to be in danger. If the Protector sees that the Wanderer is in danger, it will react accordingly. ProtectorAI: This script will make its character a sort of “body-guard” to the Wanderer. As a result, it follows the Wanderer around and tries to stop the player from reaching it. If the player gets too close, the Protector will move to place itself between the player and the Wanderer, and will face the player. It may also grunt and make noises occasionally, which are signals to the player that they’re too close! If the player physically touches the Wanderer to try to get points, the Protector will realize that you are a threat, and it will charge the player! Music will start as well to signal that the player is in danger from the angry Protector. After some time, the Protector will calm down, and if the player gets far enough away from it, the Protector will forget about you and go back to the Wanderer. StalkerAI: This script will make its character stalk the player. Stalking is defined on these two conditions: the player can never see the stalker move towards it and the stalker must never get too close to the player (defined by some arbitrary unit distance away from the player). Therefore, only when the player does not have the stalker in its field of vision and when the player is not too close will the stalker actually move towards the player. SlendermanAI: This script is weird because the Slenderman NPC is quite literally never seen by the player. In fact, the character doesn’t actually make an appearance in any demo scenes (at least, as far as we know…). However, for a developer, it can come in handy for implementing some Slenderman-like game. The script when attached to any character makes it ALWAYS outside the field of view of the player and within a certain distance away from it. This means that as the player looks around, the Slenderman is always going to be behind it and move accordingly… and just might be programmed to appear when the player least expects it. Part C: Real-time Procedural Generation Procedural generation is awesome. Why? Well, you’re creating visuals, an environment, and basically any data algorithmically at run time rather than pre-made. This saves on heavy designer costs, produces a less expectable game area, and offers customization and novelty on every run of the game. So yeah, it’s pretty awesome. We would like to start with a quick disclaimer though: procedural generation can’t do everything. If you need a well-balanced map for online multiplayer in the next hit shooter, odds are you will need human hands guiding the placement of objects in the scene. Players will be able to tell how much thought went into the level, and when an element of randomness is introduced, it can sometimes result in levels losing their flow. Of course, the genre of game, number of players, and many other factors go into deciding whether procedural generation is the right choice or not. Assuming you know it will work for your game, or you’re just curious, let’s dive on in! In order to use our procedural generation library, you will first have to decide on the Unity prefabs you would want to include. If you want a city-like structure, the prefabs could include concrete, sidewalks, buildings or walls, etc. among other things. Same goes for any environment you want to create, where you at least need a prefab of that object, say a sidewalk prefab, that our procedural generation library can use to replicate hundreds or thousands of in the way you specify. To apply the Random Map Maker to an empty scene, place the C# script on an empty object as a component. It will show up in that object’s Inspector View, with every field labeled. In the Player, Reticle, NPCs column, Floor column, Ground Items column, In Air column, and Walls fields, select the Unity prefab you want to be instanced into the map. For Npcs, Floor, Ground Items, and In Air columns, you can additionally specify the number of different items to use. The numerical fields below these describe other features of the map, including the concentration of items compared to the number of floor tiles, variation in item sizes, and overall size of the map. Note that the Random Map Maker by itself is standalone, without any dependencies on the CoreAI class that our characters use. To make your procedurally generated scenes work with characters, attach Nav Mesh Source Tag components to every floor and wall prefab that the Random Map Maker uses, and a Local Nav Mesh Builder component to any one object in your scene. We recommend placing it on the same empty object that you placed your Random Map Maker on for neatness. From there, run the scene and see what happens! If you notice there are too many items being strewn around your scene, try decreasing the density of the items in the DensityOfItems field in the Inspector View of your procedural generation object. If items in air are being placed too high or too low, adjust your Y Offset variable in that same view. If the NavMesh generation isn’t working correctly, double check that you put Nav Mesh Source Tags on each of the prefabs you gave to the script to place. Once you have a good idea of how changing certain variables changes the map generation, try moving on to the WalledMapMaker script. This procedural generation script differs slightly from the RandomMapMaker script in that it imposes a few more rules on how the map should be laid out. Rather than placing items randomly (like the trees that were randomly placed for Level 2), the WalledMapMaker tries to do what its name implies: place walls in ways that make sense. For Level 3, this meant having rectangular arrangements of walls with varying heights, spacing between the rectangles, and also some missing walls. We wanted to demonstrate the vision of the Predator and Stalker, so we wanted the environment to provide plenty of opportunities for them to see the player, but also for the player to evade them. For a more realistic and less decrepit looking city, walls could be given uniform height, with no probability of being removed. Spacing and sizing could be made more uniform by adjusting the variables in the Inspector View. And if that still doesn’t yield a level that you want for your game, you can try your hand at creating your own procedural generation script! Our advice to you as you try to make your own script is simplify the problem. Thinking in 3D can make it very hard to program your procedural generation, so it’s often easier to think in terms of 2D slices of the map, with each slice increasing in height. Think of 3D printing: objects are created by printing slices and then stacking slices on top of those until it’s done. Your level can be constructed in a similar way, by using a 2D array to layout your ground tiles, another 2D array to layout items attached to the ground, another 2D array to place items in the air, and so on. If you look at our RandomMapMaker script, you’ll see that that’s exactly what we did! On top of thinking about how you want to program your level, you need to think about how you want it to actually look, and what the rules are that govern it. These rules will typically be patterns and probability distributions. For example, RandomMapMaker is built around a uniform probability distribution, and this distribution is what governs where items go. The DensityOfItems parameter is what controls the probability of placing an item. WalledMapMaker still makes use of the uniform probability distribution to some extent, but it also adds in the pattern of the rectangular wall layout. Finding a way to program that pattern into the map over and over made the script very short and sweet, and easy to think about. Long story short, if you can keep the problem simple and programmable, and govern your levels with patterns and probabilities, you can produce your own procedural generation scripts. You may feel limited now in what you can produce, but if you think about how to model the level that you want to create, odds are you can come up with something that will work. Take a look at our two scripts to get a sense of what to do, and then start working! Final Thoughts Whether you’re looking to develop the next big hit, learn a bit more about game development and programming, or just have fun messing around with a cool tool, we hope you’ll be able to get some use out of our little project. We have plans to continue development down the road, adding to the CoreAI library, refining our procedural generation scripts, and adding additional AI NPCs. Hopefully, our project should become big enough to be posted on the Unity store. Our hope is that many people will be able to use our tool to learn about game development, and produce the games that they otherwise didn’t think they would be able to make. There are so many artists and storytellers out there that have ideas to share with the world, and we want them to be able to use what we built to make their work come to life. Thanks for reading, and happy devving!
https://unitylist.com/p/2n7/Unity3D-Open-Source-AI-and-Procedural-Generation
CC-MAIN-2020-24
refinedweb
3,731
67.49
I would you like write a client in python, that send packet to a TCP server. I don't know the server implemantation, but it always return a menù like this (for example after nc server 4444 Make your choice: 1- test1 2- test2 3- insert two numbers 4- test4 5- test5 6- test6 1 (test1) 3 (insert two numbers) 2 1 6 (test6) class Connect(object): def connect(self): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print('connecting to host') sock.connect(('127.0.0.1',4444)) return sock def send(self, command): sock = self.connect() recv_data = "" data = True print('sending: ' + command) sock.send(command) while data: data = sock.recv(1024) recv_data += data print('received: ' + data) sock.close() return recv_data def main(): connect = Connect() connect.send("1") connect.send("3") connect.send("2") connect.send("1") connect.send("6") if __name__ == "__main__": main() Some notes: 1. Don't open and close the connection each time you use send. We don't know the server implementation, but it's absolutely clear that server won't be able to say if it is the same client has reconnected or it's a new client. TCP simply has no tools for this. Even the client port number in your case is chosen randomly by your OS. Open the connection once and close it when you're done. 2. Your are likely to stuck here forever at some point: while data: data = sock.recv(1024) If the server has closed the connection, you may get an exception. If the server hasn't got anything to send, it will wait forever. Use select to check if the server has sent you anything or use settimeout + exception hadnling to make recv wait for a certain time. A quick non-select example of sock.recv replacement of questionable quality: def try_recv(sock, bufsize, timeout): old_timeout = sock.gettimeout() sock.settimeout(timeout) try: data = sock.recv(bufsize) except socket.timeout: data = None sock.settimeout(old_timeout) return data
https://codedump.io/share/0UwhNlMX4JhI/1/python-server-connection
CC-MAIN-2017-17
refinedweb
329
59.8
(13) Mahesh Chand(8) John O Donnell(4) Indika M W (4) Pramod Singh(3) sayginteh (3) andrew.phillips (3) Rajadurai P(3) Shripad Kulkarni(3) Bill Farley(2) Patrick Lam(2) Imtiaz Alam(2) Chandra Hundigam(2) casper boekhoudt(2) Abhijeet Warker(1) Kareem Bawala(1) Bipin Joshi(1) shrijeet (1) Ashish Banerjee(1) Dipal Choksi(1) Paul Lockwood(1) Rahul Sharma(1) John Schofield(1) gary sun(1) Anil Sequeira(1) Neelam Iyer(1) Prasad H(1) Amit Ware(1) Cyberwinds (1) David Kulbok(1) Edwin Lima(1) sami_danish (1) Pasihavia Havia(1) Jibin Pan(1) Leonid Molochniy(1) Abrar Hussain(1) G Gnana Arun Ganesh(1) Scott MacDiarmid(1) Andrew McCarter(1) Alberto Ferrazzoli(1) Joel Matthies(1) Robert Hinrichs(1) David Sosby(1) vus1 (1) TH Mok(1) Doug Bell(1) Mark Johnson(1) Patrick Lundin(1) ivar (1) Robert Keith(1) S.R.Ramadurai, K.Sreenivasan(1) Christopher Hall(1) farazfastian43 (1) Dennis Pratistha(1) Dipal Choksi(1) vivekchauhan (1) Ivar Lumi(1) vanyoe (1) Ranjith (1) Ahmed Al Kayali(1) Resources No resource found Adding Images to ToolBar Button Jan 29, 2000. An article shows you how to add images and tooltips to the toolbar buttons. A GridView Component in C# Apr 05, 2000. This example shows you how I've wrapped a ListView in a UserControl and turned it into a simple grid control. Graphics Animation Sample May 16, 2000. After finishing a text program (lottery) its time for some fun. Everytime a have to work with a new language.I write a small program to bounce some balls in a box. A Simple Calculator Class Nov 28, 2000. Code sample shows how to create a simple calculator class and call it from Main C# program. Tutorial: Working with Toolbars in C# Jan 30, 2001. This tutorial explains you how to add toolbars to a form, load images to the toolbar buttons, and writing event handlers for toolbar buttons.. Windows Calculator in C# Mar 27, 2001. This is a simple Calculator application as you will find in a Windows accessories. Web Request Class Apr 04, 2001. This is a simple application that the gets the source of a webpage via the WebRequest Object.! Serializing Objects in C# May 14, 2001. In simple words serialization is a process of storing the object instance to a disk file. Serialization stores state of the object i.e. member variable values to disk. Deserialization is reverse of serialization.. A Simple C# Utility to Help You Invent Names Jul 10, 2001. I wrote this simple console utility to help me think of a new name for a project I was launching. Sending Mail in ASP.NET using C# Jul 13, 2001. This article contains the listing for a simple web form to send email. MP3 Tag Editor Jul 16, 2001. MP3 Tag Editor is a simple GUI that allows MP3 ID3 (v1.1) tags to be created or edited. . Mastermind Game in C# Aug 10, 2001. This is the game of Mastermind written in C#. The game is played by clicking on a set of 4 colors and then hitting the score button. Colors can repeat themselves in this game, so be wary! Simplest way to Create and Deploy Web Services Aug 20, 2001. This article explains how to create and deploy a simple Web Service. Displaying Exception Information Aug 21, 2001. This is a simple utility to display exceptions. Each exception in the chain is added to an ArrayList and displayed in reverse order in a ListView control. Scribble in C# Aug 24, 2001. Here is a simple scribble C# program you can change the color and the pen width. C# Tokenizer Aug 27, 2001. A simple tokenizer in csharp without using regex or MatchCollections.. Socket Programming Oct 01, 2001. This is a simple Client/Server program showing the communication taking place between the client and the server.. Calculator in C# (Windows Application) Oct 19, 2001. This is a simple calculator program that was written using Visual Studio.NET and C#. Tray Bar Application Oct 30, 2001. This is a very simple C# application which implements those very familiar Windows applications with a tray Icon. Components in C# Nov 06, 2001. The components creation and usage in C# is much more simple than earlier technologies like C++, ATL, COM. Implementing Stacks in C# Nov 06, 2001. With the help of C# we can also implement ADT (Abstract Data Types) with little effort. An example of ADT is a simple stack of integers. Charting in GDI+ Nov 07, 2001. Here is an example of creating simple charts using GDI+ commands in C#. I have used the random class to create 5 random percentage values. I then use GDI+ to plot these values on a chart.... CartWheel Man - Animating GraphicPaths Nov 27, 2001. This simple application illustrates how GraphicsPaths can be animated to look like something is moving across the screen... Using MS Agent in C# - Part-III Jan 09, 2002. In this article, I will show you how to write a program which lists all the animations of the loaded characters which speak to us using synthesized speech, recorded audio, or text in a cartoon word balloon. Custom FileDialog Jan 18, 2002. The purpose of this article is to give a simple example showing how easy it is to create a custom FolderDial. An Animation Component using C# Feb 08, 2002. Sometimes its desirable to get those graphics moving a bit and this article show the control to implement. A Wheel Control in C# Feb 15, 2002. This article describes a simple Windows control written in C# that simulates a wheel knob like that on your walkman used to change volume.. Authenticate Web Service Mar 04, 2002. In this example we will build a web service that authenticates userid and password from an a very simple MS Access database. This web service exposes only one method to the client.. XbWrapper - Xbase Interpreter Mar 15, 2002. XbWrapper-Xbase script inter XbWrapper is a simple scripting language. It is intended to use as an embedded language in other C# programs. Peer-to-peer Chat Program using Asynchronous Socket Mar 22, 2002. This is a simple chat program, which uses asynchronous socket to provide connection between two machines. .NET Remoting: The Simple Approach Mar 26, 2002. .NET Remoting provides a powerful and high performance way of working with remote objects. Architecturally, .NET Remote objects are a perfect fit for accessing resources across the network without the overhead posed by SOAP based Web services. Simple NSLookUp Implementation in C# Apr 01, 2002. This is code implementation for simple nslookup. As you can see from the code listing, I've used classes defined in the System.Net namespace.. Outlook Bar Control Apr 18, 2002. This is a simple control similar to the OutlookBar. The attached zip file contains two Visual Studio .NET projects.. A Simple Contacts List for Pocket PC May 19, 2002. I have implemented a simple contact list application that is capable of adding and viewing contact details. Understanding Destructors in C# Jun 18, 2002. This article is about understanding the working concept of destructor in C#. I know you all may be thinking why a dedicated article on simple destructor phenomenon. Imlememnting Drag and Drop in ListView Controls Jul 08, 2002. Drag and Drop operations in Windows can be achieved using 3 simple events - DragEnter, DragLeave, and DragDrop.. Code Internationalization Aug 06, 2002. This is a very simple windows application example for localizing the application. Visual studio .NET makes it pretty simple to create localized applications and manage ... Remote Procedure Calls using SOAP Oct 04, 2002. Here is the sample RPC (remote procedure call) using SOAP ( simple object access protocol).... About Simple-Button-Animation.
http://www.c-sharpcorner.com/tags/Simple-Button-Animation
CC-MAIN-2016-36
refinedweb
1,294
67.35
K-Means is one of the simplest unsupervised clustering algorithm which is used to cluster our data into K number of clusters. The algorithm iteratively assigns the data points to one of the K clusters based on how near the point is to the cluster centroid. The result of K-Means algorithm is: - K number of cluster centroids - Data points classified into the clusters Applications: K-Means can be used for any type of grouping where data has not been explicitly labeled. Some of the real world examples are given below: - Image Segmentation - Chromosome segmentation - News Comments Clustering - Grouping inventory by sales activity - Clustering animals - Bots and Anomaly Detection Outline of the algorithm: Assuming we have input data points x1,x2,x3,…,xn and value of K (the number of clusters needed). We follow the below procedure: - Pick K points as the initial centroids from the dataset, either randomly or the first K. - Find the Euclidean distance of each point in the dataset. Euclidean Distance between two points in space: If p = (p1, p2) and q = (q1, q2) then the distance is given by Implementation: def euclidean_distance(point1, point2): return math.sqrt((point1[0]-point2[0])**2 + (point1[1]-point2[1])**2) Assigning each point to the nearest cluster: If each cluster centroid is denoted by ci, then each data point x is assigned to a cluster based on here dist() is the euclidean distance Implementation: #find the distance between the points and the centroids for point in data: distances = [] for index in self.centroids: distances.append(self.euclidean_distance(point,self.centroids[index])) #find which cluster the datapoint belongs to by finding the minimum #ex: if distances are 2.03,1.04,5.6,1.05 then point belongs to cluster 1 (zero index) cluster_index = distances.index(min(distances)) self.classes[cluster_index].append(point) Finding the new centroid from the clustered group of points: Si is the set of all points assigned to the ith cluster. Implementation: #find new centroid by taking the centroid of the points in the cluster class for cluster_index in self.classes: self.centroids[cluster_index] = np.average(self.classes[cluster_index], axis = 0) K-Means full implementation The above program creates a sample set for 4 clusters and then performs K-Means on it K-Means implementation using python sklearn: from sklearn.cluster import KMeans import numpy as np import matplotlib.pyplot as plt from sklearn.datasets.samples_generator import make_blobs #generate dummy cluster datasets K = 4 X, y_true = make_blobs(n_samples=300, centers=K, cluster_std=0.60, random_state=0) k_means = KMeans(K) k_means.fit(X) cluster_centres = k_means.cluster_centers_ y_kmeans = k_means.predict(X) plt.scatter(X[:, 0], X[:, 1], c=y_kmeans, s=50, cmap='viridis') for centroid in cluster_centres: plt.scatter(centroid[0], centroid[1], s=300, c='black', alpha=0.5) Output from the above program: The output of the clustering we wrote from scratch is similar to the one we get by using the sklearn library. Choosing Initial centroids In our implementation we chose the first 4 points as our initial cluster centroids which may give slightly different centroids each time the program is run on random dataset. We can also use the K-means++ method to choose our initial centroids. k-means++ was proposed in 2007 by Arthur and Vassilvitskii. This algorithm comes with a theoretical guarantee to find a solution that is O(log k) competitive to the optimal k-means solution. Sklearn KMeans class uses kmeans++ as the default method for seeding the algorithm.
http://muthu.co/mathematics-behind-k-mean-clustering-algorithm/
CC-MAIN-2018-43
refinedweb
580
52.8
0 Hi! I am using Dev-C++ and when I am trying to compile a program in it, it is showing many errors. All the settings seems to be right. Can I compile a program including header files like conio.h and iostream.h and using namespace std in Dev-C++? If not please suggest a good compiler in which I can do a program containing the header files mentioned above. I tried doing the same program in turbo C++ and microsoft visual studio 2010 express and it is working properly. If this problem in Dev-C++ is due to any settings that has to be done, please tell. I have installed Dev-C++ correctly. Someone, please help me out!:confused:
https://www.daniweb.com/programming/software-development/threads/371113/problem-of-compiling-a-program-in-dev-c
CC-MAIN-2017-17
refinedweb
121
76.82
Goal Using the Hotwire, show how to setup a basic implementation of a modal with a form. We'll break this down into talking about the controller, view templates and javascript. There are many other things that were setup in the example application due to the choices made in the tech stack and some setup/configuration has been derived from things learned on Go Rails. We'll assume some familiarity with Stimulus in order to keep focused on the benefits of Turbo. Source code for this guide - updated to turbo-rails 0.5.9 Posts page being referenced Creating a new post using the modal New link and modal setup Note this github comment is what I used as guide for this setup. This all starts in index.html.erb <%= turbo_frame_tag 'post' %> <div class="mt-8" data- <%= render partial: 'posts/modal_form' %> ... <%= link_to 'New Post', new_post_path, class: "btn btn-primary", data: { action: "click->post-modal#open", 'turbo-frame': 'post' } %> turbo_frame_tagallows us to tell turbothat links with a matching data-turbo-framevalue matching it will return an html response including a matching frame tag(not sure on this wording, as we supply it here to merely tell turboto leave the url unchanged when the link is clicked). Our action upon New Postclick will be a replace that is defined in the new.html.erb template. This will populate the modal via use of the targetvalue on the turbo-streamelement in the template. - render our modal_formpartial which will contain the modal definition and define a divwith an idthat the turbo-streamresponse replaces. data-controller="post-modal"names our post-modalcontroller and causes it to connect on render. data-post-modal-prevent-default-action-opening="false"will allow us to open the modal with the link and also fetch new_post_pathfrom the controller and render our modal content. Clicking the New Post link This action will take us into the posts_controller.rb. def new @post = Post.new end - We render the html response of new.html.erb <%= turbo_frame_tag 'post' do %> <turbo-stream <template> <%= render partial: "posts/form", locals: { post: @post } %> </template> </turbo-stream> <% end %> - We render the turbo_streamresponse inside the template with a target that matches the idinside the modal. This will then replace that element inside the modal with our form content. - Below is an example response - While the data is being fetched, the modal is given the signal to open, so we'll listen for an event from another Stimulus controller. That controller is the post_form_controller.js, and it keeps us from seeing unprepared html and stale data from an invalid form submission. - We can achieve that by adding an eventListenerto post_modal_controller.js's open function. - this is extended from the original modal supplied from tailwindcss-stimulus-components document.addEventListener("postForm:load", () => { this.containerTarget.classList.remove(this.toggleClass); }); - The above is done in order to take advantage of the connectCallback that seems to be the only way to know when the replaceaction from turbo-streamis completed. Rendering the response At this point the modal that is defined in _modal_form.html.erb is opening and this element below is being replaced with the turbo-stream response that has the rendered form. <%= tag.div nil, id: 'post_form' %> Submitting the form When we submit the form, the modal closes via close function in the extended post-modal stimulus controller and reach the create method in the posts_controller.rb def create @post = Post.new(post_params) respond_to do |format| if @post.save format.html { redirect_to posts_url, notice: 'Post was successfully created.' } else format.turbo_stream do render turbo_stream: turbo_stream.replace('post_form', partial: "posts/form", locals: { post: @post }) end end end end - If successful, we'll just redirect to the page the modal is launched from, and flash a message. This will all feel seamless since Turbo takes care of replacing items in place; negating the need for a full page reload. - When the form submission is not successful, turbo_streamformat is rendered and the form is replaced(leaving the modal open and adding in the errors automatically) Editing a post using the modal This uses the same concepts as the new submission and starts off in index.html.erb as seen below. <div class="align-middle min-w-full overflow-x-auto shadow overflow-hidden sm:rounded-lg" data- <table class="min-w-full divide-y divide-cool-gray-200"> <thead> <tr> <th class="px-6 py-3 bg-gray-50 text-left text-xs leading-4 font-medium text-cool-gray-500 uppercase tracking-wider">Title</th> <th class="px-6 py-3 bg-gray-50 text-left text-xs leading-4 font-medium text-cool-gray-500 uppercase tracking-wider">Body</th> <th colspan="1" class="px-6 py-3 bg-gray-50 text-left text-xs leading-4 font-medium text-cool-gray-500 uppercase tracking-wider"></th> </tr> </thead> <tbody class="bg-white divide-y divide-cool-gray-200"> <% @posts.each do |post| %> <tr> <td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-cool-gray-900"> <%= post.title %> </td> <td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-cool-gray-500"> <%= post.body %> </td> <td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-cool-gray-500"> <%= link_to 'Edit', edit_post_path(post), class: "btn btn-secondary", data: { action: "click->post-modal#open", 'turbo-frame': 'post' } %> </td> </tr> <% end %> </tbody> </table> </div> The rest of edit and delete can be found in the example application In closing Disclaimer: The code above is far from perfect In some places the implementation could definitely use refinement(feel free to suggest an improvement). I chose a modal here as I had that particular issue to solve on a project and didn't see a ready-made solution/guide. Overall I am happy with what Turbo enables and appreciate how the hard work of others to build these types of things, make it easier for everyone else to produce things quickly. Discussion (13) I don't like the fact of render edit partial on each iteration :/ Yep...that could likely be refactored to only put in one edit modal for entire page as an optimization I've fine tuned this a bit to only edit one modal - could likely go further and make it one modal skeleton/post-modal stimulus controller instance for entire page if desired. Let me know what you think - gitlab.com/doug.stull/turbo_modal I've further refactored it now to only render a modal skeleton once and utilize that for both newand editand updated this post - thanks for the nudge in a better direction! Do you know how we can run some JS when form appends? I'm using selectize, the first time works with turbo:loads, but not then because turbo just fires when the history changes :/ I don’t know how...yet. I had same issue with wanting to trigger showing the modal when it was finished rendering. In my case I hacked it with a 200ms timeout in the post-modal controller. Maybe someone will come along with an a solution. Hahaha yes, I think that too but it didn't works in slow conections So I have an initial work-around - not what I'd consider a final solution(it works), so I opened an Merge Request while I think about it more - should likely try to figure out what magic connectis using instead of creating a new stimulus controller. gitlab.com/doug.stull/turbo_modal/... edit: And here is more of the turboway to do it, though I have some reservations that it is the event I need to listen to...will have to try initializing something JS wise like a select element to feel confident in this approach gitlab.com/doug.stull/turbo_modal/... This is my temporary solution (it sucks, i know 😂): $(document).on("turbo:before-fetch-response", function(){ var checkExist = setInterval(function () { if ($('.selectize#item_category_ids').length) { $(".selectize#item_category_ids").selectize({ create: function (input, callback) { $.ajax({ method: "POST", url: "/categories.json", data: { category: { name: input } }, success: function (response) { // call callback with the new item callback({ value: response.id, text: response.name }); } }); }, }); clearInterval(checkExist); } }, 100); }); I don't think it is that bad actually. However, I think this is the correct solution see my latest commit on gitlab.com/doug.stull/turbo_modal/... reasoning: connectis the only thing that is sure that the stream as finished rendering. See if that works for you? Awesome, thank you! Thank you, for providing great feedback that helped with the iteration here! I tried this solution with slim select and of course the customary console.logdebugging and it seems to work for me, so I merged it and updated the blog post. I've updated the code used in this post with the latest release of turbo. I had to change how things loaded a bit and rely on turbo include tag to load turbo correctly. Webpack loading was having issues with any update of turbo-rails past 0.5.3. Latest commit shows the updates gitlab.com/doug.stull/turbo_modal/...
https://practicaldev-herokuapp-com.global.ssl.fastly.net/dstull/how-to-use-modals-with-forms-in-rails-using-turbo-14n7
CC-MAIN-2022-27
refinedweb
1,503
53.92
Opened 6 years ago Last modified 2 years ago That is, instances where either the class or the type constructor is defined in the module but not exported. I'm interested in implementing this, but not sure about the right semantics. In particular, it seems to me that the right granularity is package, not module. E.g. there might be an "internal" module which exports a datatype, which is an instance of an exported type class. If the datatype is not exported by any of the exposed modules, we don't want its existence to leak to the outside via this instance. But haddock doesn't know about packages, as far as I understand. Any ideas on how to tackle this? I haven't verified, but my first guess would be that Cabal passes --hide=... for all modules that are not exported.. I'm not doing the review, that is David's privilege. But I tried it, and it seems to work very well. One concern: if I understand correctly, the test case does not test correct handling of --hide at all, right? I think it would be possible to test this like so: {-# OPTIONS_HADDOCK hide #-} module Foo where -- | Should be visible class Foo a -- | Should be visible data Bar -- | Should be visible instance Foo Bar -- | Should *not* be visible data Baz -- | Should *not* be visible instance Foo Baz module Bar (Foo, Bar) where import Foo if I understand correctly, the test case does not test correct handling of --hide at all, right? if I understand correctly, the test case does not test correct handling of --hide at all, right? That's true. Having a test as you suggested would be great indeed, but I don't think the current testing system supports multi-module tests. (Or maybe I'm wrong?) Actually, Simon has already implemented the two-module test, which is now in my branch as well. Apart from the fact that one more file now lacks a .ref file, it seems to work well. Note: I renamed the repo, now it's (branch hiddenInstances). Btw, the patches are still there and waiting for a review. This will be include with 2.13.0. By Edgewall Software. Visit the Trac open source project at
http://trac.haskell.org/haddock/ticket/37
CC-MAIN-2014-52
refinedweb
375
73.17
Iteration in Scala - effectful yet functional Iteration in Scala - effectful yet functional Join the DZone community and get the full member experience.Join For Free How do you break a Monolith into Microservices at Scale? This ebook shows strategies and techniques for building scalable and resilient microservices. In this post I look at some of the traversal patterns' functional implementations using scalaz. In the paper on applicative functors, McBride and Paterson defines traverse as an applicative mapping operation .. traverse :: Applicative f => (a -> f b) -> [a] -> f [b] Gibbons et. al. uses this abstraction to study various traversal structures in the presence of effects. The paper starts with a C# code snippet that uses the syntax sugar of foreach to traverse over a collection of elements . public static int loop<MyObj> (IEnumerable<MyObj> coll){ int n = 0; foreach (MyObj obj in coll){ n = n+1; obj.touch(); } return n; } In the above loop method, we do two things simultaneously :- - mapping - doing some operation touch() on the elements of coll with the expectation that we get the modified collection at the end of the loop - accumulating - counting the elements, which is a stateful operation for each iteration and which is independent of the operation which we do on the elements traverse looks ugly - it's there because scalac cannot infer partial application of type constructors, a problem which will be rectified once Adriaan fixes issue 2712 on the Scala Trac. Traverse is one of the functors Traverse type is the pure function that maps on the elements of the collection, g is the function that does the effectful accumulation through the State monad. Using collect, here's a version of the C# loop method]) =label(List(10, 20, 30, 40)) should equal(List(0, 1, 2, 3)) disperse(t, ((a: A) => state((i: Int) => (i+1, i)))) ! 0 disperse can also be used to implement the wordCount example that ships with scalaz distribution. Actually it counts the number of characters and lines in a stream. def charLineCount[T[_]:Traverse](t: T[Char]) =charLineCount("the cat in the hat\n sat on the mat\n".toList).last should equal((35, 2)) disperse(t, ((a: Char) => state((counts: (Int, Int)) => ((counts._1 + 1, counts._2 + (if (a == '\n') 1 else 0)), (counts._1, counts._2))))) ! (1 }}
https://dzone.com/articles/iteration-scala-effectful-yet
CC-MAIN-2018-30
refinedweb
383
51.58
Competitive Programming With Swift. This is a cool hobby to have, and as a bonus you'll even be indirectly preparing yourself to the feared Big 4 interviews where you have to solve algorithm problems in a whiteboard! Even though in a real competition coding in Swift would be a big disavantage (as it's slightly slow compared to other languages and has few native data structures), lots of popular online platforms like LeetCode, HackerRank and Codefights support Swift and they are a great way to make yourself a better iOS developer, specially since competitive problems will only accept very fast algorithms as possible solutions. If you've never did this before, I highly recommend giving it a shot. In this article, I'll give a brief tutorial on how to use Swift to read input data and some tips for tackling competitive problems in Swift. Reading Standard Input with Swift In competitive programming, the problem's input is usually fed into a command line application which makes some sense of it and prints the desired result. Platforms like LeetCode and CodeFights will automatically process input data for you and expose an empty Swift method that should return the problem's solution, but other platforms like HackerRank will sometimes have you manually read, parse the standard input and then print the result. Thankfully, that's not as complex as it sounds. To simulate a competitive programming environment, create a Command Line Tool project in Xcode: Be aware that a Command Line Tool is not a Cocoa app, so you'll have no access to things like UIKit! The core frameworks like Foundation are all you have here. In main.swift, type and run the following code: let line = readLine() print("Got something! \(line)") At this point, the program will be frozen. readLine() is a Standard Library method that synchronously reads the standard input and returns a String? once a full line is retrieved or nil if EOF is reached. If you type something in Xcode's console, the program's execution will continue and print what you wrote: However, a competitive programming problem will likely have several hundred lines of input. You can use a while loop to make your code run until the input ends: while let line = readLine() { print("Got something! \(line)") } That is all you need to know to get started. From here forward, your skill with pure Swift is the only variable. Here's an example problem if you've never done this before: Example Problem Given an array of integers, find the sum of its elements. Input Format The first line contains an integer, denoting the size of the array. The second line contains n space-separated integers representing the array's elements. Output Format Print the sum of the array's elements as a single integer. Sample Input 6 1 2 3 4 10 11 Sample Output 31 Solution Every problem has multiple possible solutions. For this one, we can harness the power of reduce: import Foundation _ = readLine() //Read and drop the array size line. //Knowing the size of the array beforehand is needed for some languages //But as readLine() returns the whole line, Swift doesn't need it! let array = readLine()!.components(separatedBy: " ").map { Int($0)! } let result = array.reduce(0, +) print(result) Swift tips for Competitive Programming The beauty of competitive programming is that merely solving the problem is not enough - your program must solve it as fast as possible. There's a lot to talk about runtime complexity, but this section is supposed to cover Swift tips that are useful when things need to be quick. If you have a tip that is not here, feel free to contact me and I'll add it and credit you! Use Overflow Operators Swift naturally protects you from numbers overflowing at the cost of performance. This can cost you some valuable nano-seconds, and some problems might even want you to overflow numbers. Luckily, Swift has special arithmetic operators that ignore overflow checks, making them faster than the regular operators: 1 &+ 1 1 &- 1 1 &* 1 1 &>> 1 Printing is slow The print(_:) method is very slow, and it can be particularly painful when printing things like Arrays. You can gain some performance if you print everything at once. let array = [String](repeating: "A", count: 1000) for a in array { print(separated, terminator: " ") // slow } ///// let separated = array.joined(separator: " ") print(separated) // a lot quicker, even though we're processing the array beforehand Allocate Array capacities in advance Swift's Arrays have dynamic sizes, meaning that the language automatically allocates more memory space for it as it increases in size. Even if this is quite fast, you can make it even faster if you know the array size in advance by using the Array.reserveCapacity(_:) method. This is useful if you have a problem where the solution is an Array with a specific size. let arraySize = Int(readLine()!)! var array = [Int]() array.reserveCapacity(arraySize) //Runtime is slightly slower without manually setting the array's capacity. for i in 0..<arraySize { array.append(solve(for: i)) } Alternatively, you can use the repeating:count: initializer when you need a pre-filled array: let fiveZs = Array(repeating: "Z", count: 5) print(fiveZs) // Prints "["Z", "Z", "Z", "Z", "Z"]" Abuse Implicitly Unwrapped Optionals While the dreaded ! should be avoided in real applications, safety is not a concern in competitive programming. Since inputs are guaranteed to always be the same, you can completely skip the overhead of unwrapping optionals. Use inout - Dmitry Volevodz Using inout arguments can be really useful when passing data around recursive functions, and I was able to confirm that inout arguments are even faster to create than regular ones when passing around value types with inner reference types. Subtract Dates to measure performance - Rodrigo Carvalho The following snippet will measure how long it takes to run something: func measure(function: () -> Void) { let start = Date() function() let end = Date() print("Elapsed time: \(end.timeIntervalSince(start))") } measure { timeIntensiveTask() } This can be useful when you have multiple approaches and is not sure which one is faster. Be sure to run this with optimizations turned on to properly measure things, as most of the Swift compiler's tricks require it. Swift Algorithm Club Most competitive programming problems will rely on a specific data structure, and since Swift unfortunately has no native support for most of them, that means you'll have to code them yourself. Fortunately, the swift-algorithm-club repo has Swift implementations of pretty much everything, making it a great place to learn how to code popular data structures in Swift. What else? Regardless if you are studying for an interview, wanting to compete at world events or just trying to get better at iOS development, solving competitive programming problems is a very interesting way of increasing your Swift skills. I've personally benefited a lot from it, and would love to know what you think of it. Follow me on my Twitter - @rockthebruno, and let me know of any suggestions and corrections you want to share. References and Good readsBig O Notation Performant Arrays In Swift Apple Docs: readLine() Contact InfoBruno Rocha is an iOS Software Engineer and is the developer of open sources libraries like SwiftInfo and SwiftShield. bruno@swiftrocks.com
http://swiftrocks.com/competitive-programming-with-swift.html
CC-MAIN-2019-47
refinedweb
1,219
50.06
fork1(2) [opensolaris man page] fork(2) System Calls fork(2) NAME fork, fork1, forkall, forkx, forkallx - create a new process SYNOPSIS #include <sys/types.h> #include <unistd.h> pid_t fork(void); pid_t fork1(void); pid_t forkall(void); #include <sys/fork.h> pid_t forkx(int flags); pid_t forkallx(int flags); DESCRIPTION: descriptors and directory streams. Each of the child's file descriptors shares a common file pointer with the corresponding file descriptorlimit(2). The it_value and it_interval values for the ITIMER_REAL timer are reset to 0; see getitimer(2). o The set of signals pending for the child process is initialized to the empty set. o Timers created by timer_create(3C) are not inherited by the child process. o No asynchronous input or asynchronous output operations are inherited by the child. o Any preferred hardware address tranlsation sizes (see memcntl(2)) are inherited by the child. o. Threads(). Fork Extensions The forkx() and forkallx() functions accept a flags argument consisting of a bitwise inclusive-OR of zero or more of the following flags, which are defined in the header <sys/fork.h>: FORK_NOSIGCHLD Do not post a SIGCHLD signal to the parent process when the child process terminates, regardless of the disposition of the SIGCHLD sig- nal in the parent. SIGCHLD signals are still possible for job control stop and continue actions if the parent has requested them. FORK_WAITPID(). fork() Safety inter- faces." RETURN VALUES. ERRORS The fork(), fork1(), forkall(), forkx(), and forkallx() functions. The forkx() and forkallx() functions will fail if: EINVAL The flags argument is invalid. ATTRIBUTES See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe. | +-----------------------------+-----------------------------+ |Standard |See below. | +-----------------------------+-----------------------------+ For fork(), see standards(5). SEE) NOTES. SunOS 5.11 28 Oct 2008 fork(2)
https://www.unix.com/man-page/opensolaris/2/fork1/
CC-MAIN-2022-40
refinedweb
298
66.23
The datetime module supplies classes for manipulating dates and time. We will display different formats like day of the week, week number, day of the year, etc. Step 1: Import datetime. Step 2: Print day of the week. Step 3: Print week number. Step 4: Print day of the year. import datetime print("Day of the week: ", datetime.date.today().strftime("%A")) print("Week number: ", datetime.date.today().strftime("%W")) print("Day of the year: ", datetime.date.today().strftime("%j")) Day of the week: Sunday Week number: 06 Day of the year: 045 The arguments of the strftime() function are explained below:
https://www.tutorialspoint.com/python-program-to-display-various-datetime-formats
CC-MAIN-2021-25
refinedweb
102
71.1
They've also written some apps that are 100% GPL - for example Wix ( ), note too that Wix is apparently the primary installer platform used by Microsoft internally (Office, etc.) - at least from what I've heard. Hmm....I think they might have changed it since I last looked at it (long ago). Can't find the software on my local system to verify though...so I may have been wrong. But I believe it was originally released under the GPLv2 license. Doesn't surprise me though. Of course we believe Microsoft are playing nice with the open source world, after all, the EU is not investigating them AGAIN making them interoperable ? yeah, right. Edited 2008-01-25 21:49 UTC Colour me sceptical, but I just visited the website for "Port 25", the Microsoft open source software lab. It's about as busy as a cemetery. Bill Hilf has managed one blog entry in six months, which is better than some of the others who've managed none in over a year. The only exception is Sam Ramji who blogs plenty. There's hardly anything to read or any menus on the site taking you to deeper and more interesting things and their most "active" visitor last turned up several months ago, then stopped. Maybe the plague got him. In short, there's no beef anywhere on view. What happened? I'm wondering: has almost the entire Microsoft open source and interoperability labs crew been kidnapped by a borg and placed in an isolation cell on the planet Zanussi, or what? I'm not surprised: 1. Open source development is an anathema to Microsoft. They don't get it and it threatens their business model. Culturally, the organisation will never accept it, so that means they will be incapable of spending any real time or effort on it. 2. It takes more than a couple of new licenses and a few funded projects to get some open source projects to a critical mass and have them survive. Just ask Sun. You have to get people involved doing a lot of diverse things to get anything really happening. 3. Those people also have to feel that they're getting something back in return, and they're not just doing market research for the parent company or that their code, produced in their own time and off their own bat, is simply used by someone else to make money:... The notion that somehow Microsoft can claim that they're now an open source company (look at the phrase they use - "Open for Business"!) is laughable, and it's funny and a bit sad to see them thrashing around and throwing out soundbites over something they don't get conceptually or culturally, and something their management will absolutely not accept unless it can be used as marketing. Open source development is an anathema to Microsoft. Of course. But shh!, the trick is not to say so too loudly. There's a certain black humour in watching their antics. The senior management cadre know the score full well, I'd imagine. From time to time they flick a lizard glance at such suckers typo incorrigible optimists as they've managed to rope in. An outfit from Utah is giving good dance for its 300 million bucks. Lizards approve. But there's also a sadness in seeing energetic, feisty young people becoming involved, taking a job with the Man and then running themselves into the sand because the organization doesn't get it and won't stand for it. I hope those young hires swifty find something better for themselves and their talents. A nice quote from John Naughton's blog about the Davos gabfest sums this up rather well: "Bill Gates delivered his plea for a kinder, gentler capitalism, for example, which is bit like hoping that wild boars will learn to respect suburban flower-beds." Or Foss and the open source method. ha ha ha ha What efforts!!!? What a joke. In all fairness I don't know if MS could get an open source community going, assuming they actually did want to. Most MS fan boys don't actually care about writing open source code they only like talking about. In the end all Microsoft has to do is talk about it, and they are happy. Kind of a double reach around. Yes, Microsoft are now actively helping to bring the world increased interoperability by creating new and important standards for us to all the interoperate with, like OOXML, Silverlight or Metro. I guess if you have one open standard that's good for interoperation, so if you have two standards that must be twice as good, right? Not buying that huh? Well, IE8 will be standards compliant. Apart from stuff like ActiveX obviously, but who uses that on the web apart from er, Microsoft? Damn. Help me out here! Sometimes, yes. In the case of OOXML, for example, some people believe that OOXML simply provides a better overall solution than ODF (and its successor). See That's nice. Why couldn't Microsoft have simply sat on the Oasis committee to ensure their obviously deep seated concerns over ODF were addressed in the standard, instead of mucking about creating a new one of their very own after ODF was ratified? That's a rhetorical question: anyone who's been awake the past two decades already knows the answer to this.. That's a great phrase. I'm going to try to work that phrase into an every day conversation now. Yuh huh. Sun, Novell, IBM and everyone else on OASIS decided that having Microsoft work with them on an Open Standard that would be submitted for ISO ratification was a bad thing, so they started being mean and nasty to poor old Microsoft. What bullies! The clue train has left the station. Yes they were some kind of member in OASIS, and there is no reason in the universe that they couldn't have added the features that they needed trivially. That is an excuse for the NIH syndrome and coming up with their own pretty broken format. Do you have any specific evidence for that, and any occasions where people would not have accommodated Microsoft's additions for their Office formats? More to the point, do you have any evidence at all that Microsoft was even involved at all with ODF or OASIS and that they tried to make any contributions? If you can't do that then you're talking out of your posterior. As per usual, your link and what is in it is utterly worthless. There is no evidence that the independent study is all that independent, and has been regurgitated by clueless people the world over, and features absolutely cast-iron reasons as to why you would use Microsoft's OOXML (they're not the same thing) such as. It of course neglects to tell us what these reasons are, and the notion that ODF cannot replicate Microsoft Office fidelity is a lie. The problem is going the other way, and converting from ODF to OOXML. ODF supports an awful lot MSOOXML simply doesn't. ODF is insufficient for complex real-world enterprise requirements, and it is indirectly controlled by Sun Microsystems, despite also being an ISO standard. When you read a statement like that, you are entitled to question the independence of the report. Who is OOXML directly controlled by again? I forget. there is some truth to the statement that the ODF people cut out the Microsoft people from putting all the features in MS office into ODF. Much of MS Office functionality things like OLE and such are implemented as binary program blobs inside the raw .doc/.xls/.ppt file. The choice was made in ODF to leave such programatic support out in favor of letting the Application take care of those features at this time thru open scripts. For the multiple, cross-integration that microsoft does, that would be a show stopper as was no Embedded language control at that level included in the ODF specs. It's a case where Microsoft's current path is really ahead of the pack, but it's also a dead-end road for anybody EXCEPT Microsoft to implement. Remaking history? Microsoft has been asked repeatedly to join the ODF creating group, administratively it would have been easy as they already were in OASIS at the time. Now what MS did, was to send in some feature requests from the outside. Those features would have worsened the ODF format, so they consequently were not included into ODF. When Microsoft was again asked to actively participate in the ODF work, and to find a compromize, or to rewrite a little bit of their - then alpha stage - Office12, Microsoft completely refused working with the ODF guys. OpenOffice.org, as reference implementation had to undergo several severe modificationd in order to follow the then moving ODF specification. Microsoft could have done the same. Microsoft obviously did NOT want a format that gave everybody else the same chances as MSOffice, and they did not want to change Office. The OOXML format is living proof, that MS simply wanted a dump of their internal Office12 structures onto an XML namespace. And full fidelity is easily achieveable with old formats, what else would the extensibility of ODF be for? ODF is based on XML, XML is (that's right!) eXtensible. If MS really was concerned about standards they could have produced "ODF +", a bunch of features on top of, integrated with and extending ODF. Even if extending ODF were not an option Microsoft could have produced a document format with a feature set it considers realistic which is described in a way that does not rely on the inner workings of Microsoft's already existent code and which invites competing implementations. Do you know what MS says when people complain that OOXML is too complex? They say that they are expecting tool writers to make use of a subset of it for special purposes, not that anyone would write a complete implementation. Now perhaps ODF is not sufficient for Microsoft's products to use it as their native format (almost nobody cares about that), but they could certainly have provided a built-in way to open and save to ODF. I don't care how screwed up, limited or worthless ODF might be, the world did not need, does not need and should not use OOXML. Its production and introduction in the form in which it exists is not an honest effort but merely an attempt by Microsoft to stem the spread of a truly Open alternative. If customers were going to choose the open format and be content with its feature set, surely MS could have bowed to customer wishes and made its Office work with the format the customers chose. The only reason to introduce OOXML was to have a format which could be *called* Open, so customers would not be able to switch to a competitor. As for OOXML... have you *read* that spec? The document part of it is basically the .doc binary format mechanically converted to XML. Except, of course, for some parts that weren't. OOXML may be "realistic" in terms of feature support but it's only nominally XML. What about that name? With a competitor on the market called "Open Office" which uses a standard, open XML-based file format is there really any excuse that can be offered for calling your competing format "Office Open XML"? This is very clearly an attempt to confuse the marketplace; another nail in the coffin of the idea that MS is doing anything above board here.. " The GP was being quite sarcastic. yes, Microsoft sat on the OASIS committee for ODF, and yes, they said nothing. That is the problem. If they believed it to be incomplete for Office, they should have spoken up to help make it complete. The fact that they said nothing means that either (a) they believed it to be complete enough, or (b) they were doing it just for show. More likely than not, they were doing it for 'b', but since they were on the committee, ODF supporters really could use 'a' against them. ;-))?. OpenXML (OOXML) is that long because Microsoft just did a dump of their memory information to XML, just like their older binary formats were dumps to a binary file. OpenXML does not need to be anywhere near as long as it is if it were truly focused around file formats as opposed to internal program notations. The sad fact is Microsoft is focused around "internal program notations" as a file format - thus OOXML and 6000+ pages of incomplete documentation. I'll agree that OOXML is not trying to meet the same goals as ODF. While ODF aims to be a file format, OOXML just aims to be an XML version of the older binary memory dumps that Microsoft did for a file format previously. Their (Microsoft's) goal was simple - make it as length and incomprehensible as possible so that no one else could adequately implement it in such a manner as to actually be comparable to MS Office. It's in the ODF standard already, and you can already see how this functions by looking between ODF 1.0 and ODF 1.1. It's left to XML name spacing, and works beautifully. So it's no a problem for ODF at all. This is no different than how will two browsers compare to supporting current and future web standards. Or how any image program does with supporting image file formats. Or any number of similar things. Fact is, people will support it, implement, and then add new features that don't break the implementation so that others can also be successful at reading the same file even if they don't support the extras. I'm thinking of doing such an extension to OpenOffice and perhaps another Open Source ODF office suite to try to add some functionality to ODF myself. If it gains support, it'll likely be pushed to the OASIS committee for consideration as part of ODF proper. All the implementors have to do is implement the standard honestly and in such a way that any expanded functionality does not break the implementation. Microsoft, however, likely has no plans of doing that with OOXML - they already implement a number of things in Office 2007 that break its against the spec. So even if you implement the spec as written (all 6000+ pages of it) you still won't be compatible with MS Office. Comparatively, implement the 700+ (749?) pages of ODF and you'll be compatible with all ODF implementations. ;-) Yes, more or less it can be called memory dumb or data that's serialized into XML. People also often forget that the 6000+ pages includes documentation for three products + common parts like packaging, DrawingML etc. That makes less than 2000 pages/product, which sounds quite realistic for that complex products. When line-spacing is halved, there are even less pages Also, if you leave some "maybe nobody needs these" -parts out, like say spreadsheet formulas (10 pages in original ODF spec vs. 384 pages in openxml spec), then you of course save many extra pages I think it is better that there is extra information available than too little. Btw for those complaining the documentation is incomplete; now the obscure "AutoSpaceLikeWord95" etc parts are fully documented (but deprecated as they will be phased out): ."... Ok, I had always thought that ODF aims for full fidelity between products, but if the goal is just to be able to open the same document on different products, then it is easier to achieve. One can't really trust that the document will look exactly the same on all products, but I guess that's what PDF is for. Even Microsoft will be able to add that level of support for ODF to Office easily (ODF was standardized too late for Office 2007 of which development had already started after O2003). I'm quite sure Microsoft will officially support importing and exporting of ODF in the next version of their Office as ODF really isn't that big a threat to them technically. Microsoft is more worried that governments etc will choose ODF only because it is ISO (and OOXML is not). Sure they will update the Office to support the standard once it gets finalized after comments and updates. With patches and translators current products and Open XML documents can be moved to support the finalized spec, just like .doc files are converted now. Open XML doesn't require to support all the features in the spec before you can create 100% compatible files. If 100% transferability can't be expected from the ODF, why it should be always expected from OOXML? Full specs are for those that really want to support all the possible features or some segment specific to their needs. If I wanted to make a tool that reads/writes simple MS Office documents, it wouldn't be much harder than it would be for ODF. So, one can ignore parts of the Open XML specs that they don't need and still make compatible documents. Just like in ODF the vendor specific extras can be ignored as long as the baseline requirements are met. As it just turned out in this thread, ODF won't be 100% transferable between products - just the lowest common denominator due to vendor-specific extras. Also, one still needs to learn and implement completely the referenced standard formats, like SVG and build support for them from the start, since they are extended (see my another post). Already made third-party components won't help, unless sources are available. After this thread I'm even more convinced it is better there are two formats as they really are for different needs. Combining them would be much bigger mess than asking other party which format they prefer (ooxml, odf, pdf, xps). I just wish there wasn't so much FUD and hatred between the camps . Edited 2008-01-26 13:27 UTC. Perhaps you should read for comprehension before you criticize me. Here's what I said: "Sometimes, yes. In the case of OOXML, for example, some people believe that OOXML simply provides a better overall solution than ODF (and its successor). See " rel="nofollow">" You complain about me and yet, clearly, you never even read my post. Or, if you did, you must not have understood it, or you'd realize I wasn't expressing my opinion or "towing the party line". Rather, I linked to somebody else's opinion. I realize that I'll never win any popularity contests around here by daring to contradict the orthodoxy that you and people like you have been spoonfed. It's fashionable to hate MS. But I'm a pragmatist. I use many of Microsoft's products, as well as quite a few produced by its competitors. So, I can see the value that both sides provide; whereas, for many of you, it's OSS or nothing. Which is just another brand of tyranny, if you were honest with yourselves. Edited 2008-01-27 07:51 UTC What you again fail to understand is that by pitting yourself against people in some kind of juvenile 'them against me' crusade, people like me who actually share your supposed opinion, you are singling yourself out for ridicule and derision. By quoting just your last post and thereby possible wishing I would some how forget other posts you have made on this very subject, you are actually insulting my intelligence. And finally, by labeling me some kind of FLOSS fanatic, without taking into account the many times I have openly stated that I use MS software (I even wrote an original complementary piece on Vista for this site) and thereby attempting to safely pass me off as some kind of kook or nut, in the possible hope to discredit me or at least marginalize what it seems quite a few fellow members of this forum agree is a valid statement, you are driving away potential supporters. Although your opinions may or may not be popular, it's your attitude that makes you unpopular. I haven't read the Burton report, so I can't really judge it, but the quotes in the article you linked are terrible. Some highlights: * Saying ODF is worse than OOXML because it's 'indirectly controlled by Sun' is silly. * The state 'OOXML is considerably more complex' - like that's a good thing. * 'Building on other standards' is indeed the way to go - and is exactly what ODF does (unlike OOXML). Perhaps there's stuff in the Burton report that supports the gratuitous claims in the article ('a better form-follows-function fit for most productivity application usage patterns', blah blah) - but on its own it's worth squat. Does "building on" mean extending the other standards so that they fit the need:. Source:... FOSS companies should read Aesop's fable "the sick lion" before doing business with Microsoft I think moderation voting can't come soon enough. The "MS are weasels" post by all rights should be modded down to -5 because it is personally insulting to a large group of people without adding anything to the conversation. Instead 5 people thought this purely emotional response was worthy of being pointed out as an exemplary OSNews comment. Good job, folks. Exactly, if you look closely at Microsoft's licenses they basically forbid you from using programs included in Microsoft products to replace other Microsoft products or services. You can write anything and give it away for free, but the license pretty much locks that program to windows platforms only. Like the guy a while back that reimplemented some feature for Visual Studio. The feature was in the more expensive version program, basically disabled but included AFTER he wrote a free version, and because his program "touched" some DLLs that Microsoft installs on your machine but reserves for "their" use only, they made him pull the software even though I believe his was first, or something a normal user wouldn't have seen. Their license will only be "free" as long as it doesn't step on THEIR toes, then they'll cut you off for "using their IP wrong". For corporate developers with the big bottle of kool-aide license agreements this is probably a good thing to have lots of resources with licenses that are free and sanctioned so it looks good to the execs. For fans of OSS it's useless. Surprise- Microsoft is open source company since 2002!. Please see the accompanying license.... Are all Shared Source licenses OSI approved? No? Then SS and OS are not the same thing. Period. Now you can argue about how open you think Shared Source is, but that's a whole different issue. Open Source is not just about being able to see the source code, do some reading about that.
http://www.osnews.com/comments/19218
CC-MAIN-2016-18
refinedweb
3,864
68.91
Hi all, I've been trying to run a sequence alignment using clustal omega from within a python script. However, I keep getting the following error: FATAL: Sequence file contains no data However, if I run the raw command on the command line, everything runs fine. Here is the relevant code in my script: from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.Alphabet import IUPAC import Bio.SeqIO as SeqIO from Bio.Align.Applications import ClustalOmegaCommandline ref_seq = "ERVVIGSKPFNEQYILANMIAILLEENGYKA" target_seq = "ERVVIGSKPFNEQYILANMINGYKA" in_file = "unaligned.fasta" out_file = "aligned.fasta" # Write my sequences to a fasta file handle = open(in_file, 'w') records = (SeqRecord(Seq(seq, IUPAC.protein), id=str(index), name="Test", description="Test") for index,seq in enumerate([ref_seq, target_seq]) ) SeqIO.write(records, handle, "fasta") clustalomega_cline = ClustalOmegaCommandline(infile=in_file, outfile=out_file, verbose=True, auto=True, force=True) clustalomega_cline() #sp.call(str(clustalomega_cline), shell=True) # This will also fail with the same error Edit: It seems that this is due to either the way biopython writes the FASTA file, or how clustalo processes it. If I comment out the lines where I write to a file and run the script again, is still fails, even if I run the raw command using subprocess. BUT, if I also make sure that there are no spaces in the FASTA sequence headers, then the commands at the bottom run fine. I don't know why this isn't a problem when just run from the command line with the headers unmodified. This doesn't make any sense.
https://www.biostars.org/p/188079/
CC-MAIN-2019-43
refinedweb
254
58.38
Contents Introduction To script MayaVi2, you need (at least): - your favorite text editor; python installed MayaVi2 installed Scripting MayaVi2 is quite simple because MayaVi2 is written in python and based on TVTK, which eases the uses of all VTK objects. In the following, you'll be learned how to script and use MayaVi2 modules and filters. Modules can be split in two parts: modules which do not interact with VTK data, and are seldom modified/handled (Outline, Axes, OrientationAxes and Text). These are called the "basic" modules. Although color bar is not strictly speaking a module, it will be presented here. Setting a few parameters for rendering your scene will be also presented. - modules which do interact with VTK data, and those you want to play with (i.e. all the remainder modules ;-). Before starting, let's see the "main template" of a MayaVi2 script written in python. Main template: create your MayaVi2 class A MayaVi2 script should contain at least the following few lines: 1 #! /usr/bin/env python 2 3 from enthought.mayavi.app import Mayavi 4 5 class MyClass(Mayavi): 6 7 def run(self): 8 script = self.script 9 # `self.script` is the MayaVi Script interface (an instance of 10 # enthought.mayavi.script.Script) that is created by the 11 # base `Mayavi` class. Here we save a local reference for 12 # convenience. 13 14 ## import any Mayavi modules and filters you want (they must be done here!) 15 .../... 16 17 script.new_scene() # to create the rendering scene 18 19 ## your stuff (modules, filters, etc) here 20 .../... 21 22 if __name__ == '__main__': 23 24 mc = MyClass() 25 mc.main() Adding modules or filters is quite simple: you have to import it, and then add it to your MayaVi2 class. To add a module, type: from enthought.mayavi.modules.foo_module import FooModule .../... mymodule = FooModule() script.add_module(mymodule) To add a filter, type: from enthought.mayavi.filters.bar_filter import BarFilter .../... myfilter = BarFilter() script.add_filter(myfilter) Notice the used syntax: for modules for example, foo_module is the foo_module python file (without the extension .py) in the subdirectory module/ of mayavi/ directory (lower case, underscore); this file contains the class FooModule (no underscore, capitalized name). But first of all, before rendering your scene with the modules and the filters you want to use, you have to load some data, of course. You have the choice between: create a 3D data array, for scalars data (for vectors data, you have to use a 4D scalars data, i.e. a 3D scalar data for each component) and load it with ArraySource method; load a data file with FileReader methods. For example, we will create a 50*50*50 3D (scalar) array of a product of cosinus & sinus functions. To do this, we need to load the appropriate modules: 1 import scipy 2 from scipy import ogrid, sin, cos, sqrt, pi 3 4 from enthought.mayavi.sources.array_source import ArraySource 5 6 Nx = 50 7 Ny = 50 8 Nz = 50 9 10 Lx = 1 11 Ly = 1 12 Lz = 1 13 14 x, y, z = ogrid[0:Lx:(Nx+1)*1j,0:Ly:(Ny+1)*1j,0:Lz:(Nz+1)*1j] 15 16 # Strictly speaking, H is the magnetic field of the "transverse electric" eigenmode m=n=p=1 17 # of a rectangular resonator cavity, with dimensions Lx, Ly, Lz 18 Hx = sin(x*pi/Lx)*cos(y*pi/Ly)*cos(z*pi/Lz) 19 Hy = cos(x*pi/Lx)*sin(y*pi/Ly)*cos(z*pi/Lz) 20 Hz = cos(x*pi/Lx)*cos(y*pi/Ly)*sin(z*pi/Lz) 21 Hv_scal = sqrt(Hx**2 + Hy**2 + Hz**2) 22 23 # We want to load a scalars data (Hv_scal) as magnitude of a given 3D vector (Hv = {Hx, Hy, Hz}) 24 # Hv_scal is a 3D scalars data, Hv is a 4D scalars data 25 src = ArraySource() 26 src.scalar_data = Hv_scal # load scalars data 27 28 # To load vectors data 29 # src.vector_data = Hv To load a VTK data file, say heart.vtk file in mayavi/examples/data/ directory, simply type: from enthought.mayavi.sources.vtk_file_reader import VTKFileReader src = VTKFileReader() src.initialize("heart.vtk") Note: Files with .vtk extension are called "legacy VTK" files. MayaVi2 can read a lot of other files formats (XML, files from Ensight, Plot3D and so on). For example, you can load an XML file (with extension .vti, .vtp, .vtr, .vts, .vtu, etc) using VTKXMLFileReader method. Add the source to your MayaVi2 class Then, once your data are loaded using one of the two methods above, add the source with the add_source() method in the body of the class MyClass (after script.new_scene): script.add_source(src) The four basic modules Outline, Axes, OrientationAxes and Text will be presented now. Basic Modules See the Basic Modules wiki page. Main Modules See the Main Modules wiki page. Filters See the Filters wiki page.
http://wiki.scipy.org/Cookbook/MayaVi/ScriptingMayavi2?highlight=((----(-*)(%255Cr)%253F%255Cn)(.*)CategoryCookbook%255Cb)
CC-MAIN-2014-52
refinedweb
812
65.22
Just converted this from an old version made by someone else, I like it because it’s shorter than the other ones I’ve seen and it has a good working constraint on the Y axis, as if your head actually has a neck. Hopefully that’s easy to understand. EDIT (Updated blender file): I did some changes to the script, and tried to explain it as well as I could: import bge r=bge.render c=bge.logic.getCurrentController() o=c.owner mouse=c.sensors["Mouse"] #this is used for info about the mouse cursor's position rotG=c.actuators["Motion"] # this is used to look left/right. fcurve=c.actuators["F-Curve"] # this is used to look up/down. sens=0.001 # define mouse sensitivity. movtx=(int(r.getWindowWidth()/2)-mouse.position[0]) * sens # distance diff between center # of the screen and the mouse to determine how to move the camera, in the X axis movty=(int(r.getWindowHeight()/2)-mouse.position[1]) * sens * 8 # same as above for the Y #axis. Times eight because the F Curve uses bigger numbers for the same amount of movement # as dRot on this case. rotG.dRot=[0,0,movtx] c.activate(rotG) c.activate(fcurve) o['mousey']+=(movty) # add vertical mouse movement to this property, whether it's negative # or positive (up or down). Basically converts the mouse movement to the property which # is then read by the F-Curve actuator, which converts it to rotation of the camera. if o['mousey']>30: # put a cap on how much you can look up/down. o['mousey']=30 if o['mousey']<0: o['mousey']=0 r.setMousePosition(int(r.getWindowWidth()/2),int(r.getWindowHeight()/2)) #center the mouse c.deactivate(rotG) c.deactivate(fcurve) EDIT: It seems to work really well right now. The stuttering I said I got before editing this post seemed to be caused more by my mouse than the script. Download the .blend here:
https://blenderartists.org/t/yet-another-v2-5-first-person-mouselook/505517
CC-MAIN-2022-40
refinedweb
327
56.35
Logic gate kills clock signal?ken.orkis Aug 18, 2017 1:54 PM Hi All, I'm trying to synchronize two PWM's using an AND gate and Control Reg. My thought was to set the Control Reg to zero by default, which would null the output of the AND gate. Then, in my main function, after both PWM's are initialized, I would set the Control Reg to 1 and active the AND gate to pass the clock signal through it. The PWM's work fine without the AND gate. When the AND gate is added, nothing works. I've tried initializing the Control Reg to 1 and the PWM's still do not work. It seems like a bug, has anyone else experienced this? Can anyone recommend an easy way to synchronized the PWM's? Thanks, Ken ********* main.c code ********** #include <device.h> void main() { CY_SET_REG8(CYREG_MLOGIC_DEBUG, CY_GET_REG8(CYREG_MLOGIC_DEBUG) | 0x40); PWM_1_Start(); PWM_2_Start(); Control_Reg_1_Write(1u); while(1); } - schem1.jpg 62.4 K 1. Re: Logic gate kills clock signal?ken.orkis Apr 30, 2015 2:21 PM (in response to ken.orkis) So I dropped the clock frequency down and it seems to run as expected at 1MHz. Maybe there is an issue with the propagation delays at higher frequencies? 2. Re: Logic gate kills clock signal?user_1377889 Apr 30, 2015 2:44 PM (in response to ken.orkis) Most of the basic components run up to 48MHz clock, so the issue will be caused by something different. Can you please post your complete project (with the AND-gate) with all of your settings? To do so, use Creator->File->Create Workspace Bundle (minimal) and attach the resulting file. Bob 3. Re: Logic gate kills clock signal?ken.orkis Apr 30, 2015 2:41 PM (in response to ken.orkis) Files are attached. Thanks for the assistance. - Ken - IntensityLED.cywrk.Archive01.zip 404.8 K 4. Re: Logic gate kills clock signal?user_1377889 Apr 30, 2015 3:26 PM (in response to ken.orkis) Some thoughts: You disabled the instruction cache? Would be easier to use the enable input for the PWMs to start (and stop) counting instead of gating the clocks You could use a two (2) output configuration which will be synchronus by design You are using a rather old version of creator. I would suggest you to upgrade to version 3.1 or even to 3.2 early access. Bob 5. Re: Logic gate kills clock signal?user_1377889 May 1, 2015 3:14 AM (in response to ken.orkis) It was a bit late yesterday night, so I will explain today my suggested changes: Reset signal must be synchronus to clock TC is one clock pulse => when tc is internally derived from Clk the rising edge of the reset signal may come too late and will not be seen. In other words: When deriving the reset signal directly from Tc there might be some tough setup and hold times. Have a look at the diagrams in the PWM datasheet. Problem could be solved by using a Pulse Converter component to get a reset pulse long enough. Bob 6. Re: Logic gate kills clock signal?user_14586677 May 1, 2015 5:05 AM (in response to ken.orkis) From datasheet reset is synch - This shows reset being used directly from Tc. Regards, Dana. 7. Re: Logic gate kills clock signal?ken.orkis May 1, 2015 5:31 AM (in response to ken.orkis) Hi Bob & Dana, Thanks for such thorough help. I ended up dropping the gate and shifting the control reg to the reset line to get things moving. I didn't want to use the dual output because this is an early stage in a more sophisticated system. Regarding the instruction cache, I used an example project to get things moving and that must have been a remnant from the original program. Where did you see that and how can I re-enable it? Thanks, Ken 8. Re: Logic gate kills clock signal?user_14586677 May 1, 2015 5:45 AM (in response to ken.orkis) On the *.cydwr file shown in workspace explorer The heap and stack size were reduced in 3.1, try restoring to 3.0 levels 4K and 16K respectively. 3.1 default settings are now 128 bytes and 2K.
https://community.cypress.com/message/68468
CC-MAIN-2019-04
refinedweb
717
85.39
I’ve been meaning to attack this one since we first published the Clipboard Manager as a Plugin of the Month: working out how to display a preview image of the clipboard contents inside the Clipboard Manager palette. And then I happened to receive a request by email, yesterday, suggesting a couple of enhancements to the tool. A nice reminder. :-) 1. Have the clipboard include image previews, similar to that of the wblock command (instead of needing to immediately rename the item when fast copying multiple items). 2. Have the clipboard store items in memory for use in between autocad sessions (this would be useful on projects that are not completed in one day/session, or really useful when/if autocad encounters a fatal error). To start with I thought that both of these requests would have a common solution (at their core, at least): understanding how AutoCAD places its data on the clipboard would hopefully allow us to load it into a Database and then create a thumbnail from it. And we’d also be able to save off a copy of the data for future reuse. After asking some colleagues for their opinions (and many thanks, Davis, Lee, Markus, Murali and Jack for the input! :-) it turns out the format AutoCAD uses to write to the clipboard is defined in an ObjectARX SDK header, clipdata.h. I think I once knew this, but once again I’m a victim of my own over-efficient garbage collection :-). Here’s the relevant structure, edited to fit the width of the blog: typedef struct tagClipboardInfo { ACHAR szTempFile[260]; // block temp file name ACHAR szSourceFile[260]; // file name of drawing from which // selection was made ACHAR szSignature[4]; // szClipSignature int nFlags; // kbDragGeometry: dragging // geometry from AutoCAD? AcGePoint3d dptInsert; // original world coordinate of // insertion point RECT rectGDI; // GDI coord bounding rectangle of // sset void* mpView; // Used to verify that this object // was created in this view (HWND*) DWORD m_dwThreadId; // AutoCAD thread that created this // DataObject int nLen; // Length of next segment of data, // if any, starting with chData int nType; // Type of data, if any // (eExpandedClipDataTypes) ACHAR chData[1]; // Start of data, if any. } ClipboardInfo; A number of the people I asked pointed out that AutoCAD actually WBLOCKs out the selected objects into a complete, standalone drawing file, which is referenced from this structure. The problem I suspect I’m going to have, at some point, is to map this structure to .NET, although as I know the temporary file is going to be in the first 260 characters, I could probably get away with just pulling out those characters and ignoring the rest. Although reusing them in a later session may then actually involve calling INSERT rather than placing them back into the clipboard and calling PASTECLIP, as in any case it feels as though there are some fields that might be tricky to recreate (thread ID has me nervous, for instance). But anyway – that’s for another day. Another of the pieces of input I received had me thinking this was probably over-engineering the solution to the first request. We actually store a bunch of different formats to the clipboard – including a bitmap of the selected contents – which means we probably don’t need to care about the AutoCAD-specific format to address that request. Rather than extending the existing VB.NET code to accomplish this, I decided to start with a simple C# app showing a palette that only displays the contents of the clipboard via an embedded PictureBox. I chose to go back to C# as I thought, at the time, I’d be mapping the above C++ structure – which would be easier – but anyway. Now that I have some working C# code I’ll be taking a look at extending the existing Clipboard Manager plugin, in due course. Here’s the C# test code I put together. I placed everything in a single file – the UI is created by the code, rather than being in the Visual Studio designer, to keep it all simple. Oh, and I’m sorry for the lack of comments – if you’re interested in the implementation details but they’re not obvious, please leave a comment on this post. using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.Windows; using System.Runtime.InteropServices; using System.Windows.Forms; using System.Drawing; using System; namespace ClipboardViewing { public enum Msgs { WM_DRAWCLIPBOARD = 0x0308, WM_CHANGECBCHAIN = 0x030D } public class ClipboardView : UserControl { [DllImport("user32.dll")] public static extern IntPtr SetClipboardViewer( IntPtr hWndNewViewer ); [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SendMessage( IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam ); IntPtr _nxtVwr; PictureBox _img; PaletteSet _ps; public ClipboardView(PaletteSet ps) { _img = new PictureBox(); _img.Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); _img.Location = new Point(0, 0); _img.Size = this.Size; _img.SizeMode = PictureBoxSizeMode.StretchImage; Controls.Add(_img); _nxtVwr = SetClipboardViewer(this.Handle); _ps = ps; } private void ExtractImage() { IDataObject iData; try { iData = Clipboard.GetDataObject(); } catch (System.Exception ex) { MessageBox.Show(ex.ToString()); return; } if (iData.GetDataPresent("Bitmap")) { object o = iData.GetData("Bitmap"); Bitmap b = o as Bitmap; if (b != null) { _img.Image = b; if (_ps != null) { _ps.Size = new Size(b.Size.Width / 3, b.Size.Height / 3); } } } } protected override void WndProc(ref Message m) { switch ((Msgs)m.Msg) { case Msgs.WM_DRAWCLIPBOARD: ExtractImage(); SendMessage(_nxtVwr, m.Msg, m.WParam, m.LParam); break; case Msgs.WM_CHANGECBCHAIN: if (m.WParam == _nxtVwr) _nxtVwr = m.LParam; else SendMessage(_nxtVwr, m.Msg, m.WParam, m.LParam); break; default: base.WndProc(ref m); break; } } } public class Commands { PaletteSet _ps = null; ClipboardView _cv = null; [CommandMethod("CBS")] public void ShowClipboard() { if (_ps == null) { _ps = new PaletteSet( "CBS", new System.Guid("DB716FC9-2BD8-49ca-B3DF-6F2523C9B8E5") ); if (_cv == null) _cv = new ClipboardView(_ps); _ps.Text = "Clipboard"; _ps.DockEnabled = DockSides.Left | DockSides.Right | DockSides.None; _ps.Size = new System.Drawing.Size(300, 500); _ps.Add("ClipboardView", _cv); } _ps.Visible = true; } } } When we run the CBS command, it displays a palette which updates when the clipboard is modified to show its contents. The palette resizes to be a third of the size of the bitmap, so the aspect ratio is maintained. You may recognise the drawing used from the last post. So that happily ended up being much easier than expected. Now I’ll be taking a look at how best to integrate this into the Clipboard Manager. And in due course how best to handle the persistence and reuse of the data between sessions.
http://through-the-interface.typepad.com/through_the_interface/2010/10/previewing-the-contents-of-the-clipboard-in-an-autocad-palette-using-net.html
CC-MAIN-2013-48
refinedweb
1,080
56.55
MDA From a Developer's Perspective By Stefan Tilkov 01 Dec 2002 | TheServerSide.com You've probably heard about Model Driven Architecture (MDA), the Object Management Group's brand-new approach to software development. It's likely you have also seen lots of product announcements, where new "MDA tools" appear in the market and existing ones, such as CASE tools or IDEs, suddenly become "MDA enabled". In this article I'll try to explain what MDA is all about, and do so in a bottom-up way. By this I mean that I'm going to focus on the benefits a developer (as opposed to a manager or someone with architectural responsibility in an enterprise) can gain from applying an MDA approach. One thing that never ceases to surprise me is the way some developers are willing to implement the same thing over and over again. I'm not talking about writing a software system for the third of fourth time, each time applying experience and lessons learned from the last iteration. That's perfectly fine with me, and in fact I believe that most good software is based on something that has been thrown away at least once. What I'm talking about is doing the same thing again and again on a different level. Think, for example, about the patterns you apply when you develop a J2EE system. If you're following decent architectural guidelines, you might define operations in your EJBs to take value objects as parameters. These value objects are simple, plain old data types that hold some state. Typically, each of those attributes has a read and a write accessor, and perhaps also something like "isNull" to check for null values: public class ExampleValueObject { private long value; private boolean valueNull; public boolean isValueNull() { return valueNull; } public long getValue() { return value; } public void setValue(long value) { this.value = value; } } (I'm not surprising anyone yet, I know. Please bear with me for a few seconds more.) Chances are you have implemented this pattern, probably better called an idiom, about a thousand times at least. If you're like me, you hate doing things that can be automated by hand, so you are likely using some sort of IDE like JBuilder, Eclipse, IDEA, or even Emacs, all of which allow you to automatically generate accessor methods for attributes. (Thinking about it - how many IDEs do you know that allow you to generate not only the bean-like get and set methods, but an isNull method as well?). This is a very simple case, but if you consider it for a while, you'll find that your code is full of patterns like these, from very simple to very complicated. Some examples of patterns are: - classes used for communicating with servers remotely; - the combination of classes, interfaces, and deployment descriptors used to describe and implement how you persist objects using J2EE CMP; - classes implementing alternative persistence strategies, such as session beans managing simple Java objects in combination with a persistence layer - Java Beans used to allow for communication between the web tier and the EJB tier; - and lots more. If you look at all those occurrences, you'll notice that in most of these cases, a very simple structure is behind all of those implementation details, together with a specific mapping of those structures to an underlying platform. Let me elaborate on that a bit. Assume that you have a simple object model, described in a UML class diagram: Figure 1 If you are using a pre-EJB 2.0 application server, you might have made the decision to use BMP entity beans only and persist objects using some sort of DAO pattern. For each persistent object, you decide whether it's worth being implemented as a bean or an object only, following what used to be called a "coarse grained object pattern". Regardless of whether you're using UML or not, the result you get when you implement your object model following those rules might look like this: Figure 2 So where is this leading us? Imagine that you introduce a few new attributes to your customer object. You will have to make modifications to the customer bean's remote interface because of the new getters and setters (or, if you're following a value object pattern, to the value object associated with it); you'll need to apply the same change to your DAO, as well as to any other class somehow affected by that change. Adding an attribute is not what I would term a complex change. So why would I have to edit 3-5 different files for a change as simple as that? Now think about what happens when you switch application servers, or even upgrade your app server to a new version. Let's say it supports EJB 2.0, including CMP, and it does so very efficiently. Let's also assume that you want to take advantage from that fact, resulting in a model that might roughly look like this: Figure 3 Where does that leave you? It's not your logical object model that changes. A customer is still associated with an order in the same way as before. It's the rules, the mapping from logical to physical model that change, forcing you to touch each and every single software artefact related to persistence. Do you really think it's worth your time doing that? Do you call that creative work? Of course, a real-world architecture will be a lot more complicated. The same principles apply, though. After all, what is architecture if not a set of rules stating how to solve common problems? So what's the point? You'll remember that I started by describing that I wanted to explain MDA bottom-up, and hopefully I have convinced you by now of some facts: - When you implement a solution on a powerful platform such as J2EE, you follow certain rules to map your logical model to a physical representation. - If this transformation could be automated, you'll be able to save a lot of time required for tedious, uncreative work. - Separating a logical model from a technical mapping will isolate changes made to the two from each other. So let me now step a bit more into MDA terminology and explain what the OMG suggests as a solution. First of all, the OMG introduces the concept of platform independent and platform specific models (abbreviated as PIM and PSM, respectively). An example of a platform independent model is the one given in Figure 1 (although one might argue whether this is really platform independent, but more on that later). The idea is to have a model that represents business knowledge without being cluttered with technical detail. Figure 2 and Figure 3 clearly represent platform specific models, being tightly coupled to the underlying platform. When using MDA, PIMs are transformed into PSMs by applying a mapping or transformation. PIMs and PSMs can exist on different levels; basically, your PIM might be somebody else's PSM, depending on their perspective. Thus, a transformation might include several steps, from highly independent to more and more specific ones. The final result of the transformation will (hopefully) be the code. In my view, the code is also a model - but your mileage may vary here. To put it very simply, MDA is thus exactly concerned with solving the problems mentioned above by allowing you to look at and modify your logical model (the PIM) independently from the underlying platform, automate the transformation into a PSM, and thus be able to change the two of them independently of each other. To do this, MDA relies on some technologies that are controlled by the OMG, but are pretty much ubiquitous: UML - the Unified Modeling Language Probably everybody knows UML, so I'll not go into too much detail here. UML has become the one and only wide-spread standard modeling language, so that if anybody uses a modeling tool or simply draws something on a whiteboard, it'll most likely follow UML conventions. UML defines a lot of different diagram types, the best-known of which are the class diagram and the interaction diagram. XMI -. MOF - the Meta-Object Facility This is probably the least known of the OMG standards, although I personally consider it to be the most important one. MOF is a conceptual framework for describing meta-data. Meta-data is, as the names suggests, data about data. To explain this, consider the following layers: 0. A customer, ACME Corp., has placed an order for 32 boxes of candy on the 23rd of April. 1. A customer has a name and can place zero to n orders, each order having a date and referencing a specfic item that is being sold. 2. Classes have attributes which have a type, and classes can be related to each other. 3. There are things that describe something, and there are connections between those things. With numbers increasing, we move away from pure information (level 0) to a model layer (1), to a meta-model layer roughly resembling UML (2), to a meta-meta-model layer representing a way to describe meta-models. MOF is mainly concerned with level 3, for which it contains a hard-coded set of "things". (If you're not confused enough already: in fact this layer is a subset of UML. Don't worry, things will hopefully become clearer soon). So what is MOF? MOF JCP has just finalized a mapping of these interfaces for the Java language. XMI - again Huh? Didn't we already discuss XMI? Yes, we did - but as we now know what MOF is about, we'll have to take a closer look. In fact, XMI cannot only be used as an interchange format for UML, but for any model that can be described by a MOF meta-model. Let me give you an example. Let's say that your organisation defines a meta-model to express certain concepts, for example the concept of a business service. Each business service might be an aggregation of interfaces, each of them consisting of operation signatures. Each business service might also have an owner and a version it is available in. MOF-compliant tools would allow you to define this meta-model, import it into e.g. repositories and CASE tools, and start drawing or editing model information - i.e., concrete instances of business services. This model information could then be exchanged with other MOF-compliant tools via XMI. An existing example of a MOF-compliant meta-model apart from UML is the Common Warehouse Meta-model, CWM, which is defined by OMG and used to describe meta-data for use in data warehousing scenarios. It includes well-known model elements such as tables, columns, views, and indices. Back to the beginning ... So how does all of this relate? MDA is just starting to become popular, and while user-defined meta-models will definitely become, IMHO, extremely popular in the future, for now they are concerned mainly with automating the transformation mentioned quite a few times. So what type of tools should you take a look at? There are quite a few MDA-compliant software generators out there, one of them being iQgen (iQgen is freely downloadable at), the one the company I happen to work for produces. iQgen is able to read a logical model, a PIM, in the form of an XMI file as exported from a CASE tool. These PIM is then transformed into the ultimate PSM, the code, based on a set of rules defined as templates. The issue of transformation is the one the least specified by the OMG at the moment. Therefore, available tools use different strategies. iQgen uses Java Server Pages, which allows Java developers to start developing templates (or rather, refactor existing code into templates) without having to learn something new. Other tools rely e.g. on Jython or Jakarta's Velocity template engine. All of them preserve code that has already been modified, usually by enclosing it in some form of special comment. All of these tools enable you to code with different perspectives. While you make structural changes in a UML model, you define the transformation or mapping to your selected software architecture in a different, localized place. Moving from e.g. EJB 1.1 to EJB 2.0 (or the upcoming 2.1, for that matter), is simply done by changing templates. This dramatically reduces monkey-work, saves a lot of development time, and enforces adherence to architectural principles in your application. For the future I expect three major things to emerge: - CASE tools will become MOF-compliant. This will allow users to define their own meta-models, import them into the CASE tool, and start drawing diagrams conforming to them. - CASE tool vendors will have to shift their focus from documentation to efficient maintenance of model information. - "Real" model-to-model transformation, based on MOF, JMI, and the result of the MOF 2.0 Query/View/Transf. RFP issued by OMG, will become commonplace, pushing programming tasks to another meta-level. But that's just an expectation of what might become mainstream in the future. To stick with the goal of introducing things in a bottom-up approach, I'll also try to address some of the concerns people have about automating software development, and about code generation in particular. When you talk to people about the use of code generation, as I very often do, you will immediately be confronted by either great enthusiasm or equally great skepticism. There are, of course, valid points that can be made against using a generative approach. But in my experience, I have found that most of these only apply to specific products, can be circumvented easily, or are based on a plain misunderstanding of the way the technology can and should be used. In the following paragraphs, I will try to list some of the most common reasons against code generation, as well as describe how they can be addressed. 10 Myths About Code Generation 1. Code generation is a great way to impress managers, but once you hit the 80% wall, you need 800% more effort to achieve the final result. This is very true for tools that force you to accept what they deem to be "the right way" to build your software. It's also the reason why a lot of people don't like to work with 4GL tools like PowerBuilder. Basically, you get a lot of benefits from the fact that they hide the complexity, but you run into severe trouble once you need to solve a problem the tool designers did not expect. A good tool will enable you to automate what you would otherwise do by hand. The code generated should be - at least in principle -no different from what you would have written yourself. It's also of critical importance that you can still implement things without using the generator, because for some things, you need to be able to put the full power and flexibility of the underlying platform to use. If your tool environment enables you to use code generation where appropriate and mix the result with hand-written code as needed, you will get the best of both worlds. 2. People will soon start to modify the generated sources, making repetitive generation impossible. So why bother? A one-shot code generation approach, i.e. one where you generate an initial skeleton implementation and then do the elaboration by hand without being able to regenerate, is of no use at all. This approach reminds me of the first "wizards" that became available in popular IDEs some time ago. So you really need the ability to generate code, enhance it, and regenerate after you have made changes to the model. But if people start modifying the generated code and break the rules, e.g. by inserting code outside of "protected sections", you will have a problem. I believe that there are two ways to circumvent this: One is the brute force way that you can apply in certain environments. With this approach, you include the code generation step in your daily or weekly builds by checking out the model and the code and regenerating before you compile. Anything that does not survive this project is not included in the build result, and this is likely to make people break the code generation rules only once. While effective, this approach smells of centralized control, and thus I don't really like it. The far better way is to use tools that provide a clear and measurable benefit to the developer, so that they will not even think about not using them. Which approach is better depends on your environment. 3. Code will never be generated in a way that meets my standards, coding conventions, works with my architecture and frameworks, etc. True for a lot of environments, and a very good reason against using them. I am strongly opposed to any tool vendor trying to force their view of doing software development "the right way" on me. Fortunately, a lot of tools in the MDA market allow you to adapt the way they transform and generate code to your own needs. From simple things like allowing you to decide where to put your curly braces, to naming conventions, attribute access, copyright notices, and persistence strategies - everything must be customizable by the end user. And it is - at least in tools that I consider being worth their money. 4. Code generation creates too much of a dependency on proprietary tools. This is probably the strongest argument one can make as long as MDA standards are still weak. While using XMI as the language to describe your model in should make you independent of any particular CASE tool vendor, it's not as strict as one would like. Every XMI export is a little bit different, so support for multiple CASE tools is a crucial factor in assuring that you can switch to another one, if need be. JMI, the Java Metadata Interface, standardizes the access to model information. In most tools, the way to describe transformations is proprietary, although languages used in specifying templates can include open standards like JSP or Jython. This will hopefully change once the RFP ... is finalized and implementations emerge. At the moment, though, some dependence on a tool implementation will exist in all solutions I am aware of. 5. Code generation has been tried in the past - and failed. True. Lots of concepts have been tried in the past, and failed miserably. I do believe that with the current hype surrounding the MDA approach, lots of tools appear in the market, which creates a lot of competition, which fuels innovation ... you get the picture. With standard formats like XMI and the rising need for improving productivity, things look a lot different today than they did only a year ago. Don't let past experience make you believe that things can't improve. 6. My CASE tool already has a code generator that I've tried without being impressed. I believe this is due to the fact that historically, code generation has been added to CASE tools as an afterthought, and I often have the impression that it has mostly been tested during presentation where the main goal was to impress management. Most CASE tools' code generators are very hard to modify, written in some proprietary language (or even Visual Basic, which some might consider even worse), and perform very badly. One should not assume from experience with bad implementations that the scenario itself is flawed - it's more productive to look for a tool that does the job better. 7. I'll just use XML/XSLT and be done with it. XML and XSL(T) are fine tools, and I use them quite a lot. For example, our product's web site is based on the excellent Cocoon framework, which does a great job of coordinating and integrating transformation pipelines. There are quite a lot of problems with using XSLT for code generation, though. The most obvious one is that preserving existing code requires quite a bit of effort, e.g. by writing a custom merger task and integrating it with the XSLT engine. When XMI is used as the input format, stylesheets become extremely complicated - because XMI is really, really hard to read and understand. Finally, not everyone knows how to use XSL, and even developers used to it tend to get into problems once stylesheets become complicated. 8. I don't need a code generator, I'm using XDoclet. XDoclet is cool, and I think that in a lot of cases it's a sensible alternative to a full-fledged MDA approach. If you're still writing (and updating!) deployment descriptors by hand, XDoclet will definitely reduce the work you have to do tremendously. The one problem I have with it is that the basis for all of the automatic code generation is the Java code, which is nothing I can show to my customers. While Java code is arguably an easy means of communication between Java developers, it's probably rather hard to discuss an entity/relationship model with your local DB admin, or the implementation of a use case with a business analyst. 9. It's faster to code something in Java than to draw diagrams in some GUI tool. If this is the case, by all means use Java. I'm not advocating to do everything with the graphical representation. In my experience, what works best is to make structural designs (and updates to them) in the CASE tool, and implement the generated methods in the code. It's true though that a lot of CASE tools don't easily allow the developer to e.g. create a bunch of attributes efficiently. I think this is something where CASE tools yet have to match the support offered by IDEs. Once they do so, the main argument against their usage - which is again tied to the implementation, not the general concept - disappears. 10. If I use code generation to automate my work, I'll soon be out of a job. You can easily use that as a justification to program in Assembler. I tend to believe that developers like to be creative, so people justifying their role by doing lots of monkey-work by hand is something I am rarely confronted with. Conclusion So what's so great about MDA? If you think that there's nothing so new about it, I'll agree whole-heartedly. MDA is not a new invention; it is a bunch of techniques integrated under a single name. What's good news is that this leads to standards that are supported by different vendors, which is in general considered to be a good thing. MDA is thus an approach that is intended to solve problems common to application development in a standard way, freeing developers and architects from restrictions imposed on them by the complexity of today's technologies. It's a lot easier to talk about MDA in more abstract terms to managers than it is to convince developers actually implementing systems on a day-to-day basis. In this article, I have tried to point out MDA's benefits from a developer's perspective. Whether I did so successfully is up to you to decide. About the Author Stefan Tilkov (stefan.tilkov@innoq.com) is CEO and Co-Founder of innoQ, a Germany-based consulting company focusing on software architecture for mission-critical systems. innoQ provides an MDA-compliant software generator, iQgen, that uses XMI for model input, JSPs as the template language and can generate any text-based software artefact.
http://www.theserverside.com/news/1365187/MDA-From-a-Developers-Perspective
CC-MAIN-2014-41
refinedweb
3,974
60.85
Calling a (Gazebo) service parallelly from multiple nodes/ Remapping a (Gazebo) service to a particular namespace I have a multi robot setting (with different namespaces which work totally independent of each other, in the same empty_world) in Gazebo. I have to reset the manipulated objects after a certain time interval. I have different ROS nodes controlling the robots and the resetting objects. So I want to use gazebo/set_model_state service parallelly in all the nodes. Spawning one robot works fine as it is the only node using the service. But as soon as I launch the second node it gives me the following error from the first simulation and the second simulation starts running fine. rospy.service.ServiceException: service [/gazebo/set_model_state] returned no response I'm aware that the service call executes commands in a serial manner. But I would like to call the service parallelly from all the nodes at the same time. Is this possible? I suppose this can be done if I can somehow "remap" the service like I do for the topics. That way I can specifically call the service belonging to the robot of that particular namespace. Or if I somehow clone the existing service into multiple unique services each node can call these unique nodes parallelly. But I'm not sure how this can be done. Any suggestions?
https://answers.ros.org/question/288916/calling-a-gazebo-service-parallelly-from-multiple-nodes-remapping-a-gazebo-service-to-a-particular-namespace/
CC-MAIN-2019-39
refinedweb
224
54.42
Hallo alle, Long time lurker, first time poster. I hate to be the one who have no posts and starts off their career on a forum with a noob question, but im stuck and there has to be a batter way to do this. I just want to point out this isnt a homework problem, I am just preparing for a java course that i will be taking next semester. I found this on some other forum, i forget where but here is the main idea of what i need to do: Take a user input and return the next number in a fibonacci sequence for the number the user has entered and continue to enter the next number (after the preceeding one) until the user stops asking for the next number. Example. The user enters 4, Return is 4, next return is 8 next return is 12 ect... I know that the normal fibonacci sequence is 1 1 2 3 5 8 ect and to change it to start with a different number you just multiply each number by the starting digit, but im still struggling. Here is my sad attempt at this practice problem: Thanks for the help, I hope this isnt an overwhelming amount of code to post. I also feel as if i have over complicated this.Thanks for the help, I hope this isnt an overwhelming amount of code to post. I also feel as if i have over complicated this.Code:import java.util.Scanner; public class fibseq { //scanners for 2 inputs, first a number then a choice(yes or no) static Scanner in = new Scanner(System.in); static Scanner in2 = new Scanner(System.in); static String choice; // choice of yes or no static String yes = "yes"; // yes string to compare static String no = "no"; // no string to compare static int i = 0; // int i is used to find the next number but save fNumber static int y = 0; // this is the int that i will switch with in repeat static int fNumber; // fNumber means first number public static void main(String[] args) { getNumber(); responce(); } public static void getNumber() { //get the number System.out.println("Enter your number(single digit 1 - 9 no 0): "); fNumber = in.nextInt(); nextNumber(); } public static void nextNumber() { while(i < fNumber) { i = fNumber; } } public static void repeat() { y = i + fNumber; System.out.println(y); while ( >= fNumber) { } } public static void responce() { System.out.println(i + "\n"); System.out.println("Whould you like the number after this as well?"); choice = in2.next(); //idk if i should make another method for this.... if (choice == no) { System.out.println("Goodbye!"); System.exit(0); } if (choice == yes) { /* This is where i get lost i need to basically tell the * system to take the last number which should be stored * in the int i and then add it with the original number * which shoould be stored in fNumber, then output it, * then give the user a change to ask for the number after * that as well. Below is a random attempt i have been * trying to dev refer to the method repeat. */ repeat(); } } } Thanks again, 5imp7y
http://www.codingforums.com/java-and-jsp/292510-fibonacci-sequence.html?s=d3d2d5950456b547eac6b35bd076cd8f
CC-MAIN-2016-30
refinedweb
520
66.88
#include <cstdio> int main() { bool l_default_value; if(l_default_value) printf("default value for bool is true\n"); else printf("default value for bool is false\n"); return 0; }Is there a default value for a bool in C++? Why this happens? TIA. #1 Members - Reputation: 122 Posted 27 May 2010 - 03:12 AM #2 Moderators - Reputation: 10843 Posted 27 May 2010 - 03:15 AM #3 Members - Reputation: 122 Posted 27 May 2010 - 03:16 AM Don't know where/when i formed this idea about it. Glad i've run into this. thanx SiCrane. #4 Members - Reputation: 781 Posted 27 May 2010 - 03:17 AM #5 Members - Reputation: 152 Posted 27 May 2010 - 03:46 AM #6 Members - Reputation: 100 Posted 27 May 2010 - 03:58 AM Quote: It would seem to apply for all globals then. At least my combination of bools and ints all got zero as their initial values. Or its just that, the whole datasegment is just by default zeroed? This happened on Visual Studios debug mode though... Wonder if enabling optimizations and disabling runtime checkups would alter the result. #7 Members - Reputation: 163 Posted 27 May 2010 - 03:58 AM Quote: Under no circumstances would I recommend you ever rely on this being the case. #8 Moderators - Reputation: 7430 Posted 27 May 2010 - 04:08 AM Quote: It is reliable; objects with static storage duration are zero-initialized before all other initialization occurs (see 'basic.start.init' in the standard). #9 Moderators - Reputation: 10843 Posted 27 May 2010 - 04:25 AM struct Foo {}; int Foo::* data; int main() { std::cout << (data == 0) << std::endl; } I'm firmly in the "just initialize your variables" camp. #10 GDNet+ - Reputation: 1312 Posted 27 May 2010 - 04:32 AM bool var = false; instead of bool var; or is it? #11 Members - Reputation: 2422 Posted 27 May 2010 - 06:52 AM Quote:It is, when you have an array. (Real programmers probably cry in pain while reading this) #12 Members - Reputation: 840 Posted 27 May 2010 - 07:10 AM bool array[100] = {}; #13 Senior Moderators - Reputation: 7002 Posted 27 May 2010 - 07:33 AM Quote: bool* array = new bool[100]();too... In general, always initialize your variables, never just leave it up to the compiler (even for statics), because interpretations of the standard varies from compiler to compiler, and even version to version. Just spare yourself the hassle and initialize them yourself. In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh. ScapeCode - Blog | SlimDX #14 Members - Reputation: 2422 Posted 27 May 2010 - 08:12 AM Quote:Hmmm. I learn something new every day. Thanks guys! #15 Members - Reputation: 516 Posted 27 May 2010 - 10:49 AM Quote: afaik, this is something you can rely on. anything with static duration will be 0'd, guaranteed. static int magic[32] = { 0, 1, 2, 3 }; will end up 01230000... #16 Moderators - Reputation: 10843 Posted 27 May 2010 - 11:01 AM Quote: Quote: Quote: Which doesn't rely on the zero-initialization of objects with static storage duration. If you specify four items in an aggregate initializer list for an array of 32 ints, you aren't saying leave the items you didn't specify uninitialized, you're saying initialize the rest of the other items with 0. #17 Members - Reputation: 114 Posted 27 May 2010 - 09:18 PM
http://www.gamedev.net/topic/572392-c-default-value-for-bool/
CC-MAIN-2015-35
refinedweb
578
59.84
scan input from a file #include <stdio.h> int fscanf( FILE *fp, const char *format, ... ); The fscanf() function scans input from the file designated by fp, under control of the argument format. Following the format string is a list of addresses to receive values. The format string is described under the description of the scanf() function. The number of input arguments for which values were successfully scanned and stored, or EOF when the scanning is terminated by reaching the end of the input stream. When a file input error occurs, errno may be set. To scan a date in the form "Saturday April 18 1987": #include <stdio.h> void main() { int day, year; char weekday[10], month[10]; FILE *in_data; in_data = fopen( "file", "r" ); if( in_data != NULL ) { fscanf( in_data, "%s %s %d %d", weekday, month, &day, &year ); printf( "Weekday=%s Month=%s Day=%d Year=%d\n", weekday, month, day, year ); fclose( in_data ); } } ANSI cscanf(), errno, scanf(), sscanf(), vcscanf(), vfscanf(), vscanf(), vsscanf()
https://users.pja.edu.pl/~jms/qnx/help/watcom/clibref/src/fscanf.html
CC-MAIN-2022-33
refinedweb
162
64.41
Nowadays JavaScript applications are getting bigger and bigger. One of the most crucial things while developing is to optimise the page load time by reducing the size of the JavaScript bundle file. JavaScript is an expensive resource when processing and should be compressed when it is about to be sent over the network. One of the most popular techniques to improve the performance of our applications is code splitting. It is based on splitting the application into chunks and serving only those parts of JavaScript code that are needed at the specified time. However, this article is going to be about another good practice called tree shaking. Tree shaking is used within the ES2015 import and export syntax and supports the dead-code elimination. Since Webpack 4 released it is possible to provide the hint for a compiler by the “sideEffects” property to point the modules that can be safely pruned from the application tree if unused. Function may be supposed to have side effects if it modifies something outside its own scope. Real life example In order to introduce tree shaking concept more precisely, let’s start with creating a new project including the application entry point (index.js) and the output bundle file (main.js). In the next step, a new JavaScript file (utils.js) is added to the src directory… export function foo() { console.log('First testing function') } export function bar() { console.log('Second testing function') } …and imported in the index.js. import { foo } from './utils.js' foo() Webpack 4 introduces the production and development mode. In order to get a not minified output bundle, we are supposed to run a build process in the development mode what can be defined in the package.json file. "scripts": { "dev": "webpack --mode development", "build": "webpack --mode production" } Now, just get the terminal and run: npm run build script. Despite, only the foo function has been required in the entry point, our output bundle still consists of both foo and bar methods. Bar function is known as a “dead code” since it is unused export that should be dropped. console.log('First testing function');\n\nfunction bar() {\n console.log('Second testing function') To fix this problem we are about to set the “sideEffects” property in package.json file. { "name": "tree-shaking", "version": "1.0.0", "sideEffects": "false", } That property just tells the compiler that there are not any side effects files and every unused code can be pruned. It accepts also absolute and relative paths to the files that should not be dropped due having some side effects. { "name": "tree-shaking", "version": "1.0.0", "sideEffects": "./src/file-wth-side-effects.js", } Minification After we pruned unused ES6 imports and exports, we still need to remove “dead code” from the application bundle. The only thing we have to do is to set the mode configuration to production and execute npm run build. ([function(e,t,n){"use strict";n.r(t),console.log("First testing function")}]); As we can see, the second testing function is no more included in the bundle minified file. Use three shaking with the ES6 It is crucial to keep in mind that tree shaking pattern can be used only within the ES6 import and export modules. We cannot “shake the tree” while using the CommonJS without the help of special plugins. To solve this issue, setting the babel-preset-env to leave the ES6 modules on their own should be performed. { "presets": [ ["env", { "modules": false }] ] } Exception Removing unused modules does not work while dealing with lodash. Lodash is one of the most popular utility library. If you import a module in the way it is depicted below, it will still pull all the lodash library. import { join } from 'lodash' To go around that, we need to install lodash-es package and require the modules in the following way: import join from 'lodash-es/join' Conclusion Let’s prove the statement from the beginning of this article! Let’s take a closer look at the sizes of the bundle file (main.js) before and after the tree shaking and minification process. As we can see we minimized the output size significantly. When you start using tree shaking in your projects it may seem not taking a big advantage of application performance at all. You will notice how it really boosts up your work while having a more complex application tree.
https://itsilesia.com/lets-shake-some-trees-how-to-enhance-the-performance-of-your-application-2/
CC-MAIN-2022-05
refinedweb
735
63.29
current position:Home>Do you know the fuzzy semantics in Python syntax? Do you know the fuzzy semantics in Python syntax? 2022-01-30 00:09:25 【Python learner】 1. The slice does not perform cross-border inspection and error reporting What will be the output of the following code ? list = ['a', 'b', 'c', 'd', 'e'] print list[10:] Copy code The following code will output an empty list [] , Will not produce IndexError error . As expected , Try using more than the number of members index To get members of a list . for example , Try to get list[10] And later members , It can lead to IndexError . However , Try to get the slice of the list , At the beginning index Exceeding the number of members will not produce IndexError, It just returns an empty list . This has become a particularly disgusting problem , Because there are no errors when running , Lead to bug It's hard to track . 2. Creation of empty list 1ist = [[ ]] * 5 list # output? list[0].append(10) list # output? list[1].append(20) list # output? list.append (30) list # output? Copy code 2,4,6,8 What results will be output on the line ? Try to explain . The output is as follows [[],[],[],[],[]] [[10],[10],[10],[10],[10]] [[10,20],[10,20],[10,20]] [[10,20],[10,20],[10,20],[10,20],[10,20],30] Copy code The output of the first line is intuitively easy to understand , for example list = [ [ ] ] * 5 Is simply created 5 An empty list . However , Understanding expressions list=[ [ ] ] * 5 The key point is that it doesn't create a list of five separate lists , Instead, it is a list created with five references to the same list . Only to understand this point , We can better understand the next output . 3. The key is coming. : Delay binding of closures What will be the output of the following code ? Please explain . #Python Learning exchange group :531509025 def multipliers(): return [lambda x : i*x for i in range(4)] print [m(2) for m in multipliers()] Copy code How do you modify the above multipliers The definition of produces the desired results ? The output of the above code is [6, 6, 6, 6] , Not what we think [0, 2, 4, 6] . The reason for the above problems is Python Delay binding of closures . This means that when an internal function is called , The value of the parameter is searched in the closure . therefore , When any multipliers() When the returned function is called ,i The value of will be found in the nearby range . At that time , Whether the returned function is called or not ,for The cycle is complete ,i Given the final value 3. therefore , Each time the function returned is multiplied by the value passed 3, Because the value of the previous code is 2, They all end up returning 6(3*2). It happened that ,《The Hitchhiker’s Guide to Python》 Also pointed out , With the lambdas There is also a widely misunderstood point of knowledge about functional correlation , But with this case Dissimilarity . from lambda There is nothing special about the functions created by expressions , It's actually with def The function created is the same . Here are some ways to solve this problem . One solution is to use Python generator . def multipliers(): for i in range(4): yield lambda x : i * x Copy code Another solution is to create a closure , Use the default function to bind immediately . def multipliers(): return [lambda x, i=i : i * x for i in range(4)] Copy code Another alternative is , Use partial functions : from functools import partial from operator import mul def multipliers(): return [partial(mul, i) for i in range(4)] Copy code author[Python learner]
https://en.pythonmana.com/2022/01/202201300009238742.html
CC-MAIN-2022-27
refinedweb
622
60.65
Client for Capturing Voice Calls on the Android OS This project received 7 bids from talented freelancers with an average bid price of $1032 USD.Get free quotes for a project like this Skills Required Project Budget$500 - $1000 USD Total Bids7 Project Description # VoiceGuard is a recording service from TextGuard that records inbound and outbound calls and makes them available online. Companies need an active account on TextGuard's website or host an on-premise instance of the application and have the VoiceGuard feature turned on. VoiceGuard will record the calls by automatically creating a conference call to a recording server using native three-way calling features. The recording server will record, compress, and then upload the recording to TextGuard servers. The current Android application records all call details, e.g. other number and duration, and uploads the details to the TextGuard servers. The server threads the call details and recording together and makes the recording playable. This project is too develop functionality to create the automatic conference call to be added to the existing TextGuard Android application. The deliverables will be as follows; ? Java classes ? Changes to [url removed, login to view] ? Test Application that demonstrates its use The new functionality needs to automatically create the conference call for both inbound and outbound calls. The phone owner should not be able to manually disable intercepting any phone calls. The application must detect a new inbound call and automatically join the inbound call with the recording server phone number. The detection and successful connection to the recording server must complete within 4 seconds of the phone owner accepting the call. The application must account for outbound calls in two ways; first, it should operate like an inbound call in that it automatically detects the call and creates the conference call. Second, it must provide an alternate dialing service that connects to the recording service first, then calls the outbound number. The final java code must conform to the following standards; Code format must follow standard java spacing and outlining (i.e. Ctrl+Shift+F in eclipse). Variable naming must be conform to java standards, e.g. lowercase initial letter and capital subsequent words. All public functions and public classes must have full javad
https://www.freelancer.com/projects/Mobile-Phone/Client-for-Capturing-Voice-Calls/
CC-MAIN-2016-40
refinedweb
374
54.73
count() function The count() function outputs the number of records in a column. It counts both null and non-null records. count() is an aggregate function. Output data type: Integer count(column: "_value") Empty tables count() returns 0 for empty tables. To keep empty tables in your data, set the following parameters for the following functions: Parameters column The column on which to operate. Defaults to "_value". tables Input data. Default is piped-forward data ( <-). Examples The following example uses data provided by the sampledata package to show how count() transforms data. Count the number of rows in each input table import "sampledata" sampledata.string() |> count().
https://docs.influxdata.com/flux/v0.x/stdlib/universe/count/
CC-MAIN-2022-21
refinedweb
106
52.66
Greetings. After having an issue with this.userService.login throwing an error, I decided to go right back to the start of the Groceries tutorial and work through it again step by step. Oddly enough, I’m now getting an issue which didn’t happen my first time through the tutorial. I’m using an iPhone 6 Plus, and I deleted and re-installed both NativeScript Preview and NativeScript Playground, just to make sure that were no old files mucking things up. The problem is appearing in Lesson 1, Step 2 where I’m directed to copy/paste this code - import { Component } from “@angular/core”; @Component({ selector: “my-app”, template: ` The ActionBar displays ok, but the GridLayout is blank, instead of being a bar chart. Thanks for any pointers. Cheers, Brian
https://discourse.nativescript.org/t/gridlayout-not-rendering/3839
CC-MAIN-2019-09
refinedweb
131
59.43
Today, I will write about the remaining rules to statements and the arithmetic rules. If you don't follow the arithmetic rules, undefined behaviour may kick in. Four rules to statements are left. Here are they: == != The first rule is quite obvious. Declaring a local variable without a name has no effect. With the final semicolon, the variable will go out of scope. void f() { lock<mutex>{mx}; // Bad // critical region } Typically, the optimiser can remove the creation of a temporary, if it will not change the observable behaviour of the program. This is the so-called as-if rule. To put is the other way around. If the constructor has observable behaviour such as modifying the global state of the program, the optimiser is not allowed to remove the creation of the temporary. To be honest, I don't get the reason for this rule. Why do you want to write empty statements? For me, both examples are just bad. for (i = 0; i < max; ++i); // BAD: the empty statement is easily overlooked v[i] = f(v[i]); for (auto x : v) { // better // nothing } v[i] = f(v[i]); Ok. That is from two perspectives really a very bad practice. First, you should avoid to write raw loops and use the algorithms of the Standard Template Library. Second, you should not modify the control variable inside the for-loop. Here is the bad practice. for (int i = 0; i < 10; ++i) { // if (/* something */) ++i; // BAD // } bool skip = false; for (int i = 0; i < 10; ++i) { if (skip) { skip = false; continue; } // if (/* something */) skip = true; // Better: using two variable for two concepts. // } What makes it difficult for me to reason in particular about the second for-loop is that this are under the hood two nested dependent loops. I'm guilty. In my first years as professional C++ developer I often used redundant == or != in conditions. Of course, this changed in the meantime. // p is not a nullptr if (p) { ... } // good if (p != nullptr) { ... } // redundant // p is a nullptr if (!p) { ... } // good if (p == 0) { ... } // redundant for (string s; cin >> s;) // the istream operator returns bool v.push_back(s); These were the rules to statements. Let's continue with the arithmetic rules. Here are the first seven. unsigned Honestly, there is often not so much for me to add to this rules. For the sake of completeness (and importance), I will briefly present the rules. If you mix signed and unsigned arithmetic, you will not get the expected result. #include <iostream> int main(){ int x = -3; unsigned int y = 7; std::cout << x - y << std::endl; // 4294967286 std::cout << x + y << std::endl; // 4 std::cout << x * y << std::endl; // 4294967275 std::cout << x / y << std::endl; // 613566756 } GCC, Clang, and the Microsoft Compiler produced the same results. The reason for the rules is quite simple. Bitwise operations on signed types are implementation-defined. First, you should make arithmetic with signed types. Second, you should not mix signed and unsigned arithmetic. If not, the results may surprise you. #include <iostream> template<typename T, typename T2> T subtract(T x, T2 y){ return x - y; } int main(){ int s = 5; unsigned int us = 5; std::cout << subtract(s, 7) << '\n'; // -2 std::cout << subtract(us, 7u) << '\n'; // 4294967294 std::cout << subtract(s, 7u) << '\n'; // -2 std::cout << subtract(us, 7) << '\n'; // 4294967294 std::cout << subtract(s, us + 2) << '\n'; // -2 std::cout << subtract(us, s + 2) << '\n'; // 4294967294 } Let me combine both rules. The effect of an overflow or an underflow is the same: memory corruption and undefined behaviour. Let's make a simple test with an int array. How long will the following program run? // overUnderflow.cpp #include <cstddef> #include <iostream> int main(){ int a[0]; int n{}; while (true){ if (!(n % 100)){ std::cout << "a[" << n << "] = " << a[n] << ", a[" << -n << "] = " << a[-n] << "\n"; } a[n] = n; a[-n] = -n; ++n; } } Disturbing long. The program writes each 100th array entry to std::cout. If you want to have a crash you should divide by zero. Diving by zero may be fine in a logical expression. bool res = false and (1/0); Because the result of the expression (1/0) is not necessary for the overall result, it will not be evaluated. This technique is called short circuit evaluation and is a special case of lazy evaluation. Don't use an unsigned type if you want to avoid negative values. The consequences may be serious. The behaviour of arithmetic will change and you are open to errors including signed/unsigned arithmetic. Here are two examples of the Guidelines, intermixing signed/unsigned arithmetic. unsigned area(unsigned height, unsigned width) { return height*width; } // ... int height; cin >> height; auto a = area(height, 2); // if the input is -2 a becomes 4294967292 As the Guidelines stated there is an interesting relation. When you assign a -1 to an unsigned int, you will become the largest unsigned int. Now to the more interesting case. The behaviour of arithmetic will differ between signed and unsigned types. Let's start with a simple program. // modulo.cpp #include <cstddef> #include <iostream> int main(){ std::cout << std::endl; unsigned int max{100000}; unsigned short x{0}; // (2) std::size_t count{0}; while (x < max && count < 20){ std::cout << x << " "; x += 10000; // (1) ++count; } std::cout << "\n\n"; } The key point of the program is that the successive addition to x in line (1) will not trigger an overflow but a modulo operation if the value range of x ends. The reason is that x is of type unsigned short (2). // overflow.cpp #include <cstddef> #include <iostream> int main(){ std::cout << std::endl; int max{100000}; short x{0}; // (2) std::size_t count{0}; while (x < max && count < 20){ std::cout << x << " "; x += 10000; // (1) ++count; } std::cout << "\n\n"; } I made a small change to the program modulo.cpp such that x (2) becomes a signed type. The same addition will now trigger an overflow. I marked the key points with red circles in the screenshot. Now, I have a burning question: How can I detect an overflow? Quite easy. Replace the erroneous assignment x += 1000; with an expression using curly braces: x = {x + 1000};. The difference is that the compiler checks narrowing conversions and, therefore, detects the overflow. Here is the output from GCC. Sure the expressions (x += 1000) and (x = {x + 1000}) are from a performance perspective not the same. The second one could create a temporary for x + 1000. But in this case, the optimiser did a great job and both expressions were under the hood the same. I'm nearly done with the arithmetic rules. This means in the next post I will continue my journey with the rules to performance. 139 guests and no members online Kubik-Rubik Joomla! Extensions Read more... Read more...
http://modernescpp.com/index.php/c-core-guidelines-rules-to-statements-and-arithmetic-rules
CC-MAIN-2019-51
refinedweb
1,139
74.59
Using RhinoCommon from Python This brief guide cover using RhinoCommon from Python. Overview Along with the RhinoScript style functions you will be able to use all of the classes in the .NET Framework, including the classes available in RhinoCommon. As a matter of fact, if you look at the source for the rhinoscriptsyntax functions, they are just python scripts that use RhinoCommon. This allows you to do some pretty amazing things inside of a python script. Many of the features that once could only be done in a .NET plugin can now be done in a python script For example, you can implement some custom drawing while a user is picking a point with the following script. This script draws a Red and Blue line connected to the point under the mouse cursor while the user is picking a point. import Rhino import System.Drawing def GetPointDynamicDrawFunc( sender, args ): pt1 = Rhino.Geometry.Point3d(0,0,0) pt2 = Rhino.Geometry.Point3d(10,10,0) args.Display.DrawLine(pt1, args.CurrentPoint, System.Drawing.Color.Red, 2) args.Display.DrawLine(pt2, args.CurrentPoint, System.Drawing.Color.Blue, 2) # Create an instance of a GetPoint class and add a delegate for the DynamicDraw event gp = Rhino.Input.Custom.GetPoint() gp.DynamicDraw += GetPointDynamicDrawFunc gp.Get()
https://developer.rhino3d.com/5/guides/rhinopython/using-rhinocommon-from-python/
CC-MAIN-2021-39
refinedweb
210
58.38
This week, let's talk about what, out of all the symbols in kernel space, you're allowed to access, and what you're not. And while we're at it, what symbols you can make available to other loadable modules from your code. (The archive of all previous "Kernel Newbie Corner" articles can be found here.) This is ongoing content from the Linux Foundation training program. If you want more content please, consider signing up for one of these classes. Back to Basics Let's once again consider a fairly basic loadable module, which prints to /var/log/messages that it's been loaded, and also prints the current value of the kernel space symbol jiffies, which is the number of kernel clock ticks in HZ since the kernel was booted (sort of). Here's the sample module source file m1.c: #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/jiffies.h> [for "jiffies" variable] static int __init hi(void) { printk(KERN_INFO "module m1 being loaded.\n"); printk("Current jiffies: %lu.\n", jiffies); return 0; } static void __exit bye(void) { printk(KERN_INFO "module m1 being unloaded.\n"); } module_init(hi); module_exit(bye); MODULE_AUTHOR("Robert P. J. Day"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Symbols, exported and otherwise."); Run That Baby! Given that the tick rate for my current kernel is 1000, if I load and unload that module once per second, I should expect to see the value of jiffies increasing by about 1000 each time. So let's let the shell keep track of that by running the following at the command line until we tell it to stop: # while true ; do > insmod m1.ko > rmmod m1 > sleep 1 > done at which point we see in /var/log/messages: ... Jul 29 11:04:17 localhost kernel: module m1 being loaded. Jul 29 11:04:17 localhost kernel: Current jiffies: 4297191451. Jul 29 11:04:17 localhost kernel: module m1 being unloaded. Jul 29 11:04:18 localhost kernel: module m1 being loaded. Jul 29 11:04:18 localhost kernel: Current jiffies: 4297192470. Jul 29 11:04:18 localhost kernel: module m1 being unloaded. Jul 29 11:04:19 localhost kernel: module m1 being loaded. Jul 29 11:04:19 localhost kernel: Current jiffies: 4297193488. Jul 29 11:04:19 localhost kernel: module m1 being unloaded. Jul 29 11:04:20 localhost kernel: module m1 being loaded. Jul 29 11:04:20 localhost kernel: Current jiffies: 4297194508. Jul 29 11:04:20 localhost kernel: module m1 being unloaded. ... That looks good--the value of jiffies seems to be increasing about 1000 each time. Which brings us to our main point. What Exactly Can Your Module Access After It's Loaded? As you can see, your module needed to be able to access a couple different symbols from kernel space: the routine printk(), and the variable jiffies. And why were those symbols available to your module? Because they were "exported". You can think of kernel symbols (either functions or data objects) as visible at three different levels in the kernel source code: - "static", and therefore visible only within their own source file (just like standard user space programming), - "external", and therefore potentially visible to any other code built into the kernel itself, and - "exported", and therefore visible and available to any loadable module. Exporting symbols for modules is typically done with one of: - EXPORT_SYMBOL(), which exports to any loadable module, or - EXPORT_SYMBOL_GPL(), which exports only to GPL-licensed modules. Not surprisingly, then, since we could access those two symbols, we expect to find them exported somewhere in the source tree and, sure enough: kernel/printk.c:EXPORT_SYMBOL(printk); kernel/time.c:EXPORT_SYMBOL(jiffies); Let's let kernel wizard Robert Love summarize this in his book, Linux Kernel Development (2nd ed.), p. 288: When modules are loaded, they are dynamically linked into the kernel. As with userspace, dynamically linked binaries can call only into external functions that are explicitly exported for use. In the kernel, this is handled via special directives EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(). Functions that are exported are available for use by modules. Functions that are not exported cannot be invoked. But wait--there's more. Exporting Symbols of Your Own Not surprisingly, you can use the above to export symbols from your loadable modules to make them available to other modules. Consider module source file m2.c: #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> static int rday_1 = 1; int rday_2 = 2; int rday_3 = 3; EXPORT_SYMBOL(rday_3); static int __init hi(void) { printk(KERN_INFO "module m2 being loaded.\n"); return 0; } static void __exit bye(void) { printk(KERN_INFO "module m2 being unloaded.\n"); } module_init(hi); module_exit(bye); MODULE_AUTHOR("Robert P. J. Day"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Let's try some exporting."); As you can see, there are three integer variables defined, only one of which should be visible to other modules after this one is loaded. To confirm that, once you compile that module, but before you load it, you can examine its symbol table thusly: $ nm m2.ko 0000000000000000 r __kstrtab_rday_3 0000000000000000 r __ksymtab_rday_3 0000000000000040 r __mod_author25 0000000000000000 r __mod_description27 0000000000000028 r __mod_license26 0000000000000060 r __mod_srcversion23 00000000000000a0 r __mod_vermagic5 0000000000000088 r __module_depends 0000000000000000 D __this_module 0000000000000000 t bye 0000000000000000 T cleanup_module 0000000000000000 t hi 0000000000000000 T init_module U mcount U printk 0000000000000000 D rday_2 0000000000000004 D rday_3 If you're familiar with the nm utility, you'll see that the variable rday_1 doesn't show up in the symbol table at all (having been declared as "static"), while both rday_2 and rday_3 are flagged as global data objects but, additionally, you can see that rday_3 has an entry in the module string table and symbol table, meaning that when this module is loaded, that symbol will be made available to other loadable modules. And it's easy enough to verify that by loading that module, then checking the contents of the dynamic kernel symbol table available in the file /proc/kallsyms: $ grep rday /proc/kallsyms ffffffffa00f6080 r __ksymtab_rday_3 [m2] ffffffffa00f6090 r __kstrtab_rday_3 [m2] ffffffffa00f6570 D rday_3 [m2] ffffffffa00f656c d rday_2 [m2] What the above excerpt from /proc/kallsyms represents should be obvious: - The variable rday_1 shouldn't show up anywhere in kernel space since it was declared as static. - The variable rday_2 exists in kernel space, but is considered "local" in that context. - The variable rday_3 exists in kernel space, and is considered "global" and available to other modules since it was exported. A Couple More Details Regarding Exporting Besides the standard export macros defined in the kernel header file linux/module.h, there are a couple more specialized ones: - EXPORT_UNUSED_SYMBOL() and EXPORT_UNUSED_SYMBOL_GPL(), which are used to identify symbols that are currently being exported but which are destined for unexporting some day, so you should try to avoid using them. The phrase "UNUSED" in this context is unfortunate, as it would have made much more sense to have used the phrase "DEPRECATED". - EXPORT_SYMBOL_GPL_FUTURE(), which denotes a symbol that is currently available to all modules, but is planned for restriction to GPL-only modules in the future. zair Said: Nice article about kernel export symbols. Got what i need..! Ahmed Abdelfattah Said: Nice info about nm tool . thanks :) Jose Said: Hello,!
http://www.linux.com/learn/linux-career-center/31161-the-kernel-newbie-corner-kernel-symbols-whats-available-to-your-module-what-isnt
CC-MAIN-2014-52
refinedweb
1,207
55.74
Integrate with HockeyApp for beta distribution & crash reports. Integrate with HockeyApp for beta distribution & crash reports. When developing an app or game you often want to allow beta testers to install your apps to get feedback early in your development process. With HockeyApp you can upload new versions of your iOS & Android builds and automatically notify your testers about the new version when they open your app the next time. HockeyApp collects and uploads crash reports from you apps or games for you. The plugin currently supports crash reporting for native iOS crashes and Android SDK crashes. HockeyApp is a great way to distribute your beta versions and collect crash reports during development of your apps & games. When developing an app or game you often want to allow beta testers to install your apps to get feedback early in your development process. With HockeyApp you can upload new versions of your iOS & Android builds and automatically notify your testers or customers about new the new version when they open your app the next time. HockeyApp collects and uploads crash reports from you apps or games for you. The plugin currently supports crash reporting for native iOS crashes and Android SDK crashes. Note: Errors in your QML code are currently not supported. To try the plugin or see an integration example have a look at the Felgo Plugin Demo app. Please also have a look at our plugin example project on GitHub:. To integrate HockeyApp into your Qt 5 app or game add the following item to your QML code: import QtQuick 2.1 import Felgo 3.0 HockeyApp { appId: "<HOCKEYAPP-APP-ID>" } From now on the plugin notifies the user with a message box whenever an update is available. HockeyApp identifies new updates by comparing the CFBundleVersion on iOS and the android:versionCode on Android, which are set from the PRODUCT_VERSION_CODE variable within your project file. If the latest uploaded version identifier is higher than the version identifier given in the currently installed app bundle, the user gets notified about a new update. To distribute a new update to your users, open up your app's *.pro project configuration file and set the version code by incrementing the PRODUCT_VERSION_CODE property and optionally update the PRODUCT_VERSION_NAME property. Note: You can find more information about version information in the Publishing Felgo Games & Apps guide. As a last step build your apps in release mode, sign them with your appropriate certificates and upload them to HockeyApp. For builds intended for app store distribution you should disable the update service of HockeyApp. You can do this by setting the HockeyApp::disableUpdateManager property to false. HockeyApp plugin you need to add the platform-specific native libraries to your project, described here: HockeySDK.frameworkfrom the iossubfolder to a sub-folder called ioswithin your project directory. .profile: ios { FELGO_PLUGINS += hockeyapp } build.gradlefile and add the following lines to the dependencies block: dependencies { compile 'net.vplay.plugins:plugin-hockeyapp:3.+' } Note: If you did not create your project from any of our latest wizards, make sure that your project uses the Gradle Build System like described here. You finally need to set up a HockeyApp user account at. Note: Other HockeyApp SDK versions higher than the stated ones might also be working but are not actively tested as of now. Voted #1 for:
https://felgo.com/doc/plugin-hockeyapp/
CC-MAIN-2019-47
refinedweb
555
54.93
From: Eric Ford (eford_at_[hidden]) Date: 2001-10-04 02:36:12 > Comments and criticisms will all be addressed asap, although asap may > not be tonight :-) But send them in nonetheless. Also, information on > other platforms cmath compliance would be nice, so send that information > in if you have please! And thanks in advance. Is there a reason why you use define's to deal with the std_compat namespace? Why not just use std_compat and make std_compat an alias to std, iff the cmath is compliant? MAKE_STD_FUNCTION_REAL2 (and SPECIALIZE_...) need to be able to deal with arguments of differing types. More template arguments... ldexp will either need to take two template arguments (even though we know the second should be an int) or be done separately. I'd vote for the former, since it generates a compile time error if there's not an appropriately specialized version anyway. For something like sin, I think it's reasonable to generate a compile errror for calling it with an int (I'd guess a call with an int is more often an error). However, for pow, I think we should specialize to allow for integers (more likely to be intentional). I'm not sure whether it's appropriate to have the specializations perform optimzations in this layer, so maybe just convert both arguments to the longer type. Fernado posted some simple type promotion code a while ago, which seems reasonable. Making progress... Thanks, E Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2001/10/18016.php
CC-MAIN-2021-31
refinedweb
264
66.03
Introduction: AVR Microcontroller Fuse Bits Configuration. Creating and Uploading in the Flash Memory of Microcontroller the LED Blinking Program. In this case we will create simple program in C code and burn it into the memory of the microcontroller. We will write our own program and compile the hex file, using the Atmel Studio as the integrated development platform. We will configure fuse bits and upload hex file into the memory of the AVR ATMega328P microcontroller, using our own programmer and software AVRDUDE. AVRDUDE - is a program for downloading and uploading the on-chip memories of Atmel’s AVR microcontrollers. It can program the Flash and EEPROM, and where supported by the serial programming protocol, it can program fuse and lock bits. Step 1: Writing Program and Compile the Hex File, Using the Atmel Studio If you don’t have Atmel Studio, you should download and install it:-... This project will use C, so select the GCC C Executable Project option from the template list to generate a bare-bones executable project. Next, it is necessary to specify which device the project will be developed for. This project will be developed for the AVR ATMega328P microcontroller. Type the code of program in the Main Source Editor area of Atmel Studio. The Main Source Editor – This window is the main editor for the source files in the current project. The editor has spell check and auto complete features. 1. We must tell compiler at what speed our chip is running to that it can calculate delays properly. #ifndef F_CPU #define F_CPU 16000000UL // telling controller crystal frequency (16 MHz AVR ATMega328P) #endif 2. We include the preamble, which is where we put our include information from other files, which defines global variables and functions. #include <avr/io.h> //header to enable data flow control over pins. Defines pins, ports, etc. #include <util/delay.h> //header to enable delay function in program 3. After the preamble comes the main() function. int main(void) { The main() function is unique and set apart from all other functions. Every C program must have exactly one main() function. Main() is where the AVR starts executing your code when the power first goes on, so it's the entry point of the program. 4.Set pin 0 of the PORTB as output. DDRB=0b00000001; //Set PORTB1 as output We do this by writing a binary number to the Data Direction Register B. The Data Direction Register B allows us to make the bits of register B input or output. Writing a 1 makes them output, while a 0 would make them input. Being that we are attaching an LED to act as output, we write a binary number, making the pin 0 of PORT B as output. 5. Loop. while (1) { This statement is a loop, often referred to as the main loop or event loop. This code is always true; therefore, it executes over and over again in an infinite loop. It never ceases. Therefore, LED will be blinking in an infinity, unless power is shut off from the microcontroller or the code is erased from program memory. 6. Turn on LED attached to port PB0 PORTB= 0b00000001; //turns on LED attached to port PB0 This line, gives a 1 to the PB0 of PortB. PORTB is a hardware register on the AVR chip that contains 8 pins, PB7-PB0, going from left to right. Putting a 1 at the end gives a 1 to PB0; this sets PB0 high which turns it on. Therefore, the LED attached to pin PB0 will turn on and light up. 7. Delay _delay_ms(1000); //creates a 1-second delay This statement create a 1-second delay, so that the LED turns and stays on for exactly 1 second. 8. Turn off all B pins, including PB0 PORTB= 0b00000000; //Turns off all B pins, including PB0 This line turns off all 8 Port B pins, so that even PB0 is off, so the LED turns off. 9. Another delay _delay_ms(1000); //creates another 1-second delay It turns off exactly for 1 second, before starting the loop all over again and encountering the line, which turns it back on, repeating the process all over. This happens infinitely so that the LED constantly blinks on and off. 10. Return statement } return (0); //this line is never actually reached } The last line of our code is a return(0) statement. Even though this code is never executed, because there is an infinite loop which never ends, for our programs that run on desktop computers, it's important for the operating system to know whether they ran correctly or not. For that reason, GCC, our compiler, wants every main() to end with a return code. Return codes are needless for AVR code, which runs freestanding of any supporting operating system; nevertheless, the compiler will raise a warning if you don't end main with return(). The final step is the building the project. It means compiling and finally linking all object files to generate the executable file (.hex) file. This hex file is generated inside the folder Debug which is inside the Project folder. This hex file is ready to be loaded into the microcontroller chip. Step 2: Changing the Default Configuration of the Micro Controller Fuse Bits It is important to remember that some of the fuse bits can be used to lock certain aspects of the chip and can potentially brick it (make it unusable).". There is also a forth byte that is used to program the lock bits. Each byte is 8 bits and each bit is a separate setting or flag. When we talk about setting, not setting, programmed, not programmed fuses we are actually using binary. 1 means not set, not programmed and a zero means set, programmed. When programming the fuses you can use binary notation or more commonly hexadecimal notation. ATmega 328P chips have a built in RC oscillator which has a 8 MHz frequency. New chips are shipped with this set as the clock source and the CKDIV8 fuse active, resulting in a 1 MHz system clock. The startup time is set to maximum and time-out period enabled. New ATMega 328P chips generally have the following fuse settings: Low fuse = 0x62 (0b01100010) High fuse = 0xD9 (0b11011001) Extended fuse = 0xFF (0b11111111) We will be use ATmega 328 chip with an external 16MHz crystal. Therefore, we need to program bits of "Fuse Low Byte" accordingly. 1. Bits 3-0 control the oscillator choice, and the default setting of 0010 is to use the calibrated internal RC oscillator, which we don't want. We want the low power crystal oscillator operation from 8.0 to 16.0 MHz, so bits 3-1 (CKSEL[3:1]) should be set to 111. 2.Bits 5 and 4 control the startup time, and the default setting of 10 is for a startup delay of six clock cycles from power-down and power-save, plus an additional startup delay of 14 clock cycles plus 65 milliseconds from reset. To be on the safe side for a low power crystal oscillator,. 3. Bit 6 controls the clock output to PORTB0, which we don't care about. So, bit 6 can be left set to 1. 4. Bit 7 controls the divide-by-8 operation and the default setting of 0 has the feature enabled, which we don't want. So, bit 7 needs to be changed from 0 to 1. Therefore, the new Fuse Low Byte should be 11111111 which, in hexadecimal notation, is 0xFF. To program bits of the "Fuse Low Byte" we can use our programmer (...) and software AVRDUDE. AVRDUDE is a command-line utility that is used to download from and upload to Atmel microcontrollers. Download AVRDUDE:... First, we must add describe our programmer to the configuration file of AVRDUDE. On Windows the configuration file is usally in the same location as the executable file of AVRDUDE. Pastе the text in configuration file avrdude.conf: # ISPProgv1 programmer id = " ISPProgv1"; desc = "serial port banging, reset=dtr sck=rts mosi=txd miso=cts"; type = "serbb"; connection_type = serial; reset = 4; sck = 7; mosi = 3; miso = 8; ; Before starting the AVRDUDE, we must connect the microcontroller to the programmer, according to the scheme. Open DOS prompt window. 1. To view the list of programmer that avrdude is supported type command avrdude -c c. If all is well, the list should have programmer id "ISPProgv1" 2. To view the list of Atmel devices that avrdude is supported type command avrdude -c ISPProgv1. The list should have device m328p for Atmel ATMega 328P. Next, type avrdude -c ISPProgv1 –p m328p,the command tell avrdude what programmer is being used and what Atmel microcontroller is attached. It presents the ATmega328P signature in hexadecimal notation: 0x1e950f. It presents the fuse bit programming currently in the ATmega328P also in hexadecimal notation; in this case, fuse bytes are programmed per factory default. Next, type avrdude -c ISPProgv1 –p m328p –U lfuse:w:0xFF:m, It is a command to tell avrdude what programmer is being used and what Atmel microcontroller is attached and to change the Fuse Low Byte to 0xFF. Now the clock signal should come from low power crystal oscillator. Step 3: Burning the Program Into the Memory of the ATMega328P Microcontroller First, copy the hex file of program we made at the beginning of the instruction in to AVRDUDE directory. Then, type in DOS prompt window the command avrdude –c ISPProgv1 –p m328p –u –U flash:w:[name of your hex file] The command writes hex file to the microcontroller’s memory. Now, the microcontroller works in accordance with the instructions of our program. Let's check it out! Step 4: Check Microcontroller Works in Accordance With the Instructions of Our Program Connect components in accordance with schematic diagram of the AVR Blinking LED Circuit. First, we need power, as all AVR circuits do. About 5 volts of power is sufficient for operation of the AVR chip. You can get this either from batteries or a DC power supply. We connect +5V of power to pin 7 and connect pin 8 to ground on the breadboard. In between both pins, we place a 0.1μF ceramic capacitor to smooth out the power of the power supply so that the AVR chip gets a smooth power line.. We connect the anode of our LED to AVR pin PB0. This is pin 14 of the ATMega328P. Since it is an LED, we want to limit current flowing to the LED so it doesn't burn out. This is why we place a 330Ω resistor in series with the LED. The cathode of the LED gets connected to ground. 16 MHz crystal is used to provide clock for the Atmega328 microcontroller and 22pF capacitors are used to stabilize the operation of crystal. These are all the connections necessary to light up the LED. Power supply. Ok. LED is blinking with one-second delay. The work of the microcontroller corresponds to our tasks. Step 5: Conclusion Admittedly, that was a long process for just flashing an LED, but the truth is that you have successfully cleared major hurdles: creating a hardware platform for programming an AVR microcontroller, Using the Atmel Studio as the integrated development platform, using AVRDUDE as software for configuring and programming an AVR microcontroller. If you want to keep up to date on my base microcontrollers projects, subscribe to my YouTube! Watching and sharing my videos is way to support what I do. Be the First to Share Recommendations Discussions
https://www.instructables.com/AVR-Microcontroller-Fuse-Bits-Configuration-Creati/
CC-MAIN-2020-50
refinedweb
1,932
62.88
For the most part, JSX should feel pretty natural. There are a few things to be aware of though. Whenever you want to use an expression (something that produces a value) in JSX, you need to wrap the expression in single curly braces, {}. render() {const name = 'Tyler'return (<div><h1>Hello, {name}</h1><p>Today is {new Date().toLocaleDateString()}</p><p>What is 2 + 2? {2 + 2}</p></div>)} If you want React to render nothing, return null. render() {if (isLoading() === true) {return null}return (...)} The ability to conditionally render UI based on a piece of state is pretty foundational to any front-end framework. Typically, this functionality is built natively into the framework. // Angular<h1 *Welcome back!</h1><ng-template #elseBlock><h1>Login to see your dashboard</h1></ng-template>// Vue<h1 v-Welcome back!</h1><h1 v-else>Login to see your dashboard</h1> With React, it’s a bit different. Instead of increasing the API surface layer, because JSX is “Just JavaScript”, React can leverage native JavaScript features to accomplish the same task. There are pros and cons to this approach, but if you’re already familiar with conditional rendering in JavaScript, you’ll feel pretty comfortable. The most basic example is just using a simple if/else statement. render() {const authed = isAuthed()if (authed === true) {return <h1>Welcome back!</h1>} else {return <h1>Login to see your dashboard</h1>}} Again, because we’re just writing JavaScript, if we had another conditional, we’d just add an else if case. render() {const authed = isAuthed()const firstLogin = isNew()if (firstLogin === true) {return <h1>👋 Welcome!</hi>} else if (authed === true) {return <h1>Welcome back!</h1>} else {return <h1>Login to see your dashboard</h1>}} If you’re rendering different UI based on a single condition, typically you’d use JavaScript’s ternary operator. render() {return isAuthed() === true? <h1>Welcome back!</h1>: <h1>Login to see your dashboard</h1>} We learned earlier that any expression needs to be wrapped in {}. We can use that knowledge to render a ternary inside of JSX. render() {return (<div><Logo />{isAuthed() === true? <h1>Welcome back!</h1>: <h1>Login to see your dashboard</h1>}</div>)} Earlier we also learned that we can render null if we want React to render nothing. This is a common pattern when using ternaries. render() {return (<div><Logo />{showWarning() === true? <Warning />: null}</div>)} If you’re not already familiar with it, JavaScript has an && operator. Typically it’s used in conditionals as an “AND” statement. if (user && authed) {} In the example above, it’s important to note that authed won’t be checked if user isn’t truthy. Using that logic, we can use the && operator as a more concise ternary that renders null. render() {return (<div><Logo />{showWarning() === true && <Warning />}</div>)} Can you spot what’s wrong with the following JSX code? render() {const name = 'Tyler'return (<h1>Hello, {name}</h1><p>Today is {getDay()}</p><p>What is 2 + 2? {2 + 2}</p>)} It looks fine, right? Unfortunately, it’ll throw an error. Adjacent JSX elements must be wrapped in an enclosing tag. That’s a fancy way to say that you can only ever return one top-level element from a component. In our example, we’re trying to return 3. We can fix this by wrapping everything in a div. render() {const name = 'Tyler'return (<div><h1>Hello, {name}</h1><p>Today is {getDay()}</p><p>What is 2 + 2? {2 + 2}</p></div>)} That fixes the issue, but now we have a semantic problem. We’re unnecessarily creating an extra div. This is the exact use case that React.Fragment was created for. If you want to return adjacent elements but don’t want to change your markup, wrap them in <React.Fragment>. render() {const name = 'Tyler'return (<React.Fragment><h1>Hello, {name}</h1><p>Today is {getDay()}</p><p>What is 2 + 2? {2 + 2}</p></React.Fragment>)} Much better. There also exists a shorthand syntax for React Fragment, but I don’t use it. render() {const name = 'Tyler'return (<><h1>Hello, {name}</h1><p>Today is {getDay()}</p><p>What is 2 + 2? {2 + 2}</p></>)} How does React know the difference between a custom React component like <User /> and a built-in HTML element like <span>? The answer is probably simpler than you’d expect, it’s based on the capitalization. Whenever you create a React component, you need to capitalize it. Otherwise, React will think it’s a built-in HTML.
https://ui.dev/jsx/
CC-MAIN-2021-43
refinedweb
750
59.7
folks, Ned here again. Despite the reputation for cutting edge technology, a lot of IT departments can get stuck in the now or worse, the past. Since it’s a new year, a new economy, and winter is coming to a close, here are some articles you should find interesting if you are looking to Hello folks, Ned here again. Today we talk PDCs, DFSN, DFSR, AGPM, authentication, PowerShell, Kerberos, event logs, and other random goo. Let’s get to it. Is the PDC Emulator required for user authentication? How long can a domain operate without a server that is running the PDC Emulator role? It’s not required for direct user authentication unless you are using (unsupported) NT and older operating systems or some Samba flavors. I’ve had customers who didn’t notice their PDCE was offline for weeks or months. Plenty of non-fully routed networks exist where many users have no direct access to that server at all. However! It is used for a great many other things: But don’t just trust me; I am a major plagiarizer! How Operations Masters Work (see section “Primary Domain Controller (PDC) Emulator”) How Operations Masters Work (see section “Primary Domain Controller (PDC) Emulator”) The DFSR help file recommends a full mesh topology only when there are 10 or fewer members. Could you kindly let me know reasons why? We feel that a full mesh will mean more redundancy. It’s just trying to prevent a file server administrator from creating an unnecessarily complex or redundant topology, especially since the vast majority of file server deployments do not follow this physical network topology. The help file also makes certain presumptions about the experience level of the reader. It’s perfectly ok – from a technical perspective - to make as many connections as you like if using Windows Server 2008 or later. This is not the case with Win2003 R2 (see this old post that applies only to that OS). The main downsides to a lot of connections are: I'm trying setup delegation for Kerberos but I can't configure it for user or computer accounts using AD Users and Computers (DSA.MSC). I’m logged as a domain administrator. Every time when I'm trying activate delegation I get error: The following Active Directory error occurred: Access is denied. The following Active Directory error occurred: Access is denied. It’s possible that someone has removed the user right for your account to delegate. Check your applied domain security policy (using RSOP or GPRESULT or whatever) to see if this has been monkeyed up: Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment "Enable computer and user accounts to be trusted for delegation" Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment "Enable computer and user accounts to be trusted for delegation" The Default Domain Controllers policy will have the built-in Administrators group set for that user right assignment once you create a domain. The privilege serves no purpose being set on servers other than DCs, they don’t care. Changing the defaults for this assignment isn’t necessary or recommended, for reasons that should now be self-evident. I want to clear all of my event logs at once on Windows Vista/2008 or later computers. Back in XP/2003 this was pretty easy as there were only 6 logs, but now there are a zillion. Your auditors must love you :). Paste this into a batch file and run in an elevated CMD prompt as an administrator: Wevtutil el > %temp%\eventlistmsft.txt For /f "delims=;" %%i in (%temp%\eventlistmsft.txt) do wevtutil cl "%%i" If you run these two commands manually, remember to remove the double percent signs and make them singles; those are being escaped for running in a batch file. I hope you have a systemstate backup, this is forever! Can AGPM be installed on any DC? Should it be on all DCs? The PDCE? [Answer from AGPM guru Sean Wright] You can install it on any server as long as it’s part of the domain - so a DC, PDCE, or a regular member server. Just needs to be on one computer. Is it possible to use Authentication Mechanism Assurance that is available in Windows Server 2008 R2 with a non-Microsoft PKI implementation? Is it possible to use Authentication Mechanism Assurance with any of Service Administration groups Domain Admins or Enterprise Admins? If that is possible what would be the consequences for built-in administrator account, would this account be exempt from Authentication Mechanism Assurance? So that administrators would have a route to fix issues that occurred in the environment, i.e. a get out of jail. [Answer from security guru Rob Greene] First, some background: So here are the answers: Is it possible to use Authentication Mechanism Assurance that is available in Windows Server 2008 R2 with a non-Microsoft PKI implementation? Yes, however, you will need to create the Issuance Policies that you plan to use by adding them through the Certificate Template properties as described in the TechNet article. Is it possible to use Authentication Mechanism Assurance with any of Service Administration groups Domain Admins or Enterprise Admins? This implementation requires that the group be a universal group in order for it to be used. So the only group of those listed above that is universal is “Enterprise Admins”. In theory this would work, however in practice it might not be such a great idea. If that is possible what would be the consequences for built-in administrator account, would this account be exempt from Authentication Mechanism Assurance? In most cases the built-in Administrator account is special cased to allow access to certain things even if their access has somehow been limited. However, this isn’t the best way to design your security of administrative accounts if you are concerned about not being able to get back into the domain. You would have similar issues if you made these administrative accounts require Smart Cards for logon, then for some reason the CA hierarchy did not publish a new CRL and the CA required a domain based admin to be able to logon interactively then you would be effectively locked out of your domain also. I find references on TechNet to a “rename-computer” PowerShell cmdlet added in Windows 7. But it doesn’t seem to exist. Oops. Yeah, it was cut very late but still lives on in some documentation. If you need to rename a computer using PowerShell, the approach I use is: (get-wmiobject Win32_ComputerSystem).rename("myputer") That keeps it all on one line without need to specify an instance first or mess around with variables. You need to be in an elevated CMD prompt logged in as an administrator, naturally. Then you can run restart-computer and you are good to go. There are a zillion other ways to rename on the PowerShell command-line, shelling netdom.exe, wmic.exe, using various WMI syntax, new functions, etc. Does disabling a DFS Namespace link target still give the referral back to clients, maybe in with an “off” flag or something? We’re concerned that you might still accidentally access a disabled link target somehow. [Oddly, this was asked by multiple people this week.] Disable actually removes the target from referral responses and nothing but an administrator’s decision can enable it. To confirm this, connect through that DFS namespace and then run this DFSUTIL command-line (you may have to install the Win2003 Support Tools or RSAT or whatever, depending on where you run this): DFSUTIL /PKTINFO It will not list out your disabled link targets at all. For example, here I have two link targets – one enabled, one disabled. As far as DFS responds to referral requests, the other link target does not exist at all when disabled. When I enable that link and flush the PKT cache, now I get both targets: When DFSR staging fills to the high watermark, what happens to inbound and outbound replication threads? Do we stop replicating until staging is cleared? Excellent question, Oz dweller. So the importance of staging space for very large files remains to ensure that quota is at least as large as the N largest files that could be simultaneously replicated inbound/outbound, or you will choke yourself out. From the DFSR performance tuning post: If you want to find the 32 largest files in a replicated folder, here’s a sample PowerShell command: Get-ChildItem <replicatedfolderpath> -recurse | Sort-Object length -descending | select-object -first 32 | ft name,length -wrap –auto If I create a domain-based namespace (\\contoso.com\root) and only have member servers for namespace servers, the share can’t browsed to in Windows Explorer. It is there, I just can’t browse it. But if I add a DC as a namespace server it immediately appears. If I remove the DC from namespace it disappears from view again, but it is still there. Would this be expected behavior? Is this a “supported” way create a hidden namespace? You are seeing some coincidental behavior based on the dual meaning of contoso.com in this scenario: It’s not an “unsupported” way to hide shares, but it’s not necessarily effective in the long-term. The way to hide and prevent access to the links and files/folders is through permissions and ABE. This solution is like a share with $ being considered hidden: only as long as people don’t talk about it. :) Not to mention this method is easy for other admins to accidentally “break” it through ignorance or reading blog posts that tell them all the advantages of DFS running on a DC. PS: Using a $ does work – at least on a Win2008 R2 DFS root server in a 2008 domain namespace: But only until your users talk about it in the break room… And by everything, I mean only this and rally sport. Have a nice weekend folks. - Ned “simple and readable” Pyle Hi, David here. We’ve seen a few cases on this now, so I wanted to put the word out and explain why it happens and how you can (very easily) prevent it from happening to you. The scenario: Imagine an ordinary domain admin. Let’s call him Fred. Fred has finally gotten the ok from his management to start deploying shiny new Windows Server 2008 R2 domain controllers (and the new hardware he wanted to do this). Fred brings up a DC and spends several weeks making sure that everything works. Then, confident in the stability of his new DC, he transfers the PDC Emulator role to it. Nothing explodes and everything appears to be good. Mission accomplished, Fred goes home and enjoys the rest of his weekend. On Monday morning Fred gets to work and finds out that the help desk is swamped with calls from users whose accounts are locked out. Unlocking the accounts only seems to fix them temporarily, and then they get locked out again. Fred’s manager tells him to undo the change he made over the weekend, which he does. Desperate to figure out why his new DC betrayed him so horribly, Fred opens up a case with Microsoft for support and gets someone on our team. Troubleshooting an account lockout: Obviously this is a bad situation for Fred, but unfortunately it’s kind of hard to troubleshoot an account lockout without logs from while the problem was happening. As an aside here, if you haven’t examined the Security Compliance Manager tool and its included docs, you should probably take a look. It lays out our recommendations around account lockout policies. There are multiple tools for troubleshooting account lockouts, but sometimes it pays to go old-school: What we want for this are the Netlogon debug logs, which every domain administrator should be familiar with. Netlogon debug logging can show you all kinds of very useful information for troubleshooting authentication issues, particularly with NTLM authentication. In this situation, it shows us something very interesting if we take a look at the log from the domain controllers of the domain while the accounts are being locked out: [LOGON] SamLogon: Transitive Network logon of Domain\User from Computer successfully handled on DC (UseHub is FALSE). I should mention here that the netlogon debug logging is NOT turned on by default, which is really just a holdover from the days when your server processor speeds were measured in mhz. It can be a highly useful troubleshooting tool and everyone should know how to turn it on – documented here. Here in DS, we spend a lot of time looking at Netlogon debug logs, and when we first saw the above line in the log, we were stumped as to where it was coming from. It’s not something that we normally see at all, and none of us could remember ever seeing it in a case before. It turns out that this output only happens in the log under a very specific set of circumstances when the authenticating domain controller decides that it needs to bypass validating the password with the PDC if a bad password is received. When it makes this decision, it sets a parameter called UseHub to FALSE instead of the default of TRUE. Thankfully, it writes this in the netlogon log for us to see; otherwise we’d never have had any clue what it was doing. Unfortunately the log didn’t tell us why it was happening - only that it did happen. But, after some snooping in source code and a few dozen emails, we discovered that this decision occurs when the PDC of the domain will not allow us to pass the client’s credentials because the client is using a Lan Manager Authentication Method that is not supported on the PDC. Or, in normal language, what it means is that your LMCompatibility settings don’t match. Why would this happen just by moving the PDC Emulator role? So, like every new operating system, we ship Windows 2008 R2 with enhanced security when compared to its predecessors. Sometimes this security is accomplished by changing the way that OS works to make it harder to attack, or turning off unnecessary services until they are needed. At other times, we simply change default settings on features that were present in previous OS versions, because the majority of the world can now support those higher settings. LMCompatibility is one of those settings. The default for Windows 2008 R2 is a setting of 3: Send NTLM v2 response only/ Allow LM and NTLM. In Fred’s case, it turned out that his XP clients all had a setting of 1: Send LM and NTLM responses, while his new PDC emulator had a setting of 5: Send NTLM v2 response only/Refuse LM and NTLM. It’s worth noting that these setting aren’t the default – someone had to choose to put them there. The clients couldn’t use NTLMv2 session security, which is why we couldn’t pass the user’s credentials to the 2008 R2 PDC Emulator for evaluation. The 2003 DCs on the other hand, had a setting of 2: Send LM and NTLM, Use NTLMv2 if negotiated. So when the PDC was running Windows 2003, we didn’t have this problem. So the new Win2008 R2 OS was not specifically an issue – the same issue would have happened to any version of Windows running the PDCE. For normal Kerberos logons, we don’t care about LM Compatibility, but there are plenty of applications out there that will default to NTLM – and most applications will retry logons multiple times on your behalf without ever telling you that they’re doing it. In Fred’s environment, all it took was his Outlook clients, connecting to his Exchange CAS servers over http and using NTLM to try and authenticate that connection. The users had changed their passwords that morning and the local DCs didn’t have the new password – so, the password that Outlook used looked “bad” to the local DC. Because of the LM Compatibility mismatch, we couldn’t talk to the PDC, and thus we ended up locking the account out. Solving the problem – the right way So, Fred’s first inclination upon hearing from support about this might have been to reduce the security setting on the PDC emulator to make everything magically start working. And while this would have been effective, it would not have been the best solution from a security perspective. There are plenty of good reasons why you should want to use the strongest encryption and security algorithms on network communications, especially ones where your users passwords are being handed back and forth between computers for validation. The right solution here is that Fred should be centrally managing his settings in a way that fits his network and enforces the best possible level of security. Fortunately there’s a group policy setting that enables him to do just that: This setting is located in Computer Configuration ->Windows Settings -> Security Settings -> Local Policies -> Security Options. Notice the very helpful text on the Explain tab that outlines the default settings. So, if Fred was confident that all of the computers on his network supported NTLMv2, he could go ahead and use the policy to enforce the highest level of security on his entire network (Send NTLMv2 response only\refuse LM and NTLM). Or, if he suspected that there might be a few applications (or more likely, ancient operating systems) out there that haven’t quite been retired yet that might have problems with NTLMv2, he could use the fourth option instead and just refuse LM connections. As a note here, every supported Windows OS version supports NTLM v2 – so the situations where you can’t use it should be very rare and only happen with specific, third-party applications or OS platforms. David “Fred Herring” Beach I was out of the office last week and did not have a chance to post the new KB articles, so this week you’re in for double the fun. There are quite a few updates between the last two weeks. Here they are, separated by week: 2/13/2011 – 2/19/2011 977611 After you apply a GPO to redirect a folder to a new network share, the redirected folder is empty on client computers that are running Windows Vista or Windows Server 2008 2498185 How To Diagnose Active Directory Replication Failures 976033 "Terminal Session" targeting item does not work for a Group Policy preferences setting on a client computer that is running Windows Server 2008 or Windows Vista 981704 The file name of an ADM file is displayed incorrectly in the GPMC report in Windows Vista, in Windows Server 2008, in Windows 7 or in Windows Server 2008 R2 322244 How to Turn On Debug Logging of the Active Directory Users and Computers Snap-In 977511 About the DFS Namespaces service and its configuration data on a computer that is running Windows Server 2003 or Windows Server 2008 2/6/2011 – 2/12/2011 2493933 FIX: The "Validate server certificate" option is enabled on a computer that is running Windows Vista or Windows Server 2008 when you disable this option by using a Group Policy object 2464365 The ACL permission of some DFS folders is incorrectly reset after you restart the DFS Namespace service in Windows Server 2008 2505568 Cannot use Romanian "Ș" character in computer name on Windows 7 2492505 Computer does not crash when the disk is full after CrashOnAuditFail is set in Windows 7 or in Windows Server 2008 R2 2460922 Group Policy preference item-level targeting does not work for 64-bit versions of Windows 7 2462585 You cannot save changes to the Dial-in property settings of a user account on a Windows Server 2008-based domain controller or on a Windows 7-based computer that has RSAT installed 2468353 The MPR still calls the NPPasswordChangeNotify function to notify a password change event in Windows 7 or in Windows Server 2008 R2 even though the password change is unsuccessful 2506030 Text on logon screen or lock screen may be truncated with some third-party credential providers on Windows 7 2466048 Previous versions of a file or of a folder in a DFS share are not listed if you access the share through a nested DFS link from a computer that is running Windows 7 or Windows Server 2008 R2 2424375 A remote desktop session may be incorrectly disconnected when a smart card is removed in another remote desktop session in Windows Server 2008 or in Windows Server 2008 R2 2471430 You cannot restore large files in the NTFS file system when all the data streams that have sparse attributes are deleted in Windows Server 2008 or in Windows Vista 2413670 Events 1659, 1481, and 1173 are recorded in the Directory Service event log on Windows Server 2008 R2-based domain controllers after you remove Active Directory Domain Services from the last domain controller in a tree root domain 2445324 An AD FS-enabled web application that is published for AD FS authentication on a Windows Server 2008 R2-based computer cannot decode session cookies that are received out of order 2468316 A paged LDAP query fails on the second page and the pages that follow in Windows Server 2008 R2 2483564 Renewal request for an SCEP certificate fails in Windows Server 2008 R2 if the certificate is managed by using NDES 2462137 The Active Directory Users and Computers MMC snap-in and Active Directory Administrative Center display Serbia and Montenegro as one country instead of as two countries in Windows Server 2008 R2 and in Windows 7 2411938 "An external error has occurred" error when you change the user rights of an account in Local Security Policy in Windows Server 2008 R2 2461385 The DFS Replication service leaks download tasks, and an outgoing replication backlog occurs in Windows Server 2008 R2 2301288 A Remote Desktop Services session is disconnected automatically if you apply the "Interactive logon: smart card removal behavior" Group Policy setting in Windows Server 2008 R2 or in Windows 7 2466181 A crash in the Ntfs.sys component on a computer that is running an IA-64-based version of Windows Server 2008 R2 BACKSPACE or arrow keys do not work in MMC on a computer that is running Windows 7 or Windows Server 2008 R2 Hello all, Ned here again. Today we talk DCDIAG, DFSN, DFSR, group policy, user profiles, migrations, USMT, and the fuuuuuuturrrrrrrrre.: Win2008 R2 Win2008 R2 Win2003 Win2003. Is there a way to disable and enable DFS namespace targets from the command-line? We’re building some automation. You can use the Win2008/Vista RSAT (or later) versions of dfsutil.exe with this syntax: dfsutil property state offline <DfsPath> [<\\server\share>] dfsutil property state online <DfsPath> [\\server\share] dfsutil property state offline <DfsPath> [<\\server\share>] dfsutil property state online <DfsPath> [\\server\share] Nicely buried… When I use RSOP.MSC on a Windows 7 computer, I see a lot of missing entries and errors and whatnot.. I was curious - has the team heard what the future is for Active Directory, beyond Win2008 R2? Lots (that’s my full time job now) but we cannot discuss anything. Don’t worry, the marketing people won’t keep it a secret one moment longer than necessary. And our fearless leader lets things out every so often. Can the new MIGAPP.XML included in KB2023591 be used with USMT 3.01? . We have Windows Server 2003 DFSR and have started to explore adding Win2008 R2 servers. Is mixing supported and are there any known issues? Series Wrap-up and Downloads - Replacing DFSR Member Hardware or OS?] Yes, we have two ways to do this: MOVEUSER.EXE - XP and older, comes from the resource kit Win32_UserProfile WMI - Vista and newer: MOVEUSER.EXE - XP and older, comes from the resource kit Win32_UserProfile WMI - Vista and newer: These tools correctly change permissions and ProfileList registry settings in order to “move” (i.e. convert) a user profile between local and domain accounts. I didn’t want to like it… but I did. The name is Bond. Wyatt Bond. No shots of Bucky yet. Close encounters of the eleventyth kind Ned “the future, Conan?” Pyle Hi all, Ned here. Update
http://blogs.technet.com/b/askds/archive/2011/02.aspx?pi145015=2
CC-MAIN-2014-52
refinedweb
4,075
56.29
. For a time I've been avoiding extension methods. Not because I'm opposed to using them but because of the 3.5 Framework. A lot of the tools I own are designed to be very light weight tools that only require the user to have 2.0 installed on their machine. I find that the easier that tools are to install, the more likely people are to use them. Extension methods require the ExtensionAttribute be available. Since the attribute is declared in a 3.5 Framework assembly it's not possible to use extension methods without the 3.5 framework. At least, that's what I thought up until I read an recent MSDN article. You can simply define the ExtensionAttribute in your assembly and extension methods will start working. No references to the 3.5 framework required. It's a lightweight solution that adds the full power of extension methods to your program. Namespace System.Runtime.CompilerServices Class ExtensionAttribute Inherits Attribute End Class End Namespace Published Friday, November 16, 2007 3:37 PM by Jared Parsons PingBack from MSDN Blog Postings » Extension Methods without 3.5 Framework Could you provide a sample implementation? I've tried to implement this in C#, and I'm getting "Type expected" compiler errors because of the use of the this keyword in following code: public static bool IsEmailAddress(this string s) You're also unclear if the ExtensionAttribute should decorate anything. Is this all available in MSDN article you mention? If so, what's the URL? Adrian Anttila Sorry for the confusion. Below is some sample code detailing how to get this to work in C#. For C# you don't need to decorate anything with the Extension attribute (C# has builtin syntax for extension methods). using System; using System.Collections.Generic; using System.Text; namespace System.Runtime.CompilerServices { class ExtensionAttribute : Attribute { } } namespace ConsoleApplication168 public static class ExtensionHolder public static bool IsEmailAddress(this string s) { return false; } class Program static void Main(string[] args) Jared Parsons Here's my implementation, which still gets the "Type expected" compiler error in Visual Studio 2005: using System.Runtime.CompilerServices; using System.Text.RegularExpressions; public class ExtensionAttribute : Attribute namespace ConsoleApplication1 public static class StringExtensions Regex regex = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"); return regex.IsMatch(s); public class Program public static void Main(string[] args) string email = "aanttila@vertigo.com"; if (email.IsEmailAddress()) { Console.Write("Valid"); } else Console.Write("Invalid"); Console.WriteLine(); Console.Write("Press <enter> to exit..."); Console.ReadLine(); Are you targeting the 2.0 runtime from VS2008? I wonder if the compiler in VS2005 won't support the new 3.0 language features even if they are valid for 2.0. Actually, the C# version you wrote still will not compile because of that same error message. Tony This trick will only work with VS2008. 扩展方法本质上只是一个编译器级别的语法糖, 但不引用.NET Framework 3.5的程序集却无法发布程序到2.0/3.0版本的运行环境中, 因为它将使那些方法(扩展方法)带上ExtensionAttribute属性, 而就是ExtensionAttribute这个类却存在于.NET Framework 3.5的程序集中. 其实只要使用一个小技巧即可以保证带有扩展方法的程序在Target到.NET Framework 2.0/3.0时通过编译... Adrian H. I just installed framework 3.5 so i could play with linq but can not seem to get extension methords working in VS2005. MS you are a joke with you 3/3.5 framework and many developers think that V3.0 has linlq alan A great new feature of Visual Studio 2008 is multi-targeting, which allows VS 2008 to compile for .NET James Kovacs
http://blogs.msdn.com/jaredpar/archive/2007/11/16/extension-methods-without-3-5-framework.aspx
crawl-002
refinedweb
563
52.66
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. Get payslip net line amount in another costum field Happy new year to everybody. i want to get the net amount to pay to the employee in a costum field i have just created. I am not developper but i creat a function field in the hr.payslip model and write this function but it is not working def _get_payslip_net(self, cr, uid, ids, name, args, context): if not ids: return {} res = {} for line in line_ids.browse(cr, uid, ids, context=context): if line.code=="NET": res[line.id] = line.total return res Thanks in advance. About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/get-payslip-net-line-amount-in-another-costum-field-72280
CC-MAIN-2018-22
refinedweb
151
66.23
0.10 - Sat Sep 16 03:42:40 2006 * This is the initial release of a group of modules which implement the web services of the US Postal Service. This isn't screen scraping! * See 1.11 - Sat Nov 3 00:49:12 2007 * cleanups to move from CVS to SVN * now requires perl 5.6 * cleanups to the disto; no need to upgrade if you already have this 0.00 - Thu Oct 25 22:04:42 2007 * distro adjustments. no big whoop. 1.09 - Mon Feb 5 18:16:12 2007 * Jay Buffington noted I wasn't escaping the query strings correctly (meaning, at all), so I fixed that. * This is an important fix that everyone should upgrade too. 1.06 - Wed Jan 10 00:13:28 2007 * First official release :) 0.10 - Tue Sep 26 16:21:58 2006 * Changed namespace to Business::US::USPS::* * More docs to point out you need the USPS UserID to use any of this * See
https://metacpan.org/changes/distribution/Business-US-USPS-WebTools
CC-MAIN-2016-07
refinedweb
163
82.65
From time to time I see people using u8 s8 u16 etc instead of the usual unsigned char etc. What exacly is u8? is it just u8 defined as unsigned char? Will using u32 instead of unsigned int make sure that the compiler on every system will leave it untouched? Are there any downsides to using this system instead of the usual? Thanks . There should be some typedefs for integral types of fixed type in cstdint (although probably not all compilers have this). You can be quite sure that u8 is typedeffed as unsigned char (since the size of char is guaranteed to be 1). However, there are no guarantees for the other types. So it you typedef unsigned int as u32, there is no guarantee that it will be actually 4 bytes with each compiler. (If I'm not mistaken, each compiler implementation provides suitable typedefs in the cstdint header, so that you won't have to worry about the size of types with this particular compiler.) On the other hand, I've never been tempted to use fixed-sized integral types anyway. I see, I guess I just have to make sure no complications will arise on different systems then. Thanks . EDIT:I thought I would be smart and made my own definitions to make the code more readable: #define ubyte unsigned char #define byte signed char #define uint unsigned int #define int signed int But as you can see this causes some problems as uint becomes both signed and unsigned, my question is, can I bypass this problem and if so, how? The order of the definitions does not matter, apparently. I thought I would be smart and made my own definitions to make the code more readable I think it becomes less readable, it's best to just use the normal C++ types. And in the (rare) cases where you need fixed bit sizes, use cstdint (stdint.h in C99), no need to #define your own. --"Either help out or stop whining" - Evert signed char *value_name; signed int *value_subtopic; signed char **subtopic; signed int *integer_values; double *double_values; I think this is very irritating to read, but It's personal taste of course. I'll have to do it this way I guess :/. A plain 'int' is always signed. Never write 'signed int', it's just a waste of space. The only reason ever to use the 'signed' keyword is with chars, since they can be either signed or unsigned by default. If you're using chars for small integers, as opposed to for characters, it's common to use 'unsigned char' or 'signed char'. ---Smokin' Guns - spaghetti western FPS action How sure are you about "always"? Thanks. EDIT: I mean, if int is always signed then why can I write signed int? Yes, I am sure. I don't know why they chose to add signed as a keyword with only a single use case, but that's what it is. Seems a bit silly in hindsight. Probably 'historical reasons'. Or they felt it made such a nice pair together with unsigned... Ok, thanks, from now on I'll program as if that's true. Wierd . You can be quite sure that u8 is typedeffed as unsigned char (since the size of char is guaranteed to be 1). Bzzzzt!sizeof measures size in units of a char. That doesn't say a char has to be 8 bits. Bzzzzt!sizeof measures size in units of a char. That doesn't say a char has to be 8 bits. Really? Interesting. Some people prefer typedefs for integral types (use a typedef, not a #define). I think it's easier to read and deal with, personally. Most of my projects will have a types header that goes along the lines of #include <boost/cstdint.hpp> typedef int SInt; typedef unsigned int UInt; typedef boost::int_least8_t SInt8; typedef boost::uint_least8_t UInt8; typedef boost::int_least16_t SInt16; typedef boost::uint_least16_t UInt16; typedef boost::int_least32_t SInt32; typedef boost::uint_least32_t UInt32; typedef boost::int_least64_t SInt64; typedef boost::uint_least64_t UInt64; #define nullptr 0 Really? Interesting. Indeed. Essentially all modern PC platforms will have an 8 bit byte/char size, but there are other platforms that C/C++ can be used on where the size differs. Most of my projects will have a types header that goes along the lines of Only ones that think its a good idea to produce harder to read code, and duplicate types for no reason what so, so that's what typedef is used for.. . Thanks. Only ones that think its a good idea to produce harder to read code, and duplicate types for no reason what so ever. You do know that expressing your opinions in a way that make you look like an arrogant ass is the best way to make people ignore you... right? You do know that expressing your opinions in a way that make you look like an arrogant ass is the best way to make people ignore you... right? He does have a point, you do realise that, right?There are standard datatypes. Use them. Then you shouldn't have a problem telling me which integer type to use that will be at least 32 bits wide on every platform. (u)int32_t is available on every C99 compiler, and some C89 compilers that like to include bits of later standards. (u)int32_t is available on every C99 compiler, and some C89 compilers that like to include bits of later standards. C99 != C++ C99 != C++ It might still work though.In either case, you can provide it yourself by picking a standard name rather than making up your own. Then you shouldn't have a problem telling me which integer type to use that will be at least 32 bits wide on every platform. long is guaranteed to at least 32 bits. I don't think long or any other C++ datatypes have a guaranteed bit size - as Evert pointed out, the standard does not even require a char to be 8 bits. What you want is int_least32_t. Wrong, the types integer types have guaranteed minimum types. Look it up. I did, but I only read the "simple types" or whatever it is called section of the standard. I assumed it would mention bits there if it does at all... [edit:] "Fundamental Types" it was. And no, the only occurrence of the number "32" in the C++ standard is to tell that std::atexit() must support registering at least 32 functions I only have a draft though, so maybe it changed in the final version? The C++ standard doesn't require minimum sizes, but it does require minimum ranges - see this page. When applied to a 2's complement machine (like pretty much every single machine currently in use), those ranges translate to the following minimum type sizes:char: 8 bitsshort: 16int: 16long: 32Also, it is a recommendation (but not a requirement) that a char corresponds to the smallest unit a machine can address, and that an int is the 'native' size of the platform. As the article states, an implementation meets the standard by making all 4 integer types 32 bits wide.The number 32 doesn't appear because the standard requires a range of at least -32767 ... 32767.Minimum sizes are generally fine, unless you do silly things like brute-force pointer casts, e.g.: int i = 12345; char* c = (char*)(&i); for (int j = 0; j < 4; ++j) c[j] = 1; The above obviously breaks when sizeof(char) * 4 > sizeof(int). ---Me make music: Triofobie---"We need Tobias and his awesome trombone, too." - Johan Halmén
https://www.allegro.cc/forums/thread/599586/800218
CC-MAIN-2018-39
refinedweb
1,274
70.43
This is part 1 of the first instalment of a new series of blogs on Open-Source Spatial technologies. First stop on this tour is a Python library called GeoPandas. What is GeoPandas? Before GeoPandas, there was of course Pandas, the adorably named but very powerful Python library of data structure and analysis tools. Pandas is “the Excel of Python”. Its primary object type is the DataFrame, which I think of as an abstract database table, or spreadsheet – you can do things like create queries, index your data, perform grouping and aggregations, and join tables, i.e. all that good database/spreadsheet stuff, but right in a python environment. Of course, all of these functions are very useful when working with spatial data (I even remember adding Pandas to ArcGIS 10.1 by hand back in 2015 to use it in a toolbox script). The one thing that was missing from Pandas was spatial data typing, in the same way that PostGIS was missing from PostgreSQL. This is what GeoPandas does – it extends the standard Pandas DataFrame with spatial typings. The advantage of having typings directly on your data object is that you can use a standard set of methods and properties for each type. Basically, GeoPandas adds a geometry column to the DataFrame, not dissimilar to the “geom” column from PostGIS. This geometry column contains Shapely geometries (Shapely is a Python library with geometry types and operations), which means that we can access all the properties and methods available to Shapely objects directly on the DataFrame, or even the feature itself. For example, we can get the CRS of the layer by accessing its `crs` property, or create a buffer simply by calling the `buffer()` method, right on the GeoDataFrame object. In addition to this core function, GeoPandas also adds a few useful common tools to the package to help buff out the offering a bit, including reading/writing spatial file formats directly into/from GeoDataFrames using the Fiona library. It also adds plotting (i.e. generating map outputs) with Descartes and Matplotlib. The sum of these parts is a very “Pythonic” and user-friendly experience, which provides a set of useful basic tools for working with your spatial data, even generating map and data outputs, all directly in an open-source Python environment. I will say that DataFrames, as good as they are, can take a little bit of time to wrap ones’ head around, but it is time well spent. My only other “criticism” is that not all the Shapely methods and properties have been bound to the GeoDataFrame yet, but as we see in the examples to come, we can work around this. Incidentally, the power of Pandas did not go unnoticed by ESRI, who since ArcGIS version 10.4 have also baked the Pandas library into their arcpy releases. They have implemented basically the same premise as the GeoDataFrame (i.e. adding spatial typing to DataFrames), but gave it the more pragmatic title of “Spatially Enabled DataFrame” (SEDF). It’s worth noting though that ArcGIS 10.4 was released in February of 2016, while the first commit to the GeoPandas repository on github was back in June 2013. I’d say that earns GeoPandas the title of OG (“Original GIS”) fair and square. Worked Example, Part 1 Now for a worked example. The example I’ve chosen is based on an actual workflow I used for a job last year. I’ve simplified bits of the workflow for the sake of brevity, but the outputs I needed were two datasets: - a set of addresses as points, and - a set of rotated minimum bounding rectangles of postcodes that either fall within, or touch the border of Victoria. And I needed the two tables to be joinable on the postcode value. In part 1, below, we’ll select out the postcodes and save them to a shapefile, then in part 2 we’ll generate some random points and rotated bounding boxes, and join them. A quick note – I won’t go through any environment setup in this blog, but you can check out the steps I went through [[ here ]]. And you can download the git repository here, then follow the instructions in the readme to get set up. Anyway, let’s get started. import geopandas aus_poas = geopandas.read_file('aus_poas.shp') This is what our dataframe looks like - it's a table, but with a fully typed spatial geometry column. The pandas head() method returns the first 5 rows with our attributes - POA_NAME, code, state and geometry aus_poas.head() ax = aus_poas.plot() melb = aus_poas.query('code == 3000') ax = melb.plot() melb.head() Let's select all the Victorian postcodes vic_poas = aus_poas.query('code >= 3000 & code <= 3999') ax = vic_poas.plot() vic_poas.head() vic_shape = vic_poas.dissolve(by='state') ax = vic_shape.plot() vic_shape.head() note that this has made the 'state' column the index column, on the far left. Projecting & Buffering¶ Now that we have our Victoria polygon, we want to buffer around it to get adjoining postcodes from the full set. The vic_shape layer is in GDA94, so let's re-project it to GA Lambert EPSG:3112 so we can calculate in metres. We can do this super quickly and easily using the to_crs() method. vic_shape_lamb = vic_shape.to_crs(epsg=3112) ax = vic_shape_lamb.plot() Now we can buffer in metres, using the buffer() method. The buffer() method returns a GeoSeries (a single feature geometry), but we want to keep using our data in a GeoDataFrame, so we need to create a new data frame and then add the resulting buffer GeoSeries. We create a new empty GeoDataFrame using geopandas.GeoDataFrame() with the CRS we defined earlier on the vic_shape object (which we can reference directly with the .crs property) vic_buffer = geopandas.GeoDataFrame(crs=vic_shape_lamb.crs) Then we can perform the 10km buffer operation with buffer(10000), and store it in the 'geometry' column on the GeoDataFrame we just created. vic_buffer['geometry'] = vic_shape_lamb.buffer(10000) ax = vic_buffer.plot() Let's re-project our buffer to get it back to the original CRS, ready to for joining with our full postcode dataset vic_buffer_gda = vic_buffer.to_crs(aus_poas.crs) ax = vic_buffer_gda.plot() Do a Spatial Join to Select All Postcodes Inside Victoria and Within 10kms¶ We can use the 'spatial join' or sjoin() method (accessible via the geopandas class) to do an intersect analysis, then query out the features that satisfy the intersect relationship. Performing sjoin() with the how parameter set to 'left' keeps all rows from the full set of postcodes, but we can filter them down to just those that intersect by querying the 'index_right' column, which is added as part of the join with the index of the joined feature (in this case our Vic buffer has an index_right id of 'VIC', as noted above) vic_plus = geopandas.sjoin(aus_poas, vic_buffer_gda, how='left', op='intersects').query('index_right == "VIC"') ax = vic_plus.plot() vic_plus.head() The result is all of the postcodes in Victoria, and the postcodes in the other states which come within 10kms of the border vic_plus.to_file('./outputs/vic_poas_plus.shp', driver='ESRI Shapefile') Let's quickly check our output file... ax = geopandas.read_file('./outputs/vic_poas_plus.shp').plot() I'm also going to save out our dissolved Victoria shape for later vic_shape.to_file('./outputs/vic_shape.shp', driver='ESRI Shapefile') This ends part 1, in part two let's create some random points, join the postcode attributes to them, and create some minimum bounding boxes. - GeoNetwork and Spatial Metadata Cataloguing - March 3, 2020 - Getting Started with Power BI Part 2 - July 12, 2019 - Getting Started with Power BI Part 1 - July 4, 2019
https://spatialvision.com.au/blog-open-source-spatial-geopandas-part-1/
CC-MAIN-2020-50
refinedweb
1,270
62.58
I tend to keep track of data in Excel, and lately I've been using it as a CRM. I keep different sheets in order to answer different kinds of questions: Who asked about cell formatting? Who did I first talk to on our online chat? How many users do we have in Chicago? In theory, each sheet is synced with a master sheet containing all customer data. In practice, maintaining everything by hand was too time-consuming, and my data became scattered. When I realized this system wasn't scalable, I began looking for a replacement. My two main requirements were flexibility and ease-of-use. If I suddenly need to know which customers are on the West Coast, I want to be able to do it without inputting the data repeatedly or cross-checking a single sheet. After trying some other products, I was inspired by my friend Peter's blog post to build my own solution in Datanitro. This let me extend my original ad-hoc system within Excel by keeping all my data synced in a spreadsheet, while letting me interact with any view I want. The script The design is straightforward - the user interacts with one sheet, which displays and organizes data on the fly. Another sheet stores all data not currently displayed. For example, here's a spreadsheet Darth Vader might have on the Rebel Alliance: (Download the sample to follow along with the example. You'll need to have DataNitro installed.) This is the 'View' sheet, which displays the active part of the data. The full set of data is on the 'Data' sheet. To add a new record, just type it in the 'View' sheet: Here's how to add a note on Yoda. Open the Python shell and run from db import * show_col('notes')This will add the 'notes' column from the database to the view. If there were no notes column, one would be created. We can then type in the note. Let's say we want to pick the Death Star's first target. We can sort the records by homeworld by running sort_records('homeworld') Alderaan looks like a good candidate - let's investigate it further. The filter_records matches records to a regular expression. It can match either against records in the current view, or against all records in the database. (The last parameter is filter_from_view, which is True by default.) filter_records('Alderaan', 'homeworld', False) Whether you're suppressing the Rebel Alliance or planning a barbecue, try out db.py to keep track of your data.
https://www.datanitro.com/blog/using-excel-as-a-simple-crm
CC-MAIN-2018-47
refinedweb
427
73.68
No, BeOS is not dead as many will speed to the forums and proclaim. YellowTAB‘s Zeta is the true inheritor of BeOS 5’s fortune, as it is based directly on Dano/EXP’s codeline (which was supposed to be BeOS 6 but was never finished as Be sold its IP to Palm). At last, I got my hands on Zeta Beta-5a, and here is what I found and think of it so far. You might need to have some experience with BeOS in order to follow this article, but screenshots are included to make it easier for everyone.‘ ~2900 BeOS apps won’t run on Dano/Zeta because they are too old and the API has changed a bit). YellowTAB has changed the Deskbar folders from ‘Applications’ and ‘Preferences’. YellowTAB includes a number of applications with the OS. This version I tried, beta 5a, featured CD tools (e.g. Helios), a few demos, development applications (e.g. CodeLiege IDE), the Bochs emulator, three games, some internet applications (BeAIM, BeShare, Mozilla, NetPenguin, Beam, Phoenix), some third party multimedia apps in addition to the BeOS ones (e.g. SoundPlay, SampleStudio, DVDRip, VideoLAN), BePDF and more. There is still space on the CD to be filled up with apps, as the ISO was only ~500 MBs. YellowTAB has developed a few applications from scratch, like the FFMpeg front-end which allows you to encode videos, the Fax-It application which allows you to send faxes and another one called BeEAR, which I have no idea what it does as the app would only load itself in German language, even though my localization was set to English (my guess is that it is an address book though). There is also a To-Do application, called ToDoIt, also coded by YellowTAB and, as the other YellowTAB applications, will only be available for Zeta. Zeta uses a modified OpenTracker and Deskbar version which supports Internationalization and a few other goodies like cut/copy/paste directly when selecting some files/folders (a feature missing from the original Tracker). This Tracker also supports SVG, but I found no way to enable its settings globally (you can only control it on per-window basis, as far as I know, I could not for example set all windows to 128×128 or 16×16). Deskbar now supports “Team Expander” which will expand the running applications’ windows to be able to select them directly instead of having to navigate on a submenu to reach them. Nice add-on, I really like it, but there are bugs still. The “Move To”, “Copy To” and “Create Link To” context menus have been enriched with more options. So far, I had many instances where NetPositive and other apps won’t respond to my mouse’s double click to minimize, while the minimize button (found only on some themes) does work. YellowTAB comes by default with a number of useful Tracker add-ons, including a brand new one named “Fax these files”, which loads a new FAX-It application created by YTAB+friends especially for Zeta. Overall, some good new additions and options and some bloatware/duplication ones, like the addition of DockBert, a MacOSX-like Dock application which, when it comes down to it, it does exactly what Deskbar does. It serves no purpose having two different taskbars on the same OS, and BeOS was never the OS of many choices (like OSX and Windows too), it was the OS with the best defaults. Zeta seems to fail in this regard, adding a lot of new but similar things instead of perfecting the solution at hand that is proven to work. YellowTAB comes with… three GCC compilers. GCC 2.94, 2.95 and 3.2. YellowTAB claims that including the old BeOS compiler is necessary for easier adoption of the platform by the existing BeOS developers (applications compiled with GCC 3.2 won’t run on anything but Zeta you see, so the older compilers are needed). In my opinion, this is a bad situation. YellowTAB should bring the OS forward. When Be moved to R5, their forward compatibility issues wouldn’t allow creation of executables that could run on R4.5 either, but all older applications would run on R5. They made a choice to not allow legacy into the OS and without having an impact to the users, as all older binaries were still working. In my opinion, YellowTAB should take the same course and move the OS to GCC 3.3 and optimize it for all sorts of new cool stuff and forget the past. Allowing binary compatibility with R5 binaries is enough, developers will migrate with time. Zeta comes with BONE, which was the new networking stack for Dano. It was modeled after BSD’s networking stack (it is not a port though, it is brand new code), and it offers much-superior performance to the old user-space based net_server which used to crash very often. Be left the BONE development in pretty much 90% of its completion and debugging but I don’t have any information about whether YellowTAB has completed the job or left it as-is. Dano/EXP was also coming with some 3D support (Voodoo 3/4/5, ATi Radeon up to Radeon 8500, some Matrox G400/G450 3D support, Intel i810/i815/i820 and an SiS model I can’t remember now). Jason Sams, one of the brightest Be engineers that ever joined the Be team, created the GL stack and drivers with little help from others, and our benchmarks back in the day at BeNews showed that this was a very fast stack by year 2000 standards. However, no one really can get into Jason’s mind as there was no real documentation on how he put the whole thing together. Other Be engineers who looked at Jason’s accomplishment were left scratching their heads on how it worked (Jason had also created a brand new programming scripting language which looked like assembly to help him with the development). Jason works for nVidia these days (he left PalmSource recently). YellowTAB is left with no documentation about this particular GL stack, so there was no 3D support in the Zeta I tried. In fact, running a few *software* GL applications would result in crashes after a while (even the simple GL Teapot app). Please note that this PC has been running BeOS 4/5/betas for many years now, so it is definitely not my graphics card at fault here. YellowTAB is telling me that we will have to “wait and see” about 3D support; they do have something at work but it won’t be ready for quite a while. Speaking of drivers, YellowTAB has brought to the table a number of new drivers, like better 2D support for ATi and nVidia, some more networking card support and Audigy, AC97 support. Zeta also features the new printing API and tools Be designed that look extremely nice, professional and simple! Check screenshot. YellowTAB also works on the LocaleKit which will allow Zeta to support localization for most languages, something that BeOS lacked severely. They have contributed work on BeAIM, Jabber, wireless LAN drivers, video capture card support, support for latest CPUs (I think HyperThreading support is already there, Be added it a few years ago, when Xeons HT were not even available, with the help of Intel). YellowTAB also did some work on AbiWord, on a new word processing application (no details yet) and they now support all three kinds of USB (UHCI, OHCI, IHCI – BeOS 5 only supported Intel’s USB well, but VIA’s not very well or not at all depending on the chipset). There is also a new add-on to be added to Zeta, which will bring ODBC support to the OS! YTAB was telling me that this module will be available for testing soon. Zeta uses the updated Media Kit, which doesn’t have broken support for codecs as the earlier versions of BeOS had… And hopefully, there is better support for the SB128 sound cards which was the main complaint in 2001. Also, a port of MPlayer is at works too. I just hope they will rewrite the GUI to be Zeta-like and simple. The group is also considering the development of a rootless X11 (similar to how it works on Mac OS X and QNX) so applications like OpenOffice.org and other applications would be much more easily ported rather than going through the major pain doing a direct port (BeOS is kind of a pain regarding ports because it is very different architecture-wise than any other OS out there). When on rootless X11, its applications would run side-by-side the native Zeta ones. Personally, can’t wait for a fully accelerated port of X11 on Zeta. Bugs and problems In this beta, I found a few problems, bugs and things that I personally wouldn’t agree with as a very old BeOS user. I don’t use BeOS much anymore, but I do have a good grasp of its excellence in some points and its suckiness in others, so please forgive me for being opinionated. So, here are a few problems I found in this beta and I wholeheartedly hope they will be fixed for the final version: 1. The fonts are bad. Very bad. I don’t know what YTAB changed in the settings of the font rendering engine, but fonts are plain ugly. Dano/EXP also used this new font engine, but it wasn’t as bad as in this Zeta beta. Linux’s latest font config is worlds better in my opinion. 2. The preference panel “Fonts” is now broken. Changing the font size in the “Plain Font” only changes it to the context menus, but not in the menus of the applications, as it should have. 3. SoundPlay and its plugins and email client Beam crash like there’s no tomorrow. No DivX support I could see. 4. There is a problem with the font sensitivity of the UI, and it is especially visible with *some* themes. I don’t know if this is a bug of Zeta or a bug of the theme. But on some applications there are problems with widgets colliding with others widgets (they render on top of the other). 5. There is no security/protection for the user, even now with the introduction of BONE, like a personal firewall. Something more advanced like internet connection sharing, would be cool to have too. However YTAB has worked on better ISDN support and that’s a plus. 6. The logo of Zeta in the Deskbar is really amateurish and when you click on it you get an even uglier look. But hey, it’s a beta, right? 7. No scanner support as of now. Bernd tells me they are working on it though so this is promising. YellowTAB is a small team and it doesn’t have all the resources to work full scale on every aspect of the OS. However, the realities of the marketplace won’t be kind to the company, so I feel I am forced to also not soft-pedal my criticism. Granted, this is a beta. However, the direction the OS is taking is already clear: Add features and more new user-space applications and some more and some more. I will have to ring the bell of danger for YTAB and ask for more fixes rather than more new features. BeOS 5 was by no means perfect. But it worked well for most people. Replacing parts that are known to work well and have served well with new parts that only add unnecessary bloat (e.g. the new Installer) or duplication (e.g. Dockbert), is hardly a step forward for the BeOS paradigm. In fact, this could be considered a step backward. We certainly don’t need another Linux, with mind-boggling choice and variety at every turn. Zeta should continue where BeOS has stopped, not transform the OS into bloatware and illogicality like your average Linux distribution. Surely, I love the new drivers. Surely, I like the new Tracker (even if it is still buggy), but instead of filling up the preferences with unneeded panels I would have to ask for things like: 1.Samba. Where is a working samba? We need interoperability!. 3. No spell checking or voice reading in the text views of any Zeta application. No real support for accessibility. 4. No multi-user yet! Yes, this can break a number of older applications (which was why Be didn’t go live with it, but Zeta/Dano already breaks apps, so let them breat in one go instead of having to break more apps again in a few years), but someone has to take the big decision and activate the Be implementation (it is just a build flag ;). Zeta is a desktop OS, but multi-user also grows in the minds of people as times goes by. It is not 1998 anymore. Even Microsoft now offers multiuser on all its OSes. 5. Why doesn’t Zeta use the _new_ preference panel that was written for Dano/EXP. Why do we still get the old panels that are now filling up the menus? (more than 12 items on any menu is considered bad by usability engineers). 6. No fix for the numlock bug which makes BeOS to not remember if the NumLock was set to ON in the previous booting. Sounds trivial and stupid but really annoys a lot of people. 7. No fix for the 1 GB RAM limit. This is maybe the biggest BeOS/Zeta limitation today. Read here for more explanation and make sure you read the comments too. 8. BeOS can’t load more than 32 MB of addons, which is needed for big applications (a problem that almost stalled the Mozilla port back in the day). No more than 192 threads per app. Say you open more than 192 child windows or threads of an application, BeOS goes ca-boom (e.g. ShowImage). 9. Still, no Java. 10. Sucky VM in the kernel. Needs fixing. Source of many problems for Zeta, including the 1 GB RAM limit. 11. I’d like to see support for Great Britain’s TV cards (some TV cards use a different sound standard). There was an addon for it but never got integrated to BeOS. 12. Second biggest problem: No usable browser. NetPositive just doesn’t cut it anymore — it is a Netscape 2 compliant browser. Useless, at least for me, despite its speed, as it doesn’t support SSL (I don’t care about javascript, but I need SSL). The Mozilla/Phoenix ports are just _BAD_. BeOS was created to run on computers like P90 and P100. I use BeOS and Zeta on this (fast machine by the BeOS standards) dual Celeron 2×533 (which is the machine most BeOS geeks preffered back in the day) and BeZilla/Phoenix is just _unusable_. I am *not* saying that it is Mozilla’s fault, because in this case it is not. I also have Windows XP and Linux on this machine and while Mozilla doesn’t fly, it is 100% usable under these OSes. But on BeOS/Zeta, it is not. It crawls like hell. Again, I will have to ask YellowTAB to help fix the port, as a good browser is imperative no matter the platform (and the rest of the Mozilla apps that come with the browser). THIS port should be fixed, regardless. It is a strategic step for YellowTAB, even if YTAB doesn’t plan on using it as default. Conclusion Even with Mozilla so slow when operating clogging up both my CPUs, mp3 playback did not skip (while it does on Red Hat Linux 9 on the much faster AthlonXP 1600+). The OS still has the BeOS’ great UI responsiveness, but overall the system is a bit slower: you will need something like 80-100 Mhz more than the previous low-end (P75-P90) and at least 48 MB (previous low was 32 MB). Still, the OS overall, BeZilla/Phoenix aside, is much faster and responsive on low-end hardware than _any_ of its competition (Linux, Windows XP). So, what I do I think of this beta? I believe that it is two steps forward and one step backwards. YellowTAB does some hard work to ensure driver support and application support, but at the same time they lose focus and spend time working on things that don’t need replacement or fixing and leaving aside other things that do need fixing. The hard problems are still there. YellowTAB must play catch up with Linux and Windows now, as BeOS was paused and not developed for years now. For now, I say “good job,” but keep running. YellowTAB has a great advantage inheriting all this source code from Be, Inc. but also it has the inevitable curse that they will have to live in the shadow of the “legendary days” of R4.5 and R5. To overcome Be’s own legacy will take a lot of work. But it is a great help that Zeta is the true and only direct BeOS descentant, so they are currently years ahead in development than the other teams who try to reproduce the BeOS, like OpenBeOS, B.E.O.S, BeFree and Cosmoe. I hope that ex and BeOS developers and users show the support YellowTAB needs in order to survive and continue the development of the authentic and original BeOS code. However, I would like to see some real engineering from YellowTAB, not just “development”. Some real breakthroughs and innovations, like we became accustomed to from Be. Hiring a usability engineer with real BeOS experience would be a good thing in my opinion. I am not talking about a UI artist, I am talking about a usability engineer. YellowTAB needs one. More engineers to join the team would be good too. If they could “hire” Axel, Marcus and 2-3 more “big brains” from the BeOS dev community and OpenBeOS, they could definately get some great results with time. For version 1.0, I can say that I understand that the product needs to play catch up with the competition because of the lost time Palm created, but from now on, I need to see some achievements in order to draw attention in the market. BeOS was always about impressions and “wows”. So, impress me. Installation: 9/10 Hardware Support: 6.5/10 Ease of use: 10/10 Features: 6.5/10 Credibility: 8/10 (stability, bugs, security) Speed: 8.5/10 (throughput, UI responsiveness, latency) Overall: 8.08 .” What is GTF? Generally it is great to see a new release of “BeOS” – and being ßeta, I am sure that most of the kinks will be ironed out before an actual release. Are sliding tabs supported? >What is GTF? VESA autodetection method to get the right resolutions/refresh rates. >Are sliding tabs supported? No. The window manager is brand new code. It is not possible to support this now that theming is supported. I must say, I am glad I’m an OSNews regular. I expected that this site would be the first or one of the first to report on Zeta, and was not mistaken. Excellent review. Do you know if the same font rendering engine that PhOS used is here? that one seemed much better than Dano. Overall, a lot of these issues PhOS FIXED! For example, I got a routing 120 fps with my i810. Maybe looncraz left after all. That should be “routine”, and in GLTeapot. >Do you know if the same font rendering engine that PhOS used is here? I don’t know as I never used the PhOS BeOS distribution. But one thing is for sure: Zeta did something to the font engine code that decreased the font rendering quality when compared to any version of BeOS, even Dano. I hope they will find what’s wrong and fix it for the final version, because the fonts are really not good… I love the WORLD EXCLUSIVE titles they really get my attention I am really looking forward to Zeta, I would love to have it on my current machine, that is when I get my new machine I actually liked Dockbert a lot. I could use my Deskbar to keep track of windows and such, but Dockbert looks much better and has a nifty “CPU-usage” feature. It was also something i could keep on the side and launch favorite apps with. Not quite as space-hogging as the Dock, too, and has a few nifty graphical effects. Also, I must say I liked the BeOS Terminal better than any of the Linux ones. I could configure it to be green text on black with spiffy no-background selection, as I like the readability better that way. The /dev directory, implemeneted for POSIX compliance I think, was brain-dead. A UNIX/Linux like naming scheme would be better. Come on, /dev/disk/ide/ata/0_0/? better /dev/hda. Good job on the review Eugenia. I completely agree with your conclusions regarding the direction that needs to be taken with this. I was attracted by BeOS’s elegance and speed, and it sounds as if Yellow Tab is doing quite a bit of patchwork adding features etc. that aren’t needed or wanted. If they can focus on using the power of BeOS to take advantage of the latest hardware, who knows what it could do. Your report that it boots slower is very disturbing… Boot time is not everything but it sounds like you get nothing from this extra time (besides more fonts!). Lets hope YellowTab gets the bugs worked out and keeps the focus on BeOS’s founding principles. Granted its just a beta, but from what I’ve read and heard Zeta is going in the opposite direction from the way I would like to see BeOS progress. I also thought this of the leaked Dano .. more features, fewer fixes. I wish they would dump the themeing engine, I wish they would adopt Freetype as the default font renderer, I wish they wouldn’t throw Dockbert in there by default. I hope none of this is the case for Zeta R1 Final. YellowTab, take head, in the opinion of many BeOS enthusiasts Zeta should be an R5 with more drivers, an updated networking stack and tons of fixes … nothing more. I for one would be perfectly satisfied if that’s all Zeta was. >I also thought this of the leaked Dano .. more features, fewer fixes. Dano was never finished. This is why it didn’t have the fixes you wanted to see. As for more features, it was natural for Be to develop them, as Dano was supposed to be R6. > I wish they would dump the themeing engine No, that wouldn’t be wise. The theme engine is there, it works and it was one of the points users were asking during the R5 days. I agree about adopting Freetype and Fontconfig though. Dockbert shouldn’t be there either, because duplication is a bad thing on any OS. 1. What the hell is up with the installer? I mean, not being able to pick source and target? Talk about dropping a really nice feature. Also, I take it Drive Setup is gone, or at least been made such a weak duck that it won’t let a sure resize or remove/create other types of partions? 2. Make an amazing Word .doc translator, and life will be a little easier for some of us. 3. I think offering Dockbert to the user is just fine, I’ve never used it but it doesn’t seem like a bad way to go about things. 4. Font rendering, for most of us, isn’t that impressive in Dano, I hope it gets some targetting, that it would become worse in Zeta is distressing. I assume you played with the Rendering options in the font previews? (if it works, I saw in the review how some things are broken in there, this might be one of those items). 5. Best of luck to YellowTab and the coders out there helping them try to make the best BeOS they can. I don’t think looncraz left, I think he is just busy atm From what I can see in those screenshots, it seems to be an application for finacial accounting purposes. But it seems very specific for Germany, because there are fields like “DATEV”, which is the software/network for this here in Germany…. > 1. What the hell is up with the installer? I mean, not being able to pick source and target? Talk about dropping a really nice feature. Agreed. Bernd said that he would add it to his new Installer, but in my opinion, any new code is prone to bugs. Personally, I would just drop the YTAB installer and use the much simpler and less involved old one, and just add to the old one the ability to select the language and tweak a few things that might need tweaking. (and I didn’t even mentioned to the article that the thumbnails of any application you have selected in the new Installer are just very badly resized, using “Smart Size” instead of Billinear or Bicubic resizing method, making them looking exceptionally ugly!) > Also, I take it Drive Setup is gone, or at least been made such a weak duck that it won’t let a sure resize or remove/create other types of partions? No, Drive Setup is there. As it was before. The same Drive Setup as Be’s. But Be’s Drive Setup doesn’t have the ability to edit flags/create partitions. And so doesn’t Zeta’s. i just hope they don’t lure away the best devs from openbeos! a much more worthwhile project imo. . Eugenia, you complained about Zeta being slow. Did you feel that you were using BeOS, or did it feel like something new? It did seem from the review that zeta tries to be another Linux distro. Judging from the review, Zeta will NOT be on my to purchase list. >you complained about Zeta being slow. No. The *booting time* was slow. The usability is the same as Dano’s (which is *a bit* slower than BeOS 5 *naturally* because of all the theming stuff etc). As for the BeZilla stuff, it is slow on BeOS as well, not just on Zeta. >Did you feel that you were using BeOS, or did it feel like something new? Felt like BeOS Dano, with some additions, but these additions didn’t always worked well (e.g. Tracker would crash when changing settings of the SVG icon size) >It did seem from the review that zeta tries to be another Linux distro. It certainly has this feel here and there. However, if YTAB *learn* from this preview and fix some bugs, then this IS a product to be in your purchase list. Definately. I’ve played with Dano, Phos and use BeOS as my main OS, simply because it delivers most of what I want without the hassles I always seem to encounter with Windows. I must admit that I got quite used to the way Dano did things, and missed them alot when I went back to plain old R5 (needed some apps that simply didn’t behave under Dano). That the Font engine has gotten worse (It was way better under Phos) than the Dano original is shameful really, sorry and all of that, but it has to be one of the most used componants of an OS…. I truely hope Bone is fixed otherwise a whole lot of Dialup users of Zeta will likely be waiting until it is or be handing their copies back when they find out the worst… All in all it’s good to see that they are doing something, as their website has been awaiting for about a month now. I agree that it would be a good idea to have a central core of lads and lasses working on this, but time is money as the saying goes and programmers eat a lot of capital per head. So I guess that’ll have to wait untill they start getting money back from Zeta R1. RE the firewall issue, if its using Bone then you can install Snort (available at bebits) I don’t know how good it is in the firewall sweepstakes but its better than nothing at all. That it wasn’t included seems to me to be a very serious oversight on their part as Security on the internet are must haves and could be turned to a distinct marketing advantage. And Finally Thanks for the review, I thought it a bit harsh re it’s critism but I think that that is a case of each to their own and as I’ve not used it yet I can’t really say more than that 😀 Good work Eugenia, and well played the YT crew! Im not trolling or anything, but I am woundering what the real advantages of BeOS are, I’ve never used it (though I have the install file) so I have no real opinion about it. What are the advantages over my Mac (OS X) or my PC (win2k, linux)? Is it unix-based / open source, etc? Fill me in If they are going to add something new, why not try doing something similar to Safari. eg. KHTML stuff with an interface that is a lot like Netpositive with tabs. Also in the future as the Mozilla team make gecko more embeddable that too could be ported. Imagine being able to switch between rendering engines for website that don’t work well for konqueror derivatives(hopefully things in konqueror will be fixed). >> [openbeos]. i was talking about a “project” not a “product”. having a free and opensource desktop OS in a few years (glad to see your prediction is down to 5-7 years instead of the usual 10…) is imo worth more than a feature bloated zeta this or the next year; always on the verge of bancrupting the company. Well, BeOS’s main advantages (fully buzzword compliant) are mostly the technological innovations it brought (some still have no duplicate). BeOS will seem faster in day-to-day (ie not heavy compiling) use than anything on slower hardware. The user interface is quite beautiful and intuitive (IMNSHO). It has real-time video and audio (it was meant to be a MediaOS), so it is theoretically superior to anything else (other systems now lead due to raw speed). Programming for it is supposedly a wonder, and the API has things like BMessage (find the old BeBounce demo somewhere). It isn’t UNIX-based, but it is partially POSIX-compliant. Definitely not open source, though such an effort is underway. Linux and W2K will kick its ass in networking–BeOS networking sucks, even in the leaked stuff. Overall, it’s nice to boot into sometimes, and see what things could have been like. Nice to play 10 different videos at the same time–linux could never do that. Too bad it’s dead, and if anything will eventually change that it’s OpenBeOS, not Zeta. Just read here: (slow site) I should say it’s not as dead anymore with Zeta, but it is dead in terms of mindshare, just like the original. When you don’t have mindshare, open source is the best way to go.. Didn’t you learn anything from the Be experience? With closed-source applications you always have the risk of the company dying and taking your application with it, rendering all the time you invested in learning that application useless. If Be couldn’t make BeOS fly, what makes you think these guys will? It’s pretty clear they’re not half the company Be was. And a fair bit of warmth. so had they included that stegemann “multiuser” /patch/ yet? it doesnt seem like it. and an easy way to go if they want a so-so firewall solution is to use portsentry i.e not the best solution but a good userland “firewall” good review. >Didn’t you learn anything from the Be experience? I have. But open source doesn’t guarantee ANYTHING either. Especially development. Especially good debugging. Especially professionalism with usability engineers with guts to kick the nuts of the engineers when they don’t listen. Closed source development has its high points and its low points. Open Source development has also high points and low points. At this point in time I prefer YTAB over any other BeOS project, just because YTAB’s OS *works* and it is ready for consumption. This is their main advantage. As a consumer, I don’t want to wait years, I want something NOW. And YTAB is able to provide me with that today. It is simple economics. >With closed-source applications you always have the risk of the company dying I can tell you my friend, I have seen a zillion OSS projects die because their developers just lost interest. It is the same danger. Always. You can never guarantee anything. > If Be couldn’t make BeOS fly, what makes you think these guys will? I don’t think it. I don’t believe that they have many chances of sell enough to sustain them. Still, I do prefer them over any other BeOS OSS project, just because their product is something I can use TODAY. > It’s pretty clear they’re not half the company Be was. What do you expect when they have 5-6 people overall, and Be had 105 in its high day with over 70 engineers? Kinda unfair comparison, don’t you think? So they released a “Beta” with missing features? I thought Betas were supposed to be feature-complete. Hey Eugenia, just a thought. If such a small company as Zeta can buy the source code of BeOS, it isn’t *that* expensive. Just like the open source community did with Blender, maybe that same community could buy the BeOS source code? Hell, I’d immediately pay 300$ for it to help this. It would give a huge boost to projects such as OpenBeOS… Anybody share this thought? >Anybody share this thought? No. The BeOS source code costs about $2 million dollars (this is how much PalmSource asked the last time to the people attempted to buy it). Blender only costed $100,000 in order to open source it, and even then, it took months to gather thant sum. There is no chance in hell that the small community of BeOS can buy BeOS. As for YellowTAB, I think they got the source by other (yes, legal) means, that I won’t reveal here. They didn’t buy it, they reached a licensing agreement with Be before Be was sold. I wish…. Nice review, Eugenia. Gave a pretty good overview for us old BeOS users what using Zeta is like. Personally, I’m saddened by it. It seems that practically everything that made the BeOS neat back in the day has been laid to waste. I mean, look, for example, at. What do we see? Some programs have menus, some use tabs instead, and some don’t deal with that kind of layout. Of those with menus, one has a help menu, and the others don’t. Every program using any kind of toolbar-ish buttons rolled their own. Or do you like how the ffmpeg GUI (great name, btw!) window has some options capitalized, others not, and lots of the options just thrown into random groupings? Etc. etc. etc. There’s just no consistency whatsoever. Or look at, say, DVDRip. “Write to standard output”? Now, what the hell does that mean to anyone except a total geek? Why would you want to do it, anyway, if you weren’t using something else on the command line? Oh, and you just have to love how ffmpeg GUI shows you the command-line output it’ll use. WHY? So I can pat it on the head and say, “Good boy, you correctly translated the options I selected into the appropriate command-line string. Have a biscuit!” A good GUI is more than just a listing of all the command-line program’s flags with checkboxes and radio buttons; it’s about making choices. To me, Zeta looks like a mediocre Linux distro that doesn’t use X11 and uses a different threading model. Yay. It seems the days of, “yeah, the BeOS is technically awesome, but the interface kicks ass too!” are long gone. But you know, I think the best thing said here was when Eugenia mentioned that Be used to have some 100 employees, while yellowTab has merely a handful.. I have really been hoping to replace my current music creation setup with Zeta, the purpose I bought BeOS for in the first place. At one point MidiMan announced it would be writing drivers for the Delta 1010 for BeOS, but as far as I can tell, nothing came of it. I was never able to buy a midi sequencer/audio recorder aside from tracker or drum-machine type apps. I hope Zeta can steer this where BeOS said they were going; a Media OS. I am sure that means different things to different people, but to me it means running my midi and audio studio. Hmm, I assume BeOS uses something similar to AmigaOS’ catalog files for localisation, so that looks like a catalog file editor… quite why its part of an installation procedure though… who knows. >. Your whole comment was excellent Billy, as always, but the last paragraph really excels. It requires INNOVATION to be able to survive in today’s OS world and captivate a market. Things are always getting tightier with time, not easier for OS companies/projects. Sad as it is for small groups… The same type of thing was happening 30-35 years ago. Reading Edsger Dijkstra gave me some insights into how this works. Back then, IBM and its OS/390 crap (according to Dijkstra) ruled the nascent computer world. UNIX was not nearly mature; E.D hardly mentions it. The point is, something will come along that shakes the world to its foundations (sad as it is, it won’t be BeOS or Linux). Back then it was UNIX. What’s it gonna be now? Plan9? ..first time as tragedy second time as farce…. “Something more advanced like internet connection sharing, would be cool to have too.” There’s ipalias, though it’s not entirely user friendly “There is _stil_ no support for more than 90 Hz in the monitor panel.” You can download and compile the OpenBeOS Screen Preferences app from their CVS silly YellowTab. YellowTab, get your act together and create something that will make us old timers proud, right now, I certainly won’t be buying your cheap BeOS hack. YellowTab, get your act together and create something that will make us old timers proud, right now, I certainly won’t be buying your cheap BeOS hack. ————– Thats what i am seeing too. The more i look at the screenshots, the less i want to buy Zeta. I am actually quite dissapointed. Oh well, i am glad it is Zeta and not BeOS. Why do i feel that BeOS was just raped and pillaged? Maybe this is why they didn’t want to release it yet. >The more i look at the screenshots, the less i want to buy Zeta. Well, most of the screenshots just show Be’s own pref panels, and not YellowTAB’s creations. Some windows are of YTAB’s, but in the first shots it all Be’s. The design of the UI widgets was also Be’s. Check the printer windows on the first two shots for example. This is the new printer panel that Be created. Really nice I must say… Does BeOS support TTF fonts? If not, why? Thanks. Of course it does. hm, seems that many points critisized are being adressed by the b.e.o.s-approach, which i personally for this reason(s) find the most interesting. some might say that it’s neither fish nor flesh, but properly done, it could combine the best of both worlds, means participating in the very good driver pools as well as the technical progress of the linuxkernel, as well as being source-compatible to beos. sounds very promising… as for dano, i don’t think they’ve chance. really…! “as for zeta…”, of course! I don’t like the BEOS approach. It combines Linux and Xfree bloat with something that needs to be responsive. Both of those have way more features than needed or wanted in a BeOS clone. Linux is good for Linux. there’s a reason Be used a microkernel. dano: you mean YellowTAB….then again, that too Eugenia, your comment : “Zeta uses a modified OpenTracker and Deskbar version which supports […] a few other goodies like cut/copy/paste directly when selecting some files/folders ” Misses the fact that Open Tracker has had this for ages. I rebuilt my ppc box in January (maybe earlier) with the latest Open Tracker CVS tarball and it had this feature. Nope. There’s no telling what the status of it was, it was a leak. It wasn’t released be Be Inc. at all. And looking at these screenshots and reading this review really made me feel a tad nostalgic and miss my old PC and BeOS. But I’m pretty happy running MacOS X, It’s not perfect but it does all I need now. The last OTracker I used, about a year ago, didn’t have that. And there was no official version that had that either. Not everyone is using CVS you know… 😉 Your whole comment was excellent Billy, as always Thanks! I think one of the biggest problems with the “geek” community is growing up with stars in their eyes regarding Jobs & Woz (or Hewitt & Packard, or Gates & company, or whoever). The belief that two guys in their garage can create something cool and shake up the world with it. But what they often don’t seem to grasp is that Jobs & Woz (to use them as an example), created an industry. They made something new that hadn’t existed before. These days, companies like Be compete with huge, established companies who are in the same business. And that already have the investment of millions of customers. The BeOS, as cool as it was, wasn’t that different from other operating systems. It wasn’t a completely new industry; it was a nicer operating system, which was an established industry. Yet a lot of its fans apparently expected the world to say, “Wow, that scheduler’s a little neater, the API is cleaner, and the icons are cuter. Ok, you’ve convinced us…we’ll throw away the trillions of dollars we’ve invested in this other platform and adopt yours!!” That’s like saying, “Ok, we don’t like this one thing about English, so we’re going to change it and translate every book ever written.” For people to be willing to throw away such investment, the advantages of the new platform have to be tremendous. Face it: the BeOS’ advantages weren’t tremendous back in the day, and they sure as hell aren’t by today’s standards. Moreover, I doubt that too many people really care about the operating system, other than its not getting in your way (by crashing, not having drivers, not supporting applications, etc.) other than the capabilities it brings to its applications. Love or hate Apple, I think they realize this. They go, “Hmmm, a web browser is a crucial portion of a modern computer and the user experience with those existing on our platform isn’t good. Let’s deliver (what will hopefully be) a great experience to the user.” Or they do it with e-mail, or digital photography, or whatever. But I’ll bet that Apple has more people working on Safari than yellowTab has employees, period. There’s just no way that yellowTab can compete with that. So what is yellowTab left with? An aging OS that can’t run most software in the world (including not being able to run a decent web browser at all decently), whose applications tend to lack even basic polish (and this is getting worse, not better, with time), and for which, in the few areas where it still is technically superior, the features aren’t particularly compelling. Who’s the market? If it were me with BeOS source code, I’d attempt to do something radically different from what Apple and Microsoft are doing. What exactly, I don’t know–I haven’t thought that much about it. But the Apple I didn’t succeed because it tried to take on IBM’s mainframe business. To the extent that Be had a differentiating angle (personally, I’ve always thought the sole reason for Be’s creation was to be bought by Apple), it was that it did media well in the days when competing systems didn’t, and that it focused on bringing incredible power to the user in an easy package. Nowadays, as it stands, Zeta is worse than Windows or the Mac for media. And because of lack of polish and lack of talented engineers/UI designers working together, it’s worse in terms of “easy package.” By contrast, Apple and Microsoft are both strongly focused on it (Apple especially, in my opinion). Zeta simply cannot compete with that “differentiating angle”; if your army’s outnumbered and outsupplied, you don’t lead a forward charge. Yet yellowTab hasn’t bothered to seek out a new angle, something that could leverage what little technological advantage they still have. Instead, they’re adding small applications to an OS that no sane person would use for such applications, anyway. It just doesn’t make sense. They’re obviously trying to appeal to the few BeOS diehards who say, “Man, I’d love to still use the BeOS [for reasons that are beyond me considering the awesome things competing systems can do], but I just won’t be able to without a few more abilities.” Great, so you string the small and ever-shrinking group of users who use BeOS “just because” along for a few years, and then what? The company folds and the game is over. They can’t seriously be crazy enough to think that they can be successful by making and selling a product that to most users is “the exact same thing as Windows or the Mac, except with way fewer features and worse applications”, can they? Rather than trying to fight Apple and Microsoft, they’d be better off trying something radically different, something that the other companies simply can’t do. If it doesn’t work, fine…they tried. But at least they’d have a chance. Where they’re at now is playing chicken in a Mini against a freight train and hoping that somehow they survive. You are 100% correct. I think yT’s target market is 1)Geeks and 2)BeOS fans. I bet they’ll make a couple thou net profit, and then quietly fade off into promises and obscurity as the world moves to 64 bit computing. “I don’t like the BEOS approach. It combines Linux and Xfree bloat with something that needs to be responsive.” if you haven’t, read the articles about and from b.e.o.s in osnews’ archive-it depends on _how_ you do things… As an old time BeOS user and developer I am saddened to see this review of Zeta. It seems to me that YellowTab has taken BeOS and destroyed the principial idea: Keep it simple and efficient. I see the screenshots and the “themes”, and I feel sorry for what BeOS has become. I read what Euginia has to say and agree, what reason could YellowTab have to screw up a great/simple installer with more bloat-crap. YellowTab should have sat down and done a bug-fix release first, then they should have turned to more features. Frankly I don’t see how they plan on competing with Mac OS X, Windows XP, or even KDE 3.1. I also think that providing themes is a very bad idea. At least they should have focused on 2 themes, not 8. 2 perfect ones are better than 8 screwed up ones. Just my take on this. Michael PS. I am not buying this one, perhaps the next version The 64bit computing is just a recompiling away and a bit of testing/debugging. There is nothing stoping YTAB porting to a 64bit CPU. The problem is, as Billy said above, lack of innovation and features that will sustain the OS and bring NEW users to their market. YTAB won’t survive with only the current or ex-BeOS users as customers. It HAS to attract new ones, and to do that, it will have to prove itself against the big sharks. And you can’t do that with 5 employees scattered around the world… But I wholeheartely wish them the best of luck! I really do! Yes, I know all about the preemptive and lowlatency kernel patches. I have tried them; they have made zero difference in performance on two of my computers. You just can’t have the Be innovativeness with Linux and XFree. If I want Linux I will run Linux, and I do. > I am not buying this one, perhaps the next version Don’t forget, this is only a beta. The final, might be a better one. And also, if you and the rest BeOS users won’t buy THIS version, there won’t be a next one. Count on it. Well, remember that this is not a release, but a beta. well, let’s wait for the final “product” (if there will ever be one, but i’m quite optimistic), and then judge, ok?! looking forward to it! Allright. That’s what choice is about, after all. I have problems with their licensing. What are they trying to do, build a semi-proprietary OS on top of Linux? Legal and feasible, but still. Pah. I believe their site says you have to be a developer to look at the code. I agree with Eugenia about Dockbert. I still have no idea why they’ve included it in Tracker. It duplicates functionality of Deskbar, and it’s fugly, IMHO. Also, I can’t speak for Zeta, but when I installed OT that has Dockbert included, you can’t turn it off if you don’t like it. Only option is to make it autohide. I have SVG Tracker, and it is OK, but prone to crashes. Restoring Tracker helps, but hope YT will make it more stable. Also, I hope they automated making of thumbnails, not thru Thumbnailer add-on like it is in SVG Tracker (leaked one). Also one more thing. People use high resolutions. I’m on 1152×864. I need bigger Deskbar. For example, build in option to dispay bigger icons in Deskbar. Why have options to have bigger icons in Tracker when Deskbar remains tiny? BTW, look at this realy nice mock-ups. Now, that is Deskbar that it would be great to have. Much better then Dock-look-a-like Dockbert. And Eugenia is right about Mozilla/Phenix. I’m too on dual Celereon 550Mhz, and Mozilla is slow. Usable, but slow. I made Net+ theme for it to look like BeOS app, but it surely doesn’t feel like one. And it’s memory hog.58 megs of ram are eaten by this beast. And finaly, Eugenia didn’t tell much about compatibility list. A lot of time passed since R5. Huge loads of new hardware apeared. I’m talking about loads of integrated audio/video chipsets and “softer then softomodem” modems (like AMR ones). I’m sure hardware compatibility problems will be much, much bigger now with Zeta then I had with r4, for example. Euginia you are perfectly right when you say that there will be no “version 2” if we don’t buy version 1. Well, so be it. A long time ago I invested a lot of time and trouble (plus some cash) in writing programs for a commercial operating system. Suddenly the company switched focus, threw the developers out in the cold and eventually was sold to another company. Well, guess what if YellowTab goes under its the same old situation all over again. I am not betting my time on a closed source operating system, I’d rather wait for OpenBeOS, even if it means running the risk that the OpenBeOS people might never deliver anything. But if it turns out to be a really good product I might consider investing in a copy of it, just to play with. Michael This is what happens when a company don’t listen to the market but rather what they wanna do themselves. This is exactly what I feared all along. yT is sort of vapor… I’m not even sure they have access to sources but rather just remove and append new software. That could be the reason to why they decide not to fix things like they should have. I will most likely buy it anyway assuming they support GeForce 4, but my heart and hope goes to OBOS. If only some more kernelhaxxors could join the group… ” think yT’s target market is 1)Geeks and 2)BeOS fans. I bet they’ll make a couple thou net profit, and then quietly fade off into promises and obscurity as the world moves to 64 bit computing” I think you are leaving out Beos’ real target market….multi-media, audio/visual. XP is definitely better than win 95/98 but i’ve found that its peformance become sub-par once you push into the 24 to 36 track range if you start adding real time effects. reponsiveness fades pretty quickly. I’ve heard good things about OS X behavior when loaded but pricing becomes a problem there. The premimum of a OS X machine compared to a PC is about the cost of a good studio condenser mic, a mic preamp, a decent compressor or a couple of universal audio UAD-1s (an audio effects accelerator). The opportunity cost of buying that apple is quite high though i might do it anyway. Beos on the other hand does the job (well it would if the software were there) and does it with cheap PC hardware. Openbeos is the future as far as i am concerned but i’ll definitely purchase zeta when its available. Hi Greg! Do you tried see BlueEyedOS Demo? No? Look at! Give a try. See and comment here again about Linux and XFree performances. I’m wanting your positives words Michael Vinícius de Oliveira ~ BlueEyedOS.com Webmaster ~ I don’t like the BEOS approach. It combines Linux and Xfree bloat with something that needs to be responsive. If I write a slow and non responsive app under BeOS will you conclude that BeOS is bloated? No, of course. So, don’t do the same with the linux kernel and XFree86, they are working very well, even without patchs (preemptive, etc..). You see XFree through KDE or Gnome, and the linux kernel through its boot time, I suppose. It’s the mistake you do IMHO. Take a look at the demo CD of B.E.OS, and be conscious that it’s compiled in debug mode with a lot of ‘printf’, and with an app_server which is built (for debug) to redraw _everything_ at every needed redraw. Regards, Guillaume Slashdot just linked to this story. I must admit I was never a BeOS user, but I loved it none the less, and when I heard of Zeta I was hopeful to see BeOS back. But this review brought me to reality, has Billy stated, and what does Zeta bring to the market that other OS don’t? Linux is already pretty usable has a desktop (even if long way from perfect) and has community and commercial support Zeta can only dream about so who would by Zeta besides BeOS die hard fans? So my conclusions are that BeOS has an OS is dead it’s just too old to compete with the rest of the boys, but BeOS has the collection of innovating ideas should live on! Things like the database like file system, the translators, just to name a few are still with out mach on other system. In the end I think what projects like OBOS could be doing is bringing these ideas and concepts to the next level and building what BeOS would of became and not what it was. DragonSoull I was hoping beyond hope that Zeta would be an improvement. I wanted updated drivers, Media kit fixes (multichannel for example), OpenGl (as Bernd has repeatedly promised), and some of the Dano/Exp features. Sadly only the drivers issue will be updated. Some Dano/EXP features will be added but excessive bloat is also added. Eugenia reported that Soundplay was now broken. That is one of the ESSENTIAL apps for BeOS. Really sad news. OBOS will need years to be a viable OS, but sadly they do not have the manpower to keep up. I think this review is the death knell for BeOS. Eugenia also hit on my major peeve with most Linux distros. I do not want zillions of options or apps to install. I wanted a decent desktop OS. I want basic functions that work. BeOS R5 and Corel Linux were examples of OS’es that did exactly that. Granted there were a lot of cool apps you could install later that independent developers made, but the OS itself was perfectly functional with the default install. Obviously as the years have passed the basic requirements for an OS has radically changed and these OS’es are now frightfully outdated. I am now resigned to use Windows XP as it does most of what I want, nowhere as elegantly as BeOS did, but it is being updated and has actually improved. It galls me to think that BeOS is dying a most inelegant death. I would have liked to see one final blaze of glory with the release of Zeta. Wow, looks nice. I haven’t used BeOS in years, and the other projects and BeOS editions don’t support the wireless card for my laptop, so I haven’t even thought about using it in a while. Nice to see they’ve got a decent amount of drivers and are putting some good work into Be again. Looks like it’s time to buy BeOS again That’s just what we used to call the tip of tree (‘exp’ for experimental) as opposed to the release branch (‘rel’ for release). It looks even weirder in all-caps. I guess BeOS just won’t die 🙂 Where’s JLG to make some bizarre necorphilia crack? – Brian Well, I look at the kernel through its enormous size and features that are unnecessary, plus some that are missing. Is anyone really going to be running BEOS on a SPARC? Also, on your site you mention that all the hardware drivers are compiled in…do you mean as modules? because if they are *actually* compiled in, that increases the kernel’s footprint significantly. XFree (I read your piece on this site earlier; enlightening) I look upon as something designed for UNIX, not Linux. Its features–network transparency etc.–are lost for single desktop machines. Even within the Linux community there are many voices shouting for an alternate solution, like DirectFB. And last time I checked app_server didn’t use 7.5% of my CPU like XFree does…. I wish I could try out your demo, but unfortunately the CD-ROM drive in this computer is b0rked. Will definitely when I get my main PC back. >I think you are leaving out Beos’ real target market….multi-media, audio/visual. Nowadays, that crowd’s hardware is less and less supported. If you look at the website. you see that there is little information about anything media, just BeOS geek stuff like “History.” A lot of the questions are already answered on the yellowtab forum btw… Here are some quickies: > > Are sliding tabs supported? > No. The window manager is brand new code. It is not possible to support this now that theming is supported. Let’s say “for now”. Really the decor system doesn’t make it easy. It seems that would need some hacking. > Maybe looncraz left after all. He has become quite invisible currently… I think he has some personal problems to deal with. > Come on, /dev/disk/ide/ata/0_0/? better /dev/hda. Certainly not. And btw, even Linux is heading towards a tree-like devfs, years after BeOS did that. The flat organisation wouldn’t handle growing numbers of drivers. Do you know what namespace polution means ? > Good job on the review Eugenia. I completely agree with your conclusions regarding the direction that needs to be taken with this. After some moaning, I admit I agree too. It’s always good to have external view of what you do I’ll address issues in another comment. > Also, I take it Drive Setup is gone, … It’s not, however it never supported partition resizing. Besides it’s true it has lots of limitations (like creating only primary partitions). > Is it unix-based <troll>NO, it’s BETTER </troll> > eg. KHTML stuff with an interface that is a lot like Netpositive with tabs I know there is development going on the browser side, but can’t tell more atm. >> [openbeos] a much more worthwhile project imo. Why do people always try to oppose those ? IMO both are useful, and both need more developers. > BeOS networking sucks, even in the leaked stuff. BONE works here. I even got a working netstat > Too bad it’s dead, and if anything will eventually change that it’s OpenBeOS, not Zeta. Time will tell. > Why not buy the BeOS source code? For something to get bought, 2 parties must agree, one to buy, and one to sell. I’m not sure Palm even wants to think about it. Besides buying the BeOS source code doesn’t mean we would be able to setup an sf.net/projects/beos and put it on. There are parts that are *licenced* from other sources, that you simply cannot opensource if you don’t want to face trials and such. > The BeOS source code costs about $2 million dollars For what they currently use IMO it costs much less than that… They should even pay me for cleaning up their cupboard from the box. > Oh, and you just have to love how ffmpeg GUI shows you the command-line output it’ll use. What about you want to reuse it later in a Terminal ? Or add other options yourself that aren’t in the GUI ? that’s what I like in BeOS, simplicity is there (GUI), but complexity (the CLI prog) isn’t hidden. Reminds me of what I read about an old Apple program (Commando). > Hmm, I assume BeOS uses something similar to AmigaOS’ catalog files for localisation, so that looks like a catalog file editor… Yes it is. > quite why its part of an installation procedure though… Simply because currently the Installer just launched the PresonnalSettings Preferences, which has more than language settings. I agree it might seem odd now. > “as for zeta…”, of course! Zeta is NOT Dano I check out OSNews’ headlines everyday through its RDF backend, because it is a good source of news, even though there are way too much editorials entitled “Why I hate / love Linux” or “Why Linux isn’t ready for the desktop”. Hell, I just don’t read them. I do have a few rants about your writing though, Eugenia: – the title of this review (“WORLD EXCLUSIVE”) is really unjustified, it’s not like YellowTAB is revealing a revolutionary OS that everyone was waiting for. You make OSNews look like a tabloid! – I wrote you an email some time ago, complaining about the use of acronyms without giving their meaning: I suggested the use of [abbr] and [acronym] HTML tags. You didn’t seem to understand the suggestion, perhaps you just didn’t find it interesting enough. Anyway, it seems like I’m not the only one who’s bothered by acronyms I don’t understand. – You write “[…] the user […] can’t create, edit/resize partitions. This is a huge limitation for most new users and plagued BeOS back in the day, and it will continue to do so, unless the user already has a free partition waiting for Zeta.“.. – “The other reason is the startup sound, which is 1.3 MB“: do you mean that the sound takes a long time playing, thus making the boot time longer, or that it takes a long time loading? In the latter case, I wonder how 1.3 MB can be long to load… – “Samba. Where is a working samba? We need interoperability!“: what about NFS? AppleTalk? – “NetPositive […] doesn’t support SSL“: I could swear that NetPositive in BeOS R5 had SSL support; could someone confirm? – “mp3 playback did not skip (while it does on Red Hat Linux 9 on the much faster AthlonXP 1600+)“: you make it sound like it is a real feature of BeOS. I play Flac, Ogg Vorbis and MP3 files (all three formats have very different impacts on CPU and bandwith consumption) from my NFS server, with a Pentium III-M 866MHz, 256 MB of RAM, running Linux From Scratch and using XMMS: playback never skips, even when I’m compiling a software or uncompressing a bzipped tarball. Consider your own experiences carefully, your comparisons are sometimes very subjective. That’s all for today. Please take all these as remarks, suggestions, not as personal attacks. If Zeta cannot exchange data with Windows via ethernet, I will not be buying it. Some networking equivalent of Samba is a MINIMUM requirement. I was a BeOS user from R45 thru R52/3 and, while I loved it, it would not do what I needed. So, when Be Inc folded I knew it was NEVER going to be what I needed and I removed it. I have been watching and waiting for a suitable replacement that will allow me to keep Windows XP just for games and let me do everything else in a BeOS-like environment. That includes my accounts and correspondance so I’ll need something like Open Office too. Mozilla also absolutely MUST work properly. I will NOT put up with slow responses and a lack of utility. Java must also be implemented. That is also a minimum requirement for a browser. My current machine is a high-end Athlon with a Radeon 9600 graphics card. I shall require that this resource will not be ignored by Zeta. BeOS was always handicapped by the fact that there were no drivers for current hardware. Linux is now catered for by some sound and graphics card makers. BeOS never was. Zeta never will be. Zeta must therefore find a way to make use of the drivers provided for Linux by the likes of ATI and nVidea. Will Yellow Tab make an effort in this direction? They should. After all, no drivers = no future. What do you say, Yellow Tab? Eugenia, in your review, you said: “(I think HyperThreading support is already there, Be added it a few years ago, when Xeons HT were not even available, with the help of Intel)” Can you tell me where it is Where did you hear or read about Be and HTT? BeOS R5, nor Dano detect a HyperThreading enabled cpu, either Pentium 4 “C” or Xeon with HTT. R5 & Dano do detect an SMP capable system, but I assume thats due to MPS support in the bios. Actually, that should have read, “neither” R5 or Dano detect & utilise a HTT (HyperThreading Technology) enabled cpu. You are mistaken. Windows and Linux definately allow for the creation of a new partition to install on during installation. what about NFS? AppleTalk? When i bring a machine on my network that supports samba/smb – it can instantly talk to/mount shares/etc… every other machine on my network. None of my machines at home use NFS, and while the Macs have AppleTalk, it’s unused. I don’t want to have to go running around and get YetAnotherFilesharingProtocol up and running on my boxes at home. The pathetically small icons have always been an annoyance in BeOS. Why can’t they add vector icons or at least support 64×64 icons? Although I find the UI tweaks of Yellowtab to be ugly. I much prefer the old look to this. I also don’t agree that the lack a multiuser support is a problem, as I think that there is a place for single user OSes. > The pathetically small icons have always been an annoyance in BeOS. Why can’t they add vector icons or at least support 64×64 icons? icons in the Zeta Tracker are in SVG format, and can grow up to 128×128. Deskbar’s team expander (showing the windows) is definately cool. Even if I’m not a bit biased. The patches for this were sent to both YT and OpenTracker at the same time. OpenTracker has had this option for a while in the deskbar. As for this option being unstable, I submitted a fix for all the instability last week. I have yet to see it commited. If I had commit access to the OpenTracker CVS, it’d be in there by now. Eugenia, it’s obvious you haven’t used a recent OT in a _long_ time, or you’d have known about cut/copy/paste of files, and the “SuperExpando” deskbar. As for me (obviously a BeOS dev) buying Zeta. They won’t see a penny of my money. This looks like a bloated, vapor POS. No thanks, if I want crap, I’ll use Linux. Besides that, on a matter of principle (and the fact that I use it extensively) If the window title-tabs don’t slide, I’m not wasting my money. YT, give me back the R5 look with slidy tabs, then I’ll -consider- forking over some $$. Now onto the review itself: (once again many questions are answered in the yellowtab forums) The Strings tab in the PersonalSettings is a string editor for the locale kit. It is there at install time, simply because the Language button in Installer loads the pref panel. Boot time: Yeah, 400 seems a bit too much, really. The startup sound size is easily fixed by converting it to IMA ADMCP, cutting it down to 300K. Let’s say also that more drivers means more binaries to load and check at boot… > 1. The fonts are bad. I think looncraz fixed it already, but maybe the fix got lost. As I remembered it has to do with the font file format or something. > 2. The preference panel “Fonts” is now broken. I think the Menu font is specified in the Menu preferences… Or I didn’t understand the sentence. > No DivX support I could see I thought there was Hybrid Divx included. I have an updated FFDecoders anyway… > personal firewall <troll>That should be a 3rd party opportunity ?</troll> > internet connection sharing that shouldn’t be too hard to add to Boneyard. > 6. The logo of Zeta in the Deskbar is really amateurish A matter of taste I believe… Does “BeOs” look that much sexier ? > 1.Samba. Where is a working samba? We need interoperability! Porting the current Samba needs fcntl() advisory locking, which BeOS defines in its headers, but doesn’t implement. Not undoable for a faithful mind though. > 4. No multi-user yet! It is planned, but not for R1. > (it is just a build flag No it’s not. There is much more to correctly working multiuser than rebuilding the thing. Things as simple as umask() aren’t implemented correctly. (i.e. not inherited on exec()). Also Tracker itself behaves quite strangely when run setuid. But it’s to be tested yet. > Sucky VM in the kernel. I believe that will only be addressed correctly by OpenBeOS itself. s,Linux,GNU/Linux, This review s one of the best ever on OS News and by Eugenia. It’s good to see Eugenia get some credit for once. I do not think her review was harsh. She has simply always called them as she sees them. I thought it was fair and very balanced. As for tabloid headlines, every BeOS junkie on earth has been waitng for that headline 🙂 I though Billy and Eugenia’s (and some others) remarks are on the nose and lay out the problems for Zeta. Even if they end up being true, I dismiss, for now, the more negative remarks of some. I want to see the final release. It is hard for me to imagine former BeOS users not getting Zeta…how can we possibly resist? The end game is the problem though, as many pointed out. It is very hard seeing Zeta catching the world on fire due to lack of innovation. I do not blame YellowTab for that – it appears they’re doing what they can do. If they get some things cleaned up and support some modern hardware, I will not complain. I have never quite known what to think of OpenBeOS, although I fervently hope they succeed. It will be awhile though. I would not mind at all having something like Zeta to play with in the meantime, assuming it’s useable – and it sounds like it will be. At any rate, I’m going to give it a whirl. In the way that it expresses my feelings towards what should and should not be worked on. I’d love to see more drivers, BONE and the new app-server but not bloat and inconsistancies and so. Still, this is just the first baby steps of Zeta… how can we possibly resist? Very very eaisly if the damn window tabs don’t slide. Sometimes I use BeOS 5.0. It is quite good: fast and well designed. For everyday use you do not need much: good and fast internet browser (where is Opera?), mail and user group client, Java and multimedia. And spreadsheet with editor compatible with MS Office (something like OpenOffice is welcome however it would require XFree API for BeOS). But where is a place for BeOS? I see only one: if BeOS would be small enough to be kept in Flash Memory, you would create super fast GUI for notebooks and bigger palmtops. Without power consumption, noise and warm of HDDs. Dream Mashine – something that is not reachable for Windows, Linux and MacOS X now and probably in the future. “Keep It Simple, Stupid!” You are mistaken. Windows and Linux definately allow for the creation of a new partition to install on during installation. I do not believe to be mistaken: BeOS R5’s installation program does allow the creation of partitions too, even non-BFS ones. I don’t know about Zeta, though. Yet none of these operating systems allows dynamic resizing of partitions without data loss, not even BeOS / Zeta (Partition Magic does it). I don’t want to have to go running around and get YetAnotherFilesharingProtocol up and running on my boxes at home. That’s not the point; nobody expects you to run several redundant servers at home. The point of interoperability is to enable most people to use file sharing (in this case), whichever protocol they use. You’re using Samba, I’m using NFS; if Zeta supported both protocols, both of us would be happy with it. That is accurate, is it inaccurate, and wrong to say that “Linux” has font configuration. It DOES NOT. Linux is a kernel, not an operating system, and not a distribution. Ok, let’s kill this complete nonsense once and for all. Saying Linux to a Linux distribution is correct. Saying Linux instead of GNU/Linux is correct. Ever heard of a pars-pro-toto? It makes articles and day-to-day speech alot easier, manageable and expressive. If you are confused by metaphores, you really should go back to school and learn to read. Windows isn’t just windows. It also has buttons, a kernel, internet browser, firewall, command line tools, … But you don’t see long-haired windows zealots yelling “It’s buttons/windows!! Respect the work and philosophy of buttons!” > “It’s buttons/windows!! Respect the work and philosophy of buttons!” Actually in MSWindows, a button _is_ a window, technically speaking > To my knowledge (I could very well be mistaking), >neither do Windows OSes, MacOS X or Linux >distributions offer such a feature. >You always need to have a free partition >to install an operating system! Mandrake has it since r7. DiskDrake is the name. It is part of install. You can resize Win partitions with it. Realy great app. Every “alternative” should have something like this. And even BeOS r4 had special edition of Partition Magic. And even BeOS r4 had special edition of Partition Magic. So did R5. This version of Partition magic is old now and it doesn’t support the new big drives. And Zeta doesn’t come with it anyway. In other words, they do need a *well-designed* partitioning tool to accompany Disk Probe. What needed changing was Disk Probe, not the Installer. Thanks for the information. As I read resize fat partitions – resize partitions (when not caring loosing its data) ( ), tough, I assume partition resizing without data loss is only supported for FAT partitions. So if I run BeOS or another Linux distribution, I’m screwed Correct me if I’m wrong, but I was under the impression DiskProbe was for looking at raw hex dumps of files. I really really hope they don’t require you to do that You did mean DriveSetup, right? >You did mean DriveSetup, right? Yes, sorry. >I think this review is the death knell for BeOS. i think you are overreacting. >what about NFS? AppleTalk? Samba is more important for the kind of users Zeta will have. >Where did you hear or read about Be and HTT? At Be. >BeOS R5, nor Dano detect a HyperThreading enabled cpu, either Pentium 4 “C” or Xeon with HTT. R5 & Dano do detect an SMP capable system, but I assume thats due to MPS support in the bios. Yes, and this plus a small change in the kernel is all it is needed. Adding HT support is easy. The only thing that BeOS didn’t support is the thing aboug bogomips, which they wouldn’t add it anyway. >The pathetically small icons have always been an annoyance in BeOS. Why can’t they add vector icons or at least support 64×64 icons? Zeta DOES have vector icons! Did you read the article and saw all shots? >> 2. The preference panel “Fonts” is now broken. >I think the Menu font is specified in the Menu preferences… Yes. But it doesn’t work! >> 6. The logo of Zeta in the Deskbar is really amateurish >A matter of taste I believe… Does “BeOs” look that much sexier ? Much better, yes. Especially when selected with the mouse, it was still looking clean. > Sucky VM in the kernel. >I believe that will only be addressed correctly by OpenBeOS itself. I believe this is the kind of things any OS company should be doing: engineering. If YTAB can’t do that all, not even for R2, then they should not be working on an OS. No one said that it would be easy. > >I think the Menu font is specified in the Menu preferences… > Yes. But it doesn’t work! Are you sure you launched a new app *after* changing the font ? the settings only work for newly launched apps (the BMenuBar isn’t suppose to resize itself, as it would need if it had to support changing on the fly, lots of applications would break). I visited Yellow Tab’s site, and read through their “History” and “Products” section. I did find information on the history of the product – how they had begun negotiations with Be to develop BeOS before Palm bought Be. But Yellow Tab does not specify whether they actually succeeded in buying the source code from Palm after it had acquired Be. In other words, is this new OS based on old BeOS code? And if so, did Palm approve its development? (100th comment ? *g*) Palm has nothing to say about an agreement that was made before they bought anything. However There are some changes that need to be addressed about that agreement, that has to be discussed with Palm. Obviously we can’t say anything about it.
https://www.osnews.com/story/3692/world-exclusive-first-look-at-yellowtabs-zeta/
CC-MAIN-2019-04
refinedweb
13,602
73.07
NAME Perform a basic read of the clock. SYNOPSIS #include <zircon/syscalls.h> zx_status_t zx_clock_read(zx_handle_t handle, zx_time_t* now); RIGHTS handle must be of type ZX_OBJ_TYPE_CLOCK and have ZX_RIGHT_READ. DESCRIPTION Perform a basic read of the clock object and return its current time in the now out parameter. RETURN VALUE On success, returns ZX_OK along with the clock's current time in the now output parameter. ERRORS - ZX_ERR_BAD_HANDLE : handle is either an invalid handle, or a handle to an object type which is not ZX_OBJ_TYPE_CLOCK. - ZX_ERR_ACCESS_DENIED : handle lacks the ZX_RIGHT_READ right. - ZX_ERR_BAD_STATE : The clock object has never been updated. No initial time has been established yet.
https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_read
CC-MAIN-2020-29
refinedweb
106
60.01
GitLab Runner in Kubernetes with MinIO cache Setup a GitLab Runner in Kubernetes using MinIO for caching with the Helm 2 package manager. Updated version for Helm 3 can be found here. Connecting a Kubernetes cluster to GitLab is pretty simple. Even simpler, the installation of a GitLab Runner when you do it from the GitLab admin area in Kubernetes Applications. Install “Helm Tiller” (older GitLab versions) is one click and “GitLab Runner” the second. That works, but … The so installed runner has a simple, default configuration and is not using any cache. That’s ok for just trying CI in GitLab but for a serious installation you want to tweak the settings and use a cache. There’re several instructions for setting up GitLab Runner in Kubernetes but it took me some time to figure out how it works and finally make it work. I hope this step-by-step guide provides some help or hints. Still I’m not a Kubernetes expert. So, if you find something to improve, I’m happy to get feedback. We use MinIO because the GitLab Runner in Kubernetes needs a distributed cache which is either S3 or GCS. If you want a cache within your cluster, the MinIO service emulates the S3 cache type. So in the gitlab-runner settings we configure S3 pointing to our minio-service. Requirements: * A Kubernetes cluster (or minikube). I used a cluster with version 1.14.5 * Install Helm client * Ensure that kubectl is using the right cluster (helm uses kubectl context) First I’ll create an own namespace and a role for that namespace that is used by the service account. Using a namespace and limited service account adds a bit complexity. If you don’t need the namespace, things might get easier. Create namespace gitlab-runner kubectl create namespace gitlab-runner Create a service account gitlab-runner in namespace gitlab-runner kubectl create serviceaccount gitlab-runner -n gitlab-runner Create the role with permission in namespace and bind it to service account defined in file role-runner.yaml role-runner.yaml kubectl create -f role-runner.yaml Init helm for the namespace and let it install tiller in the namespace. Using the service account created before. helm init --service-account gitlab-runner --tiller-namespace gitlab-runner Now with helm and tiller ready, we can install MinIO and GitLab Runner. Let’s start with MinIO. Because the service account of the namespace is limited, it can’t create a persistent volume. Usually this would be done by helm but now we have to create it manually upfront and tell helm to use the existing volume. The file minio-standalone-pvc.yaml defines the config for the PersitentVolume and the claim for the volume. In this example a size of 4 GB is used. If you plan to use more, increase the value. minio-standalone-pvc.yaml kubectl create -f minio-standalone-pvc.yaml Now we install MinIO with helm and add some custom settings we put inside a minio/values.yaml file. For more details on the MinIO helm chart see: Important is here, that we set the accessKey and secretKey that will later be used by the GitLab Runner installation. Also the default bucket is created that the GitLab Runner will use to store the cache files. minio/values.yaml helm --tiller-namespace gitlab-runner install --namespace gitlab-runner --name minio -f minio/values.yaml stable/minio This step is optional: If you wanna access the MinIO browser from outside Kubernetes, you can create a NodePort or a temporary port-forward. The NodePort is defined in the minio-standalone-service.yaml as an own service. minio-standalone-service.yaml kubectl create -f minio-standalone-service.yaml Find out your cluster IP: kubectl cluster-info and the port the minio-service is mapped to: kubectl get services -n gitlab-runner The two commands will output the following where you can get the IP and the port, that is exposed. The minio-service-ext service is mapped to port 32028. Open in a browser: and you should see the MinIO login page. The login accessKey and secretKey we set in the values.yaml for MinIO install to “minio” and “minio123”. As mentioned, there’s also the temporary solution of creating a port-forward. Just run: kubectl port-forward service/minio -n gitlab-runner 9000:9000 and open localhost:9000 in your browser. Ok, finally lets install the GitLab Runner itself. This is described in more details here:. Helm should have created a secret named “minio” in the namespace which is used by gitlab-runner. If this is not the case, create one. Check if secret exists: kubectl get secrets -n gitlab-runner Create it if secret doesn’t exist: kubectl create secret generic minio --from-literal=accesskey=minio -from-literal=secretkey=minio123 -n gitlab-runner The gitlab-runner is not part of the helm repo so we have to add it to helm. helm repo add gitlab We also set some custom values for this helm chart in runner/values.yaml On the GitLab site you’ll find more details about all the config values in the helm chart. This is the minimal set including the settings for the cache. runner/values.yaml Now install it to the namespace. Take care, you might want to install an older chart version depending on your GitLab server version. helm --tiller-namespace gitlab-runner install --namespace gitlab-runner --name gitlab-runner -f runner/values.yaml gitlab/gitlab-runner Done ✌️ Now you should see the created runner in your GitLab Admin Area for further configuration inside GitLab. Please note that we’ve not really considered security and performance in this setup. You might also need different settings depending on your Kubernetes version and installation. The example above runs a Kubernetes v1.14.5.
https://caenderl.medium.com/gitlab-runner-in-kubernetes-with-minio-cache-875fb283e499?source=post_internal_links---------4----------------------------
CC-MAIN-2021-21
refinedweb
973
65.62
1 /*2 * @(#)ClickArea.java 1.16 06/02/223 * MICRO * @(#)ClickArea.java 1.16 06/02/2239 */40 41 import java.awt.Graphics ;42 43 /**44 * An click feedback ImageArea class.45 * This class extends the basic ImageArea Class to show the locations46 * of clicks in the image in the status message area. This utility47 * ImageArea class is useful when setting up ImageMaps.48 *49 * @author Jim Graham50 * @version 1.16, 02/22/0651 */52 class ClickArea extends ImageMapArea {53 /** The X location of the last mouse press. */54 int startx;55 /** The Y location of the last mouse press. */56 int starty;57 /** A boolean to indicate whether we are currently being dragged. */58 boolean dragging;59 60 static String ptstr(int x, int y) {61 return "("+x+", "+y+")";62 }63 64 /**65 * When the user presses the mouse button, start showing coordinate66 * feedback in the status message line.67 */68 public boolean press(int x, int y) {69 showStatus("Clicked at "+ptstr(x, y));70 startx = x;71 starty = y;72 dragging = true;73 return false;74 }75 76 /**77 * Update the coordinate feedback every time the user moves the mouse78 * while he has the button pressed.79 */80 public boolean drag(int x, int y) {81 showStatus("Rectangle from "+ptstr(startx, starty)82 +" to "+ptstr(x, y)83 +" is "+(x-startx)+"x"+(y-starty));84 return false;85 }86 87 /**88 * Update the coordinate feedback one last time when the user releases89 * the mouse button.90 */91 public boolean lift(int x, int y) {92 dragging = false;93 return drag(x, y);94 }95 96 /**97 * This utility method returns the status string this area wants to98 * put into the status bar. If this area is currently animating99 * a message, then that message takes precedence over any other area100 * that a higher stacked area may want to display, otherwise the101 * message from the higher stacked area takes precedence.102 */103 public String getStatus(String prevmsg) {104 if (dragging) {105 return (status != null) ? status : prevmsg;106 } else {107 return (prevmsg == null) ? status : prevmsg;108 }109 }110 }111 112 Java API By Example, From Geeks To Geeks. | Our Blog | Conditions of Use | About Us_ |
http://kickjava.com/src/ClickArea.java.htm
CC-MAIN-2018-30
refinedweb
365
63.19
Creating A Modular Waypoint System For Your AI To Follow On Your Nav Mesh Sometimes, when creating the movement for an AI, you may want to determine a set path for them to navigate. To do this, you will likely need to create a “Waypoint System” so that your AI knows its target destinations. You’ll need to create a “List”, which will hold the transforms of all your AI’s waypoints. Next, create a reference to your “Nav Mesh Agent” and call it in void Start. Then you’ll need to create an “Integer Variable” to hold your AI’s current target from the list. And you’ll also need a “Boolean Variable” to reverse your AI’s progression through the waypoints. [Important Note] Don’t forget that you will need to add the namespace “using UnityEngine.AI;” if you are wanting to access Unity’s Nav Mesh components. Now in Unity, you’ll need to create empty game objects for each waypoint within your hierarchy and adjust their transform position to your desired waypoint locations. And lastly, drag and drop those waypoints onto your script in the inspector.
https://adamwreed93.medium.com/creating-a-modular-waypoint-system-for-your-ai-to-follow-on-your-nav-mesh-5fbdb48918e
CC-MAIN-2021-39
refinedweb
190
70.13
{-# LANGUAGE OverlappingInstances, FlexibleInstances #-} -- microbench, a tiny microbenchmarking library for Haskell. -- Copyright (C) 2008 Evan Martin <martine@danga.com> -- . module Microbench ( microbench, Microbenchable ) where import Control.Exception import Debug.Trace import Data.IORef import Data.List import Data.Time.Clock import Data.Typeable import Control.Concurrent import System.IO import Numeric -- Want to handle: -- Int -> a => ok -- Int -> IO a => ok -- IO () => loop the action -- TODO: -- IO a => loop the action, forcing each result? -- a => is it possible? I tried for a while but couldn't make it work. -- -- TODO 2: -- factor out "setup time" by comparing different outputs for different inputs -- and a linear model. -- |Microbenchmarkable computations. Be very wary of adding your own -- instances of this class, as it's difficult to force GHC to -- re-evaluate code in a way that makes benchmarking easy. class Microbenchable a where run :: a -> Int -> IO () instance Microbenchable (Int -> IO ()) where run f n = f n instance Microbenchable (Int -> a) where run f n = do x <- evaluate (f n); return () instance Microbenchable (IO ()) where run f n = mapM_ (const f) [1..n] -- This was chosen totally arbitrarily. Perhaps it would be better to make it -- a parameter, or use some sort of real statistical test. microbenchTime = 1 -- |@microbench description target@ probes target with different parameters -- until it's ran enough iterations to have a good estimate at the rate per -- second of the operation. @description@ is a textual description of the -- thing being benchmarked. Outputs to stdout. microbench :: Microbenchable a => String -> a -> IO () microbench desc f = do hSetBuffering stdout NoBuffering putStr $ "* " ++ desc ++ ": " start <- getCurrentTime time <- probe 1 putStrLn "" putStrLn $ " " ++ showFFloat (Just 3) (time*1000*1000) "ns per iteration / " ++ showGFloat (Just 2) (1 / time) " per second." where probe repeats = do putStr "." start <- getCurrentTime run f repeats end <- getCurrentTime let delta = end `diffUTCTime` start if delta > microbenchTime then do return (realToFrac delta / realToFrac repeats) else probe (repeats * 2)
http://hackage.haskell.org/package/microbench-0.1/docs/src/Microbench.html
CC-MAIN-2016-26
refinedweb
314
58.99
{-# LANGUAGE DeriveDataTypeable, RecordWildCards, PatternGuards #-} -- | Types exposed to the user module Development.Shake.Types( Progress(..), Verbosity(..), Assume(..), ShakeOptions(..), shakeOptions, ShakeException(..) ) where import Control.Exception import Data.Data import Data.List -- | current) $ do -- > let (s,c) = timeTodo current -- > setTitle $ "Todo = " ++ show (ceiling s) ++ "s (+ " ++ show c ++ " unknown)" -- > threadDelay $ 5 * 1000000 -- > loop -- > -- > setTitle :: String -> IO () -- > setTitle s = putStr $ "\ESC]0;" ++ s ++ "\BEL". data Assume = AssumeDirty -- ^ Assume that all rules reached are dirty and require rebuilding, equivalent to :: Int -- ^ Defaults to @1@. The version number of your build rules. -- Increment after building, checking files have not been modified -- several times during the build. These sanity checks fail to catch most interesting errors. Progress :: IO Progress -> IO () -- ^ Defaults to no action. A function called when the build starts, allowing progress to be reported, -- see 'Progress' for details. } deriving Typeable -- | The default set of 'ShakeOptions'. shakeOptions :: ShakeOptions shakeOptions = ShakeOptions ".shake" 1 1 Normal False Nothing False False (Just 10) Nothing (const $ return ()) fieldsShakeOptions = ["shakeFiles", "shakeThreads", "shakeVersion", "shakeVerbosity", "shakeStaunch", "shakeReport" ,"shakeLint", "shakeDeterministic", "shakeFlush", "shakeAssume", "shakeProgress"] = ShakeOptions x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 (fromProgress x11) instance Data ShakeOptions where gfoldl k z (ShakeOptions x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11) = z unhide `k` x1 `k` x2 `k` x3 `k` x4 `k` x5 `k` x6 `k` x7 `k` x8 `k` x9 `k` x10 `k` ShakeProgress x11 gunfold k z :: ShakeProgress) | otherwise = error $ "Error while showing ShakeOptions, missing alternative for " ++ show (typeOf x) -- | Internal type, copied from Hide in Uniplate newtype ShakeProgress = ShakeProgress {fromProgress :: IO Progress -> IO ()} deriving Typeable instance Show ShakeProgress where show _ = "<function>" instance Data ShakeProgress _ = tyShakeProgress tyShakeProgress = mkDataType "Development.Shake.Types.ShakeProgress" [] -- NOTE: Not currently public, to avoid pinning down the API yet -- | All foreseen exception conditions thrown by Shake, such problems with the rules or errors when executing -- rules, will be raised using this exception type. data ShakeException = ShakeException [String] -- Entries on the stack, starting at the top of the stack. SomeException -- Inner exception that was raised. -- If I make these Haddock comments, then Haddock dies deriving Typeable instance Exception ShakeException instance Show ShakeException where show (ShakeException stack inner) = unlines $ "Error when running Shake build system:" : map ("* " ++) stack ++ [show inner] -- |)
http://hackage.haskell.org/package/shake-0.4/docs/src/Development-Shake-Types.html
CC-MAIN-2014-35
refinedweb
364
51.48
#include <Audio.h> List of all members. Makes a sound when play() is called. Deleting stops the noise. First load the sound you want using a SoundBuffer. This is not directly a wrapper for openAL's sources. A SoundSource creates as many OpenAL sources as there are SoundListners. OpenAL is fixed to one listner. Definition at line 162 of file Audio.h. Create attached to a specific buffer. The buffer contains the sound that will be played, so don't delete it until you have deleted the SoundSource. Definition at line 404 of file Audio.cpp. Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.
http://racer.sourceforge.net/classEngine_1_1SoundSource.html
CC-MAIN-2017-22
refinedweb
115
80.07
The user provides a date, or start/end dates, or month/year or year (all of which could be resolved into start/end dates). The program returns -- Option 1: an array of integers representing the ordinal day since Jan 1, 1980. For example, if the user enters "Feb 1, 1981" to "Feb 5, 1982", the array returned is (397 .. 766) as Feb 1, 1981 is the 397th day since Jan 1, 1980 (index starting at 0), and so on. Potential solution: Use something like Time::JulianDay to convert start and end dates into integers, and just subtract "epoch" start day from each. Critique, por favor. Option 2: a hash in which the keys are the years, and the values are the days for the period prescribed by the start/end dates in the input. So, something like so ( "1981" => [31 .. 365], "1982" => [0 .. 35] );. Suggestions, por favor. For date calculations use the cpan module: Date::Calc and possibly Date::Parse Here's a quick and dirty script that takes the dates you specified and prints the difference in days between them. Note that there are differences between how Date::Parse treats month ranges and how Date::Calc does. use Date::Parse; use Date::Calc qw(Delta_Days); use strict; my $base = 'Jan 1, 1980'; my $start = 'Feb 1, 1981'; my $end = 'Feb 5, 1982'; print days_diff($start, $base) . "\n"; # 397 print days_diff($end, $base) . "\n"; # 766 sub days_diff { my $minuend = shift; my $subtrahend = shift; my (undef,undef,undef,$d2,$m2,$y2,undef) = strptime($minuend); my (undef,undef,undef,$d1,$m1,$y1,undef) = strptime($subtrahend); return Delta_Days($y1, $m1+1, $d1, $y2, $m2+1, $d2); } 1; __END__ [download] use strict; use warnings; use feature qw( say ); use DateTime qw( ); # Or using your favourite DateTime::Format parser. my $date1 = DateTime->new( year => 1981, month => 2, day => 1 ); my $date2 = DateTime->new( year => 1982, month => 2, day => 5 ); [download] Part 1: my $ref = DateTime->new( year => 1980, month => 1, day => 1 ); say $date1->delta_days($ref)->in_units('days'); say $date2->delta_days($ref)->in_units('days'); [download] Part 2: sub last_day_of_year { ( my $dt = DateTime->new( year => $_[0], month => 1, day => 1 ) ) ->add( years => 1, days => -1 ); return $dt->day_of_year(); } my %in_range; my $year1 = $date1->year(); my $year2 = $date2->year(); if ($year1 == $year2) { $in_range{$year1} = [ $date1->day_of_year()-1 .. $date2->day_of_yea +r()-1 ]; } else { $in_range{$year1} = [ $date1->day_of_year()-1 .. last_day_of_year($ +year1)-1 ]; for my $year ($year1+1 .. $year2-1) { $in_range{$year} = [ 0 .. last_day_of_year($year)-1 ]; } $in_range{$year2} = [ 0 .. $date2->day_of_year()-1 ]; } for my $year (sort { $a <=> $b } keys(%in_range)) { say "$year: @{ $in_range{$year} }"; } [download] PS - You said 365 where you should have said 364. Update: Added part 2. use Time::JulianDay; my @start = (1981, 2, 1); my @end = (1982, 2, 5); my $days = days('start' => \@start, 'end' => \@end, 'type' => 'yearly' +); my $days = days('start' => \@start, 'end' => \@end, 'type' => 'range') +; sub days { my (%a) = @_; my ($start, $end, $type) = ($a{'start'}, $a{'end'}, $a{'type'}); if ($type eq 'range') { my $j0 = julian_day(1980, 1, 1); my $j1 = julian_day(@$start); my $j2 = julian_day(@$end); return (($j1 - $j0), ($j2 - $j0)); } elsif ($type eq 'yearly') { my $start_year = $start->[0]; my $end_year = $end->[0]; my %days; for my $year ($start_year .. $end_year) { my $j0 = julian_day($year, 1, 1); my $j1; my $j2; if ($year == $start_year) { $j1 = julian_day($year, $start->[1], $start->[2]); $j2 = julian_day($year, 12, 31); } elsif ($year == $end_year) { $j1 = julian_day($year, 1, 1); $j2 = julian_day($year, $end->[1], $end->[2]); + } else { $j1 = julian_day($year, 1, 1); $j2 = julian_day($year, 12, 31); } $days{"$year"} = [($j1 - $j0) .. ($j2 - $j0)]; } return \%days; } } [download] Thunder fish Shocky knifefish TBD Electric eels were invented at the same time as electricity Before electricity was invented, electric eels had to stun with gas Results (293 votes). Check out past polls.
http://www.perlmonks.org/index.pl/jacques?node_id=889705
CC-MAIN-2017-09
refinedweb
621
67.69
New version of Script.NET was released. (13 June 2008) It is now based on Irony Compiler Toolkit and has new run-time infrastructure. Please use following link to download it: Download Latest Version. Script .NET is a simple scripting engine which can be embedded into .NET framework applications to perform custom functionality in run-time. It works like VBA in Microsoft Office Applications. The difference is that Script .NET may use custom object model, different for each application. Script .NET is written in C#.The key principles of Script .NET are: All you need to start working with Script .NET is to add reference to ScriptDotNet.dll, using ScriptDotNet; Script s = Script.Compile( "MessageBox.Show('Hello .NET! This is Script .NET');"); s.AddType("MessageBox", typeof(MessageBox)); s.Execute(); For the sake of simplicity there are only four commonly known build-in types: There is also implicit type object which is .NET object. All other types are derived from it. Script .NET supports type importing. Which means you can add any .NET Framework type to the Script .NET programs and work with it. Note: If you haven’t added your time Script.NET run-time will search it in libraries loaded into current application domain. If the type was found then it will be cached for further use in Script Context. All variables in Script .NET are global and non-typed. They are stored in the Script Context. Script Context is a special structure which is used by Script Engine to store run-time information and interact with .NET. However, function body creates local Contexts and store declared variables there. Functions have access to global variables. The build-in arrays has a .NET type object[] and can store any values. The element of array may be accessed in a usual way: Array[index]. There is usual syntax of expressions, like: X = (y+4)*2; Y = a[5] + 8; Z = Math.Sqrt(256); P = new System.Drawing.Point(3,4); 'this is string' is string Expressions have following operators: +, -, *, / ,%, ! , | , & , != , > , < , is There is also special operator new for creating instances of imported types. A program in Script .NET is a sequence of statements. There are three usual statements: sequencing (;), loop, and branching. if (Expression) statement else Statement The result of Expression calculation must implement IEnumerable. Expression evaluates only once, before loop starts. function (id1, id2, ... , idn) { Statement } The function is creates local context during execution. event – assign event to windows forms control eval – evaluates value of an expression clear – clears all variables in context Script Context is an object stores run-time information: variables and import types. Using Script Context you can add .NET objects to use in the script. There are a number of functions: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using ScriptDotNet; namespace Test { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Script s = Script.Compile(@"form.Text = 'Hello World'; MessageBox.Show('Hi'); b = new Button() "); s.AddObject("form", this); s.AddType("Button", typeof(Button)); s.AddType("MessageBox", typeof(MessageBox)); s.AddBuildInObject(typeof(Math)); s.Execute(); } } } All you need to start working with Script .NET is to add reference to ScriptDotNet.dll, using ScriptDotNet; ... Script s = Script.Compile( "MessageBox.Show('Hello .NET! This is Script .NET');"); s.AddType("MessageBox", typeof(MessageBox)); s.Execute(); Script Test is the application for testing Script.NET programs. You can use it to execute any scripting program and to observe results in Script Context. Mutantic Framework introduces a special kind of "meta" objects for working with objects of any type. Definition: Mutant is a special object which could have all properties (fields, methods, etc), and may be converted to any type (or assigned to object of any type). The semantics of such conversion (or assignment) is pragmatically conditional, i.e. depends on user needs. Example. Creation and Usage of MObject: // Create Data Mutant Object a = [ Text -> 'Hello from Mutant' ]; // Set Additional Fields a.Top = 0; a.Left = 0; // Set corresponding fields of Windows Form object // (Mutantic Assignment) form := a; Script .NET has a special quotation operator: <[ program ]> which returns AST of a given program. The AST of the current program may be accessed with prog object. Here is an example: Modification of current script //Create an AST for MessageBox.Show('Hello'); program ast = <[ MessageBox.Show('Hello'); ]>; //Add this AST at the and of the current program prog.AppendAst(ast); MessageBox.Show(prog.Code()); The <[ ... ]> operator and prog object allows Script.NET to generate new scripts or modify existing script at the run-time. General News Question Answer Joke Rant Admin
http://www.codeproject.com/KB/cs/ScriptNET.aspx
crawl-002
refinedweb
778
54.49
Overview Once you have found the data you want to analyze in Earth OnDemand, the next step is to analyze these data in your EarthAI Notebook. To do this, you'll want to copy your query from Earth OnDemand into the EarthAI Notebook environment. How To Copy your Query to EarthAI Notebook High Level Approach - Copy query - Paste and run query in EarthAI Notebook 1. Search The first step is to search for the data you want to analyze in Earth On Demand. The Copy Query tool will copy the most specific version of your search. This means if you have selected and are viewing a specific image on the map, the query that will be copied will return only this image. By contrast, if you have only specified an Area of Interest using the bounding box, all of the imagery over all indexed history for all of the footprints intersecting the bounding box will be returned. In between these two extremes, you can filter by date, cloud cover, and footprint. 2. Copy Query Once you have a query you'd like to copy, Click on the Export menu (top-right of map) and select "Export Query to EarthAI Notebook." This will open a pop-up dialog (unless you've already done this and disabled the dialog). If you are logged in and have a subscription (or trial subscription) to EarthAI Notebook, the dialog will have a button that opens your notebook. Otherwise, it will direct you to the EarthAI Notebook Webpage where you can start a free trial. If you don't have a subscription, you will need to start a trial to use this feature. If you do have a subscription, proceed to the notebook. 3. Paste and run query in EarthAI Notebook In notebook, you will need to add an include statement to your notebook. Best practice is to put all of your include statements in the first cell of your notebook. from earthai import earth_ondemand Create a new cell. The copy query function uses a JupyterLab magic function. This means it must be in its own cell. Paste your query from the clip board. The result set will be returned as a new geopandas dataframe with the result set metadata: Tip: Every time you run this cell, the variable name will increment (eod0, eod1, eod2,...) Please sign in to leave a comment.
https://docs.astraea.earth/hc/en-us/articles/360042332612-Export-Earth-OnDemand-Query-to-EarthAI-Notebook
CC-MAIN-2021-31
refinedweb
396
78.89
Asked by: Documentation Compiler - Sandcastle We did code complete of documentation compiler ( code named "Sandcastle") on June 15th and currently we are testing the tool building our .NetFramework documentation. We would like to release the CTP version of Sandcastle..Thursday, June 29, 2006 10:58 PMModerator General discussion All replies - Good news!Friday, June 30, 2006 9:48 PM - can't wait!!!Saturday, July 01, 2006 6:44 AM - It all looks very promissing. I can't wait to get my hands on the CTP to give it a go!Monday, July 03, 2006 6:16 PM Hello Anand This is really great news! Can't wait! Best regards, Jeroen Landheer.Monday, July 10, 2006 6:32 PM Hello Anand., Is there any news on Sandcastle? Can we expect the CTP soon? I'm really anxious to try it, and from what i can see in this forum, so are others? I would love to see what Sandcastle can do and provide feedback to you. Kind regardsThursday, July 13, 2006 7:06 AM Well it is the end of that next week that the Sandcastle CTP should be release, where is it? I too would love to see sandcastle in action!Friday, July 14, 2006 10:26 AM - I'm really needing this tool as well. Any news?Friday, July 14, 2006 1:33 PM - Me too I'm waiting urgently... !Friday, July 14, 2006 7:12 PM I think we all are. Don't forget that a Program Managers "desire" to release something is not always met. I think we would all want something usable, installable on a variety of configurations, and able to handle the occasional malformed XML that might occur. Also don't forget that this is summer in the upper northern hemisphere and a time when a lot of people take vacations so getting something through verification/validation/QA to release a CTP may not be nearly as quick as say, November or April. I would imagine that most people in Redmond would not call it their hometown (presuming it's coming out of Redmond).Friday, July 14, 2006 7:28 PM Thanks everyone for your posts. I have had several emails asking about CTP. There are couple places (download at our download center and also as a part of VS SDK) we are targeting to release our CTP version. The CTP at the download center should be posted by next week and if there are any delays I will post the information here. Also as soon as the CTP is posted I will provide the information here so that you can download and use Sandcastle. In addition we plan to include Sandcastle in our August CTP release of VS SDK. Sandcastle Overview: - Produces quality, comprehensive, familiar MSDN-like documentation. - Works with or without authored comments. - Supports Generics and .NET Framework 2.0 - Sandcastle has 2 main components (MrefBuilder and Build Assembler) - MrefBuilder generates reflection xml file for Build Assembler - Build Assembler includes syntax generation, transformation..etc - Sandcastle is used internally to build .Net Framework documentation Let me know if you have any additional questions. My email is listed in my profile and please feel free to reach me directly with any questions. AnandSunday, July 16, 2006 2:36 PMModerator - Thanks for the update Anand!Sunday, July 16, 2006 5:29 PMModerator - Great, Thanks. Will this handle non-standard tags (exmple: nested tags named: objects, object, parameters)? Will sandbox render the content of these non-standard tags in a reasonable format? If not, will we be to extend the code to format additional parameters ourselves? We are setting up our documentation format now, and would like to know how to format this type of information. Thanks, DavidMonday, July 17, 2006 3:05 PM Sandcastle (not sandbox) will not process non-standard tags. However user can post process these tags or extent the transforms (XSLTs) we provide to process these tags. Anand..Monday, July 17, 2006 11:51 PMModerator Will source code be available? I know this is a redundant question, but the way in which you've architected the application troubles me. For instance, in NDoc, [ObsoleteAttribute] was not being documented on enumeration members. I requested it should be included, and *very* quickly it was. In a recent project, I've generated an additional piece of metadata that I apply to enumeration fields that I would like to be documented (because they really don't have another place to be): I want a particular type of delegate to be associated with a particular enumeration field. Will MrefBuilder be extensible to support something like this, can it be replaced, or will there be a solution for it? Thank you, Anand. That this is the same tool used to build the .NET Framework documentation is exciting. --RobertTuesday, July 18, 2006 6:22 PM Rob, Source code for our CTP drop will not be available. We have not made a decision on exposing source code for our RTW release. We plan on doing monthly updates and the feature requests should be included quickly. I need additional information about your last point and you are wlecome to email me the scenario. The output from MrefBuilder is extensible with custom XSLTs. Anand..Thursday, July 20, 2006 12:31 AMModerator Hi Anand, I'm looking forward to seeing the tool. Here are a few things that I would like in a documentation compiler that in some instances I had been thinking about modifying NDoc to do: - Images. I'd like to be able to include references in the XML comments to images from either a local disk source (C:\image.jpg) or web source (). I think you could do this in NDoc but it was a bit cumbersome. The images could be class diagrams, sample output, etc. - Include files. I'd like to be able to include a reference in the XML comments to an external XML / XHTML file that would be compiled inline. This should also be local disk source (C:\file.xml) or web source (). - Directives for how namespaces should be nested in the contents. - Directives to exclude certain files / namespaces from the documenation. - Scriptable from MSBuild, NAnt, etc. I'm sure you'd be allowing for this already but thought I'd put it in. That's all I can think of for now. I hope these suggestions are useful and can be included! AndyThursday, July 20, 2006 12:50 AM Anand, Thank you for being forthcoming about source code availability. That it's even a decision you are considering is exciting news! That was one of my favorite things about NDoc - if it wasn't there, I could add it. In a project I'm working on, I'm using a custom attribute on the fields of an enumeration to indicate the Type of a delegate that should be used to respond to events. I chose to do it this way because in situations in which an event is raised and an exception is thrown, callees hooked to the event list after the callee that raised the exception are not called. I wanted to handle these errors and process the rest of the callee list. The following is an excerpt of my enumeration: public enum EventType { [Use(typeof(InfoEventHandler))] Info, [Use(typeof(ErrorEventHandler))] Error, [Use(typeof(EventHandler))] Authenticated, } The UseAttribute is read by the type that dispatches events, and when delegates are registered for the event, it ensures that the Type of the delegate being registered (it accepts a System.MulticastDelegate parameter) is the same as the Type of the delegate specified by the UseAttribute. Basically what I want to know is, will MrefBuilder be smart enough to include the attribute definitions on the fields of the enumeration? For my project, plugins implement their own EventType-style enumeration, and then plugins that operate as consumers of those plugins consume the events. Short of looking at IL disassembly or in Reflector, there is no other way to get access to that metadata. So it's important to me that this be possible in some way. Thanks again for your work on this project. I look forward to seeing it in action. --RobertThursday, July 20, 2006 1:25 AM Hey Anand, You mentioned that we can expect a drop in a week or so, it is almost three weeks now, any update for us? PieterThursday, July 20, 2006 1:34 AM Come on! I'm sure Anand and his team are as excited as the rest of us to release the CTP. Let's just wait for a little longer.Thursday, July 20, 2006 6:35 AM - Anand we're excited to hear about Sandcastle. Thanks for your group's effort to push this initiative.Thursday, July 20, 2006 5:21 PM Rob, We currently do not build topics for enum fields. I am going to add this a feature request. Anand..Friday, July 21, 2006 12:23 AMModerator Yes and our team is very excited about this release. I will post the Sandcastle MSI this week if our legal and interanl review process is complete. If not I will get them out next week. Just few more days and thanks for your patience. Anand..Friday, July 21, 2006 12:26 AMModerator Hi Anand - I'm not looking for enum fields to have their own topics - that would be insanity! In fact, I don't believe much besides <summary> is valid on enum fields. No, what I'd like is for there to be some way to process custom attributes on documentation. For example, the assembly contains the information that, on those enum fields, the custom attribute is applied. For instance, when the ObsoleteAttribute is applied to an enum field, when you create the table, it should indicate that the enum field is obsolete. For instance: This is documentation emitted by NDoc on a 1.1 assembly. Basically, I'm looking to make sure that custom attributes are not simply ignored by MrefBuilder - that instead, they're given an opportunity to be processed by either a plugin or XSLT on the developer's end. Thanks again! --RobertFriday, July 21, 2006 1:21 AM - One question - will this tool be able to generate docs from a Web Site project? We are currently debating whether its worth converting a large project from Web Site to Web App Project as it caused a few problems when we tried previously. The only reason we need it is to generate docs.Friday, July 21, 2006 11:51 AM Robert, Yes. The output from Mrefbuilder will have all this infomation. You will be able to modify the XSLTs to process this information. Let me know if you have additional questions. Anand..Friday, July 21, 2006 8:40 PMModerator Adam, I am not clear about your question. Could you please elaborate? Are you looking Sandcastle to generate documentation for a website project to document what? Thanks. Anand..Friday, July 21, 2006 8:41 PMModerator - I hope Sandcastle will generate html documentation as well. We had previously relied on NDoc to document all of our web services and class libraries this way, posting them to a common server for the entire company to access via a simple index.html file. MDSN help files don't load over a UNC share :-(.Friday, July 21, 2006 8:43 PM - To document all the classes in App_Code and all the code-behind and the relatioships between the aspx files, user controls, the code behind files, and the classes in App_Code. We've got a massive project, and converting it to a Web Application Project has caused a lot of issues so, as the priority is now getting feedback from beta testers, we need to keep it running smoothly and just ironing out bugs and dealing with feature requests. Thanks Adam.Friday, July 21, 2006 9:12 PM That is incorrect. There is no problem getting CHM files to load across UNC shares; it just requires a registry change documented in the MS KB. This was a "fix" in WinXP SP2 and in order to get the behavior back to pre-fix, you merely have to make a quick reg edit.Saturday, July 22, 2006 3:07 AM SiMonday, July 24, 2006 4:15 PM Maybe it could be run through Microsoft Connect and get some beta testing done there, where all the feedback support etc is collected... Then the legal guys can add their bits to the beta program for it... Like all the others in this forum, I too cannot wait for this pending release! Regards BrianTuesday, July 25, 2006 5:13 AM - I am also having the same issue in trying to get the .chm file to load on a UNC share. Can you please provide some further instructions on who,what,when,where,how to reg edit. Thanks. Thanks, Please reply to mjoshua@manfinancial.comTuesday, July 25, 2006 7:42 PM - Seriously, Google is your friend:, July 25, 2006 9:25 PM Adam and Sdix, Thanks for providing this scenario. This was not one of our scenarios and test cases for this CTP. However I have added this as feature request. I am going to try our existing build against a web App to see if it works. We will certainly support this for a future release if the current version does not support this scenario. Please fee free ask more questions and I will be happy to respond. Anand..Wednesday, July 26, 2006 9:11 PMModerator - Looks like NDoc 2.0 is dead. I received this email from Kevin Downs (developer of NDoc) this morning: " "Wednesday, July 26, 2006 11:53 PM - I'm terribly sorry for Kevin. This to me is an example why most open source projects can't survive unless they're surrounded by revenue/services (something I don't how could have saved this tool) or sold as nagware.Thursday, July 27, 2006 12:04 AM I feel for Kevin, too. I would be just as outraged if members of the .NET community spent their time spamming me instead of helping out on the project. However, I disagree that MS are releasing SandCastle to compete with or "stamp out" NDOC. The problem is that there is no competition: there is no NDOC 2.0. The community needs a product to fill the void, regardless of who the product comes from. I don't believe MS would have released SandCastle if NDOC 2.0 was out and going strong. Of course, that leads us back to the problem of the community not getting involved in the project. I, for one, have been involved in several community projects (NAntContrib and my own Ingenious MVC). I have been surprised at times by how rude some people can be despite the fact that you work your ar*@ off on a product only to give it away for free. RIP NDOC, Kent BoogaartThursday, July 27, 2006 12:48 AM I'm not sure what you guys are talking about, but if you read *any* of the mailing lists for the NDOC sourceforge site you would have seen MANY people dying to help Kevin with NDoc2. He simply wouldn't let them. I don't feel bad for him per say, because its more or less his own fault. I'm not saying I don't appreciate all the hard work and effort he put into NDoc, because I do, very much so! I just don't feel bad for him abandoning the project when he wouldn't let the community help him, and there were plenty willing to help. Either way, I'm looking forward to Sandcastle. Doug I forgot to mention a great post about Kevin's resignation from NDoc. I don't think I could have said it better:, July 27, 2006 7:03 AM Wout, As I mentioned in my post, I'm sincerely appreciative of the work he's put in to a great piece of software. That being said, its open source, you can't expect anything from people in regards to donations. But the reason I posted was because there were and still are a ton of people that want(ed) to help with NDoc 2. Why he didn't "let" them help is beyond me. I can only blame him for that. DougThursday, July 27, 2006 8:46 AM - Is there a link to the Sandcastle project site yet?Thursday, July 27, 2006 9:09 AM - Thanks for your response. What would you suggest we do in this situation? Carry on using a Website project and hope Sandcastle supports them soon (i.e. next couple of months) or go through the tedious process (in our case) of converting to a Web Application Project just to get documentation?Thursday, July 27, 2006 11:28 AM No, it is an CTP release and as far as i know there is no project site yet.Thursday, July 27, 2006 12:47 PMModerator Skute, Don't know if this is what you meant, but after the CTP is released, I would love to see a (msdn) blog etc. by the Microsoft team dedicated to Sandcastle. I am sure I will have a lot of questions, want to see example xslt code, have a place for feedback, want to track development etc. Anand, if this is not already in the works please consider it. Thanks.Thursday, July 27, 2006 2:33 PM Don't get me wrong folks -- I have a huge amount of respect for Kevin. The guy created an incredibly useful tool, one that has had a huge impact on .NET development. And then he gave it away for free. That's huge. I just don't agree with the way that he's been handing things since 2.0... That said, I find blowing away his email or threatening his family appalling. It can't believe that there are those of us out there -- supposed "professionals" -- who would even consider acting in such a way. It's embarrassing.Thursday, July 27, 2006 3:19 PM I agree with that. I find it hard to believe a mature professional developer out there could do something like that. It screams of script kiddies, but I doubt they would be so concerned with it's development. Oh well, roll on Sandcastle. Looking forward to the release.Thursday, July 27, 2006 3:29 PM There is a postscript to Kevin's public letter: I wish I had the bandwidth. I hope someone does.Thursday, July 27, 2006 3:41 PM Doug Rohm and I have requested that Kevin hand the project over to us. We'll see what happens.Thursday, July 27, 2006 3:58 PM - That's great news. Thank you both.Thursday, July 27, 2006 4:00 PM It seems like with so much notoriety from having developed NDoc you could have done things like: 1. Write a book about NDOC and promote it on your website. 2. Wrote a business plan and asked for venture capital. 3. Developed some add-on products (filters, special formatters, spin off technologies) which you could charge for. The really hard part in software is getting a user base. You have that.Thursday, July 27, 2006 4:12 PM - Gentlemen, This discussion is taking a ridiculous turn. Chatting about how an adult should run his life or business is generally reserved to other kinds of circumstances.Thursday, July 27, 2006 4:29 PM Yes we do plan to setup a dev docs and help system blogs with RSS feeds. I am in the process of setting this blog up. This is a great idea and please consider this done. Anand..Thursday, July 27, 2006 4:48 PMModerator - Sandcatle generates HTM files and it's fed into the help compiler.Thursday, July 27, 2006 5:03 PMModerator I have been following these threads. The mission statement for Sandcastle has been to "Enable managed class library developers throughout the world to easily create accurate, informative documentation with a common look and feel". Since releasing v1 of the .NET Framework, Microsoft has been encouraging C# developers to document their code using XML documentation comment. We have had several request from MVPs and customeres to release our internal documentation compilers. Andrew Webb opened a feature request at We are releasing documentation compilers which we have been using for shipping .Net Framework documentation. The goal for this CTP release is to improve performance in the build. we will have new features in our monthly releases. Anand..Thursday, July 27, 2006 5:30 PMModerator - Am I blind. I saw the original post stated that there should have been a CTP at the beginning of this month. I saw he updated with new features but I didn't see a reason for a time delay or a new estimation for the expected release of ctp. Don't see anything in download center or msdn.Thursday, July 27, 2006 9:10 PMModerator Hi MarcD I agree with you... I can't find the CTP anywhere... Maybe because it hasn't been released yet? I guess we need to be patient... Best regards, Jeroen.Thursday, July 27, 2006 9:50 PM Anand..Thursday, July 27, 2006 11:01 PMModerator Marc, We have not released the CTP yet. Please check out and I will do a post as soon as the CTP is out of the door. We are very close and thanks for your patience. Anand.Thursday, July 27, 2006 11:02 PMModerator Adam, If you can generate dlls for your code behid CS files then you can generate documentation. We provide a test.cs file in Sandcastle example directory and steps to create documentation for it. I would wait until we release the CTP. Anand..Thursday, July 27, 2006 11:52 PMModerator - That's great - thanks for setting up the blog!Friday, July 28, 2006 8:58 AM Sandcasle CTP has been released, August 01, 2006 8:27 AM Should I be the first to thank Microsoft for producing Sand Castle? The number of unnecessary steps and command line statements one has to execute to do anything is surpassed only by most Open Source projects. The fact that Microsoft developers working on this project DID NOT take 5 minutes to produce a batch file that worked simply by going CreateOutputThatReducesTheNumberOfUnnecessaryStepsfrom11To1.bat "YourDllFileGoesHere.dll" is extremely warming. I want to thank Microsoft for requiring other developers to step forward and show their leet batch skills. Yes To all the people that posted solutions, every single person in the world installs their stuff to "C:\Program Files" and every single person wants to put your stuff in their root "C:\" directory and every single person has a C:\ and uses it as their main drive. And every single person wants to have to go through the scripts and edit all of these ridiculous paths to point to valid locations. And when this is all said and done, and 3 scripts have been tried and one script has been rewritten eliminating the aforementioned problems we are given a 24kb chm file that has a single icon. An Alert Icon. No security warning. No contents listing my public classes and their methods, and the enumerations and the comments from the assembly that it took. Just a blank icon. Thanks a million.Tuesday, August 01, 2006 1:42 PMModerator MarcD, I was very disappointed to read your post. The people on the SandCastle team have worked hard to release a build of a product with which you have met with negativity and sarcasm. The SandCastle version released was the first CTP. What did you expect? An RTM build as a CTP? Your attitude is the very reason why people like Kevin stop working on products like NDoc that they give away for free. Why don't you start being part of the solution.Tuesday, August 01, 2006 2:10 PM Hey, take it easy on them (and us).. it's just a very early CTP you're looking at. I bet you that when the 1.0 release is out it will be fully integrated in Visual Studio. Btw, my MSBuild script should be very easy to modify so that it looks somewhere else than in c:\Program Files etc: If you don't get it working, let me know and I might be able to help you out. Cheers, AndersTuesday, August 01, 2006 2:11 PM Just thought I'd let you know how to modify the msbuild script mentioned above to work with different setups. 1) Instead of extracting the Sandcastle.zip file to c:\Program Files\MSBuild, extract it to the equivalent MSBuild folder (d:\Program\MSBuild or whatever) 2). /Anders, August 01, 2006 6:41 PM MarcD, What an ignorant comment. I'm not sure how these things work, but if I could I would vote for your "MVP" status to be revoked.Tuesday, August 01, 2006 8:50 PM So in your opinion, all an MVP should ever do is cheer every new Microsoft release, no matter how lackluster? Also, please don't use "ignorant" as a general-purpose insult... there was nothing "ignorant" about his comment. Microsoft claims this Sandcastle release is an early preview but they also claim that this same application has been used all the time to create their own MSDN documentation. Also, several weeks have passed since the first Sandcastle announcement -- time that was supposedly spent to properly wrap up this first public release. Given that, the current state of Sandcastle is definitely disappointing. On top of the incredibly convoluted usage, Sandcastle is apparently also unable to link to an installed MSDN Library and does not support popular NDoc tags like <overloads>. I think Kevin was hasty in abandoning NDoc for fear of Sandcastle... the application shows promise but it has a long way to go before it's an acceptable replacement. I'll keep using NDoc 2.0 Alpha, thanks.Wednesday, August 02, 2006 6:19 AM Actually I think a lot of people were disappointed by the CTP also. I also believe that the steps should be much less even from the first CTP. As far as I'm concerned, I didn't even tried to use it. This is my direct opinion without sarcasm. I will expect the next release and the final product since documentation compiler is really missing from VS. Keep up the good work which I'm sure you are doing. It's just that some of us will have to wait a little longer to see. Regards, DimitrisWednesday, August 02, 2006 7:11 AM Not at all. MVPs can certainly express disapproval over Microsoft's choices. My objection is to his tone -- it's basically a "thanks for nothing" attitude that unfairly damnifies the effort put forth by the Sandcastle team. We have no way of knowing why the team didn't provide a script... perhaps they have been busily working to make the actual function of the product as stable as possible? Perhaps they are internally using a VS add-in that isn't ready for release... it's all speculation, nobody on the outside knows, and it's a reprehensible form of anti-community behavior to spout such nonsense. The team has put themselves out there with an early release, and to our benefit. I certainly don't think that the team has been sitting around doing nothing since the first announcement -- note that most of the posts by the team on the Blog that was set up last week are from over the weekend. When I read back through this thread I see several instances where the team has welcomed feature requests. Clearly they're dedicated to the project. If responses like MarcD's become a norm of the community (and the community doesn't respond by calling them out for what they are), Microsoft's public relations people will take notice and we'll go back to seeing releases much later in the development cycle -- that doesn't help anybody. Kevin didn't abandon NDoc strictly because of Sandcastle -- he says that clearly in his message. He did it because of events that occurred as a result of the general attitude of entitlement that some people in the community seem to have. Your comments about what Sandcastle doesn't support indicates that you clearly have it as well. Nobody said you have to use Sandcastle -- continue using NDoc 2.0 Alpha, by all means... but remember that the reason that it won't be finished is precisely because of the perspecitves held by people like you and MarcD.Wednesday, August 02, 2006 2:44 PM - No they don't. They specifically say the CTP is a new architecture. Clearly this means it *hasn't* been used to generate any publicly available MSDN documentation. As they dogfood, I'm sure *many* improvements/fixes will be added. I'd much rather have the ability to get involved with the product at this stage then wait for some arbitrary set of criteria be validated before being able to use it. The CTP is to garner feedback. Clearly the designers are looking for the community's opinion on usability, look-and-feel, etc. To simply say "thanks for nothing" is not productive, reduces the chances that future projects of this type (or any type) will even be made available (look at Kevin's response to the "gimme" attitude of the community), ruins it for the rest of us, and it just plain rude. If you don't like the product either shut up and don't use it or be a productive member of the community. All that was required was a comment like "I was disappointed with the number of steps needed to produce output. I suggest <enter suggestion here>...". Look at Anders' response to the whole thing. Clearly more proactive and productive, and provides feedback that the designers can actually use. Look at Kevin's complaint-to-pat-on-the-back-ratio; a million to one! (irrespective of his criteria for pat-on-the-back, or the liklihood that he put himself in that position) Not really incentive to continue similar work for "the community".Wednesday, August 02, 2006 3:21 PMModerator This is getting ridiculous. Can we please stop pretending that Sandcastle was made by private individuals (like Kevin Downs) out of the goodness of their hearts? These people are Microsoft employees, they are being paid for what they do, and what they do is fulfil a request by Microsoft's paying customers (such as me) to add a feature that's obviously missing from the current Visual Studio release. You know, take the XML comments from a compilation run and turn them into an actual usable help file. Not such an outlandish and extravagant idea, you will admit. One might reasonably say this feature should have been available when Visual Studio 2005 or even 2003 was first released, at least in the Professional edition and up. As to the current Sandcastle release, I stand corrected regarding Microsoft's own use of the product but I still say that a release at this early stage is simply not helpful. I'm baffled what sort of constructive feedback is even expected here -- the project lead already wrote up the sequence of steps required to build a CHM file in his blog, yet the extremely obvious action of putting these steps into an executable script is such a huge mental leap that the community has to help out? Give me a break. Microsoft aren't doing their own reputation any good by releasing those increasingly early and incomplete preview versions of their products. It's disappointing that Microsoft releases take so long to begin with, but an unusable release is worse than no release. Sandcastle needs at least some basic level of polish before the team can reasonably expect useful feedback.Thursday, August 03, 2006 6:43 AM While waiting for a nice polished Microsoft-built GUI, I again decided to take on the task myself. If anyone is brave enough to install my first attempt at a Visual Studio Project plugin, head over to. Features: - New project type "Documentation Project" - Add assemblies/XML-files from the current solution, and/or from external files. - Build the same way you would any other project in Visual Studio It most likely also features a whole lot of bugs, so be warned.. /AndersThursday, August 03, 2006 1:35 PM - I disagree with Chris Nahr, I thank the dev team on this for getting this release out as quick as they could. Yes it is frustrating that it isn't intuitive to use, but that will come with time. I'm sure that a lot of people waiting for this release are like me, in that they'd rather something was released now so they can create documentation for their projects, rather than wait, weeks or months until it is a little more polished. That way if you'd rather wait for the finished product, you can. If you need something now and are happy to spend a little of your time to write a script to get it to work, you also have that option open to you.Thursday, August 03, 2006 1:57 PM - Anders, your contributions are much appreciated!!! I've started documenting our large project using your MSBuild tasks and sandcastle. There are a couple of things I'm trying to change (some small some big) which I wonder whether you or the general audience have opinions on. 1) I can't seem to get content on that "front" page that just shows the alert icon. Anybody succeeded on that one? 2) We have lots of nested namespaces, because the product is big. I personally think nesting those sub-namespaces (AALabs.Foo.Bar inside AALabs.Foo) is better for us. It's unclear how this occurs now... I read the XSL and the input XML and the topic list doesn't seem to have any hierarchy in the first place, I'm not sure how the hhc ends up with it. That said, I can modify the hhc programmatically, and maybe that's the answer. I'm not sure XSL is up to the task of splitting and sorting it all out anyway. 3) This is too big to be a bullet item, but I really want to figure out how to integrate class level docs with a Wiki. We use Confluence here. I can imagine modifying the style sheets to produce wiki markup instead of HTML Help, but the magic part is how might we then take changes back into the comments. Or perhaps this isn't the right model at all, perhaps it should be "read only" with discussion in the wiki. Anybody else dealing with this?Thursday, August 03, 2006 2:41 PM I'm afraid I've been so busy automating the current process that I haven't looked that much at the stuff that is actually produced. But I figure you could do a lot of things with the xml and xsl files. About the wiki, I'd probably suggest going the same way that the msdn-wiki is going (), ie. the documentation is read-only but with a discussion below it. Incorporating changes back into the original comments would probably be really difficult..! /AndersThursday, August 03, 2006 2:56 PM Hmm, let's see. Perhaps feedback on the actual function of the product? For instance, how about "I tried to document an assembly that uses feature X, and didn't get a correct result." Or maybe, "I'd really like to be able to use some NDoc features like P, Q, and R... here is how I would like to see them supported." Personally I am thrilled to see Microsoft finally starting to embrace some of the best attributes of the open source community, even if they haven't embraced open source itself. Anders' contributions are a great example. This whole experience really makes me wonder how many other useful pieces of code Microsoft has internally that they would be willing to release to the community if they could expect others to help out? Should Microsoft have released this feature way back with VS 2003? Absolutely. They didn't for their own reasons, but they're doing it now. We should support them and try our best to provide positive feedback. Not such an outlandish and extravagant idea, you will admit.Thursday, August 03, 2006 3:42 PM Agreed. As much some members of the community seem to believe it's their inalienable right to have some sort of XMLDoc-to-CHM conversion, comments like "thanks for nothing", "I don't like it", "it doesn't do what I want", "it's not useful", etc. are just going to make the people working on it (yes, they work for Microsoft, but they're still people) think they just shouldn't bother--nothing is good enough, so why waste time, nothing is what the community will get. "Hmm, bust my *** working on something to get negative comments, or don't bust my *** and get negative comments": seems like an obvious choice to me! If you're not willing detail the criteria by which any application does not meet your needs, you cannot expect to ever meet your needs. If you're not willing to detail the failure criteria, then keep silent. I don't care who's working on it. If a user of software that you wrote came to you an said "I can't use it, it doesn't work" what would *you* say?Thursday, August 03, 2006 4:14 PMModerator - Please all. Stop the drama or take it to UseNet.Thursday, August 03, 2006 7:07 PM
https://social.msdn.microsoft.com/Forums/en-US/cef926c5-bf43-45fb-a69a-3266ddf56994/documentation-compiler-sandcastle?forum=devdocs
CC-MAIN-2017-39
refinedweb
6,311
72.46
. . spark-packages.org collection. Spark user / dev mailing lists first./data loss bugs are very serious. Make sure the corresponding bug report JIRA ticket is labeled as correctness or data-loss. If the bug report doesn’t get enough attention, please send an email to dev@spark.apache.org, to draw more attentions.:: user@spark.apache.orgfirst about the possible change user@spark.apache.organd dev@spark.apache.orgmailing list archives for related discussions.. It’s worth reemphasizing that changes to the core of Spark, or to highly complex and important modules like SQL and Catalyst, are more difficult to make correctly. They will be subjected to more scrutiny, and held to a higher standard of review than changes to less critical code. While a rich set of algorithms is an important goal for MLLib, scaling the project requires that maintainability, consistency, and code quality come first. New algorithms should: @Sinceannotation on public classes, methods, and variables. Before considering how to contribute code, it’s useful to understand how code is reviewed, and why changes may be rejected. See the detailed guide for code reviewers from Google’s Engineering Practices documentation. Simply put, changes that have many or large positives, and few negative effects or risks, are much more likely to be merged, and merged quickly. Risky and less valuable changes are very unlikely to be merged, and may be rejected outright rather than receive iterations of. If you are interested in working with the newest under-development code or contributing to Apache Spark development, you can check out the master branch from Git: # Master development branch git clone git://github.com/apache/spark.git Once you’ve downloaded Spark, you can find instructions for installing and building it on the documentation page.. Fix typos in Foo scaladoc correctness: a correctness issue data-loss: a data loss issue release-notes: the change’s effects need mention in release notes. The JIRA or pull request should include detail suitable for inclusion in release notes – see “Docs Text” below. starter: small, simple change suitable for new contributors dev@spark.apache.orgfirst before proceeding to implement the change. test("SPARK-12345: a short description of the test") { ... @Test public void testCase() { // SPARK-12345: a short description of the test ... def test_case(self): # SPARK-12345: a short description of the test ... test_that("SPARK-12345: a short description of the test", { ... ./dev/run-teststo verify that the code still compiles, passes tests, and passes style checks. Alternatively you can run the tests via GitHub Actions workflow by Running tests in your forked repository. remote add upstream, running git fetch upstreamfollowed by git rebase upstream/masterand resolving the conflicts by hand, then pushing the result to your branch. master, that you will actually have to close the pull request manually Please follow the style of the existing codebase. If you’re not sure about the right style for something, try to follow the style of the existing codebase. Look at whether there are other examples in the code that use your feature. Feel free to ask on the dev@spark.apache.org list as well and/or ask committers.
https://spark.apache.org/contributing.html
CC-MAIN-2021-17
refinedweb
523
56.86
Isolated import of Python Modules Project description localimport allows you to import Python modules in an isolated environment, preserving the global importer state. Features - Emulates an isolated environment for Python module imports - Evaluates *.pth files - Compatible with pkg_resources namespaces - Mocks pkgutil.extend_path() to support zipped Python eggs Example Given your Python script, application or plugin comes with a directory that contains modules for import, you can use localimport to keep the global importer state clean. app.py res/modules/ some_package/ __init__.py # app.py with localimport('res/modules') as _importer: import some_package assert 'some_package' not in sys.modules **Important**: You must keep the reference to the ``localimport`` object alive, especially if you use ``from xx import yy`` imports. Usage Pre-minified versions of localimport can be found in this Gist. Of course you can minify the code by yourself, for example using the nr command-line tools. nr py.blob localimport.py -cme localimport > localimport-gzb64-w80.py Depending on your application, you may want to use a bootstrapper entry point. # @@@ minified localimport here @@@ with localimport('.') as _importer: from my_application_package.__main__ import main main() API localimport(path, parent_dir=None, do_eggs=True, do_pth=True, do_autodisable=True) A context manager that creates an isolated environment for importing Python modules. Once the context manager exits, the previous global state is restored. Note that the context can be entered multiple times, but it is not recommended generally as the only case where you would want to do that is inside a piece of code that gets executed delayed (eg. a function) which imports a module, and building the isolated environment and restoring to the previous state has some performance impacts. Also note that the context will only remove packages on exit that have actually been imported from the list of paths specified in the path argument, but not modules from the standard library, for example. Parameters - path – A list of paths that are added to sys.path inside the context manager. Can also be a single string. If one or more relative paths are passed, they are treated relative to the parent_dir argument. - parent_dir – A path that is concatenated with relative paths passed to the path argument. If this argument is omitted or None, it will default to the parent directory of the file that called the localimport() constructor (using sys._getframe(1).f_globals['__file__']). - do_eggs – A boolean that indicates whether .egg files or directories found in the additional paths are added to sys.path. - do_pth – A boolean that indicates whether .pth files found in the additional paths will be evaluated. - do_autodisable – A boolean that indicates that localimport.autodisable() should be called automatically be the context manager. Changed in 1.7 Added do_autodisable parameter. localimport.autodisable() Uses localimport.discover() to automatically detect modules that could be imported from the paths in the importer context and calls #disable on all of them. New in 1.7 localimport.disable(modules) Disable one or more modules by moving them from the global module cache (sys.modules) to a dictionary of temporary hidden modules in the isolated environment. Once the localimport() context manager exits, these modules will be restored. Does nothing when a module does not exist. Parameters - modules – A list of module names or a single module name string. localimport.discover() A shorthand for pkgutil.walk_packages(importer.path). New in 1.7 Project details Release history Release notifications Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/localimport/
CC-MAIN-2018-51
refinedweb
582
50.53
Play the songs, albums, playlists and podcasts you love on the all-new Pandora. Sign up for a subscription plan to stream ad-free and on-demand. Listen on your mobile phone, desktop, TV, smart speakers or in the car.Get a Quote. us$20.57 us$24.68 17% off 30w 16led outdoor solar powered accent lightss by h&h pir motion sensor 360degrees diming outdoor wall lamp for garden road pathway 0 review cod us$4.53 us$5.43 17% off 7w 12w e27 radar motion sensor induction led light bulb globe lamp for home indoor decor ac220v 23Get a Quote. 66 leds solar street wall light with remote controller solar outdoor garden lighting white warm white. add to cart. sale. 360 leds dusk to dawn solar wall light dual color outdoor waterproof pc link integrated solar street & street light 2000lm 6 modes solar street induction night lights with remote. add to cart.Get a Quote.. integrated solar street lights(all-in-one) the ss2 series is the second generation of component of solar garden light useds, with a better performance than the last generation: improved from the deficiency of the last generation, which was first developed in 2013; innovative allGet a Quote The number of purchases shot up 57 percent in 2014.Why homebuyers face a tough spring adno=50479588 ADVERTISEMENT ADVERTISEMENT ADVERTISEMENT s 4 iIN JrLDrug Name Qty (pills) Price* Drug Name Qty (pills) Price*Viagra 100mg 16 $ 99.99 Janumet 50/1000mg 84 $184.99Viagra 50mg 16 $ 79.99 Protonix 40mg 84 $ 29.99Cialis 20mg 16 $ 99.99 Aciphex 20mg An icon used to represent a menu that can be toggled by interacting with this icon.Get a Quote USA.com provides easy to find states, metro areas, counties, cities, zip codes, and area codes information, including population, races, income, housing, school licwshi baterai lithium solar street light [jyc li lifepo4 outdoor 48 led 4500mah,ip65 waterproof outdoor security night light,wireless wall lamp with motion sensor and remote control for garden, fence, patio, yard, gate garage-white licwshi 1100lm light nagpur |outdoor solar street lights outdoor 4500mah black aluminum alloy 120degrees infrared motion licwshi outdoor radar sensor light solar power outdoor 48 led 4500mahGet a Quote Semi-circular torch wall light DM-106-2 - many bright Products Made In China, China Manufacturer. Product Name: Semi-circular torch wall light Product Model:106-3 Solar Panel: 5.5V 80ma 0.49w Polysilicon Color Temperature: 66PCS Amber LED Light body material: ABS+PC environmental protection new material Battery: 3.7v 2000mah lithium battery Light source: "2835" patch led 66PCS …Get a Quote Jul 21, 2014· Below we share full list of colour code for car painting. From Alfa Romeo, Proton, Perodua, Honda, Toyota to VW. Colour code database Colour Code: SOURCE/MMF PPG CODE OEM CODE COLOUR DESCRIPTION ALFA ROMEO FIA.533/B 533/B GIALLO MTS 2CT ALFA ROMEO FIA.818/B 818/B NERO MTS 2CT ALFA aug 22, 2019 this will not happen much compared with ip66 sensor solar street lights all, because 120 watt 2 in 1 solar garden light are usually used at night and do not work too long. so if you want to buy a solar street lamp product with stable quality, please choose a regular manufacturer.Get a Quote Darco Acoustic 6 Set Value Pack Phosphor Bronze Lights-Light (12-54) 2-Pack . Price $ 35.88. Save $ 24.00. Regular Price: $ 59.88. Ends in Availability: Price Match Guarantee. If you find a better advertised price on the same product from an authorized U.S. dealer—online or in-store—within 45 days of purchase, we’ll match it.Get a Quote Everything you love is in Amazon.ae. Discover and buy electronics, computers, apparel & accessories, shoes, watches, furniture, home and kitchen goods, beauty & personal care, grocery, gourmet food & more. Enjoy great deals, fastest delivery and cash on delivery in UAE.Get a Quote Jul 02, 2018· Bending Light and Space Digital Sun 015dd172-e86a-4d38-b373-a07615998072 La Ambulancia K-50 Bones (Nh Mix) Nicolas Hilton 0363260b-eb6a-4a31-a254-6e83e09a28da People Help the People Pure 100% d'amour 0491e456-20d9-4e8c-a957-b1f7ce8a3a9b Twisted Mark Murphy led outdoor lighting (288) accessories (9) fixtures (279) security and flood lighting (69) outdoor ceiling fans (60) fans (55) light kits (5) accessories (54) other (49) replacement glass (5) address light (40) wall faucets (27) door chime (6) outdoor chandeliers (6) portable lamps (4) floor lamps (2) table lamps (2) outdoor solar led light price in Zimbabwe (6) wallGet a Quote Since 1974 we've loved helping folks find the right gear. Get FREE 2-day shipping, one-on-one advice from our Virginia-based Advisors, along with free lifetime tech support. item 3 morningstar sl-20l-12v sunlight 40w cheapest upgraded solar street lights in rural controller 20a 12vdc 2 - morningstar sl-20l-12v sunlight athli 30/60/90w led solar street light controller 20a 12vdc. $115.00. free shipping. item 4 morningstar sl-20l-12v sunlight - 20 amp 12 volt solar charge controller w/lvd 3 - morningstar sl-20l-12v sunlight - 20 amp 12 volt solar charge controller w/lvd. $115.00.Get.Get a Quote With Indeed, you can search millions of jobs online to find the next step in your career. With tools for job search, resumes, company reviews and more, we're with you every step of the way.Get a Quote Solar Dream Light DM-LL-208 - many bright Products Made In China, China Manufacturer. 1. Solar panel :10w 223*347*18MM, polycrystalline 2.LED : Bridgelux 60PCS 30W LED ,3000-6000K 3.Lithium Battery:9.6V 6.5Ah 4.Control model;:radar induction/light control/time control/remote control 5.Sensor distance :5-8m 6.Installation height:3m-5m 7.Working time: > 7 days. Product features 1. [Low import china solar powered street light from various high quality chinese solar powered street light suppliers & manufacturers on globalsources.com. smart led 70w split solar garden light on jumia outdoor street pole with battery 30w 60w 90w. us$ 18.99 - 19.99 / unit (20w) solar street light/garden light polycrystalline silicon panelGet a Quote Get the News Articles and News Stories for December, 2015. Find What happened in News for December, 2015. Explore the NDTV.com Daily News and News Archives Sitemap for latest news & news videos includes India, South India, News from Indian Cities, …Get a Quote Academia.edu is a platform for academics to share research papers. energy saving smd led high bay lights 150 watt for indoor / outdoor industrial lighting. all products. led street light fixtures (134) led street light housing (104) led high bay lights (36) ufo high bay lights (24) urban led lighting (14) smart led solar streetlamp for street lighting (7) aluminum led street light (18) outdoor led street lights (69)Get a Quote Mar 01, 2018· The final goal is the production of neutron rich RIBs with masses ranging from 30 to 150 by using primary beams of protons, deuterons and light ions with energy of 100 MeV and 100 kW power. This project is expected to be developed in about 10 years from new and intermediate milestones and experiments are foreseen and under consideration for theGet a Quote。Get a Quote light dark matter, which can be made as light as a few MeV [100]. It is important to note that such light WIMPs are challenging to probe via direct scattering of galactic DM particles on atoms [101], and therefore alternative strategies aimed covering this mass range must be developed.Get a Quote Instantly bright. Don't wait for bulbs to warm up. Get your light right away with the flip of a switch. Look for dimmable bulbs for the option to adjust brightness. Low usage cost. Spend only $1.20 per year to operate a 60-watt bulb. Shopping for LED Bulbs. With so many choices, how do you choose the right LED light bulbs for your needs? rfx no. 1000000493 - street and solar street lights in usa map with states in turkana east, kilifi south and embakasi south rfx no. 1000000494 - highmast floodlights in embu county, awendo and mwala constituencies addendum 001 - rfx no. 1000000477: supply, installation, testing commissioning of solar water pumping power systems to existing boreholes at nyeri countyGet a Quote
https://www.isabelle-revital.ch/9f17254a10f8e9258b22c63aba48eae9
CC-MAIN-2021-25
refinedweb
1,388
62.68
A wrapper package designed for running continuous integration (CI) build steps using Python 3.5+. Project description Managing cross platform build scripts for CI can become tedious at times when you need to e.g., maintain two nearly identical scripts install_deps.sh and install_deps.bat due to incompatible syntaxes. ci_exec enables a single file to manage this using Python. The ci_exec package provides a set of wrappers / utility functions designed specifically for running build steps on CI providers. It is - Logging by Default - Commands executed, including their full command-line arguments, are logged. This includes any output on stdout / stderr from the commands. The logging resembles what set -x would give you in a shell script. For commands that will take a long time, as long as output is being produced, this will additionally prevent timeouts on the build. - Failing by Default - Any command that does not succeed will fail the entire build. An attempt to exit with the same exit code as the command that failed will be performed. Meaning the CI provider will correctly report a failed build. - Convenient ci_exec affords users the ability to write shell-like scripts that will work on any platform that Python can run on. A simple example: from ci_exec import cd, which cmake = which("cmake") ninja = which("ninja") with cd("build", create=True): cmake("..", "-G", "Ninja", "-DCMAKE_BUILD_TYPE=Release") ninja("-j", "2", "test") Please refer to the full documentation for more information. Project details Release history Release notifications Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/ci-exec/
CC-MAIN-2019-26
refinedweb
266
57.98
I am trying to make a program that computes gross by using a class and three functions. When I try to run it, it gives me this error I think something is wrong with my set function and my int main function, any help would be appreciated. Code:#include <iostream> using namespace std; double payRate; int hours; class Employee { public: void set(double payRate, int hours); double pay(); void display(); private: int hours; double payRate; double Gross; }; int main() { Employee wage; cout << "What is the pay rate:"; cin >> payRate; cout << "How many hours worked:"; cin >> hours; wage.set(payRate, hours); wage.display(); } void Employee::set(double payRate, int hours) { cin >> payRate; cin >> hours; } double Employee::pay() { return Gross= payRate* hours; } void Employee::display() { cout << "The Gross wage is: " << Gross; }
https://cboard.cprogramming.com/cplusplus-programming/114780-determine-gross-wage-using-class.html
CC-MAIN-2017-30
refinedweb
129
64.04
From: Edward Diener (eddielee_at_[hidden]) Date: 2005-04-27 15:25:11 JOAQUIN LOPEZ MU?Z wrote: > Current tests for Comeau 4.3 show this problem: > > "G:\boost\boost/test/impl/test_tools.ipp", line 136: error #135: > namespace > "std" has no member "va_list" > std::va_list args; > > Looks like va_list is not properly injected into std:: > (yet BOOST_NO_STDC_NAMESPACE is *not* defined > for this platform, and I guess for a good reason.) > I've googled for this and found some discussions at the > Boost list on the very same problem, with no definitive > answer :( > > 1. Could anyone take a look at Comeau stdlib <cstdargs> > and see what's going on? It is <cstdarg>, and in libcomo for Comeau 4.3.3 I see: #include <stdarg.h> namespace std { using ::va_list; } Comeau uses the back end compiler for the C headers, such as stdarg.h, although it provides a few of its own for various compilers evidently to make up for some compiler deficiences. I do not see any stdarg.h among the latter. What is the back end compiler being used for the failing test ? Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2005/04/85208.php
CC-MAIN-2020-10
refinedweb
205
77.74
This post is a continuation from Mutability model for ResourceType and friends. At this point I'm just going to geek out on design options - this doesn't really apply to the WCF Data Services API. The problem is this: let's say we want to have two immutable values that reference each other. // Obvious way, but not immutable. CircularRef a = new CircularRef(); CircularRef b = new CircularRef(); a.theOtherOne = b; b.theOtherOne = a; Here we're changing the values of 'theOtherOne' property, so it's clear that the instances aren't immutable - they will have a null before we set the property, and then a reference after, so it's changing. We can try saving this case with constructors, but we only get half-way there - we can't make the references circular. // The constructor takes value for theOtherName, // but the second instance can't grab ahold of 'a'. CircularRef a = new CircularRef(new CircularRef()); Here is a solution that is syntactically correct but I consider a rather poor design. It turns out that in C#, you are allowed to pass instances of this to other parts of the program before your constructor has finished running. This little sample shows how to leverage that. class C { public static void Main() { var a = new CircularRef(); Console.WriteLine("Done!"); a.WriteOut(new HashSet<CircularRef>()); } } public class CircularRef { private static int idGen; private readonly int id; private readonly CircularRef theOtherOne; public CircularRef() { this.theOtherOne = new CircularRef(this); this.id = idGen++; } public CircularRef(CircularRef theOtherOne) { this.theOtherOne = theOtherOne; this.id = idGen++; } public void WriteOut(HashSet<CircularRef> visited) { // We use the HashSet to ensure we don't keep looping. if (visited.Add(this)) { Console.WriteLine("Found " + this.id); this.theOtherOne.WriteOut(visited); } else { Console.WriteLine("Breaking loop at " + this.id); } } } If you run this program, you can see that the references are indeed set up to point to each other. Done! Found 1 Found 0 Breaking loop at 1 The reason why I don't like this, however, is that the readonly keyword on the fields can lead you to believe that the type works like an immutable type; in fact, you can see all fields are assigned by the time the constructor is done, another good indication. However, a subtle "gotcha" is introduced: during construction, one of the instances gets to see a half-initialized, mutating version of the other one, so all the guarantees go out the window. In our sample, the second instance sees the first instance with an id set to the default value of zero, but then at some point that id value is going to change, when the first instance finished construction with the idGen++ assignment. There are other problems with this design as well: to initialize the second instance, you need to pass the parameters through the first constructor, so it's a brittle design and small changes will likely ripple through multiple places in the code base. Well, this post is running longer than I intended, and I didn't even got to the use of names / tokens / monikers in reference handling, which is what I intended. So I'll close off with a promise to continue next time and the following bit of advise. Good rule of thumb: don't expose the this instance from constructors to the rest of the world unless you are very, very careful, and your objects can deal with getting calls or being looked at before construction has finished. Enjoy!
https://blogs.msdn.microsoft.com/marcelolr/2010/04/19/immutable-instances-with-circular-references/
CC-MAIN-2018-13
refinedweb
579
60.55
explanation ; Hi,can I know what is the meaning for the above coding?I have find the explanation in internet,but not very clear about it. Thank Which is the good website for struts 2 tutorials? Which is the good website for struts 2 tutorials? Hi, After... for learning Struts 2. Suggest met the struts 2 tutorials good websites. Thanks Hi, Rose India website is the easily and quickly. Developer can write very extensible and high Can u giva explanation of Struts with annotation withy an example? Hi friend, For solving the problem Warnings ...About FormBeanConfig & about Cancel Forward - Struts Struts Warnings ...About FormBeanConfig & about Cancel Forward Hi Friends... I am trying a very small code samples of Contact Application i...)WARNING: Unable to find 'cancel' forward. the contents of struts-config.xml About Struts processPreprocess method - Struts About Struts processPreprocess method Hi java folks, Help me... that the request need not travel to Action class to find out that the user is not valid? Can I access DB from processPreprocess method. Hi Struts - Framework /struts/". Its a very good site to learn struts. You dont need to be expert... to learn and can u tell me clearly sir/madam? Hi Its good...Struts Good day to you Sir/madam, How can i start application,and why would you use it? Hi mamatha, The main aim of the MVC... knows about all the data that need to be displayed. It is model who is aware about.... ----------------------------------------------- Read for more information. Struts - Struts for later use in in any other jsp or servlet(action class) until session exist...Struts hi can anyone tell me how can i implement session tracking in struts? please it,s urgent........... session tracking? you mean About struts About struts How will we configure the struts - Framework using the View component. ActionServlet, Action, ActionForm and struts-config.xml...Struts Good day to you Sir/madam, How can i start struts application ? Before that what kind of things necessary Struts Books . The book starts with an explanation of why Struts is a "good thing" and shows... covers everything you need to know about Struts and its supporting technologies...: you will learn to use Struts very effectively.John Carnell hi i would like to have a ready example of struts using "action class,DAO,and services" for understanding.so please guide for the same. thanks Please visit the following link: Struts Tutorials, 1) can we write two controller classes in struts struts struts Hi,... please help me out how to store image in database(mysql) using struts Struts Code - Struts Struts Code How to add token , and encript token and how decript token in struts. Hi friend, Using the Token methods The methods we care about are: * saveToken(HttpServletRequest req) * isTokenValid Hi Hi Hi How to implement I18N concept in struts 1.3? Please reply to me Struts Struts What is Struts? Hi hriends, Struts is a web page... developers, and everyone between. Thanks. Hi friends, Struts is a web... developers, and everyone between. Thanks. Hi friends, Struts struts - Struts struts I want to know clear steps explanation of struts flow..please explain the flow clearly.2.1 - Struts 2.2.1 Tutorial and testing the example Advance Struts Action Struts Action... About Struts 2.2.1 Login application Create JSP file Create Action class Add configuration in struts.xml file... properties of the respective Action class. Finally, the same Action instance can you please help me to solve...*; import org.apache.struts.action.*; public class LoginAction extends Action...; <p><html> <body></p> <form action="login.do"> Java - Struts Java What is the difference between Struts and Struts2. Pls explain with a simple example. HI, Please check to learn more about the differences validation - Struts validation Hi Deepak can you please tell me about struts validations perticularly on server side such as how they work whats their role etc.? thank Can you suggest any good book to learn struts Can you suggest any good book to learn struts Can you suggest any good book to learn struts Hello - Struts Hello Hi Friends, Thakns for continue reply I want to going with connect database using oracle10g in struts please write the code and send me its very urgent only connect to the database code Hi explanation - Java Beginners explanation I have create small java appication. I don't know about garbage collection, memory leak. I want reference about these and how to use my java application. Hi Friend, Please visit the following links Hello I like to make a registration form in struts inwhich... compelete code. thanks Hi friend, Please give details with full.... Struts1/Struts2 For more information on struts visit to : validation - Struts validation Hi, Can you give me the instructions about... single time only. thank you Hi friend, Read for more information, Thanks Struts - Struts Struts Hi All, Can we have more than one struts-config.xml... in Advance.. Yes we can have more than one struts config files.. Here we use SwitchAction. So better study to use switchaction class Struts Articles . 4. The UI controller, defined by Struts' action class/form bean... it. Struts is a very popular framework for Java Web applications... application. The example also uses Struts Action framework plugins in order struts - Struts struts Hi, I need the example programs for shopping cart using struts with my sql. Please send the examples code as soon as possible. please send it immediately. Regards, Valarmathi Hi Friend, Please Hello I have 2 java pages and 2 jsp pages in struts.... Thanks in advance Hi friend, Please give full details with source code to solve the problem. For read more information on Struts visit about db - Struts About DB in Struts I have one problem about database. i am using netbeans serveri glassfish. so which is the data source struts config file should be? Please help me... are different.So, it can be handle different submit button : class MyAction extends? are now preferring Struts based applications. Struts is good as it provides... Struts is very elegant framework based on the latest technologies of Java...What is a Struts? Understand the Struts framework This article tells you " flow - Struts struts flow Struts flow Hi Friend, Please visit the following links: Thanks Struts Validation - Struts Struts Validation Hi friends.....will any one guide me to use the struts validator... Hi Friend, Please visit the following links: http Hi good afternoon Hi good afternoon write a java program that Implement an array ADT with following operations: - a. Insert b. Delete c. Number of elements d. Display all elements e. Is Empty
http://roseindia.net/tutorialhelp/comment/11605
CC-MAIN-2014-41
refinedweb
1,102
68.26
Programming with databases is a fact of life for any seasoned programmer (read, “worth their salt”). From embedded databases like SQLite and LevelDB to server databases like PostgreSQL, data management is a fundamental part of any significant project. The first thing I should say here is skip the ORM and learn SQL. SQL is such a powerful tool to query and manage a database, and is far more performant thanks to 40 years of research and development. Ok, now that we’ve got that out of the way, the question becomes, how do we embed SQL into our programming language of choice? What you’ll typically see in tutorials is the direct embedding of strings into the codebase. While this works, and is nice because now your SQL is also versioned, it can also create many security related complications that I won’t go into as well as an organizational nightmare. So you’ve got to wrap your SQL statements somehow. Unfortunately, there is no standard answer for this because there are a lot of questions including connection management for performance; size and frequency of queries, etc. Each use case has it’s own optimization. Therefore, I’d like to look at a simple wrapper for a Query, as shown in the Gist below and discussed after the code. As you can see from the example, we have a routine query where we want to get the orders between a particular time range for a customer identified by their email. Presumably this query will be executed many times in the course of our program, so the factory gives us the ability to run many different queries simultaneously. Basically what this method gets us is the wrapping of a parameterized query — e.g. a query that uses PEP 249 string formatting to add arguments on execution. Calls to query’s iterator initiate a connection to the database and execute the query, returning the results of fetch row. By using the factory method, this technique basically gives us the ability to execute many queries with different parameters over the course of program execution, such that each query has a separate connection, cursor, and error handling. There are also two techniques involving the engine and the query that I generally use. The engine in this case connects to a particular database. For a SQLite database you have to specify a path on disk, for a PostgreSQL database a url, username, and password. My preference is to use a database url but you’ll note that the Query object is database-agnostic. Although beyond the scope of this post, a simple Engine can be created as follows: import psycopg2 class PostgreSQLEngine(object): def __init__(self, database, user, password, host, port): self.params = { 'database': database, 'user': user, 'password': password, 'host': host, 'port': port, } def connect(self): return psycopg2.connect(**self.params) def query_factory(sql, **kwargs): def factory(): return Query(sql, PostgreSQLEngine(**kwargs)) return factory You could then create an engine object that reads configuration details from Confire, parses a database URL, or selects from SQLite or PostgreSQL depending on which is available. Also, the Gist uses a query that is embedded as a docstring. I prefer to store my more complex SQL in .sql files and load them from disk. (Smaller queries I might have constants stored in a queries.py or similar). This changes the factory again: def query_factory(path, **kwargs): engine = PostgreSQLEngine(**kwargs) with open(path, 'r') as f: sql = f.read().strip() def factory(): return Query(sql, engine) return factory Advanced implementation of this particular technique will use: - Row format classes to return Python objects or namedtuples. - Context managers to ensure the connection to the database gets closed. - A connection pool as the engine to reuse connection objects. - Advanced error handling for not found or parameter errors. We do this so much that we plan to create a package called ORMBad which will implement engines and a more advanced query pattern. We just have to get around to doing it!
https://bbengfort.github.io/2016/01/query-factory/
CC-MAIN-2021-17
refinedweb
668
61.87
Post your Comment Java I/O Buffered Streams Java I/O Buffered Streams In this section we will discuss the I/O Buffered Streams. In Java programming when we are doing an input and output operation... stream classes and the other twos are the buffered character streams classes Java I/O Byte Streams Java I/O Byte Streams In this section we will discussed the I/O Byte Streams. This Stream handles the 8-bit binary input/output of data. Byte streams... I/O raw binary data the byte stream classes are defined. For all of the byte Classes and Interfaces of the I/O Streams Classes and Interfaces of the I/O Streams  ... then this exception to be occured. InterruptedIOException When the I/O... When the I/O operations to be failed then it occurs. NotActiveException/O Java I/O Character Streams Java I/O Character Streams In this section we will discuss the I/O Character... and for this Java provides the Character stream I/O. Character stream I/O... the character stream I/O the character stream classes are defined. These classes Java I/O Examples Streams. Java I/O Buffered Streams In this section we will discuss the I/O Buffered Streams. Java I/O Data Streams... Streams In this section we will discussed the I/O Byte Streams. Java Java I/O Data Streams Java I/O Data Streams In this tutorial we will discuss the Java I/O Data Streams. To deal with the binary I/O of primitive data type values as well as the String values Java provided the support of Data stream. DataInput I/O stream class. I/O stream class. Explain the hierarchy of Java I/O stream class. Hierarchy of Java I/O streams Have a look at the following link: Java I/O Java I/O From the Command Line Java I/O From the Command Line In this section we will learn about the I/O from the command line in Java. Several times you can see that the programs runs..., by default. There are three Standard Streams which are supported by the Java I/O JAVA I/O Introduction The Java Input/Output (I/O) is a part of java.io package... in the package which are used for reading from and writing to byte streams, respectively. For more Details click the following links below : Java I/0 Complete i/o i/o java program using inputstream and outputstream Hi Friend, Try the following code: import java.io.*; class InputStreamAndOutputStream { public static void main(String[] args)throws i/o i/o java program using inputstream and outputstream Hi Friend, Try the following code: import java.io.*; class InputStreamAndOutputStream { public static void main(String[] args)throws Exception i/o i/o Write a Java program to do the following: a. Write into file the following information regarding the marks for 10 students in a test i. Matric no ii. Marks for question 1 iii. Marks for question 2 iv. Marks streams - Java Beginners . Java's input and output (I/O) is based on streams. For more information,visit... Friend, Streams are the convenient metaphor for reading and writing data..., another thread, or some other source. Furthermore streams can be filtered What is Java I/O? . How Files and Streams Work: Java uses streams to handle I/O operations... What is Java I/O? Introduction The Java Input/Output (I/O) is a part of java.io package Java i/o Java i/o How can you improve Java I/O performance Java I/O Changes in I/O Changes in I/O This is a new feature added in Java SE 6, which has the ability to read... is provided by java.io.Console Class which is newly added in JAVA SE 6. Reading java i/o operations java i/o operations how to write integer data to a file in java using random access file object or file writer or data outputstream i have already tried the write and writeInt methods....plz help Post your Comment
http://www.roseindia.net/discussion/46112-Java-I/O-Buffered-Streams.html
CC-MAIN-2014-41
refinedweb
680
66.84
Rainman Rainman is an experiment in writing drivers and handlers. It is a Ruby implementation of the abstract factory pattern. Abstract factories provide the general API used to interact with any number of interfaces. Interfaces perform actual operations. Rainman provides a simple DSL for implementing this design. Drivers & Handlers In Rainman, drivers represent abstract factories and handlers represent the interfaces those factories interact with. In simpler terms, drivers define what things you can do; handlers define how to do those things. Creating a driver Rainman drivers are implemented as Modules. They must be extended with Rainman::Driver and use the driver DSL to define their public API. An example Domain driver might look like this: require 'rainman' # The Domain module handles creating and deleting domains, and listing # nameservers module Domain extend Rainman::Driver # Register Domain::Abc as a handler. register_handler :abc # Register Domain::Xyz as a handler. register_handler :xyz # Register Domain.create as a public method define_action :create # Register Domain.destroy as a public method; Alias Domain.delete to it define_action :destroy, :alias => :delete # Register Domain.cancel as a public method; it delegates to a handler's # :cancel_account method. define_action :cancel, :delegate_to => :cancel_account # Register Domain.namservers.list as a public method namespace :nameservers do define_action :list end end Implementing handlers Driver handlers are implemented as classes. They must be within the namespace of the driver Module. Using the example above, here are example handlers for Abc and Xyz: class Domain::Abc # Public: Creates a new domain. # # Returns a Hash. def create(params = {}) end # Public: Destroy a domain # # Returns true or false. def destroy(params = {}) end # Public: Cancel a domain account # # Returns true or false. def cancel_account(params = {}) end end class Domain::Xyz # Public: Creates a new domain. # # Returns a Hash. def create(params = {}) end # Public: Destroy a domain # # Returns true or false. def destroy(params = {}) end # Public: Cancel a domain account # # Returns true or false. def cancel_account(params = {}) end end The example driver above also defined nameservers namespace with a list action (eg: Domain.nameservers.list). To implement this, a Nameservers class is created within each handler's namespace: class Domain::Abc::Nameserver # Public: Lists nameservers for this domain. # # Returns an Array. def list(params = {}) end end class Domain::Xyz::Nameserver # Public: Lists nameservers for this domain. # # Returns an Array. def list(params = {}) end end Handler setup If your handler requires any sort of setup that can't be handled in your initialize method (e.g. you're subclassing and can't override initialize), you can define a setup_handler method. Rainman will automatically call this method for you after the class is initialized. class Domain::Abc attr_accessor :config def initialized @config = { :username => 'username', :password => 'password' } end end class Domain::Xyz < Domain::Abc def setup_handler @config[:username] = 'other' end end Using a driver With a driver and handler defined, the driver can now be used in a few different ways. General A driver's actions are available as singleton methods. By default, actions are sent to the current handler, or a default handler if a handler is not currently in use. # Create a domain Domain.create({}) # Destroy a domain Domain.destroy({}) Domain.delete({}) # Cancel domain acconut Domain.cancel # List domain nameservers Domain.nameservers.list({}) Changing handlers It is possible to change the handler used at runtime using the with_handler method. This method temporarily changes the current handler. This means, if you have a default handler set, and use with_handler, that default handler is preserved. Domain.with_handler(:abc) do |driver| # Here, current_handler is now set to :abc driver.create end You can also change the current handler for the duration of your code/session. Domain.set_current_handler :xyz Domain.create # create an :xyz domain Domain.set_current_handler :abc Domain.create # create an :abc domain Domain.transfer # transfer an :abc domain It is highly suggested you stick to using with_handler unless you have a reason. Convenience predicate methods are added for each handler to determine if it is in use: Domain.abc? Domain.xyz? Including drivers in other classes A driver can be included in another class and its actions are available as instance methods. class Service include Domain end s = Service.new s.create s.destroy s.delete s.cancel s.nameservers.list s.with_handler(:abc) do |handler| handler.create end s.set_current_handler :xyz s.create If you want to namespace a driver in another class, it's as easy as: class Service def domain Domain end end s = Service.new s.domain.create s.domain.destroy s.domain.delete s.domain.cancel s.domain.nameservers.list s.domain.with_handler(:abc) do |handler| handler.create end s.domain.set_current_handler :xyz Note on Patches/Pull Requests - Fork the project. - Make your feature addition or bug fix. - Add tests for it. This is important so I don't break it in a future version unintentionally. - Commit, do not bump version. (If you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull). - Send me a pull request. Bonus points for topic branches. Contributors
http://www.rubydoc.info/github/site5/rainman/
CC-MAIN-2014-49
refinedweb
840
51.95
Hello ! Again, please CC: any replies to me as I have not _still_ received any acknowledgement from mailing list manager. :-) I have checked out latest subversion source code and moved it to fresh box to try building current version from scratch. I have one question and a couple of suggestions to authors. I have downloaded and installed httpd-2.0, it is placed in /local/apache2. Configure script when running with arguments --with-apxs=/usr/local/apache2/bin/apxs --enable-maintainer-mode --with-apr-includes=/local/apache2/include --with-apr-libs=/local/apache2/lib fails to locate and use APR. File config.log states: configure:2258: Apache Portable Runtime (APR) library configuration configure:2442: checking for apr.h configure:2452: gcc -E conftest.c configure:2449: apr.h: No such file or directory configure:2458: $? = 1 configure: failed program was: #line 2448 "configure" #include "confdefs.h" #include <apr.h> configure:2477: result: no Somewhy it doesn't pass external -I argument to gcc (specified in --with-apr-includes). What do I do wrong or miss ? And several points to developers from stranger's point of view (as I am still newbie to subversion and it's hairy build process ;-) I cannot send patches and I am not even sure that I am right). Files INSTALL, HACKING and notes/dav_setup.txt are not simple to understand for beginner. Some of them refer to others and describe overlaying stages of build process. User has to jump over them and select parts to read and follow. It would be nice to have one file for instructions on how to install from working copy, one file describing what should be _additionally_ done for server version. Options passed to build utilities in examples should be described (what exactly means --enable-maintainer-mode ?). Each component of a product should be briefly described for USER. User has to understand what parts of system he needs without getting into details of its functioning. (If you need server part, you need: httpd-2.0, neon, etc). User should be able to figure out exact sequence of actions he should perform in 5 minutes of reading. Again, I am not flaming but trying to help development process of subversion as I'm yet new to it and my suggestions may help other users to stick with subversion. I would be glad to discuss points I've figured out in this posting and even contribute later when I'll get a bit deeper in all this stuff. --.
http://svn.haxx.se/dev/archive-2001-11/0425.shtml
CC-MAIN-2015-32
refinedweb
416
66.54