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
SYNOPSISpackage require Tcl 8.0package require Pcap 2.0.0 - pcap_open ?-offline? ?-nopromisc? ?-caplength length? ?-filter filter? fileName|deviceName - lookupdev - lookupnet deviceName - getPacket pcapChannel - packetToString packet - printPacket packet - savefile pcapChannel ?on|off? - datalink pcapChannel - dump_open pcapChannel dumpFileName - dump pcap_dumper packet - dump_close pcap_dumper - version DESCRIPTIONtclPcap is a set of Tcl commands that provide an interface to the pcap packet capture library, available on a wide variety of platforms. This extension does this by creating a new channel type called pcap. This allows for very easy access to the library. All new commands added to the interpreter are in the pcap:: namespace. - pcap_open ?-offline? ?-nopromisc? ?-caplength length? ?-filter filter? fileName|deviceName - Creates a new channel that can be used to read captured packets. This command returns the name of the new channel. - -offline - The -offline flag to pcap_open indicates that data will not be captured from a network device. Instead, a file name will be given that is the name of a capture file to read. This capture file could have been created by tclpcap or tcpdump (or any other program that uses libpcap). - -nopromisc - The -nopromisc option to pcap_open tells tclpcap not to open the capture device in promiscuous mode. The option has no effect if -offline is given. - -caplength length - The -caplength option to pcap_open specifies the number of bytes of each frame to capture. The default value is 1500. If a negative number is given, the default value will be used. - -filter filter - The -filter option pcap_open specifies a filter string that is to be set for this capture. The syntax of the filter is as documented in the tcpdump man page. If no filter is specified, the string "default" is used, which will capture all packets on the network. If the filter cannot be applied to the capture device, pcap_open will throw an error. - fileName|deviceName - The last argument to pcap_open is the name of the network device to capture from, unless -offline has been given. In that case it is the name of a capture file to read from. The special deviceName of "any" will cause all network interfaces to be used for captures. - lookupdev - This calls pcap_lookupdev and returns the name of a network device that can be used with pcap_open. The loopback interface is ignored, and the lowest numbered unit is the one returned (assuming multiple devices). - lookupnet deviceName - This calls pcap_lookupnet with the supplied network deviceName. The command returns a list containing the network address as the first element and the netmask as the second element. - getPacket pcapChannel - This command takes the name of a pcapChannel that was opened with pcap_open as an argument. It reads the next available packet and returns that in a list. The first element of the list is a header containing the timestamp and length of the packet. The next element is the actual data itself. The data is a binary string, so it is not useful to print it out. See packetToString and printPacket. It is possible for getPacket to be unable to read a packet. In this case, an empty list will be returned. The caller should not interpret this to mean that an end of file has been reached (if reading offline) or that the network interface is down. The eof command should be used to detect this. An empty list could be returned even if the channel is in blocking mode. - packetToString packet - This command takes a packet, as returned from getPacket, as an argument and returns the captured data as a string. - printPacket packet - This command takes a packet, as returned from getPacket, as an argument and prints the hex values to stdout. - savefile pcapChannel ?on|off? - This turns on or off the dumping of the captured packets to a file. The name of the capture file is configured through fconfigure with the -savefile option. If neither on nor off are specified, then the current state is returned. - datalink pcapChannel - This calls pcap_datalink which returns the link layer type of the pcapChannel. The return value is a list. The first element of the list is a string representing the name of the datalink. This corresponds to what is listed in the pcap man page. E.g., DLT_EN10MB. The second element of the list is a longer version of the datalink that is more human readable. E.g., Ethernet. - dump_open pcapChannel dumpFileName - dump pcap_dumper packet - dump_close pcap_dumper - version - This calls pcap_lib_version which returns a string containing version information of the pcap library. CONFIGURATION OPTIONSThe fconfigure command can be used to query and modify several parameters of the channel created by pcap_open. - -savefile fileName - The -savefile option specifies the name of a file that is to be used to save dumped packets to. This option does not actually start dumping data to the file. The savefile command needs to be called to start saving captured packets. Attempts to change the -savefile while packets are being dumped will result in an error. The value of -savefile defaults to an empty string. - -filter filter - The -filter option allows the filter used by pcap to be changed. This option corresponds to the -filter option of the pcap_open command. By default, the filter captures all packets. EXAMPLE LIMITATIONS SEE ALSOtcpdump, pcap(3), fconfigure(n)
http://wiki.tcl.tk/14371
CC-MAIN-2017-09
refinedweb
874
65.32
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char revid[] = "$Id: os_fid.c,v 1.1.1.1 2003/02/15 04:56:09 zarzycki Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <sys/stat.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <stdlib.h> #include <string.h> #include <unistd.h> #endif #include "db_int.h" #define SERIAL_INIT 0 static u_int32_t fid_serial = SERIAL_INIT; /* * __os_fileid -- * Return a unique identifier for a file. The structure * of a fileid is: ino(4) dev(4) time(4) pid(4) extra(4). * For real files, which have a backing inode and device, the first * 16 bytes are filled in and the extra bytes are left 0. For * temporary files, the inode and device fields are left blank and * the extra four bytes are filled in with a random value. * * PUBLIC: int __os_fileid __P((DB_ENV *, const char *, int, u_int8_t *)); */ int __os_fileid(dbenv, fname, unique_okay, fidp) DB_ENV *dbenv; const char *fname; int unique_okay; u_int8_t *fidp; { struct stat sb; size_t i; int ret; u_int32_t tmp; u_int8_t *p; /* Clear the buffer. */ memset(fidp, 0, DB_FILE_ID_LEN); /* On POSIX/UNIX, use a dev/inode pair. */ retry: #ifdef HAVE_VXWORKS if (stat((char *)fname, &sb) != 0) { #else if (stat(fname, &sb) != 0) { #endif if ((ret = __os_get_errno()) == EINTR) goto retry; __db_err(dbenv, "%s: %s", fname, strerror(ret)); return (ret); } /* * Initialize/increment the serial number we use to help avoid * fileid collisions. Note that we don't bother with locking; * it's unpleasant to do from down in here, and if we race on * this no real harm will be done, since the finished fileid * has so many other components. * * platforms, and has few * interesting properties in base 2. */ if (fid_serial == SERIAL_INIT) __os_id(&fid_serial); else fid_serial += 100++; if (unique_okay) { /* * We want the number of seconds, not the high-order 0 bits, * so convert the returned time_t to a (potentially) smaller * fixed-size type. */ tmp = (u_int32_t)time(NULL); for (p = (u_int8_t *)&tmp, i = sizeof(u_int32_t); i > 0; --i) *fidp++ = *p++; for (p = (u_int8_t *)&fid_serial, i = sizeof(u_int32_t); i > 0; --i) *fidp++ = *p++; } return (0); }
http://opensource.apple.com//source/BerkeleyDB/BerkeleyDB-6/db/os/os_fid.c
CC-MAIN-2016-36
refinedweb
371
67.86
I think we should somehow explicitely catch all exceptions > we are expecting (maybe near the main loop) and the > exception handler could feed them to the backend. > Reasons: > 1) This looks like the most Pythonic solution to me: > exceptions are ment to by caught by "try: ... except: ..." > statements > 2) This might open a way to differentiate between expected > exections (opening a file with a user-supplied file name > might fail, if the user mistyped the name -> User should > be told and asked for another file name) and unexpected > ones which indicate programming errors. > 3) Easier to understand flow of control. If you follow a > chain of callers through the source code you can see which > exections are caught at which place, whereas the > except_hook mechanism is more "magical". > What do you think? I think in the backend and other matplotlib code where we know how to handle the exception, this makes sense. Eg, if backend_gtk gets a IOError on some file, it can catch it and request a new filename. We should catch and handle exceptions where we can. Buy I'm thinking about the matlab interface. There are two problems in matlab.py: 1) There are practically no exceptions that we can handle at that level so the best we can do it forward it on the user and 2) there is no single point to plug in a master exception handler. Consider the canonical matlab interface function def plot(*args, **kwargs): ret = gca().plot(*args, **kwargs) draw_if_interactive() gca().plot makes a series of deeply nested calls, as does draw_if_interactive. With these two calls, a substantial number of the total methods defined in matplotlib are actually called (format string parsers, line instantiation, transformations, clipping, gcs, renderers, font finding, etc, etc....) There are a lot of potential exceptions to be thrown, and tracking down all of them would be a big task. And then once we catch them what could we do with them? The problem is compounded by the fact that the solution would have to repeated for *every* matlab interface function separately, which looks like it would lead to a big tangle of unmanageable code across the whole module. Perhaps I'm missing the obvious thing and not understanding your suggestion. But form my end at the level of the matlab interface, the best we can do is get a helpful, descriptive error message to the user. Did you have another approach in mind? JDH
https://discourse.matplotlib.org/t/propagation-of-error-messages-in-matplotlib/1605
CC-MAIN-2021-43
refinedweb
407
70.02
Creating a Registration Web Service Once you've generated some registration keys, you'll need some mechanism for users to validate the key. In this example, we'll create a Web service that communicates with a SQL Server database on the server that contains registration keys. Create the Registration Database The registration database will be stored on SQL Server. For the purposes of the example, we are running SQL Server 2005 Express Edition on Windows 2003 Server with Internet Information Services (IIS). In a production environment, you might run SQL Server and IIS on separate computers. Begin by creating a new database on SQL Server called AppReg. Create a new table in this database called PID with the following columns: The id column is an IDENTITY column similar to the AutoNumber data type in Access. The pidkey column is used to store the actual registration key. The used column is a bit field that will be set to True when a successful registration occurs. This is also used to prevent existing registration keys from being reused. Add some data to this table. The registration keys that you add will be used later. The Web service will connect to the database using SQL authentication. Make sure SQL authentication is enabled on the SQL Server. Add a new user to the SQL Server called wsuser with SELECT and UPDATE permissions on the PID table. Create the Web Service We will write the Web service using C# in Visual Studio 2005. Follow these steps to set up the Web service and prepare it for code. - Launch Visual Studio 2005. - Click File, then click New, and choose Web Site. - Choose ASP.NET Web Service in the New Web Site dialog box. - Change the location to HTTP and enter the address of a Web server to which you have access as follows: - Rename the Service.asmx file in the Web site to Registration.asmx. - In the Registration.asmx file, change the CodeBehind attribute of the Web service to point to Registration.cs, and the Class attribute from Service to Registration. - Rename the Service.cs file in the App_Code folder in the Web site to Registration.cs. - In the Registation.cs source file, rename the class from Service to Registration. - Remove the HelloWorld method that appears in the Registration.cs source file. - Change the Namespace property of the WebService attribute of the class. - Select Add New Item from the Website menu in Visual Studio and choose Web Configuration File, and then click OK. - Edit the web.config file to add the following code beneath the system.web element in the configuration file. <webServices> <protocols> <add name="HttpGet"/> </protocols> </webServices> With the core steps out of the way, we can add some code. Begin by adding the following using statements to the top of the Registration.cs source file: using System.Data; using System.Data.SqlClient; Add the following private data to the class: SqlConnection m_connection = null; Add the following WebMethod to the class. This is the actual method that will be executed using the Web service. [WebMethod] public bool IsValidPIDKey(string pidKey) { try { if (GetPIDCount(pidKey) > 0) { UpdatePIDRegistration(pidKey); return true; } return false; } catch (Exception) { throw; } finally { m_connection.Close(); } } This method calls two helper methods. The first method, GetPIDCount, returns the number of unused registration keys that match the specified key in the PID table. private int GetPIDCount(string pidKey) { string connString = "Data Source=<SQLServerName>"; connString += ";Initial Catalog=AppReg"; connString += ";User ID=wsuser"; connString += ";Password=<YourPassword>"; // this is the actual action we want to take m_connection = new SqlConnection(connString); m_connection.Open(); // build the command text string commandText = string.Format("SELECT COUNT(*) FROM " + "pid WHERE used = 0 AND pidkey = {0}", pidKey); SqlCommand command = new SqlCommand(commandText); command.Connection = m_connection; command.CommandType = CommandType.Text; // return return (int)command.ExecuteScalar(); } The next method, UpdatePIDRegistration, updates the PID table when a registration key is used: private void UpdatePIDRegistration(string pidKey) { if (m_connection.State == ConnectionState.Closed) { m_connection.Open(); } string commandText = string.Format("UPDATE pid SET used = 1 WHERE " + "pidkey = {0}", pidKey); SqlCommand command = new SqlCommand(commandText); command.Connection = m_connection; command.CommandType = CommandType.Text; // execute command.ExecuteNonQuery(); } Save the source file and build the Web site.
http://sourcedaddy.com/ms-access/creating-registration-web-service.html
CC-MAIN-2017-47
refinedweb
694
51.34
wq.io provides a consistent interface for working with data from a variety of common formats. However, it is not possible to support every conceivable file format and data structure in a single library. Because of this, wq.io is designed primarily to be customized and extended. To facilitate fully modular customization, the wq.io APIs are designed as combinations of a BaseIO class and several mixin classes. The BaseIO class and mixins break the process into several steps: fileproperty on the instance fileproperty and saves it to a dataproperty, which should almost always be a listof dicts. data, e.g. by transforming each row into a namedtuplefor convenience. These steps and their corresponding classes are detailed in the following pages. When writing to a file, the above steps are done more or less in reverse: the Mapper transforms data back into the dict format used in the data list; and the Parser dumps the data into a file-like object prepared by the Loader which then writes the output file. There are a number of pre-mixed classes provided by wq.io's top level module. By convention, each pre-mixed class has a suffix "IO", e.g. ExcelFileIO. (Note that IO in this context is a reference to wq.io, not Python's built-in io module or its StringIO class.) The class names provide hints to the mixins that were used in their creation: for example, JsonFileIO extends FileLoader, JsonParser, TupleMapper, and BaseIO. Note that all of the pre-mixed classes extend TupleMapper, and all IO classes extend BaseIO by definition. To extend wq.io, you can subclass one of these pre-mixed classes: from wq.io import JsonFileIO class MyJsonFileIO(JsonFileIO): def parse(self): # custom parsing code... ... or, subclass one of the mixins and mix your own class: # Load base classes from wq.io.base import BaseIO from wq.io.loaders import FileLoader from wq.io.parsers import JsonParser from wq.io.mappers import TupleMapper # Equivalent: # from wq.io import BaseIO, FileLoader, JsonParser, TupleMapper # Define custom mixin class class MyJsonParser(JsonParser): def parse(self): # custom parsing code ... # Mix together a usable IO class class MyJsonFileIO(FileLoader, JsonParser, TupleMapper, BaseIO): pass Note that the order of classes is important: BaseIO should always be listed last to ensure the correct method resolution order. You can then use your new class like any other IO class: for record in MyJsonFileIO(filename='file.json'): print record.id Last modified on 2015-02-17 04:39 PM Edit this Page | Suggest Improvement © 2013-2019 by S. Andrew Sheppard
https://wq.io/1.1/docs/custom-io
CC-MAIN-2020-05
refinedweb
427
58.38
16 July 2010 07:28 [Source: ICIS news] By Felicia Loo SINGAPORE (ICIS news)--Asian naphtha prices are likely to stay moribund for the rest of the year in the face of an armada of spot shipments from the Middle East and tepid demand, market sources said on Friday. This would make naphtha the worst performing oil product across the barrel, they said. On signs of poor market conditions, the price spread between first-half September and first-half October contracts sank to a contango of $7/tonne (€5.5/tonne) from a contango of $2/tonne early last week, while the naphtha crack spread against Brent crude futures plunged to a 13-month low of $60.20/tonne, ICIS data showed. The deeper the contango, the worst the market gets. And there seemed to be no end of the tunnel and prices would face more downward pressure, sources said. “Naphtha prices are freefalling. The market’s not getting any better, but worst,” said a naphtha trader in ?xml:namespace> The market was reeling from the repercussions of a recent cracker outage in Meanwhile “Spot demand from The other buyers have the last laugh at this point, sources said. “It’s a buyer’s market. There’s no doubt about it,” one source added. The company last bought a bigger volume of 100,000 tonnes of spot open-spec naphtha for first half of August delivery, at discount levels of between $4.00-5.00/tonne to Sellers are feeling the pinch, as evident in a string of tender sales from For instance, Hindustan Petroleum Corp (HPCL) awarded its export tender for 25,000 tonnes of paraffinic naphtha at $3.50-5.00/tonne below With prices on a freefall, the Middle East producers were heavily squeezed and were forced to reverse some arbitrage shipments to The arbitrage economics, typically to move European naphtha to Globally, Asian naphtha is the worst performing oil product, traders said. “There are relentless exports from the There has been a surge in spot Middle East shipments to The upstream condensate market was hard hit by naphtha woes, with Downstream, ethylene prices weakened $10-30/tonne to $860-870/tonne CFR NE Asia, while the Asian toluene and xylenes market continued to wade in a glut. Current high operating rates of reformers at regional petrochemical facilities was also expected to keep the Asian aromatics market oversupplied through the rest of the year, sources said. A slowdown in Chinese economic growth in the second quarter signalled lower petrochemical demand from the world’s second-biggest energy consumer in the months ahead, they said. “Petrochemical margins are poor and there is more downside than upside. There isn’t any rush in buying,” said a trader. ($1 = €0.78) With additional reporting by Bohan Loh
http://www.icis.com/Articles/2010/07/16/9377009/Asian-naphtha-seen-bearish-for-the-rest-of-the-year.html
CC-MAIN-2015-06
refinedweb
467
59.03
pmc_switch_sclk_to_32kxtal(0);while (!pmc_osc_is_ready_32kxtal()) {} SUPC->SUPC_CR = ((((uint32_t)(0xA5)) << 24) | (SUPC_CR_XTALSEL)); while ((SUPC->SUPC_SR & SUPC_SR_OSCSEL) != SUPC_SR_OSCSEL); PS:the 32 kHz crystal is labeled Y2, not Y1. I followed a simpler way.Before to use the RTC, I switch to the 32 kHz with this code:Code: [Select]SUPC->SUPC_CR = ((((uint32_t)(0xA5)) << 24) | (SUPC_CR_XTALSEL));This sets the source clock of the Slow Clock Generator to the external clock (0xA5 is the password that MUST be written into the SUPC_CR register otherwhise the chip won't execute the switch).The datasheet suggests to wait for the chip changes the source clock by monitoring the change of the OSCSEL bit in SUPC_SR register. when that bit will be set to 1, the chip has done the change. This can be done with this code after the preivous codeCode: [Select]while ((SUPC->SUPC_SR & SUPC_SR_OSCSEL) != SUPC_SR_OSCSEL); /*** \brief Switch slow clock source selection to external 32k (Xtal or Bypass).** \note This function disables the PLLs.** \note Switching SCLK back to 32krc is only possible by shutting down the VDDIO* power supply.** \param ul_bypass 0 for Xtal, 1 for bypass.*/void pmc_switch_sclk_to_32kxtal(uint32_t ul_bypass){ /* Set Bypass mode if required */ if (ul_bypass == 1) { SUPC->SUPC_MR |= SUPC_MR_KEY(SUPC_KEY_VALUE) | SUPC_MR_OSCBYPASS; } SUPC->SUPC_CR |= SUPC_CR_KEY(SUPC_KEY_VALUE) | SUPC_CR_XTALSEL;}/*** \brief Check if the external 32k Xtal is ready.** \retval 1 External 32k Xtal is ready.* \retval 0 External 32k Xtal is not ready.*/uint32_t pmc_osc_is_ready_32kxtal(void){ return ((SUPC->SUPC_SR & SUPC_SR_OSCSEL) && (PMC->PMC_SR & PMC_SR_OSCSELS));} Actually, if you look at the function pmc_switch_sclk_to_32kxtal() in hardware/arduino/sam/system/libsam/source/pmc.c it does the exact same thing as the code you listed above. Since your answer is duplicating work, I fail to see how it is simpler. You are very correct that I was not waiting for the chip to complete the change. It did work fine for me without waiting for that bit Thanks! When I first tried your suggestion, I put the function in the point you suggested in your first post, and it didn't work.
http://forum.arduino.cc/index.php?topic=187128.0
CC-MAIN-2015-40
refinedweb
333
64.71
Opened 7 years ago Closed 7 years ago Last modified 7 years ago #15079 closed (fixed) django/core/cache/__init__.py missing import Description On creating settings.CACHE without a default, Django tries to raise ImproperlyConfigured, but cannot because it's not defined in django/core/cache/init.py. It needs: from django.core.exceptions import ImproperlyConfigured in the imports. Change History (3) comment:1 Changed 7 years ago by comment:2 Changed 7 years ago by comment:3 Changed 7 years ago by Milestone 1.3 deleted Note: See TracTickets for help on using tickets. (In [15214]) Fixed #15079 -- Added a missing import in the cache infrastructure. Thanks to jaylett for the report.
https://code.djangoproject.com/ticket/15079
CC-MAIN-2018-22
refinedweb
114
60.41
The Slider control as shipped with the Windows Phone Developer Tools has some problems, both due to how it was templated, and also because it was originally designed for the desktop, where mice are very good at hitting small targets. The visible Thumb was removed, and the invisible Thumb, even when you know where it is, is quite difficult to touch and drag. This means that most often, you end up pressing one of the RepeatButtons that will slowly increment or decrement the Slider’s value. That may be what you intended, but the Slider on the phone shouldn’t be used for precision adjustments. That will just frustrate the user. It is quite difficult to manipulate a horizontal Slider to get the maximum value, and if you somehow do manage to do that, you will find that you have moved the invisible Thumb off of the Slider, where it will be clipped, and you have to press the decrement button a while to get it back. I have re-templated the Slider, and added a small tick mark in the thumb for some sort of a visual cue, as when the Slider is on its minimum value, the darkened track is sometimes hard to see. It is easy to remove the tick if your application provides enough context to make it clear that there is a Slider and how to use it. I made the touchable area much wider—in fact, the Thumb has been expanded to cover the entire Slider area, so that the user can drag anywhere on the Slider without having to hit a small, invisible target. Note that the Slider should be used judiciously. Controls that are manipulated by dragging should not be placed in situations where they are on a parent that uses drags of the same orientation. So, for example, you should not put a horizontal Slider inside of a Panorama or Pivot control, and you should not put a vertical Slider inside of a ListBox (I have a hard time imagining why you’d want to do the latter.) Here is the new Slider template. I started with the template that I found in %ProgramFiles%\Microsoft SDKs\Windows Phone\v7.0\Design\System.Windows.xaml although I could have used Blend, added a Slider, and then right-clicked on it and selected “Edit Template…” and then “Edit a Copy…”. I put my template in App.xaml: - <Application - x:Class="SliderApp.App" - xmlns="" - xmlns:x="" - xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" - xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" - xmlns: - - <!--Application Resources--> - <Application.Resources> - - <ControlTemplate x: - <Rectangle/> - </ControlTemplate> - - <ControlTemplate x: - <Border Background="Transparent" Margin="-480,-18"> - <Rectangle Width="2" Height="6" Fill="{StaticResource PhoneForegroundBrush}"/> - </Border> - </ControlTemplate> - - <ControlTemplate x: - <Border Background="Transparent" Margin="-6,-800"> - <Rectangle Width="6" Height="2" Margin="24,0,0,0" Fill="{StaticResource PhoneForegroundBrush}"/> - </Border> - </ControlTemplate> - - <Style x: - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="BorderBrush" Value="Transparent"/> - <Setter Property="Maximum" Value="10"/> - <Setter Property="Minimum" Value="0"/> - <Setter Property="Value" Value="0"/> - <Setter Property="Margin" Value="{StaticResource PhoneHorizontalMargin}"/> - <Setter Property="Background" Value="{StaticResource PhoneContrastBackgroundBrush}"/> - <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="local:PhoneSlider"> - <Grid Background="Transparent"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x: - <VisualState x: - <VisualState x: - <VisualState x: - <Storyboard> - <DoubleAnimation Duration="0" Storyboard. - <DoubleAnimation Duration="0"="*"/> - <ColumnDefinition Width="0"/> - <ColumnDefinition Width="auto"/> - </Grid.ColumnDefinitions> - <Rectangle x: - <Rectangle x: - <RepeatButton x: - <RepeatButton x: - <Thumb x: - </Grid> - <Grid x: - <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="0"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - <Rectangle x: - <Rectangle x: - <RepeatButton x: - <RepeatButton x: - <Thumb x: - </Grid> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </Application.Resources> - - <Application.ApplicationLifetimeObjects> - <!--Required object that handles lifetime events for the application--> - <shell:PhoneApplicationService - Launching="Application_Launching" Closing="Application_Closing" - - </Application.ApplicationLifetimeObjects> - - </Application> This could also be placed in your page’s resources or in generic.xaml. You will note that in lines 28 and 39, I have am not using TargetType=”Slider”, but I have used the name of my subclassed type. This is because I had to use some code-behind to handle the Clip area. Since I am using negative margins to make the Thumbs cover the entire Slider, and I had to make the Thumbs large enough to cover the entire Slider, no matter where it is positioned, I need code to handle the clipping, otherwise the Thumbs would extend way beyond the Slider’s bounds, and cover up other controls. This is particularly a problem for vertical Sliders. Fortunately, the code-behind isn’t much: - using System.Windows; - using System.Windows.Controls; - using System.Windows.Media; - - namespace SliderApp - { - public class PhoneSlider : Slider - { - public PhoneSlider() - { - SizeChanged += new SizeChangedEventHandler(PhoneSlider_SizeChanged); - } - - void PhoneSlider_SizeChanged(object sender, SizeChangedEventArgs e) - { - if (e.NewSize.Width > 0 && e.NewSize.Height > 0) - { - Rect clipRect = new Rect(0, 0, e.NewSize.Width, e.NewSize.Height); - if (Orientation == Orientation.Horizontal) - { - clipRect.X -= 12; - clipRect.Width += 24; - object margin = Resources["PhoneHorizontalMargin"]; - if (margin != null) - { - Margin = (Thickness)margin; - } - } - else - { - clipRect.Y -= 12; - clipRect.Height += 24; - object margin = Resources["PhoneVerticalMargin"]; - if (margin != null) - { - Margin = (Thickness)margin; - } - } - - this.Clip = new RectangleGeometry() { Rect = clipRect }; - } - } - } - } It just has to set the margins and clip correctly, but the values depend on the value of Slider.Orientation. If your application was going to use Sliders with only one orientation, you could simplify the code-behind and the template, but you’d still need the code-behind for the clip. You can download a sample project that contains both horizontal and vertical Sliders, with the default and modified templates. Here’s what it looks like: You really have to try this on an actual Phone to appreciate how hard it can be to use the default Slider. The emulator makes it easy—we have all been trained to use a relatively high-precision mouse to hit small targets on the screen, and the invisible Thumb is quite easy to hit when using the emulator and mouse. Great post, thank you for putting it up 🙂 Great job. It make a huge difference and makes the control actually usable now 😉 Can you please clarify if this code is okay to use in commercial apps? @SmartyP – You are welcome to use any of the code on my blog however you would like. Hi Dave, I'm getting a run time "exception {"Invalid attribute value local:PhoneSlider for property TargetType. [Line: 28 Position: 36]"} System.Exception {System.Windows.Markup.XamlParseException} in the App.g.i.cs file. Any pointers? Am I missing anything? Hi Dave, Thanks a lot for your nice job. As you've permitted, I'm going to use your re-templated slider in my app. But I have a problem: your slider doesn't response properly in "Panorama" applications. As you may guess, trying to move the slider in those apps changes the current Panorama item. I tried to put that "e.Handled = true" in all of the mouse events of PhoneSlider, but nothing happened. Do you have any solution? Thanks again 😉 @Siavash – There is a problem with Panorama. It listens to all manipulations, whether they have been handled or not. But the UIX recommendation is to not use controls that require horizontal manipulation (like Slider) on Panoramas or Pivots, which use horizontal manipulation for navigation. Thanks for your info, I really appreciate it 😉 with best wishes Siavash Hey Dave, First off, thanks much for the helpful post! I'm noticing a strange issue with the slider in my app. Both the default and modified sliders are very choppy and seem to constantly lose the drag gesture so they require repeated "drags" to move the value from one side to the other. However, if I tombstone and return to the same page, the issue seems to be gone and they function like in your sample. The only page in the backstack when this occurs contains a panorama control. I experimented with removing that panorama control and that also seems to resolve the slide issue. Just for the clarity, the slider is NOT in a panoram but in a separate page navigated to FROM a panorama. Very strange… Any possible thoughts as to what might be happening here? -James Just been doing some more testing and traced my issue above to the use of the GestureListener from the PhoneToolkit on some of the visual elements inside the panorama control. When I remove those the slider on the subsequent page is smooth. Now… why is the Gesture Listener causing this issue… hmmm James, I've run into the exact same problem. Did you manage to find out why this bug occurs? It's a very weird one, considering how tombstoning seems to fix the issue… Hey Paul, Unfortunately no… I was just toying with using a slider and, so far, haven't actually needed it so I left this alone. In my case the tombstoning issue was a factor because the pages in my backstack (when I got to the page with the slider) were the ones using the Gesture Listener. Right after tombstoning on the slider page, those pages in the backstack weren't yet re-instantiated so the slider worked as expected but once I navigated backwards causing those pages with the gesture listener to be instantiated again I was back to the same slider issue. Sorry that I don't have anything to offer on the root issue at the moment… -James I also have the exact same problem as James and Paul. Has anyone found the source of this issue? BTW: My control is on a simple static page (not panorama, pivot). Thanks. Same problem here as Joe, James, and Paul: jumpy behavior, and thumb drags don't complete correctly. Not using GestureListener in my code, and not using Panorama, but I AM using a Bing map control below the slider. I'm guessing that the map control is using GestureListener. Anybody know a work around? MouseCapture? Et si on veut que cette valeur change dynamiquement sans utiliser le curseur (à partir d'un code inséré ) je veux dire une variable qui change à chaque fois et change l'état du slider? Et si on veut que le slider change sans l'utilisation du curseur ; ç-à-d on utilise une variable que le slider représente çà valeur d'une façon dynamique ? Thank you Dave! Great slider. It teached me how to make a usercontrol from another control! But can you tell one thing? I have horizontal slider as one of ScrollViewer child. If first touch position while I am scrolling was on a slider, Viewer is not scrolled and value of a slider is changing. Can I add something like checking of dragging X and Y and react only X > Y for horizontal slider and Y > X for vertical? Otherwise to "pass action" (?) to a parent (for example ScrollViewer). Hi Dave, Thanks for the post. It really helped in using a better slider in my application. I have a requirement of placing two sliders in a same row grid. But I am facing a small problem when i use two sliders in a same row of my "slider grid". Only the second slider moves, even when i try to move the first slider? It very strange i am unable to understand how the even of 1st slider goes to second one 🙁 Can you please help me? Thanks once again! Just for info: Regarding issue of Jaybo, Joe, James, and Paul. I had the same thing and solved it with advice from MarkChamberlain post 1/6/2011 1:19 AM from forums.create.msdn.com/…/436721.aspx which is "Not use the GestureService and use TouchPanel directly instead (GS is just a wrapper around TP)". How to use TouchPanel you may find here…/using-touchpanel-for-gestures-in-windows-phone-7
https://blogs.msdn.microsoft.com/devdave/2010/10/04/a-better-slider-for-windows-phone-7/
CC-MAIN-2019-35
refinedweb
1,963
55.13
perl5173delta - what is new for perl v5.17.3 This document describes differences between the 5.17.2 release and the 5.17.3 release. If you are upgrading from an earlier release such as 5.17.1, first read perl5172delta, which describes differences between 5.17.1 and 5.17.2. The loop controls last and redo, and the special dump operator, now allow arbitrary expressions to be used to compute labels at run time. Previously, any argument that was not a constant was treated as the empty string. $ENV{foo}=undefdeletes value from environ, like delete $ENV{foo} This facilitates use of local() with %ENV entries. In previous versions of Perl, undef was converted to the empty string.now aliases the global $_ Instead of assigning to an implicit lexical $_, given now makes the global $_ an alias for its argument, just like foreach. However, it still uses lexical $_ if there is lexical $_ in scope (again, just like foreach) [perl #114020]. CVf_*and GVf_*and more SV-related flag values are now provided as constants in the B::namespace and available for export. The default export list has not changed. -nobanneroption has been fixed, and formats can now be dumped. When passed a sub name to dump, it will check also to see whether it is the name of a format. If a sub and a format share the same name, it will dump both. B::PADLIST, which will be added in Perl 5.17.4. formatline are also now deparsed correctly. startform()or start_form(), and bogus "Insecure Dependency" warnings appearing with some versions of perl are now worked around. compress(), uncompress(), memGzip()and memGunzip()have been speeded up by making parameter validation more efficient. $VERSIONs have been suppressed. codes_in_verbatimoption is now disabled by default. See cpan/Pod-Simple/ChangeLog for the full details. /[s]/or /[s]/iare now optimized as if they did not have the brackets, i.e. /s/or /s/i. getservbyname(), setlogsock()and log levels in syslog(), together with fixes for Windows, Haiku-OS and GNU/kFreeBSD. See cpan/Sys-Syslog/Changes for the full details. timegm()and timelocal()to croak. dump, goto, lastand redo) have always had the same precedence as assignment operators, but this was not documented until now. $_warning against the use of lexical $_[perl #114020]. The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see perldiag. This message now occurs when a here document label has an initial quotation mark but the final quotation mark is missing. This replaces a bogus and misleading error message about not finding the label itself [perl #114104]. This error is thrown when a child pseudo-process in the ithreads implementation on Windows was not scheduled within the time period allowed and therefore was not able to initialize properly [perl #88840]. Attempts to put wide characters into environment variables via %ENV now provoke this warning. Support code relating to UTS global has been removed. UTS was a mainframe version of System V created by Amdahl, subsequently sold to UTS Global. The port has not been touched since before Perl 5.8.0, and UTS Global is now defunct.. The a2p build has been fixed for the HP C++ compiler on OpenVMS. \wnow matches the code points U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER). \Wno longer matches these. This change is because Unicode corrected their definition of what \wshould match. dump LABELno longer leaks its label.. s///now turns vstrings into plain strings when performing a substitution, even if the resulting string is the same ( s/a/a/). undefon a subroutine now clears call checkers. refoperator started leaking memory on blessed objects in Perl 5.16.0. This has been fixed [perl #114340]. useno longer tries to parse its arguments as a statement, making use constant { () };a syntax error [perl #114222].. print $xand print eval '$x'now produce the same output. This also allows "my $x if 0" variables to be seen in the debugger [perl #114018]. =and .), but only sometimes. Semicolons and low-precedence operators in format argument lines no longer confuse the parser into ignoring the line's return value. In format argument lines, braces can now be used for anonymous hashes, instead of being treated always as doblocks. /(?{...})/and qq/${...}/) [perl #114040]. require()could potentially read one or two bytes before the start of the filename for filenames less than three bytes long and ending /\.p?\z/. This has now been fixed. Note that it could never have happened with module names given to use()or require()anyway. require()has been made thread-safe on VMS. re_compile()API function, the entry point for perl's regex compiler, was accidentally changed in Perl 5.17.1 to operate on the current engine. This has now been restored to its former core-engine-specific state [perl #114302]. /$unchanging/). This has now been fixed. /(?{})/expression which affected the TryCatch test suite has been fixed [perl #114242]..
http://search.cpan.org/~flora/perl-5.17.5/pod/perl5173delta.pod
CC-MAIN-2014-35
refinedweb
844
67.65
I was wondering if adding support for validation-errors with Ajax is something that may be considered at some point. I spent some time today looking at the jx template stuff, and while I have a better concept of what is going on, it's deep for me. Gary > -----Original Message----- > From: Jason Johnston [mailto:cocoon@lojjic.net] > Sent: Thursday, February 15, 2007 8:42 PM > To: users@cocoon.apache.org > Subject: Re: Cforms and Ajax validation workaround? > > Grzegorz Kossakowski wrote: > > Gary Larsen napisal(a): > >> The Ajax implementation in Cforms is fantastic, not not > being able to > >> use <fi:validation-errors> is causing me a problem. > >> > >> I need to use tab styling with groups since there are so > many widgets > >> on the form. The issue is that when a use submits the form, a > >> validation error could occur on a non-active tab. To the user the > >> submit button is just not working. > >> > >> Has anyone been able to come up with a solution to work > around this > >> issue? > >> > > > > Do you know what causes this limitation? Dojo, Ajax nature of > > requests/responses, DOM processing on the browser side, flaw in > > architecture or just simple bug that should be fixed? AFAIK most > > functionality of CForms should work equally well in Ajax > and non-Ajax mode. > > I was the one who reported the JIRA issue (COCOON-1570) and > worked at one point on a fix so I'll give a little background. > > The way CForms's AJAX mode works is that during an AJAX > request, the JXTemplate checks each widget for whether its > value or state has been changed, and if so wraps it in a > <bu:replace/> element. Then the browser-update transformer > strips out everything in the document except those bu:replace > elements, so the only thing sent back to the browser is the > widgets that have changed. > > So the problem with fi:validation-errors is that, being a > purely stylistic element (not evaluated by a JXTemplate > macro), it has no way to indicate that its contents have > changed, and gets stripped out of the AJAX response by the > browser-update transformer. > > I believe the best "final" solution will be to create a > ft:validation-errors (note the template namespace) element > which gets handled by a JX macro. That macro will be able to > determine if its contents need to be updated and if so create > the bu:replace element like any other template macro. I had > a partial implementation of this a long time ago, but it > would be way out of sync with current code and I'm not sure I > could find it anyway. > > I think that as a temporary workaround one should be able to > manually wrap the fi:validation-errors within a bu:replace > with an appropriate id. I haven't tried this though. > > > > Could you please elaborate a little more on this? What happens when > > you try to use ft:validation-errors, what happens to > validation errors > > on other tabs than active one. Do you know where they get lost? > > > > It would be great if you could fill the issue with as simple as > > possible example of the code (forms definitions and templates, > > sitemap, flowscript cod) that shows buggy behavior. I could take a > > look on this in a week or two. > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org >
http://mail-archives.apache.org/mod_mbox/cocoon-dev/200702.mbox/%3C003101c75b7b$b6e451f0$4f01a8c0@envisnofc.com%3E
CC-MAIN-2016-44
refinedweb
566
61.67
#include <sys/types.h> #include <ShoreApp.h> shrc Shore::utimes(const char *path, struct timeval *tvp) If tvp is 0, the object's atime and mtime are set to the current time. The process must be running under the uid of the owner of the object, or must have write permission on the object to use utimes in this way. If tvp is not 0, it is assumed to point to an array of two timeval structures. The object's atime is set to the first of these structures; the mtime is set to the second structure. The process must be running under the uid of the owner of the object to use utimes in this way. In either case, the object's ctime is updated to the current time. In addition, utimes obtains an EX-mode (exclusive-mode) lock on the object.
http://www.cs.wisc.edu/shore/1.0/man/utimes.oc.html
crawl-001
refinedweb
143
80.01
clone - create a child process #include <sched.h> int clone(int (*fn) (void *), void *child_stack, int flags, void *arg) _syscall2(int, clone, int, flags, void *, child_stack); clone creates a new process, just like fork(2). clone is explicitely one or several of the following constants, in order to specify what is shared between the calling process and the child process: CLONE_PARENT [Toc] [Back] (Linux 2.4 onwards) [Toc] [Back] If CLONE_FS is set, the caller and the child processes share the same file system information. This includes the root of the file system, the current working directory, and the umask. Any call to chroot(2), chdir(2), or umask(2) performed by the callng process or the child process also takes effect in [Toc] [Back] If CLONE_FILES is set, the calling process and the child processes share the same file descriptor table._SIGHAND [Toc] [Back]. CLONE_PTRACE [Toc] [Back] If CLONE_PTRACE is specified, and the calling process is being traced, then trace the child also (see ptrace(2)). CLONE_VFORK [Toc] [Back] [Toc] [Back] [Toc] [Back] [Toc] [Back] .). On success, the PID of the child process is returned in the caller's thread of execution. On failure, a -1 will be returned in the caller's context, no child process will be created, and errno will be set appropriately.. The clone and sys_clone calls are Linux-specific and should not be used in programs intended to be portable. For programming threaded applications (multiple threads of control in the same memory space), it is better to use a library implementing the POSIX 1003.1c thread API, such as the LinuxThreads library (included in glibc2 (libc6) ). See pthread_create(3thr). This manual page corresponds to kernels 2.0.x, 2.1.x, 2.2.x, 2.4.x, and to glibc 2.0.x and 2.1.x. fork(2), wait(2), pthread_create(3thr) Linux 2.4 2001-06-26 CLONE(2)
https://nixdoc.net/man-pages/Linux/man2/clone.2.html
CC-MAIN-2020-34
refinedweb
317
73.27
The QTextTable class represents a table in a QTextDocument. More... #include <QTextTable> Inherits QTextFrame. Note: All the functions in this class are reentrant..) See also QTextTableFormat. Returns the table cell at the given row and column in the table. See also columns() and rows(). This is an overloaded member function, provided for convenience. Returns the table cell that contains the character at the given position in the document. This is an overloaded member function, provided for convenience.. See also splitCell(). This is an overloaded member function, provided for convenience. Merges the cells selected by the provided cursor. This function was introduced in Qt 4.1. See also splitCell().().().
https://doc.qt.io/archives/qtextended4.4/qtexttable.html
CC-MAIN-2019-26
refinedweb
108
63.76
I'm trying to use format-number like this: <xsl:variable <xsl:variable <xsl:value-of I've seen many examples online of using a variable in the first spot with format-number, but I keep getting a validation error, "Required item type of first argument of format-number() is numeric; supplied value has item type xs:string." I've tried sticking and adding the xs namespace, but then I get this error, "Required item type of value of variable $number is xs:integer; supplied value has item type xs:string". I can't make $unitid an integer, as it has alpha characters in it (which I remove in $number). Can someone point out my errors or give me a hint? --: |
http://www.oxygenxml.com/archives/xsl-list/201308/msg00061.html
CC-MAIN-2018-17
refinedweb
121
52.73
. Use the boolean operator OR to include at least one of the possible conditions - Use the OR operator ||to have the program check if either of two conditions, or any of multiple conditions, is true. NOTE: In the example above, the if statement is actioned if the Bumper Switch is pressed or the V5 Robot Brain's screen is pressed. NOTE: It is easier to use boolean operators if the outcomes of conditions are considered. Logical truth tables like those below are used to track input conditions and output behaviors. Code that can be copied and pasted: #include "robot-config.h" int main() { //The robot moves forward unless the Bumper Switch or the Screen is pressed. while(true){ if(Bumper.pressing()==true || Brain.Screen.pressing()==true){ LeftMotor.stop(); RightMotor.stop(); }else{ LeftMotor.spin(directionType::fwd); RightMotor.spin(directionType::fwd); } } }
https://kb.vex.com/hc/en-us/articles/360035955671-Boolean-OR-Operator-VEX-C-
CC-MAIN-2022-05
refinedweb
139
53.92
You can subscribe to this list here. Showing 1 results of 1 The only change since 1.02 is that this release is built with v5.1 of the Intel Performance Primitives libraries. This will improve the performance of the 64-bit VirtualGL server components on Opteron and EM64T systems, bringing the performance up to the level of the 32-bit components. This release was also necessary because a bug in IPP was preventing us from building the VGL Sun Ray plugin on certain platforms. We had to build the plugin against IPP 5.1 to get around the bug, and TurboJPEG had to be upgraded simultaneously to avoid namespace collision. If you are not using the Sun Ray plugin or an x86-64 system, there is no need to upgrade to TurboJPEG 1.03. IA-64 users should continue to use 1.02. -- ====================================== Darrell Commander <dcommander@...> Electron Mobility Specialist Advanced Visualization Group Sun Microsystems, Inc. Phone/Fax: x67057 (512-275-3825) ======================================
http://sourceforge.net/p/virtualgl/mailman/virtualgl-announce/?viewmonth=200609
CC-MAIN-2014-23
refinedweb
162
68.26
After an interview question about Python decorators which I stumbled over, I promised myself that I would improve my knowledge of this metaprogramming technique. These are my notes to myself on decorators - maybe they’ll be helpful to someone else who’s improving their knowledge of decorators too. A decorator is pure Pythonic syntatic sugar. A decorator is a Python callable that receives the decorated function and returns a new function in its place. For example, if there is a decorator called my_decorator and we want to decorate my_func then… @my_decorator def my_func(): """some stuff""" ... return Is equivalent to writing. def my_func(): """some stuff""" ... return my_func = my_decorator(my_func) The decorator callable is executed at load time, not at execution time. Here is an example of a silly decorator that prints “Hello World” when the Python file is loaded - there is nothing else in the file. hello.py def say_hello(func): print 'Hello World' return func @say_hello def nothing(): # Do nothing just return return Run it on the command line, and “Hello World” appears when the nothing function is decorated. $ python hello.py Hello World When writing a decorator, remember to patch over the docstring of the wrapped function. This can be done by accessing the passed function’s __doc__ attribute. Failing to do so will prevent doctest from testing the decorated function. def my_decorator(func): def wrapper(*args, **kwargs): return func(*args, **kwargs) # Pass through the doc string wrapper.__doc__ = func.__doc__ return wrapper Update This is actually far better done with the wraps decorator from the functools modules, which fixes the __name__ and __doc__ attributes to what we’d expect them to be. from functools import wraps def my_decorator(func): @wraps(func) def wrapper(*args, **kwargs): return func(*args, **kwargs) return wrapper Found on Improve your Python. When unit testing decorators, one strategy can be to manually call the decorator on a mocked object and inspect how it interacts with it. Here’s a caching function which is used to speed up the Fibonacci series. def cache(func): # Keep a dict of values returned already vals = {} def wrapper(x): if not vals.has_key(x): vals[x] = func(x) return vals[x] wrapper.__doc__ = func.__doc__ return wrapper Now use the cache function as a decorator. @cache def fib(x): """Fibonacci series >>> fib(1) 1 >>> fib(2) 2 """ if x < 0: raise ValueError('Must be greater than 0') elif x == 0: return 1 elif x == 1: return 1 else: return fib(x - 1) + fib(x - 2) And here’s a unittest that asserts that the cache function only allows calls through when there is no value saved in the vals dict. import unittest from mock import Mock class TestCashDecorator(unittest.TestCase): def test_cache(self): my_fn = Mock(name='my_fn') my_fn.return_value = 'hi' wrapped = cache(my_fn) # First call gives a call count of 1 self.assertEqual(wrapped(3), 'hi') self.assertEqual(my_fn.call_count, 1) # Second call keeps the call count at 1 - the cached value is used self.assertEqual(wrapped(3), 'hi') self.assertEqual(my_fn.call_count, 1) # Subsequent call with a new value increased the call count self.assertEqual(wrapped(7), 'hi') self.assertEqual(my_fn.call_count, 2) Make sure the scope of variables used in the decorators is correct, this is an interesting article by Simeon Franklin about decorators and scope. If in doubt, extend any tests to test a second decorated function and ensure that the two functions do not effect each other. Below is a test that aims to check that cache dictionaries are not shared between instances of the cache decorator, it is appended to the test_cache test above. # Check that the vals dict isn't shared between other decor my_other_fn = Mock(name='other fn') my_other_fn.return_value = 'other hi' # Create other wrapped function other_wrapped = cache(my_other_fn) self.assertEqual(other_wrapped(7), 'other hi') self.assertEqual(my_other_fn.call_count, 1) # The original function has not have been additionally called, its # call count remains 2 self.assertEqual(my_fn.call_count, 2) All suggested tips on decorators very welcome - thanks for reading!
https://jamescooke.info/things-to-remember-about-decorators.html
CC-MAIN-2021-17
refinedweb
667
55.64
After reading this article, you will learn how to configure autoscaling based on the average number of HTTP requests per second. I haven’t found any article describing the configuration of horizontal pod autoscaling based on the HTTP requests metric from Isio. There are a few sources, but all of them are outdated or much more complicated than my solution. Some time ago, we have created a similar autoscaling solution based on metrics from AWS Load Balancer, which was scaling containers deployed on ECS. We first tried CPU based autoscaling, but we had a lot of problems because of high CPU usage on an application startup. Scaling based on the number of HTTP requests worked much better. However, in the Kubernetes world, things are completely different… All source code is available here: Prerequisites I have used several tools in this article, you could probably replace some of them, though. Remember to use a fairly new version of Istio (tested with 1.7.2). Probably older versions do not have istio_requests_total metric available per Pod. List of tools: - Minikube (tested with v1.10.1, Kubernetes v1.17.12) - KVM (required by Minikube) - Kubectl (tested with v1.17.12) - Helm (tested with v3.2.1) - Siege (tested with 4.0.4) - Istioctl (tested with 1.7.2) Preparation First of all, we have to start Minikube: minikube start --driver=kvm2 --kubernetes-version v1.17.12 --memory=8192 --cpus=4 && minikube tunnel Few things to mention here: I use kvm2 and Kubernetes version 1.17, but the solution will probably work on different Kubernetes versions and different Minikube drivers (or even other Kubernetes distributions). We need quite a lot of RAM and CPU because we want to test the autoscaling. The last thing - we have to run the Minikube tunnel to access the Istio ingress gateway, so it will ask you for the sudo password and it will lock your terminal, therefore you will have to open a new one. Next, we need to install Istio: istioctl install -y We are using the default Istio configuration. Nothing special here. Then, we will create namespaces and enable Istio automatic sidecar injection on one of them: kubectl create namespace monitoring kubectl create namespace dev kubectl label namespace dev istio-injection=enabled I will not explain what a sidecar is and how Istio works, but if you want to know more - just read the Istio documentation. Then, we will deploy the sample application (code available here:): kubectl -n dev apply -f sample-app-with-istio.yaml and wait for the deployment to work (probably a few minutes): export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') until curl -f; do echo "Waiting for the application to start..."; sleep 1; done This is an almost unmodified httpbin application from Istio documentation. The solution For our solution we will need Prometheus to scrape metrics from Istio: helm repo add prometheus-community helm repo add stable helm repo update helm -n monitoring install prometheus prometheus-community/prometheus It is the default helm chart for the Prometheus installation. We use this one because Istio has a default configuration to expose metrics for it, i.e. pod has the following annotations: prometheus.io/path: /stats/prometheus prometheus.io/port: 15020 prometheus.io/scrape: true Having Prometheus installed doesn't mean that we can use its metrics for horizontal Pod autoscaling. We will need one more thing - Prometheus Adapter installed with customized configuration file prometheus-adapter-values.yaml: prometheus: url: port: 80 rules: custom: - seriesQuery: 'istio_requests_total{kubernetes_namespace!="",kubernetes_pod_name!=""}' resources: overrides: kubernetes_namespace: {resource: "namespace"} kubernetes_pod_name: {resource: "pod"} name: matches: "^(.*)_total" as: "${1}_per_second" metricsQuery: 'sum(rate(<<.Series>>{<<.LabelMatchers>>}[2m])) by (<<.GroupBy>>)' Here, we can see our Prometheus instance URL, port, and one custom rule. Let's focus on this rule: seriesQueryis needed for metric discovery resources/overrides are mapping fields from the metric ( kubernetes_namespace, kubernetes_pod_name) to the names required by Kubernetes ( namespace, pod). name/matches, name/asare needed to change the metric name. We are transforming this metric, so it is good to change the name istio_requests_total to istio_requests_per_second. metricsQueryhere is the actual query (which is actually a query template) and it will be run by the adapter while scraping the metric from Prometheus. rateand [2m]"calculates the per-second average rate of increase of the time series in the range vector" (from Prometheus documentation), here it is the per-second rate of HTTP requests as measured over the last 2 minutes, per time series in the range vector (also, almost from the Prometheus documentation). Now, as we have the adapter configuration, we can deploy it using: helm -n monitoring install prometheus-adapter prometheus-community/prometheus-adapter -f prometheus-adapter-values.yaml Ok, so the last thing is to create the Horizontal Pod Autoscaler using the following configuration: apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: httpbin spec: minReplicas: 1 maxReplicas: 5 metrics: - type: Pods pods: metric: name: istio_requests_per_second target: type: AverageValue averageValue: "10" scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: httpbin Most of the configuration is self-explanatory. scaleTargetRef references our application’s Deployment object and min and max replicas are our boundaries. The most interesting part is metrics — here we tell the autoscaler to use our custom istio_requests_per_second metric (which is calculated per Pod) and that it should scale out after more than 10 average requests per second. One of the most important things — probably when other articles about this topic were written, istio_requests_total metric wasn’t calculated per pod. Things got much easier because now it is! Now let’s create the Horizontal Pod Autoscaler: kubectl -n dev apply -f hpa.yaml and wait for the metric availability (probably a few minutes): until kubectl -n dev describe hpa | grep "\"istio_requests_per_second\" on pods:" | grep -v "<unknown> / 10"; do echo "Waiting for the metric availability..."; sleep 1; done We have our autoscaling up and running. Let’s test it! Testing First of all, we can open two new terminal windows and watch what is happening (every line in a separate window): watch kubectl -n dev get pod watch kubectl -n dev describe hpa httpbin Then, let’s start testing: export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') siege -c 2 -t 5m You can use other tools than siege (e.g. hey). It is important that it needs to support HTTP/1.1 so ab (apache benchmark) is not the right solution. After a few minutes, you should see more pods running, and that “describe hpa” shows the current number of requests per second. Conclusion It is not that hard to create an autoscaling solution based on the HTTP requests per second metric if you know what you are doing. It should be also quite simple, to change it to some other Prometheus metric. But should you really do it yourself? Our DevOpsBox platform has already built-in full autoscaling with reasonable defaults! For more details about the DevOpsBox platform please visit Discussion (0)
https://dev.to/mraszplewicz/horizontal-pod-autoscaling-based-on-http-requests-metric-from-istio-cc3
CC-MAIN-2021-49
refinedweb
1,168
54.12
inkiBAN USER Simple recursive solution in C. It is 2^n. This will work for any targe sum value: #include <stdio.h> #include <stdlib.h> void printArray(int *array, int size) { for (int i = 0; i<size; i++) { printf("%d ", array[i]); } printf("\n"); } void print_all_subsets(int *nums, int numsSize, int start, int sum, int *subset, int subsetSize) { if (numsSize == 0) { printf("Empty set"); } if (start >= numsSize) { return; } // do not include element nums[start] in the subset print_all_subsets(nums, numsSize, start+1, sum, subset, subsetSize); // inlcude element nums[start] in the subset subset[subsetSize++] = nums[start]; if (nums[start] == sum) { //found a subset printArray(subset, subsetSize); } print_all_subsets(nums, numsSize, start+1, sum-nums[start], subset, subsetSize); } int* initArray(int size) { int *array = (int*)calloc(size, sizeof(int)); return array; } int main() { int nums[]={8, 3, 5, 1, -4, -8}; int numsSize = 6; int *subset = initArray(numsSize); int sum = 0; print_all_subsets(nums, numsSize, 0, sum, subset, 0); free(subset); } This is just a different type of sorting question, so if you provide your own comparison function: Pi > Pj if Pi won Pj then you are all set to use any of the classic sorting algorithm. Finding the winner is equivalent to finding the max of a list of numbers which can be done in 0(n), go over player and always keep the winner of the max (winner of the two players). And sorting can be done O(NlogN) with any of the standard sorting algorithms. RussBDycus, Android test engineer at ABC TECH SUPPORT I am working as a manager in Lionel Kiddie City company. I really enjoy my job. I like to play ... PatriciaNRowe, Consultant at ADP Hi i am a Freelance Writer and Social Media Manager who helps finance professionals and Fin-tech startups build an audience ... DonnaWHale, Data Engineer at ADP Hi, I am passionate writer with a BA in English from the Ohio State University.5+ years of experience writing ... brandysolsen, Area Sales Manager at AMD I am a Social butterflies who enjoy travel.Have fun doing this job and project an atmosphere that reflects Amazon ... Another solution might be to use a bloom filter per container, where each container contains that XOR of all the unique tokens in that container. Moving a luggage is just a matter of XOR the unique ID with the current container and then with the new container. Depending on the size of the containers you can choose appropriate token sizes.- inki March 13, 2016
https://careercup.com/user?id=5717134131855360
CC-MAIN-2021-49
refinedweb
413
51.28
This is a simple wrapper for Diablo III published API. I wrote this program in C# 2.0. The winform program will show you any your interested guys information, which include hero level/class/Paragon and items without opening your game. You can open the solution via VS2012, click the left combobox and select property-Items, add any your favorite guys Diablo III tag, just like iamfqq#1989, this is my tag in the game. Here is a snapshot for my program. If you want to check your friends' Diablo III hero, and do not want to open your game, you can use this application to see detailed information. Blizzard published the API several months ago and I wrote this wrapper for the .NET developer to do some interesting things. You should add the using statement at head of your .NET file like below using GameBaster.Diablo3.API; Pass the Diablo III tag string to the constructor of Profile class. The tag format should look like: Yourname#Number. Profile profile = new Profile(tag); List<Hero> list = profile.HeroList; In current version, the Cache is set to true by default. This means the API will download necessary resources and save .JSON and items pictures to the cache path when you first time run the application. When these resources download, the API will not retrieve them again (in order to improve application performance). This is a sample code to show a hero's head picture on a button. using (Stream myStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(hero.HeadPicture)) { Bitmap bmp = new Bitmap(myStream); btn.BackgroundImage = bmp; btn.BackgroundImageLayout = ImageLayout.None; } If you go to definition of HeadPicture you'll find similar code. The head picture resources are located at the folder HeadPicture, they had been merged into the windows form application resources. HeadPicture public string HeadPicture { get{ return String.Format("Diablo3Profile.HeadPicture.{0}_{1}.png", this._class.Replace("-", ""), this.male); } } Class Profile is the entry for this API which include 3 main properties: MonstersKilled,ElitesKilled and a dictionary that contains all of the heros who belong to the tag. MonstersKilled,ElitesKilled The D3 API doc told us, we could get user profile information via a HTTP GET operation. You could find this line in the constructor of the class Profile. Be careful, do NOT forget the last "/" after the {0} parameter. Profile this.apiurl = String.Format("{0}/", tag.Replace("#", "-")); When you download the data through the WebClient class, you could use JSON helper or any other helper class to analyze the data. Because I do not know much about JSON, I had to use String.IndexOf and String.SubString methods to finish the resolving work. WebClient String.IndexOf String.SubString In fact, in the Profile constructor method, I'd resolved the JSON string and split basic hero information, such as ID, Name, Level, Class, Paragon Class, etc. Class Hero include the basic hero information just like the last line of "What's the class Profile", and also a dictionary which contains all of the items which belong to this hero. You could get the hero's items through the D3 API via a HTTP GET. The URL is a little different with the prior profile URL. It looks like this: string url = String.Format("{0}/hero/{1}", this.tag.Replace("#", "-"), this.id); You may find the D3 API require the tag string should use the "-" instead of the "#" .And the {1} parameter is the hero id, you can retrieve this from the class Profile. All of the items information are retrieved from public method GetItemList. GetItemList public Dictionary<string, Item> GetItemList() This method does not need any parameters, and will return a generic Dictionary instance which include all of the items. The key in the dictionary is the item type instead of a individual name, such as "head" instead of "Some Head Item". And the value in the dictionary is an instance of the class Item. Here are parts of the method GetItemList. All of the main work is done by another method, "GetItem". GetItem <pre>itemlist.Add("head", GetItem(info, "head")); itemlist.Add("torso", GetItem(info, "torso")); itemlist.Add("feet", GetItem(info, "feet")); itemlist.Add("hands", GetItem(info, "hands")); itemlist.Add("shoulders", GetItem(info, "shoulders")); itemlist.Add("legs", GetItem(info, "legs")); itemlist.Add("bracers", GetItem(info, "bracers")); itemlist.Add("mainhand", GetItem(info, "mainHand")); itemlist.Add("offhand", GetItem(info, "offHand")); itemlist.Add("waist", GetItem(info, "waist")); itemlist.Add("rightfinger", GetItem(info, "rightFinger")); itemlist.Add("leftfinger", GetItem(info, "leftFinger")); itemlist.Add("neck", GetItem(info, "neck")); In the GetItem method, I simply resolve the JSON string by the parameter key. private Item GetItem(string content, string key) Here, we should use the other D3 API via HTTP GET operation. string url = "" + itemtip; The itemtip is split from the JSON data. When you send the GET request to, you'll get the detailed information for this item. The information is big and rich, you can find a number of things, such as Name, Type, Image, Color. You can also find some basic but importand properties, like strength, vitality, intelligence, MF and resistance all. itemtip At last, I add the GDI+ information in the API code. I do not have a clear thoughts on where to put such image loaction, lable location and line location information. Maybe I'll refactor the code and move these complex Points array to other class. I think, now you could understand the key part of this application. Class Helper include some configuration info, such as Cache, JSON analysis. Again, I do not have the knowledge on how to resolve the JSON string, So I use the simple String operations to complete this task. All of the UI operations are coded in the file MyPanel.cs. The class MyPanel is derived from UserControl, for a better performance, I'd set the style on this control just like below code. The 3 ControlStyles are merged by the "OR" operator, this can greatly improve the GDI+ performance. MyPanel private void MyPanel_Load(object sender, EventArgs e) { this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); this.UpdateStyles(); } The kernel code are all in the method MyPanel_Paint, which include 7 parts MyPanel_Paint Graphics.DrawString Hero tooltip methodGetAttributesRaw You can find the original Blizzard API here: This is a version 0.1. The next version will include hero skill information, and will add event handler to some methods. This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) private static string DownloadData(string url) { try { var webRes = ((HttpWebRequest)WebRequest.Create(url)).GetResponse(); var streamReader = new StreamReader(webRes.GetResponseStream()); string responce = streamReader.ReadToEnd(); webRes.Close(); if (responce == "{\n\"code\" : \"OOPS\",\n\"reason\" : \"There was a problem processing the request.\"\n}") return "error"; else return responce; } catch { return ""; } } using (FileStream writter = new FileStream(fullpath, FileMode.Create)) Public Property Hero() As Hero Get Return Me._hero End Get Set(value As Hero) Me._hero = value Me.itemlist = _hero.GetItemList() End Set End Property Dim myStream As Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(hero.HeadPicture) Dim bmp As New Bitmap(myStream) this.itemlist = hero.GetItemList(); public Hero Hero { get { return this.hero; } set { this.hero = value; this.itemlist = hero.GetItemList(); } } 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.
https://www.codeproject.com/articles/465647/csharp-wrapper-for-diablo-iii-api
CC-MAIN-2017-04
refinedweb
1,226
59.4
:hm. this doesn't really add value to your testing case for passing signed :chars. now they all appear non-printable - and not like the integer :equivalent, as the naive programmer would expect. I would prefer the :openbsd way: : if (c =3D=3D EOF) : return 0; : else : return ((table+1)[(unsigned char)c)]); : :this gives expected results for (common?) misuse and even saves us one :conditional. : :cheers : simon Well, from all the standards that were quoted at me I don't think we can safely return anything but 0 for negative numbers simply because the data space for one of those numbers, -1, is overloaded. Since there is no way to get around the the -1 vs 0xFF problem, it's probably best not to try to retain compatibility for other negative numbers either. Another possibility would be to use more GCC constructs to check whether the passed type is a char and emit an #error if it is (verses just emitting a warning which is useless relative to all the warnings we get compiling third party software anyway). But I dislike such a solution because a program could use char's to store restricted ascii characters and still be entirely correct. So I think its best to stick with just returning 0 for out of bounds values. -Matt
https://www.dragonflybsd.org/mailarchive/commits/2005-07/msg00184.html
CC-MAIN-2017-09
refinedweb
219
64.75
Training your Pooch¶ The problem¶ You develop a Python library called plumbus for analysing data emitted by interdimensional portals. You want to distribute sample data so that your users can easily try out the library by copying and pasting from the docs. You want to have a plumbus.datasets module that defines functions like fetch_c137() that will return the data loaded as a pandas.DataFrame for convenient access. Assumptions¶ We’ll setup a Pooch to solve your data distribution needs. In this example, we’ll work with the follow assumptions: - Your sample data are in a folder of your Github repository. - You use git tags to mark releases of your project in the history. - Your project has a variable that defines the version string. - The version string contains an indicator that the current commit is not a release (like 'v1.2.3+12.d908jdl'or 'v0.1+dev'). Let’s say that this is the layout of your repository on Github: doc/ ... data/ README.md c137.csv cronen.csv plumbus/ __init__.py ... datasets.py setup.py ... The sample data are stored in the data folder of your repository. Setup¶ Pooch can download and cache your data files to the users computer automatically. This is what the plumbus/datasets.py file would look like: """ Load sample data. """ import pandas import pooch from . import version # The version string of your project GOODBOY = pooch.create( # Use the default cache folder for the OS path=pooch.os_cache("plumbus"), # The remote data is on Github base_url="{version}/data/", version=version, # If this is a development version, get the data from the master branch version_dev="master", # The registry specifies the files that can be fetched from the local storage", }, ) def fetch_c137(): """ Load the C-137 sample data as a pandas.DataFrame. """ # The file will be downloaded automatically the first time this is run. fname = GOODBOY.fetch("c137.csv") data = pandas.read_csv(fname) return data def fetch_cronen(): """ Load the Cronenberg sample data as a pandas.DataFrame. """ fname = GOODBOY.fetch("cronen.csv") data = pandas.read_csv(fname) return data When the user calls plumbus.datasets.fetch_c137() for the first time, the data file will be downloaded and stored in the local storage. In this case, we’re using pooch.os_cache to set the local folder to the default cache location for your OS. You could also provide any other path if you prefer. See the documentation for pooch.create for more options. Hashes¶ Pooch uses SHA256 hashes to check if files are up-to-date or possibly corrupted: - If a file exists in the local folder, Pooch will check that its hash matches the one in the registry. If it doesn’t, we’ll assume that it needs to be updated. - If a file needs to be updated or doesn’t exist, Pooch will download it from the remote source and check the hash. If the hash doesn’t match, an exception is raised to warn of possible file corruption. You can generate hashes for your data files using the terminal: $ openssl sha256 data/c137.csv SHA256(data/c137.csv)= baee0894dba14b12085eacb204284b97e362f4f3e5a5807693cc90ef415c1b2d Or using the pooch.file_hash function (which is a convenient way of calling Python’s hashlib): import pooch print(pooch.file_hash("data/c137.csv")) Versioning¶ The files from different version of your project will be kept in separate folders to make sure they don’t conflict with each other. This way, you can safely update data files while maintaining backward compatibility. For example, if path=".plumbus" and version="v0.1", the data folder will be .plumbus/v0.1. When your project updates, Pooch will automatically setup a separate folder for the new data files based on the given version string. The remote URL will also be updated. Notice that there is a format specifier {version} in the URL that Pooch substitutes for you. Versioning is optional and can be ignored by omitting the version and version_dev arguments or setting them to None. User-defined paths¶ In the above example, the location of the local storage in the users computer is hard-coded. There is no way for them to change it to something else. To avoid being a tyrant, you can allow the user to define the path argument using an environment variable: GOODBOY = pooch.create( # This is still the default in case the environment variable isn't defined", }, # The name of the environment variable that can overwrite the path argument env="PLUMBUS_DATA_DIR", ) In this case, if the user defines the PLUMBUS_DATA_DIR environment variable, we’ll use its value instead of path. Pooch will still append the value of version to the path, so the value of PLUMBUS_DATA_DIR should not include a version number. Subdirectories¶ You can have data files in subdirectories of the remote data store. These files will be saved to the same subdirectories in the local storage folder. Note, however, that the names of these files in the registry must use Unix-style separators ( '/') even on Windows. We will handle the appropriate conversions. So you have 1000 data files¶ If your project has a large number of data files, it can be tedious to list them in a dictionary. In these cases, it’s better to store the file names and hashes in a file and use pooch.Pooch.load_registry to read them: import os GOODBOY = pooch.create( # Use the default cache folder for the OS path=pooch.os_cache("plumbus"), # The remote data is on Github base_url="{version}/data/", version=version, # If this is a development version, get the data from the master branch version_dev="master", # We'll load it from a file later registry=None, ) GOODBOY.load_registry(os.path.join(os.path.dirname(__file__), "registry.txt")) The registry.txt file in this case is in the same directory as the datasets.py module and should be shipped with the package. It’s contents are: To make sure the registry file is shipped with your package, include the following in your MANIFEST.in file: include plumbus/registry.txt And the following entry in the setup function of your setup.py: setup( ... package_data={"plumbus": ["registry.txt"]}, ... ) Creating a registry file¶ If you have many data files, creating the registry and keeping it updated can be a challenge. Function pooch.make_registry will create a registry file with all contents of a directory. For example, we can generate the registry file for our fictitious project from the command-line: $ python -c "import pooch; pooch.make_registry('data', 'plumbus/registry.txt')" Multiple URLs¶ You can set a custom download URL for individual files with the urls argument of pooch.create or pooch.Pooch. It should be a dictionary with the file names as keys and the URLs for downloading the files as values. For example, say we have a citadel.csv file that we want to download from instead: # The basic setup is the same and we must include citadel.csv in the registry. GOODBOY = pooch.create(", }, # Now specify custom URLs for some of the files in the registry. urls={ "citadel.csv": "", }, ) Notice that versioning of custom URLs is not supported (since they are assumed to be data files independent of your project) and the file name will not be appended automatically to the URL (in case you want to change the file name in local storage). Custom URLs can be used along side base_url or you can omit base_url entirely by setting it to an empty string ( base_url=""). However, doing so requires setting a custom URL for every file in the registry. You can also include custom URLs in a registry file by adding the URL for a file to end of the line (separated by a space): pooch.Pooch.load_registry will automatically populate the urls attribute. This way, custom URLs don’t need to be set in the code. In fact, the module code doesn’t change at all: # Define the Pooch exactly the same (urls is None by default) GOODBOY = pooch.create( path=pooch.os_cache("plumbus"), base_url="{version}/data/", version=version, version_dev="master", registry=None, ) # If custom URLs are present in the registry file, they will be set automatically GOODBOY.load_registry(os.path.join(os.path.dirname(__file__), "registry.txt"))
https://www.fatiando.org/pooch/v0.2.1/usage.html
CC-MAIN-2021-21
refinedweb
1,353
65.52
Immutable: Install immutable using npm. npm install immutable Then require it into any module. const { Map } = require('immutable') const map1 = Map({ a: 1, b: 2, c: 3 }) const map2 = map1.set('b', 50) map1.get('b') // 2 map2.get('b') // 50 To use Immutable.js from a browser, download dist/immutable.min.js or use a CDN such as CDNJS or jsDelivr. Then, add it as a script tag to your page: <script src="immutable.min.js"></script> <script> var map1 = Immutable.Map({a:1, b:2, c:3}); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50 </script> Or use an AMD loader (such as RequireJS): require(['./immutable.min.js'], function (Immutable) { var map1 = Immutable.Map({a:1, b:2, c:3}); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50 }); If you're using webpack or browserify, the immutable npm module also works from the browser..39.0 or higher) and TypeScript (v2.1.0 or higher), so you shouldn't need to do anything at all!. import { Map } from "immutable"; const map1 = Map({ a: 1, b: 2, c: 3 }); const map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50 Previous versions of Immutable.js include a reference file which you can include via relative path to the type definitions at the top of your file. ///<reference path='./node_modules/immutable/dist/immutable.d.ts'/> import Immutable = require('immutable'); var map1: Immutable.Map<string, number>; map1 = Immutable.Map({a:1, b:2, c:3}); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); //1.set('b', 2) assert(map1.equals(map2) === true) const map3 = map1.set('b', 50) assert(map1.equals(map1 = Map({ a: 1, b: 2, c: 3 }) const clone = map1;(list1.size === 2); assert(list2.size === 5); assert(list3.size === 6); assert(list4.size === 13); assert' Designed to inter-operate with your existing JavaScript, Immutable.js accepts plain JavaScript Arrays and Objects anywhere a method expects an Collection. const { Map } =" } Object.keys(obj) // [ "1" ] obj["1"] // "one" obj[1] // "one" const map = fromJS(obj) map.get("1") // "one" map.get(1) // undefined Property access for JavaScript Objects first converts the key to a string, but since Immutable Map keys can be of any type the argument to get() is not altered. All Immutable.js Collections can be converted to plain JavaScript Arrays and Objects shallowly with toArray() and toObject() or deeply with toJS(). All Immutable Collections also implement toJSON() allowing them to be passed to JSON.stringify directly. const { Map, List } = require('immutable') const deep = Map({ a: 1, b: 2, c: List([ 3, 4, 5 ]) }) deep.toObject() // { a: 1, b: 2, c: List [ 3, 4, 5 ] } deep.toArray() // [ 1, 2, List [ 3, 4, 5 ] ] deep.toJS() // { a: 1, b: 2, c: [ 3, 4, 5 ] } JSON.stringify(deep) // '{"a":1,"b":2,"c":[3,4,5]}'3. // ES2015 const mapped = foo.map(x => x * x); // ES3 var mapped = foo.map(function (x) { return x * x; }); nested2 = nested.mergeDeep({ a: { b: { d: 6 } } }) // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } } nested2.getIn([ 'a', 'b', 'd' ]) // 6 const nested3 = nested2.updateIn([ 'a', 'b', 'd' ], value => value + 1) // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } } const nested4 = nested3.updateIn([ 'a', 'b', 'c' ], list => list.push(6)) // Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } } Seq describes a lazy operation, allowing them to efficiently chain use of all the sequence methods (such as map and filter).. For example, the following does not perform any work, because the resulting Seq is never used: const { Seq } = require('immutable') const oddSquares = Seq([ 1, 2, 3, 4, 5, 6, 7, 8 ]) .filter(x => x % 2) .map(x => x * x) Once the Seq is used, it performs only the work necessary. In this example, no intermediate arrays are ever created, filter is called three times, and map is only called once: console.log(oddSquares.get(1)); // 9 Any collection can be converted to a lazy Seq with .toSeq(). const { Map } = require('immutable') const seq = Map({ a: 1, b: 2, c: 3 }).toSeq() Seq allows for the efficient chaining of sequence operations, especially when converting to a different concrete type (such as to a JS object): seq.flip().map(key => key.toUpperCase()).flip().toObject(); // { A: 1, B: 1, C: 1 } As well as expressing logic that would otherwise seem memory-limited: const { Range } = require('immutable') Range(1, Infinity) .skip(1000) .map(n => -n) .filter(n => n % 2 === 0) .take(2) .reduce((r, n) => r * n, 1); // 1006008 Note: A Collection is always iterated in the same order, however that order may not always be well defined, as is the case for the Map. Immutable.js provides equality which treats immutable data structures as pure data, performing a deep equality check if necessary. const { Map, is } = require('immutable') const map1 = Map({ a: 1, b: 2, c: 3 }) const map2 = Map({ a: 1, b: 2, c: 3 }) assert(map1 !== map2) // two different instances assert(is(map1, map2)) // have equivalent values assert(map1.equals(map2)) // alternatively use the equals method Immutable.is() uses the same measure of equality as Object.is including if both are immutable and all keys and values are equal using the same measure of equality.(list1.size === 3); assert. Read the docs and eat your vegetables. Docs are automatically generated from Immutable.d.ts. Please contribute! Also, don't miss the Wiki which contains articles on specific topics. Can't find something? Open an issue. If you are using the Chai Assertion Library, Chai Immutable provides a set of assertions to use against Immutable.js collections. Use Github issues for requests. We actively welcome pull requests, learn how to contribute. Changes are tracked as Github releases. Phil Bagwell, for his inspiration and research in persistent data structures. Hugh Jackson, for providing the npm package name. If you're looking for his unsupported package, see this repository. Immutable.js is BSD-licensed. We also provide an additional patent grant.
http://facebook.github.io/immutable-js/
CC-MAIN-2017-13
refinedweb
1,014
70.29
iTriggerFiredCondition Struct Reference This interface is implemented by the leaf iBTNode that monitors a CEL trigger. More... #include <tools/behaviourtree.h> Inheritance diagram for iTriggerFiredCondition: Detailed Description This interface is implemented by the leaf iBTNode that monitors a CEL trigger. It returns whether or not a trigger has been fired. The exact behaviour depends on the value set by SetFireOnce(). Definition at line 120 of file behaviourtree.h. Member Function Documentation Set whether or not the execution of the condition will return true once or forever once the trigger has been fired. If once is true, then iBTNode::Execute() will return true only once each time the trigger is fired. Otherwise, iBTNode::Execute() will return true forever once the trigger has been fired. The default value is false. Set the trigger to be monitored by this node. The documentation for this struct was generated from the following file: - tools/behaviourtree.h Generated for CEL: Crystal Entity Layer 2.0 by doxygen 1.6.1
http://crystalspace3d.org/cel/docs/online/api-2.0/structiTriggerFiredCondition.html
CC-MAIN-2016-40
refinedweb
164
51.04
I am looking at a javascript code that manipulates an HTML A tag , and I'm having trouble understanding how it sets up the "onclick" property. It seems to be telling it to update ytplayer_playitem with the index variable j and then call ytplayer_playlazy(1000) But what's up with all the parentheses? What details in the javascript syntax allows it to be setup like this? var a = document.createElement("a"); a.href = "#ytplayer"; a.onclick = (function (j) { return function () { ytplayer_playitem = j; ytplayer_playlazy(1000); }; })(i); Well, basically, the value of onclick is a function that will get called when the element is clicked. Whatever you want to happen when the user clicks the element goes in the body of the function. You could create a named function and then assign it to the element's onclick attribute: function youClickedMe() { ... } a.onclick = youClickedMe but that clutters up the namespace with a function name that is never referenced anywhere else. It's cleaner to create an anonymous function right where you need it. Normally, that would look like this: a.onclick = function() { ... } But if we try that with your specific example: a.onclick = function() { ytplayer_playitem = something; // ?? ytplayer_playlazy(1000); } We see that it hard-codes the something that gets played. I'm assuming the original code was taken from a loop which generates several clickable links to play; with the code just above, all of those links would play the same thing, which is probably not what you want. So far, so straightforward, but this next leap is where it gets tricky. The solution seems obvious: if you're in a loop, why not just use the loop variable inside the function body? // THIS DOESN'T WORK a.onclick = function() { ytplayer_playitem = i; ytplayer_playlazy(1000); } That looks like it should work, but unfortunately the i inside the function refers to the value of the variable i when the function is called, not when it's created. By the time the user clicks on the link, the loop that created all the links will be done and i will have its final value - probably either the last item in the list or one greater than that item's index, depending on how the loop is written. Whatever its value is, you once again have the situation where all links play the same item. The solution in your code gets a little meta, by using a function whose return value is another function. If you pass the loop control variable to the generating function as an argument, the new function it creates can reference that parameter and always get the value that was originally passed in, no matter what has happened to the value of the outer argument variable since: function generate_onclick(j) { // no matter when the returned function is called, its "j" will be // the value passed into this call of "generate_onclick" return function() { ytplayer_playitem = j; ytplayer_playlazy(1000); } } To use that, call it inside the loop like this: a.onclick = generate_onclick(i); Each generated function gets its very own j variable, which keeps its value forever instead of changing when i does. So each link plays the right thing; mission accomplished! That's exactly what your posted original code is doing, with one small difference: just like the first step in my explanation, the author chose to use an anonymous function instead of defining a named one. The other difference here is that they are also calling that anonymous function immediately after defining it. This code: a.onclick = (function (j) { ... })(i) is the anonymous version of this code: function gen(j) { ... } a.onclick = gen() The extra parens in the anonymous version are needed because of JavaScript's semicolon-insertion rules; function (y) {...}(blah) compiles as a standalone function definition followed by a standalone expression in parentheses, rather than a function call.
https://codedump.io/share/PrAEauAFaais/1/javascriptsetting-up-onclick-method-syntax
CC-MAIN-2017-39
refinedweb
636
60.75
Both C++ and Ruby support public, protected, and private members. In the example, the method count_words_in_file is declared as private in both implementations. In both C++ and Ruby, public methods can be called by anyone, and protected methods can be called only by objects of the same class or objects that inherit from the defining class. The semantics of private differ between C++ and Ruby, however. In C++, methods are private to the class, while in Ruby they are private to the instance. In other words, you can never explicitly specify the receiver for a private method call in Ruby. Blocks and Closures One feature of Ruby for which C++ has no good counterpart is its support of blocks. The most common use for blocks is iteration. You'll find examples of iteration with blocks in Listing 2's implementation of the WordCounter class at lines 65, 73, and 76. Consider the code at line 65 for example: Dir.foreach(".") { |filename| count_words_in_file filename } The class Dir is used to inspect directories. The method foreach is passed two arguments: the string "." and the block of code in parentheses, which in turn specifies an argument filename within the vertical bars. The method foreach iteratively invokes the block, passing in the names of each file found in the current working directory ".". This simple feature can save significant keystrokes and also leads to very readable code. Blocks also are useful for more than just iteration. Line 48 uses a block to specify the comparison function to use for sorting an array of pairs: def file_occurrences return @file_hash.sort { |x,y| –(x[1]<=>y[1]) } end The expression x <=> y is -1 if x < y, 0 if x == y, and 1 if x > y. The above code returns an array of pairs, where each pair consists of a String and a FixNum. The block specifies that the second element of each pair (the FixNum) should be compared using the negation of the <=> operator. This method therefore returns the word occurrences pairs in decreasing order of occurrences. At line 15 of Listing 1, the C++ example code also specifies a comparison function to be used for ordering pairs. However, lacking support for anonymous functions, the comparison is implemented as a function object, later used to define the STL multiset at line 25. The blocks in Ruby are so useful in part because they are closures. A closure captures the context in which it is defined, so it can refer to local variables found within the scope of the definition. Take for example the code at line 76 of Listing 2: wc.file_occurrences.each { |pair| f = e.add_element "file", {"occurrences"=>"#{pair[1]}"} f.add_text pair[0] } The expression wc.file_occurrences returns an array of pairs. The array's method each is then invoked with the subsequent block as an argument. It's important to note that the block will be invoked from within the method each. However, because the block is a closure, it can still access the object e (which represents an XML element) that was in the local scope of the method where the block was defined. While you can use C++ function objects to implement much of the functionality described above, I believe that the elegance and readability of blocks speak for themselves. A Wide Range of Libraries, Regular Expressions Another clear advantage that Ruby has over C++ is the vast collection of libraries that come with the standard distribution, as well as its support for regular expressions. For example, compare the ad-hoc implementation of an XML generator in method dump_results in Listing 1 to the use of the REXML library in Listing 2. Next, note the use of the pseudo-standard dirent.h for working with directories in C++ to that of the class Dir in the Ruby implementation. Finally, compare the ad-hoc parsing of the files at line 77 of Listing 1 to the much more concise code at line 90 of Listing 2. While many available C++ libraries, such as Boost, provide a wide range of utilities, Ruby provides many of these features as part of the standard distribution. So out-of-the-box, the Ruby programming language and its standard libraries simplify many of the more common programming tasks when compared to C++. Please enable Javascript in your browser, before you post the comment! Now Javascript is disabled. Your name/nickname Your email WebSite Subject (Maximum characters: 1200). You have 1200 characters left.
http://www.devx.com/RubySpecialReport/Article/34497/0/page/3
CC-MAIN-2017-13
refinedweb
745
63.7
Research on the recent OpenBSD select() bug and its possible exploitation. Includes a local denial of service exploit which was tested on OpenBSD v2.6 - 3.1. 11b34ff9c52e9241262598028265afec Hi there, Recently a bug in the select() syscall of openbsd was published. This text describes the details and the eventual exploitation of this bug. First of all let us look at the definition of select(): int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); The first argument is the number of the file descriptors, followed by the three sets of descriptors (read,write,except) plus a timeout before returning, which is optional (NULL equals no timeout). The implementation of sys_select() takes place in kern/sys_generic.c. Let's go through the code, step by) #define getbits(name, x) \ if (SCARG(uap, name) && (error = copyin((caddr_t)SCARG(uap, name), \ (caddr_t)pibits[x], ni))) \ goto done; (4) getbits(in, 0); getbits(ou, 1); getbits(ex, 2); #undef getbits .. SCARG is a macro to access arg2 from structure arg1. At (1) an upperbound check is done to adjust 'nd' (arg1 of select) in case it is bigger than the number of open files that are allocated. There we spot the first problem. Both values of the comparison are signed integers and it only checks for an upperbound limit. What happens if you enter a negative value ? We will see. At (2) it stores in 'ni' (which is defined as u_int) how many bytes are needed to copy from the descriptor sets to the local pibits fd_set. If we assume that 'nd' is a negative value then something special happens. Let's zoom in: (from sys/types.h) #define NBBY 8 typedef int32_t fd_mask; #define NFDBITS (sizeof(fd_mask) * NBBY) #define howmany(x, y) (((x) + ((y) - 1)) / (y)) On an i386 machine int32_t is 4 bytes, thus NFDBITS equals 32. If x is smaller than -31 howmany results in a negative value, thus 'ni' swaps to a very big unsigned number. e.g. 536870908. This behaviour has a catastrophic impact then the macro (3) getbits does a (4) copyin (which is infact something like bcopy) from in,ou,ex to pibits[] with the length of ni! What does that mean? You can overwrite kernel memory by providing a negative nd and with pointers to arbitrary data as arg2,3,4 of the select syscall, since the length 'ni' is pretty messed up. Like that it's very trivial to crash the system as unpriviledged user. It might even be possible to compromise the system with specially crafted pointers... What follows is a very small program which immediately crashes any unpatched OpenBSD system (tested 2.6-3.1) as unpriviledged user: cat > obsdfault.c << EOF #include <sys/types.h> #include <sys/time.h> #include <unistd.h> int main() { int r; char *la = "VBASAAAAAAAAAAAAAAA"; r = select(-19999, la, NULL, NULL, NULL); exit(0); } EOF ugh. yes, it's that easy. Now, select is a very vital syscall and it is/was buggy. Imagine, there are 182 other syscalls .... ;-). Have fun, your drugphish.ch security team sec@drugphish.ch
http://packetstormsecurity.org/files/29772/openbsd-select-bug.txt.html
crawl-003
refinedweb
514
65.93
Secure HTTPS Requests to URL Using NodeMCU ESP8266 Fetching or posting data over the Internet is one of the main core functions of the IoT device. Doing so over HTTP is better implemented in NodeMCU ESP8366 Arduino libraries, but makes things more difficult for HTTPS requests. In this post, I will talk about the most common approaches used by the community and will show you the method to make Secure HTTPS Requests to URL Using NodeMCU ESP8266. No special certificates or fingerprints are required to manually code the program using this method. HTTPS is a method of requesting HTTP over a TLS (formerly SSL) connection. By doing so, the data sent between and behind your computer and server is encrypted and secure. The good news is that this protocol can be used in conjunction with the ESP8266 WiFiClientSecure class. The bad news is those common methods have some major disadvantages. First I will discuss the two most common methods, and next, I will describe the generic solutions to their problems. What are CA certificates? Before diving into the details I will briefly describe the basic principles of secure HTTPS requests in general terms. Generally, there is a certificate for each website. This certificate is issued by someone called the Certification Authority (CA). Each CA certificate can be issued by another CA which invites the so-called certificate chain. In the picture, the chain certificates are long, but in reality, the length of the chain can be anything. The top-level certificate is called the root certificate. This certificate is self-signed, which means it can be trusted naturally. This is because only a few organizations can issue root certificates, and these are believed not to provide fake or incorrect certificates. When you request an HTTPS for a website from your browser, the browser looks at the certificate for the website and verifies that the authentication is actually issued by its parent. This can be done because each certificate is signed with the private key of the upstream certificate. Details for dummies in public and private key functions can be found here. When it is verified that the certificate is actually issued by a trusted root CA issuer, it is verified that the domain in the certificate is the same as the actual domain. If this is true, we know who the server claims to be, and a secure connection can be started. Also Read: ESP8266 Data Logger to Upload Data on Webserver These trusted root certificates are actually stored as part of your browser to validate all other certificates. Each OS or browser sets about 10-200 basic certificates a little differently, which it knows can be trusted. This is called a certificate store, and this is what I will implement in this project with ESP8266. But first, let’s start with the two most popular approaches. HTTPS Requests to URL Using Fingerprints – secure but annoying The method proposed in the official NodeMCU ESP8266 Arduino document is to extract the fingerprint of the site’s certificate and store it in the code. A fingerprint is a hash of a certificate. Because it is highly unlikely that a second certificate exists with the same hash, we know that the website can be trusted if the hash is stored with us. const char* host = ""; const char* fingerpr = "CF 05 98 89 CA FF 8E D8 5E 5C E0 C2 E4 F7 E6 C3 C7 50 DD 5C"; WiFiClientSecure client; client.connect(host, httpsPort); if (client.verify(fingerpr, host)) { http.begin(client, host); String payload; if (http.GET() == HTTP_CODE_OK) payload = http.getString(); } else { Serial.println("certificate doesn't match"); } This approach is simple because the certificate chain does not need to be certified, but for me, there are two main issues: - NodeMCU ESP8266 is required to extract fingerprints and manually connect to each page. - The bigger issue is that these fingerprints change once a year when the certificate expires. This means that your program can break at any time and you need to manually update the fingerprint on the code. HTTPS Requests to URL Using client.setInsecure() – easy but unsafe You could argue that secure connections to your app are overkill. I may be the first person that I want as practical a solution as possible. Imagine what you want to do with your ESP8266 is to bring the weather from the internet and show it off somehow. Personally I don’t mind doing it unsafely because there are no real risks. But imagine that the ESP8266 is controlling the lock on your door or the 3D printer can give heat and catch fire. Or think of a case where you are transferring personal information or from some site or API. It is better to be safe than sorry in these cases, and the method should not be used in this section. Anyway, I’ll show it here: const char* host = ""; WiFiClientSecure client; client.setInsecure(); //the magic line, use with caution client.connect(host, httpsPort); http.begin(client, host); String payload; if (http.GET() == HTTP_CODE_OK) payload = http.getString(); So basically all you need to do is add the client.setinsecure () to your code and it starts the connection without verifying the certificate. HTTPS Requests to URL with the IoT framework With that out, we finally get to the implementation I choose instead of the ESP8266 IoT Framework that is placed in the Fetch class. const char* host = ""; String payload; if (fetch.GET(host) == HTTP_CODE_OK) payload = http.getString(); fetch.clean(); Sounds easy enough doesn’t it? So what happens behind the scenes? You are learning to make Secure HTTPS Requests to URL Using ESP8266. Usually the same thing in the same browser. ESP8266 has a complete repository of all reliable root certificates in PROGMEM memory. At this point, the flash memory takes about ~ 170 KB, which is easily remembered in my case. This certificate is generated automatically in the creation of the store software, no manual steps are required. This also means that you can make secure HTTPS requests to any URL with ESP8266 (so you can configure or change the URL after creation). You may think so, but hey! These certificates also expire. And this is true. The only difference with fingerprints is that the validity of root certificates is very long, and can be more than 20 years. While for some services the fingerprint may change every few months. As a starting point, I found an excellent but hidden example in ESP8266 Arduino Repo. This example includes a Python script that retrieves all certificates from the Mozilla Original Certificate Store and stores them as files. These files will then be uploaded to SPIFFS and used during HTTPS requests. I optimized this example to be able to store certificates instead of PROGMEM. Generating a certificate store When the request starts, the certStore class will compare the certificate issuer’s hash with all the hashes of the original certificates stored. If there is a match, the authenticity of the domain and other assets will be checked and the connection will be initiated. In the default Arduino instance, these hashes for stored certificates are generated in the certStore class. It seems more logical to me to do this directly in Python script to save computer time on ESP8266, so that’s where I moved it. In addition, I customized the certificate system class (GitHub) to read information from my PROGMEM variable, not from my system program. The final Python script to generate the certificate store is provided below. from __future__ import print_function import csv import os import sys from asn1crypto.x509 import Certificate import hashlib from subprocess import Popen, PIPE, call, check_output try: from urllib.request import urlopen except: from urllib2 import urlopen try: from StringIO import StringIO except: from io import StringIO #path to openssl openssl = "C:\msys32\usr\bin\openssl" f = open("src/generated/certificates.h", "w", encoding="utf8") f.write("#ifndef CERT_H" + "\n") f.write("#define CERT_H" + "\n\n") f.write("#include <Arduino.h>" + "\n\n") # Mozilla's URL for the CSV file with included PEM certs mozurl = "" mozurl += "mozilla/IncludedCACertificateReportPEMCSV" # Load the names[] and pems[] array from the URL names = [] pems = [] dates = [] response = urlopen(mozurl) csvData = response.read() if sys.version_info[0] > 2: csvData = csvData.decode('utf-8') csvFile = StringIO(csvData) csvReader = csv.reader(csvFile) for row in csvReader: names.append(row[0]+":"+row[1]+":"+row[2]) pems.append(row[30]) dates.append(row[8]) del names[0] # Remove headers del pems[0] # Remove headers del dates[0] # Remove headers derFiles = [] totalbytes = 0 idx = 0 # Process the text PEM using openssl into DER files sizes=[] for i in range(0, len(pems)): certName = "ca_%03d.der" % (idx); thisPem = pems[i].replace("'", "") print(dates[i] + " -> " + certName) f.write(("//" + dates[i] + " " + names[i] + "\n")) ssl = Popen([openssl,'x509','-inform','PEM','-outform','DER','-out', certName], shell = False, stdin = PIPE) pipe = ssl.stdin pipe.write(thisPem.encode('utf-8')) pipe.close() ssl.wait() if os.path.exists(certName): derFiles.append(certName) der = open(certName,'rb') bytestr = der.read(); sizes.append(len(bytestr)) cert = Certificate.load(bytestr) idxHash = hashlib.sha256(cert.issuer.dump()).digest() # for each certificate store the binary data as a byte array f.write("const uint8_t cert_" + str(idx) + "[] PROGMEM = {") for j in range(0, len(bytestr)): totalbytes+=1 f.write(hex(bytestr[j])) if j<len(bytestr)-1: f.write(", ") f.write("};\n") # for each hashed certificate issuer, store the binary data as a byte array f.write("const uint8_t idx_" + str(idx) + "[] PROGMEM = {") for j in range(0, len(idxHash)): totalbytes+=1 f.write(hex(idxHash[j])) if j<len(idxHash)-1: f.write(", ") f.write("};\n\n") der.close() idx = idx + 1 f.write("//global variables for certificates using " + str(totalbytes) + " bytes\n") f.write("const uint16_t numberOfCertificates PROGMEM = " + str(idx) + ";\n\n") # store a vector with the length in bytes for each certificate f.write("const uint16_t certSizes[] PROGMEM = {") for i in range(0, idx): f.write(str(sizes[i])) if i<idx-1: f.write(", ") f.write("};\n\n") # store a vector with pointers to all certificates f.write("const uint8_t* const certificates[] PROGMEM = {") for i in range(0, idx): f.write("cert_" + str(i)) os.unlink(derFiles[i]) if i<idx-1: f.write(", ") f.write("};\n\n") # store a vector with pointers to all certificate issuer hashes f.write("const uint8_t* const indices[] PROGMEM = {") for i in range(0, idx): f.write("idx_" + str(i)) if i<idx-1: f.write(", ") f.write("};\n\n#endif" + "\n") f.close() Existing header file certificates.h is saved and included in the application. The Python Script is hooked in PlatformIO so that each build can be implemented automatically, with a new version of the Certificate included automatically. HTTPS Requests to URL Using ESP8266 Source Code This post was a short-level review of what snippets of code were included. The full application for the ESP8266 IoT Framework can be found on GitHub. Documents for the fetch class can be found here. Conclusion In this tutorial, I have shown you how to make Secure HTTPS Requests to URL Using NodeMCU ESP8266. Now you can modify this project and make HTTPS POST or HTTPS GET Request to any URL. I hope you enjoyed reading this article. If you have any questions, comments, or ideas? Let me know in the comment section below. You might also like reading: - RFID Based Attendance System Using NodeMCU with PHP Web App - BME280 Based Mini Weather Station using ESP8266/ESP32 - IoT Based Patient Health Monitoring System Using ESP8266/ESP32 Web Server - Capacitive Soil Moisture Sensor with OLED Display & Arduino - Internet Clock Using NodeMCU ESP8266 and 16×2 LCD without RTC Module - ESP8266 Plot Sensor readings to Webserver in Real-Time Chart - Simple Weather station using Arduino & BME280 Barometric Pressure Sensor - Connect RFID to PHP & MySQL Database with NodeMcu ESP8266 - NodeMCU ESP8266 Monitoring DHT11/DHT22 Temperature and Humidity with Local Web Server - Home Automation with MIT App Inventor and ESP8266 One Comment
https://theiotprojects.com/https-requests-to-url-using-esp8266/
CC-MAIN-2021-43
refinedweb
1,996
57.57
Most of us will have experienced the dread of updating documentation at some point or other. C# and Visual Studio .NET (VS.NET) give us the ability to maintain code and documentation in the same file, which makes the whole process a lot easier. VS.NET does this. VS.NET produces XML comments. The first thing you need to do is enable the XML commenting feature for your VS.NET project. With this enabled, your XML comment data file will be rebuilt each time you build your project. Any problems that occur when trying to generate the file will not prevent a build but will be flagged in the VS.NET Task List. Assuming you do not have compile warnings set to errors. VS.NET Task List flagging XML commenting error. With that enabled you can start to use the special XML tags in your procedure “headers”. To get you started, place the cursor on the line directly above a procedure’s definition. Once there, press the “/” key three times, this will automatically insert a summary tag into your code. If the procedure had any arguments there should now be a param tag for each one. /// <summary> /// /// </summary> /// <param name="data"></param> public void SaveData(ref DataSet data) { } The SaveData code above is what is inserted as default SaveData /// <summary> /// Connects to the database and attempts to apply /// all adds, updates and deletes /// </summary> /// <param name="data">a dataset, passed by reference, /// that contains all the /// data for updating>/param> public void SaveData(ref DataSet data) { } This SaveData code is after I have added my comments describing what the routine does in the summary tag and what the data parameter is. This very simple action has given us enough to provide basic documentation including intellisense just like that provided by the .NET Framework assemblies. It is clear from just this feature, how useful XML commenting is. When you include a reference to a .NET project that has XML commenting enabled, the XML documentation file we named earlier is copied over along with the binary to the current project’s \bin directory. This gives you the intellisense across assemblies. The summary tag is the most basic of tags. The list below is the complete set currently supported by VS.NET. The ones marked with a * are the ones I feel are the most useful and the ones we will be dealing in the following examples. c The c tag gives you a way to indicate that text within a description should be marked as code. Use code to indicate multiple lines as code. c code code* The code tag gives you a way to indicate multiple lines as code. Use <c> to indicate that text within a description should be marked as code. <c> example* The example tag lets you specify an example of how to use a method or other library member. Commonly, this would involve use of the code tag. example exception* The exception tag lets you specify which exceptions a class can throw. exception include The include tag lets you refer to comments in another file that describe the types and members in your source code. This is an alternative to placing documentation comments directly in your source code file. include para The para tag is for use inside a tag, such as <remarks> or <returns>, and lets you add structure to the text. para <remarks> <returns> param* The param tag should be used in the comment for a method declaration to describe one of the parameters for the method. param paramref The paramref tag gives you a way to indicate that a word is a parameter. The XML file can be processed to format this parameter in some distinct way. paramref permission* The permission tag lets you document the access of a member. The System.Security.PermissionSet lets you specify access to a member. permission System.Security.PermissionSet remarks* The remarks tag is where you can specify overview information about a class or other type. <summary> is where you can describe the members of the type. remarks <summary> returns The returns tag should be used in the comment for a method declaration to describe the return value. returns see The see tag lets you specify a link from within text. Use <seealso> to indicate text that you might want to appear in a See Also section. see <seealso> seealso* The seealso tag lets you specify the text that you might want to appear in a See Also section. Use <see> to specify a link from within text. seealso <see> summary* The summary tag should be used to describe a member for a type. Use <remarks> to supply information about the type itself. summary value* The value tag lets you describe a property. Note that when you add a property via code wizard in the Visual Studio .NET development environment, it will add a <summary> tag for the new property. You should then manually add a <value> tag to describe the value that the property represents. value <value> We have taken the intellisense format as far as it will go, but there is much more we can do with MSDN style documentation. There is a tool that comes with VS.NET that you will find at “Tools|Build Comment Web Pages…” which will take your C# XML comments from source files and generate linked HTML files. This comes straight out of the box so should not be totally disregarded. But if you want to create easy-to-use, helpful, cross-referenced and attractive documentation, then I can strongly recommend the free, open source tool NDoc. The screenshot below is taken from a compiled help file produced from NDoc and is an example of the quality it can produce. The two routines below will show the correct usage for most of the XML comment tags we saw earlier. The cref attribute of the exception tag is used for cross-referencing to an Exception type. This attribute is also used in the seealso, permission and see tags to reference a type. The type must be available from the current compilation environment. The compiler checks that the referenced type exists and passes relevant data to the output XML. cref /// <summary> /// Gets or sets the age of the person involved in the accident /// </summary> /// <value>Age of the claimant.</value> /// <remarks> The value must be numeric. /// </remarks> /// <exception cref="System.ApplicationException">Thrown when a non- /// numeric value is assigned.</exception> public string Age { } This Age property once processed by NDoc will produce this. Age I have drawn attention to areas in the picture and their corresponding XML comment tags. /// <summary> /// Connects to the database and attempts to apply all adds, /// updates and deletes /// </summary> /// <seealso cref="Adjuster.BusinessServices.Accident"/> /// <param name="data">a dataset, passed by reference, /// that contains all the /// data for updating</param> /// <example> This sample shows how to call the SaveData /// method from a wireless device. /// <code> /// ///AccidentCRUD accCRUD = new Adjuster.BusinessServices.AccidentCRUD(); ///accCRUD.SaveData(ref ds); /// ///</code> ///</example> ///<permission cref="System.Security.PermissionSet">Everyone ///can access this method.</Permission> public void SaveData(ref DataSet data) { } This SaveData method once processed by NDoc will produce this Again I have drawn attention to areas in the picture and their corresponding XML comment tags. The Accident cross-reference in the “See Also” section is the only one that I added. By default NDoc adds cross-referencing for the parent class, the parent class’ members and the parent class’ namespace. Accident With the combination of NDoc and VS.Net & C#’s ability to produce these comments you can get great technical documentation at a level so close to the code, that there is absolutely no excuse for it not telling it as.
http://www.codeproject.com/Articles/3009/C-Documenting-and-Commenting?fid=11807&df=90&mpp=25&sort=Position&spc=Relaxed&tid=2275294&PageFlow=FixedWidth
CC-MAIN-2014-52
refinedweb
1,290
64.2
Top 5 reasons jQuery doesn't suck Learn the top 5 reasons why jQuery is being used today. This Article Covers Java client platforms Like spending time on a yacht, jQuery doesnʼt suck. Here are my top 5 reasons why. 5. Do you really want to spend your life writing if statements to deal with browser differences? While the state of Cross-browser Difference Hell in 2011 has improved slightly over past years, there are still tons of browser specifics we need to deal with. Someday all browsers might follow the W3C standards so that client-side script can enjoy the "write once, run anywhere" capability that we enjoy on the server, but that day hasn't arrived. jQuery deals with the vast majority of browser specifics so that we don't have to. We write to a single API and, with very few exceptions, things “just work” on all modern browsers. ><< 4. Events make the Web go around, and the different event models can make your head spin with it! We canʼt escape event handling in modern web user interfaces -- we just canʼt. Even web sites that just show pictures of kittens have gotten mighty fancy. And one of the most frustrating areas with respect to cross-browser differences are the various event models. Should we use the ubiquitous but limiting DOM 0 Event Model? Should we use the more versatile DOM 2 Event Model in all but IE, and IEʼs proprietary model? Arghhh! Back to tons of conditionals! Not only does jQuery provide an event model that works across all browsers, it offers event-focused features that make dealing with events almost fun! We can define “live” events for elements that donʼt even exist yet, group event types into namespaces to make them easier to manage as a group, or even define custom events. The latter gives us a means to use a publish/subscribe model in script -- something we can immediately see vastly simplifies many things and reduces coupling. We like that! 3. You know you want to create DOM elements on the fly, but the XML API blows chunks. Creating, manipulating and removing DOM elements is the life-blood of any dynamic web user interface, but the XML-centric API provided by the browsers is tedious in the extreme! jQuery provides a simple API that allows us to easily create DOM elements, blow them away, move them around, or otherwise manipulate them in any way that we see fit. By-by NodeList! Donʼt let the door hit ya! 2. Plug it in! Plug it in! What would we do without the rich ecosystem thatʼs grown up around Java? Imagine life without the 3rd-party libraries that make Java so much more than just the core language and its libraries! Similarly jQuery -- which was wisely engineered from the ground up with the ability to be extended -- has a huge community of plug-in writers that have provided an incredibly rich set of plugins to do just about anything we might want to do in our client-side scripts. Date pickers? Form validation? Fancy controls? Animation effects? Modal dialogs? Social integration? No problem! And if we canʼt find a plugin to do it (whatever it is), itʼs a snap to extend jQuery ourselves. 1. Ajax is the bomb, but dealing with the nuances can make your brain explode! Itʼs be hard to think of a technology thatʼs changed the face of web interfaces more than Ajax. Most modern user interfaces either depend upon Ajax capabilities completely, or could at least benefit from some level of Ajaxificiation. But Ajax, like most other advanced browser features has complexities that can frustrate the modern page author to the point of extreme hair pullage. jQuery makes Ajax as simple as scrubbing the kitchen sink with, well, the other Ajax. Simpler in fact -- sink scrubbing is hard work. Ajax with jQuery is not. jQuery handles all the cross-browser nuances of making and receiving Ajax requests and responses, as well as offering such advanced capabilities as: centralizing error handling and events, automatic JSON conversions, form value serialization, and a ton of other freebies that make writing Ajax “by hand” seem like using stone knives and bear skins. Conclusion You want to use jQuery. You really do! Admit it. All the cool kids are doing it. And with very good reasons.
http://www.theserverside.com/feature/Top-5-reasons-jQuery-doesnt-suck
CC-MAIN-2016-36
refinedweb
727
70.73
WIPO To Loosen Domain Names Transfer Standards 170 ethereal writes "According to Brian Livingston's column on C|Net, WIPO is considering some new rules which would make it easier for plaintiffs to get domain names which are '"geographical terms," individuals' personal names and "tradenames"'. The story also discusses how WIPO now gets the lion's share of the domain name disputes because they rule for the plaintiff the most often (surprise surprise) and have even transferred domains away from defendants who were acting in good faith (read: cybersquatting). WIPO is accepting comments on these new rules until Aug. 15." Question for the lawyers (Score:1) Can Microsoft sue either Joe or me for trademark infringment? Wouldn't this be the same as if I ran a "Mystery Train" restaurant and gave the diner's real-life but only-locally-used names like "Davy Crockett", "Bill Gates", etc? -- Barcelona.com (Score:1) Quote: BARCELONA, Spain - The owners of Barcelona.com face a legal battle after losing their domain name in a decision issued this week. The company's tourism Web site will be handed over to the Barcelona City Council in Spain. The World Intellectual Property Organization, or WIPO, in Geneva, Switzerland, ruled Wednesday that the City Council had "better rights" to the name than the company, but the decision creates uncertainty for thousands of geographic domain-name owners. Your reasoning is flawed (Score:1) Procter & Gamble Co., the largest U.S. maker of household products, has bought thousands of domains. They have been sitting on many for five years. Are they squatters also? >Likewise, the montyroberts.com dispute involves a person using it for negative commentary about the actual plaintiff. This would be considered misuse under most arbitrators review. You do not believe in free speech? Re:Confusing article header (Score:2) The fault is mine as the submitter, rather than due to one of the /. editors. It figures that after several well-thought-out but rejected submissions, this one that I dashed off in haste got accepted. Thanks for good clarifications. I think that's what I said - I was trying to summarize the article rather than repeat it in the submission box. This is a complicated topic which is tough to explain in a few words. IANAL, but this is the case for many other kinds of law - it makes more sense than letting the defendant pick I think. What would be most fair would be to only have one arbitration system (so that both plaintiffs and defendants know what they're getting into) but subject it to much closer oversight. WIPO is in the process of rewriting international trademark law without legislative approval or control as we speak, which I find very disturbing. Unless some balance and consideration for the individual/small business is brought back into the discussion, WIPO could very easily eclipse NSI and the U.S. Congress as the major threat to the Internet as we know it. Re:Demand fair arbitration from ICANN candidates (Score:1) UN vs US (Score:2) Don't blame the UN. Lobby YOUR congressmen about this. After all, it was they who voted the US to become a member of the UN, and applied their citizenry under it. Just drop domain names already. (Score:1) [company/person]-->[ip address]-->[domain name] Look at a phone book; People are only two steps away: [company/person]--> phone number It may be a bit confusing at first, but if there was a directory for ip addresses, we wouldn't have all these issues. The idea of a domain name was that it is easier to remember. Obviously, this then allows people to skip looking up an ip address in a phone book. However, there are so many domains, and all these disputes, that it just isn't worth it. There already are laws about company names, and they should just use those here. Wouldn't it be nice to do a whois based on a company name rather than trying to guess their domain name? There only problem is that ip addresses can change quickly. But if Domain Name servers can keep up, so can another scheme. ---------------- Re:Jurisdiction (Score:1) they should remember that any one of the several hundred times a year they put motions before the UN, then. Arbitrators Decisions (Score:2) If anybody tried to introduce libraries today, WIPO would stop them - claiming copyright infringement. My protest site WIPO.org.uk [wipo.org.uk] is nothing to do with power mad WIPO.org. Re:Americans ignoring the UN (Score:1) Come and get me baby! Probe me all you want, just get me off this rock! PS- I'm serious. I'm not staying here any longer than I have to. Re:The Only Comment WIPO Needs To Hear... (Score:1) Corp. America (Score:1) Read sig. Re:Errors in Livingston's Article (Score:1) actually, i just read the complaint on the WIPO site and realized that it is much the same as the jcrew decision... he was also a squatter to think that i had sent this guy an email supporting him in his decision to take the WIPO to court. the more of the decisions i read, the more i figure that on the whole, the WIPO makes reasonable decisions... on the other hand, i think that the PETA.com website should have stayed in the hands of the parody-site People Eating Tasty Animals after all, PETA is an organization (and owned PETA.org at the time) that People.Eating... is funny perhaps they could still get PeopleEatingTastyAnimals.com How long will this even matter? (Score:1) Consider telephones: Telegraph was the precursor. Address were physical address; you just wired the message to the appropriate station and the hardcopy was delivered to the recipient. Any naming convention based on that is obsolete. Early phones (based on watching The Andy Griffith Show Party lines: Later, less populous areas got these. I'm not really familiar with them, but I think it was basically a single line shared by multiple households. I don't know if there was a unique number for each household, or one number for the whole thing. This may or may not be wholly obsolete 7-digit local: current system; been stable for quite a while. Number *does not* stay with you when you move, generally. There is almost no constancy to a person's phone #. area code + 7 long distance: see above; necessary to differentiate regions area code + 7 (10 digit) local: Due to growing numbers of phone users, the numbering convention is being increased in many areas. This may eventually make obsolete the 7-digit number (that is, your former number will be insufficient to dial you except for your closest neighbors) What's next? IP telphony? Will we even have phone numbers? Will they be 10, 13, 20 digits long? Multiple phones with multiple numbers, or will we see consolidation efforts? If the simple U.S. phone system has seen this, should we expect the *global* WWW naming convention to remain stable over the next several decades? I predict major changes within 10 years, that make obsolete many of the current names, leading to a new cyber-squatting rush. But, IANAC (I am not a clairvoyant There's the rub... (Score:2) Do you trust your software to be free from defects, or if defects are found that the vendor will respond in a timely and effective manner? Do you trust that your government and it's law enforcement are acting in your best interests - to protect you from harm and allow you to excercise the maximum freedom afforded to you under the constitution? Is the WIPO the problem... or a symptom of the problem? That's an odd interpretation (Score:1) How do you come up with this interpretation of 'in good faith'? That phrase would suggest to me that someone had registered the domain name for their own use, not to 'squat' on it. Re:The Only Comment WIPO Needs To Hear... (Score:1) How many domains are actually registered under ".us" as a domain? Exactly, the top level domains are Global in scope, so it is only right that a global body is responsible for settling disputes So, trolling loser, if you don't like a "FOREIGN power" having influence over you, then choose to use your national domain. Really, never ceases to amaze me how parochial [dictionary.com] some Americans can be. (link is to dictionary.com, I'm sure you'll need to look up the meaning.;) Reminds me of gumby.com all over again... (Score:1) What's next? Kids' names? We can't name our kids the same thing a political figure or a movie superstar is named? "No, you can't name your child Newt." (Who would want to name their kid Newt anyway?) This could be abused. If you don't like someone's website, trademark their website's name or just something close to it and shut it down. Granted, something like a guy making "\ Dotmark", a school supplies company (markers, crayons, etc) won't take down Slashdot, but if Slashdot wasn't trademarked, they could use WIPO to say that Slashdot.org was too close to the tradename of "\ Dotmark" and transfer ownership. WIPO Decisions (Score:2) Decisions (in English) [wipo.int] Décisions (in French) [wipo.int] Resoluciones (in Spanish) [wipo.int] Errors in Livingston's Article (Score:3) He states that the crew.com case involved a "small business" and not a squatter, yet the company that registered it had 50+ domain names of registered companies it was selling. Seems to be a squatter to me. Likewise, the montyroberts.com dispute involves a person using it for negative commentary about the actual plaintiff. This would be considered misuse under most arbitrators review. I agree with his concerns, just wish he used more appropriate examples of the abuses WIPO has performed. Re:The Only Comment WIPO Needs To Hear... (Score:2) Art. VI, Section 2. See And no, I'm not psyched about that part any more than you are.. Gargoyle_sNake TheKult.org [thekult.org] -=Gargoyle_sNake -=-=-=- Re:Speculation != Squatting (Score:1) Actually yes it is. Common sense and a little judgement and you realize that. The real estate business is bullshit. As much money as there is in it, its the end user that gets fucked over every time when the house sells for 3x what was paid for it. I'm rather sick of it, its been happening in my neighborhood for years. (ohh, but property values go up up up.. fuck that, I like this neighborhood and do not want to be stuck living with the ultra rich. very few rich geeks will come cuz this is the heart of the biblebelt.) Is it squatting if someone got into Ultima in the beginning and managed to build a huge castle, something which noone else can do as there's not enough land? Its a video game, if somebody doesn't like it, go to a different server or play a real game (Rainbow 6 - Rogue Spear: Urban Operations comes to mind, but insert any NON-monthly-fee-ripoff-of-a-game here.) UO is just a bad idea in the first place. You are paying to play your game. It should be open and have 100% free public servers run by anyone and everyone. Use a copy of Gamespy Lite with the game to organize the servers. Just make sure the server has a linux version and boom, you have plenty of servers (every body knows linux geeks like to run game servers). -=Gargoyle_sNake TheKult.org [thekult.org] -=Gargoyle_sNake -=-=-=- Re:It's a hazard to have a domain name nowadays (Score:1) Re:It's a hazard to have a domain name nowadays (Score:1) Papa Johns forever. Mike "I would kill everyone in this room for a drop of sweet, tasty beer." Domain trademark (Score:1) Re:So what are the alternatives? (Score:1) I agree with this premise, that it should be local (city/county), state, regional, then national, then worldwide (domain.com). It makes good sense, because disputes over a name like Pillar.org would be far less likely to occur, because it might be something like pillar.la.ca.us. And, if we have to have .org, .com, .net, I don't see why one: registrars couldn't ask people to prove they are a non-profit organization, commercial entity (has business license) or a network (ISPs and such). I'd also like another extension or two for people who fit none of those (.per - personal domain?). However, a domain like bobs-stuff.portland.or.us isn't as easy to remember as bobs-stuff.com and it doesn't look as cool, so I'm not holding my breath. Re:WIPO.org.uk told you - WIPO are power Mad (Score:1) Anyone could randomly assemble letters and register domain names, and then wait for someone to come along wanting to use that domain and offer to 'sell' it to them. As if they owned it in the first place. Selling a domain name is in my mind a lot like selling electromagnetic frequencies, or the rights to use certain musical notes. As individual units of communication they are not, and should not be, viewed as property. They are tools and building blocks; creative people use them to make genuine intellectual property. Parasites use them to make money. There is a qualified difference. One of those activities benefits society. The other benefits no one but the parasite. Re:Could there be a "Freenet" type alternative? (Score:1) The trouble is - they are "GENERIC" names. That means they are easier to take off you - by a bigger company. I have protest site, WIPO.org.uk, that gives examples of the names being taken. Domain names shouldn't need to be obvious (Score:2) IMHO, the real problem is that people expect that domain names should be guessable. No one would ever dream dialing 1-800-FORD-CAR and expect to be able to purchase a Ford car that way, but for some reason, every legal body in this planet thinks that Joe Six Pack is going to sit down at his computer, and instead of looking up the address, he's just going to type ford.com. This whole problem with domain names would go away if people just stopped expeting them to be obvious, because that's just not going to happen. That's what directories are for. Yahoo is really good at that sort of thing - in addition to being a normal web search engine, they have an index which is manually created, with descriptions and categories. Some web browsers even have this capability built-in. The courts don't protect phone numbers and street addresses, so why should they protect domain names? I can petition to my street changed to "Ford Lane" if I wanted, and Ford Motor Company can't do squat about it, even if I lived in Detroit. -- Huge backlog (Score:1) Re:So what are the alternatives? (Score:1) Honestly, I would be perfectly happy with pillars.norfolk.va.us for a domain name. Just didn't think it was possible, given the front page of the US domain registry home page []. But let's find out for sure... Okay, the norfolk.va.us domain is controlled by infi.net [infi.net]. I'm calling them now.... Apparently the receptionist has never heard of this kind of request before. I got referred to Tony Rolls' voicemail and left a message. I'll keep you posted. Maybe it IS possible to get a geographically specific subdomain, even if you're not a part of city government, but I've never seen it done before. Re:Commercialism is Evil[TM] (Score:1) And which brand would suffer the most damage if brand 'dilution' were allowed to occur? Why it's the company with the most money isn't it? 1% damage to a billion dollar a year company is more than 2000% damage to a $40,000 a year company so of course the first suffers more damage right? Now what if 'Ford Musical Instruments' had the ford.com domain 3 years before ford auto recognized that there was an internet? The registrars of ford.com didn't act in bad faith. ford was a registered trademark yes, but it was a trademark OF THE COMPANY that registered it. So what does dilution have to do with it if nobody acted in bad faith? Re: purposeful comments (Score:1) Point taken. I'm *not* an "old fart" (or does 33 years old qualify?) but I'm aware that capitals is considered, in Usenet at least, as "shouting." And yes, I've also seen the star-variation. I'm not sure I'd have done it that way even if it had come to mind, but thanks for the advice anyway. Actually it's LOOSEN you RETARD. (Score:1) Re:Your reasoning is flawed (Score:2) Procter & Gamble Co., the largest U.S. maker of household products, has bought thousands of domains. They have been sitting on many for five years. Are they squatters also? Depends on your definition of squatting. Usually a cybersquatter is someone who registers a name with the intent of selling the registration for profit. Are they registering these names with the intent of selling them? Do they plan to use them at a future date? Are they trying to prevent anyone from using them? I think that if you register a name, it should have to point to some sort of content within a reasonable amount of time (say 2 months). I'm very much against the idea of allowing people to register names with the intent of selling them for profit without providing any sort of content. I'm also disgusted with the practice of registering names, not paying for them, and snatching them up again the moment they go back into the pool. Since the squatter knows exactly when that will happen, they can hold onto their "property" indefinitely for free. Registration services usually give you first and second notices over a few months, so the honest people have plenty of opportunity to pay for it. If you don't pay for a name, you shouldn't be allowed to register it again for at least a month . >Likewise, the montyroberts.com dispute involves a person using it for negative commentary about the actual plaintiff. This would be considered misuse under most arbitrators review. You do not believe in free speech? There's a fine line between free speech and slander. Free speech (in the U.S. anyway) doesn't mean that you can say anything you want. There are restrictions. -Jennifer Re:Your reasoning is flawed (Score:1) Procter & Gamble Co., the largest U.S. maker of household products, has bought thousands of domains. They have been sitting on many for five years. Are they squatters also? If Procter & Gamble Co. owns thousands of domains for the purpose of reselling them, then yes, they are squatters. The point is that he used a squatter case as an example of a transfer from a non-squatter, which is an incorrect example. You do not believe in free speech? I most certainly do, I am just pointing out that the status quo in disputes seems to be that this would be a fair ruling. I have read through some of their other arbitration rulings, and have found some I completely disagree with - and that would have made better examples for the points Livingston made. Deja Vu? (Score:1) As for trademarks - well, we'll be working on uneven ground there. I could hold the trademark for 'Slashdot' here in the UK, Andover would own it in the US - who is entitled to it? I also believe there is 'Dominoes Pizza' and another 'Dominoes' company - both owning the 'Dominoes' trademark, but in different 'fields'. The UK had a resonable idea with it's Sounds good in theory - but can anyone work around, simply, the unsolved questions? Richy C. [beebware.com] -- Re:Agreed, upon further review. (Score:1) Most of the transfers happened because the current owner of the domain failed to respond to the dispute notice. " I don't see why not responding should be automatic proof of guilt. It seems to me the burden of proof (and a heavy burden at that) should be but upon the complainant. Bradley Confusing article header (Score:5) Not to be a nitpicking editor, but the slashdot writeup of this article is a bit confusing. I think it would be clearer to say that WIPO is considering some new rules that force people to give up domain names which are geographical terms, individuals' personal names, and fall into the loosely defined catagory of "tradenames". I think you mean to say that WIPO is forcing people to give up their domain names even when they are NOT cybersquatting. What the poster is trying to say is that people who bring domain disputes get to choose which organization hears their case. WIPO has a track record of finding for the defendent 84% of the time, much more than competing organizations, so they are the favoured choice of people bringing such suits. I personally don't understand how this ludricrious idea of letting the plantiff pick the court ever got off the ground! What kind of f*cked up legal system works this way?!?-OT Re:This is seriously sad... (Score:1) On the flip side, I would be sorta annoyed if I went to a "" and all I got was a page saying "I'm holding this domain ransom until someone wants to pay me enough." There SHOULD be a way to arbitrate. I just don't know if this is a good way. Take a lesson from the Linux Advocacy HOWTO (Score:2) Railing against the WIPO for even considering such changes are off topic. Wail here. Write purposefully there. Could there be a "Freenet" type alternative? (Score:1) I own several "generic term" domains, and had one email exchange with a troll who insisted that he owned the rights to a particular generic word. I not so politely told him to fork off. With the WIPO, it looks now like someone like him has a real means to cause me trouble now...? The real problem... (Score:2) In the US court system, both the plaintif and the defendent have to agree to the jury members. This is done so that neither side can choose people that are obviously bias for them. However, according to the CNet article, when you have a domain name dispute, only the plaintif chooses the "jury" (the group that ends up settling the dispute), so of course they are going to choose the group that is most likely to rule for them! Doesn't this give more power to the plaintif than the defendent? If I created a group of /.ers, and some how got ICANN accredited, then if any one of you sued Microsoft, saying that you make small software and therefore deserve the domain microsoft.com more thant MS, you would just need to choose the /. dispute resolution to win! Is it just me, or does that seem silly? Of course you shouldn't win, but you would! How to make the WIPO's collective head explode... (Score:1) Have a man named George River, a company called George River, and an apartment complex called George River all file cases claiming that they should own georgeriver.com, and not the current owner, the George River Tour Group. Shafted (Score:3) Seems quite appropriate really Re:So what are the alternatives? (Score:1) Okay, Infinet says that they don't administrate norfolk.va.us either (They claim that the whois information is wrong). They referred me to "Pilot" which is owned by Infinet but has separate offices. Left a voicemail message for Natalie P. (No, not Portman, you troll!) Re:Your reasoning is flawed (Score:1) Being unable to work, I *bought* generic domains for investment. As I thought of them first, they are my Intellectual Property. The corporates make billions out of their IP, I would like return for mine. You and I have different philosophies about this. You're domain names were generic and you happen to get to them first. Corporations provide content (or at least have built up name recognition through advertising) to make their domain names valuable. OTOH, I also feel that domain names should be first come, first serve, as long as there is some sort of content being offered. I'm not exactly a fan of WIPO. They have a track record that shows they favor the haves. >There's a fine line between free speech and slander. There are laws in place already - why take the domain away before any crime is commited? I don't know exactly what was said on that site. It could be that WIPO was unjustified in taking the name away. Then again, it could have been slander. The poster implied that free speech should have protected the domain name. I don't see this to be inherently true. -Jennifer. You're talking about opinion. That's covered by first amendment. I was saying that it's possible that there could have been things posted that would not be covered under the first amendment.. I agree with you on this count. WIPO scares me. It is not elected and tends to act as a special interest to the corporations with the most money. The whole intellectual property thing kind of bothers me. I do think you should have an opportunity to profit off of a creative and original expression where it is clearly being used to make a profit. But I also think there should be some limitations to this. Reminds me of a Tank McNamera cartoon I saw back in the eighties. Someone copyrighted the phrase "that ball is outta here". He wanted to charge all sports commentators a nickle every time they said it. -Jennifer Re:The Only Comment WIPO Needs To Hear... (Score:1) Some friends and I have looked at his work and feel that it has little merit. Stephen Re:The Constitution is not a problem (Score:1) Can you see an amendment that allows foreign rule passing that muster? I don't think so. What about me? (Score:1) Re:WIPO.org.uk told you - WIPO are power Mad (Score:1) Ask any big business that has taken them off the legal owner. They uses them to make money also. Why should Bank of America pay millions for loans.com?. They benefit no one but themselves. Like you say, big business are parasites. Re:This is seriously sad... (Score:1) What is wrong with that, if it is generic "somethingorother"? As an individual, you pay many thousands to corporations for their Intellectual Property. If you owned "somethingorother.com", why should you not ask for a fair return for your Intellectual Property? You had the *idea* to buy it first. After all - *as you say* - This translates to millions of hits, and potentially a Lot Of Money. Perhaps you should go to WIPO and *give it to them for nothing.* The greedy corporations have got the arbitrators on their side - they don't need help. My protest site, WIPO.org.uk [wipo.org.uk] , is nothing to do with WIPO.org. Here is the comment I submitted... (Score:2) Regardless of the content WIPO's final decision, I hope that WIPO will document carefully all the arguements for and against their decision so that the process may be as open to critical review as possible. Domain names are a very valuable commodity and many people have invested significant amounts of time, money, and more importantly, hope into developing web presenses. Do not let this historical effort, these "sunk" costs to become ignored. Thanks, Mishkin. Re:lame... (Score:1) Scott Re:Commercialism is Evil[TM] (Score:1) ." (bold is mine) "I feel that a decent way to address the problem is to actually hold register-ers to the purpose of the various top level domains." Um... 'nuff said? Re: purposeful comments (Score:1) These new proposed rules tilt the scales in favor of big companies with well-funded legal departments WAY TOO MUCH. No matter what name I pick for my domain, if it is composed of prounounceable syllables, there is probably SOMEBODY, SOMEWHERE, whose business or personal name contains the same string of syllables. And even if there isn't, somebody could form a business tomorrow, trademark the name, and then steal my domain from me. In any case where there is a limited supply of resources and no clear, universally agreed-upon way to distribute them, the only rule that makes sense is "First come, first served." Re:Who put the WIPO in charge? (Score:3) However, by my understanding, *both* sides get a say in which arbitrator is used, ususally by submiting a list of sealed names of acceptible candidates from a master list. With this arrangement, ICANN has effectively given away the store. I think one of the few cases they ruled for a defendent was in the sting.com affair. I worry about this with my own domain name. There are a .com and .net, though they don't seem to be particularly worrisome now. In fact, I've not talked to either of them. But, say the .com gets a wild hair and says I'm infringing on their trade name? We registered about two months apart. I've managed to keep a working site for two years, they will disappear for a bit as they jump bandwidth providers. Would my constant activity and the fact that I don't do anything like they intend to do matter?." Makes me nervous. This is great! (Score:2) ---------------------------- Re:Amazing (Score:1) Where does this end? (Score:2) If it applies geographically then we'll soon have a bunch of tribes people taking over the worlds largest bookstore? In fact I believe i've seen a place called AltaVista, cant remember where though. But then can the british frozen food store take iceland.com from the country? Surely if we had a first come first served policy then all these disputes would be easily solved. At the end of the day if company X want X.com then they can set up their own domain servers and ask people nicely to use them... that way they can have their domain as can everyone else that wants X.com. Now as for IP addresses they are more of a problem, can I get 131.47.73.33 to match my phone number? Not Quite (Score:2) WIPO supplies arbitration services. ICANN undertakes to abide by the decisions of its accredited arbitrators. WIPO just happens to rule in favour of claimants a lot, and so gets a lot of that arbitration work because claimants naturally select the softest tribunal. As it happens, whatever that arbitration tribunal decides, it ought in theory to be reviewable by a court of competent jurisdiction (there are some wrinkles to this one in the UK following the Arbitration Act 1996), a fortiori if the Defendant didn't submit to the jurisdiction of the arbitratori and absolutely if the defendant can demonstrate reasonable grounds for suspecting bias. Your hypothetical /. members' arbitration panel, if it were to take a decision like the one you mention, would not only be making a decision that most courts would laugh themselves silly over, but would probably be exposing itself for liability on the grounds of bad faith. Essentially, what I'm saying is that these arbitration mechanisms work a bit better than a cursory examination would suggest: there are checks and balances even if they aren't immediately obvious from news reports about the thing. Jurisdiction (Score:2) And although I can ignore the UN, (heck my country, the US, does not even pay their bill to them), that does not preclude ICANN or some other organization choice to abide by WIPO's rulings which may leave some of us in the cold. I mean, who knows what this UN's bodies motivation may be? By the sound of the crew.com debacle, they may only side with corporations and not with individuals, for instance. Scary. Re:Who put the WIPO in charge? (Score:2) The complaintant ( the company that wants to take over a domain for example ) gets to choose the arbitrator. The implications of this are very serious. If WIPO makes it very easy for corporations to "take back" domains they want, think what happens to the little guy ( worse than what already has happened... ). This is generally not good news. ----------------------------------------------- If you're so ticked off... (Score:1) My question is, how many of the people crying foul on the Slashdot pages have bothered to follow the link to send a message to WIPO where somebody besides our own may actually read it. Do not teach Confucius to write Characters Re:Jurisdiction (Score:2) Re:That's an odd interpretation (Score:1) My mistake - I meant that WIPO is transferring domains away from those defendants as if they were cybersquatting, even though they were really acting in good faith. I've seen CmdrTaco FUBAR submissions as badly as I did, but not very many :) Re:WIPO.org.uk told you - WIPO are power Mad (Score:1) Re:It's a hazard to have a domain name nowadays (Score:2) The fact of the matter is, fraud laws are nearly enough to avoid any abuse of words requiring trademark. The trademark system -- and now, its absurd, surreal extension into domain namespace -- is merely a front for a crooked scheme, an attempt to carve out pieces of our common ideaspace. It should probably never have been allowed; it certainly should not be enshrined and expanded. Re:Amazing (Score:1) Re:Your reasoning is flawed (Score:1) Procter & Gamble Co is now to sell 100 domains, including beautiful.com. So you would consider them squatters. I would consider it commerce, like when you buy and sell anything. This *squatting* thing is a lie - brought about by ICANN deliberately holding up new TLDs for years. Being unable to work, I bought generic domains for investment. Then I found people like myself branded as illegals. Which is why I started my protest site, WIPO.org.uk. Solution - Forget WIPO (Score:2) The answer is don't accept WIPO as a binding arbitration - use eResolution. I don't think you have to use a specific body, but if someone takes you to arbitration, don't both sides get to pick the arbiter? Being with you, it's just one epiphany after another Re:Commercialism is Evil[TM] (Score:1) The courts have ruled that it's not the one with the most money that get the domain name. It's the one whose brand would occur the most damage if brand "dilution" were allowed to occur. The courts see it like this. If you go up to most people on the street and ask them what "Ford" makes, most of the people are going to say cars. The fact is "Ford" is a nationally recognized brand name. And it is certainly more nationally recognized than say, "Ford Musical Instruments". So of course Ford Motor Company deserves the domain ford.com. crew.com != jcrew.com (Score:1) Re:Who put the WIPO in charge? (Score:1)." Looking over news over the last few years, its increasingly the trend to sue rather than to pay. It seems that companies have learned that its easy and cheaper to use their attorney on retainers than it is to sit down and deal fairly. They do this with the little guy, because in that instance its GUARANTEED that he can't hire legal clout like they have and can't afford to deal with the hassles these people are paid to dish out 24h a day if need be. They also do this with competitors (ie: Patent cases) and smaller companies. Its a sad commmentary, makes me nervous too, but who said the world had to be fair? "I'm not a procrastinator, I'm temporally challenged" - myself Would the WIPO give katie.com to penguin? (Score:1) I would estimate that in this case the WIPO would rule in favour of Penguin, forcing the real Katie to give up her domain. I might be wrong, but this smacks of capitalistic forces squeezing out the intelligensia who built this network for them in the first place. Is it any wonder that people are looking to FreeNet as as somewhere to escape to? Re:Deja Vu? (Score:2) There isn't a work-round for Companies-House filings. It's first-come-first-served for limited companies' (equivalent to US Incs) names and there's jack you can do about someone getting in first. Your only remedy is in trademark infringement if the company trades under a name you're using, or, if it's a squatter company, waiting until dormancy forces it off the register. Re:The Only Comment WIPO Needs To Hear... (Score:2) Support Opennic! (Score:3) I strongly urge you to use and support opennic. While not as subversive as I would prefer (I would have relegated all ICANN domains to domain.com.icann, rathar than respecting their This means you can still resolve all ICANN names, but in addition you can resolve alternic, opennic, and various other competitor's TLDs as well. ICANN has been given a monopoly by our governments, primarilly because our governments cannot (or will not) imagine a system in which there is not some central authority. It is up to us, as individuals and as ISPs, to thwart this powergrab at the grass roots level, by supporting independent, democratic, and popularist efforts to take back control of our internet. How about re-arbitration? (Score:2) I, as a defendant, don't have any choice in the selection of the arbitrator. I protest, knowing the WIPO only looks at the $$$ of the big company and isn't interested in little guys like me, and ignore the WIPO. As a result, the WIPO orders me to transfer bigcompany.com to the plaintiff and my registrar hands it over to them (according to ICANN rules). Now, say I have been doing business as for a few years before that big ole company had even thought of the internet. I decide that it's not fair. Therefore, would I be able to REARBITRATE, and pick my own arbitrator (since I'd be the plaintiff now)... an arbitrator that's a little more partial to the "little guys" and make the same claim on the big company, which is now the defendant? If so, then I can see a big see-saw happening. What I would prefer to see is: Of course, the defendant should be notified by email and snail mail at the addresses in the WHOIS databases as well as postmaster@[the disputed domain]) in order to prevent any mishaps where a defendant that is on holiday may come home to find that he is in default because of a ridiculously short time to answer...! This would be a little less "quick and dirty" but would prevent looking like either the plaintiff or defendant has any edge over the other except for the merits of the actual dispute. -- Who put the WIPO in charge? (Score:2) any jurisdiction whatsoever Speculation != Squatting (Score:2) Why, when this occurs in the DNS tree is it called squatting? Is it called squatting if someone purchases a lot of land in Silicon Valley, expecting to sell it for 3x the price in 2 years? Is it squatting if someone got into Ultima in the beginning and managed to build a huge castle, something which noone else can do as there's not enough land? The words you choose *DO* make a difference. This is DNS speculation... The only problem is that instead of a lot of rich people/companies doing it, it's individuals who got in first. The companies don't like it, and call those individuals who thought that 'sell.com' 'clean.com', 'ford.com' domain squatters. That way it's easier to steal their property from them. If I own ford.com, and I'm not using it for any purpose, or I purchase it to offer to sell it to them, that's NO WORSE than purchasing a lot of land next to a ford manufacturing plant, expecting them to expand a year, and buy it for 3x the price. In one case, it's called 'cybersquatting', and you have no rights. In another, it's called speculation, and stealing it is theft. The words you use make a difference.. Cybersquatting, Domain Speculation, Unauthorized Duplication, Piracy. Re:The Only Comment WIPO Needs To Hear... (Score:2) Re:Commercialism is Evil[TM] (Score:3) If these folks followed the rules... (Score:2) The most important of these being, "One domain name per entity." The second being, ".com for commercial folk, .edu for education, .net for net-related folks, .org for (non-profit) organizations, and so on." But no. These people will give 40 addresses from several TLDs to the same people for the same domain. That's bull. If they'd stick to their guns, and tell em, "Uh, no. Pick *one* that you really want, and stick to it." We would not have this problem. Anyone ready to start up their own Top-Level domain service? Re:Commercialism is Evil[TM] (Score:2) ICANN bug (Score:2) Normally that would be the case, but apparently not with domain name disputes. This looks to me like a bug in ICANN, one that should be fixed. Is this the type of kind of thing the ICANN Board of Directors (up for election in October) will have the power to change? If so, then perhaps the candidates should explain where they stand on this issue. --- Re:Who put the WIPO in charge? (Score:3) --- It's a hazard to have a domain name nowadays (Score:3) I really really hope that none of the domains I own get disputed. I really just don't want to put up with some corporate meany conglomerate knocking on my door and threatening me with legal action because they want a domain I'm using. Think about it this way. Say I have the 1-800 number 1-800-dom-inoe by pure coincidence. Can Dominoes pizza come sue me take that 1-800 number from me? It's just stupid. I hate corporate America more and more every day... Mike "I would kill everyone in this room for a drop of sweet, tasty beer." Commercialism is Evil[TM] (Score:5) IANAL, but IIRC(enough I's for ya?) trademarks only extend through one commercial domain. So, for example, I could start up a company called Ford's Musical Instruments, Inc. and not be breaking trademark law. However, an attempt to start up a Ford Car Company would result in a nasty lawsuit that I would most likely lose.. I feel that a decent way to address the problem is to actually hold register-ers to the purpose of the various top level domains. No more corporations in Re:Deja Vu? (Score:2) Or, as the page on the other side of the link (not to mention the domain itself) suggests, Companies House... This is seriously sad... (Score:3) Computers don't use them, they are purely for the convenience of the human operator. In addition, domain names are scoped. They are NOT necessarily global. That depends on how the DNS servers are configured and on the entry itself. So, WE, the users of the Internet, are funding several massive, costly organizations who do absolutely nothing than order other massive, costly organizations to move pointers around. Sorry, but that feels like a bit of a rip-off. Whilst I like the idea of overseers, the overseers CANNOT be a part of the system they are overseeing, if they are to be efficient, honest and rational. Re:Commercialism is Evil[TM] (Score:2) Actually, I agree ... commercialization of the Net is in fact Evil. Day by day we're watching something wonderful slipping away, because we tolerate these assaults by Big Business: Not only can they do these things, but they're convincing us it's right that they do them... Sad. Why this is... (Score:2) If I were the ruler of the Internet inestead of that Esther woman, the domain space you could get in to would be much deeper. You'd be forced to use your country code (Even in the US.) So microsoft.com->microsoft.com.us. Et Cetera. Perhaps I'd come up with a .international TLD for companies that are international. ibm.com.international, for instance. I'd have to think some more on other heavy-handed policies as well. Should it be hard for Normal Mortals to get names in the high level namespace? Perhaps each country should provide some deeper domains for people. So providersofgoatporn.co.us for goat porn providers in Colorado? And bring back the days of having to prove you're a .com, .net or .org to qualify to get into those domains. Resolving such disputes under my draconian leadership would indeed be much more simple. Re: purposeful comments (Score:2) Re:Agreed, upon further review. (Score:2) If the defendant offers no evidence or argument, whatever the claimant says (within reason) has to stand as the finding of the court. That pretty much automatically discharges any burden of proof you care to impose: if the other side declines to raise reasonable doubt, the Claimant sure as buggery isn't going to do it for him. A fortiori where the burden imposed is "balance of probabilities" - if the defendant puts nothing in his side, the tribunal is again stuck with only the claimant's side of the story to go on. A system I think would work (Score:2) Apparently use of the tld for actually routing information is completely dead, so there is no technical reason for any set of tlds. All claimnants can register "a.b" where a and b are arbitrary words. Either a or b or both may be a trademark or other word they own, but the combination a.b cannot be trademarked (if it is they must use a_b.c). To preserve existing value, browsers will automatically replace 'a' (no periods in it) with 'a.com', to give these existing names much more value. Entity 'a' can sue anybody using 'a.b' or 'b.a' if: the displayed page is blank, contains or links any kind of indication that the name is for sale, or contains content that can reasonably be confused as actually being from 'a'. Otherwise names can be bought and sold on the open market. I would expect there to quickly be a lot of 'b' words in common use, like .cars and .movie. Some will be as valuable as .com and will be fought bitterly over. But the individual can just pick random b words. MicroSoft is free to register "microsoft.sucks" and every other word they want. It costs them and they never will pick all the possible words, since this proposal squares the size of the name space. So what are the alternatives? (Score:2) If you don't like how ICANN operates, what alternatives do you have? Does ICANN have a government-granted monopoly on com/net/org addresses? This vaguely worries me. I run pillars.net on my home computer mainly as a permanent place to store my resume. Last week I met somebody whose last name is "Pillars". According to these rules, anybody in that family could petition ICANN for my domain name and probably get it with no recourse on my part. Do I have to register a trademark to protect my domain name? How much would that cost, anyway? Men with guns (Score:4) The government, big business, the judicial system and law enforcement are basically all one big protection racket enforced at the point of a gun, and they dish out legal jurisdiction as suits them. Moral jurisdiction is a different matter of course, but you have to pay lip service to the immoral but legal kind occasionally if you want to retain your freedom. I don't see it changing any time soon.
https://slashdot.org/story/00/08/11/1312214/wipo-to-loosen-domain-names-transfer-standards
CC-MAIN-2017-17
refinedweb
8,141
73.88
I want to reverse and array of integer recursively, I think this is the way but I get this error when trying with a 5 integer array: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5 at name.of.package.ArrayAscDesc.CambioAscDesc(ArrayAscDesc.java:12) at name.of.package.ArrayAscDesc.main(ArrayAscDesc.java:34) Here's the code: import java.util.Scanner; public class ArrayAscDesc { public static int[] CambioAscDesc (int[] array, int index, int tam){ while(index < tam){ int temp = array[index]; array[index] = array[tam]; array[tam] = temp; CambioAscDesc(array, index++, tam--); } return array; } public static void main(String[] args) { Scanner teclado = new Scanner(System.in); System.out.print("Inserte el tamaño del array: "); int tam = teclado.nextInt(); int[] array = new int[tam]; System.out.println("Inserte datos para un array de " + tam + " elementos:"); for(int i=0; i<tam; i++) {array[i]= teclado.nextInt();} System.out.print(CambioAscDesc(array, 0, tam)); } } Thanks beforehand! The while on line 7 looks wrong to me. This is a recursive solution, it shouldn't need another loop. I would expect a simple if. You'll probably want a better print on line 32, since array is an array. Even changing it to an if I get the same error. About the print, I needed to name it so I named it "array". At the entry to your recursive method print the values of all the parameters so we can see where its going wrong. To print the contents of the array you can use System.out.println( Arrays.toString(array)); I have pretty much the same problem but what I need to do is a bit more complicated :/ I need to get an input like "Hello" and reverse it and the output has to be "o,lo,llo,ello,Hello" please Help! Forget the computer. Get a sheet of paper and work out how you would do this by hand. In detail. Then, and only then, write a program that does the same thing.
http://www.daniweb.com/software-development/java/threads/317531/java-integer-array-reverse-recursion-problem
CC-MAIN-2014-15
refinedweb
331
58.18
2,745. fabricecw left a reply on Facade\Ignition\Exceptions\ViewException Undefined Property: StdClass::$u_id (View: C:\xampp\htdocs\join\resources\views\join.blade.php) You need to select the u_id field on your sql statement: $data=DB::table('user') ->join('user_details','user_details.user_id','=','user.u_id') ->join('order','order.user_id','=', 'user.u_id') ->select('user.u_name','user.u_id', 'user.phone','user_details.email','user_details.age','order.o_id','order.item_name') ->get(); fabricecw left a reply on POST AND UPDATE WITH SAME METHOD Maybe you mean updating a data property with the responded data from your API? It seems that you add a module and emit an event. Your event listener has to handle the data. Your component: <your-component @ </your-component> And the method maybe on your vue instance: methods: { addModule(module) { this.modules.push(module) } } We need more information to give you better assistance. fabricecw left a reply on Complex Query Performance Hm, I think this won't work since you can't use last() method in a query builder instance. fabricecw started a new conversation Complex Query Performance Hey! I need to track statuses on an order model. It's a many to many relationship between order and status, since an order has multiple statuses and a status is used in many orders. Now there is always the "current" and the "next" status of the order. The status sequence is controlled by a "step" integer in the pivot. | order_id | status_id | step | completed_at | | ------------- | --------------| ------| ----------------| | 1 | 1 | 10 | 2019-0706 16:00 | | 1 | 2 | 20 | null | | 1 | 3 | 30 | null | Status relationship: /** * Get the order's statuses. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function statuses() { return $this->belongsToMany('App\Status')->using('App\OrderStatus')->withPivot('completed_at', 'user_id', 'step')->orderBy('pivot_step'); } Next status: /** * The status of the order which is in progress. * * @return Status */ public function statusInProgress() { return $this->statuses()->wherePivot('completed_at', null)->first(); } Current status: /** * The last completed status. * * @return Status */ public function lastCompletedStatus() { return $this->statuses()->wherePivot('completed_at', '!=', null)->get()->last(); } And obviously when it comes to filtering, users want filter by all orders which are in a specific status. How can I query the orders in a performant way? Currently I have to loop over all the orders and check if the methods return is equal to the filtered status... I have considered about the following approaches: Is there a better approach to do that? Thanks for your help! fabricecw left a reply on Password Validate Rules For repetitive characters, you can use the following regex: (.)\1{3,} While the 3 stands for the minimum number of repetitive characters. In the validation, you can use the not_regex rule: 'password' => 'not_regex:/(.){3,}/' fabricecw left a reply on Reusing Called Accessor I don't expect it in my code. But I don't know why Laravel itself doesn't write the value into the Model as an attribute when using an accessor. I'm talking about the framework functionallity. fabricecw left a reply on @foreach Loop Not Working? Laravel 5.8.24 (WAMP) W10 The migration should also work like this: public function up() { Schema::create('replies', function (Blueprint $table) { $table->increments('id'); $table->integer('thread_id'); $table->integer('user_id'); $table->text('body'); $table->timestamps(); }); } Are there any replies with the specific thread id if you take a look into your DB? fabricecw left a reply on Reusing Called Accessor Yeah sure. But (for me) this doesn't answer why Laravel doesn't store the value as an attribute when using an accesor the first time The next times it get's called, the accessor should check if the attribute already exists. This doesn't depend if the accessor loads a relationship or do something else. fabricecw left a reply on How To Get A Method Working In Vue, The Same Way As It Does In The Backend This package sends the form request via axios. So just use this.user = response.data.user; window.location = '/users/' + this.user.id When everything is fine (no errors). fabricecw left a reply on How To Get A Method Working In Vue, The Same Way As It Does In The Backend You cannot use "redirect" on JSON requests. Laravel responses asynchronous to Axios (AJAX) - not to your "browser". So a solution to make a redirect would be: axios .post('/api/users', { params: { username: this.username, name: this.name, } }) .then(function(response) { this.user = response.data.user; window.location = '/users/' + this.user.id }.bind(this)) .catch(function(error) { console.log(error) }.bind(this)); } And your controller: public function store(StoreContactRequest $request) { $user = $this->userRepository->store($request); // Flash to session $request->session()->flash('flash', User successfully created.'); return response()->json(compact('user')); } So, if axios get the created user successfully, it will redirect to the new user and flash the message. fabricecw left a reply on @foreach Loop Not Working? Laravel 5.8.24 (WAMP) W10 Can you post the dump from a dd()? public function show(Thread $thread) { dd($thread->replies); return view('threads.show', compact('thread')); } fabricecw left a reply on How To Get A Method Working In Vue, The Same Way As It Does In The Backend I'm not sure what you're really looking for... But for example... Your Vue component: axios .post('/api/users', { params: { username: this.username, name: this.name, } }) .then(function(response) { this.user = response.data.user.; }.bind(this)) .catch(function(error) { console.log(error) }.bind(this)); }, If you need a JSON response instead of a page: if(request()->wantsJson()) { return response()->json(compact('user')); } fabricecw left a reply on Reusing Called Accessor fabricecw started a new conversation Reusing Called Accessor I'm using an accessor which loads a custom relationship field: public function getHandoverDedicatedAreaAtAttribute() { $activity = $this->activities()->select('created_at')->where('status', 6)->first(); if($activity) { return $activity->created_at; } return null; } And in another accessor, I call the accessor above: public function getIsOverdueAttribute() { return Carbon::parse($this->handover_dedicated_area_at) > Carbon::parse($this->delivery_at); } But as I analyzed with Debugbar, if I call the is_overdue and handover_dedicated_area_at attributes, the query from getHandoverDedicatedAreaAtAttribute() is called twice. Is there a way to reduce this to one query and use the attribute value from the Model once it's loaded? fabricecw left a reply on Callback / Anonymous Functions Sorry, the $like approach works correctly. I had a third array which wasn't valid. I thought I could fix the dynamic call of the anonymous function, but it doesn't work properly. How can I call the anonymous function dynamically by the array value (operator)? fabricecw started a new conversation Callback / Anonymous Functions Hi I try to understand callback / anonymous function but it still confuses me a lot... I tried to write callback functions for operational filters: public function scopeSearch($query) { $like = function($value, $field) use($query) { $test = $value; $query->where($field, 'like', '%' . $test); }; $match = function($value, $field) use($query) { $query->where($field, $value); }; $searchable = [ [ 'field' => 'client_reference', 'operator' => 'like', 'filter' => request()->filterClientReference ], [ 'field' => 'article_number', 'operator' => 'match', 'filter' => request()->filterArticleNumber ] ]; foreach($searchable as $search) { if($search['filter']) { // Here it should call the right function depending on the operator... Hardcoded example: $like($search['filter'], $search['field']); // But this also isn't working... } } return $query; } Maybe I'm on a totally wrong way. fabricecw started a new conversation Fluent Pivot Scope Hi I try to keep my models as clean as possible. But when it comes to pivot scopes, I'm unsure what the cleanest approach could be. I need to filter through a pivot column completed_at: $this->statuses()->wherePivot('completed_at', null)->get(); But it would be much more readable this way: $this->statuses()->incomplete()->get(); What's the best way to do make it this fluent? And should it be done this way? Many thanks and regards, fabricecw left a reply on Status Template Class If better explanation would be helpful, let me know. :-) fabricecw started a new conversation Status Template Class Hey I try to implement a clean progress handling for orders. A order has many statuses and they can be completed via a button in the frontend or an API request. But a status should contain: Name Logic policies: For example, the user can only complete a status "start shipping" if a field "address" is defined in the order. Otherwise the status can't be completed. Authorization policies: Like Laravel Policies, only authorized user for this status can complete it. I thought about a custom PHP class, but I'm still unsure about the best approach. An order has a statuses "template". When the order is created, all needed statuses will be created in a subtable in the right order. Because some orders needs an approval, others can be executed directly. We already have a order progress handling, but it's a mess: An order has a "status" integer field. The user completes the status by submitting a "complete_status" integer to an update function. In the update function, I check for each status if it can be completed: public function updateStatus() { if(request('complete_status') == $order->status) { // For example status 2 is the "start shipping" status if($order->status == 2) { if(! $order->addressAvailable) { abort(403, 'You can not start shipping with no address.'); } if($order->needsApproval()) { $order->status = 3; } else { $order->status = 4; } } if($order->status == 3) { // Code for status 3... } } else { // If a user tries to complete a status in which the order isn't. abort(403, 'This status can't be complete.'); } } And in the frontend, I check the same logic to show/disable the buttons... Any ideas or hints? Thanks in advance :-) fabricecw left a reply on Testing Touches With More Performance Oh great, didn't know about this Carbon method! fabricecw started a new conversation Testing Touches With More Performance Hi I'm testing touches with the sleep function: CommentTest: /** @test */ public function it_touches_the_orders_timestamp() { $order = factory('App\Order')->create(); sleep(1); $comment = $order->comments()->create(factory(OrderComment::class)->raw()); $this->assertEquals($order->fresh()->updated_at, $comment->updated_at); } But this means heavy time consumptions. Is there a way to "mock" the time? fabricecw started a new conversation Create Multiple Records On Relationship With A Factory I try to test a morphMany relationship: /** @test */ public function it_has_packagings() { $variant = factory(Variant::class)->create(); $variant->packagings()->create(factory(Packaging::class, 10)->raw()); $this->assertCount(10, $variant->packagings); } But the factory outputs the records inside an array. What's the best way to create multiple records on a relation? fabricecw left a reply on Ubuntu Server Doesn't Send Emails? Please provide all the requested information above. Per default, Laravel uses MAIL_FROM_ADDRESS and MAIL_FROM_NAME, not MAIL_ADDRESS. Do you overwrite that somewhere? And have you tried it with port 587? fabricecw left a reply on Sending Email Notification To Users If $user is the App\User model: Your User class (in the App directory) should have the Notifiable trait: <?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; // <-- this one /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; } If it's another Model, add the trait there like the example above. fabricecw left a reply on Ubuntu Server Doesn't Send Emails? Please post the email part of the .env file, the email class and how you fire it. fabricecw left a reply on Ubuntu Server Doesn't Send Emails? Is the outgoing port open on the Forge server. You can check this by wget -qO- portquiz.net:<<port>> while the port is the outgoing SMTP port. Do you use queueable on your emails? Maybe the queue isn't working. Did you setup the .env correctly of your app on the Forge server? Maybe you have to use SSL/TLS. What says the Laravel log? fabricecw left a reply on When Should I Use Polymorphic Relationships? I'm totally with you @douglasakula. The questions require a long term analysis/thinking. Maybe there is only a Book class which is orderable for now, but in future it could be possible that there are some others. Thanks for your hint! fabricecw started a new conversation When Should I Use Polymorphic Relationships? Hey! I'm a little bit confused of when I should use Polymorphic Relationships and when a normal relationship would be the better approach. I've been thinking about a question which I could ask to myself. I got the following idea of the question's "syntax": Is there anything else which is modelable? As an example for a Ordermodel: Is there anything else which is orderable? Which could be a model Bookor Chair. An other example would be a Comment: Is there anything else which is commentable? Do I get the right thoughts or is this mindset wrong? Thanks for your feedback! fabricecw left a reply on Laravel Notification Email Queue With Amazon Sqs Amazon SQS is "only" a Queue Service and isn't responsible to send the email. What happens if you change your Queue Connection to sync? fabricecw left a reply on Updating Answer - Mention User Yeah, it's just the auto-completion which doesn't work and I didn't receive a notification. fabricecw started a new conversation Updating Answer - Mention User fabricecw left a reply on Getting Distinct Data Based On Specific Columns By default, latest() sorts the column by the created_at field. If you don't select this field, latest() isn't working. You also can pass the column, like latest('id') but you always have to fetch this field. fabricecw left a reply on Is It Possible To Have 2 Sites (1 Www And 1 Root) With Forge? I think the ssl_redirect.conf is auto-generated when activating a certificate. Have you removed the "www" form the Let's Encrypt certificate? fabricecw left a reply on Is It Possible To Have 2 Sites (1 Www And 1 Root) With Forge? fabricecw left a reply on Passing Variable Between Two Functions In Same Controller So if you dd($person_type) in the first function, you get a value but dd($test)in the second function returns null? fabricecw left a reply on Displaying Label Of Select Field In Table fabricecw left a reply on Displaying Label Of Select Field In Table Can you explain this a little bit more? Don't know what your goal is. fabricecw left a reply on Load Large Data In Ubuntu What is the PHP memory limit according to phpinfo()? fabricecw left a reply on Load Large Data In Ubuntu What type of error do you receive? Gateway timeout? fabricecw left a reply on Laravel OnHover Link Popover Fetch Dynamic Data From DB W/AJAX Ok, so please let us know which JS library you want to use. If you want to use jQuery: You'll need to pass the ID as a data attribute: <div data-<h2>Your title</h2></div> And fetch it in jQuery with $(this).data("id") fabricecw left a reply on Laravel OnHover Link Popover Fetch Dynamic Data From DB W/AJAX Would be easy stuff with Vue. You have to render the list with Vue and make an mouseover event. <div v-on="mouseover: openPopup(entry.id)><h2>Your title</h2></div> var vm = new Vue({ el: '#test', data: { }, methods: { openPopup: function(id) { // axios call with the id // display a popover with fetched data } } }); In the openPopup method you make an AJAX request with axios fabricecw left a reply on Fingerprint Capture And Verification Fingerprinters have their own system / application to handle and analyze the bio data. You have to find a vendor which provides an API to their fingerprinting system. I'm not sure if it's even possible only with Laravel. Because then, the fingerprint would have to fire an API request on a scan event - you can't control an USB device out of Laravel because this is local client stuff. Probably you need a local application (written in C# or whatever) which controls the fingerprint device and calls the API. I found the following solution: fabricecw left a reply on Zip Code Search Try to consume this API: fabricecw left a reply on Blade Checking If Auth Admin Is Logged In If you want to work with roles, for example an "Admin" role and so on, take a look at this package: spatie/laravel-permission fabricecw left a reply on Laravel Passport - X-RateLimit-Limit OAUTH API If anyone is looking for a solution: ThrottleRequests: <?php namespace App\Http\Middleware; use Closure; use Illuminate\Routing\Middleware\ThrottleRequests as BaseThrottleRequests; class ThrottleRequests extends BaseThrottleRequests { /** * Handle an incoming request. * Customization: 300 attempts per minute instead of 60 * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param int $maxAttempts * @param float|int $decayMinutes * @return mixed */ public function handle($request, Closure $next, $maxAttempts = 300, $decayMinutes = 1) { $key = $this->resolveRequestSignature($request); if ($this->limiter->tooManyAttempts($key, $maxAttempts, $decayMinutes)) { return $this->buildResponse($key, $maxAttempts); } $this->limiter->hit($key, $decayMinutes); $response = $next($request); return $this->addHeaders( $response, $maxAttempts, $this->calculateRemainingAttempts($key, $maxAttempts) ); } } Set the maxAttemptsparameter to the required default rate limit. In this example 300. throttlearray value from the routeMiddlewarevariable in the Kernel.php: protected $routeMiddleware = [ // ... 'throttle' => \App\Http\Middleware\ThrottleRequests::class, // ... ]; Warning: All routes with the throttle middleware use the new rate limit. If anyone has a better approach, let me know. Thanks! fabricecw left a reply on MySQL - Rounding Thanks for your research! We're going to round the value in the applcation. fabricecw left a reply on MySQL - Rounding Yeah, only thought if I it's possible to define this in a Laravel migration I would prefer that way. fabricecw started a new conversation MySQL - Rounding Hi Our Laravel application's database runs on a MySQL 5.7.21 server. We store some float values with up to 6 decimal places into a double field with 2 decimal places. MySQL automatically rounds the value to 2 decimals. Now the rounding function rounds for example 6.025 to 6.02 instead of 6.03. But 5 should be rounded up (mathematically round). MySQL rounds 6.026 correctly to 6.03. Anyone knows where or how I can fix this? Otherwise we will round the value before storing it to the DB. Thanks and regards fabricecw left a reply on 2nd DB Connection Crashes Site Please define protected $connection = 'remote'. Than start Laravel tinker and try to fetch some data from the model with $foo = App\Foo::all().
https://laracasts.com/@fabricecw
CC-MAIN-2019-39
refinedweb
3,064
56.05
nodeMCU, MY_GATEWAY_ESP8266 and Temp Sensor Using mysensors 2.0 on a nodeMCU, I can deploy the DS18B20 to read temp values. Secondly using the mysensors Gateway works to join the WLAN and sending Messages to iobroker mysensors instance. Serial log connected with ho..., channel 1 dhcp client start... chg_B1:-40 .ip:192.168.1.103,mask:255.255.0.0,gw:192.168.1.1 .IP: 192.168.1.103 ----------------- # of Sensors found >>> 1 0;255;3;0;9;No registration required 0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1 iobroker log mysensors-0 2016-09-30 07:24:06.103 info Version from 192.168.1.103 :1.1 mysensors-0 2016-09-30 07:24:06.101 info Name from 192.168.1.103 :nodeMCUTemperatureECM mysensors-0 2016-09-30 07:24:06.095 info Connected 192.168.1.103:5003 As soon as I call sensor.begin() I get an exception and stack trace Fatal exception 9(LoadStoreAlignmentCause): epc1=0x402028e8, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000002f, depc=0x00000000 Exception (9): epc1=0x402028e8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x0000002f depc=0x00000000 ctx: cont sp: 3ffef850 end: 3ffefaf0 offset: 01a0 stack>>> 3ffef9f0: 00000000 00008000 3ffeeabc 00000030 3ffefa00: 3ffe8be0 3ffefa10 000000ff 40225ad5 3ffefa10: ffffffff 0000138b 3fff13fc 40228271 3ffefa20: 3fff1774 3fff1238 3fff13fc 3ffeeabc 3ffefa30: 3fffdad0 3ffefbaf 3ffefb98 40203d38 3ffefa40: 000000f3 00000000 3ffefb6c 402047be 3ffefa50: 000000e7 3ffefe38 3ffefb98 4020295d 3ffefa60: 00000001 3ffefe38 3ffefb98 3ffeeabc 3ffefa70: 3ffefbb0 00000001 3ffefb98 40202a44 3ffefa80: 3fffdad0 00000000 00000006 40202316 3ffefa90: 00000000 3ffefd04 3ffeea80 3ffeeabc 3ffefaa0: 3fffdad0 00000000 00000005 40204b2c 3ffefab0: 3fffdad0 00000000 3ffeea80 40204d19 3ffefac0: 00000000 00000000 3ffeea80 40204460 3ffefad0: 3fffdad0 00000000 3ffeea80 40204e34 3ffefae0: feefeffe feefeffe 3ffeead0 40100114 <<<stack<<< ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v3de0c112 ~ld 0;255;3;0;9;Starting gateway (RRNGE-, 2.0.0) I found another script where MySensor gw; is declared, but this gives me an error. And in the same example #include MySensor.h is declared. But I have to use #include MySensors.h. Is this a matter of mysensors Version ? @mysensors-6043 yes. MySensor.h is for version 1.x, MySensors.h is for version 2. What does sensors.begin() do? (Why do you call it?) The exceptions are described briefly at Hi since I am new to mysensors, I starting with examples, don't have much experience right now. Here is my sketch. #include <ESP8266WiFi.h> #include <OneWire.h> #include <DallasTemperature.h> #include <EEPROM.h> #include <SPI.h> // Enable debug prints to serial monitor #define MY_DEBUG // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h #define MY_BAUD_RATE 115200 // Enables and select radio type (if attached) #define MY_RADIO_RFM69 #define MY_GATEWAY_ESP8266 // Enable UDP communication #define MY_USE_UDP #define MY_PORT 5003 // Set the hostname for the WiFi Client. This is the hostname // it will pass to the DHCP server if not static. #define MY_ESP8266_HOSTNAME "nodeMCUTemperatureEC, 1, 152 // #include <WiFiUdp.h> #include <MyConfig.h> #include <MySensors.h> #define ONE_WIRE_BUS 2 #define MAX_ATTACHED_DS18B20 4 int numSensors=0;. void setup() { //sensors.begin(); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("nodeMCUTemperatureECM", "1.0"); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); Serial.print("----------------- # of Sensors found >>> "); Serial.println(numSensors); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { present(i, S_TEMP); } } void loop() { // Send locally attached sensors data here Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures Serial.println("DONE"); delay(1000); } Ok, thank You. So how I declare MySensor gw; in mysensors Version 2 ? @mysensors-6043 looks like you have used some of the DallasTemperatureSensor example, is that correct? If that is the case, it seems heavily modified. Lots of includes that shouldn't be there (MyConfig.h for example) and sensors.begin is called from the wrong funchtion (should be before(), not setup() ) Try starting with the bare example and get that working. Then extend it little by little while checking that it still works. ok, I'll give it another try. Learning by doing Starting with the ESP8266 example and adding the Dallas Temp parts ? @mysensors-6043 said: Ok, thank You. So how I declare MySensor gw; in mysensors Version 2 ? You don't. It is not used in MySensors 2. describes the differences between version 1.5 and 2.0 @mysensors-6043 said: ok, I'll give it another try. Learning by doing Yes that is a good approach. To me it is the best and the most fun way to learn. Starting with the ESP8266 example and adding the Dallas Temp parts ? The Dallas example works on several platforms, it is not esp specific. It does require a specific version of the Dallas library though. You can get the example and the library by downloading Hey great, I started with a new sketch and did what You recommended. I get the number of sensors now without exception and stack trace. On a good way now I guess. Many thank's and best regards from Switzerland @mysensors-6043 said: As soon as I call sensor.begin() I get an exception and stack trace Fatal exception 9(LoadStoreAlignmentCause): This is usually caused by a library which is not (fully) compatible with 32-bit processors (AVR is 8-bit). The MySensors library has been ported to ESP8266 and does not throw such exceptions (to my knowledge). If the DS18B20 library @mfalkvidd pointed at does not solve your issue I would search the net for other people having issues with the same library & ESP8266, to see how they solved it. ok, yes lokks like this. A soon as I try to get temp values then I run into an exception again. void loop() { // Send locally attached sensors data here Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures Serial.println("DONE"); delay(1000); } - korttoma Hero Member last edited by @mysensors-6043 said: Do not use: delay(1000); Instead try: wait(1000); - scalz Hardware Contributor last edited by As @Yveaux said, it can be lib compatibility with esp. So If you want to try, I use this lib for ds18b20, with other mcus : (his stuff is neat). I have not tried with esp8266 though, but i'm pretty sure it works there are defines for esp8266 which are not present in mysensors git.. ok, i'll try, hmmmm how to import / use this lib ? - scalz Hardware Contributor last edited by scalz @mysensors-6043 how did you import Mysensors? that's the same for every lib So if you don't find it in lib manager, then download it and unzip it in your lib folder. restart arduino. go to examples. simple. You will find this one in lib manager (look at the one with Paul PaulStoffregen contributor). or download it from his git @mysensors-6043, Have you been able to confirm that you get temperature readings on the sensor? I would try to simplify your sketch to rule things out. Here's what I'd do, in the following order: - Remove all MySensors related code and just get the sensor reading to the serial monitor. - I see you're looping over several temperature sensors on the node, simplify this, only read one for starters. - Verify your gateway is on the network by using telnet or netcat. I.e.: nc xxx.xxx.xxx.xxx 5003 - Try just getting your node to "present" to the gateway. Reading the sensor debug via the serial monitor and watch the gateway via netcat. Hi, yes, the Hardware is ok. running a Dallas example script shows the temperature from the sensor. The Gateway is on the Network, I see a DHCP request and get Messages on the iobroker. @mysensors-6043, The sketch you posted looks like you combined the sensors with the NodeMCU, is this true? Is this NodeMCU acting as a gateway as well? - mysensors-6043 last edited by mysensors-6043 yes, but i'm not shure whether this is correct All I Need is a sensor that sends the temperature via WLAN to UDP Port 5003 of the iobroker (acting as Controller) Could also be an Arduino Nano with a Radio, e.g. NRF24L01 @mysensors-6043, The normal setup involves 3 pieces: - The sensor (aka node) emitting data via RF using something like a NRF24L01 - A gateway that receives the sensor data via the RF module (NRF24L01) and sends it to a controller over ethernet or wifi. - A controller to manage connected nodes and present data to the user. It seems like you're combining the sensor and gateway into one device. If this is the case, I think you can comment out the #define MY_RADIO_RFM69line as there is no radio connected. I don't know how this plays into the registration process of a sensor. There is no ID getting associated to the sensor because this is a gateway. Maybe someone else can chime in who knows whether it's okay to combine the gateway and sensor into one device. If so, how is registration and ID assignment handled? @mysensors-6043,
https://forum.mysensors.org/topic/4983/nodemcu-my_gateway_esp8266-and-temp-sensor
CC-MAIN-2018-05
refinedweb
1,523
57.98
On Tue, 2005-01-11 at 11:09 +0100, Stepan Kasal wrote: > Hi Bruce, > > On Mon, Jan 10, 2005 at 08:35:27AM -0800, Bruce Korb wrote: > > > if [some-shell-script-test] > > > then > > > ... > > > AM_CONDITIONAL([XXX], [true]) > > > else > > > ... > > > AM_CONDITIONAL([XXX], [false]) > > > fi > > > reading the docs some more, they explicitly state to not do this. > > I re-read the node ``Conditionals'' of automake manual (CVS version) just > now. I don't see any problem: > > ``you must arrange for _every_ `AM_CONDITIONAL' to be invoked every > time `configure' is run'' > > and you are doing this. > > But Ralf said that this practice is not reliable, and I'd believe his > experience. The "_every_" is the crucial word in your sentence. In practice this "_every_" is very easy to miss, esp. if packing conditionals into macros, splitting "setting up conditionals"/"using conditionals" into different macro files and trying to "AC_REQUIRE" the these macros: A semi-classic example of such a situation is this one: # cat configure.ac: AC_PREREQ(2.59) AC_INIT(autobug, 20040111, address@hidden) AM_INIT_AUTOMAKE([foreign 1.9.4]) AC_ARG_ENABLE(cxx) AS_IF([test "$enable_cxx" = yes], [AC_PROG_CXX]) AM_CONDITIONAL(USECXX,[test "enable_cxx" = yes]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT # cat Makefile.am if USECXX noinst_PROGRAMS = foo foo_SOURCES = foo.cc endif automake will not complain, but configure will yell at runtime: # .. => Not even automake and autoconf are to treat this situation properly. Even more bizarre situations can be constructed when adding AC_PROG_CC to the configure.ac above. Depending on where you insert it either this happens: # ./configure ... hecking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 configure: error: conditional "am__fastdepCXX" was never defined. Usually this means the macro was only invoked conditionally. or this # ./configure ... checking whether we are using the GNU C compiler... no checking whether gcc accepts -g... no checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... none configure: error: conditional "AMDEP" was never defined. Usually this means the macro was only invoked conditionally. [Note: this is the same system, same environment!] In a real-world example, I once encountered a case were such breakdown occurred conditionally, depending on the --enable/--disable arguments being passed to a configure script ;( Ralf
http://lists.gnu.org/archive/html/automake/2005-01/msg00034.html
CC-MAIN-2015-40
refinedweb
390
59.8
Using the Workflow Designer This section details how to create new activities and workflow projects using the built-in designers and the expression editor that is hosted by several of the activity designers. Creating a Workflow Project Topics that describe how to create libraries through the use of these templates. How to: Add Activities to the Toolbox Shows the different ways to add activities to the Toolbox. How to: Use the Argument Designer Shows how the argument designer makes it easy to allow data to flow into and out of an activity. How to: Use the Variable Designer Shows how to create variables for use in data-binding scenarios and conditional statements. How to: Use the Expression Editor Shows how to use the Expression Editor to enter and evaluate expressions. How to: Use the Imports Designer Shows how to enter namespaces for the types that you use in your expressions. How to: Use Breadcrumb Navigation Shows how to navigate between activities.
https://msdn.microsoft.com/en-us/library/dd489402.aspx
CC-MAIN-2017-22
refinedweb
161
51.28
even as he championedHomers unity against the ch orizontes who would ascribe the Iliad andthe Odyssey to two different authors. As for the relative chronology ofIliad and Odyssey, ps.-Longinus seems to contribute to an ongoing debate:Graziosis comprehensive account also generously refers to other contributions in a similar vein, suchas West (:,,,), Burkert (:,;).:FGrH ;c F: ad Plut. Vita Hom. :.:; ,: F::c.,Heraclid. Pont. F ::.:,: ap. Diog. Laert. V o; F :;o ap. Diog. Laert. V ,:. Schol. D ad Il. :.,; schol. A ad Il. :.,o. On Aristarchus attitude, see Severyns (:,:), Ballabriga(:,,), Burgess (:cc:).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:21:26 WEST 2013. Books Online Cambridge University Press, 2013Introduction ,as he advances the view that the Iliad is the work of a young, vigorouspoet, and the Odyssey that of an aged one.,The second-century ad satiristLucian during his sojourn amongst the dead asks Homer whether he wrotethe Odyssey before the Iliad, as most people say (Homer answers no).oAnother writer of the same period, the geographer Pausanias who himselfwas unsure whether the Theogony was a work of Hesiod and believed thatHomer had written the Thebaid declares that he has undertaken carefulresearch into the question of the age of Hesiod and Homer, but I donot like to write on this matter, as I know the quarrelsome nature of thoseespecially who constitute the modern school of epic criticism.;Sometimes,fortunately, relevant evidence is reported. Thus, in view of the fact thatverses :,o of the Aspis were transmitted in Book of the Catalogue,Aristophanes of Byzantium, as reported in the hypothesis to the Aspis,suspected that the Aspis was not by Hesiod but by someone else whohad chosen to imitate the Homeric Shield; this is not only testimony tothe way an Alexandrian scholar would reason, it also contains, if reliable,relevant information on the relationship between two works within theGreek epos.Both Eratosthenes, Aristophanes predecessor as head of the AlexandrianLibrary, and Aristarchus of Samothrace, who succeeded him, attempted tobuttress Homers priority over Hesiod by showing that the geographical,ethnographical and socio-cultural information incorporated in the Home-ric epics represents a less advanced and thus earlier stage in relation tocomparable information in Hesiods works. According to Strabo, Eratos-thenes pointed out that Hesiod knew many more localities associated withOdysseus wanderings than did Homer. -hwn(which would be the archaic Ionic form instead of Aeolic -ao/-awn) has::See St uber (:,,o: ;,). ::As shown rst by Witte (:,:,a).:,See for instance Janko (:,:), West (:,), Haug (:cc:).:Notable supporters of this hypothesis include Strunk (:,,;) (who in fact denied the very existenceof specically Aeolic material in the epics), Wyatt (:,,:) and Horrocks (:,,;).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:21:26 WEST 2013. Books Online Cambridge University Press, 2013Introduction ::been seen as evidence for just such a break. On the other hand, there areIonic sequences of -ho-/-hw- in other forms, and the argument dependspartly on the linguistic interpretation of the change known as quantitativemetathesis. Another crucial issue is the genitive in -oio, which was arguedby Haug (:cc:) to be an Aeolic archaism that is not directly comparableto the Mycenaean forms which are written -o-jo. If this is right, it wouldstrongly support the hypothesis of an Aeolic phase.As the momentum of Aeolic inuence became clear, interest in theinuence of other dialects on the epic language also grew. In :,:,, Meilletwrote: Just as the Aeolic epic was ionicized, there might have existedan Achaean epic, which inuenced the Aeolic one (:,:,: :,). Lexicalstudies supported this, by showing that many Homeric words were foundonly in Arcado-Cypriote.:,The decipherment of Linear B conrmed thishypothesis. Linear B was shown to be a close relative of Arcado-Cypriote,and at the same time it contained many forms that scholars had previouslythought to be Aeolic.However, the more we go back in time, the more similar the Greekdialects were to each other. Despite treatments like Ruijgh (:,,;), there isno convincing demonstration that there are specically Mycenaean formsin Homer, as opposed to just archaic forms and perhaps there cannotbe one, given the state of our knowledge about Greek dialects prior tothe advent of alphabetic writing. We must therefore rather ask ourselveshow old the Homeric forms are, rather than where they come from, andthis brings us to the chronological dimension. Chronology partly relies ondialectology, of course; as noted by Jones, many Aeolic forms will countas archaisms in Homer only on the assumption that Aeolic preceded Ionicin the development of the epic. Similar problems arise with other features,such as tmesis, the separation of preverb and verb (Haug, this vol.). Thishas been argued to be a pre-Mycenaean feature of the epic language, sincethere are no clear cases of tmesis in the Linear B tablets. On the otherhand, the evidence of the tablets is meagre, especially when it comes tocomplex syntactic constructions, so we cannot rule out that tmesis was aliving syntactic feature in Mycenaean times and possibly Homers time.The same holds for lexical evidence: Bowra showed that unusual words inHomer are often found also in Arcadian and Cypriote inscriptions but wecannot knowwhether the word also existed in pre-historic Aeolic and Ionic.Nevertheless, the decipherment of Linear B allowed for a more correctassessment of the history of Greek dialects and a more correct classication:,The most important articles are Bowra (:,:o, :,,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:21:26 WEST 2013. Books Online Cambridge University Press, 2013:: ivind andersen and dag t. t. haugof Homeric foms as Ionic, Aeolic or even Mycenaean. With these insightsscholars have been able to proceed from the linguistic stratication of theHomeric language as such to studies of subgenres of the Homeric poems:o Several linguists have recently denied this (Hackstein :cc:: ,:o; Haug :cc:: ,,o; Hajnal :cc,:c,,). However, those who hold this view seem to neglect the archaeological evidence for objectsthat go back to the Early Mycenaean period, like the body-shields that inspired some of the phraseswhich once had syllabic r like osc, uqipc:cv. Of course, such phrases could have been developedin Central Greece (where a mixture of Mycenaean and West Greek was probably spoken) rather thanSouthern Greece, so the Mycenaean phase of the epic tradition may be more chronological thangeographical in signicance.,As Haug (this vol.) shows, the rate of replacement in syntactical features like tmesis is likely to havediffered from that of morphological features; but this does not affect my argument.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013: richard jankocalled for, belatedly when there must be such a loss, so that the traditional dictionhas in it words and forms of everyday use side by side with others that belong toearlier stages of the language. (in A. M. Parry :,;:b: ,,,)This admirable insight was long overshadowed by Parrys other claim thatall or most epic verse consists of formulae, which would of course implythat their language hardly changes over time. We owe the rebuttal of thislatter assumption to Hoekstra (:,o,) and Hainsworth (:,o) in particular.My second presupposition was that the decipherment of Linear B byVentris and Chadwick and the reconstructions of historical linguistics,many of them decisively conrmed by the decipherment, are in theiroutlines largely accurate and reliable, so that we can say that, for instance,phrases with the digamma preserved are older than those which presupposeits loss. Indeed, the method can sometimes be used to conrmthose results.For example, when statistics show that the contraction of t to to spreadsthrough the epic as the poems become later, this helps to conrm that t,good is derived fromIndo-European 1s us and is cognate with the Hittiteadjective assus of the same meaning.oMy third presupposition was that, in order to obtain statistically depend-able results, it is in most cases useless to study elements of the language thatare rare, like infrequent linguistic forms;or isolated items of vocabulary;the occurrence of the latter depends too much on the vagaries of content,and one cannot usually knowagainst which other words they must be mea-sured. Instead, one must study common features, like phonetic changes andmorphological endings. Fortunately I was able to identify more than ten ofthese (and a few more since) that are so frequent that they yield statisticallysound samples in all but the shortest poems in the corpus. Each statistic isbased on counting dozens or even hundreds of occurrences (populations,in statisticians terminology) of tiny things, about many of which the poetscould hardly have been aware. One can usually obtain some usable resultsfrom poems as short as :,c to :cc lines, but everything depends on thefrequency of the particular phenomenon that is being studied.My fourth presupposition, related to the third, was that this methodapplies only to large bodies of text. It cannot date brief passages or particularlines, although one can certainly observe more recent or more archaic formswithin them, and doing so afforded me many insights into the creativity ofHomer when I was commenting on the Iliad. (It is important to emphasizethat the minimumsize of the body of text cannot be precisely dened, sinceoSee Janko (:,,:: : n. :,), with further examples.;This is the weakness of Hackstein (:cc:).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein :,it is contingent upon the number of instances of the phenomenon thatis under observation and the level of probability that is desired from theresult.) Because of this restriction, the method presupposes the generalintegrity of the transmitted texts of the early epic. But so do most scholars,except for a few diehard analysts and the surprising number of thosewho think there never was a xed text. The work of the unitarians andneoanalysts seems to me decisively to support the literary integrity of thebulk of the Homeric epics. Indeed, if we were to seek to date Homerspoems on the basis of the date of their latest lines, we ought to put theminto the Roman or Byzantine eras, when concordance-interpolations werestill entering the papyri and codices in signicant numbers. Thus I am notcomfortable with efforts to date whole poems solely on the basis of singlelines or brief passages. This is effectively the error that I made myself when I dated the Hymn to Aphrodite after theTheogony (above, n. ,).,West (:,,:ccc), with West (:cc:a: :::).:cSee Janko (:ccc, :cc,). ::See Janko (:,,).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013:o richard janko0204060801001 2 3 4 5 6 7 8 9 10 11 12Book-numberPercentageFig. :.: Linguistic variation in the Iliad, books :::.position. Since a book that managed to prove nothing in particular wouldnot have been interesting to read or to write, and I had made otherdiscoveries that seemed important, I presented those instead.::I suppliedin an appendix (Janko :,:: :c::,) the raw data for the individual booksof Homer so that others could test for themselves my denial that suchvariations exist. Few have done so, except for Danek (:,; this volume::co:::), who discerns only qualitative differences between the Doloneiaand the rest of the Iliad, in aspects like vocabulary and formular usage.Qualitative divergences such as those to which he points will never beable to be detected by a quantitative method such as mine, and theirexistence and signicance will always be a matter of judgement ratherthan of statistical evidence. As he acknowledges, there are no decisivequantitative differences between the diction of the Doloneia and that ofthe rest of the Iliad; I failed to detect any elsewhere either. Figure :.:::Janko (:,:: ::,). Also, the format of my publication limited the number of illustrations and ofwords. My omission was regretted by one reviewer (Fowler :,,).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein :;0102030405060708090100 Iliad Odyssey Theogony ErgapercentagesFig. :.: Diminishing archaisms from Homer to Hesiod.presents as a graph the variations in eleven very common features of epicdiction (which I shall explain below) in the rst twelve books of the poem,based on the data in my appendix A.:,One can see even by eye that thedivergences between books exhibit no consistent pattern. The rest of theIliad and Odyssey presents a similar picture, indicative apparently of randomvariation.When, on the other hand, I plotted the results for the whole epic corpus,I at once found an almost consistent decline in these eleven very commonfeatures, as they evolve from the Iliad to the Odyssey to the Theogonyand Works and Days. Figure :.: shows the different choices made in thefour poems in fourteen features of epic diction, including three additionalones the incidence of ,cc as against contracted ,, the failure tocontract t and tu- to to and to-, and the use of :tsc, rather than :tsvcv.According to the evidence, each feature comprises the retention of an:,Janko (:,:: :c::,). I have revised the calculations of the results for -cc and -cv in accord withthe suggestions of Jones (this vol.).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013: richard janko0102030405060708090100Iliad Odyssey Catalogue Theogony Erga Hy. Dem.* false archaism regional variationpercentagesFig. :., Diminishing archaisms in epic diction.archaism that could have been replaced by a more recent form. The onlyfeature among the fourteen that does not belong to this pattern is anAttic-Ionic innovation, the use of n-mobile (v0 tqtsuo:iscv) before aconsonant; I include this feature to show that it disappears in works ofBoeotian origin like those of Hesiod.Classicists are notoriously averse to numbers, but gure :.: should makeit clear to anyone that there is a coherent pattern in these results. It emergesthat the Odyssey is nearly always more advanced than the Iliad, the Theogonyis always more advanced than the Odyssey, and the Works and Days is nearlyalways more advanced than the Theogony. Yet the Odyssey is extremelyclose to the Iliad, and the Works and Days stands in a similar relationto the Theogony. On the other hand, the frequency of n-mobile before aconsonant increases over time in Ionic and Attic poems and diminishesin Boeotian ones, so that in this Hesiod seems more archaic than Homer.In gure :., I have added the results for the Catalogue of Women and theDownloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein :,Table :.: The statistical basis of gure 1.3 (%)Iliad Odyssey Catalogue Theogony Erga Hy Demdigamma (observed) .: ,., o. o; o:., ,.:masc. gen. in -cc ,.: ,.: ,c :.; ,,., ;,gen. plur. in -cv ,., c.: oo.; o:., ,., :.:gen. sing. in -cic ,:., o.o ,,., ,. :. ,.,gen. sing. in -cc notcuo, ,;., ., o. ,,.; ,.:dat. plur. incioi/-nioi/-cioi,. ,.: ;.: ;:. oo., o,.,dat. plur. in -cio /-cionot -ci,/-ci,:., o., ,c o. ,., :.oo-stem acc. plur.before vowel:., ,.: :o.: :,., :.; ca-stem acc. plur. beforevowel; :.: ,:.o :o.; ::. o.,Ai- not Znv- ,:., ,., ;,.: ;;., ;:. ;.,,cc not , ,o., ,o o. : ,.; ,.;:tsc, not :tsvcv , ,: :c c c :,tu not contracted :., :.o ;o. ,.; .; ;:.:n-mobile before cons.per :ccc vv.,,.o ,;.: ,c.; ::., ::.; .total no. of instances (sample size)digamma (tpscexcluded):;;, :oo; :c, : o:masc. a-stem gen. sing. :, , ,c :: , a-stem gen. plur. :: :o: : ,, :: :oo-stem gen. sing. ::co :,, :o, :c: ::, ;,gen. sing. in -cc or-cu:c:: o:, ,, ::, , ,o- and a-stem dat.plur.:; :,c: :,; :,, :: :c:o- and a-stem shortdat. plur.:oc ::: ,c ,o ; ,,o-stem acc. plur. o:; :: ,: ,: ,: ,a-stem acc. plur. ,, :oo :, : :; :ooblique cases of Zt, :;: ::: : c :: ,cc and , :: :; :: o: :: ::tsc, and :tsvcv ;, , :c :: : tu and to ,oc ,;c , ,: , :n-mobile beforeconsonant,,, ,: :, :: : ::no. of verses :,o,, ::::c c. ;,c :c:: : ,,Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013,c richard jankoHomeric Hymn to Demeter. The data on which this graph is based are givenin table :.:, to show that the numbers of instances involved are high; weare not counting just a few occurrences.As one expects with statistics, gure :., reveals two outlying results in theHesiodic Catalogue of Women. However, both are based on small samples,and most of its other results fall between those for the Odyssey and thosefor the Theogony. There is, however, a tremendous scatter in the HomericHymn to Demeter, a phenomenon to which I shall return. In the rst vepoems, a general pattern is evident. The Iliad is the most archaic poem interms of its diction, the Odyssey is next, and Hesiod comes last, generallyin the sequence Catalogue of Women, Theogony and Works and Days. Thisis of course only a relative sequence; it is not translated into centuries orgenerations, let alone years. But it is a sequence, and unless the statisticsare somehow wrong, it is therefore a fact. As a fact, it is a phenomenon inneed of explanation.Even before I wrote, great effort had gone into arguing that linguisticdifferences between the poems depend on genre alone;:the claim was thatsome genres are more conservative in their use of old formulae than areothers. Much of my book was devoted to examining this claim. It has someplausibility only in the case of genealogy, where the Catalogue of Womenis consistently slightly more archaic than the Theogony, an acknowledgedpoem of Hesiod which contains rather less genealogy as a proportion ofits total number of lines. Yet the Catalogue must be either contemporarywith Hesiod or later than he, since it is attached in content, structure,and the manuscripts to the end of the Theogony (Janko :,:: :, :,::).Almost everyone knows (or thinks they know) rst, that the Catalogueis spurious,:,and secondly that it was composed after the foundation ofCyrene in o,c bc; indeed, many hold that it was written in the sixthcentury.:oI shall argue below that neither of these views need be correct.When poems such as the Iliad and Odyssey display a greater usage ofarchaic diction than do the Theogony or Works and Days, and when theydo so consistently, with clusters of early results (e.g. the Odyssey is nearlyalways slightly more recent than the Iliad),:;it is counter-intuitive to:Notably Pavese (:,;:, :,;).:,Dr ager (:,,;), who ascribes to Hesiod both the Catalogue and the end of the Theogony, is a recentexception; likewise Arrighetti (:,,: ,;).:oSo, notably, West (:,,: :o), Fowler (:,,). Wests arguments are successfully rebutted by Dr ager(:,,;: ::o).:;Brantly Jones (this vol.) has proved that the Odyssey is more archaic than the Iliad in one result, thegenitive in -cc, once ambiguous cases before vowels are discounted. I accept his correction, whichhardly affects the overall picture. My tables reect this correction.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein ,:suppose that this could be explained by anything other than linguisticchange through time. I shall look at other possible explanations shortly;but we should only embrace a different kind of explanation if we haveother, compelling types of evidence that point us in that direction. It isboth simpler and more logical to accept that the preponderance of earlydiction in Homer as compared with Hesiod is because the texts of Homerwere somehow xed at an earlier date than were those of Hesiod.There is one major complexity to be addressed before we turn to theimplications of this relative chronology of Homer and Hesiod. Figure :.,reveals that the Homeric Hymn to Demeter does not behave like the textsof Homer and Hesiod. The Hymn has more recent diction than Hesiod insix features, but more archaic diction in seven others (I exclude n-mobile,as this phenomenon varies by region). The more recent features are (a) therarity of ,cc rather than contracted ,; (b) the infrequency of elided o-and a-stemdative plurals in -cio and -nio before vowels; (c) the rarity of a-stemaccusative plurals before vowels; (d) the rarity of long dative plurals in-cioi and -nioi; (e) the rarity with which the uncontracted o-stem genitivesingular in -cc could be restored; and (f ) the rarity with which the effectof digamma is observed. Of these six criteria, all are based on statisticallyreliable samples. The reason why the poet does not archaize in observing thedigamma, or in observing the earlier frequency of uncontracted genitivessingular in -cc, is that he saw no reason to do either thing; he probablydid not know that there were archaisms at stake in these features of hislanguage, since the existence of digamma and of the uncontracted genitivein -cc was long in the past of the Attic dialect when he composed hisHymn.The pattern is different in other linguistic features, some of whichpoets could have consciously manipulated in order to achieve particularliterary effects. The seven more archaic features of the Hymn to Demeterare (a) the frequent use of the stem Ai- instead of Znv- in the name ofZeus; (b) the frequent retention of the archaic genitive plural in -cv; (c)the retention of the archaic genitive singular in -cc; (d) the retention ofuncontracted tu both on its own and in compounds; (e) the retention ofthe archaic genitive singular in -cic; (f ) the frequent use of the accusativeplural in -cu, before a vowel; and ( g) the frequent use of archaic :tsc,rather than :tsvcv. However, no fewer than four of these phenomenarest on unreliably small samples of eight occurrences or fewer: these are(c) the retention of the archaic genitive singular in -cc, (d) the retentionof uncontracted tu instead of to, (e) the frequent use of the accusativeplural in -cu, before a vowel, and (g) the frequent use of :tsc, ratherDownloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013,: richard jankothan :tsvcv. Accordingly, no weight can be placed upon these criteria. Butthe other three are statistically signicant, and are distinctive because theyare features which the composing bard certainly could have manipulatedconsciously. First, the retention of the Attic stem Ai- instead of the EastIonic Znv- in the name of Zeus is a feature which one can attribute to thevernacular Attic dialect of the poet. The second and third features arethe retention of the archaic genitive plural in -cv and the retention ofthe archaic genitive singular in -cic. Both features are sonorous disyllabicendings, and I believe that the poet consciously favoured them in order toenhance the solemnity and archaic avour of his verse.Examination of most of the other long Homeric Hymns and of theHesiodic Shield of Heracles reveals even more numerous departures fromthe pattern, so much so that they have no cluster of results at all (Janko:,:: ;:, with table : and g. :); I forbear to demonstrate this here,and refer you to my book and to a related article (Janko :,ob), where Iargued from historical evidence that the Shield of Heracles and the Hymnto Pythian Apollo were both composed in central Greece in the rst twodecades of the sixth century bc, with the Shield being prior. I explained thepresence of anomalous results like those in the Hymn to Demeter, the Shieldof Heracles and the Hymn to Pythian Apollo as follows. Once we are dealingwith poems from a very late stage in the tradition, the poets are no longerlearning their diction exclusively from their older living contemporaries.They are also hearing renditions of texts xed at much earlier stages ofthe tradition, from which they are learning to adopt certain archaisms,i.e. those which are immediately noticeable to a listener. These poets didnot care whether they put a formerly uncontracted disyllable in heavy orlight position in the hexameter, but they felt passionately about producinga grand-sounding poem, packed with euphonious polysyllables like -cvand -cic. The same can be demonstrated for all subsequent composers ofGreek hexameters, from Theocritus and Apollonius of Rhodes to Quintusof Smyrna and Nonnus (Janko :,:: ;o).I called this phenomenon false archaism, which still seems the bestname for it. Poets who practise false archaism are imitating older modelsselectively. They could not imitate them perfectly, even if they wished todo so. However, if poets are free to imitate aspects of older models from thesame tradition, one may well ask what value an analysis of their languagecan possibly have for chronological purposes. In effect, this phenomenonof false archaism might seemcompletely to demolish the edice of graduallinguistic innovation that I had carefully constructed.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein ,,Yet I do not believe that it does. Just because some epic poets practisedfalse archaism, it does not logically follow that they all did so. The consis-tency of the results that I obtained for Homer and Hesiod shows that theirpoems are not subject to false archaism but are genuinely archaic com-positions, whose the bards learnt their diction from their contemporariesand not from some far older, xed text. If such texts were available in anyform to Homer and Hesiod, they have had no discernible effect on thetexture of the language of those poets. The later poets, on the other hand,like those of the Hellenistic and Roman periods, offer no such consistentpatterns.So what is the signicance of the fact that the poets of the long Hymnsto Hermes, Demeter and Pythian Apollo practise false archaism, whereasthe texts of Homer and Hesiod, including the Catalogue, show no sign ofit? The only explanation is that those poets who had access to texts xed atmuch earlier stages of the tradition were themselves later than Homer andHesiod, who had no such access to such fossilized material. Later poetsknew the work of much older predecessors, as did their Hellenistic andRoman successors. This accords with the growing diffusion of literacy inthe Greek world, and with the gradual increase in the number of writtentexts and of performances based on them, such as are documented forAthens in the time of the Pisistratids. The picture of a coherent evolutionof the epic diction remains consistent.:Hence one must ask what it means that the texts of the two poems ofHomer and the three Hesiodic poems were xed at different stages in theevolution of the diction. I have already suggested that this reects a relativechronological order. But the fact that the poems were xed at differenttimes has other important implications. If we believe, as I do, that theTheogony and the Works and Days are by a single poet, the evolution inHesiods diction from the Theogony to the Works and Days shows that theepic Kunstsprache could evolve even during the lifetime of a single poet;the same is true, mutatis mutandis, for Homer, where Longinus (Subl.,.:,) plausibly suggested that the Odyssey is the work of the poets old age.Others are willing to accept Kirks hypothesis (:,o:: ,c:,) that the epicswere accurately transmitted by memory over a considerable period beforethey were written down; but I have never seen any decisive argument infavour of this view, since these are not sacred texts like the Rig Veda. It is:Hence the account of my method in Martin (:cc,: :o;) is gravely mistaken when it is said thatthere is no criterion for distinguishing false archaism, when the criterion is lack of consistency inthe diction, i.e. the lack of clusters.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013, richard jankofar easier to accept that the epics acquired a xed form at different times,that we have them in much the form in which they acquired this xity,and that their language differs in these subtle ways precisely because theywere xed at different times. Others, again, may prefer to believe that theauthors of all these poems wrote them down in this form. However, likeKirks theory, this too is an unnecessary hypothesis, because it assumes thatthese poems could not have been composed without their authors usingwriting. This belief, in my view, reects our own lack of imagination andof experience of an oral culture rather than the realities of skilful oral epiccomposition in a largely illiterate society.Since the evidence shows that the poems were xed at different stagesin the ongoing evolution of the tradition, those who wish to ascribe theirpresent formto editors must accept that they have been uniformly and con-tinuously updated by experts in historical linguistics to keep them distinctfrom each other in terms of language. This is not credible. Accordingly,I supported very tentatively in my book, and more denitely since, thehypothesis of Milman Parry and Albert Lord that these epics are oral dic-tated texts, and that their linguistic form accurately reects the differentstages during the tradition when they were taken down. I believe, followingLord, that the slower pace of dictation permitted the best poets to producebetter poems than they could have sung.:,The simplicity, coherence andcomprehensiveness of this explanation of how the texts were xed havenever remotely been matched by any other theory.Although some reviewers of my book wrote that they could not followall the statistics, on the whole they accepted my results, at least as regardsrelative chronology. However, as time went on it began to appear thatthe book was being more cited than read. Unfortunately, it went out ofprint within ten years. Also, it presupposes much expertise in historicallinguistics and the Greek dialects, as well as an intimate knowledge of earlyGreek hexameter poetry. Although I kept the statistics as elementary aspossible, the fty-two tables of numbers are dreary stuff in themselves. Inan account of the language of early Greek epic I supplied further statisticswhich support my case (Janko :,,:: :,, esp. :::), but none of myrecent critics takes account of these additions to my theory.During the :,,cs I began to notice some really strange pronouncementsabout the date of Homer. These often began by setting aside the linguisticevidence, allowing scholars to adopt other approaches, above all the notion:,Lord (:,,,, :,oc: ::, :,,:: ::::, ,, ,,, :c,:c, :,,,: :c:,); cf. Parry in A. M. Parry:,;:b: ,:.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein ,,that the texts were never xed. This was in my view already refuted bythe statistical results presented in my book. Such critics usually cited,sometimes apparently at second hand, my appendix E. There I offered,among a number of tables giving different scenarios for the absolute datingof the epics, provided that their relative dates were upheld, the observationthat, if the date of the composition of the Iliad were set at around ;,c;:,bc, that of the Odyssey would fall at around ;,;:,, the Theogony in ;ccoo,, and so on. The citation of these exact dates became a sort of talismanfor these scholars,:callowing them to overlook the mountain of statisticalevidence, because it seems absurd to give an exact date in a case where therewill never be documentary evidence for the precise years in which thesetexts were xed. I quote an example of such a critique, written by a scholarwhose work I admire in other respects:[T]here is still the internal evidence of linguistic forms to consider. On the basis ofsuch evidence, Janko (:,:) has insisted that the Homeric poems must date fromthe eighth century, and he came to conclusions about the relative dating of manyother poems as well. Jankos study displays an unsettling condence that epic verseeverywhere was developing in the same way in a robotically steady manner. Thestatistical quantication of forms here does not make enough allowance for thevarying length of the different poems that are being compared, and indeed the verymeagerness of what survives in some cases can only lead to misleading percentages.Variance in diction and form between poems was undoubtedly [my emphasis]caused by subject matter, poetic function, local dialects, and the preferences orability of composers. The epic tradition on the whole was a swirling ux ofcrosscurrents, which a rigid statistical analysis cannot hope to measure. And evenif we accept conclusions about chronological relativity, that means nothing aboutthe historical time of the poems. An unveriable argument about the LelantineWar is the peg on which Janko hangs the whole frame of his relative dating toa historical timeline. Finally, the very desirability of assigning specic dates toindividual poems is open to question. Assuming a moment in time for the xationof early epic does not change the fact that a lengthy process of oral compositionlay behind it. (Burgess :cc:: ,:,)A footnote adds [t]o be fair, Janko is certainly not unaware of these issues,and gives page-references that amount to :, per cent of my book.:cE.g. Taplin (:,,:: ,, n. ,,). Others make a similar error over the level of exactness in dating, whenthey hold that I believe that, because the Theogony is linguistically slightly more advanced than itssequel the Catalogue, the latter was necessarily composed before the former (e.g. Haubold :cc,: ;n. ). As I had noted (Janko :,:: ,o), linguistic tools are inevitably somewhat blunt: greaterdivergence than this is found within the attested work of Hesiod himself, i.e. between the Theogonyand Works and Days. It is of course possible that Hesiod dictated the Catalogue before he dictatedTheogony :,.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013,o richard jankoAs for epic verse developing everywhere in a robotically steady manner,I wrote many pages on the inuence of local dialects, since I wanted toestablish the origin of each poem. I found that one can easily distinguishIonian from mainland compositions, which have Boeotian inuence inHesiod and Attic features in the Hymn to Demeter. As for not mak[ing]enough allowance for the varying length of the different poems that arebeing compared, what matters is the number of occurrences, not the lengthof the poem, although the two things are related. Part of the purpose ofstatistics is that it enables one to compare populations of different sizes.Every result was subjected to tests such as t-tests and y:tests to make surethat it was statistically reliable, as my footnotes reveal; results based oninadequate sample-sizes were set aside. Again, when it is suggested thatthe diction was affected by the preferences . . . of composers, this can onlybe partly true; in many cases, such as how many uses of the contractedgenitive singular in -cu can be replaced by the uncontracted form in -cc,the bards cannot have been aware of this difference and had no experts inhistorical linguistics to advise them.West (:,,,: :c,) suggests that the major determinant of the quantityof younger forms in a given poet is the extent to which his language divergesfrom the formulaic, and this depends on many other factors apart from hisdate. However, it is not clear howone could be certain that this is the majordeterminant rather than the date: in the Homeric poems the proportionof speeches, which constitute the least formulaic part of the diction,::isthe highest in the corpus, yet these are the poems with the most archaicdiction. Moreover, I did examine, at some length, the question of variancein diction and formbetween poems being caused by subject matter, poeticfunction, local dialects, and the preferences or ability of composers, andwrote as follows:It might be alleged, for example, that battle-poetry has more ancient antecedentsthan stories of nautical adventures, genealogies or gnomic and rustic verse. Suchan approach is almost impossible to test on present evidence, at least within theearly Greek tradition, with one important exception, and that is in Hesiod. It issometimes assumed that gnomai and accounts of rural activities are likely to bethe least traditional of all the types of hexameter poetry of the archaic period.Certainly it is true that the diction of the Works and Days is very advanced: but itis nonetheless not as advanced, by a good margin, as the narrative in the Hymn toDemeter, which is in terms of content reminiscent of scenes in Phaeacia and Ithacain the Odyssey. Moreover, Works and Days ::cc consists of mythic narrative, and::Grifn (:,o). It does not of course follow from this fact that the Homeric poems cannot be orallycomposed, as Grifn argued.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013prtn te ka staton an edein ,;not of moral and agricultural precepts . . . And yet, when the language of thesetwo hundred lines is studied scientically,::it is established that, although it issomewhat less advanced in the linguistic criteria than the remainder of the poem,it is on the whole more advanced than the diction of the Theogony. Hesiodsdiction advanced, as we know, but it advanced despite the content. (Janko :,:::,:)However, the critic whom I quoted is partly correct that if we acceptconclusions about chronological relativity, that means nothing about thehistorical time of the poems; it is true that relative and absolute chronologyare different questions. I would only say that, if the artistic or historicalevidence for the date of Homer did point decisively to the seventh or sixthcentury, then Hesiod would have to be later still by some margin or other.If people wish to accept this, they will need to explain how it is that Hesiodis imitated not only by Alcaeus but also by Semonides of Amorgos, since inanother appendix in my book (::,) I surveyed all the apparent cases, inthe epos and other early poetry, of exemplum and imitatio. There I showedthat there are a number of ways in which this can reliably be recognizedfrom the adaptation of formulaic diction. As for the eighth-century dateof Homer and the Lelantine War, what I actually wrote was if . . . theLelantine War can indeed be dated to Archilochus time, and if Hesiod wasconnected with it, and if Homer was not prior to the mid-eighth centuryand not later than its end, then the relative datings will be corroborated,but no universal agreement on these points exists at present (:,,o). Therewere a lot of ifs in this sentence, and deliberately so, since the historicalevidence is hard to conrm; but the arguments about the Lelantine Warhave not changed, even if West is no longer so condent about them.:,Finally, if critics question the desirability of assigning dates to individualpoems, I do not see how one can understand the literary history of earlyHellas without knowing at least the relative dates of the major poems. Onemight as well say that ignorance is better than knowledge. Other critiquesof my general approach have been similar to those discussed above.:::I gave the gures in appendix B (::c:).:,West (:,,,: :::,): contrast West (:,oo: ,).:Here is another: [Janko] uses various linguistic criteria to establish that the language of the Iliadand Odyssey is less modern than that of other hexameter poems. On the basis of this observationhe establishes a relative chronology of Homer, Hesiod and the Homeric Hymns; he then assumesan eighth-century date for the Iliad and uses it to calculate the absolute dates of the other poems.There are various possible objections . . . : in the rst place, the eighth-century date is, by hisown admission, simply assumed. Secondly, Jankos own linguistic criteria measure choices betweenalternative epic forms which sound more or less archaic, but which were all current within theIonian poetic language, given that they feature, with greater or lesser frequency, in all or most earlyDownloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:34:44 WEST 2013. Books Online Cambridge University Press, 2013, richard jankoWhen one critic suggested that assuming a moment in time for thexation of early epic does not change the fact that a lengthy process of oralcompositionlay behind it, nobody denies this; infact, projecting back fromHomers usage to the beginnings of various linguistic phenomena conrmsthe view of Meister, Parry, West, Ruijgh and now Haug (:cc:: :o::) thatthe epic tradition resided in Asiatic Aeolis until shortly before Homerstime (Janko :,:: ;,, with g. , on p. ). Here I must address thediscussion (Chapter : below) by Brandtly Jones, who earns my thanks forbeing the rst to acknowledge the statistical dimension of the prehistory ofthe epic diction. His account of my sequence of changes in the prehistoryof epic diction seems to misunderstand my argument in several ways.:,However, he is right that my method of calculation of the introductionof quantitative metathesis in the a-stem genitives was awed. I shouldhave excluded from the calculation the cases of -tc before vowels, becausethese could, as he suggests, be instances of elided -cc. When this is done,the relative date at which a monosyllabic scansion of the a-stem masculinegenitive singulars enters the epic diction turns out to be c.; units (ratherthan :.; as I had thought) on the Common Scale, where the Iliad is set atc and the Theogony is set at +,.c, because the result for the Iliad changes.Similarly, I should not have omitted the forms in -cv and -v from thetotals of a-stem genitive plurals that admit quantitative metathesis, sincehexameter texts. Choices and preferences between available words and expressions may thus beinuenced by the subject-matter of the poem, the specic area in which it was composed, and thetastes of particular bards and audiences, and not simply by the date of composition (Graziosi :cc::,::). These are very similar arguments.A different critique is that of Sauge (:cc;). (I am grateful to M. Sauge for a copy of his book.)In order to set aside my results and argue that the epics were recorded in sixth-century Athens,Sauge has to reject Hoekstras overwhelming proof that epic poets modied their formulae (: n.o;). Instead, he suggests that the epic diction (but not the texts) was xed in the early eighthcentury(!), perhaps by Cynaethus on Chios (o;, ,o,); but Cynaethus was alive in c. ,:,,cc bc(Burkert :,;,). He holds that the poets learned and employed two different pronunciations at once.Thus, he believes (;,), in phrases involving initial digamma they pronounced the phoneme orignored it according to whether it is observed or neglected (and in order to furnish an objectionto one of my results he rejects the consensus that initial digamma in enclitics is in fact in a medialenvironment, as the usage of Sappho and Alcaeus proves). I have not seen Bl umer (:cc:: I. :,c);like Sauge, he does not address my argument from clusters (Fowler :cc,: ), which is the crucialone.:,Regarding -cic, -cv and -cc, my point is indeed that the metrical and not the phonological shapeof the termination changed, but I do not see how this affects the argument: if -nc was ever presentin the epic diction, why was it changed back to -cc? Regarding the change in the admission ofelision in the dative plurals, Greek has or has not admitted elision in different words at differenttimes, and it is surprising that Jones misconstrues me as thinking that such a change could havereected a general change in the practice of elision in all words. Nor is it bizarre to suggest thatthe datives of c- and a-stems were treated differently, since these represent syncretisms of differentendings: in the o-stems Mycenaean has distinct endings in -o-i and -o (from the instrumental in Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013Relative chronology and an Aeolic phase of epic ,a (metrically guaranteed) neglect of digamma could not reasonably haveentered epic language until initial [w-] had lost consonantal force in somerelevant dialect.,Clearly, however, the effects of digamma persisted in epicsinging well after the sound itself had disappeared, and thus, any apparentobservance of digamma, say, need not have entered the text before theloss of the sound in colloquial speech. That is to say, digamma is both a productive and moribund feature of epic. On the one hand, itis an important part of the Kunstsprache, licensing hiatus at certain metrical positions even beyondlegitimate historically w-initial words, but it has been lost from the Ionian vernacular by the timeof the xation of the epics, so that the poets increasingly create new phraseology which neglects theeffects of digamma.,For reliable assessments of Aeolic features in the epic language, see Horrocks (:,;: :;c), Haug(:cc:: ;:), Wathelet (:,;c: :,).ottttooi (,: in Homer) versus tttooi(v) (,) and tttoi(v) (,). Cf. Wathelet (:,;c: :,), Haug(:cc:: ;:).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013o brandtly jonesAeolicAchaeanStacked/ Phase model Diffusion modelAeolic Achaean IonicIonicNon-extant AeolicepicNon-extant Arcado-Cyprian epicHomer, Hesiod,etc.Homer, Hesiod,etc.Fig. :.: The stacked/phase model versus the diffusion model.archaisms within epic diction if the epic language passed through an Aeolicphase. Specically Ionic phraseology, on the other hand, is tantamount to akind of innovation if the tradition as a whole only came to Ionian bards ata late date. A given morphological category might show metrically distinctvariants in Ionic and Aeolic which were each current in their respectivedialects, and thus not diachronically ordered in absolute terms. Under aschema of dialectal phases, however, an Aeolism in the Ionic hexametertradition would count as an archaism, since it would have been retainedfrom a time preceding the transfer of the tradition to Ionian singers.Scholars have also argued for a continuous Ionic tradition spanning fromthe Bronze Age to the archaic period directly, without a discontinuity ofan Aeolic phase. The epics were Ionian as far back as it makes sense touse such a term, and they admitted phraseology through language contactwith neighbouring Aeolians over centuries, perhaps through an Aeolic epictradition or simply through colloquial speech. Under this diffusion model,Aeolisms could have entered the Ionic tradition at virtually any time duringthe development of the tradition. Thus, Aeolisms per se are not indicative ofchronology. Figure :.: gives a simplied graphic depiction of the competingmodels. The diachronic dimension is oriented from earlier at the top tolater at the bottom.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013Relative chronology and an Aeolic phase of epic ;Each model has its vocal and its tacit supporters;;the epics containsome specically Aeolic forms which cannot, pace Strunk, be pushedback into Mycenaean times or otherwise explained away. Naturally, giventhe contiguity of Aeolis and Ionia, and especially with the northwardexpansion of the Ionians, linguistic contact is assured. Aeolisms in the epic,though, do not necessarily point to a previous phase. Horrocks offers thefollowing assessment:There is no reason to suppose that all the Aeolic forms in the epic dialect camefrom the Aeolian tradition during the period in which it was rst Ionicised, evenif one accepts that there was an Aeolic phase. The real issue is whether or notthere is evidence of a break in the Ionian tradition, a point at which, going back inhistory and reconstructing where necessary, characteristic Ionic phenomena peterout leaving a gap between the earliest recoverable Ionic forms and their knownor reconstructed Bronze age antecedents. If there is no evidence for such a gap,there is no room for an Aeolic phase, and the diffusion theory must be adopted toexplain the full set of Homeric Aeolisms. (:,;: :;,)Indeed, a direct line of transmission from the Bronze Age to generations ofIonian bards, and ultimately to a Homer, is the most economical modelof development.,A pattern of diffusion obtains in the South Slavic epics, which remainthe closest comparandum for the Greek tradition. About the mixed dialectof the epic register, John Miles Foley notes:South Slavic singers use both ijekavski (chiey Bosnian and Croatian) and ekavski(chiey Serbian) forms, not seldom in the very same line . . . [A]lthough nativespeakers normally use only the forms appropriate to their particular geographicalcontext in most registers, South Slavic singers customarily and systematically have;Some of the most prominent and explicit advocates for an Aeolic phase in the history of epicdiction include R. Janko, M. L. West, C. Ruijgh, P. Wathelet, K. Meister, M. Parry, L. R. Palmer,A. Hoekstra and D. Haug. Many others implicitly adhere to the model, including Chantraine, whofrequently explains forms fromthe standpoint of the earlier phase of the epic. The most even-handedtreatment, in my view, is that of Horrocks (:,;, :,,;) who ultimately sides with the diffusionists,though not without reservations; Wyatts view (:,,:) is more extreme, denying the existence of anyAeolic epic poetry and attributing the Aeolisms to colloquial language contact. Others who haveexplicitly argued against the phase model include D. G. Miller, J. Hooker, K. Strunk, T. Webster,J. M endez Dosuna and M. Peters. Strunk (:,,;). For recent critique of Strunks thesis, cf. Haug (:cc:: ;::).,Defending the Aeolic phase, and rebufng critics, such as Wyatt and Webster, who attempt todownplay or refute Aeolisms in Homer, Janko notes that the hostility to Aeolisms arises from apreference for the neater theory that the epos was brought straight to Ionia from Attica and thePeloponnese, thus descending directly from major southern centres of Mycenaean civilisation: theAeolic forms are attributed to passing exchanges with a parallel epic tradition (:,:: ,).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013 brandtly jonesrecourse to forms and syntactic features from both dialects when they code-switchto the traditional performance idiom.:cThough we can never superimpose the habits of one oral tradition ontoanother, the parallel with the Greek tradition is very suggestive: we see con-current local traditions which share traditional phraseology from differentregions. The exchange is ongoing, rather than punctual.::3 a gap in a continuous ionic tradition?Aeolisms alone cannot substantiate a model of discrete dialectal phasesin the development of the epic corpus, as their mere presence could bethe result of ongoing contact, i.e. diffusion. Without some demonstrablebreak in the development of Ionic forms attested in the epics, the proposedphase theory is a solution in search of a problem. Proponents of dialectalphases see just such a gap in the masculine a-stem genitive singulars andthe a-stem genitive plurals.The phonological history of the a-stem genitives is straightforward.Mycenaean shows evidence for a genitive in - a(h)o, and this seems tobe the common Greek ending.::Most dialects simply preserved the:cFoley (:,,,: ;;). While epic language is on the whole coincident with colloquial speech, theguslar, like the aoidos, depends on both words and grammatical forms that are no longer a part ofthe singers conversational language, but remain an integral feature of their traditional register. Forthe guslars, many of these archaisms are Turkicisms which have obsolesced. Morphologically, theaorist is preserved for both metrical and phonological/phraseological reasons like in-line rhyme.Regarding a mixture of features from distinct dialects, Foley notes that deployment of the variantsdijete/dete child depends strictly on the metrical and phraseological environment, e.g. dijete Halilechild Halil, o syl. colon versus A sede mu dete besjediti But the child began to address him; Thesinger speaks the poetic language uently by speaking it multidialectally, and according to the rulesof the register for fashioning verbal signs (;;). Cf. the line (:o.::;,) Ovcijem te zapojila mlekomShe began to nurse you with sheeps milk, showing both dialectal variants deployed in a single linein a concatenation unlikely to exist in conversational speech or any other register of South Slavic.This deployment is a function of competence. While ekavski or ijekavski speakers naturally favortheir home dialect to a large degree, traditional epic phraseology always and everywhere entails autilitarian mixture of forms, sorted not according to the singers individual speech habits but rathermetri causa (;). Witte (:,:,b) noted that the Aeolic forms in Homer occurred almost exclusivelywhere they provide a metrical alternative to Ionic, an idea developed further by Parry and others.::A colleague of mine who has done eld research in the Balkans has told me, only half jokingly giventhat regions turbulent recent history, that the singers seem capable of borrowing each others songseven while theyre shooting at one another!.::Cf. Myc. su-qo-ta-o /sugw ot ao/ (of the) swineherd. The nominative singular of the -eh2 stems wasoriginally endingless but acquired -s after the analogy of the o-stems in most Greek dialects, e.g.Att. tci:n,, Dor. tci:,. Some dialects preserved, or recreated, forms without -s in the masc. a-stem nom. sg., e.g. Boet. ticvis, Mc,t, also in North-West Greek. Thus, the original masc.gen sg. -eh2es > - as seems to have been replaced by analogy with the thematic stems: -os: -osyo:: - a : - ayo. - ayo subsequently developed to -hc, then -c, with further contractions, QM orparadigm remodelling according to dialect.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013Relative chronology and an Aeolic phase of epic ,ending, often with subsequent contraction, but in AtticIonic, long alphaunderwent fronting/raising to long -:- which in turn merged with low/ e/, eventually spelled with <n>, in Ionic.:,The ending -c thus devel-oped to -nc, and this sequence in Ionic underwent so-called quantitativemetathesis, (QM) whereby descriptively an input of certain long vowelsbefore certain short vowels produced an output with quantities reversed.:There was a related sound change whereby a long vowel shortened beforea subsequent long vowel, with restrictions similar to those for QM. Thusfor the genitives which were subject to quantitative metathesis we have thefollowing development:gen. sg. m. a-stem -c > v-c, > vnc, (Il. :.;o) > vtc, (Il. :,.:,), Aspcvtc, (Od. .:::)The declension of ship shows a very mixed picture, and one that shouldbe treated as a separate phenomenon from the a-stems. The forms aresystematically disyllabic in the simplex, with apparent archaisms in vnc,,vc, and vncv, and innovative forms in vtc,, vtc, and vtcv. Except incompounds,:,we never nd the Attic declension form vtc, in the epics.Thus, with the exception of vt : at Od. ,.:,, the forms showshorteningrather than QM. We thus have some evidence for Ionian phonology in theappropriate sequences, but not for the a-stem genitives.6 further evidence against an aeolic phaseThe proponents of an Aeolic phase assert that the Ionian bards took overthe Aeolic tradition and modernized where they could, retaining thoseforms for which they had no replacement. This theory implicitly makescertain predictions, however, which are clearly wrong. Every sequence of<nc>or <nc>or <nc>which appears in epic is, if we accept an Aeolicphase, predicted to have a non-Ionic origin,:oat least among polysyllables.Homer shows a good number, e.g. cinc, vigorous, stout (< aygy awo-),tsnc I burned (< ekahwa < ekawsa), etc.:;The existence, indeed:The spelling <ti>for historical <n>is a non-issue. The verb-stems in e normally have -ti- beforeo-vowels but -n- before e-vowels (ocutic, ocun,; tic, o:ticutv, :tvtic,). This looks like abardic convention (Janko :,,:: ,o). Cf. Chantraine (:,,: ff.).:,Forms like vnc, and c, are systematically disyllabic in the simplex in Homer, but show QMin compounds (cf. Chantraine :,,: ;:): A,ttc, (Od. ::.:,:, :;), lnvttc, (Il. :.,, :.,o,:;.,), lnvttcv (Il. :,.,:) lnvtt (Il. :.;); Aspcvtc, (Od. .:::), Avcnoivtc, (Od..::,). Likewise, the long vowel of nc,, tc, nc0, contrasts with the short vowel of the compoundtcoqcpc, (Il. :,.::o). An analogous distribution is found in Hesiod, archaic lyric, Herodotus, andin inscriptions from the Ionic speech area. Hdt. nc, tcivc,; nc, Mtvttc,, tcqcpcv;vnc, vtcociscu,. M endez Dosuna (:,,,: ::::,).:oThis excludes disyllabic forms such as nc,, vnc, for reasons put forth by M endez Dosuna, cf.n. :.:;Meister (:,::: :o) quotes numerous other forms for which we nd spellings of <nc>, <ncv>,<tic> and <ticv> in words once containing PGk. / a/. My thanks to Martin Peters (p.c.) forbringing these forms to my attention.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013Relative chronology and an Aeolic phase of epic ,;frequency, of such sequences presents real difculties for an Aeolic phase,per se. Meister himself, in the face of these problems, asks, weshalb lieHomer nicht vcc, ut:cpc, cc, stehen, da er doch vtc, ut:tcpc, tc,sprach?:The duals present similar problems.The athematic dual forms ouvcv:n:nv (Od. :o.,,,), tpcocuon:nv(Il. ::.:,o, ::.,c), oun:nv (Il. :,.:c:), and qci:n:nv (Il. ::.:oo) are allformed from verbs in -c. This inection for contract verbs, the so-calledAeolic inection, was foreign to Ionic;:,thus, if these forms were a partof an Aeolic tradition which was taken over into Ionic, the Ionian bardshad no metrically equivalent forms to replace them. Even if we imaginethat Ionic had developed and retained the dual ending in -:nv from PGk. -:v, there would be no metrical equivalent form with a long nal stemvowel. The mechanical approach would yield the hybrid ou:nv.Mais les formes de duel en -:nv pr esentent pourtant ln ionien attique ` a la placede l du grec commun. Cest de m eme un n, non un qui est not e ` a la n duradical des duels de verbes en -cc comme tpcocuon:nv, ou dans les innitifscomme ,cnutvci de ,cc. Ces formes ath ematiques de verbes contractes sontcomposites et ont et e accommod ees au vocalisme de lionien.,cThis Ionicization stands in contrast to the process envisioned for a transferfrom Aeolic to Ionic. Against this tendency to Ionicize the phonology takenover from Aeolic sources stands the case of the -cc and -cv genitives,which are anomalous whether Ionian singers acquired these formationspunctually (under the stacked model) or through ongoing exchange anddiffusion. QM is metrically guaranteed by the time of the textualizations ofthe epics. The sound change is assured. Assuming an Aeolic epic transferredto Ionians after QM, we should expect a model vtqt,tpt:c to producean Ionicized vtqtn,tpt:nc, to judge from the situation of the duals:Meister (:,::: :o).:,The so-called Aeolic inection designates a characteristic athematic inection in Aeolic for contractverbs in other dialects; e.g. Ionic and elsewhere sctc, qitc, :iuc etc. Lesb./Thess. snui,qinui, :iuui, etc. Cf. Bl umel (:,:: :o;;;), Hock (:,;:: ,;ff., o,,ff.). Despite being a part ofMycenaean and Aeolic, the Aeolic inection plays a very tiny role in the language of the epics. TheIonic contract verb treatment pervades the language of the epos; Wyatt notes that such lines asn uc0vci qitcuo cycu, utpctcv vpctcv (Od. ,.,c)cv -vcv sctcuoi tci, cvopt, ot 2sucvopcv (Od. :c.;)have no metrical equivalents in Aeolic. Such examples can be multiplied. Proponents of an Aeolicphase must explain why the nominal system of epic shows a good deal of Aeolic inuence, but theverbal system very little.,cChantraine (:,,: ,co). The duals for contract verbs in -tc only rarely show -n:nv (ttin:nvfrom ttitc), showing instead -ti:nv (ocptti:nv, scuti:nv, etc.). The poets clearly employeda certain amount of modication and analogy to these forms which were not a part of colloquialspeech.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013, brandtly jonesabove. Instead, we nd the hybrid vtqtn,tpt:cc.,:Nothing preventedthe poets from Ionicizing the ending, though, of course, this was not thepractice. M endez Dosuna argues, rightly, that the process for these formsin fact worked in the opposite direction:The forms in -c, -cv, which appear systematically in place of -nc, -ncv, morein agreement with Ionic phonetics (cf. also c,, lcotiocv, etc.), should not beinterpreted as the residue of an Aeolic phase or, on the other hand, Proto-Ionic.Such Aeolism (or archaism) would be inorganic since -nc, -ncv would not havealtered the metrical value of -cc, -cv. Pace Ruijgh . . . it seems more likely thatthe process operated in the opposite direction . . . : the forms in -cc, -cv, takenfrom a distinct poetic tradition, supplanted those in -nc, -ncv because, at the timewhen the homeric text was being established, these endings were no longer usedin colloquial Ionic. It is as if the singers preferred the articial forms in -c and-cv, which would seem authentic because they had a correlate in other (literary)dialects, to authentic forms in -nc, -ncv, which would seem articial because theywere not in current use. (:,,,: ,,:cc n. ;)It is not clear when the Ionic forms in eta would have given way to formsin alpha. We have seen that the a-stem genitives do not provide us withthe full range of the stages of QM in Ionic, but the verb o:ticutv o:tc utv does. Why should o:ticutv show archaic Ionic phonology butthe genitives not? The singers showed a preference for living forms wherepossible, even those living in neighbouring dialect regions which practisedhexameter singing.,:7 an alternative explanation for the distribution of qmI suggest then that we have a special application of Parrys principlethat:the language of oral poetry changes as a whole neither faster nor slower than thespoken language, but in its parts it changes readily where no loss of formulas iscalled for, belatedly when there must be such a loss, so that the traditional dictionhas in it words and forms of everyday use side by side with others that belong toearlier stages of the language. (in A. M. Parry :,;:b: ,,,),:The form occurs ox in the Iliad, always in the phrase Aic, vtqtn,tpt:cc |. This is an obviousdeclension of the common nominative formula vtqtn,tpt:c Zt, | found in the same lineposition. The phonology of this nominative formula, i.e. in <c>, could even have inuenced orreinforced the practice of singing the genitive ending in -cc.,:The dialect mixture does strongly imply sharing among singing traditions, not simply borrowingfrom neighbouring colloquial forms. Phraseology would have been borrowed and adapted becauseof its metrical utility, and that utility was only apparent in versied speech rather than simpleconversation.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013Relative chronology and an Aeolic phase of epic ,,When we allow that the language of oral poetry was a reex of many localsingers using and adapting material shared among them, and that there wereclearly traditions in Aeolic and Ionic in contact, the preservation of obsolete o:ncutv, for which there was no living replacement, and the loss of -nc, -(c)+ V- outnumber secure cases of monosyllabic -tc in both the Iliad andOdyssey, but are unknown in Hesiod and nearly all the hymns. This replace-able prevocalic -tc also shows some involvement in formulaic language,e.g. lnnotc Ayic,, Actp:iotc Oouoc,, A:ptiotc A,cutu-vcvc,. Guaranteed examples of QM are somewhat more rare in the epics,and this scarcity has led to a supposition that the sound change itselfwas recent. The extra-Homeric evidence, however, does not support thissupposition.,,Hoekstra (:,o,: ,:). The famous Nikandre inscription of Naxos (CEG c,.:), found at Delos anddated to the seventh or sixth century, shows distinct signs for etymological / e/, spelled <t> (e.g.vt tstv), and the sound resulting from the raising of / a/, spelled <n> (e.g. Nisvopn); thedifferent spellings reect a time when the sounds had yet to merge in Central Ionic. The inscriptionis composed in hexameters and shows two guaranteed examples of QM each scanned with synizesisand spelled with the sign for <n>: Ativc|oisnc and nv (= nc v). These forms are not,despite the spelling, the missing -nc and -ncv of the continuous Ionic tradition, but ratherequivalents to the epic forms in -tc , -tc v. The masculine ccv is frequent at line end in theepics, which also show cv but never tc v. M endez Dosuna (:,,,: :cc) notes that metricalinscriptions systematically show synizesis, rather than disyllabic QM.,Hoekstra (:,o,: ,:). The forms are extremely limited: tutcv, uptcv, tc,, :tc,, and perhapsui,tcoi. M endez Dosuna (:,,,: s.v.), developing an idea of Schwyzer, seeks to demonstrate thatso-called QM in Greek was more likely a process of desyllabication of the rst element, creatinga diphthong and triggering compensatory lengthening of the second element. The notion, then,that these disyllabic forms would have been the primary output of QM followed by contraction orsynizesis seems wrong and not in accord with the practice of the epic or, indeed, the tragedians.The monosyllabic scansion seems the primary outcome of the sound change. That said, however,solutions for the distraction of the monosyllable to yield the ultimate disyllabic output are difcultto justify.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:17 WEST 2013. Books Online Cambridge University Press, 2013Relative chronology and an Aeolic phase of epic o:Table :. Distribution of a-stem genitive plurals in Hesiod-cv %-cv -tcv -tc v (syniz.) -cv -v Grand TotalTheogony : 61.5 c :c : ,,Works and Days o 54.5 c c : ::Catalogue :o 66.7 c c c :Table :., Order of changes in hedr ah on and hipp ew on hedr ah on hippew oni. loss of h (< s, yod) hedr a on hippew onii. fronting of a: to : hedr: on hippew oniii. QM/shortening-: hedre on hippew oniv. Contraction hedr on hippew onv. loss of intervocallic -w- hedr on hippe onvi. QM/shortening-: hedr on hippe onThe evidence from Attic and Ionic points strongly to an early date forQM over a hiatus left after the loss of s or yod. For example, in Attic wend the genitive plurals of the rst declension regularly contracted in -cv,but Attic shows the products of QM over a -w- hiatus still uncontracted.That is, nouns of the ttt, and coit, type never show contractionin the genitive plural, e.g.:over an s-hiatus: It seems particularly interesting in view of Georg Daneks new view on the Doloneia (this vol.: ::off.)that two of these rare cases are preserved precisely in this song. Of course, the cases preserved are likelyto be only part of the total originally contained in the text and to have been missed by grammariansor copyists who normalized the text where an Aeolic form was not metrically important. So if thepoet of the Doloneia was, as is Daneks impression now, more of a poeta doctus who imitated Homerthan an oral poet of the traditional type, he may have fancied exaggerating the Aeolic pronouns ofhis model and the two Doloneia examples may reect the original higher frequency of unnecessaryAeolisms.,See Wachter (:cc;) for the full argument on these questions.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013Linguistic innovations in the Homeric epics o;2But if we have a Homer who learned his art in Aeolis and has left us twobasically Ionic works, of which one is slightly more modern linguisticallythan the other, there is the question, what modern means in such asituation; or, to turn the argument round, how would we expect the epiclanguage of a singer with such a biography to change in the course of his life?And there is another important question. Since we do nd modernismsin great number in Homers text, what was the attitude of the poet and hisaudience towards these modernisms, and is our attitude the same? I thinkit is not, and this is what this study is about.A typical example which underlines this is the very exceptional mono-syllabic accusative vtc the ship instead of normal vc in Od. ,.:, | vtcutv uci sc:tct lcotiocv tvcoiycv. The form vtc is of course exactlythe Ionic form we know from Herodotus and others. Nevertheless scholarshave tried to get rid of it by all sorts of conjectures,obut without success.We will see later that its monosyllabic use was perfectly possible, if not nor-mal in the Ionic dialect at Homers time and I cannot believe that anybodyamong his audience would have been in the least shocked hearing it; in fact,they would not even notice it. We, however, as non-native speakers, judgethe Homeric language on strictly quantitative grounds and, as historians,nd him fascinating because of the traditional, often archaic features in hispoems, both of form and content. But as far as language is concerned, weare normally happy saying, when looking at variants, that form A is olderthan form B, or, that form A is Aeolic, form B Ionic, assuming that theAeolic variant belongs to an earlier layer of the tradition. We take for nor-mal what is most frequent. And if a form is rare but particularly developedwe tend to suspect it of being a later intrusion or adaptation. After doingthat we call the Homeric language an articial, mixed, literary dialect. Thissort of description creates, I think, a picture too diffuse for a good startingpoint for a better understanding of the Homeric language and its mixturein particular.So we may ask the following question: What kind of Greek did Homerspeak when he stopped singing epic verse? If we can establish a realisticpicture of Homers spoken language we may gain a better understandingof the other forms he uses and the reasons for which he uses them. Forexample, if we can plausibly argue that monosyllabic vtc was the normalform of the accusative of vn0, in the Ionic dialect already at Homers time,we will no longer be embarrassed by the single occurrence of this form inoEven Chantraine (:,,: ,o :o).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013o rudolf wachterthe Odyssey and will, at the same time, be in a better state to judge thenormal epic form vc.3The reasons for which the epic poet used non-everyday forms are wellknown:rthe linguistic restrictions imposed by the metre (below, )rthe existence of non-everyday forms in traditional formulae or otherkinds of prosodic structures he had learned (below, ,)rthe need or desire to gain exibility by means of metrically differentsynonyms (below, o)But it is by no means easy always to nd out what the everyday form was.Let us look at some examples.4As for the metre, its importance cannot be overrated. Chantraine (:,,::::) tells us clearly that in studying Homeric language we must never forgetthat the whole morphology is governed by the metre,;and subsequentlygives a series of instructive examples for the use of synonyms with mutuallyexclusive forms.(a) There is, for instance, ttucutc we learn in Homer because so we haveno right to say that it is the younger form. What is true is the factthat tuvvcuci is the normal form in post-Homeric Ionic and Attic,whereas ttcuci is almost exclusively epic and poetic, so we may betempted to claimthat tuvvcuci, given its rarity,,may be due to laterreworking of the text, whereas ttcuci represents the normal use at;Toute la morphologie est command ee par des pr eoccupations m etriques et nous aurons ` a chaqueinstant ` a faire appel ` a cette consid eration. nuc:csci:c,, had nutpn still been a rare word at his time. Surely thiswas not the case. Its only handicap was that it was against the metre;apart from the two nominatives only the dative singular was usable.These examples teach us three things. First, if one of two variants israre in Homer but is going to be the usual Greek form in post-Homerictimes, its rarity in Homer need not be due to its having been of recentformation or even unusual at the time of the poet. It could as well havebeen quite normal. Secondly, the frequent variant need not be frequentbecause of a strong poetic tradition which favoured and preserved archaicforms but simply because the usual form was ill-suited to the metre.:And,thirdly, whole lexemes or even morphological categories can be more orless banned from epic even if single forms of their paradigms would beusable and rarely are used.:,5(a) Our rst example to illustrate the preservation of a prosodic structureas the reason for using non-everyday forms is the digamma (i.e. thephoneme /w/). Clearly Homer did not pronounce a /w/ in the lineends t :i, ()oci:c | (Il. ,.,,) or lcotiocvc, ()cvcs:c, | (:c.o;),since this would have lengthened the short syllable. On the other hand,line ends like t tcu Nto:cpc, ucv t:i ccv:c ()oci:c | (:;.o:) orlcotiocvc ()cvcs:c | (:,.) and lcotiocvi ()cvcs:i | (:,.,;,:,) must be read with unaltered hiatus, i.e. a ghost digamma, because:,Of course not nu:tooi or nu:cv (nor any gen. pl. form of nutpn).:A form like ttcuci need not even be inherited, despite the Sanskrit parallel (and German bieten)and the existence of the active verb in Doric (Crete, see LSJ with Suppl.), but could be a recentanalogical formation some time back in the epic tradition.:,This corresponds to the widespread principle of linguistic economy.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013Linguistic innovations in the Homeric epics ;:originally there had been a /w/ at the beginning of the words iotv andcvc. There is some debate whether or not we should assume that inthese latter cases Homer actually spoke a /w/. I do not think this islikely. At least he could pronounce these lines without the digammajust as well as we can. On the other hand and this is the crucialpoint we can be certain that he knew this sound existed in otherdialects and that he even knew exactly where those fellow-Greeks pro-nounced it and where they did not. For he neglects it many times, butthere is, as far as we can see, not a single case in which he wronglyinserts such a digamma-based hiatus.:oOn the other hand, when usingdigamma words and forms, he allows for the hiatus not only in for-mulae, but also in ad hoc lines. In fact, in the course of his career heeven coined entire formulaic lines without digamma, like cscot : ttutvci sci vco:iucv nucp ()iotoci (Od. ,.:,,, ,.::c, .oo).:;This etymological accuracy of his prosodic use of original /w/, whichwe may call prosodic habit, can be used as an argument that Homerhad had personal contact with Aeolic singers who pronounced thesound, and that he evenknewtheir dialect. For through anintermediatestage of Ionic teachers this accuracy would very probably have sufferedmore damage; and on the other hand it is unlikely that in the Ionicdialect itself the generation before Homer still fully pronounced thesound and Homers generation lost it so rapidly that Homer couldneglect it as frequently as he did. Sound changes of this sort usually takeat least :cc years. So we may claimthat Homer is personally responsiblefor the modern, Ionic features in his poetic language, indeed for theentire mixture of his particular Homeric language.:(b) A very similar example of prosodic habit is the so-called diek-tasis (Chantraine :,,: ;,, ,:,). Verbs like n,cpccv:c |(Il. .:), tiocpccv:t, | (.), n,cpcot | (.:,c), tiocpcoci(:.,,) are of a historically implausible structure. Etymologically, weexpect n,cpcv:c, tiocpcv:t,, n,cptot, tiocptoci, andnally they were contracted to n,cpcv:c, tiocpcv:t,, n,cpot,tiocpoci. But, in fact, the Homeric forms are the contracted forms,save only that they were against the metre and were therefore adapted totheir original prosodic structure. This is proof, of course, that Homerin his spoken language pronounced the contracted forms. That con-traction had largely taken place in Ionic by Homers time is conrmed:oThe formula tc:vic Hpn, mentioned by Chantraine (:,,: :,,), does not prove anything; it is anold formula with /h-/.:;See Chantraine (:,,: ::). :See Wachter (:cc;).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013;: rudolf wachterby numerous cases of many different sorts. Here are a few examples(more will follow below): | :cpt coot qct:ci (Il. ::.o), and at the end of a line nut, | (.,),:,ttv | (:.:,). Even crasis iswell attested (Chantraine :,,: , ,,), e.g. in | uio:ucv : cpc:cc (:.o,), | :c0vtsc (,.c,), probably also | n p :i c ynut,tpcocuvcutv (:.:,).So, both the digamma and contraction show how prosodic habit was astrong factor conserving older linguistic features. But we must not thinkthat the more modern equivalents, digamma unobserved or contractionaccomplished (or even diektasis), would in any way have been problematicto use or unacceptable to Homers audience. Otherwise they would not beso frequent.6This brings us to the third reason for using non-everyday forms, viz. theneed or desire of the oral poet for linguistic exibility. In fact, already theexamples we have been looking at partly show this tendency.(a) First the digamma. In most of the above cases without formulae itwould not have been necessary to account for the hiatus left by the lost/w/ sound, since the forms would have been perfectly usable withoutit. But, of course, a form like oci:c was much more useful if itcould be treated both as beginning with a vowel and beginning with aconsonant. This was as good as a pair of synonyms of equal length butdifferent beginning (consonant vs. vowel) according to Edzard Vissersprinciple for his variables (e.g. sc:ts:cvt vs. tvnpc:c) (:,;: passim,e.g. ,,::) or Milman Parrys principle for (epithets in) formulae (e.g.Il. :.c cnv ,cc, Mtvtcc, | vs. ,.:: pniqic, Mtvtcc, |).(b) Next, contraction could be used to enhance exibility, e.g. | sci ypuocv:iuv:c (Il. :.;,), but | n ypuocv qicu vopc, totc:c :iuntv:c |(Od. ::.,:;; here, for once, it is the Odyssey that shows the olderform!), or | :toocpt, cqcpci ttci co:coiv cytoqiv (Il. ::.o,,),but | otuutvc, c, ttc, tcqcpc, ouv cytoqiv (::.::). Forthe purpose of the present question we have to stress that in mostvowel combinations known to have been contracted e.g. in Attic, thechange must have been accomplished in the Ionic dialect already byHomers time. This, too, is overlooked or at least underestimated inmost Homeric grammars.:cIt is just that Homer, for several reasons,:,Therefore we have no right to restore nutt, e.g. in Aii o nut, cocutv ccv | (,.:c).:cIncluding my own, Wachter (:ccc).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013Linguistic innovations in the Homeric epics ;,chose to use the uncontracted variant more often, partly because thecontracted one would not t the metre, partly for lack of prosodichabit because contracted forms had not yet been provided for andpractised in the traditional oral technique. But if a contracted formtted his purpose, why should he not have used it? And he did use itand will have been glad to have it.(c) A very similar phenomenon is synizesis. Here, too, the phonologicalchange can be clearly checked, since it has led to the loss of a syllable.It is mostly the combination of a short [e] + a short [a] or [o] thatis reduced in this way. We have clear examples that can only be readmonosyllabically, e.g., with [e + a], tooc:c :tytc | (Il. ;.:c;), orAtcvopcv tctiotc | (,.:;; a frequent formula, though normally inthe nom.: tction, |), both at line end, | nutc, :cu, ccu, (.:::), |:iuno,, cto, ot tctc, tti vnuoiv Aycicv (:.,,,; if not tc u, aspreferred by West::); or, with [e +o], | sttto t totp,tc, oiqpcu(Il. :o.;,), tt:tcv:t, occv tvci | (;.,:c), | ouv utv tci octv(:.:). In the case of [o], the manuscripts often give <tu> insteadof <tc>, e.g. | t Lpttu, (Il. .,o), | :cicu uiv potu, (:;.,;,),ycvc tcooi oc:t0v:c | (:,.:::); we do not know exactly how oldthis spelling is, but the rst examples are found in inscriptions of theearly sixth century bc, so it may be a very old reading aid precisely forthese monosyllabic cases.::Here, too, we nd the disyllabic versions, of course, and for thesame reasons as before, namely out of prosodic habit, e.g., with [a],in tttc t:tpctv:c tpconoc | (Il. :.:c:; a formula, also containinga case of contracted, i.e. monosyllabic, - |, from -ct), | oitcscucpucptnv, tctc, o tvttcootv tcu, (,.::o), or, with [o], |yvutvc,, utvtc, ot . . . (Il. :.:c,), | v0v o tutc tpc:tpc, (:c.::);or because the monosyllabic version would not t the metre, as in |cvopc, ououtvtc, (:c.c) or utvtcivcutv qpcvtcv:t, | (:,.:c).Again we can see clearly how both versions served the poet perfectly.So why should he not have used them both? And again he did, nobody::It is true that this form is (weakly) attested in :.,,, and :. (not in :,.;, and :,.oo, :c.,:,, ::.,,,:,:, Od. ,.,o:, .:;c). But we may be sceptical of its being an original Homeric form rather thana later import into some of the Homeric traditions, even e.g. by a grammarian who looked for ameans to distinguish the cases with monosyllabic ending (synizesis) from the ones with disyllabicending. For it seems difcult to see where at Homers time this third form besides tcc,, thenormal Ionic form ( Il., :: Od.), and tctc, without synizesis, i.e. most probably the Aeolicform (trisyllabic tctc, Alcaeus :,.:: LP = :,.:: LGS; this is yet another unnecessary Aeolismin Homer, by the way, occurring Il. ,.::o, .:,c, :,, ,c, ,,, ,.c, :o.:;, :.:c, ;,, ,:c, Od.:.:;) should have come from.::First attested on a Corinthian vase with a scene from the Iliad (:o.,,cff.), in which Kleoboulos,clearly written [K].t. .c.uc,, is being killed by Ajax; see Wachter (:cc:: ,c: COR :).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013; rudolf wachterminded, and we can conclude that synizesis was the normal way topronounce these forms in everyday Ionic at his time.(d) Along vowel preceding a vowel in word-interior position was shortenedin Ionic. The principle is often called vocalis ante vocalem corripitur orprevocalic vowel shortening. A frequent combination affected by thischange was a long [ e] before an [o] or [a], e.g. in the genitive pluralof a-stems, which had been - as om originally (see Latin - arum), thenbecame - ah on in Early Greek, -e on in Early Ionic, whence -tcv inHomer and later Ionic and -cv in Attic. The Homeric form of theIonic genitive plural is mostly monosyllabic, that is, pronounced withsynizesis, e.g. Ot:i, o co nt: tqt:utcv | (Il. :.,,), rarely evencontracted, e.g. | tv:ctv ts sioicv (:,.:::). The disyllabic versionis very rare, but not unattested, e.g. | c, titcv tutcv ttoou:c (;.:).Something similar happened to the genitive singular of the masculinea-stems, which had - ao in Mycenaean and in IonicAttic eventuallybecame -tcby a similar shortening, and at the same time a lengtheningof the second component. Therefore the phenomenon is here knownas metathesis quantitatum or quantitative metathesis. See, e.g. theformula Kpcvcu t, ,sucun:tc | (Il. :.:c,),:,to be read with amonosyllabic ending, that is with synizesis.Now, the Ionic vowel shortenings in these endings were so frequent anddestroyed so many formulae that a poet had to nd some way out. Againhe decided to retain the Aeolic prosodic variants as a means of exibility,only that in this case he used them almost exclusively. This is why we alsohave gen. pl. - tpicvhc, o cv : oot ti toi : tc: tpi[c] : co:isc s tvcvh iutpc, hcip i: t,.Nestor had a cup from which it was good to drink. But whoever will drink fromthis cup here will be seized with the longing of Aphrodite of the beautiful wreath.:oTmesis, studied by Dag Haug (this vol.) is probably already too conscious, too stylistic a featureand should be treated differently.:;In the case of Hesiod, on the other hand, this may have been different, although we do not knowenough about his life and his place(s) of residence and work. Some of Richard Jankos gures (thisvol.: :,) seem to indicate that this poet may have tended towards a dialect with less contraction(more tu- than to- and more ,cc than , in Op. than in Theog.) a feature notably of Boeotian.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013Linguistic innovations in the Homeric epics ;;This inscription, which is in the Euboean alphabet, teaches us several thingson the notation of epic texts at Homers time; rst, that punctuation wasused (mainly in the caesurae), secondly, that poetic text was written instichic order line after line, and thirdly, that one knew how to write longconsonants with geminate letters. All three features are, of course, valuablereading aids and testify to what we should call a remarkable didactic con-cern. I cannot see how this inscription can be denied to reect written epictexts. And as far as our modernisms are concerned, it presents an excellentexample for the principle in dubio pro textu, in that it contains a modernform, as we have it in our Homeric text, not the earlier, reconstructedone, as is sometimes claimed for the original text, namely scio:tq-vcu Aqpcoi:n,, not scio:tqvci Aqpcoi:n, (i.e. elided -cic:). So weshould not try to claim Il. :.: lnno Ayic, either (Chantraine :,,::cc ). Surely Homer used the Ionic genitive form in all these cases.This leads us to the second testimony to be mentioned here, the highlyarchaic Nikandre kore from around o,, bc, which was found on Delos buthas to be attributed to the Ionic dialect and alphabet of Naxos:Nisvopn u vt tstv h(t)sncci icytcipni,? qctovc,, but Attic qvc,), may originally have been written t0p : tovnoci oi :t c octvc stooci (with [a e] pronounced monosyllabi-cally). Secondly, the gen. pl. fem. scipcotcv in | scipcotcv o ccvtcvtctit:ci o,pcv tcicv (Od. ;.:c;), conrmed by Aristarchus, whichin its expected epic form scipc()toocv or scipc()tootcv would nott the metre and is now normally spelled and counted scipcuootcv, mayoriginally have been written in the normal way scipctootcv (or indeedscipctooncv) but pronounced with two synizeses.We will perhaps never know, but the crucial point about these contrac-tions is again that already in Homers prosody they were pronounced inthe modern, monosyllabic Ionic way, as were many of the other cases inthe Iliad, and even more in the Odyssey, that we have discussed here.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:32 WEST 2013. Books Online Cambridge University Press, 2013chapter 4Late features in the speeches of the IliadMargalit FinkelbergIn the Preface to the second edition of his Studies in the Language of Homer,G. P. Shipp wrote:That speeches tend to be later in language and to have more other abnormalitiesthan the narrative has been noted by readers of the rst edition and has nowbeen stressed in the analysis of several books. The project would no doubt repay asystematic treatment. (:,;:: vii)In the subsequent discussion Shipp fromtime to time highlights the specialstatus of the speeches vis-` a-vis the narrative. Although far from the system-atic treatment of the language of the speeches that he recommends, this isstill the fullest treatment available. To adduce some examples, he notes thatwhile [t]he freedom from exceptional features in the narrative is typical ofsingle combats that openIliad o, [t]he linguistic character changes with thespeech of Helenus to Hector at o.off. (:,); that Nestors speeches alwaysmake us expect neologisms (:,,); that [a]n important general observationin regard to the duel [of Hector and Ajax in Iliad ;] is the difference linguis-tically between the narrative itself, which has few features to be noticed,and the speeches, which are often marked by many abnormalities (:oc);that [u]nusual features thus cluster especially in these extra-narrative por-tions (:o); that the great speech of Achilles in Iliad , is for the most partcharacterized by features that reect contemporary Ionic (:o,); that thelinguistic contrast [of the speech of Menelaus in Iliad :,.o:cff.] with thenarrative itself is very marked (::); that [t]he tendency for late featuresto occur in speeches rather than in the narrative is especially impressive inIliad :: (,::), and so on.Unfortunately, as distinct from Shipps thorough treatment of the lan-guage of the similes, his ad hoc remarks relating to the speeches have exertedlittle inuence on the subsequent study of the language of Homer. This isnot to say that these remarks came as a surprise. Students of Homer havelong been aware of the fact that the language of Homeric speeches differscDownloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad :from that of the narrative in many and various ways.:O. J orgensen in :,cand M. P. Nilsson in :,: pointed out that Homers characters speak ofthe gods differently from the poet himself. P. Krarup in :, and HermannFr ankel in :,,: called attention to the fact that abstract nouns and person-ications are much more frequent in the speeches than in the narrative.In an important article published in :,,o, T. B. L. Webster showed thatclusters of late features, including linguistically late formulae, are especiallycharacteristic of the speeches.:Numerous neologisms, anachronisms, andother peculiarities of language and vocabulary have been registered for thespeeches in many a commentary on the Homeric poems. Yet, to the best ofmy knowledge, the rst to treat the distinction between Homeric speechesand Homeric narrative in a thorough and systematic way was Jasper Grifn.In a ground-breaking article published in :,o, Grifn stated unequivo-cally that in important senses the Homeric epics have two vocabularies,one for the narrative and the other for the speeches (:,o: c). As we shallsee, the conclusions that he drew from this observation were quite differentfrom those made by Shipp and others.In fact, two main approaches to the speeches have crystallized over time.Older scholars tended to account for the speeches linguistic and otherpeculiarities by applying to them the interpretative methods of Analysis.The culmination of this approach was reached in Shipps Studies, rstpublished in :,,,. According to this approach, the fact that innovations inlanguage and vocabulary tend to concentrate in the speeches indicates thattheir composition is later than that of the main narrative; consequently,the passages in which these innovations are especially numerous should betreated as interpolations. However, although it cannot be denied that moreoften than not interpolations are indeed concentrated in the speeches, andespecially in their concluding parts (Shipp :,;:: :,,), this does not meanthat all the speeches lend themselves to this kind of treatment. The reasonis simple: in so far as the speeches constitute about ,c per cent of Homerstext, this would mean that, if consistently applied, the Analyst approachwould culminate in the conclusion that about half of Homer should beregarded as interpolated.As distinct from this, the neo-Unitarian approach that became pop-ular in the second half of the twentieth century tended to regardthe speeches idiosyncrasies as due to self-conscious stylistic strategiesdeliberately employed by the poet. Although occasionally applied by other:The special status of Homeric speeches was already well recognized in antiquity, see N unlist (:cc,).:J orgensen (:,c: ,,;:), Nilsson (:,:: ,o,,,c), Krarup (:,: ::;), Fr ankel (:,o:: o), Webster(:,,o: , o).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013: margalit finkelbergscholars as well,,the rst systematic treatment of the speeches from thispoint of view was incontestably Grifns Homeric words and speakers,mentioned above. Grifns starting point that the speeches in Homer haveimportant distinctions of vocabulary, and of style, from the rest (:,o:,c), is identical to that of Shipp and other Analysts; but the conclusionswhich he reaches are diametrically opposite. According to Grifn, ratherthan being indicative of interpolation, the distinction between speech andnarrative, including the distinction in language, is entirely a matter of style:It therefore seems appropriate to expect that the later stages of the tradition willnot simply have been introducing more contemporary linguistic modes into thespeeches without reection, but on the contrary allowing them into the speeches,and excluding them from such narrative as they composed themselves, in accor-dance with a feeling that they were more appropriate there. (:,o: ,)While I agree withGrifnthat the argument of style may effectively accountfor such features of Homeric language as the avoidance of specifying thenames of gods involved in a given action or the use of terms of moralevaluation that are absent from the narrative, it is doubtful that the stylis-tic interpretation he proposed would account equally well for the purelylinguistic characteristics of the speeches. It is indeed difcult to envisagea traditional poet deliberately employing, say, quantitative metathesis asa means of stylization. This would become even more evident if we takeinto account another important aspect of Homeric language, its formulaicidiom.The role of the formulae as indicators of chronologically different strataof Homeric language was aptly summarized by Bryan Hainsworth:A linguistic development of the vernacular quickly penetrated the uid and non-formular part of the Kunstsprache (where it differed least), or took effect atthe junctions between formulae: next the development would appear in mod-ied formulae, formulae by analogy, and other derivatives of primary for-mulae: last of all would the development be found attested among regularformulae. (:,b: :;)That deviations from the formulaic language can be used with prot forthe identication of later strata of epic diction has been emphasized byother scholars as well, notably Arie Hoekstra (:,o,) and Richard Janko,See e.g. Dodds (:,,:: ::), on the difference between the poet and the characters in the identicationof divine interventions: For it is the poets characters who talk like this, not the poet: his ownconvention is quite other he operates . . . with clear-cut anthropomorphic gods such as Athenaand Poseidon, not with anonymous daemons. If he has made his characters employ a differentconvention, he has presumably done so because that is how people did in fact talk: he is beingrealistic.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad ,(:,:: :,). On the whole, however, surprisingly little attention has beenpaid to the fact that the special status of the speeches vis-` a-vis the narrativebecomes particularly manifest when Homers formulaic language is takeninto account. As far as I can see, one of the reasons why this phenomenonhas not drawnas muchattentionas it deserves is that, inspite of the evidencethat has accumulated since Milman Parrys theory of oral composition rstbecame known, many adherents of oral formulaic theory still proceed fromthe assumption that :cc per cent of Homer consists of traditional formulae.Accordingly, Homers language is still regarded by many as essentially amonolithic phenomenon. It is symptomatic in this respect that one ofGrifns purposes in Homeric words and speakers was to suggest that thelanguage of Homer is a less uniform thing than some oralists tended tosuggest. This is not to say that the belief in the :cc-per cent formularity ofHomer is shared by all oralists. Thus, by counterposing charts of formulaicdensity in a routine battle scene on the one hand and in the Lamentof Helen over the body of Hector on the other, Hainsworth effectivelydemonstrated in :,o that the formulaic density in the latter is sharplyreduced in comparison with the battle scenes (:,o: :::). In :,;o, JosephRusso studied two Homeric passages, the exchange between Odysseus andEumaeus in the Argos episode in Odyssey :; (,c,:;) and Hectors rebuke ofPolydamas in Iliad : (:,,c,), and came to the conclusion that their totalformulaic content falls far below the ,c% we have been led to expect.,That it is rst and foremost in direct speech that Homers non-formulaicexpressions are concentrated was further argued by this author in an articlepublished in :,,. To quote its conclusions, Thus, the so-called isolatedexpressions differ from the formulaic expressions in several respects: theycannot be shown to have been modelled on formulaic patterns; and theytend to occur in direct speech (rather than the main narrative) (Finkelberg:,,: :,). On the whole, however, it cannot be denied that the study ofthe formulaic aspect of Homers speeches is still a largely neglected eld.As Janko demonstrated in Homer, Hesiod and the Hymns, the evidenceof language is only signicant when it comes in clusters: [w]hen we nd acluster of results, this implies that the poet concerned is using the traditionaldiction naturally, at more or less the stage at which he found it (:,:::, :,c:). In other words, only when we nd peculiar features pertainingto the language, vocabulary and, last but not least, the formulae of Homer Cf. Chantraine (:,,: ;c): Cet exemple enseigne que la langue epique a admis de formules de typenettement ionien. On the formulaic lateness of the expression see also Hoekstra (:,o,: ,o n. :).,Troy and/or Ilios is usually characterized, in a rather banal way, as tos:iutvc, (,) or to vcicutvc,() and, more specically, as t0tcc, (,), topu,uic (,), and to:tiytc, (:).:cIt seems signicant in this connection that after Homer the theme of Troys wealth becomesincreasingly popular. See e.g. Aesch. Ag. ;,,;:, Eur. Tro. ,,,,,. Cf. below, n. :.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad ;the expansion technique (:,o: :;). Janko seems to be the only one tohold that [m]ost critics misjudge this speech and that [i]n fact it weavesseveral motifs in an integrated whole (:,,:: ::,).Shipp wrote about the passage under discussion: o::, have a strongmoralizing avour, and the linguistic contrast with the narrative itself isvery marked.::And indeed, the opening lines of Menelaus speech containno less than four late linguistic features: contraction in ttiotut, at o::,monosyllabic quantitative metathesis in tpiptut:tc at o:, plus twoadditional recent Ionisms vtc, at o:c and Znvc, at o:. Since thesefeatures have often been commented upon, most notably by Shipp andJanko,::in what follows I will concentrate mainly on the formulaic dictionof the passage.Il. :,.o:c:, contains four uncommon or linguistically late formulae::. vtc, Acvccv :cyutccv at o:c. Acvccv :cyutccv as such isof course a standard Homeric formula, which occurs ten times in theIliad. However, its combination with vtc,, resulting in the emergenceof a new expression for ships in the second half of the verse, is unique.Comparison with two equivalent expressions emerging in the Odyssey,vtc, sucvctpptipcu, at ,.:,, and vtc, qcivisctcpcu, at ::.::and :,.:;:, both in direct speech,:,shows that we have here a seriesof attempts at making use of the recent Ionism vtc, in order to createa formula for ships tting into the second half of the verse.:As weshall see immediately, the fact that none of these expressions became astandard Homeric formula is of considerable chronological importance.But rst let us discuss another linguistically late formula occurring inthis passage.:. Znvc, tpiptut:tc at o:. I can hardly improve on Jankos character-ization of this expression: Znvc, tpiptut:tc is trebly novel: -tc andZ. are recent Ionisms, and the phrase is a unique variation on Ztu, oi-ptut:n, (oHom.), duplicating Znvc, tpi,octcu (:,.:,,). Jankoscomment on the latter is also relevant: As we can expect of a recentcreation, two equally new equivalent phrases appear elsewhere, Z. tpi-ptut:tc (:,.o:) and Z. tpiotvtc, (Erga :o).:,::Shipp (:,;:: ::). Cf. Webster (:,,o: ).::vtc, Janko (:,,:: ::); ttiotut, (also Il. ,.::,) Shipp (:,;:: :,, ::), Janko (:,,:: ::, :,,); Znvc,tpiptut:tc below, n. :,.:,The expression vtc, qcivisctcpcu, belongs to a passage (Teiresias prophecy) which is repeatedverbatim in Odyssey :: and Odyssey :,. Cf. Alexanderson (:,;c: :o).:Cf. Janko (:,,:: :oc, this vol.), Chantraine (:,,: ;:, ::,o). On Homeric formulae for ships seealso M. Parry (in A. M. Parry :,;:b: :c,:,), Hoekstra (:,o,: ::,c), Alexanderson (:,;c).:,Janko (:,,:: ::, :oc). On Z. tpiptut:tcsee also M. Parry (in A. M. Parry :,;:b: :), Chantraine(:,,: ;c), Hoekstra (:,o,: ,,), Shipp (:,;:: ::).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013 margalit finkelbergIn his discussion of the presence of quantitative metathesis in Homericformulae Hoekstra wrote:It appears, then, that the evidence for the existence of formulae originally builtupon quantitative methathesis is extremely slight. This strongly suggests after themetathesis had begun to develop in East Ionic, oral composition came to an endso soon that hardly any substantial expression created out of the new materialprovided by the evolution of the spoken dialect had time to attain a formulaicxity. (:,o,: ,)This would of course be true also of the other late features under dis-cussion, Znvc, and vtc,. As we have seen, the fact that linguistically lateequivalents of the expressions vtc, Acvccv :cyutccv and Znvc, tpi-ptut:tcare attested elsewhere in the epic corpus strongly suggests that, asdistinct fromKpcvcu t, ,sucun:tcdiscussed above, the expressionsin question had no time to attain a formulaic xity. Hoekstras assertionthat after the metathesis had begun to develop in East Ionic, oral com-position came to an end will be discussed in the concluding part of thisessay. At this stage, it is sufcient to emphasize that by all standards bothvtc, Acvccv :cyutccv and Znvc, tpiptut:tc of Menelaus speechshould be associated with the latest layer of epic diction.,. tciv citnv rather than cittcv at o:, is obviously a metrically con-venient substitute for citv. This is the only occurrence in the Iliadof this distinctly Odyssean formula (). To quote Chantraines assess-ment, [i]t is remarkable that this form is found in the parts that do notseem very ancient.:o. Finally, the expression Tpct, ottpqicci at o::. As distinct from theformulae discussed above, linguistic commentaries on Menelaus speechusually pay no attention to this expression. The reason is obvious: on theface of it, Tpct, ottpqicci is an inconspicuous expression, not charac-terized by late features or other linguistic peculiarities. Yet it is not onlyunique in this specic position (three modications occur elsewhere,see below) but it is also metrically equivalent to Tpct, ottpuuci, thewell-established Iliadic formula for the Trojans (six times in the sameposition in the verse, of which three are in narrative and three in directspeech, plus one direct-speech formulaic modication). And while itis true that ottpqicci, arrogant, and ottpuuci, great-spirited,though close in meaning, cannot be considered exact synonyms, thisdoes not alter the fact that what gures here is the introduction of an adhoc variation on the standard formula Tpct, ottpuuci. Signicantly,:oChantraine (:,,: :,,, my translation). Cf. Shipp (:,;:: ::), Janko (:,,:: ::).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad ,this variation offers an unambiguously negative evaluation of the Tro-jans, which is absent from the formula Tpct, ottpuuci.:;This is thereason why Milman Parry, who studied ottpqicci as an epithet ofthe Trojans in his L Epith`ete traditionnelle, subsumed it under the cate-gory of the so-called particularized epithets, emerging when the poetwanted to include an adjective for its sense rather than for its [metrical]convenience.:The case under discussion seems to t Grifns stylistic approach quitewell. Tpct, ottpqicci in the mouth of Menelaus clearly lends itself tobeing interpreted in terms of characterization or, as many would say today,focalization of the Trojans from the standpoint of Helens offendedhusband.:,It is signicant in this connection that the modications ofTpct, ottpqicci, all of them in Iliad ::, belong to direct speech andare put in the mouths of such bitter enemies of Troy as Hera, Athenaand Achilles after the death of Patroclus,:cand that the same would betrue of the other unambiguously negative characterizations of the Trojansencountered in the Iliad.::That the situation in the Odyssey is different canbe seen from comparison of the distribution of the adjective ottpqicciin both epics.While in the Iliad ottpqicci occurs only in direct speech, in theOdyssey it is distributed almost evenly between narrative and speeches. Thisobviously reects the well-known difference in the ethos of the two poems.Namely, although the Iliad characters often criticize themselves and eachother, its poet consistently avoids judging their behaviour by the standardsof good and bad.::This withdrawal of moral judgement, which resultsin the famous impartiality of the Iliad (in the apt formulation of Simone:;Cf. Hall (:,,: :,): Great-spirited (huperthumos), on the other hand, is relatively frequent(seven occurrences) but is not conned to the Trojan side, and always seems to be approximatelysynonymous with megathumos . . . A critic who believes that the Trojans epithets portray them assignicantly more arrogant than the Achaeans therefore betrays his or her own pro-Achaean bias,not the poems. Among those to whom the epithet ottpuuc, is applied in the Iliad are Diomedes(twice), Heracles, Achilles (twice) and Nestor.:M. Parry (in A. M. Parry :,;:b: :,,); see ibid. (:,,): But ottpqicc,, which has the same metricalvalue, clearly shows the particularized meaning given by the translation arrogant. Cf. Sale (:,,:,;).:,On focalization in Homer see de Jong (:,, :cc), N unlist (:cc:).:cIl. ::.:: (Achilles), : (Athena), ,, (Hera). Cf. M. Parry (in A. M. Parry :,;:b: :,,).::Sale (:,,: ,, ,;;,). Note, however, that in his speech in Iliad , Menelaus only says that itis the sons of Priam rather than the Trojans as such who are ottpqicci sci ctio:ci (,.:co), acharacterization which would obviously square much better with the general tenor of the poem.::Cf. Grifn (:,o: ,,): No feature of Homeric style is more important than this. The narrator depictsevents in a way which leaves the understanding of their moral signicance to the audience anaudience whose presence is never acknowledged.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013,c margalit finkelbergWeil, [i]t is difcult to detect that the poet is Greek and not Trojan(in Holoka :cc,: oo)), is entirely alien to the Odyssey. The wrongdoersof the Odyssey Aegisthus, Penelopes suitors, Odysseus companions are explicitly identied as such by both the poet and the characters: theOdyssean formula uvno:poiv ottpqicioi, appearing after the second-foot caesura no less than nine times, ve of them in the narrative, readilycomes to mind in this connection.:,In view of this, it seems reasonableto suppose that, rather than purely a matter of style, Menelaus Tpct,ottpqicci reects the erosion of the impartial attitude to the Trojanscharacteristic of the earlier tradition.:The term opio:ci, applied to theTrojans later in Menelaus speech (o,,), obviously expresses the sametendency.Be that as it may, it cannot be denied that the context in which theexpression Tpct, ottpqicci emerges is both linguistically and formu-laically late. With this in mind, let us turn to the title of Zeus as Xenios,attested here for the rst time. It is signicant in this connection thatboth Pierre Chantraine and Hugh Lloyd-Jones based their interpretationsof justice in the Iliad on this specic passage.:,Both interpretations werepolemically directed against Doddss assertion in The Greeks and the Irra-tional (:,,:) to the effect that he nds no indication in the narrative ofthe Iliad that Zeus is concerned with justice as such.:oEither assessmentis based on solid evidence: on the one hand, Chantraine and Lloyd-Jonesare correct in that Menelaus does appeal to the authority of Zeus Xenios;on the other, Dodds is also correct in claiming that the narrative of theIliad never credits Zeus with this title.:;What seems especially important,however, is that, like Tpct, ottpqicci discussed above, Zeuss title asXenios emerges in a context that abounds in late linguistic and formulaicfeatures.:,On the generic meaning of this formula see Sale (:,,: ,;).:According to Sale (:,,: ,;;,), the negative epithets for the Trojans reect the inherited Achaeanattitude: this attitude was changed by Homer who, being sympathetic to the Trojans, only allowedthe negative epithets in the mouths of the characters. Yet, the distribution of the formulae Tpct,ottpuuci and Tpct, ottpqicci as described above suggests a different chronological picture.See also Hall (:,,: ::c), on the increasing barbarization of the Trojans in post-Homeric poetry.:,Chantraine (:,,:: ;,), Lloyd-Jones (:,,: ;). Cf. Janko (:,,:: :::,).:oDodds (:,,:: ,:); cf. Chantraine (:,,:: ;,o), Lloyd-Jones (:,,: :). Another Iliadic passage inwhich Zeuss responsibility for xenoi is implied (Janko :,,:: ::) is also part of a speech, seeIl. ,.,,:ff.:;Cf. Rutherford (:,,:: ;, n. :c;): The idea that the gods constantly watch for and punish mortalwrongdoers is undoubtedly current it gures in speeches in the Iliad, as well as in the Odyssey andin Hesiod but the main narrative of the Iliad presents the gods as capricious and little concernedwith justice.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad ,:il. 6.1307coot ,cp coot Apcv:c, uc, spc:tpc, Ausccp,c,onv nv, c, pc tcoiv ttcupcvicioiv tpitvc, tc:t ucivcutvcic Aicvocic :invc,ot0t sc: n,tcv Nuoncv c o cuc tocioc ycuci sc:tytucv ot vopcqcvcic Auscp,cutivcutvci cut,i Aicvuoc, ot qcnti,oot cc, sc:c s0uc, Ot:i, o ottotc:c sctotioic:c spc:tpc, ,cp tyt :pcuc, vopc, cucs.This is one of the few occasions on which Dionysus makes his appearancein the Homeric poems. To quote G. S. Kirks comment on the passageunder discussion, [R]eferences to Dionusos are rare in Homer in Il. onlyotherwise at :.,:, (incidentally to his mother Semele whom Zeus hadloved), and in Od. in relation to Ariadne and Thetis at ::.,:, and :.; and only in contexts which are allusive and incidental. His membership ofthe Olympian pantheon is marginal at this stage (:,,c: :;,). In addition,the passage contains two hapax legomena, oc at :, and cut,iat :,,, as well as a rare use of otc and contraction Auscp,cu at :,.:Finally, the layer of formulaic expressions in it is remarkably thin.Il. o.:,c; contains ve expressions that are based on formulaic associ-ations::. tcoiv ttcupcvicioiv at :,:. Although the expression is found twicein Homer, both occurrences belong to the same passage (Il. o.::, and:,:), which makes it unlikely that this is a well-established formula. Atthe same time, the related expressions t. tc,, also in Iliad o (,:;), and:i, ttcupvic, tc, to:i (Od. :;.) allow us to suggest that tcoivttcupcvicioiv is either an underrepresented formula or one in statunascendi.:. ycuci sc:tytucv at :,: a unique expression, probably created by asso-ciation with yv:c ycuci ycot, (:x Il.).,. vopcqcvcic Auscp,cu at :,. This is the only time in the epicsthat the word order attested in the widespread formula Ls:cpc,vopcqcvcic (::x Il.; cf. also Aptc, . Il. .:) is reversed. Emen-dations have been proposed to avoid contraction in Auscp,cu.:,. oot cc, sc:c s0uc at :,o. The expression can be compared withotc s0uc coon, co:is touocv at Il. :.:, (of the Nereids). Cf.also otc (or t,) tcv:cv toot:c (,x Od.).:On the two latter see Shipp (:,;:: :,,); cf. ibid. (:).:,West (:,,:ccc: I. ad loc.): -qcvcu Ausctp,cu Heyne (-ccp,cu Brandreth); Shipp (:,;:: :,,):vopcqcvcu Ausccp,cu with Nauck? and ibid. (: n. ).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013,: margalit finkelberg,. Ot:i, o ottotc:c sct at :,o. The hemistich is repeated in fullin Il. :.,,, Thetis receiving Hephaestus thrown down from Olympusby Hera. Since the Hephaestus story is obviously more popular withHomer (cf. Il. :.,,:,,), it can be suggested that what is being dealtwith is an ad hoc adaptation of this epic theme.It is true of course that tyt :pcuc, at :,;, which occurs two additionaltimes in the Iliad, can with right be considered a formula and that thenoun-epithet combination spc:tpc, Ausccp,c, at :,c is built on a well-established formulaic pattern (cf. s. Aicunon, :,x Il.). On the whole,however, it cannot be denied that, as far as Homers formulaic diction isconcerned, Il. o.:,c; is almost devoid of formulae. When taken againstthis background, the efforts to eliminate contraction in Auscp,cu at :,should be recognized as misguided:,cthe linguistic, the formulaic and thethematic evidence concur to create a consistent picture of the lateness ofthis passage.To be sure, in so far as ones methodological position demands treatingany passage containing linguistic and other deviations as issuing frominterpolation, there is good reason to discard the passages discussed in thissection as late additions. It seems, however, that although the concentrationof late and deviating features in Il. :.:,o, :,.o:c, and o.:,c; isperhaps somewhat above the average, they highlight what we nd in otherHomeric speeches as well. It follows, then, that to the degree that thepassages discussed are representative of Homeric speeches as a whole, theconsistent application of the approach in question would, as observedabove, lead to assessing some ,c per cent of the text of Homer as resultingfrom interpolation. Needless to say, this can hardly be regarded as a realisticsolution. On the other hand, as I hope to have shown, the linguistic andformulaic lateness of the speeches cannot be ignored or explained away asa purely stylistic phenomenon. Accordingly, my next task is to suggest analternative way in which the status of the speeches may be approached.It is generally recognized today that before they were xed in writing,Greek epics about the Trojan War had circulated for centuries in oraltradition. It is also generally recognized that this tradition was permanentlyin a state of ux. Not only is the language of Homer a Kunstspracheconsisting of different historical layers of Greek language, but it has alsobeen shown, above all in the studies of Hoekstra and Hainsworth, that,cAs well as other, similar attempts; cf. Rudolf Wachters caveat in his contribution to this volume(pp. ;:f.).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad ,,Homers formulaic idiom too is characterized by a high degree of exibilityand adaptation, and therefore should also be approached diachronically.The same mixture of different historical periods can also be found inHomers depictions of material culture, social institutions, moral valuesand religious beliefs.Like Ausccp,c, and Auscp,cu within one and the same passage, theold and the new exist side by side in Homer, for the simple reason thateach successive generation of poets retold anew what had been bequeathedto them by their tradition. Since the traditional subjects dealing with theHeroic Age were not only universally known but also accepted as historicaltruth, the poets were not allowed to mould them in a free and independentmanner: the Trojan War will end with Trojan rather than Achaean defeat,Hector will be killed by Achilles and not vice versa, and so on. This is whydissonances between the plot of the poems and what is expressed in thespeeches are so important: while the plot is xed in tradition, the contentof the speeches is not; accordingly, the speeches are t to express not onlythe opinions of the characters but also the poets attitude to what theyreceived from their tradition.As I have argued elsewhere (Finkelberg :,,b), the double perspectivethus adopted would often result in one and the same episode beingsimultaneously delivered from two points of view, the traditional and thepoets own. It comes as no surprise that the latter would as a rule expressthe attitudes of the poets own time. Owing to Homers extensive use ofdirect speech, it was possible to incorporate these attitudes into the textof the poems without changing their plots. And although this would ofcourse be true of other elements of the poems too,,:by their very naturethe speeches would present the most appropriate vehicle for furnishingthe traditional diction with elements of the world to which the poet andhis audience belonged.It is no accident, therefore, that Homers non-formulaic and metricallyfaulty expressions, linguistic innovations and the like are concentratedin direct speech. This does not mean that the contexts in which non-standard expressions and ideas occur were much less prominent in epicpoetry before Homer. Though everything suggests that expressions of thiskind belong to the latest layer of the Homeric poems, this does not entailthat epic diction before Homer contained no speeches or consisted mostly,:The poets famous comment on the inequality of exchange in the GlaucusDiomedes episode inIliad o provides a good example. Cf. Seaford (:,,: :,): the implicit criticism of the increasinglydangerous institution of gift-exchange from the new perspective of commodity-exchange, in whichinequality is more surprising.Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013, margalit finkelbergof standard scenes cast in traditional formulae. Hoekstras observation tothe effect that formulaic introductions to Homers speeches indicate thateven at very early stages dialogue existed alongside narrative saves memany words here.,:Yet it is reasonable to suppose that while the formulaewere preserved in the stock of traditional expressions, the non-formulaicand irregular expressions were ephemeral creations that varied from onepoet to another. In other words, even if epic poets before Homer alsocomposed long speeches abounding in non-traditional expressions whichreected the attitude of their own times, these were not likely to survive.Jankos formulation, although it does not address the speeches as such, isappropriate here:Ina traditionthat consists of oral improvisationrather thanaccurate memorisation,it is inevitable that, in those elds where the tradition hands down no ready-madediction, the improviser will draw on the only other diction he knows, that of hisvernacular.,,But how late can these late features of the Homeric epics be? In Hoek-stras words quoted above, the expressions that did not attain a formulaicxity and it should be kept in mind that this includes the overwhelmingmajority of linguistically late expressions in Homer should be seen assimultaneous with the end of oral composition. Hoekstra appears to implythat at the moment when the Homeric poems were composed the epiclanguage became frozen and the oral tradition came to an end. But surely,as neo-Ionisms and similar phenomena strongly suggest, oral tradition assuch did not die out with the xation of the Homeric poems in writing.,This is why I see the now classical formulation by Adam Parry to the effectthat the name Homer . . . must be reserved for the poet who composedthe Iliad at the time when it was put into writing (:,oo: :c:) as providinga more satisfactory explanation for the phenomena discussed.That is to say, if the epic language indeed ceased to develop, this hap-pened only in respect of those individual products of oral tradition thatwere xed in writing. At that time, epic diction already presented an amal-gam, or rather something on a par with an archaeological site whose upperstratum represents the last stage of the sites continuous occupation. Andsince, as I hope to have shown, Homeric speeches by denition belong to,:Hoekstra (:,o,: ,: n. :); cf. Finkelberg (:,,: :,o n. ,,). On Homeric speech introductions seeEdwards (:,o).,,Janko (:,:: :o); cf. ibid. (:,:).,Cf. Foley (:,,c: ::): There is no reason to believe that, even if the Iliad and Odyssey that havereached us were xed in the sixth century B.C., oral composition of the Homeric ilk immediatelyceased. On neo-Ionisms see West (:cc:a: ,:, ,, ,).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013Late features in the speeches of the Iliad ,,this upper stratum, they were also most prone to preserve the realia, thelanguage, the institutions and the mores as they existed at the momentwhen the poems were xed in writing. As far as I can see, this wouldaccount satisfactorily enough for the peculiarities of the speeches as dis-cussed in this essay. Indeed, it seems not to be a mere coincidence thatthe linguistic and formulaic irregularities observed above occur in thoseparts of the Homeric text which are innovatory in content: Dionysus andZeus Xenios, as well as the fabulous wealth of Troy and the unambiguouslynegative evaluation of the Trojans themselves readily come to mind in thisconnection. If this is correct, then linguistic and formulaic irregularitiesemerging in the speeches should be regarded as by-products of the lastpoets intervention in the traditional idiom.To recapitulate, although the speeches undeniably form an inseparablepart of Homeric diction, they belong to its latest stratum, the one thatcoincided with the xation of the Homeric poems in writing. It follows,then, that it would be dangerous to base a comprehensive theory regardingHomer on the material of the speeches alone. To return to a passagediscussed above, Diomedes use of the Dionysus myth or Menelaus appealto Zeus Xenios cannot be seen as adequately representing Homers religiousbeliefs in their entirety, but, rather, as representing such beliefs that, likemonosyllabic quantitative metathesis, only became available at the lateststage in the poems history. In viewof this, it would be welcome if Homericdictionaries began to specify the types of context in which a given word orexpression normally appears in Homer, for Homeric words and expressionsfound in the narrative are not necessarily identical to those found in thespeeches, and vice versa.,,,,To my knowledge, the only database that allows this kind of search is The Chicago Homer (Kahaneand Mueller).Downloaded from Cambridge Books Online by IP 142.150.190.39 on Fri Jul 05 16:35:52 WEST 2013. Books Online Cambridge University Press, 2013chapter 5Tmesis in the epic traditionDag T. T. Haug1 the phenomenon and its place in the epic kunstspracheIt is a characteristic feature of Greek epic diction that compound verbs,which would be integral words in classical Greek, can be split by so-calledtmesis. Consider the following example:(:) :cv sci Mnpicvn, tpc:tpc, tpc, u0cv ttitt (Il. :,.,co)It is obvious that in this line, tpc, does not form a prepositional phrasewith u0cv. Rather, it belongs with ttitt and forms what we from thestandpoint of classical Greek usage would call a compound verb.:Andstill, this compound verb is discontinuous, because the poet has chosento separate the verb and the particle.:We can tell that the poet chosethis version and did not simply follow the constraints of the metre, sinceit would be easy to compose the same line without separating tpc, andttitt:(:) :cv sci Mnpicvn, tpc:tpc, u0cv tpcottittIt could even be said that version (:) is prosodically preferable, since Il.:,.,co as given by our manuscripts violates Wernickes law in having afourth biceps which is long by position. But of course, it is likely that Ionictpc, has here replaced Aeolic tc:i,,and that the verse had a resolvedfourth biceps in the original version.Besides illustrating tmesis, this example shows the importance of prefer-ence hierarchies in the study of the Homeric dialects. As we know, Homerprefers Ionic forms to Aeolic ones, except when the latter are metricallynecessary. Thus, the text has the Ionic form tpc, which gives a correct,:Diachronically, however, it is not impossible that tpc, belonged to u0cv as an object predicativecomplement, the whole sentence meaning he said the word forth. But such an analysis is notpossible in historical Greek. For the analysis of place words in Homer, see Haug (:cc,).:A terminological note: in this article, the two words will be called the verb (ttitt in example :) andthe particle (tpc,). Note that I will use particle as a cover term for preverb, postverb, preposition,postposition and adverb that is, for words such as tpc,, irrespective of what function they have.,See Janko (:,;,).,oDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013Tmesis in the epic tradition ,;though slightly irregular, hexameter. The mere coexistence of Ionic tpc,and Aeolic tc:i (as well as numerous other dialectal doublets) in Homeris less important than the fact that there is a preference hierarchy whichwe can give a historical interpretation in terms of phases in the evolutionof the epic diction: tpc, is preferred whenever the metre allows it, so it isthe form of the later generation of poets.Is it possible to establish the position of tmesis in such a hierarchy?Consider Od. ,.c (the formula is repeated in Od. o.;; and :c.:oc):(,) ocst o cpc ot,yvcv ucipc,, tv o cvcv tytutv (Od. ,.c)As it stands, this line has tmesis, but it does not respect the digamma ofcvc,, which is otherwise a high priority: it is respected about :cc times andignored about :, times according to Chantraine (:,,: :,). It would havebeen easy, though, to compose this line as a metrically correct hexameterwithout tmesis and respecting digamma:() ocst o cpc ot,yvcv ucipc,, tvtytut ot ()cvcvIn other words, it seems as if the poet has voluntarily produced tmesis,at the cost of violating digamma. This shows that even at a late stage ofthe epic diction, after poets had started neglecting digamma, tmesis wassought after and deliberately used by epic poets. If we believe that preferencehierarchies were mechanically applied by poets in the epic tradition, linessuch as (,) must mean that tmesis was generally preferred to digamma.However, we will see that the question is perhaps not so simple, and itmight not be coincidental that (,) comes from the Odyssey, as this poemspoet seems particularly fond of tmesis.(:) and (,) are just two examples, but there are many more where thepoet has used tmesis even where he did not have to. We can concludethat while tmesis might be handy for composing hexameters, it is notconditioned solely by metrical factors. Forms with tmesis are similar to theIonic forms, which are allowed even when the metre does not enforce theiruse, and different from the Aeolic forms, which are only permitted whentheir metrical structure differs from that of their Ionic counterparts.Most scholars would agree that epic poets tended to replace archaismsin their language with vernacular forms whenever possible. Underlyingthe stylometric approach of Janko (:,:), there is even a claim that thereplacement proceeds at a more or less constant rate which allows us to drawchronological conclusions. But Jankos research is based on morphologicalfeatures rather than syntactical ones, and as we shall see, there are a numberof differences between the two areas. Replacing unfamiliar desinences byfamiliar ones in a correct way is an altogether easier affair than changingthe syntactic rules of your language. And so, even if it is clear that theDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013, dag t. t. hauglast poets, far from trying to avoid tmesis, actually sought it, we shouldnot jump too lightly to the conclusion that tmesis was a feature of theirvernacular.2 the historical linguistic background of tmesisThere can be no doubt that the freedom of word order which allows theseparation of preverb and verb is inherited. The same phenomenon is foundin the earliest texts of several other IE language groups, and so we mustassume that at one point in the history of Greek, the later preverbs hadfreer positions within the sentence. The term tmesis (separation) wouldbe meaningless as a description of this phenomenon: instead it seems as ifthe particle and the verb had not yet coalesced in Homers vernacular.On the other hand, there can be no doubt that in Hellenistic poetry, forexample, what we witness is really tmesis: a dividing in two of a synchronicunity. In Moschus (Europa ), we read:(,) uoiutn, tto uccsc sc:c qtc otoucAll scholars would agree that Moschus is here not following the syntacticrules of his own vernacular, but rather imitating a feature of the epic style.However, if we take Homers language as the norm, Moschus has made amistake: while Homer does in some cases put the particle after the verb, healways lets it follow immediately upon the verb in such cases. This rule isbroken by Moschus, who lets a dative adjective intervene between the verband the particle. At some stage, then, it seems as if the phenomenon oftmesis was interpreted as a license to cut up any compound verb and placethe results where you want in the metre. On its way to becoming a stylisticfeature, tmesis became mannered. We see the end point of the evolution insuch monstrosities as saxo cere comminuit brum, transmitted under Enniusname. In general, archaic Latin style seems to have favoured such wildtmesis, witness sub uos placo (for uos supplico, in an archaic prayer cited byFestus). Since supplicare is a denominative from supplex, it is very unlikelythat this reects a stage of Latin where tmesis was still allowed. ArchaicLatin poetry belongs to a very different context from that of early Greekhexameter poetry, of course; but the point is just that at some time, tmesisceased to obey any linguistic constraints.Now before we interpret the frequency and distribution of tmesis inearly Greek epic, it is important to know what kind of phenomenon weare dealing with at this stage. Does tmesis in early epic poetry reect thevernacular of the poets? Do our texts reect syntactic change in progress?Or are we rather dealing with a stylistic feature without any basis in thespoken language, even at this early stage of the tradition?Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013Tmesis in the epic tradition ,,Scholars found little room for doubt before the decipherment of LinearB. Wolf concluded with a nondum coaluisse. Pierson, in his major studyon tmesis (:,;), said that tmesis in Homer is not gure, but idiom. Wacker-nagel (:,:: :;:) was convinced that early Greek shows a real independenceof the preverb.But since :,,,, many scholars have come to think that the fusion ofpreverb and verb had taken place already in Mycenaean, because there areno cases of tmesis in the Linear B texts. This view was strongly argued byHorrocks (:,:) and supported by Morpurgo Davies (:,,). Since then ithas gured as a stock argument for the pre-Mycenaean roots of the Greekepic tradition. But the Mycenaean evidence is far from compelling: thereare few nite verbs in Mycenaean, and only nine of them are compoundverbs. Moreover, the most frequent type of tmesis in Homer is that wherethe preverb precedes the direct object (the type sc:c ospu ytcuoc).This is only possible with transitive verbs and only four of those ninenite compound verbs in Myceanaen are transitive. That none of theseshow tmesis could be due to chance, or even have a linguistic reason inthe way information is presented in the Mycenaean texts, as I have arguedelsewhere (Haug :cc:: :). At any rate, the evidence is too weak to allowthe conclusion that tmesis was disallowed by the syntactic rules of Greekin the Bronze Age.We should not be surprised that we cannot extract convincing negativeevidence from such a small corpus as the Mycenaean one. Indeed, it is notaltogether easy to establish the status of tmesis even in much later times: wend things like tc ,cp cc0uci (Nub. ;,:) in Aristophanes; Herodotusalso has a number of cases of tmesis, but always with only an enclitic elementintervening between particle and verb; and similar examples are found inother Ionic authors such as Hipponax and Hippocrates. Wackernagel wasno doubt right in claiming that this limited kind of tmesis by a cliticremained possible for a long time, especially in Ionic, but long-distancetmesis, where a full prosodic word intervenes between the preverb andthe verb, such as can be found in the tragedians, is at that time a poeticartice.So all we knowis that tmesis disappeared fromGreek some time betweenProto-Indo-European and the classical period. But an interesting fact aboutparticles in Homer allows us to x the moment more precisely. Whereasthere are only :, cases of ti,/t, In fact, only t, occurs in tmesis in Allens editio maior, which is the one used by TLG.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013:cc dag t. t. haugcognate in has preserved the original syntax: as a preposition with accusativeit has directional meaning, and with the dative it has locational meaning.In what we could call the peripheral Greek dialects Arcado-Cypriote,Thessalian, Boeotian and Northwest Greek tv has preserved this syntax.Ionic-Attic, Lesbian and Doric, on the other hand, innovated a form en-s(with various later dialectal developments yielding t, and ti,) which aloneis used with the accusative in the directional meaning, leaving the old form en with the locational meaning and the dative case only. Thus, the twomeanings were disambiguated by the form of the preposition, and not bycase alone.That tmesis is so much more common with tv(i) than with ti,/t, wouldsuggest that, as a linguistic phenomenon, tmesis belongs to the periodbefore ti, was created, or at least before ti,/t, became usable in the epicdialect. This is corroborated by the fact that tv in tmesis can have thedirectional meaning that would normally demand ti, or t, in a prepositionalphrase in Homer. Consider the following example from Od. ::.:(o) tv ot :c uc ccv:t, tnocutvThe force of the particle is clearly directional: Odysseus and his companionsmade the sheep go onto the ships. Still, the poet uses tv. It should also benoted that even in Attic, compound verbs show a clear preference for tvinstead of ti, (Chantraine :,:). So it is likely that the univerbation ofparticle and verb happened before the creation of ti,/t, and therefore thatthe poets of the last generation before Homer, who no doubt had ti,/t, intheir vernacular, did not have long-distance tmesis.A closer study of the cases where ti, is used in tmesis further supportsthis conclusion. In :: out of the :, cases, ti, is separated from its verb onlyby the particle ot. As we have seen, this is exactly the kind of tmesis thatis possible even in later Ionic. With two exceptions (Il. ::.:oo and :.:,,),then, this mild kind of tmesis is the only one allowed with ti,, whereas tvallows for long-distance tmesis and has retained its old semantics in suchconstructions. We can therefore retain the conclusion that long-distancetmesis had disappeared from the spoken language in Homers time.3 defining tmesisThis means that in examining tmesis in the epic tradition, we are forthe most part dealing with a defunct phenomenon, an archaism like thegenitive in -cc or the short vowel subjunctives. Still, as we saw in thebeginning, Homer uses tmesis even where it is not metrically necessary.From this there is one conclusion to draw: not only is tmesis no longer apossible construction in the vernacular it has also become a gure thatDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013Tmesis in the epic tradition :c:the poets use not only for their metrical needs, but for stylistic reasons. Assuch, it probably reects the individual choices of poets rather than theevolution of a whole tradition, which is why a study of the frequency oftmesis is likely to be an interesting complement to statistic study of otherfeatures whose use and replacement seems to have been more mechanical,such as the genitives in -cc and -tc.But studying the frequency of tmesis is also more difcult than studyingdifferent genitive endings, since it is harder to dene what we are lookingfor. For the study presented here, the data were gathered in the followingway: First, all occurrences of words that are liable to function as preverbs, inall their forms,,were retrieved from the TLG texts of the Homeric poems,the Theogony, the Works and Days, the Shield of Heracles, and the hymnsto Demeter, Apollo, Hermes and Aphrodite. Examples from the Hymn toApollo were divided into the two well-known groups. It was my intentionto divide examples from the Theogony into two groups as well, before andafter line ,cc. But as it turned out, there are no cases of tmesis in thedisputed latter part of the poem.This search yielded a large number of attestations where particlesappeared separated from the verb of the sentence and so potentially intmesis. On the other hand, there is also a possibility that the particle func-tions as a pre- or postposition and this is by far the most frequent case.Finally, the particle can also be an independent adverbial. The followingexamples show the possibilities:(;) Prepositioncoot tc: tv 1i tpiccsi c:icvtipscptcv tonnocv: (Il. :.:,,o)() Postposition:nc0 ,cp Ausin -v tti oivntv:i (Il. ,.;,)(,) Preverb in tmesisc0, tc: t Aivticv tcunv (Il. .:c)(:c) Postverb in tmesisOqp c :cu, tvpicv t tv:tc ucpucipcv:c (Il. ::.:,,)(::) Adverbial,tcoot ot toc ttpi ycv (Il. :,.,o:)Examples (;)(::) are quite easy to categorize, but this is not always thecase. In particular the boundary between adverb and verbal particle can beunclear. Consider Il. :.o:::(::) tti o cctc cvcv tt (Il. :.o::),Here is the complete list: uqi, uq, v, v, v:i, tc, t, q, oi, oi , ti,, t,, ts, t, tv, tvi, tti,tt, tq, sc:, sc:, sco, sc, ut:, ut:, ut, tcp, tp, tcp, tcpci, ttpi, tpc, tpc,, tc:i, ov,v, ottp, otc, ot, oq.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013:c: dag t. t. haugLooking at this line in isolation, it is tempting to conclude that tti is herea free adverbial. But in Od. ,.,: a compound verb tttticv appears, andIl. :.o:: could have the same verb with tmesis. Alternatively, one couldargue that even free adverbials could appear to the left of their verbs andthat the compound form tttticv is due to later univerbation. But suchspeculation is outside the scope of this study.Instead, the approach adopted here was to count tmesis and free adver-bials together, even if they are traditionally kept apart in linguistic analysesof Homers language. The rationale behind this choice was that even ifthe two phenomena are not the same linguistically speaking, they are bothforeign to the classical norm and we cannot even be sure that a poet in clas-sical times, who had neither construction in his vernacular, would be ableto keep the two apart. Both were manifestations of a stylistic trait properto epic and other higher poetic genres. (,)(::) may illustrate phenomenawhich are different from a linguistic point of view, but similar from thepoets perspective.The only problem was thus to decide for every case whether the particlewas an adposition (pre- or postposition) or not. In some cases, the choicehas already been made by the editor, cf. Il. :.:,c:(:,) vc, tt tootcv:c (Wests apparatus: tt Aa: tt Hdn AcG: tttoo-, ,c Z 0 )If the editor had chosen the text tttootcv:c, the example would noteven have turned up in the query. But fortunately, it is without importancefor our research, since on either analysis there is no tmesis here.The difcult cases, then, are the ones where the particle is separatedfrom the verb, the particle and the verb constitute an attested or possiblecompound verb, but the particle also appears next to a noun that it couldgovern:(:) uqi o cp cucioiv t:c iqc, p,upcncv (Il. :.,)There exists a compound verb uqic, so Il. :., could be countedas tmesis, but on the other hand, it is also possible that uqi governscucioiv. In such cases, my approach was to count every construction asa prepositional phrase if the particle stands next to or is only separated byclitics from a noun which it could govern according to the syntactic andsemantic rules of epic Greek. Here is another illustrative example:(:,a) tc o tv ocuc:c vciti (Od. :.,:)(:,b) Znvc, o tv ocucoi vciti (Hes. Th. :,)(:,a) is counted as tmesis, since tv cannot govern the accusative in Homer,nor in any other Greek dialect when no motion is involved. On the otherhand, the very similar example (:,b) is not counted as tmesis, since here theDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013Tmesis in the epic tradition :c,Table ,.: Frequency of tmesis in early hexameter poetryWork Cases of tmesis Freq. per :cc linesIliad ;,, ,;:Odyssey o;: ,,,,Theogony :,cc ,, ,,,Theogony ,cc:c:: c cTheogony ::c:: ,, ,,:Works and Days :, ,,,cShield of Heracles ,o ;,,To Demeter :, :,o,To Ap. ::; o ,,,;To Ap. ::,o :, ,::To Hermes :o :,;oTo Aphrodite :,,;analysis of tv ocucoi as a prepositional phrase is possible. According tothe principle set out above, this analysis is preferred and the constructiondoes not count as tmesis.4 resultsOn the denition above, tmesis distributes in the corpus of early Greekhexameter poetry as portrayed in Table ,.:. The frequencies that we observein the hymns vary considerably, and are in fact not statistically signicant.In the Shield of Heracles, the frequency is extremely high, ;., cases of tmesisper :cc lines. This is so because the poems contain many cases of tv inlines like these:(:o) tv ot oucv ,tci ycvcv tocv not tcv:cv (Asp. :o)We can also test the signicance of the numbers for the hymns on a casewhere there is universal agreement, namely the Hymn to Apollo. Everyoneagrees that this hymn should be split in two parts and the numbers show arather marked difference in the frequency of tmesis. But on closer inspec-tion, the numbers reveal themselves too small to allow for any conclusion.Knowing that the frequency of tmesis in the whole Hymn to Apollo is ,.oper :cc lines, we can, using the Poisson distribution, nd the probabilitythat any given :; lines will contain exactly o cases of tmesis and infact there is a :, per cent chance for this, so the result could easily bedue to chance, and the same is true of the other hymns. This means thatwe should concentrate on the four larger works, the Iliad, the Odyssey, theTheogony and the Works and Days. It would perhaps be possible to achieveDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013:c dag t. t. haugsignicant results even for the shorter texts, if one also counted the numberof compound verbs without tmesis, since this would allow us to study abinomial distribution instead of variation in frequency.In the four larger epics, Janko (:,:) got an impressive correlationbetween the frequencies of the eleven phenomena, though the results forthe a-stem genitives need to be modied (Janko and Jones in this volume).Generally, there is a recurrent pattern where the frequency of the moremodern variant increases slightly from the Iliad to the Odyssey, then thereis a large jump to the Theogony and a further small increase in the Works andDays. But since we have already seen that tmesis is a stylistic feature even atthe earliest known stage of the Greek epic tradition, there is every reason toexpect that the numbers will be different from those of the morphologicalcriteria, and that is what we nd indeed.Given that we seem to be dealing with the choices of individual poets,it is reassuring to see that the Theogony and the Works and Days patternso closely together, since there is almost universal agreement that the sameauthor wrote these two poems. This result is particularly evident if we lookat the result for the whole Theogony, but even if we disregard the last :::lines, the gures are rather similar and this can be conrmed by statisticaltests.And indeed, the numbers on tmesis do support the conclusion that arather large part at the end of the Theogony does not belong to Hesiod.The last example of tmesis is found in line ,,; there are no examples fromthe last :o, lines of the text. Statistics by themselves cannot show whereto draw the line, but we can make some sample calculations using Westsproposal to put the end of Hesiods genuine work at line ,cc. The frequencyof tmesis in the whole text of the Theogony is ,.: per hundred lines; usingthe Poisson distribution we can once again calculate the chance that :::lines contain no examples of tmesis: in fact, this is a mere :., per cent chanceif the distribution is random. In other words, it is highly unlikely that theabsence of tmesis in the last part of the poem is due to chance thereshould be some underlying cause. On the other hand, statistics cannot tellus what that cause is. But to my mind the data supports the conclusionthat the end of the Theogony does not belong to Hesiod, although moreprecise tools are needed in the search for the exact boundary.The fact that the results for Hesiods usage are uniformstands in contrastto the most interesting nding of the examination, namely that there is alarge difference between the Iliad and the Odyssey. And in fact, it is theOdyssey which is the more archaic poem, with ,.,, cases of tmesis per :cclines. It would be perverse to claim, on the basis of this evidence, that theOdyssey is the older poem, but there are other consequences.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013Tmesis in the epic tradition :c,5 conclusionsIt is of course no longer a very controversial claim that the Iliad and theOdyssey were composed by different authors this is rather a majority viewby now. Furthermore, there is no doubt that the diction of the Odyssey is onthe whole slightly more innovative than that of the Iliad. However, Jankoshowed that the Odyssey is not only more advanced, but also consistentlyso throughout his ten criteria. Be it digamma, quantitative metathesis orephelcustic nu, the Odyssey shows a slight increase in frequency and asJanko observed, this is obviously compatible with the hypothesis that theIliad and Odyssey are the work of one man whose diction advanced withhis age.On the other hand, Janko also showed that the change of frequency inthese criteria was rather uniform in the whole tradition; so we are dealingwith a change in the language of a genre, not with the choices of anindividual poet. In this respect, as we have seen, tmesis is different andtherefore, I think, more relevant to the question of authorship.The numbers are clearly statistically signicant. The frequency of tmesisin both Homeric poems taken together is ,.c per :cc lines, which meansthat on average we would expect o:, cases in a corpus of ::,::c lines. Againusing the Poisson distribution, we see that there is only a :.: per centchance of getting o;: examples or more if the distribution is random, sowe should look for an explanation. Once more, statistics cannot tell uswhat the explanation should be; perhaps the poet of the Iliad developeda taste for tmesis before writing the Odyssey. But such a hypothesis seemsless plausible than postulating two authors.The case of tmesis shows us that stylometrics is not always a certain guideto chronology: what is important for chronology is not the frequencyof single traits, but correlations of several features. The frequency of aphenomenon like tmesis tells us rather less than expected about the relativechronology of texts, and rather more about the phenomenon of tmesisitself. But what frequency tells us about tmesis is interesting in itself,since it shows that stylistic predilections and false archaisms played a rolealso in the earliest Greek hexameter poetry, and that even at this stage,the evolution of the diction cannot be wholly explained as mechanicalmodernization by the singers.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:28 WEST 2013. Books Online Cambridge University Press, 2013chapter 6The Doloneia revisitedGeorg DanekIn the discussion of relative chronology in archaic Greek epic the Doloneiaplays a prominent role. When we try to dene the relationship of singleworks without extra-textual evidence, we are limited to observing implicitreferences: intentional or unintentional adoptions of phrasings, citations,allusions. But by this method we can never be sure if what we label amodel text of a quotation is identical with the state of the text whichhas been handed down to us, as the model may as well have been a muchearlier condition of the same text. Thus conclusions concerning relativechronology in archaic Greek epic must remain controversial.The Doloneia is the only single extended passage within the Iliad:whichhas been labelled a late addition or not authentic by most Homericscholars, starting from the famous note in the scholia.:In my doctoralthesis I tried to show that the Doloneia, though referring to the Iliad,and aiming at being an integral part of it, differs signicantly from theIliad s style and is no part of its larger poetical conception, but a secondaryaddition. Only with regard to the question of authorship did I refrainfrom making a strong judgement,,for the following reason.What does talking about authorship inan(originally, or predominantly)oral epic tradition mean? The conception of author and authenticitybecomes problematic when we talk about an oral tradition in its strongsense, as it was outlined by Albert Lord (:,oc) following Milman Parry.:For similar discussions concerning the continuation of the Odyssey see S. West (:,,), Oswald (:,,,),Danek (:,,b: ,:ff.). The case of the unauthenticity has been made recently again by Cantilena(:cc: xxiiixxix and passim). We will see that, with the end of the Odyssey, things are different fromthe Doloneia.:Schol. T in Il. :c.:: qcoi :nv pcoicv oq Ounpcu ioi :t:yci sci un tvci utpc, :,lioc,, tti ot ltioio:p:cu :t:yci ti, :nv tcinoiv (They say the rhapsody has been placedseparately by Homer and was no part of the Iliad, but has been placed into the poem at the times ofPisistratus). Cf. Montanari :c:c.,Danek (:,: :,c;). Some scholars took my book as nal proof for the unauthenticity of theDoloneia, cf. West (:cc:a: :c::); Cirio (:,,) votes for the authenticity once againwithout discussingmy arguments.:coDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013The Doloneia revisited :c;Within the oral period of an epic tradition, strictly spoken, epic singerstake over their songs from other singers, change them in the course of theircareer and pass them on in a uent state. As long as no written xationtakes place, the only author we can identify is the singer of the versionwhich is performed on a single occasion. Under such conditions, the rstsinger who added the lay of the Doloneia to the (still uid) epic concept ofthe Iliad must be simply called the author of this new version as a whole.Any effort to discuss the authenticity of the Doloneia might be questioned,then, with a reference to the oral tradition. For that reason I want to pose two questions anew: rst, how far canwe posit that the Doloneia differs from the style of the Iliad as a whole?And, second, what does this mean for its authorship within a cultureon the fringes of orality and literacy? My essay will rst follow the threemain chapters of my dissertation, and only afterwards will I try to shednew light on the second question through a comparison with the Bosnianepic tradition: what happens when a singer within a predominantly oraltradition adds a part of his own to a model text? In my rst chapter I discussed quantitative aspects of the language of theDoloneia. Starting from Richard Jankos documentation (:,:: :c::c)which shows that the Doloneia linguistically does not differ from the Iliad,I tested several more aspects of formularity which didnt see signicantdepartures from the Iliad as a result, either (Danek :,: :c;). Buthere we may restart our scrutiny on a more basic level. Stylometricalstudies betray an individual authors style by exposing unobtrusive features,such as high-frequency word-types like connectives or particles. This canbe scrutinized much more easily nowadays with the simple help of theMicrosoft Word Search function.But my newsample controls showdisappointing results: in the Doloneia,there are no signicant divergencies in the frequency of the most frequentconnectives ot, sci, utv, :t, ,p, or the particles cpc, on, cov. Divergenciesfrom the norm of the Iliad can be found only with expressions that do notoccur often enough to produce statistical signicance. For example, I found:: occurrences of the word ttti:c, while in the Iliad we expect only ,.:occurrences in a book of the same length, or :; occurrences of the particlen (or), compared with o. calculated occurrences in the rest of the Iliad., Thus recently Grethlein (:cco: :,, n. :c,): Es ist fraglich, inwiefern es angesichts der oralen Tradition uberhaupt sinnvoll ist, von einem Autoren der Ilias zu sprechen.,Close to signicant seems the case of (:; times against :;.; times in the Iliad).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013:c georg danekNow these numbers tell us more about the content of the Doloneia,and less about its authors style, and offer no proof against its authenticity.I tried to explain already in my book (Danek :,: ;, :,c:) why weshould not expect signicant deviations from the Iliad by counting wordfrequencies: for one thing, the poet of the Doloneia very much sticks tothe formula language of the Iliad, using identical idioms and syntacticalclusters because he wants his poem to sound like the Iliad. On the otherhand, the Doloneia is simply too short to admit statistical results of anysignicance. So we might be content with stating that the poet of theDoloneia is well acquainted with the Iliadic formula language and uses itselements to a sufciently high degree to make any differences disappearwhen they are tested by quantitative analysis only. My second chapter concerned the formula style, properly spoken: in arunning commentary of ::c pages I concentrated on formulations whichI thought to be specic of the Doloneia, trying to dene criteria forexploring the ways in which the Doloneia differs from the Iliad s normstyle.oI judged as typical for the Doloneia cases where the poet, on theone hand, takes over a formula or formulaic expression from the Iliad andplaces it in an unusual context, so that its traditional connotation getslost; on the other hand I considered cases where he uses an Iliadic formulajust to evoke its traditional context, so that we get the impression of anabbreviating, allusive style. I expose here one passage which I noted onlynow when reading the Doloneia again and which has not been commentedon until now.We are right in the middle of the Doloneia. Diomedes and Odysseus areon their way across the battleeld, when they face the Trojan spy Dolon.They hide away from the path to cut off his ight back to the Trojan camp.Dolon passes by and proceeds on his way to the ships. The two Greeks waita moment and then start after him. Dolon stops rst as he supposes themto be Trojans who want to call him back. But when the Greeks approach herealizes that they are enemies and runs away. The last stage of this processis expressed as follows: c:t on p cttocv ocupnvtst, n sci tcoocv,,vc p cvopc, onicu,, cinpc ot ,cvc: tvcucqtu,tutvci :ci o cc oicstiv cpunnocv.(Il. :c.,,;,)oThis part of my book found small resonance. In his commentary, Hainsworth (:,,,) seldom refersto my critique of the formula style of the Doloneia.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013The Doloneia revisited :c,For a precise understanding of these lines we need a verbatim translation:but well, when they were at a distance of spearshot or even less,well, he recognized the men as his foes, and [at the same time]was [already] pumping his swift knees,in ight; and they immediately hurried up to follow him.When reading this passage, I was puzzled by the verbal aspect of tvcuc,because in this context the imperfect tense can only describe the back-ground of what was already going on when Dolon suddenly made hisdiscovery. Literally spoken, the sentence means: He recognized the men and even before he recognized them, he was already running, a meaningthat contradicts the logic of the events.;What we need here is a phrasemeaning he began to move which can be expressed only through theaorist, not the imperfect.We can see better what has happened here when we look at the secondinstance of the expression cinpc ot ,cvc: tvcuc, Il. ::.:,o:Ls:cpc o, c, tvcnotv, tt :pcuc, coo cp t: t:ncoi utvtiv, ctioc ot tc, itt, ot qcnti,.lntion, o ttcpcuot tcoi spcitvcoi tttcic,n0:t sipsc, cptoqiv, tcqpc:c:c, tt:tnvcv,pnoic, cunot ut:c :pnpcvc ttticv, :cn ot 0tcic qct:ci, c o t,,tv cu tnsc,:cpqt ttciooti, tttiv :t t uuc, vc,tic, cp c , tuutucc, iu, tt:t:c, :ptot o Ls:cp:tyc, 0tc Tpccv, cinpc ot ,cvc: tvcuc.Here things are described as we expect themto be: Achilles approaches Hec-tor; Hector realizes the situation and starts running away; Achilles takes upthe pursuit. Up to this point, all references are giveninthe aorist tense. Thenwe get an epic simile, which illustrates start and process of ight and pur-suit, and then this image is projected back to Achilles who, by that time, isfollowing Hector in the imperfect tense, and to Hector who starts his ightin the direction of the walls (:, :ptot, aor.). It is only at this point whenHectors ight has been well established in the narrative that the expressioncinpc ot ,cvc: tvcuc follows. Here the idiom is a descriptive ele-ment which conforms to the verbal aspect of the imperfect tense. The sameis true for the more elaborated expression cinpc tcoc, sci ,cvc:tvcuc:;The comment by Cirio (:,,: :,o) is linguistically imprecise: limperfetto mette in risalto lazionedurativa.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013::c georg danekc, Ayitu, cinpc tcoc, sci ,cvc: tvcuc(::.:)c, Ls:cp cinpc tcoc, sci ,cvc: tvcuc(:,.:o,)In both cases the expression immediately follows an extended simile whichhas already helped to establish the idea of the start and the resultingstable condition of physical movement. In both cases the beginning of the movement is expressed only in the simile, and not in the mainaction: as in many other cases, the similes here switch over, and in that way substitute, a small partof time which is left out in the narrative of the main action.,Danek (:,: :;;:c,), based on Lohmann (:,;c: :,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013The Doloneia revisited :::Doloneia poet ignores these patterns and builds up his own pattern ofarming scenes structuring the plot of the Doloneia.Here I want to discuss a third category, the treatment of time andsimultaneity. Starting from Zielinski (:,c:), scholars noticed that Homernever represents actions which happen on different scenes as taking placeat the same time, but one after the other. So the narrative knows onlyforeground actions, while events which happen in the background arereduced to stable situations without change or development.:cEven ifthe so-called Zielinskis Law has become the object of debate anew,::mostscholars agree about the following facts: (a) the prime narrator never jumpsback in time to recount actions taking place at a strand of the plot whichhas already been introduced in the narrative;::(b) when two or morestrands of the plot get announced at a ramication point, these actionsare presented in the narrative as taking place one after the other (Krischer:,;:: ;:::,). When we take a look at the South Slavic epic tradition, werealize that individual singers within a single tradition may handle similarrestrictions of time management quite differently.:,So we may concludethat Homers consequent adherence to Zielinskis Law was his deliberatechoice to economize his narrative requirements.The Doloneia systematically differs from the Iliad in this respect,:aswe see when we follow the plot. In the beginning, Agamemnon cannotsleep and decides to consult Nestor about what to do. We get a shortdressing scene including a catalogue of clothes. Only afterwards the narratorswitches to Menelaus:c, o c0:c, Mtvtccv tyt :pcuc, coot ,cp co:0tvc, tti tqpcioiv tqicvt (Il. :c.:,o)and in the same way Menelaus was frightened, because even he could not sleep.We are told how Menelaus rises, puts on his clothes (here again with acatalogue) and goes off to wake up Agamemnon. When he joins his brother,we learn that Agamemnon is just putting on his clothes::cThis part of the analysis conforms with how Erich Auerbach (:,o) commented on the permanentpresence of the Homeric narrator.::The debate has been reopened by Rengakos (:,,,). See now de Jong (:cc;).::Cf. Steinr uck (:,,:). The Odyssey maybe differs from the Iliad in this respect, cf. Rengakos (:,,);but see my remarks in Danek (:,,a: ;,).:,Danek (:,,a). Cf. Danek (:cc;).:I made a rst suggestion in Danek (:,,a: ;, n. :,). Cf. Jens (:,,,: o::).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013::: georg danek:cv o top uq cucioi :inutvcv tv:tc sc(:c.,)Following this presentation, Menelaus has risen not simultaneously withAgamemnon, as is suggested in the scholia,:,but even earlier, althoughthe poet gives it the other way round. This conclusion may sound tooscrupulous, but when Agamemnon meets Nestor, he tells him:v0v o tutc tpc:tpc, u ttt,pt:c sci uci ttto:n(:c.::)But now, [Menelaus] woke up much earlier than I and joined me.So, the narrator does not only step back in time, contrary to ZielinskisLaw, but almost comments on his violation of the rule, signalling that heenjoys the transgression.But let us go back to the two brothers encounter again. Agamem-non orders Menelaus to call, i.e. to wake up, Ajax and Idomeneus, andannounces that he himself will wake up Nestor and force himto go togetherto the guards outside the camp: . . . i v0v, Acv:c sci locutvc stoocvpiuqc tcv tcpc vc, t,c o tti Nto:cpc ocvtui, sci c:puvtc vo:nutvci, c s ttoivttv t, quscv tpcv :tc, no tti:tci . . . (:c.,,o)Here we are given the announcement of a plot ramication with twoseparate strands of actions. Following Zielinski, we are forced to expectthese two actions to be described one after the other. But again, it comesthe other way round::cv o nutit: ttti:c cnv ,cc, Mtvtcc,tc, ,p uci u tti:ttci not sttti,,coi utvc ut:c :coi otot,utvc,, ti, c stv t,,nt tc ut:c o co:i,, ttnv to :c, tti:tic,(Il. :c.oc,)Menelaus presents alternative plot possibilities. He could either stay atplace:otogether with the two companions waiting for Agamemnon (who,simultaneously, would arouse Nestor), or come back to Agamemnon afterhaving fullled his mission. The second choice might be operated in accor-dance with the usual technique of the Iliad: Menelaus might arouse Ajax:,Schol. A ad :c.:,a: c, o c0:c, Mtvtccv tyt :pcuc, sc:c :cv co:cv scipcv : A,cutuvcvi.:oThe wording of the phrase is rather imprecise, cf. Danek (:,: ;,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013The Doloneia revisited ::,and Idomeneus and come back to Agememnon, who would only then starton his way to Nestor, possibly together with Menelaus.:;But Agamemnonvotes for the rst option:coi utvtiv, un tc, pc:cutv nciivtpycutvc tcci ,cp vc o:pc:cv tioi sttuci . . . (:c.o,o)Only now we realize what Agamemnon intended to say in his rst speech:Menelaus should accompany the two companions to the guards and waitfor him there. Agamemnon in his reasoning reveals to us that even in thesecond option he would not observe Zielinskis Law, but set off for Nestorsimultaneously with Menelaus, so that they would miss each other runningdifferent ways across the camp.So again, the narrator comments on how the two actions might berepresented in ordinary Homeric narrative, and emphasizes that he willviolate these rules by letting Menelaus activities be performed in thebackground, without representing them in the narrative.:The same pattern occurs once again. Agamemnon arouses Nestor, andthey both go to wake up rst Odysseus and then Diomedes. WhenDiomedes awakes, Nestor tells himto arouse Ajax the Locrian and Meges.:,Diomedes starts on his way, wakes them up and takes them with him: . . . i v0v, Acv:c :cyuv sci 1utc, ucvcvo:nocv ou ,p tooi vtc:tpc,, t u ttcipti,.c, q , c o uq cucioiv ttooc:c otpuc tcv:c,ccvc, ut,cic tconvtst,, tt:c o t,yc,. o itvci, :cu, o tvtv vco:noc, c,tv npc,.(:c.:;,,)In an implicit way, here again we get two simultaneous actions announced:Agamemnon, Nestor and Odysseus will go the direct way to the guards,:;We may compare this with the double assembly of the gods in Odyssey : and ,. Athena announcestwo goals: Hermes shall go to Calypso, and she herself will go to Telemachus; she immediatelystarts for Telemachus and accompanies him on his journey; only when she comes back to Olympusis Hermes nally sent on his way. Similarly in Il. :,, Zeus announces two goals: Iris shall go to stopPoseidon ghting, and Apollo shall arouse Hector; but only when Poseidon has left the battleelddoes Zeus nally send Apollo to Hector.:Homers different technique may be seen in Iliad o: Hector leaves for the city of Troy; while he ison his way, Glaucus and Diomedes meet on the battleeld; when the action on the battleeld hasfallen into a stable pattern, Hector arrives at Troy. Here the audience can rest assured that Hectoron his way to Troy will not do anything which is worth telling.:,In this dialogue, too, we are not informed where Diomedes is expected to go afterwards, as Nestordoes not even mention the guards. Both the dialogue and the ensuing narrative are abbreviated andallusive, as they presuppose what the audience already knows.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013:: georg danekwhile Diomedes will fetch Ajax and Meges on his way to the same des-tination. Here we cannot distinguish which one the narrator understandsas foreground action and which one as background action, because in thenext sentence all of them already arrive at the guards:c o c:t on qustooiv tv ,pcutvcioiv tuiytv . . .(:c.:c)The poet here uses a verse of Iliad ,, where Menelaus and Odysseus meetwith the Trojan assembly.:cHainsworth (:,,,: ad :c.:c) comments on thewording of :c.:c, as if the pickets were at assembly, as the Trojans wereat ,.:c,, and criticizes the verse as not very appropriate here, althoughthe commanders are all found together. In fact, the Doloneia poet wantsto say something different: those who assemble are not the guards but thekings who just come out of the camp, and they do not so much mix withthe guards, but with one another, because the three groups who have actedseparately up to now here come together for the rst time. Thus the poetuses an Iliadic formulation in an imprecise manner. But more importantly,here again he points at the fact that the three strands (one foreground andtwo background actions) reunite to form a single strand of narrative.::In the assembly which follows, Diomedes and Odysseus volunteer fora spying mission and arm themselves. The poet describes this in a doublearming scene and lets us understand that the armings of Diomedes andOdysseus take place simultaneously (:c.:,o:):c, titcv ctcioiv tvi otivcoiv to:nv.Tuotio utv ocst utvtt:ctuc, Opcouunon, :,,qo,cvcv cuqnst, (:c o tcv tcpc vni ttit:c)sci osc, uqi ot c suvtnv stqcqiv tnstv:cuptinv, cqccv :t sci ccqcv, n :t sc:c:ustsn:ci, pt:ci ot spn ctpcv cincv.Mnpicvn, o Oouo oiocu icv not qcpt:pnv :ocsci iqc,, uqi ot c suvtnv stqcqiv tnstv . . .Thrasymedes gives to Diomedes a sword, a shield and a helmet, which isexpressed in the aorist tense; then the narrator switches to Meriones, whogives Odysseus his bow, his quiver and his sword. This action is meantto take place simultaneously with Diomedes arming, in the background,as may be judged from the imperfect oiocu (:oc). But then the poet:cc o c:t on Tpctooiv tv ,pcutvcioiv tuiytv (Il. ,.:c,).::This technique of implicity conceals a symmetrical structure: the three groups consist of threeheroes each (Menelaus, Ajax maior, Idomeneus; Agamemnon, Nestor, Odysseus; Diomedes, Ajaxminor, Meges). But the four heroes who have been called on in the background remain passive asthey are not mentioned again in the narrative.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013The Doloneia revisited ::,switches to the aorist tense (:o: tnstv), and tells us what else Merionesgave to Odysseus. So we have two simultaneous actions which are explicitlymarked as taking place at the same time, but which are described one afterthe other.Homer avoids this pattern, as we can see in the only other instance ofan extended double arming scene, in Iliad ,: rst the narrator tells us inthe aorist tense how Paris puts on his arms one after the other:co:cp c , uq cucioiv toot:c :tytc sc,oc, Atcvopc,, Ltvn, tcoi, n0scucic.svnuoc, utv tpc:c ttpi svnuoiv tnstv . . .(,.,:,c)and afterwards we just get the summary remarkc, o c0:c, Mtvtcc, pnc, tv:t touvtv.(,.,,,)and in the same way, Menelaos was putting on his armswhichmeans that nothing remarkable needs to be said of his arming becauseit is identical with Paris arming (c, o c0:c,) and takes place in thebackground (touvtv, imperfect). Homer avoids describing simultaneousactions even when he signals that they do take place, but prefers to presentthem as foreground and background. The Doloneia poet, on the otherhand, enjoys breaking this rule and puts his nger on his own violationsof the rule.The parallel actions continue. When Diomedes and Odysseus havestarted on their way across the battleeld towards the Trojan camp, thenarrator switches to the Trojan side where Hector starts an assembly withthe same goals as the Greeks:coot utv coot Tpcc, ,nvcpc, tcotv Ls:cpt0otiv, cuuoi, sisnost:c tv:c, pio:cu,,cooci tocv Tpccv n,n:cpt, not utocv:t,,:cu, c ,t ou,sctoc, tusivnv np:vt:c cunv(:c.:,,,c:)By now we have learnt that the Doloneia poet likes to step back in timewith his narrative. So the phrasing coot utv coot makes us assume thatthe Trojan assembly takes place at the same time as the Greek one.::Ourassumption is conrmed a little later: when Dolon nally ees from the::So Rengakos (:,,,: o;), with reference to schol. A b ad :c.:,,: coy c, n :cv ttcv tyti:i,, c0:c sci :c tp,uc:c. co ,cp tpctnuc:cv non :cv ttpi Oouootc sct :cu,tpcccu, c Ls:cp, c sc cv scipcv sci c A,cutuvcv.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013::o georg danekGreeks, he gets almost as far as the ships. This makes us conclude thathe has started from his post at the same time, at least, as Diomedes andOdysseus;:,in other words, the poet has stepped back in time, a lasttime.After all this said, my conclusion is short: the Doloneia poet not onlysystematically violates Zielinskis Law, but demonstrates that he does sodeliberately. He differs from the Iliad poets style not for lack of poeticmastery, but because he wants to do so. I see no reason why the poetof the Iliad would have taken so much trouble to avoid this in the othertwenty-three books just to do it in one and only one book, again and again.The Doloneia poet is not identical with the poet who is responsible for theuniform style of the Iliad. Howmay we use this result for evaluating the relationship between the Iliadand the Doloneia? If we were to deal with the work of two authors wholived in a stable literalized society, the case would be simple: the poet of theDoloneia added a text segment of his own to the text of the Iliad which wasthe product of a different author. But how can we be certain that the text ofthe Iliad had already won a stable unchanging shape at the time when theDoloneia was added? Can we be certain that at that time the Iliad was nolonger subject to the process of permanent modication and adaptation,which oralists claim is a typical feature of purely oral traditions?:How canwe exclude the assumption that the author of the Iliad we have was justthe singer of its nal version which was xed down in writing maybe thePisistratean singer who was responsible for the addition of the Doloneia,too? The question, in other words, must be: was the Doloneia added tothe Iliad at a point when the Iliad had already been written down, or ata point when it was still passed on orally and thus subject to continuingchange by the singers?In order to exclude the strong oralist model I will show what suchan addition looks like in the predominantly oral South Slavic tradition.What happens if an illiterate singer of tales takes over a specic song froma specic identiable source and makes it part of his personal repertoire,while adding a substantial part of his own? Inwhich ways does the model getadjusted, and in which way does the additional part get integrated into the:,The scholiast (:c.:,,) sees this as proof of the fact that the two assemblies take place simultaneously:c0:c ,cp sci tcu:c, ouuttoc0v:ci c tto:cutvci.:See now Colakovi c (:cc;b), who postulates a substantial difference between traditional andpost-traditional singers, but assumes that both types of singers adopt, i.e. change, their modelssignicantly.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:50:54 WEST 2013. Books Online Cambridge University Press, 2013The Doloneia revisited ::;narrative, concerning both stylistic integration and narrative adjustmentto its context?I take my examples from three songs of Avdo Me dedovi c.:,In each case,Me dedovi c uses a source which we can read and control today, but addsa substantial part to the plot. The three sources are of varying characters,but Me dedovi cs method of supplementing always remains the same. AsMilman Parry recorded all three songs as a kind of scientic experiment,I will comment on the prehistory of the songs and the circumstances oftheir recordings.Our rst example is taken from a song called Be ciragi c Meho. Whileworking with Me dedovi c, Parry made sure that he did not knowthis specicsong, i.e. that it was not part of his repertoire. Then he asked another goodsinger, Mumin Vlahovljak, to perform this song in Me dedovi cs presence.Immediately afterwards he asked Me dedovi c to sing the same song afterhaving heard it just once. Me dedovi c agreed and, without preparation,sang the song sticking closely to the plot of his model, but expanding thenarrative from Mumins :,:, lines to o,,:, lines. He achieved these biggerdimensions chiey by means of ornamentation and a more intense use ofdialogue, but made no substantial changes to the plot. Only at the end ofthe story, in a long series of scenes, he expanded on events which in hismodel text are not narrated but may be understood as implicit backgroundactions.:oAnd he invented an additional character, which forced him toadd a whole strand of actions, consisting in three short scenes which are,however, well interwoven with the main narrative.:;As far as sketched out above, all this can be judged from Albert LordsThe Singer of Tales, who in an appendix presents a detailed comparison ofthe two versions.:Only recently Me dedovi cs version was published as anonline edition of the transcript of the original audio tapes, available in thebeautiful handwriting of Parrys assistant Nikola Vujnovi c.:,Thus I couldread the text of Me dedovi cs version and assess, apart from the narrativestructuring, the style of his retelling. Now it springs to ones eye that thissong as a whole is at in its wording, and not concentrated in its narrative:,For the relevance of Me dedovi c for Homer studies see now Colakovi c (:cc;a), with the Introductionof Robert Fowler (vol. :.:,:). Colakovi c and Rojc- Burkert (:,;: ,,c) succinctly sets out the weakness of the widespread assumption that theopportunity to hear both epics in full was offered at the Panathenaia: To recite the whole of theIliad alone, not to mention the Odyssey and all the other works still attributed to Homer, would takethirty to forty hours, more than the time available for all the tragedies and comedies at the GreatDionysia, which clearly was the more important literary event in Athens. Rhapsodes could onlyproduce selections from the huge thesaurus that remained in the background. The Panathenaic lawof which we hear from Lycurgus (Leoc. :c:) and Diogenes Laertius (:.,;) was simply meant to ensurea proper order of recitation in the performance of selected episodes.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy ::,the Iliad. But the subject matter of these books is better classied astravellers tales. Distance in an age when there were numerous blanks onthe map made credible the Anthropophagi and men whose heads do growbeneath their shoulders (Shakespeare, Othello I iii), along with Sir JohnMandevilles vegetable lamb and many other marvels. In Herodotus timean adventurous traveller should be prepared to encounter ying and two-headed snakes, grifns, monocular pastoralists, epidemic lycanthropy, andpeople who slept for half a year. Exaggerated reports of the dangers to befaced on the next stage of a journey have often led explorers to turn back;in particular, rumours of cannibalism as a socially approved practice, outof all proportion to its actual occurrence, have been a powerful deterrent.,Odysseus encounters in books ,:: test to the utmost his resourcefulnessand endurance, the qualities particularly needed for successful venturesin strange environments, and thus peculiarly appropriate in the age ofcolonization. The storm which drives Odysseus contingent westwards andoff the map (,.o;ff.) thus brings about a much more challenging homewardjourney than the realistic itinerary, via Crete, Egypt, and Thesprotia innorth-west Greece, described in the cover-stories which he tells on hisreturn to Ithaca (:.:,,ff., :;.:,ff., :,.:;:ff., :;cff.; cf. Eumaeus referenceto a report of Odysseus repairing his ships in Crete (:.,;,)) and bettermatching the proem: tccv o vpctcv otv co:tc sci vccv t,vc(:.,). I believe that these cover-stories are the relics of an option whichthe poet discarded in favour of the stranger adventures which constitutebooks ,::.:cMenelaus could be given an interesting homeward journeyby way of Crete, Egypt and Phoenicia, while Odysseus is taken to terraincognita.Within this section book :: ts oddly. If books ,, :c and :: representsecond thoughts, we have third thoughts in book ::. Here I cannot avoidrepeating old arguments advanced by the analysts.::My purpose is to argue,Cf. Privitera (:cc,: :;): Ci` o che oggi, per gli studiosi del folk-lore, ` e una aba, era per Odisseoe per i Feaci lignoto, il mondo non frequentato dagli uomini, ma con gli uomini e con gli d` eisaldamente connesso. Omero non ha mai pensato che Odisseo si fosse perduto nel mondo dellaaba: si era perduto in un mondo sconosciuto e remoto, ma reale, posto ai margini del mondofrequentato dagli uomini.:cSee S. West (:,:a, :,:b: lxxxiiixc). This approach was pioneered by Woodhouse (:,,c: :,,::o,o), though he weakened his case by presenting the hypothetical earlier version as historical,the real experiences of the real Odysseus on the way home from Troy. The theory has recentlybeen revived: see Reece (:,,). A brief but stimulating exploration of the topic by Colin Hardie(:,;o), published in a Festschrift, failed to attract much attention.::Well set out by Page (:,,,a: ::,:). The recent monograph by Tsagarakis (:ccc), though it offersseveral useful observations, fails to deal adequately with the most serious problems; see furtherHaubold (:cc:), Danek (:cc,).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013::o stephanie westthat this episode is not the work of a later composer, but that the featureswhich once fuelled the case for multiple authorship throw some light onthe poets procedure in the construction of his long epic.Obvious problems arise from the loose connection of this episode withthe surrounding narrative. Most serious is the lack of adequate motivation.::Circe responds to Odysseus request for leave to go home with the newsthat he must rst go to Hades and consult Teiresias, information to whichhe reacts as if it were a death sentence. Only after lengthy instructionsabout the route and ritual procedure (:c.,c,) does she give a reason.Teiresias will give essential guidance on the route to be followed home toIthaca: cocv sci ut:pc sttcu | vco:cv , c, tti tcv:cv ttotciiyuctv:c (:c.,,,c).:,Theban legend had made Teiresias familiar to theOdysseys audience, topographical knowledge is seen as one of the skills tobe expected in a prophet,:and it is a sign of Odysseus distinction that,though without the advantage of any Theban connection, he will be ableto consult such an authority.Odysseus now rouses his men, rather brusquely (:c.,,c). The narra-tive of their embarkation does not run quite smoothly, being interruptedby Odysseus account of the death of Elpenor,:,who was not very brightor particularly brave, and having gone to sleep on the roof while drunkgot up in a fuddled state and fell off, with fatal consequences (:c.,,:oc).:oOdysseus surprise when he encounters Elpenors ghost awaiting admissionto the underworld (::.,:) indicates that he had not realized that Elpenorwas missing when he left Circes island; what is here related about thecircumstances of the young mans death is to be understood as learnedlater, though the poet does not make this immediately clear. While we mayacquit Odysseus of neglect of funerary rites, we might judge him negligentin that, with only one ships contingent under his command, he failed tonotice that he was short of a man. But Elpenor has an important narra-tive function in anchoring book :: to its surroundings; his fate eases thetransition from the world of the living to that of the dead and his ghosts::As with Telemachus journey.:,Cf. .,,,c; Menelaus encounter with Proteus (.,,,;c) is in many respects comparable. Heis likewise advised by a supernatural female to consult a clairvoyant person, following a difcultprocedure according to her instructions, and receives not only (relatively brief ) travel advice butalso information about his lifes end.:Thus Calchas guided the Greeks to Troy nv oic ucv:covnv, :nv c tcpt 1cc, Atccv(Il. :. o,;:).:,On this passage, which looks very much like an afterthought, see further Burkert (:,,,: :,o;).:oA realistic detail; in August :cco the Times reported that fteen people had died in south-easternTurkey after falling off rooftops on which they had been sleeping.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy ::;plea for a proper funeral (::.oo;) ensures that Odysseus must return toCirces island.:;Book :: itself is a curious synthesis, consisting for the most part of necro-mantic conjuration at the edge of the world, a procedure which bringsbefore Odysseus a long parade of the great dead, but concluding withmaterial appropriate to a conventional katabasis, a descent to the under-world, with a view of the exemplary punishments suffered by the greatsinners. But the demarcation between the two is not altogether clear-cut.Such oscillation between rather different conceptions is not simple care-lessness nor indicative of multiple authorship. The poet skilfully exploits alicence not available to a writer guided by the presumed expectations of areective reader.:Odysseus necromantic ritual attracts the ghosts in swarms.:,It is perhapsinappropriate to describe anything as normal in this eerie procedure, butusually the necromancer addresses his conjuration to an individual anddoes not gain access to other spirits. This feature better suits katabasis thannecromancy. After Elpenors ghost Odysseus identies that of his mother,Anticlea (::.o),:cwho, as he now learns, has died since he left Ithaca.But his interview with Teiresias must come before all other considerations.Teiresias does not need to be told Odysseus purpose. He immediatelyhighlights the expectation of danger arising from Poseidons anger, the seri-ousness of which Odysseus might be inclined to underestimate after his yearof rest-and-recreation on Circes island. But as regards Odysseus home-ward journey he concentrates on warning of the dreadful consequences tobe expected if Helios cattle on Thrinacia come to harm. We note thatTeiresias does not forecast what will happen; he sets out alternative out-comes. The comrades who assisted in his necromantic sacrices, Perimedesand Eurylochus (:,), are now forgotten; the homeward journey would verylikely have been rather different if they too had overheard Teiresias solemnwarning, but once Elpenors ghost disappears Odysseus is treated as if hewere on his own. However, Teiresias is quite certain that back in IthacaOdysseus will nd his wife beset with suitors, who must be killed. After:;Some scholars have seen an aetiological signicance in Elpenors role. The old conjecture ofWilamowitz and Von der M uhll is very tempting that the motif originally had an aetiologicalmeaning and stems from the Argonaut legend; for Elpenor demands a monument in memory ofhimself (l ;,ff.) as if this could be the origin of a future city. The monument motif goes well with asource that provided the motif of the journey to the land of the dead (Kullmann :cc:c: :,,c).:Considerable caution must therefore be exercised if this text is treated as a source for archaic Greekideas about the afterlife.:,Odysseus evocation of Teiresias is well discussed by Ogden (:cc:: :;,:).:cThe name occurs only here: what is it supposed to mean?Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013:: stephanie westthat, Odysseus must undertake a journey overland to propitiate Poseidon.That satisfactorily accomplished, Odysseus may expect a gentle death inold age, among a prosperous people.We must wish that Odysseus had displayed a little more curiosity aboutthe manner of his death. What is the relationship between what is said hereand the account of his death at the hands of Telegonus given in the Telegonyas summarized by Proclus (Tnt,cvc, tti n:noiv :c0 tc:pc, ttcv,tcc, ti, :nv lsnv :tuvti :nv vocv tscnnoc, o Oouootu,otc :c0 tcioc, vcipt:ci sc: c,vcicv)? This is not easily recon-ciled with vc:c, . . . nypc, uc :cc, (::.:,,). The poet whetsour curiosity with this enigmatic phrase. Eugammon, the composer of theTelegony, was not, it seems, so overawed by Homers authority that he felthis narrative must satisfy Teiresias description.Odysseus receives Teiresias instructions with remarkable composure(::.:,,),::but we may nd them surprising, since the start of the poemhad conveyed the impression that once he reached home Odysseus neednot worry any more about Poseidons hostility. Zeus has assured us, ashe and Athena plan Odysseus homecoming, that Poseidons wrath willpass: lcotiocv ot utnoti | cv yccv co utv ,p :i ouvnot:ci v:ictv:cv | cv:cv tsn:i tcv tpiocivtutv cc, (:.;;,, cf. :.:c:);similarly Athenas reassurance to Telemachus (,.:,:,) implies that oncehome Odysseus will not have to face any more travel. With this prospectof further journeyings for his hero the poet stimulates demand for a sequeland this may explain why he did not set before Odysseus return to Ithacawhatever measures might be necessary fully to propitiate Poseidon. TheOdyssey is often treated as a story with a happy ending; hence its clich e-isticdescription as the rst European novel. But Penelope, after one extendednight of renewed happiness, must wait a long time before her husband isback for good and they can both live happy ever after.We think of Poseidon as primarily god of the sea, but, as is indicated byhis titles tvcoiycv and tvvcoi,cic,, he controls earthquakes, a hazardto which the Ionian Isles are particularly exposed. Odysseus could not besupposed immune to the gods fury provided he avoided the sea. The awfulconsequences of provoking Poseidons wrath were peculiarly apparent toOdysseus fellow islanders.::Odysseus has now achieved the purpose for which Circe sent him, andmuch more. He has got some guidance regarding his homeward journey::Contrast his reaction to Circes revelation that he must journey to Hades (:c.,o,).::For specic details see Bittlestone et al. (:cc,: esp. ,::, ,::c,). Bittlestone argues that HomersIthaca is Paliki, now western Cephallenia, and that the poet was familiar with the terrain.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy ::,(though Circe herself will be able to give himmuch more detailed directions(::.,;::)). More important, he knows what he must do to make his peacewith Poseidon, a problem which called for a prophets peculiar insight. Buthe spends less time in conversation with Teiresias than with his mothersghost, who had appeared even before Teiresias. Here I believe that wehave a relic of the more realistic itinerary which brought Odysseus homeby way of Thesprotia, where there was a famous oracle of the dead, towhich, according to Herodotus (,.,:n:), Periander, tyrant of Corinth,sent a delegation to consult the ghost of his murdered wife Melissa.:,ForOdysseus his mothers ghost, reliable and devoted to his interests, would bean ideal source of information regarding the situation in Ithaca at the timeof her death. Of course, what he learns from her here, some eight yearsbefore he gets home, is of little practical use to him with the epics presenttimescale, and Athene must bring him up to date (:,.,c,ff.). Odysseusencounter with his mother now serves a different purpose, and in theirmutual affection we see an aspect of the hero previously little in evidence.The restraint which he shows in postponing this reunion until he has talkedwith Teiresias is very much in character. He displays such self-control, ina heightened degree, when he delays making himself known to Penelopeuntil he has disposed of the suitors, and because we have already observedhis behaviour here we shall admire his strength of will and not thinkhim unfeeling. Such recycling of components designed to serve a differentfunction in the narrative is highly characteristic of the Odyssey. We should,however, note that Odysseus ignores what he has just learnt from Teiresiaswhen he asks his mother whether Penelope has remarried (::.:;;,); if heis to nd her beset by unscrupulous suitors on his return (::.::o:c), thequestion is silly.Consultation of Teiresias provides a pretext for Odysseus to follow theexample of Orpheus and, more importantly, Heracles; the poet more orless acknowledges the latter as his model in Heracles speech to Odysseus(::.o:;:o). But it is a pretext. The procedure which allows Odysseus toconverse with the great Theban prophet is necromantic; Odysseus doesnot need to pass into Hades realm to achieve his objective. The lack ofa sufcient motive for visiting the world of the dead is most apparentin what follows Odysseus conversation with his mother, the parade of:,Cf. Pausanias (:.:;.,): ,, ot :, Ototpc:ioc, to:i utv tcu sci cc tc, cic, tpcv :t Aic,tv Acocv sci tpc :c0 tc0 qn,c, tpc, ot : Kiyp iuvn :t to:iv Aytpcuoic sccuutvnsci tc:cuc, Aytpcv, pt ot sci Kcsu:c, 0ocp :tptto:c:cv. Ounpc, :t uci ocst :c0:ctcpcsc, t, :t :nv cnv tcinoiv tc:cuoci :cv tv Aiocu sci on sci :c cvcuc:c :c,tc:cuc, tc :cv tv Ototpc:ioi toci. See further Hammond (:,o;: o,o).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013:,c stephanie westfourteen noble (or notorious) female ghosts who present themselves beforehim(::.::,,,c). The transition is awkward, particularly since Anticlea hasurged Odysseus to leave without delay. No explanation is offered for hisfailure to follow her advice. Curiosity apparently gets the better of him.:The womens stories are told, on the whole, so briey and allusively thatthe poet must have assumed this material to be familiar to his listeners.:,Some relationship between this section and the Hesiodic Catalogue ofWomen is indicated by the similarity between Poseidons farewell to Tyro(::.:,,c) and Hesiod F,:; but it is difcult to draw a more deniteconclusion about this apparently random selection.:oThese women haveno particular relevance to Odysseus, though Anticleas status is enhancedby association. We are surely meant to admire his ingenuity as a storytellerin thus elaborating material with a particular appeal for Queen Arete, whoresponds appropriately by urging the company to make generous gifts toOdysseus. We may reect on the skill with which the poet borrowed fromoral hexameter poetry of a rather different type to enrich his narrative withmaterial in keeping with the greater emphasis on women characteristic ofthe Odyssey, the song celebrating Penelope (as Agamemnons ghost saw it(:.:,o)).This intermezzo instructively reects the reality of the poets profession:some skill lay in choosing a suitable point for a break in an extendednarrative, with the suggestion that the performance has gone on longenough, so that a further incentive is appropriate if it is to continue. Thepoet of the Odyssey brings his craft to our notice in a manner quite alien tothe Iliad; here we should observe the form taken by Alcinous complimentto Odysseus: oci o tti utv ucpqn tttcv, tvi ot qptvt, toci, | u0cv oc, c: cioc, ttio:cutvc, sc:ttc,, | tv:cv Ap,ticv otc : co:c0snotc u,p (::.,o;,).:;The blurring of the distinction between truthand verisimilitude should be noted.The parade of famous women also serves to delay what we are eagerlyexpecting, Odysseus reunion with his dead comrades from the TrojanWar. It is rather characteristic of the poet of the Odyssey to postpone whatis expected, a relatively naive way of heightening tension and increasingsuspense, observable at the outset in the delay in bringing Odysseus himself:As with his exploration of Cyclopean territory (cf. ,.:;,o, ::,) and his aborted reunion withAjax (::.,oo;).:,As is implied by Antinous allusion to such a tradition (:.:::c); see further Danek (:,,b: :,:,c:).:oOsborne (:cc,: :o:;) well highlights the very different tone of the Odysseys catalogue, in particulara more general suggestion of female responsibility; see also Rutherford (:ccc: ,,o).:;Eumaeus similarly stresses Odysseus narrative skill in recommending him to Penelope (:;.,:,::).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy :,:into the narrative and an important element in the latter part of the poemas he postpones revealing himself to Penelope.In his encounter with the war veterans we are back on more familiarOdyssean ground. The post-war fate of the heroes who fought at Troy is arecurrent theme. The Atreid paradigm, as seen from Olympus, started theaction (:.:,,);:now we hear about the affair from Agamemnons pointof view (::.,;oo). To Odysseus it comes as a shock. Agamemnon dwellson the breach of hospitality at the banquet where the butchery took place,and we now hear of the slaughter of Cassandra at Clytaemestras hands(:c::). There is a peculiar pathos in Agamemnons longing for news ofhis son (,o:), but Odysseus cannot help.With Achilles arrival (::.o;ff.) we note that the poet now envisages akatabasis rather than necromancy; Achilles ghost does not need to drink theblood of Odysseus sacrices to recognize and converse with him, and hisgreeting conrms that Odysseus has now penetrated the world of the dead:oyt:it, :it: t:i utcv tvi qptoi unotci tp,cv; | tc, t:n, Aocootsc:ttutv, tvc :t vtspci | qpcott, vcicuoi, pc:cv tocc scucv-:cv; (;o). Odysseus conversation with Achilles is unforgettable, aboveall for Achilles unexpected reaction to Odysseus admiring estimate (:o) of his status among the ghosts: un on uci vc:cv ,t tcpcoc, qcioiuOouoot0. | cuciunv s ttpcupc, tcv n:tututv c, | vopi tcpsnp, un ic:c, tcu, tn, | n toiv vtstooi sc:cqiutvcioivvootiv (,:). Remembering that in the Iliad (,.:c:o) Achillesknew he could choose between a short life bringing everlasting renownand a long life in obscurity, his violently angry response sounds like anadmission that he made the wrong choice: Odysseus, the survivor, has hadthe better fate.Achilles language is strangely untraditional, and we might wonderwhether the poet is rather emphatically distancing himself from a rosierpicture of the heros fate after death such as was offered in the Aithiopisof Arctinus of Miletus, in which, according to Proclus summary, Thetissnatched him from the funeral pyre and conveyed him to Leuce, the WhiteIsle (ts :, tup, n Ot:i, vcptococ :cv tcoc ti, :nv Atsnv vocvoicscuiti). It is frustrating that we do not know what Arctinus actuallysaid. The Black Seas only proper island, c. , km east of the northernmouth of the Danube, and now in Ukrainian territory, was in antiquityknown as Leuce, well qualied for the name by reason of its white cliffs.:,:Cf. :.:,,cc, ,.:,,, ,co:c, .,::,;, :,.,,, :.:,,:c:.:,Ostrov Zmeinyy, the Island of Serpents. The recently published monograph by Okhotnikov andOstroverkhov (:,,,) includes photos and a plan of the island. A problematic Athenian black-gureDownloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013:,: stephanie westHere Achilles was to enjoy a long-lasting hero cult, under the protectionof the Milesian colony of Olbia.,cBut did the Milesian poet have this realisland in mind, or did he envisage a mythical paradise in the northernsea, comparable to Elysium and the Isles of the Blessed, and subsequentlyidentied with Leuce by the colonists of Berezan and Olbia? Was Achillestranslation to this remote uninhabited island Arctinus own invention andthe Aithiopis the inspiration of the cult?Alcaeus reference to Achilles as lord of Scythia (F,,) indicates thatthe cult was already well established among the Greek colonists of hisday. But legends do not develop everywhere uniformly; at Miletus itselfthe cult of Achilles attracted no following. I do not see how we can tellwhether the Odyssey reects unease that, for all his distinction as a warrior,there awaited the half-divine Achilles no better fate post mortem than theshadowy existence appropriate to humankind in general, or offers a protestagainst a development out of keeping with the stern philosophy of heroicepic.,:In the second Nekuia, surely the work of a later poet, Achilles isundoubtedly in Hades (:.:,,;).,:We cannot use this passage to clarifythe relationship between the Odyssey and the Aithiopis.,,Achilles concern for his father (cf. Il. :.,c:) and son contributes tothe afrmation of family values which is an important element in book:: (by contrast with :c and ::). Odysseus can give no news of Peleus, butoffers a heart-warming (and tactful) report on Neoptolemus,,and we seeAchilles ghost stalking off through the elds of asphodel ,ncovn c cucv tqnv piotist:cv tvci (::.,c). In the dead warriors interest in thesons who have grown up unknown to them we see variations on the themedeveloped most fully in Telemachus role.We see why the poet quietly abandoned the necessity for the ghoststo drink from Odysseus trench before they could recognize and speak tohim as the focus shifts to Ajax, standing somewhat apart, still harbouringamphora, dated c. ,c, now in the British Museum (LIMC i.2 s.v. Achilleus, plate ,c:), depicting awinged warrior ying across the sea (there is a ship below), watched by a raven (Apollos bird), hasbeen thought by some to depict Achilles translation northwards; but it might be better connectedwith his role as helper to those in peril on the sea, on which see Arrian, Peripl. M. Eux. :,.,cSee further Hommel (:,c), Hooker (:,), Hedreen (:,,:), Bravo (:cc:a: ::,,), Burgess (:cc:::oco, :cc,: ,::), Buiskikh (:cc:), Hupe (:cco).,:Special treatment for Menelaus might be interpreted as basically a privilege granted to Helen asZeus only mortal daughter.,:This strangely belated encounter between the ghosts of Agamemnon and Achilles was most likelyborrowed from or modelled on an episode in the Cyclic Nostoi in which, as we learn from Pausanias(:c.:.;), a scene in Hades gured. On the end of the Odyssey see further S. West (:,,).,,On the relationship between the Aethiopis and the Iliad see M. L. West (:cc,c).,It would have given Achilles no joy to hear of Neoptolemus slaughter of Priam at the altar of ZeusHerkeios.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy :,,resentment against Odysseus over the Judgement of Arms. Odysseusimplores the ghost to come and talk to him, but the other makes noanswer, and leaves without a word. Still, it might have been otherwise:tvc y cuc, tpcotqn styccutvc,, n stv t,c :cv | uci nttuuc, tvi o:ntooi qicioi | :cv ccv uyc, iottiv sc:c:tvnc:cv.(,o,;) Page comments tartly: The silence of Ajax, then, was accidental,imposed by the requirements of a timetable. Given another moment hewould have spoken. And Odysseus plea, that Ajax might forgive and speakto him, was nothing but formal politeness: Ajax was about to reply, butOdysseus is in a hurry, he cannot wait for the answer; another day, perhaps,but just now time is pressing (:,,,a: :o;).The weakness of the transition, motivated simply by Odysseus curiosity,is obvious.,,We are not actually told that Odysseus has left his sacricialtrench to stroll round Hades and view the traditional Underworld gures,but the necromantic framework has been abandoned. In Heracles greetingwe see the culmination of the poets efforts to enhance his heros status.,oHeracles recognizes that they have much in common: c oti, n :ivcsci ou scscv ucpcv n,nti,, | cv ttp t,cv cyttoscv ot co,c,nticic (::.o:,).,;On his mission to get Cerberus Heracles had thehelp of Hermes and Athena: Lputic, ot u tttutv iot ,cuscti, Anvn(o:o; cf. Il. .,o:,). Odysseus has managed his visit to the world of thedead without apparent divine support. Heracles acknowledgement thatOdysseus career has much in common with his own is highly signicant.Endurance, determination and resourcefulness win for the trickster fromthe Western Isles the respect of Zeuss son, the archetypal hero.,Odysseus was hoping to meet more of the ancient heroes when his visitwas brought to an appropriately uncanny conclusion: c tpiv tti tvt,tipt:c uupic vtspcv | ny tottoi tut ot ycpcv otc, npti, | un uciIcp,tinv stqcnv otivcc ttcpcu | t Aoc, ttutitv ,cun ltpot-qcvtic (o,:,). The weird atmosphere evoked at the start of the episodeis thus revived. The scholium on ,o (very likely displaced from two lines,,Goold (:,;;: ,o) interestingly compares the conclusion of the duel between Hector and Ajax(Il. ;.:o,::): What the poet is doing in these two passages . . . is to effect a juncture betweentwo blocks of different material. He does not want to drop Ajax and abruptly introduce Minos,nor does he wish to kill off inexpendable heroes, but has elected to secure a transition in the onepassage and a suspension in the other by means of a contrary-to-fact apodosis: from a sympatheticviewpoint no one could reasonably imagine that Ajax was willing to forgive Odysseus or that theduellers-to-the-death were really shamming.,oThe problems created by ::.oc: are notorious; already suspected in antiquity, they are bestregarded as an interpolation.,;Their afnities are well brought out by Finkelberg (:,,,).,Presented in a rather different light at ::.::,c.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013:, stephanie westearlier) tells us that the passage describing Odysseus underworld sight-seeing (,oo:;) was judged spurious (almost certainly, by Aristarchus):vctt:ci utypi :c0 c, titcv c utv coi, tou ocucv Aoc, toc (o:;).,,Persephones eerie intervention would have made a ne ending to Odysseusencounter with Ajax shade.The problems of book :: are familiar enough, and I have not attemptedto gloss over them. The situation in some ways resembles that of Iliad,. There both the way in which the book is worked into the poem andthe way in which Phoenix is worked into the book have long seemed tochallenge most severely a unitarian approach. Yet in this book we haveso much that goes to the heart of the Iliad and illuminates Achilles thatwe cannot happily label it a late interpolation as we may Iliad :c. BryanHainsworth well sums up: Reinhardts hypothesis . . . that the compositionof our Iliad was a long drawn-out process with repeated revison over manyyears rests on a persuasive premise: the poem cannot have been created in amoment of inspiration. It is in such places as book , that we have a glimpseinto the workshop of Homer.cThe difculties which once fuelled thearguments of analysts are better seen as clues which may reveal somethingabout the poets methods and view of his subject. The production of awritten, relatively xed, text of a lengthy composition was still a novelty.We can, I believe, roughly trace in book :: four strata in the Odysseyscomposition. (My geological analogy should be supposed to allow somefolding and shifting; the strata do not invariably lie neatly one abovethe other.) The earliest involves Odysseus conjuration of his mothersghost, at the Thesprotian nekuomanteion, an episode belonging to themore realistic nostos through known regions outlined in his cover-stories.The poet has left a tantalizing indication that the audience for that narrativewas originally Penelope. Anticleas ghost concludes her utterance with thewords :c0:c ot tv:c | o, vc sci ut:ctiot :t ttoc ,uvcisi(::.::,), natural enough if Odysseus is nowaddressing his wife, otherwisecuriously pointless. That itinerary was discarded in favour of a journeythrough quite uncharted territory, in the course of which his dealingswith a savage ogre provoked Poseidons wrath and thus became pivotalto the plot. This is the second stratum; at this level Circe can provideOdysseus with all the advice on his route home that he needs, and it isassumed that once home he has nothing more to fear from Poseidon. But,,Cf schol. Pind. Ol. :.,;; see further Garbrah (:,;).cHainsworth (:,,,: ,;); see also S. West (:cc:). It is not irrelevant that it is in book , that we have(at ,:) one of the clearest indications of the date of composition to be found anywhere in theIliad: see further Burkert (:,;o).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy :,,with the passage of time the poet saw a need for Odysseus to make hispeace with Poseidon, for which specialist guidance was required: hence theconsultation of Teiresias, the prophet par excellence. Ghost-raising does notin itself call for a journey to the world of the dead, but a visit to Hades hadbeen Heracles supreme exploit, and such an adventure would enhanceOdysseus status. The insertion of the greater part of what we know asbook :: entailed slight changes to the end of book :c (,c,;) and to thestart of book :: (:,,). (But the poet allowed Odysseus to appear to haveforgotten what he had learned fromTeiresias about Penelopes suitors whenhe got back to Ithaca (:,. ,,,).) Finally, as the last stratum, we have whatfollows Odysseus encounter with Ajax, culminating in his meeting withHeracles (::.,ooo,:); here, unquestionably, the framework is a katabasis,and that is how Circe viewed their adventure on their return: oyt:ici, cccv:t, otnt:t ocu Aiocc, | oiocvtt,, c:t : cci ctc voscuocvpctci (::.:::).In book :: we get an unusually strong sense of work-in-progress. In thisessay I have assumed a much greater element of innovation and creativityon the poets part than is nowadays commonly supposed, encouragedby his own emphasis on the importance of novelty (:.,,::), which issupported by Phemius pride in his own originality: co:coiocs:c, o tiui,tc, ot uci tv qptoiv cuc, | tcv:cic, tvtquotv (::.,;). Modernstudy of traditional oral epic has emphasized its conservatism, and theenvironments in which such traditions survive or are revived do notencourage innovation. But it cannot always have been so. Whoever had theidea of giving the dignity of hexameter verse to Odysseus encounter withPolyphemus (whether the poet of our Odyssey or another) could not haveproceeded by simply adapting elements from roughly similar narratives;too much here is peculiar, without close congeners in heroic narrative. Inbook :: I believe we can trace more clearly than elsewhere the sequence inwhich the poets ideas developed.If this analysis is on the right lines, it may be worth looking for indi-cations of similar developments elsewhere in the Odyssey. This is not theplace to set out the grounds for believing that it was the possibility of mak-ing a written record that stimulated the composition of long epics such asour Iliad and Odyssey. Those who had been trained in the oral poets artwould not change their style or narrative technique because script couldnow offer a degree of permanency; they did not envisage reective solitaryreaders who might be troubled by inconsistency or misdirection whichwould not worry a listening audience. When oral theory was a novelty,many oddities which had troubled analysts and inspired some amazinglyDownloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013:,o stephanie westingenious defences from unitarians appeared sufciently accounted for asnatural elements in a style which did not nicely weigh every word. Thisapproach could too easily lead to a lack of attention to detail. We shall dobetter to consider the ways in which is revealed a poets adaptation of histechnique to meet the demands of a lasting written record.We too readily assume that in antiquity the production of a written textwas as denitive an act as printing is nowadays. But the unmarked endingsof very many ancient works reect a certain indecisiveness about formallyconcluding. The end of an episode is marked as such, but the authorleaves open the possibility of going further. The last chapter of HerodotusHistories (,.:::) well exemplies this feature.:Of course, extension at theend of a work is a more obvious idea than expansion midway, but (literal)cutting and pasting presented no great difculty (though systematic minorcorrection at a series of points in the narrative was more demanding), andso long as the roll was the usual format, alteration and expansion werephysically easy.:Writing could give durability to what was previouslyephemeral, but did not preclude improvements. Modern conditions ofpublication make it highly unlikely that a literary work will be disseminatedto the reading public before its author judges that it has reached a denitiveform; if death overtakes the writer before nishing, that circumstance isunlikely to be overlooked. But book production was very different beforethe invention of printing.If the composition of the Iliad and Odyssey extended over many years decades, even questions of mutual inuence, interference and intertextu-ality in early Greek hexameter poetry gain added interest but become muchharder to answer. Singers enjoy a place in Eumaeus list of peripatetic pro-fessionals (:;.,:,); in archaic Greece this is more likely to reect the wayof life normal for a singer who made his living by his art,than the situationof Phemius and Demodocus, attached to a court or wealthy household.Though we may doubt whether our poet and Hesiod really met on Delos(Hesiod F ,,;), it is pleasing to speculate about opportunities for singersto become acquainted with one anothers work before texts circulated.But once we take this scenario seriously it becomes much more difcultto assess what might look, at rst sight, like evidence of the inuenceof one work on another; questions of intertextuality become much more:See further van Groningen (:,oc: ;c:), S. West (:cc;).:The situation was interestingly different where the normal writing material was the clay tablet; oncebaked its text was unalterable.,Or perhaps exercised his skill, in the evenings or on holidays, as a useful sideline to a peripateticday-job.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:05:09 WEST 2013. Books Online Cambridge University Press, 2013Odyssean stratigraphy :,;complicated. We can trace connections between our Odyssey and a widerange of other hexameter poetry not only with poetry dealing with theMatter of Troy (Memnonis/Aithiopis, Little Iliad, Iliou Persis, Nostoi) butalso with the Argonautica, the Catalogue of Women and poetry celebratingHeracles. With some of these titles we may be reasonably condent thattexts already existed, but for others the poet more likely drew on whatexisted only in memory and performance. The poet was unmistakablyin debt to Argonautic poetry, These allusions help to expand the range of human possibilities the poem embraces and the rangeof ethical judgements it invites, . . . [the Odysseys mythological allusions] contribute to the sense thatthere are other ways to evaluate the individual achievements and social institutions that the poemrepresents (Schein :cc:: o).,Odysseus does not even take part in the archery contest in the games for Patroclus; Meriones andTeucer are the contestants (Il. :,.,,). Meriones lends Odyssey his bow in the Doloneia (:oc), butOdysseus has no use for it. On archery in Homer and Odysseus the archer, see Dirlmeier (:,;c:o,;:), H olscher (:,: o;;:), Danek (:,,c: :,:,).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013:c ivind andersenestablishes the hero in that capacity. Whatever Odysseus the bowmanmay owe originally to tales about Odysseus the unheroic trickster, hisbowmanship at Troy as it is presented here in book enhances Odysseusheroic stature. Odysseus boast is the poets post festum amplication of hisOdyssean archer in the light of what will happen at his homecoming.oOdysseus is only the next best of his generation, though. There is nobeating Philoctetes. It is admittedly not so easy to envisage the two of themghting together as archers during the siege of Troy. The Iliad seems toreckon with the tradition according to which Philoctetes was brought toTroy in the nal phase of the war (cf. Il. :.;::,).;The dening featurefor Philoctetes status as the greatest archer before Troy is his role at thesack of the city. Here in book , however, Philoctetes is not associatedwith any decisive feat, but appears as a generally good archer, whenever weAchaeans shot with the bowin the Trojan country (.::c). For the Odyssey,of course, Odysseus is eminently the t:citcpc,. As Philoctetes in theprevailing version will have been absent for most of the duration of thewar, until he was nally fetched from Lemnos, we again can observe howthe poet has Odysseus convey a picture that suits the immediate context,although it hardly tallies with the received story. What the Odyssey offershere is not a glimpse of earlier traditions or lost poems, but a reection ofthe action of the Odyssey itself.In addition to comparing himself to Philoctetes, Odysseus contrastshimself with two others. ForI will not set myself against men of the generationsbefore, not with Herakles nor Eurytos of Oichalia,who set themselves against the immortals with the bow, and thereforegreat Eurytos died suddenly nor came to an old agein his own mansions, since Apollo in anger against himkilled him, because he had challenged Apollo in archery.(Od. .::,, tr. Lattimore)The context implies that Odysseus could stand comparison to Heracles andEurytus in archery. The fact that the two of them were good archers goeswithout saying; indeed, if they had not been good archers, they would nothave competed with the gods. The fact that Heracles and Eurytus competed in archery even with the gods is mentioned in therst instance to prove how skilled they were with the bow (Garvie :,,: :, on Od. .::).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013Heracles in the Odyssey ::conduct of the older heroes, which for Eurytus had fatal consequences.The mentioning of the older heroes thus is transformed into a warningexample.,Odysseus has made a point of himself standing far out ahead ofall others such as are living mortals now and feed on the earth (.::::); hewill not compete even with men of earlier generations, let alone with theimmortals. It may also be signicant that Odysseus had just issued a generalchallenge to the Phaeacians, to all of them except Laodamas himself, forhe is my host; who would ght with his friend? (.:c;). There is apreoccupation here, on behalf of poet and hero, with proper conduct.:cItis hardly accidental that Odysseus introduces himself as the man with thebow within a morally charged context involving guest-friendship. I wouldagree with the scholiast (to .::,) that the present passage foreshadows(tpcciscvcuti) the massacre of the suitors.::Archery at Troy is not veryrelevant in the Phaeacian context, where no archery has taken or is goingto take place. Odysseus otherwise refers to athletics that is actually goingon: He is willing to compete in boxing and wrestling and the foot race(.:co), and he refers to contests generally (.::,). Archery does not gureon the programme in Scheria; the prominence that it achieves in Odysseusspeech refers us forward to his wielding of the bow amongst the suitors inIthaca.::Both Heracles and Eurytus will have been well established as bowmenfor poet and audience alike.:,But to which story or stories does Od. .::,refer the listener? For Heracles competing with gods we have no furtherevidence. His vying with the gods simply is asserted here and it will, Isubmit, have been accepted accordingly. Heracles is the sort of hero aboutwhom a poet could easily assert, and an audience would readily believe,such things. After all, he did ght with Apollo over the tripod in Delphi,,Odysseus implies that he himself is more sensible (Schein :cc:: ,).:cDanek (:,,b: :,:) sees the contrast as being essentially between the Trojak ampfer and olderheroes.::Pace Hainsworth (:,a: ,,,) on Od. .::,: that the episode does not need the support ofso distant and incidental a comment as this. Many scholars have sided with the scholiast, e.g.Thornton (:,;c: ;) (The decisive part played by the bow at the end of the poem is foreshadowedthroughout), Dirlmeier (:,;c: ;:), Crissy (:,,;: ,c).::Odysseus mentions also throwing the spear (.::,), which equally is not on the agenda, but it isinterestingly made relevant for him as an archer: he can throw the spear further than others canshoot an arrow. The fact that the spear gures prominently in the killing of the suitors (::.o,, ::)may have contributed to the mentioning of spear-throwing here.:,Schischwani (:,,,: :,) thinks that if Eurytus were not already known as a master of the bow, hecould not have served as a comparison to the archer Odysseus, as it would be absurd to bring in anunknown person in the comparison. But it is only to the internal audience of the Phaeacians thatEurytus needs to have been known as an archer and even they would have taken Odysseus wordfor it!Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013:: ivind andersenand he did shoot at Hera, and even at Hades.:The fact that his vyingwith the gods is not elaborated upon and that it apparently did not haveserious consequences for him, as it had for Eurytus, also makes it easy toassume an ad hoc innovation in this context: a past fact is created to servethe narrative context.:,As for Eurytus, we do not otherwise know of his over-optimism inrelation to the gods. His challenging Apollo is, I presume, established as apast fact here by being told. Challenging a god within the area of the godsspecic competence and being punished for it in some relevant way is a notuncommon motif.:oThe fact that the Eurytus incident follows a typicalpattern will have made it even more easy for the poet to generate it and foran audience to accommodate it. The motif of his death by the infuriatedarcher god may even have been prompted by another tradition about himmeeting a violent death by the bow for acting unfairly (see below). Eurytusis killed by Apollo if the poet says so, just as Odysseus was a great archerbefore Troy if the poet says so. Uppermost in the poets mind is a thematiccluster of archery and of the proper use of the bow.Heracles and Eurytus, who appear together in our passage, both have aspecial link to the two allegedly best archers before Troy, whom Odysseushas just compared to each other: Philoctetes and Odysseus himself. ForPhiloctetes inherited the bow of Heracles, while Eurytus bow eventuallybecame the bow of Odysseus. It is uncertain whether or to what extentthis parallel genealogy of the bows is part of the picture here and is meantto contribute to the audiences appreciation of the passage. It may havebeen general knowledge that Philoctetes was needed to take Troy becausehe had inherited the bow of Heracles; it was the bow that Philoctetes had,not Philoctetes himself, that really was needed.:;But that Philoctetes hadthe bow of Heracles may not even have been part of the tradition at thisstage.:The bow as such is at any rate not highlighted in our passage in:Some commentators and the LfrE (s.v. tpiocivc, tpic) refer the reader from Od. .::, to Il.,.,,,ff., and it cannot be ruled out that the verb (contend with) in .::, should be translated ghtwith and not, as in .::,, compete with.:,Andersen (:,,c) develops the concept of instant past and the principle that the present hasprecedence over the past.:oOne may think of Thamyris, Marsyas, Niobe. It may be relevant that Thamyris suffered hispunishment as he came from Oechalia and Oichalian Eurytos, according to Il. :.,,o.:;Now, while Homer nowhere explicitly states that Philoctetes inherited Heracles bow, it seems clearthat both he and his audience knew that tradition well (Clay :,,: ,:); also Danek (:,,b: :,:).:Thus Gercke (:,c,: c,). Along with Heracles and Eurytus, Philoctetes is probably an old archer:Wenigstens ist dieser oder sein Vater Poias schwerlich von vornherein als Erbe des Herakles in dasEpos eingef uhrt worden: Ilias und Odyssee berichten davon nichts, und die Ubergabe von Bogenund Pfeilen zum Danke f ur die Hilfsleistung bei der Selbstverbrennung auf dem Oita ist mit dieserjung.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013Heracles in the Odyssey :,Odyssey , where Philoctetes simply appears as a generally superb archerduring the war. As for Odysseus, if one believes that the audience wasthoroughly familiar with the story of the transfer of the bow from Eurytusvia Iphitus to Odysseus, one may consider as of little account the fact thatthe transfer itself is told only in book :: (see below). But then Odysseus,who is second only to Philoctetes as an archer, did not bring with him toTroy the bow of Eurytus. Did the audience of book know that as well?And what did they make of that?:,Heracles and Eurytus joint appearance in this passage has been seen bysome in the light of the fact that the two heroes are associated in a famousstory, in which archery indeed played an important part: Heracles came toEurytus in Oichalia to compete with him (and/or his sons) in order to winthe hand of his daugther Iole; although Heracles won the contest, Eurytus(and/or his sons) would not give himIole in marriage; thus Heracles sackedOichalia and killed Eurytus (and/or his sons).:cThe story is unattestedin the Odyssey, and that Homer is unaware of this tradition, i.e. that itpostdates the Odyssey, seems to be the more commonly held view. ThusClay (:,,: ,:, n. ;c) nds that Homer seems to betray no awareness ofthe tradition surrounding the Sack of Oichalia. Danek (:,,b: :,,), on theother hand, thinks that Homer by the joint mentioning of Heracles andEurytus puts himself geradezu in Gegensatz zu einer gel augen Versionand that he seems die Geschichte vom Konikt zwischen Eurytos undHerakles um Iole regelrecht auszublenden with the addition that onemay not of course conclude from that that the poet did not know themyth.::Schein (:cc:: ,,) thinks that, by referring to Herakles andEurytos in the same line [Od. .::] and to Eurytus death at the hands ofApollo, Odysseus both alludes to and contradicts a myth that presumablywas told in the Sack of Oichalia, a version of the myth which would havebeen well known to Homers audience fromthe oral poetic tradition. I nd:,To Clay (:,,: ,,) the parallel genealogy and parallel rivalry Heracles/EurytusPhiloctetes/Odysseus suggests that Odysseus ought to be viewed as both a parallel and a rival toHeracles, but also as a contrasting gure. An elaborate comparison between Heracles and Odysseusis thus established, though its precise terms remain obscure. Crissy (:,,;: ,c) suggests that a like-ness is implied between these two characters [viz. Odysseus and Heracles], not a contrast. Surelythe relevance of Heracles to Odysseus is obvious even if one reckons with less elaborate parallelismsor inverse parallelisms.:cApollod. Bibl. :.o.:: and ;.;. References to other ancient sources in Frazers notes ad locos inthe Loeb edition. For thorough discussion of the sources and older scholarship, see Davies (:,,::xxiixxxvii) and Burkert (:,;:).::Also Davies (:,,:: xxvi, with reference to Od. .::ff. and ::.,ff.) cautions against equating un-and post-Homeric, and thus to underestimate Homers own amply documented addiction toidiosyncratic innovations in myth.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013: ivind andersenit problematic to speak of an allusion here to the bride contest with bowsbetween Eurytus and Heracles, as we are explicitly presented with a versionof Eurytus death (by Apollos hand) which does not square with that story.And I nd it even more problematic to take the mentioning of Eurytus andHeracles together here as in any interesting sense a negation of that other,untold story. It is just ignored and does not come into the picture.::It isreasonable to assume that the introduction into the poem of an Eurytus ofOichalia (.::, also Il. :.,,o and ;,c) as a great archer will owe somethingto the story that above all made Eurytus into a great archer, viz. the bridecontest at Oichalia. I would content myself, however, with the assumptionthat in some form and in some stage of its development, that story informsour passage in Book in so far as it is the basis for pairing Heracles andEurytus. Perhaps that story which included challenges and unseemlybehaviour and contests of the bow inspired the poets presentation ofEurytus as a man who behaved in a thoroughly unacceptable way, evenvying with gods.So I would refrain from (re)constructing as the telling background ofOdysseus words here a specic version of a specic story that everybodyknew and so would be referred to. The Phaeacians listening to Odysseus inthe Odyssey would know or at least they would nod knowingly, impressedby the heros name-dropping. Whatever the Phaeacians made of it, I ndit hard to believe that Homer meant his audience to think of the bows ofHeracles and Eurytus respectively in this context. Philoctetes bow mainlyis Heracles bow when it comes to the fall of Troy while here, Philoctetesis a generally good archer during the siege, and the link to Heracles bowmay not even have been established for the Homeric audience. Eurytusbowis not Odysseus bowat Troy. Odysseus boasts of his skill in archery andraises the topic of the just use of the bowwith none too subtle implications.The story of the conict between Heracles and Eurytus and the sack ofOichalia, even if it were well known, is not alluded to here by the poet ofthe Odyssey in order for it to resound.:, Heracles and Eurytus and his kin appear again at the beginning of book ::as Athena puts it into Penelopes mind to go and get the bow and grey iron::The allusion-cum-negation point of view is developed by Bruno Currie in his contribution to thisvolume, but with respect to more specic texts (hymns to Demeter) and a more cirumscribedcontext (Eleusis).:,It is quite another thing to speculate whether the story of the bride contest in Oichalia informsthe main plot of our Odyssey, as does Kirscher (:,,:), following in the steps of Gercke (:,c,). Thatwould not rule out such ad hoc glimpses of Eurytus as we get in our Odyssey.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013Heracles in the Odyssey :,to set up in the halls of Odysseus. The presentation of the bow (::.:,:),focalized by Penelope, highlights the bows signicance by revealing itsprominent provenance and its status as a token of guest-friendship. By itslength and detail and well-wrought form, the passage in itself lends weightto what is going on and signals that we are at an important juncture in thedevelopment of the plot.The bow that Penelope fetches is the one that once had belonged toEurytus and which he, dying (tcvoscv) in his high halls, left to hisson, godlike Iphitus.:Iphitus gave it to Odysseus as a token of guest-friendship when the two met in Ortilochus house in Messene; youngOdysseus was abroad to seek compensation for sheep and shepherds thathad been stolen from Ithaca by the Messenians, and Iphitus to collect somelost mares and their mule offspring. Odysseus gave a sword and a spear inexchange for the bow and arrows, but the two men never came to entertaineach other as tvci (::.:,:,, ,:,o). These parts of the excursus associateOdysseus from his early youth with the bow that he needs in order to ghtthe suitors. At Troy, he could have used any bow (and as he left Eurytusbow at home, he must have used another one when or if he was shooting).In Ithaca, however, a regular bow will not do as the revelatory functionof the archery resides less in the aiming and shooting through the axes asin the actual stringing and wielding of the very special bow. If we go bywhat we learnt in Od. .::o, this will be the bow with which Eurytuschallenged Apollo, something that led to the archer being killed by thearcher god. If we go by the Oichalia story, this will be the bow of the manwho lost the archery contest and refused to keep his promise to Heracles,something that eventually led to his being killed by the greater hero. Howsignicant is this, in the action and for the audience? On the basis of theallusion, albeit negated, to the story of the untold bride contest, wherethe bow was used by the loser, Schein (:cc:: ,,) nds that the allusioncasts an odd shadow on Odysseus victory and subsequent slaughter of theSuitors by associating him both with Eurytos transgressive behaviour andwith the loss of a bride to a better archer. Indeed, in gurative terms, italmost makes Odysseus one of the Suitors. The main idea here may be therather simpler one, that Eurytus was a great archer, the closest a human:It has often been said, e.g. by Davies (:,,:: xxv) and Gantz (:,,,: ,,), that what we hear aboutEurytus death here in Book :: squares well enough with what is said in .::o about him beingkilled by the enraged Apollo so that old age did not come to him in his house. But the atmospheresurrounding the death of Eurytus is rather different in the two passages, and the overall impressionin ::.,, is not of a man being shot dead by Apollo. The poet creates the situation, or that versionof a situation, that suits him.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013:o ivind andersencan approach Apollo in archery, on a par with Heracles, and thus a suitableformer owner of the bow which is now going to be used by Odysseus.:,The story of how Eurytus bow became the cherished bow of Odysseusexplains the convenient fact that the bow is available in Ithaca, so thatPenelope may prepare the contest. For Odysseus left it behind in his hallsin memory of his guest-friend (::.,:). The storys patent explanatoryfunction has been taken to indicate invention on behalf of the poet of theOdyssey,:oas has the fact that the poet seems almost to go out of his way toprovide a background for the encounter.:;Both the underlying criterionof Ausf uhrlichkeit der Angaben, and its application here, raise questions.Even exhaustiveness is relative. There is always more to be known, inthis case, e.g.: why should the very young Odysseus be entrusted with adiplomatic mission? What about its outcome? On the other hand, howevercontrived a story seems and however circumstantial it is, it cannot bedeemed to be untraditional on that account.:Both the old and the newmay be presented in great detail, just as both the old and the new maybe briey sketched and hinted at. I would question the assumption that abrief reference to, or the incidental remark about something some wouldsay: the allusive character of a passage speaks for the audiences familiaritywith what is evoked. In many cases this will be the case. But new facts areestablished all the time by being told, both in the main narrative and in thebackground. This obviously has implications for the way we consider therelative chronology of narrative elements and mythological incidents.:,:,Crissy (:,,;: ,c) makes the point that Odysseus rather than challenge Apollo with the same bow,will claim the god as his ally when he begins his attack in Od. ::.;.:oIphitus all too obvious function as the conveyor of the bowhas led to the suggestion that he has beenintroduced or even invented by the poet of the Odyssey or his predecessors (vom Odysseedichteroder seinen Vorg angern) for the sake of this function, see Prinz (:,;: :,c). But if the encounterwith Iphitus had been part of the tradition for, say, a couple of generations, then there would be noneed for the poet of the Odyssey to spell it out. For the audience of our Odyssey, what would be thestatus of an innovation made a couple of generations earlier?:;On exhaustiveness (Ausf uhrlichkeit der Angaben) as a criterion for invention, see with respectto our passage Danek (:,,b: c, reichlich konstruiert wirkt und nicht nach alter Traditionaussieht), H olscher (:,: o Schon die Doppelung der Suche . . . macht nicht den Eindruckdes Urspr unglichen), Schischwani (:,,,); for general discussion of this and the complementarycriterion of brevity as indication of traditionality, see Kullmann (:,oc: :::;, esp. :,); also relevantStoessl (:,,: :::o, esp. :).:See Friedrich (:,;,: ,:,) for formal analysis and his comments on the komplizierte, ja fast artizielleStruktur and the enhanced Wirkung der Retardation achieved thanks to the bulk of the excursus;also de Jong (:cc:: ,c;). Kirk (:,o:: ,;c) postulated for our passage a convoluted style suggestinga more extensive poetical model.:,See Andersen (:,,) for a fuller statement and Scodel (:cc:: passim, esp. :::,) for discussion,with due recognition that [a]bbreviated narratives claimto be and may often actually be compressedor short versions of tales that circulated in fuller form. But, this may not always be so. The tools ofanalogy and recombination that created the main stories of the tradition can still operate (::;).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013Heracles in the Odyssey :; To account for audience response in relation to the composite and incom-plete picture that a poem offers, the distinction between a narrative audi-ence and an authorial audience, as developed by Ruth Scodel, is helpful. Anarrative audience is one for whom the text would be true, the one whichknows exactly what the text takes for granted and does not already knowwhat it explains. An authorial audience on the other hand is the audienceto which the text actually addresses itself. Many readers seem to assumethat authorial and narrative audience are effectively identical in Homer. Inthis view, exposition is not really necessary for comprehension, but is partof the traditional style; hence the narrator often repeats what the audienceknows already, but never pretends that they already know something theydo not. There is an assumption of transparency. But traditional oral nar-rators do not, Scodel argues, always rely on audience familiarity with theirstories. And the authorial audience can live with gaps: they will accept thepoets version, ll in the picture or hold elements in suspense, according towhat is called for. Deciency of information invites the audience to takethings for granted, and assumes that it can cope with what there is. Forthe poets exploitation of this information gap, Scodel has developed theconcept of pseudo-intimacy.,cAlso the concept of Unbestimmtheitsstellen (points of indetermi-nancy) is helpful when we deal with this kind of patchy and incompleteinformation. Brief mention particularly of things to come or of things pastinvites the reconstruction or even the construction of what is not told.,:When new items or unexpected details are introduced into a story, theaudience is challenged to establish a context and to ll out the picture. Theaudience is ready to do so on the basis of the fewclues given, and will recon-struct or construct contexts as need be. Just as the poets base innovationson traditional materials and story patterns, to the degree that the poetsthemselves need not be consciously aware of their own innovations,,:anaudience steeped in oral poetry would nd both construction and recon-struction easy. In a rich tradition crammed with variants, and a mixedaudience who are familiar with different versions in varying degrees, anindividual would in any case nd it hard to be sure that an unfamiliar ele-ment was actually new. The narrator has tremendous power over any areasof the stories that are not completely standardized which probably means,cScodel (:,,c: :c:). See also Scodel (:cc:: o:). Although pseudo-intimacy seems not to gure inScodel (:cc:), the assumption of transparency is discussed throughout.,:I draw on Schmitz (:,,: esp. ::,).,:For this point and the following quotation, see Scodel (:cc:: ::,).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013: ivind andersenall but the basic outlines. As long as it does not vitiate the Faktenkanon, aco-operative audience is able to make sense not only of the odd detail butof whole new episodes, in the present, surface action of the poem and inits past background. We should bear this in mind when we now turn to that part of the excursuswhich concerns Iphitus and Heracles (Od. ::.::,c, ,of ). The mares andmules that Iphitus was out looking for, were baneful to him, for as hecame to Heracles place, the son of Zeus invited him home and recklesslykilled his guest in deance of the gods and of the norms of hospitality,while he kept the horses for himself. The lack of an explicit context for theencounter and the sketchy presentation of the incident have led many toconclude that the story only makes sense within a fuller picture. There areindeed questions: Where does Iphitus meet Heracles? What is Heraclesrelation to the mares that Iphitus is collecting? Why does Heracles killIphitus at the table? However, the allusive character of the story does notnecessarily mean that Homer relies on familiar material, a traditional storyof Heracles and Iphitus, a story which the poet wanted to accommodatebut which he did not need to ll in because both content and contextwere sufciently familiar to the audience. We do not know what storythat would have been. Some philologists, ancient and modern, opt forthe story about Autolycus having stolen Eurytus mares and sold them toHeracles or perhaps Heracles stole them himself?,,Some think that thekilling of Iphitus is somehow related to the bride contest in Oichalia,,although Iphitus, in later versions of the myth, comes forth as the mostfair one in the household of Eurytus. Danek concludes his discussion ofthe sources with a non liquet, but maintains that the audience would havehad to know.,,But perhaps what the poet said was enough sufcient tomake sense for his audience and even for us.Unlike the Iphitus/Odysseus episode, the Iphitus/Heracles episode hasno explanatory function in the Odyssey. But it has relevance, and it isprominently placed at the heart of the excursus as Penelope sets eye on thevery weapon that signals the beginning of slaughter (::.). As Odysseus,,Clay (:,,: ,c), Schischwani (:,,,: :,:), Davies (:,,:: xxcii ff.).,For Fernandez-Galiano (:,,:: :,::) the story is an afterthought and [t]he whole interpolation,and particularly :,,, would have been inserted to relate the passage to the epic Sack of Oichalia;the story of Eurytus has already been mentioned in viii ::,. Crissy (:,,;: o) also suggests thatHeracles murder of Iphitus may have had a motive similar to that of Odysseus, namely, revengefor a bride.,,Danek (:,,b: c): Somit lassen sich keine pr azisen Angaben uber jenes Verh altnis zwischenIphitos und Herakles ermitteln, dessen Kenntnis beim H orer aufgrund des Anspielungscharaktersdes Textes vorausgesetzt sein mu. Also Crissy (:,,;: ) is reluctant to reconstruct and acceptsthat [t]he poet feels no need to explain the motive for the murder.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013Heracles in the Odyssey :,bow makes its appearance, the audience knows that the bloodbath in thehalls of Odysseus is drawing near. The poet is working towards a situationin which a host kills guests who live unjustly off his property. By thematicmirroring and recombination the poem offers us a glimpse of a situation inwhich an unjust host slays a guest and keeps his property. The source forthis episode is not to be found in tradition but in the cluster of ideas thatengage the poets mind as he works out the Odyssey. The story providesa sinister background to foil the Odyssean foreground.,oThat is not tosay that the poet sketches an incident with nothing to go by. Like theassociation of Heracles with Eurytus in book , the association of Heracleswith Eurytus son in book :: is likely to depend somehow on tradition.The poet may take his clues from tradition, without alluding to it.The Heracles/Iphitus episode makes Odysseus stand out in contrast tothe savage hero of old, the Heracles whom we already know as a chal-lenger of gods. Some pin down more specic parallels and elicit a subtler,more ambivalent message. For example, Crissy (:,,;: ,, ,, ,c:) nds acurious reversal coming to light in our passage as Heracles deed bears astriking resemblance to Odysseus act of revenge against the suitors; thusthe story evokes the mutual savagery of both parties in the revenge storyof the Odyssey; moreover, because Eurytus in book is the one speci-cally portrayed as the transgressor in challenging Apollo, while Heraclesgets away with it, a certain successful hybris which is like that of Herak-les and in rivalry with Eurytos failed attempt seems to be implied here.Thalmann (:,,: :;,;), with a keen eye for parallels, nds that if thesuitors parallel Iphitus, Odysseus is rather uncomfortably in the posi-tion of Herakles; [t]he roles of the suitors and Odysseus in the plot ofthe Odyssey conform to those of Ipihitos and Herakles respectively, andeven though the ethical positions are reversed (or so they are portrayed) itremains true that Odysseus does what the narrative of Iphitos fate roundlycondemns. Schein (:cc:: ,;) nds that the explicit mention of Heraclesmurder of Iphitus at the table, which is somehow analogous to the feastOdysseus prepares for the guests at his tables (cf. ::.:,c, ::.:,:c),makes Odysseus revenge on the Suitors ethically more complicated thanit might otherwise seem to be, and thus challenge[s] interpretation. Onthe other hand, Danek (:,,b: c,) has drawn attention to the fact thatHeracles otherwise the bowman apparently does not use his bow to killIphitus. Precisely in a situation that represents a perversion of Odysseusjust revenge, Heracles is less of a parallel/contrast to Odysseus than he easily,oFor Heracles as a foil and contrast to Odysseus, see Galinsky (:,;:: ::), Clay (:,,: ,,o), Crissy(:,,;), Danek (:,,b: c,), Thalmann (:,,: :;o), de Jong (:cc:: ,c;).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013:,c ivind andersencould have been with the bow for a poet intent on schematic relations.Thus the bow as a weapon is dissociated from unjust murder; the very bowthat Odysseus is going to use is a uvuc tivcic qicic (::.c), which isnot going to be tainted by unfair use even by association.,;The bow isalso the one that has already been employed in the contest for a woman atOichalia. We may see signicance in the fact. But even if Heracles wooingof Iole was already part of tradition, and even if it were well known to theauthorial audience, we may still wonder whether those who knew wouldmake the connection and nd it signicant. Whether or to what extent wemay expose and exploit implicit parallels in a picture of explicit contrastsis a methodological problem akin to Clays question how can we knowwhether an allusion is rejecting a tradition or incorporating it (:cc:: ;o).And how, may we add, could the audience know? There are cases wherethe poet simply ignores a tradition, rather than emphatically rejecting it,and cases where there is no narrative tradition at all behind the allusion. Inthe Odyssey, Heracles reputationsuffers fromhis being a foil to Odysseus,as the trespasser in archery (book ) and guest-friendship (book ::) thatOdysseus is not. Also the encounter between the two heroes in the Nekuiais full of contrasting parallels. By his very descent to Hades Odysseusemulates Heracles greatest ctc,.,The poet or the interpolator whofurther developed the contrast has made the two heroes a pair in fate.,,He sets great store by Heracles being available for an encounter as he dulyexplains that it is in fact Heracles toccv that is in Hades, while Her-acles himself (co:c,) enjoys life among the immortals with Hebe (Od.::.oc:). A Heracles happily married in heaven is not irrelevant to theOdyssey.cThe (toccv of ) Heracles appears, like dark night, holdinghis bow bare with an arrow on the bowstring and forever looking, as one,;Tracy (:,,c: :;,) even sees Odysseus killing of the suitors as indirect revenge for Iphitos treacherousmurder; he also thinks that, since the poet mentions the death of Eurytus (::.,:,), we are meant toremember that Eurytos was killed by Apollo for challenging him to an archery contest in .::o.,The fact that the encounter with Heracles is the nal episode of the Nekuia has been seen as a kindof source quotation on the part of the poet of the Odyssey; see Heubeck (:,,: ::), on ::.oc::;.For aspects of the encounter between Odysseus and Heracles, see esp. Clay (:,,: ,,o), Crissy(:,,;: ,:,), Thalmann (:,,: :;,o).,,Thornton (:,;c: ;,): The poet here presents Odysseus and Heracles as a pair in fate: the two whowent to Hades alive, the two great archers.cOne may disagree about the wider implications. For Schein (:cc:: ,,), Odysseus reference to thedeication of Herakles is one example of how the poem asks its audiences and readers to hold inmind apparently contrasting realities. His unspecied audiences and readers are asked, on thebasis of these Odyssean verses, and Il. :.::;,, to say both: [Y]es, Odysseus differs from Achilles,as a nostos hero differs from a hero of kleos poetry, a survivor from one who is committed to hisown and everyone elses death. No, Odysseus does not differ from Achilles in any freedom from thelimitations imposed (and the opportunities offered) by being human.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013Heracles in the Odyssey :,:who shot, with terrible glances (::.oc;). Like the sinner Orion in theprevious episode, Heracles does what he typically did in life, as if undera curse. The bow-wielding Heracles is especially relevant to the Odyssey,of course. His appearance is amplied by the description of the wondrousworks on the golden belt that crossed his chest: bears, lions, boars, bat-tles and quarrels, murders and manslaughters qcvci : vopcs:coici :t(::.oc,::). Odysseus in an aside expresses the hope that its maker maynever again fashion anything like it it is as if the poet or interpolatorhere (and one may compare the aside on Heracles in Il. ,.c,) distanceshimself from a whole tradition, which is not that of the heroic sacker ofOichalia even, but of the superhuman action hero who ghts giants anddwarfs, beasts and monsters. Nonetheless Heracles himself in his addressto the younger hero draws a parallel between the two of them (note sci o,::.o:) in so far as he states that both have suffered some evil doom. Bothhave ctci to perform.:Thus Odysseus, in his last encounter in Hades,halfway through the poem, is elevated to the same level of suffering as thegreat Heracles, who had to suffer although I was the son of Zeus (::.o:c).Heracles went to Hades to fetch Cerberus. He tells Odysseus that hisworst work was as he was sent to Hades to fetch the dog back and that hesucceeded, with the help of Hermes and Pallas Athena (::.o:,:o). Thisspecic divine support may or may not have been part of the story. It hasbeen suggested both that the two divinities appear here in order to makeHeracles more of a parallel to Odysseus, who is well served by Hermes andAthena in the Odyssey, and that they have been introduced to enhance thecontrast between the older hero assisted by gods and an Odysseus actingalone.:Odysseus encounter with Heracles in the Underworld cannot bepart of any Heracles tradition. Heracles extended sojourn there by proxy,so to speak, is due to the role that he is allotted in the action of theOdyssey. Whatever the mythological background and the epos tradition,the Heracles we meet in the Odyssey is very much a product of the Odyssey.The audience would accept that, as they would accept and relish so muchelse that was sung to them in the course of an epic performance. The poetwould give the audience enough impulses to build a background from, tothe extent that they needed one, even if he did not and could not referthem to specic, familiar epics and stories.:On ctci see Thalmann (:,,: :c); Schein (:cc:: ,:): Herakles diction at the end of Book ::, atleast as reported by Odysseus, seems to establish him as similar to, even a paradigm for, Odysseus.:See Clay (:,,: ,,) for the limits of parallelism and for the main contrasts.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:11 WEST 2013. Books Online Cambridge University Press, 2013chapter 9The Catalogue of Womenwithin the Greek epic traditionAllusion, intertextuality and traditional referentialityIan C. Rutherford1 introductionThis chapter sets out to investigate the relationship between the HesiodicGunaik on Katalogos (GK) and the early epic corpus. It looks not only atcases where there is a correspondence of theme but also at cases wherethere is a striking difference, because difference is itself an important typeof relationship. It also asks how we decide whether or not such pointsof correspondence or dissonance are signicant, and explores the issue ofrelative priority between them.The poemThe GK is unusual because it is by its very nature a compendium, a com-pilation of narratives about gures from Greek mythology, particularlystories about women. The poem is notoriously difcult to reconstruct:what survives is mostly isolated fragments, either papyri or testimonia,and often assignation of these to the poem is tentative and uncertain.Thanks to the labours of Martin West (:,,), we know that it had a loose,genealogical structure, in outline much like that of the Bibliotheca ascribedto Apollodorus, beginning with the great family of Aeolus, which occu-pied book : and probably most of book :; then moving on to the otherheroic families. The Inachids in books : and ,, with Argive mythology,as well as the Arcadians and Atlantids. In book the Asopids, the Athe-nians and the Pelopidai and in book , the wooing of Helen and declineof heroes.:In this way, the GK surveyed the whole of Greek mythology,going through the stemmata, following branches to the end, and some-times jumping between then. In some cases, the entry for someone wasThanks to all in the conference, and particularly to Bruno Currie.:This arrangement is not quite certain: Meliado (:cc,) drew attention to a new piece of evidence thatsuggested that the story of Atalanta, who ought to be part of the family of Aeolus, came in book ,.:,:Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:51:12 WEST 2013. Books Online Cambridge University Press, 2013The Catalogue of Women within the Greek epic tradition :,,expanded into a short myth summarizing the life of a mythological gure.Myths relating to women sometimes start n cn (or such as she), whichgives the work its alternative name. It had its own style, its own reper-toire of favoured formulae and idioms, such as long patronymics witha genitive in -cc (ones in -tc are by contrast avoided) and frequenta-tive verbs in -ost. The form is essentially loose. There has been a lot ofdiscussion recently about multiforms and canonical epic, but the GKwould be a very good candidate for the multiform category.:It is the sortof text that would become xed, if at all, rather late; in fact, we know ofanother text, the Megalai Ehoiai, which may be precisely a multiformof theGK.,The basic form was open to adaptation in two main ways: rst, agenealogy could be changed, and second, which entries were expandedinto mini-myths could be controlled. The GK is likely to have a close, evensymbiotic, relationship to other early epic because material from otherpoems could easily be incorporated into it. Alternatively, sections of theGK could easily be adapted by other poets and made into longer poems.Either of these developments must have occurred in the case of the poemknown as the Shield of Heracles, because the rst fty lines or so actuallyappear in the canonical GK as the ehoie of Alcmena. o).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:51:12 WEST 2013. Books Online Cambridge University Press, 2013:oo ian c. rutherfordMinos. This is narrated in :: MW= ,o H, an important fragment whichdescribes Europa and the necklace that Hephaestus made for her, later tobecome the necklace of Eriphyle, and then goes on to describe her sonsby Zeus: Minos, Rhadamanthus and Sarpedon. Zeus grants him to livethree generations (ll. :c:),,cand he goes to ght in Troy, despite his fatherZeus sending a bad omen (pio:tpc onuc:c qcivcv (l. :,), similar to aformula that occurs a few times in the Iliad ). He rules Lycia, and muchhonour follows him (tcn ot c tott:c :iun (l. :)), a rare formula thatis used in the Theogony (:) to describe someone who sacrices to Hecate,but in the context of Sarpedon inevitably brings to mind Il. ::.,:c, whereSarpedon asks Glaucus rhetorically why are we honoured? (Ic0st :inon vc :t:iunutoc uio:c;).Notice also that the genealogy SisyphusGlaucusBellerophon appearselsewhere in the GK in the Mestra ehoie (, MW = ,; H), with theadditional detail that Bellerophons father was really Poseidon who hadabducted Glaucus wife.It is interesting that the Iliad seems to go out of its way to tell us about thegenealogy of Sarpedon. The statement of it comes in the famous episodewhere Glaucus tells Diomedes about his genealogy, the genealogical passageof the Iliad par excellence. Elsewhere, the Iliad is quite explicit that Zeusand Europa had two sons only, Minos and Rhadamanthus, as we hear fromthe mouth of Zeus himself in the Dios apate scene (:.,::). So there is nomistake: Sarpedon is without doubt a son of Zeus, only not by Europa,but rather by a female descendant of Sisyphus. Of these two versions ofthe genealogy, can we say which is likely to be earlier? One factor mightbe that the Homeric stemma of Sarpedon suits the plot of the Iliad betterthan the one in the GK, in so far as, if Sarpedon was the brother of Minos,he would be very old by the time of the Trojan War. (That is why in someversions of the myth he was allowed to live three generations.) But that sortof superhuman lifespan would not suit the taste of the poet of the Iliad,so, I suggest, he opted for an alternative genealogy, grafting him on to thestemma of Bellerophon. It may be precisely because Homer has changedthe genealogy of Sarpedon that he explains it in detail. If that approach isright, it has the consequence that the version of the myth preserved in theGK is the older one. That is not to say that the GK itself is older, of course,and the situation is a complicated one, because the canonical GK seems tohave combined the earlier Cretan genealogy of Sarpedon with themes ofthe Iliad.,cSee the supplements in Evelyn-White (:,:: oc:); for the myth, see Apollodorus, Bibl. ,.:.:.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:51:12 WEST 2013. Books Online Cambridge University Press, 2013The Catalogue of Women within the Greek epic tradition :o;3 conclusionsSince the GK is a compendium of mythology, it is no surprise at all that itoverlaps with the ground covered by other early epic poems, and predictablywe nd plenty of plausible cases of intertextuality. The chief problems arethe fragmentary nature of the material both the GKand the other poems and our ignorance about the sort of poetry we are dealing with: developingoral traditions, xed written texts, or something in between. In some caseswe seem to be dealing with contestation not between different poems butbetween narrative or even mythological traditions, e.g. with respect to someof the contested genealogemes I discussed; in these cases it is probablybetter to speak about traditional referentiality. Equally, however, there arecases where it makes more sense to speak in terms of relations between(specic) poems. That would certainly go for cases (if there are any) wherethe author of the GK reacts to Homer; the Ajax-entry in the Wooingof Helen fragment might be one such case. Relations between (specic)poems also seems a better way of describing the hypothetical use by thepoet of the Odyssey of a proto-GK, which may have been written but wasjust as likely orally transmitted.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:51:12 WEST 2013. Books Online Cambridge University Press, 2013chapter 1 0Intertextuality without text in early Greek epicJonathan S. BurgessIntertextuality is problematic for early Greek epic because it was performedin the largely oral culture of the Archaic Age. An orally composed poemcannot easily engage with another oral poem in a detailed manner. Evenif one assumes that some epics were recorded as texts at an early date,their normal publication would be by performance, where specic allusionbetween poems is not easily discernible. Anachronistic assumptions aboutepic-to-epic allusion in the early Archaic Age fail to consider whetherthere was any motivation, in terms of both composition and reception, fordetailed intertextuality. More plausible is interaction between epic poemsand mythological traditions as they were generally known. But reectionof shadowy tales might be thought a rather nebulous and disappointingtype of intertextuality. General correspondence of motifs is one thing; whatabout words and phrases? Is there such a thing as quotation in early Greekepic?:In this study I explore the possibility of a textless intertextuality inearly Greek epic that would involve specic epic phraseology. By this Ido not mean an oral poem reusing words that have been composed fora previous oral poem, but rather an oral epic reusing phraseology thathas become associated with specic mythological situations as they weretraditionally articulated in the oral epic tradition. Two Homeric phrasesI thank the conference organizers for inviting me, and I am grateful to the Social Sciences andHumanities Research Council of Canada for nancial support. Special thanks to Jennifer Phenix,Tim Perry, Lee Sawchuk and Michal Dziong for their work as research assistants. Communicationwith Ettore Cingano, Bruno Currie, Ian Rutherford and Oliver Thomas sharpened my thinking.:In a recent publication (Burgess :cco, revised as ch. of Burgess :cc,), I limit Homeric allusionto motifs at the mythological level, and question the neoanalyst interest in quotation (Burgess:cco: :,). Here I seek to explore the issue of epic quotation more optimistically, though withinoral parameters. Cf. Nagy (:,;,: :,), with a statement that has gained much attention: [W]henwe are dealing with the traditional poetry of the Homeric (and Hesiodic) compositions, it is notjustiable to claim that a passage in any text can refer to another passage in another text (:; withfurther development at Nagy :,,c: ,,, :cc,: ;:,). For (general) agreement, see Jones (:,,;: ,);for critique, see Clay (:,,: ::o), Cairns (:cc:a: ,,o), R. B. Rutherford (:cc:: ::,).:oDownloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :o,will be considered as candidates for such intertextuality without text. One isthe phrase ut,c, ut,cco:i, or great in his greatness, found in referenceto Achilles in book : of the Iliad. Neoanalysts have argued that the phraseis derived from a pre-Homeric poem about Achilles, perhaps a prototypeof the Aethiopis of the Epic Cycle.:A second test case involves a line of afragment of the Little Iliad of the Epic Cycle that describes Neoptolemustaking Astyanax from the breast of his nurse. The language is reminiscentof the famous scene in Iliad o in which Astyanax recoils into the breastof his nurse at the sight of Hectors helmet, and scholars have usuallyassumed that the Cyclic poem has taken its phraseology from the Iliad.I will argue that in neither case is there a direct connection betweenone epic poem and another. Instead, I suggest, the Iliad reuses context-specic phraseology to remind a mythologically informed audience of thenarrative context in which it usually occurs. By such intertextuality withouttext the book : passage alludes to the traditional story of Achilles death,and the book o passage alludes to the traditional story of the death ofAstyanax.1 methodologyThe following comments are meant to clarify the assumptions that I willemploy in my subsequent discussion.,Though I am gratied to see thatsome contributors to this volume have responded thoughtfully to mypresentation at the conference, my points are not intended as rules. Theyare designed, rather, to provide a heuristic strategy for my explorationof the possibilities of intertextuality in an oral performance culture. I donot insist on an everlasting and pure performance culture, and I readilyacknowledge that a wide range of circumstances involving a mix of textsand oral performance can easily be imagined. But since the relationshipbetween early epic poems is textually conceptualized by default, it shouldbe useful if I stake out a position that is more attuned to performanceculture.:. Intertextuality commonly means little more than allusion of one textto another. This does not seem to be appropriate for the oral nature ofearly Greek epic, and a more theoretical conception of intertextuality isdesirable.:For the Epic Cycle and its tradition, see Burgess (:cc:, :cc,). In my usage cycle and cyclic, whencapitalized, refer to the specic poems eventually collected into the Epic Cycle, whereas withoutcapitalization they refer to mytho-poetic traditions whose content is also found in the Cycle.,For more detailed discussion, see Burgess (:cco), with Tsagalis (:cc).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:;c jonathan s. burgess:. For traditional narrative, a distinction can be made between mytho-logical traditions (represented by various genres and media) and epictraditions (the manifestation of mythological narratives in epic verse).,. Oral epic traditions were not constituted simply of formulae and typescenes, but also of uid yet identiable mythological narratives. Oftencertain phraseology would be employed typically in the context of spe-cic mythological episodes.. The early epic tradition was not limited to surviving or attested epics,with the addition of a few oral prototypes. There were countless epicperformances that narrated mythological traditions by means of oralcompositional techniques. The poems of the Epic Cycle are representa-tive of, but not equivalent to, the non-Homeric epic tradition.,. Homeric and cyclic epic can be distinguished, though this does notisolate the former so much as establish a context for it. The Homericpoems are meta-cyclic in the sense that they transform cyclic motifsand phraseology into new contexts. E.g. Achilles afterlife at the White Island in the Aethiopis has often been linked to Milesian colo-nization in the northern Black Sea, which suggests it is a post-Homeric narrative. See Burgess (:cc:::oc:), where it is concluded that the mythological content of the narrative may be pre-Homericeven if the Aethiopis presented a Milesian perspective.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :;:that we can date two texts, we cannot necessarily extrapolate on that basis anintertextual relationship between them. One poem considered older neednot have inuenced a second poem considered younger, even if they dis-play correspondences, for these could have been inherited independently.The issue becomes more complex when we consider the possibility that apoem existed uidly in performance for some time before it was recordedas a text. In such circumstances a text with relatively late details may failto indicate the longevity of the performance tradition from which it isderived. The relative date of two texts may not well replicate the relativedate of their respective performance traditions. Even if it is established to asatisfactory degree that one text has inuenced the other text, treating thetwo poems as one-off textual compositions fails to consider the potentialcomplexity of the relationship between the performances that lay behindthem.,2 ut,c, ut,cco:iMy rst test case is the phrase ut,c, ut,cco:i, which may have regularlybeen used in epic traditions in reference to the death of Achilles. At Odyssey: the shade of Agamemnon uses the phrase as part of his description tothe shade of Achilles of a battle over the corpse of Achilles. The shade ofAgamemnon reports to the shade of Achilles, you lay in a whirl of dust greatin your greatness, forgetful of your horsemanship (ou o tv o:pcqi,,iscvin, | stoc ut,c, ut,cco:i, tcoutvc, ttcouvcv (Od. :.,,c)). Scholars have long found it striking that similar phraseology is foundat the beginning of book : of the Iliad after Achilles has learned of thedeath of Patroclus. He is described as lying stretched out in the dustgreat in his greatness in grief: co:c, o tv scvioi ut,c, ut,cco:i:cvuoti, | st:c (Il. :.:o). The phrase ut,c, ut,cco:i recurs, thoughin a different metrical position, and again we have reference to lying in thedust. Neoanalysts have most notably argued that the phraseology in Iliad: was present in a pre-Homeric description of the corpse of Achilles.:c,At Burgess (:cc:: ,:,) I summarize (in rather rhetorical fashion) critiques of the dating of earlyepic in Janko (:,:). Hesitation about the conclusions of Janko (:,:) does not imply doubt aboutthe impressive linguistic and statistical skills on display; the critics rather seem to feel that thedata fail the methodology. It should be added that Janko would stress relative chronology overthe controversial issue of absolute dating. As it happens, the argument below does not depend onthe chronology, absolute or relative, of specic texts. My concern is not with the borrowing ofphraseology from one poem by another poem, but rather the reuse of traditional phraseology in asecondary fashion, with an allusive and textless type of intertextuality resulting.:cSee Pestalozzi (:,,: :;:), Kakridis (:,,: ,), Kullmann (:,oc: ,,, ,,c, :,,:: : n. o,, ,,o,), Schadewaldt (:,o,: :o), Schoeck (:,o:: o). Those that have found the argument attractiveDownloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:;: jonathan s. burgessThe argument is all but irresistible, especially since the whole scene at thebeginning of book : seems to reect the death of Achilles. The Nereidsmourn in a way that is reminiscent of Achilles funeral, Thetis holdsAchilles head in the manner of funeral ritual, and soon enough the heroand his mother will openly talk of Achilles coming death.::The phraseut,c, ut,cco:i occurs in the midst of all this foreshadowing, and it ishard to avoid the impression that it contributes to the effect. Followingclassic neoanalyst methodology, one would view the Odyssey : passage asrepeating phraseology in its usual pre-Homeric context, whereas the Iliad: passage is transferred from its natural, or primary, context and placed inan unusual, secondary context.It is interesting that in the edition by West the relevant lines of book: are bracketed as an interpolation, for reasons having to do with therather vague conception of how Antilochus and Thetis have physical con-tact with Achilles as he lays on the ground (West :cc:a: :,). ThoughI do not agree that there is an interpolation, his argument underscoresthat the phraseology is out of place. From a neoanalyst perspective thisis not the intrusion of external verse, but rather its incorporation. TheIliad has not taken words from the Odyssey, or vice versa, and presumablythe Odyssey : passage faithfully preserves, except for the change of voice,phraseology that existed in pre-Homeric epic.::The source of the phrase-ology has sometimes been conceived as the Aithiopis, but it has been morecommonly described as a prototypical Achilleis or Memnonis. Recently oral-ists attracted to neoanalysis have more generally described the source aspre-Homeric.But before speculating on the nature of this apparent intertextuality,we have to recognize that there has been one major block to accepting theneoanalyst argument. The longer version of the phraseology used in Odyssey: is also used to describe the corpse of Cebriones at Iliad :o. The passagedescribes the battle over Cebriones, and at lines ;;,;;o the narratorinclude de Romilly (:,,: :o,), Edwards (:,,:: :,o, cautiously), Dowden (:,,o: ,,, :cc: :c:),R. B. Rutherford (:,,o: ,::), Willcock (:,,;: :;;), Danek (:,,b: o,, :cc:b: :;), Currie(:cco: c), Burgess (:cc,: ,). Dihle (:,;c: ::) by contrast argues for the priority of the Il.: example on syntactical grounds, favouring the use of a participle :cvuoti, with the adverbin the book : passage; for a response, see Kullmann (:,;;: ,c). Other examples of parachesis(cictv cc,, ;.,,; civctv civc,, ;.,;) suggest that ut,c, ut,cco:i can function as a relativelyself-contained phrase.::Schein (:,: :,c) provides an excellent analysis of the scene as a whole.::Garner (:,,,: :,,oc) proposes that a newly found fragment of Stesichorus (;, available in theappendix of PMGF) relates the battle over the corpse of Achilles; if so, o:pcq[i,,i (line ; cf. Od.:.,,, Il. :o.;;,) suggests another example of comparable phraseology in the context of Achillesdeath.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :;,reports, c o tv o:pcqi,,i scvin, | st:c ut,c, ut,cco:i, tcoutvc,ttcouvcv (he lay in a whirl of dust, great in his greatness, forgetful ofhis horsemanship). This third Homeric occurrence of ut,c, ut,cco:iphraseology raises the issue of typology. From an oralist perspective, itmight look as if the phraseology belongs to the typological scene of a battleover a corpse, and not to any one character. In other words, the phraseologymay be context-specic, but it is not certainly character-specic. One mighttherefore conclude that the phraseology in book : did nothing more thanmeet metrical needs, perhaps triggered by the dust that Achilles poursover his head, which is not uncommon in Iliadic battle scenes. In thatcase the phraseology in book : would be a meaningless by-product of oralcomposition, or at best an evocation of a generic scene. One might concludethat the book : passage reuses context-specic phraseology in a ratherinappropriate manner, but not that it reects any specic mythologicalscene featuring Achilles.To withstand the oralist perspective, the neoanalyst argument needs toestablish that the phraseology is not just context-specic, but that it ischaracter-specic; that is, that it belongs to Achilles. This is not so easywhen we reect on the specication of horsemanship in the longer versionof the ut,c, ut,cco:i phraseology in Odyssey : and in Iliad :o. Ithas not gone unnoticed that horsemanship seems especially appropriatefor the charioteer Cebriones, and some have in fact concluded that thephraseology actually belongs to Cebriones.:,This is something of an embarrassment for the neoanalyst position,but a defence can certainly be made. Kullmann (:,oc: ,,) has correctlypointed out that Achilles is closely linked to his divine horses. Scholarshave also pointed out that ttcovn can be attributed in the Iliad to anywarrior for whomthe chariot is employed. The distinction between a driverof horses and a chariot-using warrior is therefore elided. Long ago Scottafrmed that horsemanship was appropriate for Achilles, declaring that[t]o deny to Achilles this particular skill is to miss the whole tone of theIliad. The heroes themselves, not their drivers, were the skilled horsemen,and Achilles above all others.:If the extended phraseology that refers to horsemanship is not inappro-priate for Achilles, then the Odyssey : passage with its reference to Achilles:,Cf. Erbse (:,;:: :,,), Heubeck (:,,:: ,o), Usener (:,,c: :c). Willcock (:,;: I.:,,)thinks that the reference to horsemanship phraseology is not appropriate for Achilles, but since hefeels the phraseology is too impressive for Cebriones he locates its origin with horsemen of theprevious generation, like Peleus.:Scott (:,::: ,:,); see Janko (:,,:: c), Burgess (:cc:: ;o).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:; jonathan s. burgessforgetting his horsemanship is unobjectionable.:,We can also understandwhy the longer version of the phraseology is not used to describe Achillesin book :, for the grieving Achilles cannot be said then to have forgottenhis horsemanship skills. If horsemanship is not inappropriate for Achilles,however, it is certainly not inappropriate for Cebriones. The questionremains, then: how does the phraseology belong to the story of Achilles,and in what way is it secondary for Cebriones? It should be rst observedthat poetically speaking the phraseologys application to Cebriones in Iliad:o is nothing less than magnicent. Its success has been well described byJanko (:,,:: c,, c), who demonstrates that the phraseology is partic-ularly effective as a dramatic ending to the extended description of thebattle over Cebriones. Besides the full description of the opposing soldiers,there is an impressive succession of similes. First Hector and Patroclus arecompared to two lions confronting one another, and then a more gener-alized nature scene portrays two opposing winds causing the branches ina forest to knock together. The energy of the animal and nature similes isthen interrupted by the focus on Cebriones. In Adam Parrys words, it is asudden vision of the single man in the eye of the storm who has left it allbehind.:oIn book :o, the essential focus is not on horsemanship but on the loss ofhorsemanship as a consequence of his death. Part of the effect is contrast:amidst the energetic battle Cebriones is completely still. The situation ismuch different with Achilles in book :, where in contrast to CebrionesAchilles in his mourning very actively disgures himself. But much of theeffect of the Cebriones passage depends on the negation of horsemanshipskill by death.:;Some of this effect is inherent in the parallel passageabout the corpse of Achilles in Odyssey :, but Agamemnons account ismuch more concise and not as dramatic. Though it is possible that inpre-Homeric epic, descriptions of the corpse of Achilles were as poeticallyskillful, we must admit that in Homeric poetry the ut,c, ut,cco:iphraseology is most successfully employed in book :o.:,Usener (:,,c: :c,) thinks that the reference to horsemanship does not specically match Achilleslast battle, even if horsemanship is a general characteristic of warriors. Danek (:,,b: o,) arguesthat Achilles must have employed the chariot in his rout of the Trojans just before his death. Iconsider the Odyssey : phraseology generally appropriate to Achilles.:oA. M. Parry (:,;:a: liii), with an excellent analysis of the book :o passage, made in the context ofa discussion (pp. liiliv) of his fathers remarks on the ut,c, ut,cco:i phraseology (M. Parry, inA. M. Parry :,;:b: ,:). The father admired the line in book :o but cited comparanda to demonstrateits traditionality, a view which the son nds limited.:;The pathos has been well described at Grifn (:,c: :co), where it is linked with other passages inwhich the wastefulness of death is emphasized. On the tragic feeling of the Cebriones passage, seealso de Romilly (:,,: :,).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :;,If horsemanship is not inappropriate for Cebriones, and the poetics ofthe passage describing his corpse are excellent, what is secondary about thephraseology in the book :o passage? From the neoanalyst perspective, it isthe central phrase ut,c, ut,cco:i. The issue is the status of Cebriones.There is no reason to think of him as ut,c, in a physical sense, and heis not a major hero. He is a bastard son of Priam who upon his death ismocked abusively by Patroclus. Many have therefore concluded that thephraseology, though it suits the context, is inappropriate for the character.Great in his greatness might be thought very tting for Achilles, especiallyif one thinks of iconography of Ajax groaning under the weight of his hugecorpse.So the phraseology probably belongs to Achilles, normally employedin the context of a battle over his corpse. In book :o the context is cor-rect, a battle over a corpse, but the character is different. This shift to adifferent character could be seen as accidental and therefore insignicant;arguably the context of a battle over a corpse triggered the employmentof phraseology usually reserved for the battle over Achilles. Oralists mightprefer this interpretation, and something like it was argued by Schoeck, inhis theory of multiple motif transference by association.:From the per-spective of classic neoanalysis, the use of Achilles-specic phraseology forthe minor character Cebriones is a kind of narrative problem, comparableto the application to Patroclus of motifs usually associated with Achilles.Neoanalysts cite such problems as evidence of the poets inventive trans-ferral of motifs; more recently, scholars attracted to neoanalyst argumenthave tended to regard such problems as allusive signals to other narratives.It is probably too strong, however, to say that the Cebriones passageevokes the traditional death of Achilles, for Cebriones in no other wayresembles Achilles, certainly not in the way that Patroclus is an alter ego ofthe great hero. But the application of the ut,c, ut,cco:i phraseology toCebriones might be considered an anticipatory doublet, since the Achilles-specic phraseology in book :o prepares for Achilles enactment of hisdeath at the beginning of book :. As well, the Achilles-esque corpse ofCebriones prepares for the imminent rehearsal of Achilles death on thepart of Patroclus.:,Cebriones is the last major victim of Patroclus, and:Schoeck (:,o:: passim); at Schoeck (:,o:: o) the Iliad :o passage is described as gravitating to atraditional Achilles formulation.:,On anticipatory doublets, see Edwards (:,,:: :,:c). Usener (:,,c: :c,) and Danek (:,,b: o)note that the death of Cebriones directly precedes that of the Achilles-doublet Patroclus; Usenerargues that the Odyssey passage is thereby inuenced by the Iliad :o passage, whereas Danek moreplausibly sees the Iliad :o passage as a secondary reection of a context that belongs to Achilles.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:;o jonathan s. burgessPatroclus himself will soon be a corpse in the middle of opposing warriorsafter resembling Achilles in his aristeia and in his death.Kullmann (:,) has used the phrase motif transference to describe themovement of a motif from its primary situation to a secondary situation,and that phrase generally describes the phenomenon of Achilles playingthe role of a corpse in book :: a mytho-poetic episode, including some tra-ditional context- and character-specic phraseology, has been transferredinto a new context within the Homeric poem. But here and below I will tryto employ some more specic terms in order to describe the intertextualitywith more precision. In the book : passage there is what may be calledmotif alienation which involves displacement (change of scene from battle-eld to the camp of Achilles) and anachronism (enactment of death longbefore it occurs). Besides this variance, there is correspondence between thesecondary manifestation of the motif with its regular, or primary, manifes-tation, notably with the phraseology that we examined. Modied iterationis the basic recipe for intertextuality, certainly for intertextuality that ispotentially signicant and allusive. In narratological terms the allusion inbook : is external prolepsis (reference to a future event outside the bound-aries of the poem). In book : the usual context of the ut,c, ut,cco:iphraseology would quickly come to mind for a mythologically informedaudience, especially one which has recently heard it employed in book :ofor a battle over a corpse which itself serves as an intratextual anticipatorydoublet.3 astyanaxThe preceding analysis of a much-discussed phrase has established somecriteria for examination of the intertextuality of epic phraseology. Mysecond text case is the correspondence between a line of the Little Iliad anda line in book o of the Iliad. The fragment reports on the aftermath of thesack of the city:tcoc o tcv ts sctcu t0tcsucic :invn,pt tcoc, :t:c,cv tc tp,cu, :cv ot ttocv:ctct tcpqptc, vc:c, sci ucpc spc:cin:cAnd taking the child from the breast of the fair-haired nurse he gripped him bythe foot and hurled him from the tower, and dark death and strong fate seizedhim.:cFr. :c.,, Davies = ::.,, Bernab e = :,.,, West (Tzetzes ad Lycoph. Alex. ::o).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :;;Much scholarly attention has been directed to the attribution of the secondhalf of the eleven-line fragment to Simias by a scholion to Euripides (adAndromache :); I will leave that controversy aside and focus instead onlines ,, of the fragment.::This brief description of the death of Astyanax isvery similar to the famous passage in book o of the Iliad in which Astyanaxrecoils into the breast of his nurse in horror of his fathers plumed helmet:c o c t, tpc, sctcv t0cvcic :invn,tsivn iycv, tc:pc, qicu civ :uyti,:cpnoc, ycscv :t iot cqcv tticyci:nv,otivcv t spc::n, scpuc, vtcv:c vcnoc,(o.o;;c)But the child leaned back towards the bosom of his well-belted nurse, crying out,upset at the sight of his father, in fear of his bronze and the horse-hair crest, as hesaw it nodding terribly from the top part of the helmet.The correspondences are obvious. Most generally, both passages concernAstyanax. More specically, line , of the fragment corresponds extensivelyto line o; of book o; each line refers to a child and a breast fold of anurse (with a different case for tc,, and a different epithet for the nurse).And that is not all; other parts of the fragment correspond to differentpassages of the Iliad.::Most signicantly, a different form of the mainverb at the beginning of line in the fragment, along with the subsequentprepositional phrase, recurs at line ;,, of Iliad :, all in the same metricalplace. This passage also concerns Astyanax, for Andromache is ruminatingabout the possible fate of her son (as well as her own) now that Hectoris dead. It has not gone unnoticed that a Cyclic passage about Astyanaxemploys phraseology also found in Homeric passages about Astyanax, andthe consensus view is that the Little Iliad has reworked phraseology fromthe Iliad.:,::Davies prints the text with a space between lines , and o; Bernab e brackets lines o::; West separatesinto two fragments. At Davies (:,,b: ;:) the issue is deemed one of the great insoluble mysteriesassociated with the Epic Cycle. It has also troubled scholars that the eleven lines seem to moveabruptly between three distinct actions: the conveying of Andromache to the ships (imperfect tense),the previous murder of Astyanax and the acquisition of Andromache and Aeneas by Neoptolemus.Recent suggestions include Huxley (:,o,: :,,, rearrangement of the lines), West (:cc,a: :: n.,, Tzetzes quotes two unconsecutive passages of the epic), Bravo (:cc:b: ;o;, the fragment isa unity, with the succinct reference to the death of Astyanax a narratological ashback), Debiasi(:cc,: :c:, Simias reused a passage of the Little Iliad). For further discussion and bibliography onthe origins of the verse see Bernab es apparatus (:,;: ad loc.), Powell (:,:,: :::::), Grifn (:,;;:,: n. :), Bravo (:cc:b: ;,), Debiasi (:cc,: :c,).::The apparatus at Little Iliad fr. :: Bernab e helpfully gathers some of the comparanda.:,Cf. schol. Il. :.;,,; Grifn (:,;;: ,::), Curti (:,,,: ,), Richardson (:,,,: ,,), Debiasi (:cc,::,). Kullmann (:,oc: :o;) argues that the Cyclic fragment is post-Homeric, believing thatDownloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:; jonathan s. burgessI have previously resisted this idea, suggesting instead that the apparentcorrespondence is best explained as resulting from independent use ofshared poetic traditions (Burgess :cc:: :,). Though the fragment can befaulted for some awkwardness of metrics, word placement and repetition,its language is not obviously post-Homeric, and Notopoulos (:,o: ,c:)demonstrated that all eleven lines of the fragment are formulaic in nature,at least by analogy.:Most of the difculties occur in the (disputed) secondhalf of the fragment, though the section concerning Astyanax has someaspects that might raise concern. In line , the genitive form of sctc,necessitates metrical correption and hiatus, as the accusative at Il. o.o;does not. But this does not mean that the fragments formulation must beuntraditional, or derivative from the Homeric line. Though there seemsto be no qualitative reason to prefer the Homeric t0cvc, to the Cyclict0tcscuc, as an epithet for the nurse, the form of the word in thismetrical position is anomalous. If the Homeric database reects normalepic practice, the fragment may have been innovative with a non-integralpart of traditional phraseology perhaps in order to avoid repetition withthe occurrence of t0cvc, in line o, assuming the fragment is a unity. Thisslight lapse of economy is nothing extraordinary for oral compositionaltechnique in early Greek epic.:,It is not enough to claim that the Little Iliad passage is independentof the Iliad, however; if the Iliad is not the source for the Cyclic passage,nonetheless it must be more than a coincidence that parts of the fragmentsdescription of the death of Astyanax are also present in two Homericpassages about Astyanax. These passages are linked at a thematic, as wellas lexical, level. If there is no direct connection between the poems, theonly explanation could be independent manifestation of phraseology thatwas traditionally used in reference to the death of Astyanax. In this casethe phraseology would be context- and character-specic (the death ofAstyanax), with the Cyclic passage more directly describing the primarycontext, and the Iliad passages more (in book :) or less (in book o) evokingit. Using the terminology established above for the ut,c, ut,cco:iHector, and by extension Andromache and Astyanax, were Homeric inventions; for refutation ofthis argument see Burgess (:cc:: o;).:For philological and metrical data of the Little Iliad fragments, see Bernab e (:,;: xixii); for analysisof fr. :: Bernab e, see Dihle (:,;c: :), Davies (:,,a: ,o, :,,b: ;:,), Curti (:,,,: ,,, ,, ,),Anderson (:,,;: ,,), Bravo (:cc:b: ;,), Debiasi (:cc,: :,,). Debiasi defends the fragmentsunity; Anderson well explains the signicance of the genealogical emphasis in the phraseology.:,Janko (:,:: ::o) suggests that direct imitation may be indicated if a poet violates his own formulareconomy; unfortunately not enough of the Cycle poems has survived for them to be subject to thelinguistic and formulaic guidelines concerning exemplum and imitatio at Janko (:,:: ::,).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :;,phraseology, we could view the book o passage as an example of motifalienation. There is the same context, the walls of Troy, with Hectorshelmet representing an attacker, at least as it initially seems to the child.But there are obvious changes. The motif of the death of Astyanax isanachronistic here. Hector is certainly not the childs murderer, and thechild is actually in no danger. Astyanax shrinks back into the safety of hisnurses bosom, instead of being snatched from it, an inversion underscoredby the modication of the phraseology. The correspondence, coupled withvariance, produces intertextuality, and the traditional death of the princeis foreshadowed through external prolepsis.Andromaches premonition in book :, on the other hand, does notconstitute motif alienation, since the death of Astyanax is predicted muchas it traditionally occurs. There is narratological modulation, however,for the traditional event is foreseen and described by a character, insteadof the narrator. This external prolepsis, though explicit in its denota-tion, nonetheless has a hazy air about it; Andromache is not an omni-scient reporter and has no certain knowledge of the future, even if sheis well aware of the dire choices awaiting the women and children of asacked city. Skeptics about the pre-Homeric nature of Astyanax deathpoint out that Andromache offers alternative scenarios for the fate of herson, and also that she seems mistaken in her musings on the motiva-tion of the future murderer of her son (:.;,o,). But it is exactly herlack of prophetic knowledge when she happens to specify the traditionalfate of her child that produces a chilling effect for the mythologicallyinformed audience, especially since she uses context- and character-specicphraseology.To what degree, however, can we say that the phraseology actuallybelongs to Astyanax? Some of the diction is apparently character-specic.Anurse, :invn, would be employed for care of a child of high social status,as is the case with Astyanax. Not all children thrown off a wall would have anurse, and inthe Iliad :invnis almost exclusively connected to Astyanax.:oAnother seemingly signicant word is sctc,, which also occurs in con-nection to Astyanax in Iliad o (o.o;, in modied correspondence to thefragments phraseology; also at o.cc and o.,). This is not a rare Homericword, however, and there are different yet oddly echoing usages of sctc,elsewhere in the Iliad. At o.:,o Thetis receives the infant Dionysus intoher protecting sctc, (after the young gods nurses have been chased off ),:oIl. o.:,:, ,,, o;, and ::.,c,. The word does not occur in the Odyssey, but in the Homeric Hymnto Demeter Demeter acts as Demophoons :invn (::;, cf. :,:). All the Iliadic occurrences refer tothe nurse of Astyanax except the rst example, which refers to the nurses of the infant Dionysus.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:c jonathan s. burgessand at :.,, Thetis receives another victim, Hephaestus, into her sctc,(after his fall from the heights of Olympus), with the same formula that isused at o.:,o when Thetis rescues Dionysus, and with similar phraseologyto that used at o., when Andromache receives the frightened Astyanaxinto her sctc,.It appears that phraseology featuring sctc, in reference to Astyanaxcan also occur in the recurring motif of Thetis as rescuer of distressed divini-ties (cf. :.,,oco, her rescue of Zeus). And the motif of Thetis as rescuerat least on one occasion intersects with a motif that involves the hurling ofa divinity (notably Hephaestus) from Olympus (:.,,c, :.:,o,, :,.::,, :.,,,,, :,.:,c). This hurling-of-a-divinity motif itself often employsthe phraseology used to describe the attack on Astyanax in the Little Iliadfragment. The phraseology in question is not altogether character-specic,we must conclude; much of it belongs to a general context of hurling some-one from a great height. The lexical evidence might therefore be labelledhurling-from-a-height phraseology. Allomorphs of the phraseology areemployed, mutatis mutandis, for the hurling of Astyanax and the hurling ofdivinities like Hephaestus. Though these are very different circumstances,it is possible that hurling in the divine realm provided an ironic foil to thetragedy of the Trojan princes death.:;If the hurling-from-a-height phraseology does not belong exclusivelyto Astyanax, it must have been employed often enough in the context of hisdeath so as to be recognizably associated with it, especially when some keywords like :invn or (to a lesser extent) sctc, are present. When usedin connection with the Trojan wall, hurling-from-a-height phraseologyshould certainly be allusive to the death of Astyanax. The Astyanax linesin the Little Iliad fragment certainly are not an accidental conglomerationof free-oating formulae. Their composition by chance is ruled out by thepartial reoccurrence of the fragments phraseology in two Iliadic passagesabout Astyanax; in particular, the occurrence of the rare word :invn inthe fragment and the book o scene at the city walls conrms that there isa connection.Is the connection one of Homeric inuence, as many suspect? Thecommon assumption that the Cycle reshufed pilfered Homeric phrasesshould be resisted, since it is predicated upon an untenable conceptionof the Epic Cycle and of the epic tradition of the Archaic Age in general(Burgess :cc:). There is nothing that proves Homeric priority, and itis probable that the phraseology though employed in other narrative:;I examine this issue more fully in Burgess :c:c.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic ::circumstances commonly occurred in traditional descriptions of the deathof Astyanax.:Some of the diction is especially relevant to Astyanax, andthe phraseology in lines , of the fragment seems to have become attachedto the traditional epic description of the scene. If this is so, a reconceptionof the intertextuality between the fragment and the relevant Iliad passagesis required. The fragment would need to be seen as containing phraseologyas it was regularly employed in narration of the mythological scene ofthe death of Astyanax. When Andromache in book : imagines this samescene, there is a narratological modulation from an actual description ofthe childs death to fearful speculation about it. In book o of the Iliad theallusion is more indirect and complex. There has been alienation of thephraseology, transferred as it is to a new context and time, and there is alsoinversion: the child recoils into his nurses bosom instead of being snatchedfrom it, and instead of a murderous Greek it is his own father who reachesfor him(though a father whose visage is hidden by a warriors helmet). Thisis iteration with variation, resulting in signicantly allusive intertextuality.The passage thus serves as an excellent example of the meta-cyclic natureof Homeric poetry. A motif with its characteristic phraseology has beentransferred to a new, Homeric context; as a result the scene is deeplyresonant of the traditional, cyclic context.From a mythological perspective the fragment is a manifestation of theprimary motif, and the Astyanax passages in the Iliad passages are sec-ondary. This is not to suggest that the Homeric passages allude to theLittle Iliad. Nor do I think that they allude to a prototype of the Lit-tle Iliad, or to a prototype of the Iliou Persis for that matter; by usingAstyanax phraseology the Iliad is availing itself of phraseology commonlyemployed in the epic tradition when the scene of the death of Astyanaxwas narrated. The date of the Iliad and the Little Iliad is not relevant to myargument, for I conclude that the Iliad and the Little Iliad independentlyinteracted with traditional myth about the death of Astyanax. This tradi-tion certainly would have been exible Odysseus was often named themurderer, for instance, as in the Cyclic Iliou Persis, according to the sum-mary by Proclus. But the basic elements of the myth would have remained:Cf. Anderson (:,,;: ,,o), where it is allowed that the phraseology may be pre-Homeric, or thatthere was mutual inuence between Homeric and Cyclic traditions. He counts the conciseness ofthe Little Iliad fragment as an indication of imitation, but it is more likely that traditional epicresembled Cyclic narrative pace more than it did the leisurely expansion of Homeric narrative. Cf.the description of the battle over Achilles in Odyssey :. On the expansion and compression of epicnarrative, see Nagy (:,,oa: ;o;), and on the smaller scale of formulaic composition, Martin (:,,::co,c).Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013:: jonathan s. burgessstable, and in its epic manifestations the tradition typically included certainphraseology.4 conclusionI began by wondering at the possibility of an intertextuality of phraseologyin circumstances where there were no texts, or even any identiably promi-nent epics to which to allude. My rst test case, the ut,c, ut,cco:iphraseology, has attracted wide attention, not least because of persuasivearguments by neoanalysts about its use in Iliad :. The second test case wasthe Little Iliad phraseology, which is usually seen as imitative of the Iliad.In both test cases I concluded that there were mythological traditionsabout the death of Achilles and Astyanax to which the Iliad reacts, and thatthese traditions were often represented in epic manifestations which regu-larly employed a certain context-specic and/or character-specic phraseol-ogy. Apassage in Odyssey : seems to represent faithfully ut,c, ut,cco:iphraseology in its usual form, though with narratological modulation. Apassage in Iliad : similarly represents phraseology of the Astyanax deathscene, and we are lucky to have a Little Iliad fragment that provides aneven more direct manifestation. Recognizing the primary status of thesepassages enables us to appreciate the poetics of the relevant yet secondarypassages in the Iliad that contain motif alienation, with attendant displace-ment and/or anachronism. Such motif transference is especially fascinatingwhen it includes the textless intertextuality of language traditionally asso-ciated with specic scenes: the ut,c, ut,cco:i phraseology in Iliad :as Achilles collapses to the ground in intense grief at the news of Patroclusdeath, and the Astyanax phraseology in Iliad o when Hector meets hisfamily on the walls of Troy. The effect is ominously foreshadowing, as thedeaths of these characters are evoked by external prolepsis. Neither Achillesnor Astyanax are in any immediate danger, and indeed they will not perishwithin the course of the poem, but to an audience that was sensitive tomytho-poetic traditions, their deaths are signied.It has been noted that the traditional phraseology examined in thisstudy is not exclusively character-specic. In book :o the ut,c, ut,cc-o:i phraseology was used in its normal context, a battle over a corpse, butapplied to a character other than Achilles. This I considered an anticipatorydoublet; wonderfully effective in its immediate context, the phraseologyalso prepares for the death of Patroclus and especially for the later ut,c,ut,cco:i passage in book :. As for the hurling-from-a-height phrase-ology, it became apparent that it could also be employed in scenes of divineDownloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013Intertextuality without text in early Greek epic :,violence. Employed in certain circumstances, however, the phraseologymay effectively allude to the death of Astyanax; it is also possible that thedivine scenes provide a signicant contrast to the death scene of Astyanax.The source for the phraseology that I have explored is the general epictradition, not specic poems. This has allowed me to propose the exis-tence of a textless intertextuality that involves not one text inuencinganother, but the traditional articulation of an episode being reected bya secondary articulation of it. The passages considered primary for thepurposes of my investigation simply contain phraseology commonly usedfor the situations that they describe; they need not represent the only orbest or earliest compositions of these scenes. Nonetheless these primarypassages provide testimony for the traditional employment of phraseologyin specic circumstances. With this evidence in hand we have been ableto uncover surprisingly detailed examples of the Iliad s textless yet allusiveintertextual engagement with the epic tradition from which it stems.Downloaded from Cambridge Books Online by IP 130.60.206.43 on Fri Jul 05 18:06:36 WEST 2013. Books Online Cambridge University Press, 2013chapter 1 1Perspectives on neoanalysis from the archaichymns to DemeterBruno Currie1 introductionA fundamental, if vexed, contribution to a relative chronology ofearly Greek hexameter poetry is made by the consideration of literaryrelationships.:Put at its most general, and most simplistic: if a literarywork x can be shown to allude to a work y then y is older than x.:Such anapproach has played a key role in arguments for the priority of the Iliad tothe Odyssey, of the Theogony to the Works and Days, of the Cyclic to theHomeric epics and, conversely, of the Homeric to the Cyclic epics. Here Ioffer some reections, theoretical and practical, on such approaches.The theoretical issues are familiar. The very notion of a literary history,of establishing a dependency between works, has an especially controversialapplication to early Greek hexameter poetry.,There is even debate whetherthere are discrete works (xed texts) in this oral(-derived) tradition. Thecommon stock of phrases, motifs and themes, moreover, makes it prob-lematic to detect allusions in one work to another.,Scholars nowadays areThis piece became a xed text through performances at Oxford, Leeds and Oslo; I thank theaudiences of those respective occasions for their comments and suggestions. I have also proted muchfrom discussions with and communications from Jonathan Burgess, Margalit Finkelberg, AnastasiaMaravela, Robert Parker, Nicholas Richardson and Oliver Thomas, none of whom, however, shouldbe assumed to share my ideas; certainly none shares the responsibility for any errors of argument orfact.:See e.g. Janko (:,:: General Index s.v. imitation). I use the term literary without wishing toimply that early Greek hexameter poetry was read (widely) as literature, rather than experienced inperformance.:This simple formulation ignores the complications raised by the possibilities that a literary workmay go through different editions, or have an oral dissemination prior or parallel to its writtenpublication; it also ignores the complications of some readerresponse models of intertextuality,which allow for earlier texts alluding to more recent ones: see e.g. D. P. Fowler (:ccc: :,c),Martindale (:,,,: ;).,Cf. Burgess (:cco: :,,). Cf. Lord (:,,,: :,c, :,oc: esp. ,,:c:, :,); cf. Garvie (:,,: o and references in n. :;), Nagy (:,,oa::), Pelliccia (:cc,).,E.g. Hainsworth (:,o,: ,c), Hoekstra (:,o,: ); cf. Janko (:,:: ::,o).:Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013Neoanalysis and the archaic hymns to Demeter :,on the whole happier to assume that poets might exploit their audiencesknowledge quite generally of the mythological tradition (mythologicalintertextuality)oor might manipulate the traditional uses of type-scenes;or formulae (traditional referentiality). In any event we are not entitled to assume that HDem is the oldest of theattested Hymns to Demeter.,A couple of verses of Hesiods Theogony (seebelow) imply that the Rape of Persephone was a subject of hexameter verseas early as the eighth century, perhaps a century and a half before HDem.All the attested archaic Hymns to Demeter had associations with Attica.oThere is a notable degree of conformity between them. In the rst instancethis consists in certain stable elements of the plot: the abduction of Perse-phone by Hades, Demeters search for Persephone, Demeters hospitablereception by the Eleusinians, Demeters rewarding of the Eleusinians withthe gift of agriculture and/or her mysteries. Second, certain specic motifsrecur in some of them: Persephones gathering of owers before the rape,;Demeters sitting down by a well in Attica as an old woman. Third (apoint of particular interest for us), there seems to have been at least somecLate sixth century: Malten (:,c,a: :;, pointing to the circle of Onomacritus), Kolb (:,;;: :::,);cf. other references in Graf (:,;: :; n. :c,). Later fth century: Graf (:,;: :;,:, dating thepoem to oc, bc, and arguing that the author is Lampon or one of his immediate circle). Cf.in general, H. P. Foley (:,,: ,, n. o:), Parker (:,,o: :c: n. ::).:Graf (:,;) makes much of the transition from uncultivated to cultivated existence, relating it tolater fth-century sophistic thought, and to Sophocles Triptolemus.:So Colli (:,;;: :c).,Orpheus: P.Derv. xxii.; (= ,,F Bernab e), Marm. Par. = FGrH :,, A:, P.Berol. ,,. Musaeus:Paus. :.::.;, .:.,. Eumolpus: Suda s.v. L0uctc,. Pamphos: Paus. :.,.,, :.,,.:, .,;.,, ,.,:.,. Eumolpus: Suda s.v. L0uctc,. Pamphos: Paus. ;.::.,, ,.:;.:, ,.:,.. In general, cf. Hdt. :.:,,:.,,. Cf. Linforth (:,:: :,,).,Cf. Malten (:,c,b: ,c;). We must similarly assume the existence of earlier hexameter hymns beforeHAp and HHerm.oOn the Attic context of HDem, cf. Richardson (:,;: o, ::, ,o). The Hymns to Demeter by Pamphos,Orpheus, and Musaeus were used in the mystery cult of the Lykomid genos in the Attic deme ofPhyle (Paus. ,.:;.:, ,.,c.::, :.::.;, .:.,). Eumolpus is eponym of the Eleusinian hierophantic genosEumolpidai.;Pamphos: Paus. ,.,:.,. Orpheus: P.Berol. oc, cf. ,,,; cf. OA ::,:, Clem. Al. Protr. :.:;.: (=,,cF.: Bernab e). HDem o. For divine abductions of girls picking owers as a traditional motif ofearly hexameter poetry, cf. Richardson (:,;: :c:). Odysseus and Penelope plot the killing ofthe suitors.Penelope has dreamt of the return ofOdysseus and the killing of thesuitors, but she does not believe it., Odysseus tells Penelope to propose thecontest of the bow so that he may kill thesuitors.Penelope proposes the contest of thebow believing that she must take anew husband.column are hypothetically reconstructed, not actually attested, and henceprefaced with ).;,On a surface level, the Odysseys narrative insists that Penelope neitherrecognizes nor conspires with Odysseus. However, at a deep level, indi-vidual elements of the narrative and its overall shape intimate a recognitionand conspiracy. Following Danek and others I nd it attractive to see suchinconsistencies between surface and deep layers of narrative as an allusivetechnique, whose effect is to orient the audience simultaneously towardsthe traditional version and towards its reworking in the present poem: thetraditional narrative is both superseded and left vestigially present in the;,Danek (:,,b: ::); cf. Rutherford (:,,:: ,o, :,,o: ;:); Currie :cco: :o:,.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013:, bruno currietext. This view sees such inconsistencies not as the result of an improvisingoral poet caught involuntarily between the conicting claims of traditionand innovation (Lord :,oc: ,), but as evidencing, even advertising, thepoets intention of getting his audience to confront a new version with theold version with which it is in competition.;oIn HDemwe may see a similar tension between surface and deep layersof narrative. Here, however, the evidence of the papyrus is decient in acouple of places (see , , and o in the table) and has to be supplementedfrom other sources for the Attic myth of the Rape of Persephone (seetable ::.,).The Berlin papyrus seems to attest a version in which Hades descendedwith Persephone into the Underworld at Eleusis, whereupon Demeterfollowed Persephones cries to Eleusis, learned from the Eleusinians thatHades had taken Persephone into the Underworld, descended into theUnderworld to retrieve her daughter, and by absenting herself from theupper world caused a famine. Assuming such a traditional version, HDemwill have preserved most of the key elements in their expected order:Hades takes Persephone into the Underworld, Demeter arrives at Eleusis, afamine breaks out. But although most of the key events occur in the samesequence, the events are, explicitly or implicitly, very differently motivatedand consequently the signicance of the narrative is transformed.;;Mostprovocatively in HDem, on the surface level, Demeters visit to Eleusishas become irrelevant to her quest for Persephone.;Still, at a deep level,individual narrative elements and the general direction of the narrativeintimate a version in which Demeters sojourn in Eleusis is integral to herrecovery of her daughter. Again, I would see in this an allusive intent:HDem plays off the traditional version.;,And once again, the traditionalversion seems to be that of the Berlin papyrus. This technique of allusionimplies a detailed knowledge on the part of the audience of whole narrativesequences of earlier poetry.6 does hdem allude by inconsistency betweennarrator-text and character-text?My third technique of allusion may be thought of as a special case ofthat just considered: inconsistency specically between narrator-text and;oCf. Rutherford (:,,o: ;:), Danek (:,,b: passim), Burgess (:cco: :;c).;;H.P. Foley (:,,: :c:, n. o) well recognizes the gaps in motivation as a means for the poet toshape audience reaction and expectation even in the case of a traditional oral narrative.;For a different view of the irrelevance, cf. Richardson (:,;: :,,oc), supposing that HDem hasimperfectly combined originally separate narrative strands.;,A similar view of narrative inconsistencies in HDem is taken by Clay (:,,: :c,o, :::,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013Table ::., Comparison of the Rape of Persephone and the Hymn to DemeterTraditional Attic version of Rape ofPersephone (P.Berol., supplementedfrom other sources) Homeric Hymn to Demeter: Hades descends into the Underworldwith Persephone near Eleusis.aHades descends into the Underworld withPersephone, but there is no indicationwhere the descent occurs (,,,).: Demeter comes to Eleusis in search ofPersephone.bDemeter comes to Eleusis, but there is noindication why she does so (,,;)., Demeter reveals herself to theEleusinians and is informed by themthat Hades has taken Persephone intothe Underworld.cDemeter reveals herself to the Eleusinians,but receives no information from them(:o,). (Attestation controversial) After therevelation at Eleusis, Demeterdescends into the Underworld.dAfter the revelation at Eleusis, Demeterwithdraws into the temple which hasjust been built for her at Eleusis(,c:)., (Conjectural) Demeters absence fromthe upper world causes a famine,necessitating Zeuss intervention.eDemeter, secluded in her temple atEleusis, causes a famine by an act of herwill, necessitating Zeuss intervention(,c,,).o (Not in P.Berol.) After the recovery ofPersephone (?), Demeter instructs theEleusinians in the mysteries and/oragriculture in gratitude for theirinformation.fAfter the recovery of Persephone, Demeterinstructs the Eleusinians in hermysteries, but not in the arts ofagriculture, and not out of gratitude forany information received (;,:).aP.Berol. . Cf. Kr uger (:,,: ,,,), Richardson (:,;: :,c, under (c)).bCf. P.Berol. ,, Clem. Al. Protr. :.:c.: (= ,,:F Bernab e).cCf. P.Berol. :c:,:.dP.Berol. ::c ctv scoc, t,[t]:[ci]. I take this to refer to a descent into the Under-world of Demeter in search of Persephone, which is sufciently justied by later allusions(Hymn. Orph. :.,;; Hyg. Fab. :,:; cf. schol. Pind. Ol. o.:occ; see Richardson :,;:, :,,). Differently, most commentators have assumed rather the descent of Perse-phone into the Underworld with Hades; Bernab e (fr. ,,;.o;) actually supplements thepapyrus text to read ctv Kcoc, t,[t]:[ci :, Kcpn, c0:n] (following Buecheler,who however left the supplement in the apparatus); cf. Richardson (:,;: :).eThis motif is not attested, but is conjectured on the strength of various Near Easternparallels. First, the Akkadian Descent of Ishtar, lines ;oc, o,c, in which Ishtarsabsence in the Underworld brings an end to reproduction on earth: Foster (:cc,: ,c::);see Graf (:,;: :;,o), Burkert (:,,: :o,, n. ,:), Foley (:,,: ,,), Penglase (:,,:::o,, cf. :,,). Second, the Ugaritic Baal and Mot, where Baals absence in theUnderworld causes famine and drought (Wyatt :cc:: :,;,): see Richardson (:,;::,,), Hooke (:,o,: o). Third, the Sumerian complex In the Desert by the Early Grass,where the dead Dumuzis mother searches for him and determines to descend into theUnderworld after him: Jacobsen (:,;: ,o at ;:); see Penglase (:,,: ,:,, :,::, :,,).Note that on this reconstruction famine would have a place in the Orphic version, paceRichardson (:,;: :oc), Foley (:,,: :,:).fThis was apparently the standard Attic myth: cf. Isoc. Paneg. :, Marm. Par. (FGrH :,,A:), Paus. :.:.,.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013:cc bruno curriecharacter-text.cI begin, as usual, with an illustration from Homeric epic:the speech of the soul of the murdered suitor Amphimedon to the soul ofAgamemnon in the last book of the Odyssey (:.:::,c). This character-text is consistent with the narrator-text of the Odyssey except in a couple ofkey points: in particular, Amphimedons soul claims Penelopes complicityin the killing of the suitors. A number of considerations point to thisbeing a traditional version of Odysseus homecoming.:Danek has arguedthat [f]or the listener the discrepancies between the two versions [sc. thenarrator-text and character-text] present themselves as a citatory referenceby the [poet] to the tradition, from which his own version is made tostand out.:The Deuteronekyia of book :, like the Nekyia of book ::,seems particularly interested in exploring the Odysseys relationship withother poetry.,In so metapoetic a context, the use of a character-textto highlight the relationship between the Odyssey and earlier poetry onOdysseus homecoming makes good sense.In this light we may consider the speech of Persephone at HDem co,,:Persephone narrates to Demeter what befell her in the Underworld and inthe Nysian plain at the time of the rape (Hades ruses, respectively, of thepomegranate and the narcissus). Like the speech of Amphimedons soul inthe Odyssey this speech of Persephone throws up signicant points of agree-ment and disagreement with the version of the primary narrator (HDem,:: and ,,;). Another approach iswhat we might call an oralist approach, according to which HDem : isa blemish resulting from the poet composing in performance and failing toexclude a traditional detail when otherwise recasting traditional material inan untraditional form: the notorious nod of the oral poet.,This approachwould parallel that which has sometimes been taken to the duals of Iliad, or Zenodotus Cretan verses in Odyssey :.,cThis oralist approach sub-stantially converges with an older neoanalytical approach that explainsinconsistencies as a failure of the poet to assimilate fully a new version withan old one.,:The newer neoanalytical approach propounded by Danek,,:which I have been following, nds evidence rather of an allusive strategy:a different kind of nod to the traditional version.,,If this is correct, theBerlin papyrus would provide once again an external textual control foroFor the version where Artemis and Athena are present at the rape, cf. esp. Eur. Hel. :,:,:o, Diod.,.,.o (after Timaeus), Claudian, De Raptu Proserpinae :.:co. Also, Paus. .,:.: and otherreferences given by Richardson (:,;: :,c). See Graf (:,;: :,,;), Bernab e (:cc: ,:; note on fr.,,.,). Traditional by at least ,th cent. bc: Dale (:,o;: :,: on Eur. Hel. :,::o), Kannicht (:,o,:,: on Eur. Hel. :,:a-:), Richardson (:,;: :,c:).;So Kannicht (:,o,: ,: n. ,c, after Malten); cf. Graf (:,;: :,,). Kullmann (:,oc: :,:c) discusses this approach with reference to Bethe and Wilamowitz; a recentexample of the approach is West (:cc:a: :: and n. :o).,In general, Lord (:,oc: ,).,cIl. ,.::,: cf. e.g. Grifn (:,,,: :c:). Od. :.,, and :,: cf. e.g. Burkert (:,,,).,:Kakridis (:,,: :c): What if here and there unassimilated points escape [the poets] attention? Weshould be grateful to him for them, as otherwise it would be impossible for us to prove the extent,and above all, the nature of his dependence on his predecessors. Cf. Richardson (:,;: :,:): Allthese features may have been omitted in the epic narrative of the rape, leaving however a trace atthis point.,:See in general Danek (:,,b: Index s.v. konkurriende Alternativversionen).,,J. M. Foley (:,,;: :;c:) argues similarly against the view of a nodding Homer, but from thedifferent theoretical standpoint of traditional referentiality.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013:c: bruno currieHDem of a kind that we wholly lack for the Odyssey, and would providea rare textual basis for the attractive, but otherwise unsubstantiated, the-ory that early Greek hexameter poetry could use character-text to cite atraditional version.Cite is the term used (after Kullmann) by Danek (:,,b: passim),who is chiey interested in citation on the level of plot.,However,we may wonder whether HDem cites on the level of wording: whetherHDem : could be regarded as a verbatim quotation from earlier poetry.The list of nymphs at HDem ::, occurs in virtually identical form inHDemPBerol (P.Berol. ::; = fr. ,;.o:c Bernab e); and although theBerlin commentators quotation of HDemPBerol stops before that verse,it is possible that HDem : also occurred in HDemPBerol.,,We mightthen assume that HDem has taken over cited verses :: fromearlier poetry,,oand assume that HDemPBerol reects that earlier poetry.That assumption would receive support from the fact that in HDemP-Berol the list of nymphs in attendance on Persephone at the time ofthe rape came in its natural,;place in the narrative (in the narrator-text and at the start of the narrative of the rape), whereas its positionin HDem is anything but straightforward (character-text, and postponeduntil very late in the poem: actorial analepsis (de Jong :cc:: xi)); onceagain, comparison suggests that the context of the lines in HDemPBerol isprimary, and secondary in HDem. One could thus argue that HDemPBerol(P.Berol. ::;) preserves the traditional form of the narrative of the rape,to which HDem alludes (::) by means of extensive verbatim citationwithin character-text. Such an argument would parallel the argument above(pp. :,,) that HDemPBerol (P.Berol. :c:,) preserves the traditional form,The title of his book is Epos und Zitat; Kullmann (:,oc: :) uses zitiert of a verbatim quote, Il. :.,citing Cypria fr. :.; Bernab e; Danek (:cc:b) also explores the possibility of citation on the levelof wording (intertextuality). Allan (:cc: ::: and n. ,;) takes exception to the use of the termsquotation and intertextuality in Currie (:cco) and Danek (:,,b, :cc:b): in my viewthey remainfully viable. Apropos Allans disagreement (ibid.) with Daneks dating of the Verschriftlichung ofHomeric epic, see now also Danek in this volume.,,HDem :, cvtc opttcutv ytiptoo nds a close echo in OA ::,: cvtc ytpoi opttcuocv. TheOrphic Argonautica quite likely follows an early Orphic hexameter source at this point: see Nelis(:cc,); cf. Kr uger (:,,: ,,). Could that early Orphic hexameter source be HDemPBerol ? IfHDem : + :c, and :, were in HDemPBerol, the likelihood increases that HDem : was inHDemPBerol.,oRichardson observes that the language of Persephones character-text appears more traditionalthan the language of the corresponding narrator-text of HDem: see Richardson (:,;: o,, :,c),comparing HDem :; (narrator-text) and HDem :,,c (character-text). However, if that showsthat Persephones character-text represents an earlier version than the narrator-text in HDem, it failsto show that HDemPBerol represents an earlier version than HDem, for the untraditional-seemingverse HDem :; also occurs in HDemPBerol (P.Berol. o,).,;The phrase is Buechelers (:,c,: :;).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013Neoanalysis and the archaic hymns to Demeter :c,of Demeters self-revelation at Eleusis, to which HDem alludes (,o) bymeans of transferred motif and transferred verbatim wording.Finally, one should note how self-conscious HDems allusive engagementwith tradition is on this interpretation. HDem inscribes the traditionalversion within character-text, and narrator-text and character-text are madeto play off one another.,The striking emphasis placed by Persephone onthe veridicality of her speech, at both its beginning and its end (HDem coand ,,), might also be felt to suit a poem that plays self-consciously withdifferent versions of the same events.,,7 self-consciousness in hdemThis issue of self-consciousness of a poems awareness of its own indi-vidual standing within a tradition deserves attention, as it has beenlinked directly with the question of intertextuality in early Greek hexameterpoetry.:ccThe Odyssey shows the clearest signs of such self-consciousness.:c:HDem shows further arguable signs of self-consciousness in addition tothose already mentioned.:c:First, there is the striking tendency of HDemto duplicate motifs. Persephones return occurs in two stages: from theUnderworld to Eleusis (HDem ,;,,) and from Eleusis to Olympus(HDem ). Two deities, other than Demeter, are involved in the return:Hermes (who brings Persephone from the Underworld to Eleusis); andRhea (who brings both Demeter and Persephone to Olympus). And thereare two motherdaughter pairs, the mother ineachcase bringing her daugh-ter back to Olympus: not only Demeter and Persephone, but also Rhea andDemeter. It is tempting to think that such motifs may have been employedsingly in a traditional version of the Rape and there is in fact some evidencefor a traditional version in which Demeter, having descended herself intothe Underworld, conveyed Persephone by chariot herself directly from theUnderworld into the presence of Zeus on Olympus.:c,Such reduplication,The special status of character-text, as a vehicle for traditional material the Homeric narrator-textotherwise avoids, was recognized already by Aristotle (fr. :o, Rose, apud schol. A Il. :,.:c).,,Cf. Richardson (:,;) on HDem co, :,, ::c. On telling the truth and the (oral) poetic tradition,cf. M. W. Edwards (:,,c: ,::,); cf. Danek (:,,b: :: Wahrheitsanspruch).:ccCf. Burgess (:cco: :o,): we cannot be sure that performance traditions would have had theself-awareness about either themselves or other performance traditions to engage in allusive inter-textuality. On self-consciousness, cf. also R. L. Fowler (:ccb: ::o;).:c:See esp. Od. :.:,::c:, with Rutherford (:,,o: oc) and Danek (:,,b: ;). Poetic self-consciousness is also to be seen in the Odysseys numerous depictions of bardic performances:Demodocus in book , Odysseus in books ,::, and Phemius especially at Od. :.,:,;, ::.,,.Cf. too Od. :.:c, with Currie (:cco: :, n. ;,).:c:Well observed in general by Clay (:,,: :c:o,).:c,Schol. Pind. Ol. o.:occ, where t,t:ci suggests a traditional version.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013:c bruno currieof motifs may suggest a poet self-consciously playing with motifs that anaudience expected to be deployed and whose traditional form was wellknown to them. (We might compare Euripides handling of traditionaltragic motifs in the Helen, where the most self-conscious of tragedianstreats us to two prologues, two recognition scenes and two supplicationscenes.)Self-consciousness might also be seen in the fact that, as J. S. Clayhas put it, the poet seems to take perverse pleasure in thwarting ourexpectations and rendering the narrative progress problematic (:,,: :co).We have already seen (above, p. :,) how in HDem traditional episodesoccur without their traditional consequences ensuing. Instead of narrativeprogress, HDem gives us regress, ring-composition frequently returningus at the end of an episode to its beginning. Thus, Helios disclosure toDemeter, far from advancing Demeter in her quest, only gives her greatergrief (cyc,) than before the meetings with Hecate and Helios (HDem,c, echoing c). The episode in Eleusis does not advance Demeter inher quest either, and again the end of the episode echoes its beginning(HDem ,c:o, in ring-composition with ,c:). While the reunion ofDemeter and Persephone at Eleusis brings an apparent resolution to therecurrent theme of Demeters grief (HDem ,o ytcv o tttct:cuuc,, harking back to both ,c cyc, . . . st:c uucv and c spcoinv cyc,tctv), that resolution is only apparent. If a traditional ending indeedhad Demeter bringing Persephone back by chariot to Zeus on Olympus,then the motif that HDem offers us (Hermes bringing Persephone backby chariot to Demeter at Eleusis, HDem ,;,,) evokes that traditionalending by comparison and contrast: it is, in fact, a false ending. To convertthe false ending into a real one requires the introduction of Rhea, whoserole (like that of Helios) may be an innovation of HDem. Her involvementcertainly comes as a narrative surprise; before Zeus sent Hermes to Hades,we were told he had sent all the gods (,:,o) to treat with Demeter:evidently Rhea was one goddess he had kept up his sleeve. Rheas last-ditchintervention in HDem is comparable to a tragic deus ex machina (comparethe appearance of Heracles in Sophocles Philoctetes to ensure the properoutcome to the play after the playwright has teased us with several falseendings). And Rheas untraditional role in HDem enables an untraditionalsignicance to be given to the Rarian plain: according to Attic tradition,this was the rst place to be sown with cultivated seed by Triptolemus,after Demeter had instructed him in the arts of agriculture.:cIn HDem,:cMarm. Par. (FGrH :,, A:,), Paus. :.,.o.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013Neoanalysis and the archaic hymns to Demeter :c,its distinction is to be the place where Rhea rst alights on her mission toconciliate Demeter (,,c, ,;), with an explicit negation of the plainstraditional signicance (,co: the plain was already a qtptoicv cocppcpn,). Again, the traditional version is strongly evoked while beingnegated.:c,A last sign of self-consciousness could be seen in Zeus role in HDem. InHomeric epic gods or fate may sometimes be taken as gures for either thepoet or the dictates of the mythical-poetic tradition.:coIn HDemthe actionof the poem is from the outset signalled as coming about by the design ofZeus.:c;The second half of the poem, however, shows Zeus plan gettinginto difculties and Zeus struggling to get events back on course.:cTheend of the poem nally shows Demeter reconciled with Zeus on Olympus,and the poem thus broadly realigned with its traditional ending. Thistension between Zeus plan and the actual course taken by events in thenarrative of HDem may be seen as a gure for the hymns negotiation ofits own relationship to the tradition.:c,8 conclusionsIt is time to drawsome conclusions. First, regarding the literary relationshipof HDem and HDemPBerol. My argument builds on the recognition ofother scholars that HDemengages allusively with its tradition on the level ofplot, and on the recognition that some of its phrasing is derived fromearlierpoetry on the rape of Persephone (compare HDem :, with Hes. Theog.,:::). I have gone further thanmany scholars insuggesting that the Berlinpapyrus allows us to track the allusivity of HDem to an unexpected degree.I have argued that we may see certain common narrative structures, motifsand not least phrases as having their primary contexts of use in HDemPBeroland their secondary contexts of use in HDem. If this identication ofprimary and secondary contexts is correct, then HDemPBerol emerges asa source, either direct or indirect, for HDem. The indeterminacy of this:c,Clay (:,,: :,,). In general, cf. Currie (:cco: :,,o, on Iliad), Danek (:,,b: passim, on Odyssey).:coJanko (:,,:: o, ,;:). Compare the table of contents speeches spoken by Zeus in both the Iliadand Odyssey: de Jong (:cc:: :,); cf. Macleod (:,:: : n. :). In the latter part of the Odyssey, Athenafrequently directs the action as a kind of gure for the poet-narrator: cf. Olson (:,,,: :::, :,o),de Jong (:cc:: ::, ;,). On similar uses of the gods in tragedy, cf. Easterling (:,,,); and in Virgil,cf. Kennedy (:,,;: :;).:c;HDem , ocstv ot . . . Zt,, , Aic, cuoi; ,c Aic, tvvtoioi, ;, c:ic, . . . Zt,, | c, uivtocs, : Kpcviotc tusivnv oic u:iv.:cHDem ,:, ti un Ztu, tvcnotv; ,,, (Zeus obliged to send Hermes to Hades); :; (Zeus obligedto send Rhea to Demeter).:c,Differently, Clay (:,,: ::::,) interprets Zeus plan in cosmic terms.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013:co bruno currieformulation is meant to mirror the indeterminacy found in neoanalyticalscholarship over whether the Aethiopis is a direct or indirect source for theIliad: the Aethiopis will be a direct source if it is earlier than the Iliad andis the very poem to which the Iliad alludes; it will be an indirect sourceif, though later than the Iliad, it reects a specic pre-Iliadic poem (or,depending on ones theoretical standpoint, pre-Iliadic mythical traditionor non-specic pre-Iliadic poetry) to which the Iliad alludes.::cIf HDemPBerol is a direct source of HDem then we should expect it toemerge as primary at every point where the two may be compared; and wewould expect HDemto be more developed linguistically than HDemPBerol.This has indeed been argued by Robert B ohme, though the case is notstraightforward.:::Alternatively, if HDemPBerol were an indirect sourcefor HDem, it would be possible for HDemPBerol to emerge as primary insome points of comparison and secondary in others: that would parallela model that sees the Cypria as an indirect source for the Iliad (as givingus access to pre-Iliadic mythology and, possibly, to pre-Iliadic phrasing),but which sees the Iliad in turn as being a direct source for the Cypria.Some such model may be more adequate to the complexities of the datapresented by P.Berol.On its own, then, the literary method may not be sufcient to establisha relative chronology of these precise poems. While we can with a certaindegree of plausibility say that the use of a motif or phraseology is primary inone context and secondary in another, it remains possible that motifs andphrases may occur in their primary contexts in poems composed later thanpoems that employ those motifs and phrases in secondary contexts.:::Inother words, a relative chronology of motifs (a prime concern of neoanalysisas motivgeschichtliche Forschung) does not equate to a relative chronologyof the poems in which they occur. This is partly because conservatism andinnovation are both so rmly entrenched in the early Greek hexametertradition, and because they may coexist in combinations that are hard tofathom within a single poem.However, if my test case illustrates how difcult it may be in practice todemonstrate a direct literary dependence between a specic extant poem(HDemor the Iliad ) and a specic fragmentarily preserved poem(HDemP-Berol or the Cypria), the discussion nevertheless suggests a conclusion of::cCf. Kakridis (:,,: , if Homers source is not the Aethiopis itself, at least it is an epic which . . . isto be to a great extent identied with the Aethiopis), Kullmann (:,,:: :,c), Dowden (:,,o:o:), Burgess (:cco: :,,).:::Esp. B ohme (:,;c: :c:::, :,,: :).:::Cf. the opening paragraph of Danek in this volume (p. :co), and Burgess in this volume (p. :;:).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013Neoanalysis and the archaic hymns to Demeter :c;more general value: it may not be mistaken in principle to think in terms ofliterary relationships between specic poems in the early Greek hexametertradition.::,To think exclusively in terms of mythological intertextualityor traditional referentiality may be to limit unduly the possibilities of thispoetic tradition. If each of my techniques of allusion is accepted for HDem,then we must posit an audience of HDem familiar with a version of thestory of the Rape of Persephone on several different levels: they will haveknown (and have been able, at least passively, to recall) an earlier version ofthe Rape in which (a) certain specic events occurred in a specic sequence,(b) certain specic scenes and motifs were drawn in considerable detail, and(c) certain specic hexameter verses and phrases were employed.::It willbe obvious that such a scenario goes beyond mythological referentiality:elaborate narrative structures and verbatim phrases are evoked.::,Nor arewe dealing with verses or phrases that were traditionally used to describea particular mythological event without being anchored in any particularpoem.::oFaced with evocations of whole narrative structures, of scenes andof verses, I do not see what is gained by refusing to speak of allusion to aparticular poem.::;For the sake of this conclusion, it makes little differencewhether HDem is alluding to HDemPBerol or to another poem, many of::,Cf. Dowden (:,,o: ). Differently, Burgess (:cc:: :,,; :cco: :,: The Homeric epics . . . probablydo not allude to specic poems). Allan(:cc,: :): [T]he pursuit of specic dependence or inuence(from Homer to the cyclic poems, or vice versa) is, in the pre-textual stage of early Greek epic, amisleading methodology; but the pre-textual stage of early Greek epic (again at Allan :cc: :::n. ,;) hardly describes any historical stage of Greek epic; cf. Pelliccia (:cc,: ,;), J. M. Foley(:,,;: :o,).::For (a), see above, p. :,; for (b), see pp. :,,; for (c), see pp. :,, and pp. :c:,.::,Contrast Burgess (:cco: :,).::oContrast, again, Burgess (:cco: :,); cf. Burgess (:cc:: :,, this vol.: p. :o).::;Compare and contrast Burgess in this volume (p. :;c, point ,). Burgess posits oral epic traditions,whose narrative outlines and phraseology were sufciently stable to form the basis of textlessintertextuality in early epic. It is an important question for me when we should begin to recognizeoral epic traditions of such stability as a poem (on the understanding that a poem in the earlyepic tradition may have a very largely, but not totally, xed textual form: see below, n. ::,).There is thus both important convergence and important divergence between Burgesss positionand my own. Whereas Burgess thinks of oral epic traditions with a very high degree of xity, Iprefer to think of hexameter poems of less than total textual xity. The difference is more thanjust terminological. To talk of poems will permit one to think in terms of individually authoredcompositions, and to entertain the possibility that certain poems may stand out from theirtradition as classics in their own time and thus prime targets for later allusion (my wordinghere is chosen to chime with both Burkert (:,;,: ,;) and Taplin (:,,c: :::::)). By contrast,to speak of allusion to oral epic traditions (even ones that were remarkably xed on the lexicallevel) implies an impersonal and anonymous model of allusion, on which individual poems orpoets could scarcely acquire prominence within their tradition, and on which interaction remainsresolutely on the parole-to-langue level (see above, p. :, and n. ::). A related consideration is thedegree of poetic self-consciousness vis-` a-vis its tradition that an early Greek hexameter poem couldpossess: another point of divergence between Burgess and me (see above, pp. :c,, and n. :cc).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013:c bruno curriewhose features (plot, motifs and verses) are retained in HDemPBerol. Theargument, of course, presupposes a considerable degree of textual xity inthe early Greek hexameter tradition,::but not absolute xity: early hexam-eter poems might undergo small-scale changes in reperformance or textualtransmission without that affecting their ability to function as the objectof allusion or intertextuality for other poems.::,Throughout this essay I have argued for a reading of HDemthat parallelscertain well-known neoanalytical readings of the Iliad and Odyssey. Thoseneoanalytical readings have provided interpretative paradigms by whichto understand the literary relationships between the two archaic Hymns toDemeter. In turn the two archaic Hymns to Demeter give these neoanalyticalreadings a textual footing which they otherwise lack.::cSo circular anapproach does not of course prove the legitimacy of such readings ofthe Iliad and Odyssey. But it does suggest the viability of extending theseneoanalytical readings to other early hexameter texts.:::If a theorys valueresides in part in how well (how comprehensively, how attractively) itenables one to make sense of the available data then these perspectiveson neoanalysis from the archaic Hymns to Demeter have a serious claimon our attention. If it is true that the real difculty with allusion orintertextuality in early Greek hexameter poetry is not one of theory butof evidence (Dowden :,,o: ) then we cannot afford to ignore the dataoffered by HDemPBerol and HDem, its very considerable complexitiesnotwithstanding.:::Nor should it be thought very strange that the criticalissues surrounding Homeric neoanalysis are seen to replicate themselvesin miniature with HDem. Walter Burkert once observed (:,;,: ,,) thatthe critical issues in Homeric analysis are played out, on a small scale,in the Homeric Hymn to Apollo. In a different but complementary wayBernab es decision to edit the Orphic fragments in volume II of PoetarumEpicorum Graecorum Testimonia et Fragmenta alongside the fragments of::Cf. on this question Danek in this volume (p. :::, concluding paragraph).::,HHerm. :, and Hymn. Hom. :.:, are clearly two versions of the same poem, the divergencesbetween which may be seen as the result of the vagaries either of performance tradition (Hainsworth:,a: :,,c) or of textual transmission (cf. C` assola :,;,: ,,;). Either way, the degree of xityexhibited by the poem would seem quite sufcient to enable it to function as an intertext: cf.Currie (:cco: :).::cSee pp. :,, and :c::.:::This extension itself has interesting implications: motif transference and intertextuality will notjust be Homeric. Differently, Burgess (:cco: :o:, :o).:::About :o verses of HDemPBerol are preserved, and the complete HDemPBerol can hardly havetotalled more than a couple of hundred verses (HDem totals ,, verses). Contrast the Cypria, ofwhich some ,c verses are preserved out of an original :: books (totalling some ,,,cc verses, on aconservative estimate).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013Neoanalysis and the archaic hymns to Demeter :c,the Epic Cycle in volume I invites us to expand the repertoire of early Greekhexameter material to which neoanalytical approaches may be applicable.I am conscious of having based some large conclusions on controversialtexts and controversial methodologies: it is perhaps appropriate to endby reviewing the problems. First, the problems surrounding the Berlinpapyrus cannot be minimized; in particular, the rst-order questions thatdominated the rst part of my analysis lack a decisive resolution. I haveassumed that not all the verses in P.Berol. have been generated by HDem,but in at least some cases (P.Berol. :c:, HDem ,o, perhaps P.Berol.::; HDem ::,) are older than HDem and are alluded to by HDem.Second, it is legitimate to doubt how transferrable conclusions drawnfrom the archaic Attic Hymns to Demeter may be to the Homeric epics.In the rst place, the Hymns to Demeter may have had a quite restrictedcirculation: circumscribed temporally, geographically and contextually (ifall are products of sixth-century Attica and performed in the context ofmystery cults). So selective a public may have created optimal conditionsfor allusion between poems, especially such short poems. There is also aquestion of (relative) orality:::,one might suppose that the poets of the(sixth-century) hymns worked with written texts in a way that the (eighth-or seventh-century) poet(s) of the Iliad and Odyssey did not. However,an extreme contrast between the Homeric epics and the hymns alongthese lines is not attractive: probably we should think of the Iliad and theOdyssey as existing in written form at the moment of their conception;::moreover, the archaic hymns were oral in the sense that is most crucial forour purposes, that they were performed to audiences who (for the mostpart) can hardly have known them in any other form.::,Proper though itis to ponder the cultural differences that a century or so may have brought,it is proper also to remind ourselves that we are dealing with a far closercomparandum than more culturally remote oral traditions can provide.::,On this question, see Janko (:,:: ::).::Cf. A. M. Parry (:,oo), J. M. Foley (:,,;: :o,). ::,Cf. Richardson (:,;: ,,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 13:52:15 WEST 2013. Books Online Cambridge University Press, 2013chapter 1 2The relative chronology of the Homeric Catalogueof Ships and of the lists of heroes and citieswithin the CatalogueWolfgang KullmannI should like to begin with some preliminary remarks. The topic is notnew and is much debated. I myself have set forth my opinions on it inseveral publications,:but there are some new aspects which seem worthdiscussing. I presuppose that we are able to speak of relative chronologyonly if it is possible to detect recognizable differences in the age of certainparts of the text or of certain constituent elements of it; and I think this isthe case with the so-called Homeric Catalogue of Ships (Il. :.,:;,,).My thesis is that the poet of the Iliad took over the epic Catalogue ofShips in a xed form as a whole from an extraneous source or from one ofhis own earlier performances of another epic and adapted it to this poem.In a way the Catalogue belongs to the scenes in the rst books of theIliad which in one way or another mirror the events which took place atthe beginning of the war, as I have pointed out at length in Quellen derIlias.:But there are differences. Take for instance the famous Teichoskopiain book ,. Though we would expect that it took place in the rst year ofthe war, the poet makes clear that a long time has passed since then. Helen,ashamed at the sight of her husband, whom she has deserted, and lledwith the deepest remorse, declares: Would I had chosen grim death whenI followed your son here, leaving my bedroom and kin and my late-borndaughter and my delightful friends of my own age (,.:;,,). And pointingout Agamemnon to Priam she says: and he was my brother-in-law, slutthat I am, if indeed he ever was (:c).The motif probably does not come from a description of a similarsituation at the beginning of the war, but was taken over from the famousTeichoskopia in the epic of the Seven against Thebes.,Nevertheless theconnection between this Teichoskopia and the situation at the beginning ofthe war cannot be doubted, no matter how we interpret it. However, in theI should like to thank Hans-Wilhelm Nordheider and Antonios Rengakos for helpful suggestions.:See especially Kullmann (:,oc: ,ff., :,,,: ::,;).:Cf. Kullmann (:,oc: ,o,;). ,Cf. Kullmann (:,,:: :c:).::cDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships :::Catalogue of Ships the strict concentration on the situation at the time ofdeparture is extremely surprising. We mainly hear of the number of shipsat the disposal of the leaders when they were embarked. Yet there are someallusions to the battleeld. These are restricted (a) to the contingents forwhich new leaders are introduced, Podarces instead of Protesilaus (:.o,,;c,), Medon instead of Philoctetes (:.;::): in both cases we nd theword scounot(v) (he arranged the warriors); (b) to political additions,which are possibly, but not necessarily, interpolations, in :.,:,o (thePhocians have a position near the Boeotians) and :.,,; (the SalaminianAjax arranges his warriors near the Athenians); (c) to the most prominentleaders Agamemnon (:.,;;,) and Menelaus (:.,;,c); (d) to Achilles,because he refused to ght (:.oo,). In all these cases the allusions areadditions to the stereotypical bulk of the Catalogue which, if consideredas an episode of the epic, is composed in a very rigid style. Apparentlysome of the additions have caused the loss of the leaders patronymic (i.e.of Protesilaus, Philoctetes, Ajax, Achilles), which conrms the xed formof the original catalogue. This implies that it was taken over as a wholefrom another epic context in which the departure from Aulis was describeddirectly. Its poet may have been the same as the poet of the Iliad.There is another irregularity in the Catalogue, which I shall now discussin detail: the contingent of the Boeotians, as the rst described in theCatalogue, has ve leaders, whereas the maximum in the other entries isjust four (in the case of the Epeians). Even more astonishing is the factthat these ve leaders are not especially prominent in the myth. WhereasPeneleos and Leitus in , were at least suitors of Helen in Apollodoruscatalogue (Apollod. Bibl. ,.:c.), Arcesilaus, Prothoenor and Clonius aremere llers destined only to be killed by the Trojans later in the Iliad.On the other hand, there is a very prominent Boeotian not mentionedin the Catalogue or in the rest of the Iliad but important in the legend.This is Thersander, son of Polynices and legitimate successor who becamethe legal king of Thebes after its conquest by the Epigoni according toPausanias ,.,.:, ,..;. Possibly he was mentioned in the Ps.-Hesiodic Catalogue of Women fr. :cc.: West (= F :c,.: H) asassumes Cingano (:cc,: :,c).,Wathelet (:,,:: ,,) suggested that the original list contained a verse like c o cpc Onc, tycvt0s:iutvcv t:citpcv. Cf. Cingano (:ccc: :,: and n. :, :c).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013::: wolfgang kullmann(Kullmann :cc:b: :,oo:)), during the expedition of the Achaeans toMysia or Teuthrania, which they destroyed by mistake assuming it wasTroy.In Quellen der Ilias in :,oc I propounded the hypothesis that the poetof the Iliad knew of the Teuthranian expedition and the second departurefrom Aulis after the sacrice of Iphigenia eight years later, but concealedhis knowledge (Kullmann :,oc: :,c, :oc, :,ff.). I argued (a) that Helenspeaks of twenty years absence from her homeland (Il. :.;,o), whichincludes the expedition to Teuthrania; (b) that Neoptolemus was begottenat Scyros (:,.:,;), which seems to presuppose Achilles stay on the islandwhen he travelled home from Teuthrania; (c) that the sacrice of Iphigeniais referred to when Agamemnon addresses Calchas as a seer of evil whonever prophesies anything favourable (:.:coff.); and (d ) that Arcesilaus,Prothoenor and Clonius are substitutes for Thersander in the Catalogue ofShips.oMy hypothesis was neglected by my colleagues apart from DenisPage and Uvo H olscher who doubted it in their reviews of :,o: and :,oorespectively (Page :,o:: :c,ff., esp. :c,; H olscher :,oo: ::c:). Fortunately,it is now supported by the new Archilochus papyrus, published by Obbinkin volume o, of The Oxyrhynchus Papyri (Obbink :cc,). In the fragmentthe battle between the Achaeans and Telephus in Mysia is narrated. Tele-phus seems to be called Apscoion,, which alludes to his mother A0,n,so being the great-granddaughter of Aps,, the eponym of the Arcadians.We are told how Telephus put the Achaeans to ight and drove themback to the coast, and that the River Caicus was lled with corpses. Thename Teuthras is mentioned as well as a cry and gratitude to a father. Themythological background can be reconstructed from the Cypria (Proclus :, according to my numeration) and, in part, from Apollodorus withrespect to the relationship between Telephus and Teuthras, but above allfrom Hesiod fr. :o, West (=F ;: H).;In the Catalogue of Women it is toldhow the gods brought the little Auge to Teuthras, who adopted her andbrought her up like his own daughters. Later she encountered Heracles,who was on the way to Troy, and she bore himTelephus. FromApollodorusBibl. ,.,.: we can supply the fact that Auge married Teuthras, who adoptedoKullmann (:,oc: :,ff.). With respect to argument (d ) cf. especially :,c, :oc, :,, :o,; and Cingano(:cc,: ::;ff., esp. :,ff.).;In Kullmann (:cc,: ,ff., esp. :, n. ,,) I have argued that this version ts to the role of Heraclesin the Trojan myths better than that of Hecataeus FGrH I F :,a (= Fowler :ccc: :,). Accordingto him Auge was engendered by Heracles already in Tegea and banished by her father Aleus andexposed in an ark which landed in Mysia. But this looks like a doublet of the story that Dana etogether with her son Perseus was exposed in an ark by Acrisius (cf. further versions in Apollod. Bibl.:.;.. and ,.,.:).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships ::,Telephus and made him his successor. Perhaps the cry happened at anepiphany of Telephus father Heracles.The context of the new fragment of the elegies of Archilochus is opento speculation. But an attractive suggestion has been made by Parsons(Obbink :cc,: :c). He believes that Telephus functions as an exampleof Archilochus own fate when he lost his shield in a bush (fr. , IEG).According to the Cypria he was wounded by Achilles (Proclus :,) becauseDionysus made him stumble over a vine shoot (Cypria fr. :c Bernab e,conrmed by Apollod. Epit. ,.:;) and perhaps lost his shield (see Philostr.Her. :,.,:, :,.:, :,.:,). Thersanders death at the hands of Telephus isnot mentioned, but this would have been irrelevant when the story servedas an example.I think this fragment is important for the history of epic in general::. The fragment conrms that the motif of the Teuthranian expeditionwas not an invention of the poet of the Cypria, because it antedates itscomposition considerably. Certainly, froma narratological point of viewand in relation to the whole story of the Trojan war, it creates suspense,but it was not a mere poetic invention.:. Its date is very close to the date of the Iliad as suggested by WalterBurkert, Martin West and myself (though, of course, this is a much-disputed question (Kullmann :cc:b: ,,)). But it is likely that thestory of Telephus heroism is older than the Iliad.,. The conformity of the version of Archilochus with the version of theCypria is astonishing. In a sense this supports the hypothesis that thereexisted a canonical sequence of events in oral poetry, a Faktenkanon (asI have called it in Quellen der Ilias), to which the Teuthranian expeditionbelonged (Kullmann :,oc: :::,, :,,).. The conrmation of my assumption that this is an old story leads tothe question of its historical background. It obviously mirrors colonialexperiences. The story suggests that in myth the colonization was notone-sided. The gure of Telephus, son of Heracles and of Arcadianorigin and heir to the Mysian King, seems to show that fraternizationalso existed and that in this part of the myth aggressive and peacefultendencies were combined.,. The question arises why the whole sequence of the second departurefromAulis was concealed by the poet of the Iliad. When I wrote Quellender Ilias I thought this may have been because Homer did not acceptthe mysterious sacrice and removal of Iphigenia from the altar and herreplacement by a hind. But now I think that the main reason is that thisepisode would have impaired Homers conception of the Trojan War,Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013:: wolfgang kullmannwhich knows about, but deliberately excludes, the Aeolian colonizationof the coast of Asia Minor.o. The story of Telephus, son of Heracles, who was wounded by Achillesbut later healed by him after he had promised to show the Achaeans theright way to Troy, is a link between the myth of the rst destruction ofTroy by Heracles and that of the second by the warriors of Agamemnon.The second occurred with the aid of earlier Greek settlers in Asia Minor.;. One may ask whether it is possible that the story of Heracles journeyto Troy via Mysia which ended with the rst capture of Troy, as partlytold in the Iliad, is the original Trojan myth, whereas the story of itsconquest in order to regain Helen is secondary.As for the Catalogue of Ships, the new papyrus supports the claim thatThersander originally belonged to it and was the main representative ofBoeotia. Apparently the Iliad has abbreviated the Trojan legend by omittingthe Teuthranian expedition, the death of Thersander and the sacriceof Iphigenia. Moreover, the old puzzle of why there are ve leaders ofthe Boeotians is solved. The original catalogue apparently only knew ofthree leaders, a number which also occurs in other entries. As a result weare able to conclude (with much more condence than before) that theCatalogue of Ships antedates the Iliad and belongs to a more completeview of the Trojan war myth.I proceed to the list of heroes. They come fromevery region of mainlandGreece as well as the southern islands of the Aegean. They are the comman-ders of the ships and warriors from the regions and the cities mentioned ineach entry. But they are not the kings of these regions, similar to the kingsof the Mycenaean territories, i.e. of Thebes, Pylos or Mycenae, accordingto the picture presented by archaeology. Some mythological characters arenot mentioned in the Catalogue, like Nauplius, the eponym of Nauplia,and his son Palamedes. Although they play an important role in the Tro-jan legend, they are suppressed in the Iliad, Cf. Kullmann (:,oc: :o,o, ,c::, ,,, :cc:b: :o;, :;), Schlange-Sch oningen (:cco: ,ff.).,Cf. Kullmann (:,,:: :o;, :cc:b: ;off.).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships ::,ghters from Pherae, mentioned in Iliad ,.,:ff. as being under the com-mand of Ortilochus, seem originally to have constituted an autonomouscontingent. Presumably this passage is a mythological relic.:cSometimes the Catalogue provides additional brief information aboutthe heroes. In part this is genealogical in nature: so Ascalaphus and Ialmenuscoming from Orchomenus are called sons of Ares and Astyoche, whosecretly had an affair with the god (:.,:,:,); Polypoetes is presented as theson of Pirithous, the Lapith, and Hippodamia in :.;c:, and there is anallusion to the battle of the Lapiths and Centaurs on their wedding day(:.;,).Some heroes are given a personal characterization. The Locrian Ajax,son of Oileus, is compared, to his disadvantage, with the great Ajax (:.,:,c). Menestheus, we are told, is good at deploying chariots and troops(:.,,,,). Meges is said to be the son of Phyleus, who was angry with hisfather (Augeas) and emigrated to Doulichion (:.o:,). With respect toThoas we hear that the sons of Oeneus, including Meleager (and implicitlyTydeus), were no longer alive. Tlepolemus reason for emigrating to Rhodesis explained by his need to ee because of the murder of Licymnius (:.oo:). The people of the Euboean Elephenor, i.e. the Abantes, wear their hairlong at the back and are good warriors (:.,:). It is Agamemnon whogives the Arcadians the ships they need (:.o:::,).In general the narrative exhibits features which also occur in othergenealogical literature, as, for example, in the Ps.-Hesiodic Catalogue ofWomen. There we nd a similar mixture of genealogy and hints at themythological background. This catalogue poetry appears to have had along oral tradition.Some of the leaders mentioned in the Catalogue do not occur againin the rest of the Iliad. Apart from Philoctetes, who was left at Lemnos,they are the Phocian Epistrophus (:.,:;), brother of Schedius, Agapenor(:.oc,), representative of the Arcadians, Nireus of Syme (:.o;:), Phidippusand Antiphus (:.o;), sons of the Heraclid Thessalus, leading a contingentfrom the Dodecanese, Guneus from the unknown Cyphos (:.;), whomthe Enienes and the Peraebi followed, and Prothous (:.;,o), leader ofthe Magnetes. And, as Kirk (:,,: ::,) has stressed, the leadership of theEpeians as described in the Catalogue is not reected in the rest of the Iliad.Thalpius and Polyxenus (:.o:, and o:,) are completely absent, whereasOtus fromCyllene is called a leader of the Epeians in :,.,:, alongside Megeswho in the Catalogue represents the people coming from Doulichion. In:cCf. Kullmann (:,,,: ::,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013::o wolfgang kullmannsum: nine of forty-six leaders mentioned in the Catalogue (Philoctetes notincluded) do not occur in the rest of the epic; ten will be killed later in thepoem, but some of them probably in conict with other traditions. Othersare mentioned in an unimportant context.A certain tension between the Catalogue and the rest of the Iliad cannotbe denied. It seems that many of the leaders owe their inclusion in theCatalogue to the fact that their fathers or grandfathers were prominentcharacters in older legend. This is of course the case with Diomedes,Sthenelus and Euryalus, who belong to the Epigonoi in Theban epics,although they are prominent in the Iliad too (the same holds true forThersander with respect to the original Catalogue). And it is certainly trueof Polypoetes, son of the Lapith Pirithous, and Leonteus, grandson of theLapith Caeneus, who recall the famous ght of the Lapiths and Centaursalluded to in Iliad :.:o:ff.Many leaders in the Catalogue of Ships descend from the Argonauts.This is probably the case with Schedius and Epistrophus whose fatherIphitus is mentioned in Apollodorus catalogue of the Argonauts (Bibl.:.,.:o; cf. Ap. Rhod. Argon. :.:c;ff.). Eumelus is also connected to thelegend of the Argonauts, rstly through his mother Alcestis, the mostbeautiful of the daughters of Pelias, as mentioned in the Catalogue (:.;:,) for according to the legend it was Pelias who gave the decisive orderto Jason to bring back the Golden Fleece from Colchis before takingover his realm; and secondly through his father Admetus, who occurs inApollodorus list too. The father of Philoctetes was apparently anotherfamous Argonaut, Poeas, mentioned only in Od. ,.:,c, who killed thegiant Talos, a bronze monster at Crete which possessed only one full bloodvessel, with an arrow in the ankle (Apollod. Bibl. :.,.:o). Carl Robertcomments: Because Poias played a decisive role in the oldest form ofthe Talos adventure he must have belonged to the Argonauts already veryearly.::The reliability of the list of Argonauts in Apollodorus and its relativeage are conrmed by the entry for Philoctetes in the Catalogue of Ships.According to it a city called Thaumakie (Thaumakoi in historical times)belongs to Philoctetes region. And Apollodorus mentions that Poeas wasthe son of Thaumacus, apparently the eponymous founder of Thaumakie.This connection is not mentioned in the Iliad at all and is evidentlyunknown to it, so that Apollodorus is not dependent upon the Iliad in thisrespect. Another famous Argonaut was Ancaeus, father of Agapenor, leader::Cf. Robert (:,::: ;o): Da aber . . . Poias in der altesten Form des Talosabenteuers eine entschei-dende Rolle spielt, mu er schon fr uher zu den Argonauten geh ort haben.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships ::;of the Arcadians, possibly identical with a Pleuronian Ancaeus, mentionedin Iliad :,.o,, as the opponent of Nestor in a boxing match. The Iliadmainly presupposes an epic version of the Argonaut saga, as is clear fromIliad ;.,o;ff., where it is said that the Jasonid Euneos, son of Hypsipyle,named, according to his father, the man with the good ship, i.e. theArgo, sent wine to the Achaeans. It seems that it was particularly (butnot exclusively) the fathers of the Thessalian leaders in the Catalogue ofShips who participated in the expedition of the Argonauts. Unfortunately,the sources of the catalogue of Argonauts in Apollod. Bibl. :.,.:o areunknown,::although they may ultimately go back to oral traditions. Elevenor twelve leaders mentioned in the Homeric Catalogue of Ships havefathers or (in one case) another relative among the forty-four participantsin the expedition of the Argonauts enumerated by Apollodorus (Schedius,Epistrophus, Ajax, Diomedes, Agapenor, Odysseus, Tlepolemus, Achilles,Eumelus, Philoctetes, Leonteus and perhaps Protesilaus (?):,), and veleaders who do not play an important role in the Iliad occur in his listof Argonauts themselves (the Boeotians Peneleos and Leitus, the MinyansAscalaphus and Ialmenus, and Euryalus)! Perhaps the poet of the Catalogueof Ships had no names of their sons at his disposal and so adopted theArgonautic heroes into his own catalogue.Another legend, The Calydonian Boar Hunt, is indirectly referred toin the Catalogue through the reference to Oeneus son Meleager (andimplicitly Tydeus) when the Aetolian contingent led by Thoas is described(:.o:). Nestor represents sagas of Pylos and Elis, whereas Agamemnonand Menelaus are Pelopids who are in a way colonial intruders into themythology of the Greek mainland in so far as they originally come fromthe Aeolian colonies on Lesbos and the coasts of northern Asia Minor.:The leaders of the Dodecanese are Heraclids of the rst generation likeTlepolemus (as is Telephus in Mysia), or of the second (Phidippus andAntiphus, sons of Thessalus). It should be added that Heracles is a mytho-logical character who is ideal as the father of founders of cities in foundation::Some suggestions are made by Dr ager (:cc:: ::, :cc,: :o), Scherer (:cco: ,,o).:,According to Ps.-Hesiod fr. :,,.o West (= F :c.o H) Protesilaus was a son of Actor (who wasa son of the Aeolid Deon). This seems to be the original version. In Iliad :.;cff. it is said thatProtesilaus is a brother of Podarces, son of the Phylakid Iphiclus (i.e. grandson of Deon), andthe successor in the leadership of his contingent; but this is perhaps an innovation of the poet ofthe Iliad. Cf. Kullmann (:,oc: :o). Another Actor, son of Hippasus, and another Iphiclus, son ofThestius, were Argonauts according to Apollodorus and older sources, as is stressed by Grossardt(:cc:: ::;). On the other hand, the extraordinary faculty of running over the corn elds withouttouching them ascribed to the Phylakid Iphiklos (Ps.-Hesiod fr. o: West; Iliad :,.o,o) is a featurewhich is characteristic of Argonautic adventures. Cf. West (:,,: :,,).:Cf. West (:,,: :,,), Kullmann (:cc:b: ;;, ::,:).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013:: wolfgang kullmannlegends because in myth his strength is combined with considerable sexualactivity. Just look at the list of sons attributed to him in Apollod. :.;.To sum up, the list of the Achaean leaders is a panhellenic groupingof descendants of famous heroes known to the audience from older epicpoems and local legends. By far the most important epic tradition whichantedates the Trojan cycle of legends is the saga of the Expedition of theArgonauts. This discovery has considerable consequences. Probably a lotof the heroes of the Catalogue of Ships and the Iliad were either borrowedfrom earlier oral epic legends, especially from an oral Argonaut epic, or ayounger generation of sons, whose fathers were famous in these legends,was invented. It cannot of course be ruled out that through poetic inventionthe fathers of the Trojan War heroes sometimes later became Argonauts.But in the development of Greek mythology the existence of a group offorty-six Achaean leaders as described in the Catalogue of Ships is a verylate phenomenon.There is signicant disagreement, however, between the catalogue ofthe leaders and that of the cities. The Thessalian heroes are not as rmlyrooted in their regions and cities as most of the heroes of other parts of theCatalogue seem to be. This fact is generally accepted even though thereare highly contradictory interpretations. If we assume that the Cataloguemirrors the specic view of a poet of the beginning of the seventh centurythen we have to admit, as I do, the following result. The regions of Achillesand Protesilaus overlap (Halos lies on the Pagasitic Gulf in the region ofProtesilaus, not on the Maliacic Gulf ). In the same way the region ofEurypylus is confused: the Hypereian spring is found in the city of Pheraebelonging to the region of Eumelus, and Ormenion is situated at the footof Mt Pelion on the Pagasitic Gulf belonging to the region of Prothous(neither belonging to the region of Eurypylus). The region of the LapithsPolypoetes and Leonteus extends to the place given to Guneus (the city ofGonnoi is situated in their region, i.e. the main city of the Perrhaebians,a people allocated to the command of Guneus). On the other hand theregion of Guneus surprisingly reaches to the River Titaressos (most likelythe Europos, a tributary of the River Peneios in the middle of Thessaly)and Dodone in the far west. The places attributed to Philoctetes are totallyconfused. Meliboea, Methone and Olizon belong to the region given toProthous (about the river Peneios and the mount Pelion), whereas Thau-makie (the native town of his father) is to be identied with Thaumakoi,which is situated in the south of Thessaly on the border with Phthiotis(Strabo ,.,.:c), although it does not directly impair the territory of theDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships ::,other heroes.:,Perhaps the other cities are only attributed to Philoctetes inorder to give him a region.I think we cannot avoid following Niese (:;,: :ff.) and Giovannini(:,o,: ,ff.) who claim that the poet of the Catalogue has distributedidentiable cities froma list perhaps of the beginning of the seventh centuryamong well-known characters of myth in order to give each of them akingdom without always knowing precisely the geographical situation. Atthe same time he may have been inuenced by mythological associations.It runs against the character of early Greek myth to ascribe to certain heroeslike the Phthian Achilles the rule over a number of denable autonomouscities. This sort of combination is an articial construct.We proceed to the list of cities. Just as with the heroes, so the citiessometimes receive an additional remark. The people of Dorion belongto the contingent of Nestor and mention of this place induces the poetto tell the story of the meeting with the Muses of the Thracian singerThamyris of Oichalia, and how Thamyris boasted of being better thanthem (:.,,occ). It does not matter whether the poet of the Cataloguehas confused Dorion with Dotion in Thessaly where the Ps.-HesiodicCatalogue of Women places the story (fr. o, and ,,.: West) or viceversa.:oUnlike the list of heroes the list of cities seems to be almost contemporarywith the poets lifetime. It is remarkable that the distribution of the cites ofThessaly among the heroes is confused whereas, according to Giovannini(:,o,: ,,), every Thessalian city named in the Catalogue can be securelyidentied with the exception of only three: Oichalia, Asterion and Elone.Moreover, Oichalia can probably be deleted from this list. According toVissers interpretation of Strabo .,.o and ,.,.:; (:,,;: ,:ff.) it seems clearthat the historical Oichalia is situated in the Hestiaeotis near Trikka as theCatalogue says (:.;,c). The same confusion occurs with respect to Douli-chion and the Echinads. According to Strabo :c.:.:, an island of Dolichaexisted. But it is impossible that Dolicha and the Echinads ever existedas a region capable of sending forty ships under the leaderhip of Meges,grandson of Augeas and a fugitive from Elis.:;Apparently the geograph-ical names are correct, but the region has been invented by the poet ofthe Catalogue, probably on mythological grounds. The alleged emigrationof Phyleus contradicts the rest of the Iliad in which, as we mentioned,Meges leads the Epeians. The story of Phyleus anger at his father seems:,See above p. ::o. :oCf. Hirschberger (:cc: F ,). :;See Giovannini (:,o,: c).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013::c wolfgang kullmannto have been of peculiar interest to the poet of the Catalogue. Of coursethe geographical description of the regions contributing to Agamemnonand to Diomedes can only be explained as a contamination of differentmythological traditions.These are not the only geographical contradictions between the Cata-logue and the rest of the Iliad. We nd another inconsistency of this kindin Iliad :.cc. There the Boeotian locality of Yn is mentioned. Strabo(,.:.:c) identied it with the village Yci which he found near the ForestLake ('Yisn iuvn). (The coexistence of plural and singular forms is com-mon, e.g. in Musnvn and Musvci or Onn and Oci.) This contradictsanother occurrence of Yn at Iliad ,.;c;ff. There it is said that Oresbius,who was killed by Hector, lived at Hyle on the so-called Cephisian Lake,normally identied with the Copais basin. Strabo comments that Homermeans the Hulike limne . But this is of course special pleading. The expla-nation of Wallace (:,,;: :) is no better. He suggests that the village wassituated between Lake Copais and the Forest Lake. Apparently this is aninconsistency between the Catalogue and the rest of the Iliad.So far our inquiry suggests that we should analyse the list of citiesindependently fromthe list of heroes. The sheer number of about :oc citiesraises the question of its probable historical background. As I have pointedout elsewhere (Kullmann :cc:b: :c:ff., :cc;: :::ff.), I am convinced thatthe list has something to do with administrative work conducted in therst half of the seventh century bc in connection with the organization ofthe Olympic Games.Most probably we nd an allusion to the Olympic Games in Iliad::.o,ff.:There Nestor says that the Pylians had sent a four-horse chariotto divine Elis in order to win a tripod in an interregional ag on. But Augeasconscated the horses and the chariot and sent back the driver. Of courserevenge followed later.It is noteworthy that a four-horse chariot is mentioned. We know ofmany votive offerings of the eighth century bc from Olympia which rep-resent chariots with horses. But these are only two-horse chariots. Thesame holds true for the funeral games in the myth. Only two-horse char-iots occur. We conclude that the passage must have been inuenced bythe introduction of four-horse races in Olympia. According to the list ofOlympionikai edited by Moretti (:,,;: ,,ff.) this introduction took placein oc bc. It does not matter whether this date is absolutely correct or not,:Cf. Laser (:,;: :;), Dickie (:,,,: ,;), Crielaard (:,,,: :c:ff.), Kullmann (:cc:b: :c, :cc;::::ff.).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships :::but it conrms the allusion. Excavations at Olympia now show that thegames became an interregional institution after ;cc bc, as Alfred Mallwitzand Ulrich Sinn have proved in some detailed publications (Sinn :,,:;Mallwitz :,,,). From that date many fountains are found in Olympiawhich were built by groups of participants in the Olympic Games to pro-vide themselves with water. Apparently each city had its own fountain.This implies that the games required a strong organization. The cities hadto be invited to the games and this presupposes the existence of lists. Weknow of such lists from later periods. A long list from Delphi (producedabout :cc bc) contains the names of consuls in different cities who receivedthe the oroi (called the orodokoi) when they brought the invitations (Plassart:,::). Giovannini has pointed to the strong resemblance of this list to theorder of the cities in the Catalogue of Ships and has claimed that sucha list underlies it. The routes of the Delphian list are very similar to thegeographical enumeration of the cities in the Iliad (Giovannini :,o,: ,;,oc (comparative map)).If we look at the geographical principle used in the Catalogue, we ndthat it is hodological as is usual among singers, and not only in Greece(Gehrke :,,: :o,ff.). But Danek (:cc: o,) has convincingly shownfrom his own comparative perspective that the Homeric Catalogue differsfromall other comparable catalogues of oral poetry in that it provides, as heargues, an almost two-dimensional picture of the geography of mainlandGreece which can only be explained by its panhellenic tendency. Whetherthis is a deviation from the hodological principle or not depends on thedenition and is of minor importance.Without doubt, the strategy of the poet of the Catalogue had a strongpolitical dimension. He belonged to a Greek world which was character-ized by intensive communication between cities, probably along the routesaccording to which the contingents are enumerated. The organization ofan event like the Olympic Games would have been much more difcult in aworld of :oc or more autonomous cities than in an extended kingdom likethose of the Asiatic monarchies of the ancient world which was ordered ina strictly hierarchical manner. This historically attested intensive commu-nication is mirrored not only in the Catalogue but also in the stories of therecruiting of the Achaean contingents by Agamemnon and Menelaus (andperhaps Palamedes and Nestor) which we nd in the Homeric epics andthe Cypria. Of course, this picture is deceptive. It is one thing to persuadesomeone to participate in the Olympic Games by means of a personal visit,and another to recruit an army of :cc,ccc warriors against Troy in thisway. This is possible only in poetry.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013::: wolfgang kullmannSome smaller problems remain. Did the poet of the Catalogue followa contemporary geographical list exclusively or are some names of citiesinserted which were known to him only from the mythical tradition? Theproblem of the site of Oichalia in the Catalogue seems to have been solved.However, the situation is unclear with respect to Eutresis. Allegedly thecity of Eutresis was not settled between ::cc and occ bc (Goldman :,,:).This seems incompatible with the myth that Amphion and Zethus, sonsof Antiope, the builders of the walls of Thebes and rst founders of thatcity, were born at Eutresis (Strabo ,.:.:). They are rmly incorporatedinto the genealogical systems and cannot owe their existence in mythto a Mycenaean tradition. Eutresis should have existed as a geographicalnotion as early as the rst half of the seventh century. But there is noevidence.Let me summarize. The rigid formal structure of the Catalogue of Shipssuggests an origin independent of the Iliad, to which it was adapted byits poet. Whether it was nevertheless composed by him for an earlierperformance of another epic cannot be excluded, but seems improbable.Additional arguments for independence are inconsistencies between theCatalogue and the rest of the Iliad. Special attention is to be paid to theapparent substitution of the main leader of the Boeotians Thersander withthree llers. This hypothesis presupposes that the Teuthranian expeditionwas a pre-Iliadic part of the Trojan legend, which has been conrmed bythe new Archilochus papyrus published in :cc,. Moreover, the enormousmass of mythological and geographical detail of the Catalogue cannot besufciently explained when it is attributed to the poet of the Iliad himself.A great deal of the list of heroes consists of the names of the descendants ofthe heroes of older legends and oral epics.:,This list seems to be older thanthe detailed list of cities which apparently reects the contemporary worldof the poet, although it is older than the Iliad as well. The inconsistenciesbetween both lists and between the list of cities and the rest of the Iliadcorroborate this supposition.For prosopographical reasons it is obvious that the epic tradition con-cerning the Argonauts antedates the tradition concerning the Trojan War.Our inquiry results in the following picture of the relative chronologyof the Homeric Catalogue of Ships and its constituent parts::,For a more detailed account of the prosopography of the Homeric Catalogue of Ships, cf. Kullmann(:cc,: :ff., esp. :ff.): (:) The list of the fathers of the Achaean leaders mentioned in the Catalogueof Ships; (:) The list of Argonauts mentioned by Apollod. Bibl. :.,.:o which recur among theAchaean leaders of the Catalogue of Ships and their fathers and grandfathers.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013The Homeric Catalogue of Ships ::,:. Iliad including Catalogue of Ships.:. Original Catalogue of Ships without allusions to the situation on thebattleeld, but including the Boeotian leader Thersander. The authortook account of the Teuthranian expedition, mentioned in the Cypriaaccording to Proclus and in a poem of Archilochus.,. The author of the original Catalogue of Ships used a near-contemporarygeographical list of cities composed for bureaucratic purposes, which isnot in full agreement with the rest of the Iliad.. The author of the original Catalogue of Ships used oral epics which wereolder than the Iliad, concerning the Expedition of the Argonauts, theSeven against Thebes and other legends, in order to nd mythologicalcharacters who could help the Atreidae in the Trojan War. He tookover either some of the participants in these events themselves or theirdescendants whom he found among the myths or invented himself.Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:22 WEST 2013. Books Online Cambridge University Press, 2013chapter 1 3Towards a chronology of early Greek epicMartin WestThe occasion of the :cco Oslo conference prompted me to do something Ihad long had in mind: to make a synthesis of the views I have formed in thecourse of over forty years on the datings of various early Greek hexameterpoems. The dating of the Iliad alone, or the Odyssey, or the Cyclic epics,or the Hymns, or the poems of Hesiod, would of course have affordedmaterial enough for a conference paper. But there is much to be said,especially perhaps in the context of this collective enterprise, for attemptingan overview and for proposing a comprehensive chronological framework.Naturally I cannot, within the set limits, review the history of scholarshipon the question or engage at length with the work of others who havecome to divergent conclusions. I cannot do much more than explain whatI regard as the best criteria in these matters, and what conclusions I derivefrom them. If I make more reference to my own previous publicationsthan to those of anyone else, it is not because I wish to pose as thesupreme fountain-head of truth but because I am ex proposito drawingtogether and building on (or in some cases modifying) my earlier work andthoughts.In attempting to establish a chronology for these poems we have to usea combination of relative and absolute criteria. We start with an overalltime-frame. A hundred years ago scholars of repute were happy to put theIliad and Odyssey in the tenth or ninth century. Nowadays I think almosteveryone would want to put them somewhere between ;,c and occ (orat the very latest ,:c). We see the matter in sharper focus. We no longerthink of Greek history as beginning with the rst Olympiad in ;;o, withonly a misty mythical era before it. Archaeology has given us a picture ofthe Mycenaean world and a general framework for the centuries betweenthe collapse of the palaces and the owering of the archaic polis. We havelearned how to date some elements of the material culture described inthe Homeric poems. We have built up a model of the stages by which::Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:41 WEST 2013. Books Online Cambridge University Press, 2013Towards a chronology of early Greek epic ::,the Greeks gained knowledge of foreign peoples and places, and we canmeasure the Homeric picture against it. We no longer imagine that thepoems as we have them could have been preserved unchanged over timewithout being xed in writing, and we accordingly rule out a date ofcomposition earlier than we believe a written text was likely to exist. Weno longer take it as an axiom that epic poems must be earlier than lyric oriambic or elegiac poems.Within our time-frame there are few anchor-points for absolute dating.Hence relative chronology has a major part to play. If we can establish asequence for at least some of these poems, that shouldhelpus to ndthe bestplace for them within our framework of absolute chronology. Sometimesit is a question not of relative dating among these poems themselves butof dating relative to a lyric poet such as Alcaeus. Relative and absolutechronology thus become entangled.By what criteria may we judge one poem to have been composed beforeor after another? I will suggest three: (:) verbal echoes, adaptations, orimitations; (:) difference in the degree of linguistic development; and (,)thematic dependence.1 verbal echoes, adaptations, imitationsIn earlier times this criterion was employed with greater condence thannow seems appropriate. It was assumed that Homer was the oldest poet,and verbal parallels between the Homeric poems and Hesiod or other poetswere automatically taken as echoes of Homer. The presence of all theseapparent echoes of Homer then seemed to conrm his priority.It is different now. We can often say that an elegiac or melic poet isusing epic diction, but we can no longer treat epic as being necessarilysynonymous with the Iliad and Odyssey. We have become much more awarethan some of our predecessors that there existed a broad current of oralepic, and that phraseology known to us from the two epics we have wasnot necessarily unique to them.Still, there are a few cases where a passage of individual character in oneearly hexameter poem does plausibly look like the model for a passage inanother poet. Several such instances point to the currency of the Worksand Days from the mid-seventh century.:C. A. Trypanis made a persuasivecase for the inuence of the Hesiodic poems on the Hymn to Demeter.::Semon. o < Op. ;c:,; Alc. ,; < Op. ,:;; Sapph. :c; < Op. ::c, (and Theog. ,o,o::).:Trypanis (:,,); cf. Richardson (:,;: ,,:).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:41 WEST 2013. Books Online Cambridge University Press, 2013::o martin westI have elsewhere listed half a dozen instances of possible Hesiodic inuenceon the Iliad. I have reservations now about one of them, the catalogueof Nereids in :.,,, (< Hes. Theog. :co:), which Zenodotus andAristarchus athetized and which may indeed be an interpolation. Theothers I stand by, and I think they can be added to.,There are no placeswhere I see evidence of the converse relationship, the Iliad inuencingHesiod.There are many passages of the Odyssey that are evidently modelled onpassages in the Iliad. The material, with the analysis it requires, is sufcientto ll a book, and just such a book has been written by Knut Usener. Iam not aware of any instance of the converse relationship, though I wouldnot wish to deny that the poet of the Iliad knew an Odyssey, not necessarilyidentical with the Odyssey that we have.,There are two passages of seventh-century elegy that have often beentaken to be inspired by the Iliad. One is Tyrtaeus :c.::, about what adisgraceful sight it is to see an old man killed in the front line insteadof a young one; this certainly stands in a close relationship with Priamsappeal to Hector in Il. ::.oo;o, and equally certainly is not derived fromit. The other is Mimnermus comparison of human lives to leaves, withits parallel in Glaucus speech to Diomedes in Il. o.:o,. Neither of theIliadic passages ts its context as well as does the elegiac parallel, and theycannot be used as evidence of priority.oAmong the Hymns, the one to Aphrodite has always been consideredone of the earliest, and certain intertextual relationships are consistent with,West (:,,,: :c,); on the Nereid catalogue, Nickau (:,;;: :,co), West (:cc:a: :,). The otherpassages I cited were: Il. .:o < Theog. ;:c; Il. ::.:c: < Theog. ,,;,; Il. :;.;, < Op. :,; Il.:.:,:c < Theog. o:; Il. :,.; < Op. o,o. The following may be added: Il. ,.:, < Theog.ocof.; Il. o.:oo < Op. ;:f., ;,,; Il. .:,:, < Theog. o, ::; Il. ., and :, wcmn < Theog.o,; Il. .c <Theog. c:; Il. ., <Theog. :; Il. .;: <Theog. :, ;,o, ;,,oc; Il. :,.:,f.<Theog. :f.; Il. :,.,,, <Theog. o,;co; Il. :.:,:, :o.o;: <Theog. ::,, ;,o; Il. :.:;,f., :;f.,:,.::f. <Theog. ,:; Il. :o.,, <Op. ::c; Il. :;.,,f. <Op. ,f., ,::ff.; Il. :c.,ooo <Theog.,,, o:f., ;,, = :c, ;c,; Il. :c.,:f. < Theog. o,:. Hesiods Titanomachy and Typhonomachyseem to have made a particular impression. Usener (:,,c). He concludes (:c) that the Iliad must already have existed in xed form when ourOdyssey was conceived and that the poet of the Odyssey must often have heard it recited in this xedform.,This is suggested particularly by the two references to Odysseus as the father of Telemachus, Il. :.:ocand .,,.oSee West (:,,,: :co); on the Tyrtaeus passage also Von der M uhll (:,,:: ,,,), who cites earlierdiscussions. There are many other Iliadic passages that recall the manner of martial elegy and nodoubt reect current poetry of this type: :.;,; (cf. Callin. :.,f.), ,.,:,,: :,.,o: (cf. Tyrt.::.:::), o.;, (cf. Callin. :.:,), .,, (cf. Tyrt. ::.:;f.), :,.:;,o, :,.,, oo:o, :;.,o,, (cf.Tyrt. ::.:::,).Downloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:41 WEST 2013. Books Online Cambridge University Press, 2013Towards a chronology of early Greek epic ::;this. The description of the goddesss toilet at ,o looks like the modelfor the closely similar one in Od. .,o:o, where it no longer has its propercontext of preparation for a seduction (cf. Il. :.:ooo). The hymn appearsalso to have exercised a certain inuence on the one to Demeter (Heitsch:,o,: ,c; Richardson :,;: :,; and now Faulkner (:cc: ,c)).The Delian part of the Apollo hymn in my opinion owes a certain amountto the Pythian, though I know that many have taken the opposite view(West :,;,: :o:,).2 difference in degree of linguistic developmentThe epic language was a traditional and conservative idiom whichresponded only gradually to changes in the spoken dialects of the poets.But neologisms, newer words and newer grammatical forms, made theirway into it over time, and their presence, or the extent to which theyestablished themselves as regular features, provides possible indicators ofrelative chronology. If we had the text of an epic poem composed in thetwelfth or eleventh century bc and could set it beside the Iliad, there is nodoubt that we would easily be able to establish on purely linguistic groundsthat the Iliad was the younger of the two. There would be morphologicaland phonological differences much greater than any to be found withinthe extant corpus.As things are, we have a quantity of texts and fragments composedwithin a period of perhaps :cc or :,c years in a rather ossied language,and linguistic differences with a potential chronological signicance donot leap to the eye. They exist, but they disclose themselves only throughcareful analysis and measurement. Richard Janko in his remarkable rstbook, Homer, Hesiod and the Hymns (:,:), gave us the most sophisticatedstudy of such phenomena. The trouble is, as he recognized, that a numberof imponderable factors are involved. It is not just a matter of tracing a slowbut steady trickle of changes. Individual poets will have differed in theirpropensity to archaism and resistance to newer forms. Dialect differencesin their vernaculars will have affected both the choices available to themand their perceptions of what was the poetic (non-vernacular) alternative.Differences of genre and subject matter will also have affected the outcome.Janko hoped to overcome these difculties by means of a broad-basedstatistical inquiry using a variety of linguistic criteria. He certainly madegreat efforts to take all relevant considerations into account and sparedhimself no pains. He made himself a computer concordance of Homer(possibly the rst ever) and deployed sophisticated statistical methods. HeDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:41 WEST 2013. Books Online Cambridge University Press, 2013:: martin westarrived at a sequence of texts ordered according to the frequency of newerforms, and made suggestions for converting his relative chronology intopossible absolute chronologies by making certain assumptions. It seems,however, that few scholars have felt able to embrace his conclusions asdependable. When we are having to compare texts composed in differentareas by poets schooled in different local traditions one of themperhaps aman aged thirty, another a septuagenarian it is far from clear that Jankosmethod will tell us reliably in what order they were produced. There area few texts showing linguistic features (especially lexical and stylistic) thatseem obviously late, and we can agree that these are poems of relatively latecomposition: the Cypria, the Hymn to Hermes, the pair of hymns to Heliosand Selene, the Batrachomyomachia. But for the rest it seems to me that thelinguistic criterion is less useful and trustworthy than other indicators, andthat where it offers a result that conicts with arguments based on otherkinds of evidence, it should be treated with great caution.3 thematic dependenceThe most helpful criterion in my view is thematic dependence. Like theother criteria, it has to be used with circumspection. A recently publishedpapyrus (P.Oxy. ;c) has given us part of an elegy of Archilochus in whichhe recalled an episode from heroic legend: the repulse of the Achaeans byTelephus when, having landed in Mysia under the misapprehension that itwas the Troad, they attacked his city supposing it to be Troy. Archilochusmust have had the story from hexameter epic current in his time; hisadaptation of it into elegiacs is a reection of his enthusiasm for thispoetry. We know that the story was told in the Cypria. But we cannot inferthat the Cypria itself existed in Archilochus time, because it is clear thatmuch of the material in it did not rst appear there but came from oldertradition. We can only say that this particular episode was being related inepic in Archilochus vicinity by the mid part of the seventh century.It is a different matter when Alcaeus (fr. ) writes of Achilles calling onhis mother, the sea-nymph, who then went and supplicated at the kneesof Zeus to persuade him to do something about her dear sons mniv.Alcaeus is clearly echoing, not just some unspecied epic that containedan episode similar to the one we know from Iliad :, but one in which Zeusmust have responded as Thetis wished, that is, by allowing the Trojans togain the upper hand, to be driven back only when Achilles was inducedto forget his wrath against Agamemnon: an epic, then, with the samefundamental architecture as our Iliad. It would be an excess of caution todoubt that Alcaeus is alluding to the Iliad itself possibly an Iliad withDownloaded from Cambridge Books Online by IP 152.2.176.242 on Sat Jul 06 15:20:41 WEST 2013. Books Online Cambridge University Press, 2013Towards a chronology of early Greek epic ::,some recensional differences from ours, but still the Iliad.;In another place(fr. ,,,) he wrote of how Xanthus (Scamander) had its ow obstructedby corpses, a hyperbolic motif special to Achilles battle with the river inIl. ::.::,:c; here again we can say that he is following the Iliad. TheAmmonius commentary draws attention to the imitation.
https://www.scribd.com/document/179594430/Relative-Chronology-in-Early-Greek-Epic-Poetry-edd-O-Andersen-D-T-T-Haug-2012-pdf
CC-MAIN-2021-10
refinedweb
64,405
51.99
Create Cool Line Effects using Actionscript 3.0 in Flash CS4 or Flex Builder 3 by 18 May, 2009 12:30 pm 55 views23 In this tutorial, you will learn the basics of architecting a simple Line Effect, like the one you can see bellow, either using Flash CS4 or Flex Builder 3. We cover the basics on the simplest way, so everyone will be able to step in the scripted animation with actionscript 3.0 and create a nice visual effects like glow and blur. Requirements One of the following: Pre-Requisites It would be useful to know how to use classes. Create a ActionScript 3.0 Project or Class If you use Flex Builder just create a new ActionScript 3.0 Project and call it LineEffect. If you use Flash CS3 or CS4 create a Flash File(ActionScript 3.0), and call it LineEffect.as . The Flash File and the class must be in the same folder. Well, this was the first step. See… It was not so hard. After that we can go and write our code package { import flash.display.Sprite; Same Imports Again, if you use Flex Builder (Flex Builder I use too), it is not mandatory to write this step, because Flex Builder automatically imports when it sees something unknown. But if you use Flash CS3 or CS4 is required to write this step. import flash.display.Graphics; import flash.display.MovieClip; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.filters.BlurFilter; import flash.filters.DropShadowFilter; import flash.filters.GlowFilter; import flash.text.TextField; import flash.utils.getTimer; [SWF(width = "600", height = "400", frameRate = "30", backgroundColor = "#000000", pageTitle = "Line Effect")] If you are confused about this line of code: [SWF(width = "600", height = "400", frameRate = "30", backgroundColor = "#000000", pageTitle = "Line Effect")] Well, here we set the width, height, framerate, backgroundColor and the title of the SWF file. Declaring Variables To be easier for your future reference, I’ve declared variables for each color line. But before colors we need to declare a Sprite because we want to draw a line, and apply an effect to it. After that we will declare an Array that will help to animate the line. At the end we will declare the buttons with text as also line colors. The line colors consists in a BlurFilter, two GlowFilter and a DropShadowFilter. The code looks like that: public class LineEffect extends Sprite { private var sp:Sprite = new Sprite(); private var points:Array = new Array(); private var prevmouseX:Number = 0; private var prevmouseY:Number = 0; private var fireBtn:MovieClip = new MovieClip(); private var fireTF:TextField = new TextField(); private var skyBtn:MovieClip = new MovieClip(); private var skyTF:TextField = new TextField(); private var grassBtn:MovieClip = new MovieClip(); private var grassTF:TextField = new TextField(); private var sunBtn:MovieClip = new MovieClip(); private var sunTF:TextField = new TextField(); private var bf:BlurFilter = new BlurFilter(3,3,1); private var growFilter:GlowFilter = new GlowFilter(0xff3300, 2, 20, 10, 2, 3, true, false); private var growFilter_b:GlowFilter = new GlowFilter(0xfff000, 2, 16, 10, 3, 9, false, false); private var dropShadow:DropShadowFilter = new DropShadowFilter(0, 360, 0xC11B17, 1, 70, 70, 5, 3, false, false, false); private var growFilter_2:GlowFilter = new GlowFilter(0x00ffff, 2, 20, 10, 2, 3, true, false); private var growFilter_b_2:GlowFilter = new GlowFilter(0x00ffff, 2, 16, 10, 3, 9, false, false); private var dropShadow_2:DropShadowFilter = new DropShadowFilter(0, 360, 0x000fff, 1, 70, 70, 5, 3, false, false, false); private var growFilter_3:GlowFilter = new GlowFilter(0x4AA02C, 2, 20, 10, 2, 3, true, false); private var growFilter_b_3:GlowFilter = new GlowFilter(0x4AA02C, 2, 16, 10, 3, 9, false, false); private var dropShadow_3:DropShadowFilter = new DropShadowFilter(0, 360, 0x4AA02C, 1, 70, 70, 5, 3, false, false, false); private var growFilter_4:GlowFilter = new GlowFilter(0xFDD017, 2, 20, 10, 2, 3, true, false); private var growFilter_b_4:GlowFilter = new GlowFilter(0xFDD017, 2, 16, 10, 3, 9, false, false); private var dropShadow_4:DropShadowFilter = new DropShadowFilter(0, 360, 0xFDD017, 1, 70, 70, 5, 3, false, false, false); What events we have here? First we add the sp(Sprite) to the stage, then we add an Enter_Frame event to our Sprite, draw each button and create a Click event for each one in order to change from color and effect. public function LineEffect() { this.addChild(sp); this.addEventListener(Event.ENTER_FRAME, onEnter); drawFireBtn(fireBtn); drawSkyBtn(skyBtn); drawGrassBtn(grassBtn); drawSunBtn(sunBtn); fireBtn.addEventListener(MouseEvent.CLICK, makeFire); skyBtn.addEventListener(MouseEvent.CLICK, makeSky); grassBtn.addEventListener(MouseEvent.CLICK,makeGrass); sunBtn.addEventListener(MouseEvent.CLICK, makeSun); sp.filters = [bf, dropShadow]; } } } Enter Frame Function The following Enter Frame function will track the mouse coordinates and show the effect on the stage . private function onEnter(e:Event):void { var line:Graphics = sp.graphics; line.clear(); line.lineStyle(2, 0xffffff); line.moveTo(mouseX, mouseY); var dx:Number = this.mouseX - prevmouseX; var vx:Number = dx ? dx : Math.random() * randSet(-1, 1); var dy:Number = this.mouseY - prevmouseY; var vy:Number = dy ? dy : Math.random() * randSet(-1, 1); var pLen:Number = points.push({x:this.mouseX, y:this.mouseY, vx:vx / 20, vy:vy / 20, life:getTimer()}); for (var i:Number = 0; i < pLen; i++) { if (!points[i]) { continue } if (getTimer() - points[i].life > 1000) { points.splice(i--, 1) } else { if (i!=0 && points[i]) { points[i].x += points[i].vx; points[i].y += points[i].vy; var cx:Number = points[i - 1].x; var cy:Number = points[i - 1].y; line.curveTo(cx, cy, (points[i].x + cx) * 0.5, (points[i].y + cy) * 0.5 ); } else { line.moveTo(points[i].x, points[i].y); } } } prevmouseX = this.mouseX; prevmouseY = this.mouseY; } private function randSet(p_min:Number,p_max:Number):Number { return Math.floor(Math.random() * 2); } } } Draw the buttons and make the click events Now we write a function for each button that applies the colors and effects we have created in the beginning. On each function we insert the text buttons into the stage by drawing it with actionscript 3.0 using the drawRect class and we choose the rectangle fill color. Then we create a second function inside this one which calls the MouseEvent we have mentioned above and will start the effect. private function drawFireBtn(obj:MovieClip):void { with(obj.graphics) { beginFill(0x0000ff,0); drawRect(0,0,20,20); endFill(); } fireTF.text = "Fire" fireTF.textColor = 0x666666; fireTF.mouseEnabled = false; fireTF.selectable = false; this.addChild(obj); obj.buttonMode = true; obj.addChild(fireTF); obj.x = 20; obj.y = 380; } private function makeFire(E:MouseEvent):void { sp.filters = [bf,growFilter,growFilter_b,dropShadow]; } private function drawSkyBtn(obj:MovieClip):void { with(obj.graphics) { beginFill(0x0000ff,0); drawRect(0,0,20,20); endFill(); } skyTF.text = "Sky" skyTF.textColor = 0x666666; skyTF.mouseEnabled = false; skyTF.selectable = false; this.addChild(obj); obj.buttonMode = true; obj.addChild(skyTF); obj.x = 70; obj.y = 380; } private function makeSky(e:MouseEvent):void { sp.filters = [bf,growFilter_2,growFilter_b_2,dropShadow_2]; } private function drawGrassBtn(obj:MovieClip):void { with(obj.graphics) { beginFill(0x0000ff,0); drawRect(0,0,25,20); endFill(); } grassTF.text = "Grass" grassTF.textColor = 0x666666; grassTF.mouseEnabled = false; grassTF.selectable = false; this.addChild(obj); obj.buttonMode = true; obj.addChild(grassTF); obj.x = 120; obj.y = 380; } private function makeGrass(e:MouseEvent):void { sp.filters = [bf,growFilter_3,growFilter_b_3,dropShadow_3]; } private function drawSunBtn(obj:MovieClip):void { with(obj.graphics) { beginFill(0x0000ff,0); drawRect(0,0,20,20); endFill(); } sunTF.text = "Sun" sunTF.textColor = 0x666666; sunTF.mouseEnabled = false; sunTF.selectable = false; this.addChild(obj); obj.buttonMode = true; obj.addChild(sunTF); obj.x = 170; obj.y = 380; } private function makeSun(e:MouseEvent):void { sp.filters = [bf,growFilter_4,growFilter_b_4,dropShadow_4]; } } } This was the Line Effect tutorial. I hope it will be usefull for many of you. Now you can try to create your own line effects and drop a comment mentioning the url of your experiments. We are always looking for the results of our tutorials. fx.barrett 19 May, 2009 at 1:23 pm Great job there. 😉 Keep it up. samBrown 19 May, 2009 at 4:27 pm very cool tutorial, this will make for some great spiking – thanks! mitomane 20 May, 2009 at 3:13 pm wow really cool, thanks Matt Anderson 20 May, 2009 at 9:20 pm Now that, is very cool. I like how you can change colors and keep moving it around. Marco 29 May, 2009 at 8:20 am Now THAT’S what I like to see. Simple, minimalistic but beautiful stuff. Well done! Dimitros 13 June, 2009 at 5:14 pm Bravo !!!!! Well done and keep on . Greetings from Athens. Horatiu Condrea 15 June, 2009 at 4:07 pm Thank you all, I’m glad you enjoyed this tut. timothyinspa 19 June, 2009 at 3:19 am Hi I was wondering if it is possible to make a MC called NUll which cannot be seen, and the particles will follow NUll, and on the stage u animate null so it looks like the particle is moving itself, thank you Shwetabh 19 June, 2009 at 8:22 am Hi Thanks for this informative tutorial. I was just wondering, when we move the mouse a lot, or in other words, when the mouse cursor following line is a bit more long, the smoothness from the animation is kinda lost. Can you give some tips regarding how to make this animation a little more smoother?? Thanks in advance. Chetan Sachdev 20 June, 2009 at 10:16 pm Really cool effect, can I use it on my site ? Horatiu Condrea 22 June, 2009 at 12:32 pm @timothyinspa You can try, and see if it works… @Shwetabh Well,if I understood well what you want to do, in the enter frame function you can see that line: if (getTimer() – points[i].life > 1000) Put 500 instead of 1000 or other value. @Chetan Sachdev I do not know what to say, I think you can put it, but put a link… webfixed 23 June, 2009 at 7:47 am Superb! Shwetabh 24 June, 2009 at 10:01 am Changed the parameter to 500 as per your instruction. The animation has become somewhat smoother than before, but still when too much of movement of the cursor is there, smoothness is somewhat lost again, but thanks, gonna experiment with it. Thanks for the tutorial. Gonna keep an eye on more tut from you. 🙂 ANdree 2 July, 2009 at 5:50 pm hi.. i’m from indonesia, emm i still dunno how to import those files to my flash? i’m currently using Adobe Flash CS3 need help here thanx Jerry 12 July, 2009 at 3:05 am Really cool effect!But it seems a bit difficult to me. Pim 17 July, 2009 at 11:55 am Another great tutorial! Horatiu Condrea 24 July, 2009 at 10:11 am @ANdree You need to have one of the following: Adobe Flash CS4 Flex Builder 3 Broken 22 January, 2010 at 4:50 am Anyone can share this source in AS2 ? is possible? Im making the new site with AS2 and i liked put this effect on mouse. ilike2flash 20 February, 2010 at 6:01 pm This is a very interesting effect. Henrique 4 June, 2010 at 11:46 pm how to do make use this efect in another swf , please ? prasanth 11 July, 2010 at 3:54 pm i am a web developer fresher now beginner in flash actionscript can you post yor work to my mail this work is so good can we stop the drawing when the mouse in up i lik thys 30 October, 2010 at 1:07 pm @ prasanth: Yes stoping the drawing while the mouse is up is actually quite simple, implent a: private var drawing:Boolean = false; stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown); stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp); private function MouseDown(e:MouseEvent) { drawing = true; } private function MouseUp(e:MouseEvent) { drawing = false; } to the public class, and add: if (drawing == true) { BEFORE the onEnter function. note, im not anyway, what i would like to ask is how do i turn off the “sliding” of the line after i stop moving the mouse? im asking this as i have been trying to find out wether it is implented is the dropshadow or the blurfilter (as these are the only ones that are used on the gray line in the start). indu 1 April, 2011 at 10:41 am Hey..!Its Really Nice…Thank U so Much for this Script..
http://www.thetechlabs.com/tech-tutorials/flash/create-cool-line-effects-using-actionscript-30-in-flash-cs4-or-flex-builder-3/
CC-MAIN-2016-30
refinedweb
2,052
59.3
Development of Hospital Management System 28/02/18 Information Systems Hospital Management is a web based application to manage the activities related to doctor and patient. Hospital Management is based on distributed architecture. This involves the web services which receives request from the web based application and service processes the request and sends the response back to the application. Web services performs the database operations like insert, delete and update the information about the patients, doctors etc. This kind of distributed architecture is called as Service Oriented Architecture (SOA). This application contains login form, patient registration, doctor registration. Hospital Management application allow patients to edit their information like patient name, contact number, address, disease from which he is suffering from etc. The concept of hospital management is very big. The scope of hospital management involves different modules like login module, patient info, doctor info, billing module, registration module and administration module. Login module will include the operation related to login, forgot password, password change, sending confirmations or alerts etc. Patient info module will include the details about the patient like patient history about his treatment and doctors involved in the treatment, details of medicines suggested by doctors. Billing Module will include the details of fees, mode of payment used by the patient to pay the fees. Registration module will allow the users to register their profiles. Administration module allows performing operations like creating the new users, performing password change operations, loading the information of doctors for the first time. Hospital Management uses sql server 2005 as the backend. The database is maintained on the remote server, this database holds all the information related to the hospital. Abstract: Before SOA architecture, DCOM or (ORBs) object request brokers based on CORBA specifications were used to develop the distributed applications. DCOM is known was distributed component object model. DCOM is an extension of COM (component object model), DCOM was released in 1996. It works primarily with Microsoft windows. It will work with Java Applets and ActiveX components through its use of COM. Service Oriented Architecture is nothing but collection of services. These services are deployed at different servers at different locations. These services communicate with each other to perform required operations. The communication can be simple data passing. Service Provider: The provider will create the service using any technology like .net or java and publishes its information for accessing the outside world. The provider decides which service to be published and one service can provide multiple operations, how to price the services or without charge like free services. Provider also decides the category of the services. The most common broker service is UDDI (Universal Description Discovery and Integration) provides a way publish and discover the information about the services. Service Requester: The requester identifies the services using UDDI or any other service broker. The services provide the required operations then the requester should take it to the service provider for contract. Then requester can bind the services to the application and execute to get the required information. The principles used for development, maintenance and usage of SOA are - Reuse, comparability, granularity and interoperability. - Identifying the services and categorizing them. - Monitoring and tracking. The specific architectural principles of SOA design are - Service loose coupling - Service encapsulation - Service contract - Service abstraction - Service reusability - Service discoverability PROJECT SCOPE AND OBJECTIVE: SCOPE Development of a computerized Hospital management system with the provision of flexible, accurate and secured access to data thus bringing in the highly useful end product for the users as well as for the management. OBJECTIVE - To develop a system that maintains a sophisticated Hospital management details bringing out the flexibility and the ease with which the users can use it. - To track and improve internal performance of the financial corporation thereby allowing the flexible and secured transactions to happen. FEATURES OF THE CURRENT SYSTEM In the existing system the data required for the Hospital management is maintained in records. These are to be updated according to the requirements of the customer. It takes time to search for the required data. All the details regarding the hospitals and its timings are hard to maintain. The work will be more so the systems need more number of crew to fulfill the requirements. There may be a chance of failure since it is manual. A simple fault of the system may lead to inconvenience and also cause a vast destruction. So these faults make the system less effective and performance of the system is very slow. Hence, there should be a system to overcome all these defects and provide the users with more facilities. CHARACTERISTICS OF THE INTENDED SYSTEM In the proposed system everything is computerized. The system provides all the details regarding the hospitals, its details, and soon. The users can search the required data easily within no time. A very less number of people are required to handle the system. The patient’s need not wait for long time to fulfill his requirement. There is no chance of any failure in the system, which improves the performance of the system and also increases the efficiency of the system. Though this system is very beneficial a minor failure in the server or else the computer leads to a major loss of data. PROJECT OVERVIEW The project performs the following functions In 1997, a team of Medical Professionals has set up the first hospital, it signaled the dawn of a new era in medical care. At the heart of this movement was a burning desire to practice medicine with Compassion, Concern and Care, with a single-minded objective – the recovery of the patient. Today, with Multi-Specialty HOSPITAL across the state, and a reputation for humanitarian and selfless service of the highest order, Hospital enjoys an unbelievable amount of goodwill. A million smiles will bear testimony to that. At hospital, we operate on a physician driven model. This means that all the main constituents of the CARE movement – the promoters, administrators and service providers are physicians. At the centre of the CARE model is the patient and the over-riding motive of all of Care’s activities is to provide quality medical care at an affordable cost. Technology, Training and Teamwork form the very core of the CARE model. We emphasize on a comprehensive and continuous education and training of every individual involved in patient care. Every effort will be taken to ensure that our growth is one decided by the patient’s needs, and not one decided by our corporate requirements. Our hospital believes at: - “A patient is the most important person in our hospital. -.” NEED FOR COMPUTERIZATION: The use of computerized hospital is to provide effective facilities to the people, which are suffering from any problems. The advantages are: - Less cost - No mediators - Excellent services The main goal of this hospital management system is to achieve the people satisfaction. Hospital management system provides effective facilities to the people from any place in the world. SYSTEM REQUIREMENTS Software Requirement Specifications: Operating Systems : Windows 2000 Prof Database server : Sql Srver 2005 Programming Language : C# Hardware Requirement Specifications: Application Server Configuration: Computer Processor : Pentium IV Clock Speed : 700MHZ Processor Hard Disk : 40GB RAM : 256/512 MB Modem : 56KBPS Database Server Configuration: Computer Processor : Pentium IV Clock Speed : 700MHZ Processor Hard Disk : 40GB RAM : 256/512 MB SYSTEM ANALYSIS Existing System: In the current system the data required is maintained in records. They are to be updated according to the requirements of the users. It takes time to search for the required query. All the details regarding the hospital and its patients are hard to maintain. The work will be more, so the system needs more number of crew to fulfill the requirements. There may be a chance of failure since it is manual. A one fault of the system may lead to inconvenience and also causes a vast destruction. So these faults make the system less efficient and performance of the system is very slow. Hence, there should be a system to overcome all these defaults and provide the users with more facilities. In the current system if the user was suffering from any pain or etc heshe has no idea how to control the pain and suffering. Just they will be no idea for them and they become sicker and died more sooner And to know the availability for the treatment they have to go to hospital but mostly the government hospital doesn’t give more facilities to the patient as the patients want from the doctors. But in the case of the private hospital the patients has to pay more fares for the treatment and they do more delays in the case of the treatment they will be more formalities to be fulfil by the patients which take lot of time waste. Proposed System: In the proposed system everything is computerized. The system provides all the details regarding the Hospital, doctors, patients, bed numbers, and fares also and so on. The user can search required data easily with no time. A very less number of staff is required to handle the system. The patients need not wait for a long time to fulfil his requirement. There is no chance of any failure in the system, which improves the performance of the system and also increases the efficiency of the system. Though this system is very beneficial a minor failures in the server or else the computer leads a major loss of data. FEASIBILITY STUDY In preliminary investigation we got the result that the computerized Hospital management system is feasible. This includes following aspects. Technical Feasibility: Technical feasibility is nothing but implementing the project with existing technology. Computerized Hospital management System is feasible. Economical Feasibility: Economic feasibility means the cost of under taking project should be less than existing system Hospital management system is economically feasible, because it reduces the expenses in the manual system. TECHNOLOGY OVERVIEW .NET Framework The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. COMPONENTS AND FEATURES: .NET featuring specialized development scenarios. ADO.NET ADO.NET IN CONNECTED MODE: ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed via data providers for connecting to a database, executing commands, and retrieving results. Those results are either processed directly, or placed in an ADO.NET Dataset object in order to be exposed to the user in an ad-hoc manner, combined with data from multiple sources, or remotes between tiers. The ADO.NET Dataset object can also be used independently of a .NET data provider to manage data local to the application or sourced from XML. The ADO.NET classes are found in System.Data.dll, and are integrated with the XML classes found in System.Xml.dll. When compiling code that uses the System.Data namespace, reference both System.Data.dll and System.Xml.dll. ADO.NET provides functionality to developers writing managed code similar to the functionality provided to native COM developers by ADO. The most important change from classic ADO is that ADO.NET doesn’t reply on OLE DB providers and uses .NET managed providers instead. A .NET provider works as a bridge between your application and the data source. ADO .NET and .NET managed data providers don’t use COM at all, so a .NET application can access data without undergoing any performance penalty deriving the switch between managed and unmanaged code. The most important difference between ADO and ADO.NET is that dynamic and Key set server -side cursors are no longer supported. ADO.NET supports only forward-only read-only result sets and disconnected result sets. .NET Data Providers: .NET data providers play the same role that OLE DB providers play under ADO, they enable your application to read and write data stored in a data source. Microsoft Currently supplies five ADO.NET providers: OLE DB .NET Data Provider: This provider lets you access a data source for which an OLE DB provider exists, although at the expense of a switch from managed to unmanaged code and the performance degradation that ensues. SQL Server .NET Data Provider: This provider has been specifically written to access SQL Server version 7.0 or later using Tabular Data Stream (TDS) as the communication medium. TDS is SQL Server’s native protocol, so you can expect this provider to give you better performance than the OLE DB Data Provider. Additionally, the SQL Server, .NET Data Provider exposes SQL Server specific features, such as named transactions and support for the FOR XML clause in SELECT queries. ODBC .NET Data Provider: This provider works as a bridge toward an ODBC source, so in theory you can use it to access any source for which an ODBC driver exists. As of this writing, this provider officially supports only the Access, SQL Server, and Oracle ODBC drivers, so there’s no clear advantage in using it instead of the OLE DB .NET Data Provider. The convenience of this provider will be more evident when more ODBC drivers are added to the list of those officially supported. .NET Data Provider for Oracle: This provider can access an Oracle data source version 8.1.7 or later. It automatically uses connection pooling to increase performance if possible, and supports most of the features of the Microsoft OLEDB Provider for Oracle, even though these two accessing techniques can differ in a few details—for example, the .NET Data Provider for Oracle doesn’t support the TABLE data type and ODBC escape sequences. SQLXML Library: This DLL, which you can download from the Microsoft Web site, includes a few managed types that let you query and update a Microsoft SQL Server 2000 data source over HTTP. It supports XML templates, XPath queries, and can expose stored procedures and XML templates as Web services. The ODBC and Oracle providers are included in .NET Framework 1.1 but were missing in the first version of the .NET Framework. If you work with .NET Framework 1.0, you can download these providers from the Microsoft Web site. The downloadable versions of these providers differ from the versions that come with .NET Framework 1.1, mainly in the namespaces they use: Microsoft.Data.Odbc and Microsoft.Data.Oracle instead of System.Data.Odbc and System.Data.Oracle. ADO.NET Object Model: It’s time to have a closer look at the individual objects that make up the ADO.NET architecture illustrated in Figure 21-1. You’ll see that objects are divided into two groups, the objects included in the .NET Data Provider, and those that belong to the ADO.NET disconnected architecture. (In practice, the second group includes only the Dataset and its secondary objects.) Dataset (Disconnected data) .NET Data Provider Connection DataAdapter Command Data Reader ADO.NET Objects at a Glance The Connection object has the same function it has under ADO: establishing a connection to the data source. Like its ADO counterpart, it has the Connection String property, the Open and Close methods, and the ability to begin a transaction using the Begin transaction method. The ADO Execute method isn’t supported, and the ADO.NET Connection object lacks the ability to send a command to the database. The Command object lets you query the database, send a command to it, or invoke one of its stored procedures. You can perform these actions by using one of the object’s Executexxxx methods. More specifically, you use the ExecuteNonQuery method to send an action query to the database—for example, an INSERT or DELETE SQL statement—an Execute Reader method to perform a SELECT query that returns a result set, or an Execute Scalar method to perform a SELECT query that returns a single value. Other properties let you set the command timeout and prepare the parameters for a call to a stored procedure. You must manually associate a Command object with the Connection object previously connected to the data source. The Data Reader object is the object returned by the Execute Reader method of the command object and represents a forward-only, read-only result set. A new row of results becomes available each time you invoke the Data Reader’s Read method, after which you can query each individual field using the Get Value method or one of the strongly typed Getxxxx methods, such as Get String or Get Float. Remember that you can’t update the database by means of a Data Reader object. The Dataset object is the main object in the ADO.NET disconnected architecture. It works as a sort of small relational database that resides on the client and is completely unrelated to any specific database. It consists of a collection of DataTable objects, with each DataTable object holding a distinct result set (typically the result of a query to a different database table). A DataTable object contains a collection of Data Row objects, each one holding data coming from a different row in the result. A Dataset also contains a collection of Data Relation objects, in which each item corresponds to a relationship between different Data Table objects, much like the relationships you have between the tables of a relational database. These relations let your code navigate among tables in the same DataSet using a simple and effective syntax. The DataAdapter object works as a bridge between the Connection object and the DataSet object. It’s Fill method moves data from the database to the client-side DataSet, whereas its Update method moves data in the opposite direction and updates the database with the rows that your application has added, modified, or deleted from the DataSet. Connection Object: Whether you work in connected or in disconnected mode, the first action you need to perform when working with a data source is to open a connection to it.InADO.NET terms, this means that you create a Connection object that connects to the specific database. The Connection object is similar to the ADO object of the same name, so you’ll feel immediately at ease with the new ADO.NET object if you have any experience with ADO programming. Setting the Connection String Property the key property of the Connection class is Connection String, a string that defines the type of the database you’re connecting to, its location, and other semicolon-delimited attributes. When you work with the OleDbConnection object, the connection string matches the connection string that you use with the ADO Connection object. Such a string typically contains the following information, - The Provider attribute, which specifies the name of the underlying OLE DB Provider, used to connect to the data. The only values that Microsoft guarantees as valid are SQLOLEDB (the OLE DB provider for Microsoft SQL Server), Microsoft.Jet.OLEDB.4.0 (the OLE DB provider for Microsoft Access), and MSDAORA (the OLE DB provider for Oracle). - The Data Source attributes, which specifies where the database is. It can be the path to an Access database or the name of the machine on which the SQL Server or the Oracle database is located. - The User ID and Password attributes, which specify the user name and the password of a valid account for the database. - The Initial Catalog attributes, which specifies the name of the database when you’re connecting to a SQL Server or an Oracle data source. Once you’ve set the Connection String property correctly, you can open the connection by invoking the Open method: ADO.NET in Disconnected Model: In the preceding chapter, you saw how to work with ADO.NET in connected mode, processing data coming from an active connection and sending SQL commands to one.ADO.NET in connected mode behaves much like classic ADO, even though the names of the involved properties and methods (and their syntax) are often different. You’ll see how ADO.NET differs from its predecessor when you start working in disconnected mode. ADO 2.x permits you to work in disconnected mode using client-side static record sets opened in optimistic batch update mode. This was one of the great new features of ADO that proved to be a winner in client/server applications of any size. As a matter of fact, working in disconnected mode is the most scalable technique you can adopt because it takes resources on the client (instead of on the server) and, above all, it doesn’t enforce any locks on database tables (except for the short-lived locks that are created during the update operation). The following Imports statements are used at the file or project level: The DataSet Object Because ADO.NET (and .NET in general) is all about scalability and performance, the disconnected mode is the preferred way to code client/server applications. Instead of a simple disconnected recordset, ADO.NET gives you the DataSet object, which is much like a small relational database held in memory on the client. As such, it provides you with the ability to create multiple tables, fill them with data coming from different sources, enforce relationships between pairs of tables, and more. Data Set: The DataSet object is central to supporting disconnected, distributed data scenarios with ADO.NET. The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source. It can be used with multiple and differing data sources, used with XML data, or used to manage data local to the application. The DataSet represents a complete set of data including related tables, constraints, and relationships among the tables. The DataAdapter object, which works as a connector between the DataSet and the actual data source. The DataAdapter is in charge of filling one or more DataTable objects with data taken from the database so that the application can then close the connection and work in a completely disconnected mode. After the end user has performed all his or her editing chores, the application can reopen the connection and reuse the same DataAdapter object to send changes to the database. Admittedly, the disconnected nature of the DataSet complicates matters for developer Cite This Work To export a reference to this article please select a referencing stye below: DMCA / Removal Request If you are the original writer of this essay and no longer wish to have the essay published on the UK Essays website then please.
https://www.ukessays.com/dissertation/examples/information-systems/hospital-management-system-2.php
CC-MAIN-2019-13
refinedweb
3,738
54.22
In this article, you will build a full-stack app using GraphQL and Node.js in the backend. Meanwhile, our frontend will use the graphql-request library to perform network operations on our backend. We will cover the following steps: - Why use graphql-request and TypeScript? - Building our server - Building our client Why use graphql-request and TypeScript? Whenever developers build a GraphQL server using Apollo, the library generates a “frontend” which looks like so: This interface allows users to make query or mutation requests to the server via code. However, let’s address the elephant in the room: it doesn’t look very user friendly. Since the frontend doesn’t feature any buttons or any helpful interface elements, it might be hard for many users to navigate around your app. Consequently, this shrinks your user base. So how do we solve this problem? This is where graphql-request comes in. It is an open source library which lets users perform queries on a GraphQL server. It boasts the following features: - Lightweight — This library is just over 21 kilobytes minified, which ensures your app stays performant - Promise-based API — This brings in support for asynchronous applications - TypeScript support — graphql-requestis one of many libraries which allows for TypeScript. One major advantage of Typescript is that it allows for stable and predictable code For example, look at the following program: let myNumber = 9; //here, myNumber is an integer myNumber = 'hello'; //now it is a string. myNumber = myNumber + 10; //even though we are adding a string to an integer, //JavaScript won't return an error. In the real world, it might bring unexpected outputs. //However, in Typescript, we can tell the compiler.. //what data types we need to choose. let myNumber:number = 39; //tell TS that we want to declare an integer. myNumber = 9+'hello'; //returns an error. Therefore, it's easier to debug the program //this promises stability and security. In this article, we will build a full-stack app using GraphQL and TypeScript. Here, we will use the apollo-server-express package to build a backend server. Furthermore, for the frontend, we will use Next and graphql-request to consume our GraphQL API. Building our server Project initialization To initialize a blank Node.js project, run these terminal commands: mkdir graphql-ts-tutorial #create project folder cd graphql-ts-tutorial npm init -y #initialize the app When that’s done, we now have to tell Node that we need to use TypeScript in our codebase: #configure our Typescript: npx tsc --init --rootDir app --outDir dist --esModuleInterop --resolveJsonModule --lib es6 --module commonjs --allowJs true --noImplicitAny true mkdir app #our main code folder mkdir dist #Typescript will use this folder to compile our program. Next, install these dependencies: #development dependencies. Will tell Node that we will use Typescript npm install -d ts-node @types/node typescript @types/express nodemon #Installing Apollo Server and its associated modules. Will help us build our GraphQL #server npm install apollo-server-express apollo-server-core express graphql After this step, navigate to your app folder. Here, create the following files: index.ts: Our main file. This will execute and run our Express GraphQL server dataset.ts: This will serve as our database, which will be served to the client Resolvers.ts: This module will handle user commands. We will learn about resolvers later in this article Schema.ts: As the name suggests, this file will store the schematics needed to send data to the client In the end, your folder structure should look like so: Creating our database In this section, we will create a dummy database which will be used to send requested data. To do so, go to app/dataset.ts and write the following code: let people: { id: number; name: string }[] = [ { id: 1, name: "Cassie" }, { id: 2, name: "Rue" }, { id: 3, name: "Lexi" }, ]; export default people; - First, we created an array of objects called people - This array will have two fields: idof type number, and nameof type string Defining our schema Here, we will now create a schema for our GraphQL server. To put it simply, a GraphQL schema is a description of the dataset that clients can request from an API. This concept is similar to that of the Mongoose library. To build a schema, navigate to the app/Schema.ts file. There, write the following code: import { gql } from "apollo-server-express"; //will create a schema const Schema = gql` type Person { id: ID! name: String } #handle user commands type Query { getAllPeople: [Person] #will return multiple Person instances getPerson(id: Int): Person #has an argument of 'id` of type Integer. } `; export default Schema; //export this Schema so we can use it in our project Let’s break down this code piece by piece: - The Schemavariable contains our GraphQL schema - First, we created a Personschema. It will have two fields: idof type IDand nameof type String - Later on, we instructed GraphQL that if the client runs the getAllPeoplecommand, the server will return an array of Personobjects - Furthermore, if the user uses the getPersoncommand, GraphQL will return a single Personinstance Creating resolvers Now that we have coded our schema, our next step is to define our resolvers. In simple terms, a resolver is a group of functions that generate response for a GraphQL query. In other words, a resolver serves as a GraphQL query handler. In Resolvers.ts, write the following people from "./dataset"; //get all of the available data from our database. const Resolvers = { Query: { getAllPeople: () => people, //if the user runs the getAllPeople command //if the user runs the getPerson command: getPerson: (_: any, args: any) => { console.log(args); //get the object that contains the specified ID. return people.find((person) => person.id === args.id); }, }, }; export default Resolvers; - Here, we created a Queryobject that handles all the incoming queries going to the server - If the user executes the getAllPeoplecommand, the program will return all the objects present in our database - Moreover, the getPersoncommand requires an argument id. This will return a Personinstance with the matching ID - In the end, we exported our resolver so that it could be linked with our app Configuring our server We’re almost done! Now that we have built both our schema and resolver, our next step is to link them together. In index.js, write this block of code: import { ApolloServer } from "apollo-server-express"; import Schema from "./Schema"; import Resolvers from "./Resolvers"; import express from "express"; import { ApolloServerPluginDrainHttpServer } from "apollo-server-core"; import http from "http"; async function startApolloServer(schema: any, resolvers: any) { const app = express(); const httpServer = http.createServer(app); const server = new ApolloServer({ typeDefs: schema, resolvers, //tell Express to attach GraphQL functionality to the server plugins: [ApolloServerPluginDrainHttpServer({ httpServer })], }) as any; await server.start(); //start the GraphQL server. server.applyMiddleware({ app }); await new Promise<void>((resolve) => httpServer.listen({ port: 4000 }, resolve) //run the server on port 4000 ); console.log(`Server ready at{server.graphqlPath}`); } //in the end, run the server and pass in our Schema and Resolver. startApolloServer(Schema, Resolvers); Let’s test it out! To run the code, use this Bash command: npx nodemon app/index.ts This will create a server at the localhost:4000/graphql URL. Here, you can see your available schemas within the UI: This means that our code works! All of our GraphQL queries will go within the Operation panel. To see it in action, type this snippet within this box: #make a query: query { #get all of the people available in the server getAllPeople { #procure their IDs and names. id name } } To see the result, click on the Run button: We can even search for a specific entity via the getPerson query: query ($getPersonId: Int) { #the argument will be of type Integer getPerson(id: 1) { #get the person with the ID of 1 name id } } Creating mutations In the GraphQL world, mutations are commands that perform side effects on the database. Common examples of this include: - Adding a user to the database — When a client signs up for a website, the user performs a mutation to save their data in their database - Editing or deleting an object — If a user modifies or removes data from a database, they are essentially creating a mutation on the server To handle mutations, go to your Schema.ts module. Here, within the Schema variable, add the following lines of code: const Schema = gql` #other code.. type Mutation { #the addPerson commmand will accept an argument of type String. #it will return a 'Person' instance. addPerson(name: String): Person } `; Our next step is to create a resolver to handle this mutation. To do so, within the Resolvers.ts file, add this block of code: const Resolvers = { Query: { //..further code.. }, //code to add: //all our mutations go here. Mutation: { //create our mutation: addPerson: (_: any, args: any) => { const newPerson = { id: people.length + 1, //id field name: args.name, //name field }; people.push(newPerson); return newPerson; //return the new object's result }, }, }; - The addPersonmutation accepts a nameargument - When a nameis passed, the program will create a new object with a matching namekey - Next, it will use the pushmethod to add this object to the peopledataset - Finally, it will return the new object’s properties to the client That’s it! To test it out, run this code within the Operations window: #perform a mutation on the server mutation($name: String) { addPerson(name:"Hussain") { #add a new person with the name "Hussain" #if the execution succeeds, return its 'id' and 'name` to the user. id name } } Let’s verify if GraphQL has added the new entry to the database: query { getAllPeople { #get all the results within the 'people' database. #return only their names name } } Building our client We have successfully built our server. In this section, we will build a client app using Next that will listen to the server and render data to the UI. As a first step, initialize a blank Next.js app like so: npx [email protected] graphql-client --ts touch constants.tsx #our query variables go here. To perform GraphQL operations, we will use the graphql-request library. This is a minimal, open source module that will help us make mutations and queries on our server: npm install graphql-request graphql npm install react-hook-form #to capture user input Creating query variables In this section, we will code our queries and mutations to help us make GraphQL operations. To do so, go to constants.tsx and add the following code: import { gql } from "graphql-request"; //create our query const getAllPeopleQuery = gql` query { getAllPeople { #run the getAllPeople command id name } } `; //Next, declare a mutation const addPersonMutation = gql` mutation addPeople($name: String!) { addPerson(name: $name) { #add a new entry. Argument will be 'name' id name } } `; export { getAllPeopleQuery, addPersonMutation }; - In the first part, we created the getAllPeopleQueryvariable. When the user runs this query, the program will instruct the server to get all the entries present in the database - Later on, the addPersonmutation tells GraphQL to add a new entry with its respected namefield - In the end, we used the exportkeyword to link our variables with the rest of the project Performing queries In pages/index.ts, write the following code: import type { NextPage, GetStaticProps, InferGetStaticPropsType } from "next"; import { request } from "graphql-request"; //allows us to perform a request on our server import { getAllPeopleQuery } from "../constants"; import Link from "next/link"; const Home: NextPage = ({ result, //extract the 'result' prop }: InferGetStaticPropsType<typeof getStaticProps>) => { return ( <div className={styles.container}> {result.map((item: any) => { //render the 'result' array to the UI return <p key={item.id}>{item.name}</p>; })} <Link href="/addpage">Add a new entry </Link> </div> ); }; //fetch data from the server export const getStaticProps: GetStaticProps = async () => { //the first argument is the URL of our GraphQL server const res = await request("", getAllPeopleQuery); const result = res.getAllPeople; return { props: { result, }, // will be passed to the page component as props }; }; export default Home; Here is a breakdown of this code piece by piece: - In the getStaticPropsmethod, we instructed Next to run the getAllPeoplecommand on our GraphQL server - Later on, we returned its response to the Homefunctional component. This means that we can now render the result to the UI - Next, the program used the mapmethod to render all of the results of the getAllPeoplecommand to the UI. Each paragraph element will display the namefields of each entry - Furthermore, we also used a Linkcomponent to redirect the user to the addpageroute. This will allow the user to add a new Personinstance to the table To test out the code, run the following terminal command: npm run dev This will be the result: Our GraphQL server even updates in real time. Performing mutations Now that we have successfully performed a query, we can even perform mutations via the graphql-request library. Within your pages folder, create a new file called addpage.tsx. As the name suggests, this component will allow the user to add a new entry to the database. Here, start by writing the following block of code: import type { NextPage, GetStaticProps, InferGetStaticPropsType } from "next"; import { request } from "graphql-request"; import { addPersonMutation } from "../constants"; const AddPage: NextPage = () => { return ( <div> <p>We will add a new entry here. </p> </div> ); }; export default AddPage; In this piece of code, we are creating a blank page with a piece of text. We are doing this to ensure whether our URL routing system works. This means that we used routing successfully! Next, write this snippet in your addpage.tsx file: import { useForm } from "react-hook-form"; const { register, handleSubmit } = useForm(); //if the user submits the form, then the program will output the value of their input. const onSubmit = (data: any) => console.log(data); return ( <div> <form onSubmit={handleSubmit(onSubmit)}> {/*Bind our handler to this form.*/} {/* The user's input will be saved within the 'name' property */} <input defaultValue="test" {...register("name")} /> <input type="submit" /> </form> </div> ); This will be the output: Now that we have successfully captured the user’s input, our last step is to add their entry to the server. To do so, change the onSubmit handler located in pages/addpage.tsx file like so: const onSubmit = async (data: any) => { const response = await request( "", addPersonMutation, data ); console.log(response); }; - Here, we’re performing a mutation request to our GraphQL server via the requestfunction - Furthermore, we also passed in the addPersonmutation command to our request header. This will tell GraphQL to perform the addMutationaction on our server This will be the result: And we’re done! Conclusion Here is the full source code of this project. In this article, you learned how to create a full-stack app using GraphQL and TypeScript. They both are extremely crucial skills within the programming world since they are in high demand nowadays. If you encountered any difficulty in this code, I advise you to deconstruct the code and play with it so that you can fully grasp this concept. Thank you so much for reading!_12<<.
https://blog.logrocket.com/build-graphql-app-node-js-typescript-graphql-request/
CC-MAIN-2022-40
refinedweb
2,480
61.26
Can someone help me to find a longest word in array ? (c) and print it ? Can someone help me to find a longest word in array ? (c) and print it ? #include <stdio.h> #include <stdlib.h> int main () { int i,b,c,max=0,zodis=0; char raide; char line[50]; printf("Type symbol line) \n"); scanf("%[^\n]%*c", line); printf("Entered symbol line\n%s \n",line); for (i=0;line[i];i++) { if (line[i]!=' ') { I'm stuck here i dont know what to do next Okey so how should i do it :/ ? Figure out what it is that you need to do and then write the code to do it. Obviously, the program should involve an array of strings, which you will iterate through to determine which string is the longest. How to make that last word would be counted as well ? Code:#include<stdio.h> #include<stdlib.h> int main() { char eil[50]; int sk,i,ilgis=0,pradzia=0,maxpr=0,max=0; printf("Iveskite simboliu eilute su tarpais \n"); gets(eil); for (i=0; i < 50; i++) { sk = eil[i]; if (sk!=' ') ilgis++; if (sk==' ') { if (max<ilgis) {max= ilgis; maxpr=pradzia;} pradzia=i+1; ilgis=0; } } printf("Ilgiausias zodis:\n"); for (i=maxpr; i < maxpr+max; i++) printf("%c",eil[i]); system("pause "); return 0; } Oh, so you wanted the longest word in a string! Why didn't you say so? consider this part of your code: Instead, why don't you write that this way?:Instead, why don't you write that this way?:Code:if (sk!=' ') ilgis++; if (sk==' ') { That is how a programmer would normally write that.That is how a programmer would normally write that.Code:if (sk == ' ') { // your code for when you hit a delimiter between words } else ilgis++; In addition, you can make the if test more complex without having to make the other test equally complex and properly negated. For example, besides testing for ' ', you could also test for punctuation marks, or the end of the string. By being able to detect the end of the string, you could "count the last word as well". You could simply keep your code as it is and change the tests in the two if statements, but then you'd have to perform those tests twice, plus you would be more likely to make a mistake in writing that duplicate code. Worse, if you find that you need to correct the if statement, then you might forget to also correct the other one (that's a maintainability issue). I would recommend simplifying your code with an if-else and then make the changes to the if statement's condition. Thanks and sorry for my bad grammar.
http://forums.devshed.com/programming-42/word-array-954097.html
CC-MAIN-2014-52
refinedweb
457
80.31
Prima::VB::VBLoader - Visual Builder file loader The module provides functionality for loading resource files, created by Visual Builder. After the successful load, the newly created window with all children is returned. The simple way to use the loader is as that: use Prima qw(Application); use Prima::VB::VBLoader; Prima::VBLoad( './your_resource.fm', Form1 => { centered => 1 }, )-> execute; A more complicated but more proof code can be met in the toolkit: use Prima qw(Application); eval "use Prima::VB::VBLoader"; die "$@\n" if $@; $form = Prima::VBLoad( $fi, 'Form1' => { visible => 0, centered => 1}, ); die "$@\n" unless $form; All form widgets can be supplied with custom parameters, all together combined in a hash of hashes and passed as the second parameter to VBLoad() function. The example above supplies values for ::visible and ::centered to Form1 widget, which is default name of a form window created by Visual Builder. All other widgets are accessible by their names in a similar fashion; after the creation, the widget hierarchy can be accessed in the standard way: $form = Prima::VBLoad( $fi, .... 'StartButton' => { onMouseOver => sub { die "No start buttons here\n" }, } ); ... $form-> StartButton-> hide; In case a form is to be included not from a fm file but from other data source, AUTOFORM_REALIZE call can be used to transform perl array into set of widgets: $form = AUTOFORM_REALIZE( [ Form1 => { class => 'Prima::Window', parent => 1, profile => { name => 'Form1', size => [ 330, 421], }], {}); Real-life examples are met across the toolkit; for instance, Prima/PS/setup.fm dialog is used by Prima::PS::Setup. Scans HEADER, - the first line of a .fm file for version info. Returns two scalars - the first is a boolean flag, which is set to 1 if the file can be used and loaded, 0 otherwise. The second scalar is a version string. Depending on value of boolean flag Prima::VB::VBLoader::builderActive performs the following: if it is 1, the SUB text is returned as is. If it is 0, evaluates it in sub{} context and returns the code reference. If evaluation fails, EXTRA_DATA is stored in Prima::VB::VBLoader::eventContext array and the exception is re-thrown. Prima::VB::VBLoader::builderActive is an internal flag that helps the Visual Builder use the module interface without actual SUB evaluation. WIDGETS is an array reference that contains evaluated data of the read content of .fm file ( its data format is preserved). PARAMETERS is a hash reference with custom parameters passed to widgets during creation. The widgets are distinguished by the names. Visual Builder ensures that no widgets have equal names. AUTOFORM_REALIZE creates the tree of widgets and returns the root window, which is usually named Form1. It automatically resolves parent-child relations, so the order of WIDGETS does not matter. Moreover, if a parent widget is passed as a parameter to a children widget, the parameter is deferred and passed after the creation using ::set call. During the parsing and creation process internal notifications can be invoked. These notifications (events) are stored in .fm file and usually provide class-specific loading instructions. See Events for details. Reads FILENAME in .fm file format, checks its version, loads, and creates widget tree. Upon successful load the root widget is returned. The parsing and creation is performed by calling AUTOFORM_REALIZE. If loading fails, die() is called. A wrapper around AUTOFORM_CREATE, exported in Prima namespace. FILENAME can be specified either as a file system path name, or as a relative module name. In a way, Prima::VBLoad( 'Module::form.fm' ) and Prima::VBLoad( Prima::Utils::find_image( 'Module' 'form.fm')) are identical. If the procedure finds that FILENAME is a relative module name, it calls Prima::Utils::find_image automatically. To tell explicitly that FILENAME is a file system path name, FILENAME must be prefixed with < symbol ( the syntax is influenced by CORE::open ). %PARAMETERS is a hash with custom parameters passed to widgets during creation. The widgets are distinguished by the names. Visual Builder ensures that no widgets have equal names. If the form file loaded successfully, returns the form object reference. Otherwise, undef is returned and the error string is stored in $@ variable. The events, stored in .fm file are called during the loading process. The module provides no functionality for supplying the events during the load. This interface is useful only for developers of Visual Builder - ready classes. The events section is located in actions section of widget entry. There can be more than one event of each type, registered to different widgets. NAME parameter is a string with name of the widget; INSTANCE is a hash, created during load for every widget provided to keep internal event-specific or class-specific data there. extras section of widget entry is present there as an only predefined key. Called upon beginning of widget tree creation. Called after the creation of a form, which reference is contained in ROOT_WIDGET. Called after the creation of the widget. The newly created widget is passed in WIDGET Called before child of WIDGET is created with CHILD_NAME as name. Called after child of WIDGET is created; the newly created widget is passed in CHILD_WIDGET. Called after the creation of all widgets is finished. The idea of format of .fm file is that is should be evaluated by perl eval() call without special manipulations, and kept as plain text. The file begins with a header, which is a #-prefixed string, and contains a signature, version of file format, and version of the creator of the file: # VBForm version file=1 builder=0.1 The header can also contain additional headers, also prefixed with #. These can be used to tell the loader that another perl module is needed to be loaded before the parsing; this is useful, for example, if a constant is declared in the module. # [preload] Prima::ComboBox The main part of a file is enclosed in sub{} statement. After evaluation, this sub returns array of paired scalars, where each first item is a widget name and second item is hash of its parameters and other associated data: sub { return ( 'Form1' => { class => 'Prima::Window', module => 'Prima::Classes', parent => 1, code => GO_SUB('init()'), profile => { width => 144, name => 'Form1', origin => [ 490, 412], size => [ 144, 100], }}, ); } The hash has several predefined keys: Contains hash of events. The events are evaluated via GO_SUB mechanism and executed during creation of the widget tree. See Events for details. Contains a code, executed before the form is created. This key is present only on the root widget record. Contains name of a class to be instantiated. Contains a class-specific parameters, used by events. Contains name of perl module that contains the class. The module will be use'd by the loader. A boolean flag; set to 1 for the root widget only. Contains profile hash, passed as parameters to the widget during its creation. If custom parameters were passed to AUTOFORM_CREATE, these are coupled with profile ( the custom parameters take precedence ) before passing to the create() call. Dmitry Karasik, <dmitry@karasik.eu.org>.
http://search.cpan.org/~karasik/Prima-1.36/Prima/VB/VBLoader.pm
CC-MAIN-2014-10
refinedweb
1,161
57.27
This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site. Quote from Martin_Toy »You don't need to install betterlight, it's standard with the latest MC update. Quote from Fidget98160 » what you would be looking for exactly is the nvidia physx fix for ati cards..physx has full opengl support and greatly increses what ati cards can do. Quote from Finzy » WIldgrass and most other mods are not even updated for 1.3 not using non-updated mods, might help.... Quote from Scuttles » Ok but i can run crysis on high and some features on ULTRA high with 50fps minimum 40fps and i cant run minecraft with 256x256. That made me sick. my pc spec are Operating System MS Windows 7 Home Premium 64-bit CPU Intel Mobile Core 2 Duo P7550 @ 2.26GHz 49 °C Penryn 45nm Technology RAM 4.0GB Dual-Channel DDR3 @ 532MHz (7-7-7-20) Motherboard LENOVO KIWB1 (U2E1) Graphics PnP (1366x768@60Hz) NVIDIA GeForce GT 240M Hard Drives 488GB Western Digital WDC WD5000BEVT-24A0RT0 (SATA) 35 °C Optical Drives DTSoftBusCd00 HL-DT-ST DVDRAM GT30N Audio Realtek High Definition Audio Quote from icarus963 »Ok but i can run crysis on high and some features on ULTRA high with 50fps minimum 40fps and i cant run minecraft with 256x256. That made me sick. -specs- Quote from CoffiNail »How do i do this? Quote from Pazaz »I.E. 1: I.E. 2: Any of those two fit your fancy? Mocked one of them up. One I edited. Quote from Martin_Toy »Heya Scuttles, looking good on the pack front! However, for the first time, I has a gripe :sad.gif: I seem to get these really weird white outlines around torches: -broken torches- Any thoughts on what that might be? Quote from Quash »I had to reinstall minecraft after the first patch of 256x256 rendered it unable to open without crashing. But I was determined to try it out so I installed it a second time and it works, just takes a bit longer to open minecraft. I have to say it is breathtaking. Specs: Core i7 12gb DDR3 ATI Radeon HD5770 Still get 30-60 FPS Quote from TRSSZZZZ »this pack looks really nice, but the signs are almost equal to Aegeon´s pack :/ Quote from drfrozenfire »what do you use to get such fantastic screenshots? that last one looked like crap compared to yours Quote from Darkfox118 »had to go back to mixcraft hd, sorry man, your texture pack is beyond words, but it's also beyond my computer. As soon as javaw hits 1gb of ram the screen goes black, no matter what I have open. Quote from airrunner85 »Hello Scuttles, any chance you can take a quick look at this for me? When i run test after using the patcher with this texture pack it runs fine. But when i use the launcher after im finished with the patcher it logs me in then it just closes the launcher down. Here is my error log, any ideas? -error- Quote from Finzy »Got the mod to work now, apparently WildGrass indeed doesn't work in 1.3 yet (and causes a black screen). I'm getting pretty poor fps with the 256x256 pack though, about 30-45 fps, with the most intensive scenes dipping to even 20. Should I expect any better performance on these specs; -). Quote from kookster »Where did you find the 64 bit version? Do you have a link? Quote from WidowmakeR »Isnt the same without WildGrass Quote from Scuttles » How much FPS do you get anyways? I get 55 on 256x256 as I stated a few pages back... I didnt even know that was possible... I have an AMD Phenom II X3... ATI Mobility Radeon HD 4250 256MB Graphics card.... And I run it on Gaming mode.... AMD Fusion Quote from kookster »i dont know if im digging the new stone. Stuff I Like: I didn't, that's why I installed WildGrass *with* BetterLight (or for betterlight, whatever :tongue.gif:) since I thought it was bundled with the update. Btw my system specs if they make any difference: - Intel Core 2 Duo T6600 2.2 Ghz - 4 GB RAM - Ati Mobility Radeon HD 4670 XT 1 GB - Windows 7 Home Premium 64 bit I've used Aageon's Bumpmaft 128x128 texture pack before without issues, just want this thing to work... :tongue.gif: Specs: Core i7 12gb DDR3 ATI Radeon HD5770 Still get 30-60 FPS You should be well beyond capable of running this game. =/ This game was poorly designed when using a single .png for accessing all of the textures because the 256x256 stretches a graphics card to it's physical limited with 4000x4000 image size. (Yea, I rounded) Anyway, have you tried to install 64bit java yet. Also, which mods, if any, are you currently running with. I potentially just could be an incompatible mod. 1. hold windows key and press "r" 2. Type %appdata% with the % symbols 3. Find .minecraft 4. Open bin folder 5. Open minecraft.jar with winrar or other similar program Top one looks pretty damn good from the screens. I'll have to tweak it a bit to my liking. ;D Hmmmm... It's not the pack because I just checked and my game even runs with without white lines. Did you have any mods installed? The game takes quite a bit longer to load because it's physically loading textures 256 times bigger. xD Some of this pack is still part of my original collaboration. I'm working hard to trying to make this pack and no longer need a sources section of my main post. ^^ I just run around for a few minutes and take random shots until I find something I like. =) You'll notice all of my screenshots that I personally uploaded were just of nature. Most of the fan's screenshots were of impressive structures. All in all, it's a fine balance, but that's still a damn big highway. @_@ Also to answer a few of your questions: Some things on there aren't possible without mods, yet. Such as different wood from different trees and cycling through beds. Fences aren't a texture I can edit which is very unfortunate. I'm working on things such as the flowers I've realized that sandstone tiles awfully after I released it, sorry. =( That is likely a java 32bit issue. Java 64 bit can go way beyond using the 1gig that the 32 bit can use. Here is my error log, any ideas? A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x525187cb, pid=4752, tid=2692 # # JRE version: 6.0_24-b07 # Java VM: Java HotSpot(TM) Client VM (19.1-b02 mixed mode windows-x86 ) # Problematic frame: # C [atioglxx.dll+0xb787cb] # # If you would like to submit a bug report, please visit: # # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x4e55c400): JavaThread "Minecraft main thread" daemon [_thread_in_native, id=2692, stack(0x4b120000,0x4b170000)] siginfo: ExceptionCode=0xc0000005, writing address 0x00c01800 Registers: EAX=0x00c01800, EBX=0x53481000, ECX=0x00000008, EDX=0x00000000 ESP=0x4b16f4ac, EBP=0x4b16f4b4, ESI=0x53481000, EDI=0x00c01800 EIP=0x525187cb, EFLAGS=0x00010212 Register to memory mapping: EAX=0x00c01800 0x00c01800 is pointing to unknown location EBX=0x53481000 0x53481000 is pointing to unknown location ECX=0x00000008 0x00000008 is pointing to unknown location EDX=0x00000000 0x00000000 is pointing to unknown location ESP=0x4b16f4ac 0x4b16f4ac EBP=0x4b16f4b4 0x4b16f4b4 ESI=0x53481000 0x53481000 is pointing to unknown location EDI=0x00c01800 0x00c01800 is pointing to unknown location Top of Stack: (sp=0x4b16f4ac) 0x4b16f4ac: 00000400 00000000 4b16f4e4 52518871 0x4b16f4bc: 00c01800 53481000 00000400 00000000 0x4b16f4cc: 00000000 00000050 53481000 00c00000 0x4b16f4dc: 00000100 53481000 52b362e8 5230aa82 0x4b16f4ec: 00c01800 53481000 00000400 52b362e8 0x4b16f4fc: 52adbc18 52ad8100 00000100 00000400 0x4b16f50c: 00000001 522a3f00 00001800 04000000 0x4b16f51c: 00000300 00000000 00000400 00000400 Instructions: (pc=0x525187cb) 0x525187bb: 06 66 0f 6f 4e 10 66 0f 6f 56 20 66 0f 6f 5e 30 0x525187cb: 66 0f 7f 07 66 0f 7f 4f 10 66 0f 7f 57 20 66 0f Stack: [0x4b120000,0x4b170000], sp=0x4b16f4ac, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [atioglxx.dll+0xb787cb] C [atioglxx.dll+0xb78871] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.lwjgl.opengl.GL11.nglTexSubImage2D(IIIIIIIILjava/nio/Buffer;IJ)V+0 j org.lwjgl.opengl.GL11.glTexSubImage2D(IIIIIIIILjava/nio/ByteBuffer;)V+62 j hf.a()V+163 j net.minecraft.client.Minecraft.j()V+128 j net.minecraft.client.Minecraft.run()V+169 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x4e55e400 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=4724, stack(0x65f40000,0x65f90000)] 0x4e55d800 JavaThread "Thread-13" daemon [_thread_blocked, id=4908, stack(0x4fdb0000,0x4fe00000)] 0x4e55d000 JavaThread "Thread-12" daemon [_thread_blocked, id=2580, stack(0x592a0000,0x592f0000)] 0x4e55cc00 JavaThread "Thread-11" daemon [_thread_in_native, id=4816, stack(0x4e400000,0x4e450000)] =>0x4e55c400 JavaThread "Minecraft main thread" daemon [_thread_in_native, id=2692, stack(0x4b120000,0x4b170000)] 0x4e55bc00 JavaThread "Timer hack thread" daemon [_thread_blocked, id=4716, stack(0x4b090000,0x4b0e0000)] 0x4ac08000 JavaThread "TimerQueue" daemon [_thread_blocked, id=3440, stack(0x50150000,0x501a0000)] 0x4e4f0000 JavaThread "D3D Screen Updater" daemon [_thread_blocked, id=3504, stack(0x4e290000,0x4e2e0000)] 0x00529000 JavaThread "DestroyJavaVM" [_thread_blocked, id=1540, stack(0x00430000,0x00480000)] 0x4ab3d000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=4584, stack(0x4de10000,0x4de60000)] 0x4aaebc00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4128, stack(0x4b000000,0x4b050000)] 0x4aaeb400 JavaThread "AWT-Shutdown" [_thread_blocked, id=2680, stack(0x4af70000,0x4afc0000)] 0x4aae8c00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=4244, stack(0x4ae70000,0x4aec0000)] 0x0249f000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3452, stack(0x4a970000,0x4a9c0000)] 0x0249a400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4656, stack(0x4a8e0000,0x4a930000)] 0x02499400 JavaThread "Attach Listener" daemon [_thread_blocked, id=3064, stack(0x4a850000,0x4a8a0000)] 0x02496400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3156, stack(0x4a7c0000,0x4a810000)] 0x02467c00 JavaThread "Finalizer" daemon [_thread_blocked, id=4844, stack(0x4a730000,0x4a780000)] 0x02466400 JavaThread "Reference Handler" daemon [_thread_blocked, id=4780, stack(0x4a6a0000,0x4a6f0000)] Other Threads: 0x02462c00 VMThread [stack] [id=3744] 0x024a8c00 WatcherThread [stack] [id=1172] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 157376K, used 132153K eden space 139904K, 94% used from space 17472K, 0% used to space 17472K, 0% used tenured generation total 349568K, used 131625K the space 349568K, 37% used compacting perm gen total 15616K, used 15459K the space 15616K, 98% used No shared spaces configured. Dynamic libraries: 0x00400000 - 0x00424000 C:\Program Files (x86)\Java\jre6\bin\javaw.exe 0x76f50000 - 0x770d0000 C:\Windows\SysWOW64\ntdll.dll 0x74fa0000 - 0x750a0000 C:\Windows\syswow64\kernel32.dll 0x74b40000 - 0x74b86000 C:\Windows\syswow64\KERNELBASE.dll 0x76ab0000 - 0x76b50000 C:\Windows\syswow64\ADVAPI32.dll 0x753c0000 - 0x7546c000 C:\Windows\syswow64\msvcrt.dll 0x75140000 - 0x75159000 C:\Windows\SysWOW64\sechost.dll 0x74b90000 - 0x74c80000 C:\Windows\syswow64\RPCRT4.dll 0x74ac0000 - 0x74b20000 C:\Windows\syswow64\SspiCli.dll 0x74ab0000 - 0x74abc000 C:\Windows\syswow64\CRYPTBASE.dll 0x757b0000 - 0x758b0000 C:\Windows\syswow64\USER32.dll 0x75d70000 - 0x75e00000 C:\Windows\syswow64\GDI32.dll 0x753b0000 - 0x753ba000 C:\Windows\syswow64\LPK.dll 0x758f0000 - 0x7598d000 C:\Windows\syswow64\USP10.dll 0x75190000 - 0x751f0000 C:\Windows\system32\IMM32.DLL 0x74ed0000 - 0x74f9c000 C:\Windows\syswow64\MSCTF.dll 0x7c340000 - 0x7c396000 C:\Program Files (x86)\Java\jre6\bin\msvcr71.dll 0x6d7f0000 - 0x6da96000 C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll 0x72cb0000 - 0x72ce2000 C:\Windows\system32\WINMM.dll 0x72c50000 - 0x72c9b000 C:\Windows\system32\apphelp.dll 0x6d7a0000 - 0x6d7ac000 C:\Program Files (x86)\Java\jre6\bin\verify.dll 0x6d320000 - 0x6d33f000 C:\Program Files (x86)\Java\jre6\bin\java.dll 0x6d280000 - 0x6d288000 C:\Program Files (x86)\Java\jre6\bin\hpi.dll 0x76f20000 - 0x76f25000 C:\Windows\syswow64\PSAPI.DLL 0x6d7e0000 - 0x6d7ef000 C:\Program Files (x86)\Java\jre6\bin\zip.dll 0x6d000000 - 0x6d14a000 C:\Program Files (x86)\Java\jre6\bin\awt.dll 0x72bf0000 - 0x72c41000 C:\Windows\system32\WINSPOOL.DRV 0x74d70000 - 0x74ecc000 C:\Windows\syswow64\ole32.dll 0x72eb0000 - 0x7304e000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16661_none_420fe3fa2b8113bd\COMCTL32.dll 0x74c80000 - 0x74cd7000 C:\Windows\syswow64\SHLWAPI.dll 0x72bd0000 - 0x72be3000 C:\Windows\system32\DWMAPI.DLL 0x72a70000 - 0x72af0000 C:\Windows\system32\uxtheme.dll 0x00500000 - 0x00512000 C:\Program Files (x86)\MSI Afterburner\Bundle\OSDServer\RTSSHooks.dll 0x75e00000 - 0x76a49000 C:\Windows\syswow64\shell32.dll 0x6d230000 - 0x6d27f000 C:\Program Files (x86)\Java\jre6\bin\fontmanager.dll 0x69de0000 - 0x69fa3000 C:\Windows\system32\d3d9.dll 0x745d0000 - 0x745d9000 C:\Windows\system32\VERSION.dll 0x72140000 - 0x72146000 C:\Windows\system32\d3d8thk.dll 0x6c140000 - 0x6c1ca000 C:\Windows\system32\aticfx32.dll 0x6d530000 - 0x6d53a000 C:\Windows\system32\atiu9pag.dll 0x69600000 - 0x699ee000 C:\Windows\system32\atiumdag.dll 0x69a70000 - 0x69dd4000 C:\Windows\system32\atiumdva.dll 0x6d600000 - 0x6d613000 C:\Program Files (x86)\Java\jre6\bin\net.dll 0x758b0000 - 0x758e5000 C:\Windows\syswow64\WS2_32.dll 0x74b20000 - 0x74b26000 C:\Windows\syswow64\NSI.dll 0x73060000 - 0x7309c000 C:\Windows\system32\mswsock.dll 0x72d60000 - 0x72d66000 C:\Windows\System32\wship6.dll 0x6d620000 - 0x6d629000 C:\Program Files (x86)\Java\jre6\bin\nio.dll 0x73050000 - 0x73055000 C:\Windows\System32\wshtcpip.dll 0x72e60000 - 0x72ea4000 C:\Windows\system32\DNSAPI.dll 0x72d30000 - 0x72d54000 C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL 0x72e40000 - 0x72e5c000 C:\Windows\system32\IPHLPAPI.DLL 0x72e30000 - 0x72e37000 C:\Windows\system32\WINNSI.DLL 0x72d70000 - 0x72d76000 C:\Windows\system32\rasadhlp.dll 0x74500000 - 0x74516000 C:\Windows\system32\CRYPTSP.dll 0x744c0000 - 0x744fb000 C:\Windows\system32\rsaenh.dll 0x745b0000 - 0x745c7000 C:\Windows\system32\USERENV.dll 0x745a0000 - 0x745ab000 C:\Windows\system32\profapi.dll 0x72d80000 - 0x72d90000 C:\Windows\system32\NLAapi.dll 0x71f00000 - 0x71f08000 C:\Windows\System32\winrnr.dll 0x71ef0000 - 0x71f00000 C:\Windows\system32\napinsp.dll 0x71ed0000 - 0x71ee2000 C:\Windows\system32\pnrpnsp.dll 0x72cf0000 - 0x72d28000 C:\Windows\System32\fwpuclnt.dll 0x75240000 - 0x752cf000 C:\Windows\syswow64\OLEAUT32.DLL 0x6d780000 - 0x6d788000 C:\Program Files (x86)\Java\jre6\bin\sunmscapi.dll 0x75c50000 - 0x75d6c000 C:\Windows\syswow64\CRYPT32.dll 0x74b30000 - 0x74b3c000 C:\Windows\syswow64\MSASN1.dll 0x4b170000 - 0x4b1db000 C:\Users\aaron\AppData\Roaming\.minecraft\bin\natives\lwjgl.dll 0x74380000 - 0x74448000 C:\Windows\system32\OPENGL32.dll 0x74350000 - 0x74372000 C:\Windows\system32\GLU32.dll 0x74200000 - 0x742e7000 C:\Windows\system32\DDRAW.dll 0x74340000 - 0x74346000 C:\Windows\system32\DCIMAN32.dll 0x75990000 - 0x75b2d000 C:\Windows\syswow64\SETUPAPI.dll 0x75300000 - 0x75327000 C:\Windows\syswow64\CFGMGR32.dll 0x75c30000 - 0x75c42000 C:\Windows\syswow64\DEVOBJ.dll 0x6d350000 - 0x6d356000 C:\Program Files (x86)\Java\jre6\bin\jawt.dll 0x74330000 - 0x74337000 C:\Windows\system32\atiglpxx.dll 0x519a0000 - 0x5296c000 C:\Windows\system32\atioglxx.dll 0x741f0000 - 0x741fa000 C:\Windows\system32\atigktxx.dll 0x4b1e0000 - 0x4b21d000 C:\Windows\system32\atiadlxy.dll 0x74800000 - 0x7480d000 C:\Windows\system32\WTSAPI32.dll 0x75160000 - 0x7518d000 C:\Windows\syswow64\WINTRUST.dll 0x4b490000 - 0x4b4a3000 C:\Users\aaron\AppData\Roaming\.minecraft\bin\natives\jinput-dx8.dll 0x741c0000 - 0x741f0000 C:\Windows\system32\DINPUT8.dll 0x741b0000 - 0x741b9000 C:\Windows\system32\HID.DLL 0x4b4d0000 - 0x4b4e2000 C:\Users\aaron\AppData\Roaming\.minecraft\bin\natives\jinput-raw.dll 0x74080000 - 0x741a9000 C:\Users\aaron\AppData\Roaming\.minecraft\bin\natives\OpenAL32.dll 0x71a10000 - 0x71a82000 C:\Windows\system32\dsound.dll 0x71dd0000 - 0x71df5000 C:\Windows\system32\POWRPROF.dll 0x750a0000 - 0x75123000 C:\Windows\syswow64\CLBCatQ.DLL 0x73290000 - 0x732c9000 C:\Windows\System32\MMDevApi.dll 0x73190000 - 0x73285000 C:\Windows\System32\PROPSYS.dll 0x73160000 - 0x73190000 C:\Windows\system32\wdmaud.drv 0x73150000 - 0x73154000 C:\Windows\system32\ksuser.dll 0x73140000 - 0x73147000 C:\Windows\system32\AVRT.dll 0x73100000 - 0x73136000 C:\Windows\system32\AUDIOSES.DLL 0x730f0000 - 0x730f8000 C:\Windows\system32\msacm32.drv 0x71e10000 - 0x71e24000 C:\Windows\system32\MSACM32.dll 0x71e00000 - 0x71e07000 C:\Windows\system32\midimap.dll VM Arguments: jvm_args: -Xms512m -Xmx1024m java_command: C:\Users\aaron\Desktop\Minecraft.exe Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Pinnacle\Shared Files\;C:\Program Files (x86)\Pinnacle\Shared Files\Filter\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\GmoteServer\bin\vlc;C:\Program Files (x86)\Java\jre6\bin USERNAME=aaron OS=Windows_NT PROCESSOR_IDENTIFIER=AMD64 Family 16 Model 4 Stepping 2, AuthenticAMD --------------- S Y S T E M --------------- OS: Windows 7 Build 7600 CPU:total 4 (4 cores per cpu, 1 threads per core) family 16 model 4 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, popcnt, mmxext, 3dnow, 3dnowext, lzcnt, sse4a Memory: 4k page, physical 4192760k(1743572k free), swap 8383624k(5053312k free) vm_info: Java HotSpot(TM) Client VM (19.1-b02) for windows-x86 JRE (1.6.0_24-b07), built on Feb 2 2011 17:44:41 by "java_re" with MS VC++ 7.1 (VS2003) time: Thu Feb 24 18:59:49 2011 elapsed time: 26 seconds Are you running the default launcher or did you download the new launcher on the MC downloads page? There have been many reports of this happening after the 1.3 update. I'm not quite sure what is causing it at the moment. =/ Also which method of installation did you do? Patcher, manual, or through texture pack folder? Off topic news: I'm trying to get this video or a similar one for my main page. I think it would draw some more attention when people can visualize the pack in motion instead of still pictures. -). Yea, most mods become incompatible with each update which is a pain in the ass to wait for. 30-45 fps on a 256x256 pack is actually quite reasonable. If you had a gaming beast that may be a problem, but only 80-150 on Aageons is fairly average. It's funny how minecraft with textures at 256x256 is roughly the equivalent in demand to playing Crysis on medium/high, from my experience. Java 64-bit allows a greater amount of memory to be used by java when running processes such as Minecraft. If your Minecraft is continually capped out at like 820mb, then it is about time to upgrade to 64-bit Java. Keep in mind it was a pain in the ass to find for me. =/ Apparently it's the second download for windows. The one that is 15mb instead of the 10mb one. If that doesn't work you always have the the one that is obvious. (This is the one I use) I feel your pain. Luckily I had a back up .jar. ^^ Screens of my progress in polishing this for the next update This is a better tiling smoothstone texture which has given some pleasing results. What about the new stone?
http://www.minecraftforum.net/forums/mapping-and-modding/resource-packs/1223855-lb-photo-realism-1-6-convert-7-16-2013-rpg-realism?page=44&cookieTest=1
CC-MAIN-2014-42
refinedweb
3,061
69.07
Class defining uav multiplexing. More... #include <UavMultiplex.h> Class defining uav multiplexing. Constructor. Construct a uav multiplexing. It will be child of the FrameworkManager. Destructor. Set roll torque. roll torque is placed in input(0,0) Set pitch torque. pitch torque is placed in input(1,0) Set yaw torque. yaw torque is placed in input(2,0) Set thrust. thrust is placed in input(3,0) Set roll trim. trim is placed in input(4,0) Set pitch trim. trim is placed in input(5,0) Set yaw trim. trim is placed in input(6,0) Update using provided datas. Uses values specified by Set*(). Lock user interface. User interface will be grayed out. Use it do disallow changes when flying. Unlock user interface. User interface will be enabled. Layout. Layout to place custom widgets. Use default plot. Derived class can implement this function do draw default plot. Reimplemented in flair::filter::X4X8Multiplex. Motors count. This function must be reimplemented, in order to get the number of motors. Implemented in flair::filter::X4X8Multiplex. Multiplex value. Get the mutliplexed value of a motor, if SetMultiplexComboBox() was used. Get TabWidget. Usefull to add tabs. Set multiplex ComboBox. Draws a ComboBox to define motor multiplexing. This is used to change the order of the output motors.
https://devel.hds.utc.fr/software/flair/export/111/flair-dev/tags/latest/doc/Flair/classflair_1_1filter_1_1_uav_multiplex.html
CC-MAIN-2021-49
refinedweb
214
64.67
#include <mmsthread.h> This class includes the base functionality available for all threads within MMS/DISKO. This class cannot be constructed. Only classes which are derived from this class can be constructed. Definition at line 47 of file mmsthread.h. Constructor. Definition at line 59 of file mmsthread.cpp. Destructor. Definition at line 79 of file mmsthread.cpp. static helper routine to call this->run() Definition at line 83 of file mmsthread.cpp. the code of this method runs in the new thread and calls the virtual threadMain() Definition at line 89 of file mmsthread.cpp. Virtual main method for the thread. This virtual method is empty and have to be setup with code by a derived class. The MMSThread class is only the base class and cannot be constructed. Implemented in MMSEventThread, MMSImportScheduler, MMSSwitcherThread, MMSFlashThread, MMSFBWindowManagerThread, MMSGIFLoader, MMSImageWidgetThread, MMSInputWidgetThread, MMSLabelWidgetThread, MMSWindowAction, MMSInputLISThread, MMSInputThread, MMSProcessMonitor, MMSPulser, MMSTCPServer, MMSTCPServerThread, MMSThreadServer, and MMSTimer. Create and start a new thread. If the method returns true, it is possible, that the new thread is already finished. Reimplemented in MMSFlashThread, and MMSThreadServer. Definition at line 115 of file mmsthread.cpp. Check if the thread is running. Reimplemented in MMSPulser. Definition at line 160 of file mmsthread.cpp. Mark the thread as detached. Definition at line 167 of file mmsthread.cpp. Cancel execution of a thread. Definition at line 173 of file mmsthread.cpp. The caller of this method will wait of the termination of the thread. Definition at line 202 of file mmsthread.cpp. Set the size of the stack for the new thread. The stack size determines the minimum size (in bytes) that will be allocated. The stack size must be changed before the start() method will be called. Definition at line 208 of file mmsthread.cpp. helper mutex to perform a safe start Reimplemented in MMSPulser. Definition at line 51 of file mmsthread.h. starting thread is in progress Definition at line 54 of file mmsthread.h. thread is running Definition at line 57 of file mmsthread.h. if thread is detached, its resources are automatically released when it terminates Definition at line 60 of file mmsthread.h. thread attributes Definition at line 64 of file mmsthread.h. scheduling parameter Definition at line 67 of file mmsthread.h. id of the thread, valid for the running state Reimplemented in MMSWindowAction. Definition at line 70 of file mmsthread.h. requested priority of the thread Definition at line 74 of file mmsthread.h. should thread automatically detached? Definition at line 77 of file mmsthread.h. requested stack size Definition at line 80 of file mmsthread.h. identification string Definition at line 91 of file mmsthread.h.
http://www.diskohq.com/developers/documentation/api-reference/classMMSThread.html
CC-MAIN-2015-48
refinedweb
441
53.17
randfunction returns a "random" positive integer from 0 to a large value (at least 32,767) every time it is called. To scale the value into the range you want, use the mod (%) operator and addition. For example to generate a random number in the range 1 to 10 and assign it to r: #include <ctime> // For time() #include <cstdlib> // For srand() and rand() . . . srand(time(0)); // Initialize random number generator. . . . r = (rand() % 10) + 1; The sequence of numbers returned by rand() are called random because they satisfy statistical tests for randomness, eg, uniform distribution, coorelation between sequential numbers is zero, no apparent patterns). But of course they really can't be truly random (whatever that means) because computers are deterministic. Therefore they are more properly called pseudorandom numbers. For a given seed (starting value), the sequence of numbers that rand() returns will always be the same. Because the starting point for the pseudorandom sequence can easily be varied (see below) and because the sequence is very long (perhaps billions before the sequence repeats), these pseudorandom numbers are as good as random. Having the same sequence generated each time can be useful for debugging, but it isn't very useful when you're actually using the program. To generate a different random sequence, it's necessary to set the seed that starts the sequence. The srand() function takes a positive integer parameter which tells where to start the sequence. srand(2345);The above call sets the initial seed to 2345. However, this still isn't very useful. If you want to have what appears to be a truly random sequence each time you run the program, you need to start with a different seed each time. srand(time(0)) time()function as follows: srand(time(0)); // Initialize random number generator.at the beginning of the program to initialize the random seed. time(0)returns the integer number of seconds from the system clock. This will almost always be a different value. #include <ctime> // For time() #include <cstdlib> // For srand() and rand()
http://www.fredosaurus.com/notes-cpp/misc/random.html
CC-MAIN-2021-49
refinedweb
341
55.03
Anthony Tarlano wrote: > I was wondering if anyone has successfully created a WebService in > IronPython and deployed it using ASP.NET? > > If not I will make it a point to post my results after accomplishing > the task.. ;-) I haven't done it, but I'd love to see your results. I think that you're going to need to think out of the box to get this to work well. > One piece of information I need in order to begin is how I set the > namespace for a package? I.e. in C# you can say namespace > NicelyNamedSpace {... }, how do you do this with IronPython? You can't really do this in IronPython without a static compiler. We're planning to provide a static compiler sometime in the future, but it's not available today. I'm also afraid that you're going to run into trouble with the custom attributes that are used a lot for web services. We plan to support these with Python 2.4 decorator syntax, but that's not implemented yet either. Wish I could be more helpful - Jim
https://mail.python.org/pipermail/ironpython-users/2005-May/000594.html
CC-MAIN-2016-44
refinedweb
184
75
I'm not sure if I've been staring at the screen for too long, I'm immensely stupid, or there's something odd going on. I have a n*m array of doubles, Home.data public class ChangeOrdinate { public void rearrange(int index){ double[][] tempdata1 = Home.data; double[][] tempdata2 = Home.data; for(int i = 0; i < Home.data.length; i++){ Home.data[i][index] = tempdata1[i][0]; } for(int i = 0; i < Home.data.length;i++){ Home.data[i][0] = tempdata2[i][index]; } } } System.out.println(tempdata2[I][index]); tempdata2 it appears that the data in tempdata2 is being altered, despite there being no reference to it. Any changes to the reference of Home.data also affect the reference of the two temp arrays. So, those aren't copies, those all point to the same array in memory. As for swapping numbers, the problem is you assign a=b, then try to assign b=a (because the reference is the same). Which ends up a noop of b=b You can use one loop to swap, as well for(int i = 0; i < Home.data.length; i++){ int tmp = Home.data[i][index]; Home.data[i][index] = Home.data[i][0]; Home.data[i][0] = tmp; }
https://codedump.io/share/k3810m5mrmxx/1/how-to-exchange-columns-of-data-in-a-java-array
CC-MAIN-2016-50
refinedweb
207
60.92
06 April 2012 14:56 [Source: ICIS news] WASHINGTON (ICIS)--The ?xml:namespace> The March net jobs growth of 120,000 also marks a decline from the average of 246,000 new jobs added in each of the previous three months, the department noted. The The narrow decline in the unemployment rate, from February’s 8.3% jobless rate to 8.2% in March, is attributed not to last month’s mediocre employment gain but rather to a reduction in the overall size of the US workforce as some people give up looking for work and drop out of the measured labour pool. In its monthly report, the department said the March job gains were chiefly in the manufacturing sector, food services and health care. There were employment losses in retail
http://www.icis.com/Articles/2012/04/06/9548397/US-adds-120000-jobs-in-March-below-expectations.html
CC-MAIN-2015-11
refinedweb
131
70.73
0 I'm new to Python and am trying to figure out how to streamline the code at bottom to get it more simple but am having trouble. I was hoping that someone here could help me out? The program I am trying to create simply asks the terminal operator for five different celsius temperatures, processes them into fahrenheit values and outputs them to the screen. The results should look something like this: This is a program that converts celsius to Fahrenheit Enter 5 Celsius temperatures seperated by a comma: 1,2,3,4,5 ------------------------------------------------------------ 1 degrees Celsius is 33.8 degrees Fahrenheit. 2 degrees Celsius is 35.6 degrees Fahrenheit. 3 degrees Celsius is 37.4 degrees Fahrenheit. 4 degrees Celsius is 39.2 degrees Fahrenheit. 5 degrees Celsius is 41.0 degrees Fahrenheit. Here is my code now, it works but as you can see it is bulky and repetative. Theres got to be a simple way to streamline it: def main(): print "\nThis is a program that converts five celsius values to Fahrenheit" ctemp1, ctemp2, ctemp3, ctemp4, ctemp5 = input("\nEnter 5 Celsius temperatures seperated by a comma: ") ftemp1 = 9.0 / 5.0 * ctemp1 + 32 ftemp2 = 9.0 / 5.0 * ctemp2 + 32 ftemp3 = 9.0 / 5.0 * ctemp3 + 32 ftemp4 = 9.0 / 5.0 * ctemp4 + 32 ftemp5 = 9.0 / 5.0 * ctemp5 + 32 print "------------------------------------------------------------" print ctemp1, "degrees Celsius is", ftemp1, "degrees Fahrenheit." print ctemp2, "degrees Celsius is", ftemp2, "degrees Fahrenheit." print ctemp3, "degrees Celsius is", ftemp3, "degrees Fahrenheit." print ctemp4, "degrees Celsius is", ftemp4, "degrees Fahrenheit." print ctemp5, "degrees Celsius is", ftemp5, "degrees Fahrenheit." main() Help? 8) Thanks
https://www.daniweb.com/programming/software-development/threads/105808/python-beginner-need-help-with-celsius-converter
CC-MAIN-2018-43
refinedweb
270
69.38
import csv import matplotlib.pyplot as plt with open(r"C:\Demo.csv") as csvfile: rows = list(csv.reader(csvfile)) data_header = rows[0] data_rows = rows[1:] plt.ylabel("Points") plt.xlabel("Weeks") plt.xticks(range(0,5)) plt.yticks(range(1,21)) plt.title('Demo chart') plt.show() plt.xticks(range(0: the [0] in this statement is "Category", and not the list of header row strings. Open in new window Experts Exchange Solution brought to you by Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.Start your 7-day free trial
https://www.experts-exchange.com/questions/29113083/Python-creating-a-histogram-based-on-a-csv-file-content.html
CC-MAIN-2018-43
refinedweb
108
63.56
Following a question in the matplotlib mailing list, I dug inside the code of readshapefile, in order to gain power : The goal: The data: saved inside a new “borders/” folder ! The idea: Opening a GADM shapefile, get region names, and plot filled regions with random color ! The process: Copy and extend the readshapefile method from basemap, using the full power of shapelib. From this example, you could easily check for region names, and plot specific colours for them and not randomly like I do ! The code is after this break: # # BaseMap example by geophysique.be # tutorial 07 = -20. x2 = 40. y1 = 32. y2 = 64. shapelib import ShapeFile import dbflib from matplotlib.collections import LineCollection from matplotlib import cm shp = ShapeFile(r"borders\ita_adm1") dbf = dbflib.open(r"borders\ita_adm1") for npoly in range(shp.info()[0]): shpsegs = [] shpinfo = [] shp_object = shp.read_object(npoly) verts = shp_object.vertices() rings = len(verts) for ring in range(rings): lons, lats = zip(*verts[ring]) if max(lons) > 721. or min(lons) < -721. or max(lats) > 91. or min(lats) < -91: raise ValueError,msg x, y = m(lons, lats) shpsegs.append(zip(x,y)) if ring == 0: shapedict = dbf.read_record(npoly) name = shapedict["NAME_1"] # add information about ring number to dictionary. shapedict['RINGNUM'] = ring+1 shapedict['SHAPENUM'] = npoly+1 shpinfo.append(shapedict) print name lines = LineCollection(shpsegs,antialiaseds=(1,)) lines.set_facecolors(cm.jet(np.random.rand(1))) lines.set_edgecolors('k') lines.set_linewidth(0.3) ax.add_collection(lines) plt.savefig('tutorial07.png',dpi=300) plt.show() 18 thoughts on “Matplotlib Basemap tutorial 07: Shapefiles unleached” I really like this – thanks. I’m playing around with this and would like to include a colorbar as well but I keep getting errors. Not sure what I should be doing in this case. Hi Gavin, Indeed, it’s not that easy to add a colorbar on this… For a side project, I had a dict with zip_codes and values (let’s say population). Then, line 63 becomes “lines.set_facecolors(cm.jet(pop/max_pop))”. To add a colorbar, I think you’ll need to plot a scatter of the ‘lon, lat, c=pop’ somewhere (with alpha=0 maybe) before calling colorbar … There must be a better way ! Ah, so it is as complicated as I’m experiencing. I’m also trying to get this to do a “live” plot on a Django server. Any ideas on where I should put the shapefiles to ensure they load properly? Incidentally, given all the difficulties of differing country-name spellings, I found a shapefile with country ISO codes which makes things easier. I would suggest inputting the absolute path of your shapefiles in the method, (/home/gavin/my_shape_files/ .e.g.), so any place should work fine. Thanks for the hint on the ISO shapefile ! Keep me updated of your progress ! Will do… thanks…. Apologies, actually solved this a week ago. It is relatively straightforward. Create a subplot, then create a standalone colorbar using the same colormap. Pass the upper and lower bound from your data to the bar and … # [left, bottom, width, height] ax2 = fig.add_axes([0.9,0.1,0.014,0.8]) cmap = cm.hot # where bot is the lower bound and top is the upper bound from the original plot norm = mpl.colors.Normalize(vmin=bot, vmax=top) cb = mpl.colorbar.ColorbarBase(ax2, cmap=cmap, norm=norm, orientation=’vertical’) # Set the font size for the axis labels for t in cb.ax.get_yticklabels(): t.set_fontsize(8) bbox_props = dict(boxstyle=”round”, fc=”w”, ec=”0.5″, alpha=0.8) ax.text(0.5, 0, leader, ha=”center”, va=”center”, size=8,bbox=bbox_props,transform=ax.transAxes) Your tutorials have been very helpful. Thank you. I have a question concerning shapefile areas. How would you put the name of the area inside the defined area? Using your above code, how would you put ‘name’ inside the area it references? Hey ! Thanks for the comment ! taking the mean coordinates from shpsegs and then calling plt.text(x,y,name) should work. It might not be easy to handle overlapping texts… Hi Thomas! Thanks for your helpful tutorials. What about plotting with plt.pcolormesh extended from scatter plot or other method? Sorry for repeatingly asking this question, I sent you through email couple of weeks ago. “Opening a GADM shapefile, get region names, and plot filled regions with plt.pcolormesh !” Thanks! — luq good, but the library used to read shapefiles is a little outdated… Since then, Frank Warmerdam develop GDAL/OGR with Python bindings () and Joel Lawhead propose a pure Python librarie ( and) . See also, in french, and) with shapefile of Joel Lawhead, for example : import shapefile r = shapefile.Reader(r”borders\ita_adm1″) shapes = r.shapes() for npoly in range(len(shapes)): long,lats = zip(*[shapes[npoly].points[i] for i in range(len(shapes[npoly].points)) ]) …. Hi! I’m actually trying to do it with Joel Lawhead’s shapefile – shapelib isn’t going to work after all .. Can you help me out, exept for that code from martin? What I got, is mainly: fig = plt.figure(figsize=(15,7)) plt.subplots_adjust(left=0.05,right=0.95,top=0.90,bottom=0.05,wspace=0.15,hspace=0.05) ax = plt.subplot(111) x1 = -180. x2 = 180. y1 = -70. y2 = 80. m = Basemap(resolution=’h’) shpath = ‘TM_WORLD_BORDERS/TM_WORLD_BORDERS’ r = shapefile.Reader(shpath) shapes = r.shapes() for npoly in range(len(shapes)): longs,lats = zip(*[shapes[npoly].points[i] for i in range(len(shapes[npoly].points)) ]) .. how shall I go on? best, hannes. Hi all, I receive the following error message after running the program without any modification. Any clues? Traceback (most recent call last): File “italian_borders.py”, line 38, in shp = ShapeFile(r”borders\ita_adm1″) File “/usr/local/lib/python2.7/dist-packages/shapelib.py”, line 44, in __init__ self.this = apply(shapelibc.new_ShapeFile,args) IOError: new_ShapeFile failed Exception AttributeError: “ShapeFile instance has no attribute ‘thisown'” in ignored thanks, fabio Hi Fabio, I saw that error when I had the wrong path for ita_adm1.shp. I corrected that and the script ran fine. Cheers, Charles I was going through basemap. I tried plotting a random example map using the following code. def main(): ax = plt.subplot(111) map = Basemap(projection='merc',lon_0=0, resolution='l') map.drawcoastlines() map.drawmapboundary(fill_color='aqua') map.fillcontinents(color='coral',lake_color='aqua') date = datetime.utcnow() CS=map.nightshade(date) #plt.title('Day/Night Map for %s (UTC)' % date.strftime("%d %b %Y %H:%M:%S")) plt.savefig("3.png") I get a weird image like this. Please let know if it were possible to fix this. I need better quality image with at least 800×600. If thats not possible without loss of resolution, I will switch to something else. Thanks. Dear Jim, I’d say you have to set the “resolution=h” (=high) when instanciating the Basemap. Then, as nightshades seem undefined for the southernmost part of the globe, set a ylim to (-70,70) or something like that ? Note you can also start by defining the size of the figure : plt.figure(figsize=(11.6,8.3)) = A4 and saving using dpi=300 to increase the quality of the plot (you’ll have a 300 DPI A4-sized plot). Cheers, Thomas
https://www.geophysique.be/2011/01/27/matplotlib-basemap-tutorial-07-shapefiles-unleached/
CC-MAIN-2020-50
refinedweb
1,204
61.02
I have always commented this test out in my working copy. I do not like tests that actually (also) test the exact innards of certain Xerces and Xalan versions. I have got several copies of those two on my system, and I use them via the endorsed-dirs mechanism. Some scripts use a different copy than others, and for me FOP should just work with any recent parser and transformer. IMHO An upgrade of the jars in FOP does not solve the problem of this test file. Regards, Simon On Sun, Aug 07, 2005 at 06:46:17PM +0200, Jeremias Maerki wrote: > There were a number of these issues in the past. Yes, it's definitely > time to upgrade the Xerces and Xalan JARs, although it won't fix the > problems for those people who don't know how to replace the default > Xerces/Crimson and Xalan versions coming with the JDK. But that can't be > helped. As a rule, I always use the latest Xerces and Xalan versions on > my machine. I even have a customized Xalan ATM since the Xalan people > haven't fixed a bug which causes a problem with Barcode4J and FOP for > over a year now. > > On 07.08.2005 14:21:55 Manuel Mall wrote: > > On Sat, 6 Aug 2005 10:37 pm, you wrote: > > > I am consistently getting the error below on the ant junit target. > > > > <snip/> > > > > Further investigation showed that I can get rid of the error by > > upgrading the xerces/xalan combination. Here is a summary of what I > > found: > > > > xalan 2.4.1/xerces 2.2.1 as extracted from SVN doesn't work > > xalan 2.5.x/xerces 2.?.? doesn't work > > xalan 2.6.1/xerces from xalan 2.6.1 bundle does prevent the error below > > but I then get similar NAMESPACE_ERR errors from within the layout > > engine test suite > > xalan 2.7.0/xerces from xalan 2.7.0 bundle does work > > > > All this evaluated under RH Enterprise ES 3 with Sun Java 5.0 latest > > release. > > > > Time to upgrade the xalan/xerces jars in SVN? > > > > Manuel > > > > > There was 1 error: > > > 1) > > > testFO2PDFWithDOM(org.apache.fop.BasicDriverTestCase)javax.xml.transf > > >orm.TransformerException: org.w3c.dom.DOMException: NAMESPACE_ERR: An > > > attempt is made to create or change an object in a way which is > > > incorrect with regard to namespaces. > > > at > > > org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf > > >ormerIdentityImpl.java:511) at > > > org.apache.fop.BasicDriverTestCase.loadDocument(BasicDriverTestCase.j > > >ava:62) at > > > org.apache.fop.BasicDriverTestCase.testFO2PDFWithDOM(BasicDriverTestC > > >ase.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native > > > Method) > > > > Jeremias Maerki > -- Simon Pepping home page:
https://www.mail-archive.com/fop-dev@xmlgraphics.apache.org/msg01216.html
CC-MAIN-2018-43
refinedweb
436
66.33
Created on 2011-02-03.04:25:49 by JohnL, last changed 2011-02-07.23:54:27 by pjenvey. The doctest doc locate here: shows example code such as: if __name__ == "__main__": import doctest doctest.testmod() This code fails with error message: TypeError: testmod() takes at least 1 argument (0 given) My guess is that the correct code would read: import doctest, thismodule doctest.testmod(thismodule) provided, of course, that the example had been saved in the file thismodule.py I can't reproduce this. I'd suggest printing doctest.__file__ to ensure that it's being imported from where you think it is. The doctest module that ships with jython doesn't require 1 argument
http://bugs.jython.org/issue1703
CC-MAIN-2017-30
refinedweb
117
69.99
Keyboard shortcut for next/previous incremental search result? Hi, I find incremental search very useful and I almost always use it instead of the normal ‘Find’. However, I have a habit of doing an incremental search for certain text, then closing the incremental search bar, doing some writing, and then pressing F3/Shift-F3 (Next/Previous search result), expecting to go to the next/previous result based on what I entered in the incremental search bar; however, this actually just goes to the next/previous result from whatever the last regular ‘Find’ search I did was. Is there any way to use a shortcut that goes to the next/previous result of my incremental search, without having to re-open the window? Re-opening the bar, going to the next result, then closing it back again, adds two extra steps (opening + closing the bar) which it would be nice to eliminate… Thanks :) This has been an open issue since May 2016; see Oddly enough, I remember that issue was there since I added a comment to it earlier today. :-D As a side note, why would you close the incremental-search window, only to have to reopen it? That sounds like two unnecessary steps to me. I always just leave it open; it is not that large that it takes up too much real estate… Ah, thanks, didn’t come across that when I searched. The reason I close it is because it is just a single keystroke, Esc, whereas leaving it open would require me to use the mouse to switch focus back to the file itself – unless there is a keyboard shortcut for swapping focus? I like to do as much as possible with just the keyboard, swapping back and forth between mouse and keyboard is very cumbersome for me. Ah, that makes sense about the Esc key… If you’re willing to set up and use the Pythonscript plugin, I’ve created a solution that will allow assignments of keyboard shortcuts to do the next/previous-incremental-search-result functionality directly from the current editor window. Note that I didn’t do it for YOU…I thought about it after reading your post, and figured doing it would benefit ME! :-D Here’s how to accomplish the goal: - Create TWO new Pythonscripts, one named IncrSearchWindowPressFindNext.pyand one named IncrSearchWindowPressFindPrev.py - Bind these Pythonscripts to TWO new keyboard shortcuts via the shortcut mapper (I use Shift+Ctrl+.for the “next” script and Shift+Ctrl+,for the “prev” script–these keystrokes are self-reminding as they are a variant of the <and >keys, the same as the text on the buttons in the Incremental Search window) The TWO scripts should have the SAME contents and those contents are: import ctypes from ctypes.wintypes import BOOL, HWND, LPARAM from inspect import currentframe, getframeinfo try: ISWPFNOP__incr_search_hwnd except NameError: ISWPFNOP__incr_search_hwnd = None def ISWPFNOP__main(): # (I)ncremental(S)earch(W)indow(P)ress(F)ind(N)ext(O)r(P)revious user32 = ctypes.windll.user32 SendMessage = user32.SendMessageW FindWindow = user32.FindWindowW FindWindowEx = user32.FindWindowExW GetWindowText = user32.GetWindowTextW GetWindowTextLength = user32.GetWindowTextLengthW EnumChildWindows = user32.EnumChildWindows GetParent = user32.GetParent GetClassName = user32.GetClassNameW WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND,LPARAM) create_ub256 = ctypes.create_unicode_buffer(256) BM_CLICK = 0x00F5 if ISWPFNOP__incr_search_hwnd == None: # the goal with this section is to locate the Incremental Search window # this is technically overkill but it DOES define the Incremental Search window: incr_search_classname_and_text_seq_list = [ u'#32770', u'', u'Button', u'X', u'Static', u'Find :', u'Edit', None, # 'None' here means the text of control is variable u'Button', u'<', u'Button', u'>', u'Button', u'&Highlight all', u'Button', u'Match &case', u'Static', None, # 'None' here means the text of control is variable ] ISWPFNOP__main.seq_list_index = 0 def child_window_enumeration_function(hwnd, _): class_name = create_ub256[:GetClassName(hwnd, create_ub256, 256)] if (ISWPFNOP__main.seq_list_index % 2) == 0 and \ class_name == incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index]: ISWPFNOP__main.seq_list_index += 1 advance_seq_index = False if (ISWPFNOP__main.seq_list_index % 2) == 1: text_length = GetWindowTextLength(hwnd) if text_length == 0: if incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == u'' or \ incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == None: advance_seq_index = True else: buff = ctypes.create_unicode_buffer(text_length + 1) GetWindowText(hwnd, buff, text_length + 1) if incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == buff.value or \ incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == None: advance_seq_index = True if advance_seq_index: ISWPFNOP__main.seq_list_index += 1 else: ISWPFNOP__main.seq_list_index = 0 continue_with_the_enumeration = True if ISWPFNOP__main.seq_list_index == len(incr_search_classname_and_text_seq_list): # we surely found the Incremental-Search window! (it is the parent of the current child) global ISWPFNOP__incr_search_hwnd; ISWPFNOP__incr_search_hwnd = GetParent(hwnd) continue_with_the_enumeration = False return continue_with_the_enumeration EnumChildWindows(FindWindow(u'Notepad++', None), WNDENUMPROC(child_window_enumeration_function), 0) if ISWPFNOP__incr_search_hwnd != None: # save current view and doc index (and do it so that restoring later works well if a doc is cloned) saved_view = notepad.getCurrentView() saved_document_index = notepad.getCurrentDocIndex(saved_view) # find out which python file we are so we can determine which button to press: currently_running_pythonscript = getframeinfo(currentframe()).filename caption_of_button_to_press = '>' if 'FindNext' in currently_running_pythonscript else '<' # FINALLY, press the desired button: next_or_prev_button_hwnd = FindWindowEx(ISWPFNOP__incr_search_hwnd, 0, u'Button', caption_of_button_to_press) SendMessage(next_or_prev_button_hwnd, BM_CLICK, 0, 0) # return input focus to editor tab (focus was with incr search window): notepad.activateIndex(saved_view, saved_document_index) ISWPFNOP__main() If this (or ANY posting on the Notepad++ Community site) is useful, don’t reply with a “thanks”, simply up-vote ( click the ^in the ^ 0 varea on the right ). I was happy to find this thread because this is precisely what I need: shortcuts for find next (and previous) in incremental search. However, I failed implementing Scott’s suggestion. I created the two identical Phyton scripts with different names and saved them in the Notepad++ program folder under Notepad++/keyboard_shortcuts. (Or need I to place them at a different place?) Then I opened “Settings” --> “Shortcut mapper” in Notepad++, but I was not able to find any option to add, run or link the scripts I had created. What do I miss? - Claudia Frank last edited by python scripts which need to interact with notepad++ do require python script plugin. Available for 32bit version only. Once installed you need to create a new script by using the python script plugin menu, copy the code into it, save it. Goto python script plugin configuration menu and put the newly created script to the menu items. Close. Now you can assign a shortcut, Cheers Claudia @Stefan-Boeters said: what I need: shortcuts for find next (and previous) in incremental search If I interpret you literally then I think you mean you need keyboard shortcuts for these functions without leaving the incremental search window. The script above works only when the input focus is on a document tab window. Of course it could be changed to work when the input focus is in other places… But maybe that isn’t what you mean at all…hard to tell. :-) OK, I see. I’ve now: (1) Installed the Python Script plugin, (2) Copied the Python scripts in the /plugins/PhytonScript/scripts folder (3) Added the scripts in Plugins --> Phyton Script --> Configuration to the menu items (4) Assigned shortcuts in Settings --> Shortcut Mapper --> Plugin Commands It works – but only partly. This is what happens: - When I open a file, open the incremental search window, search (ordinarily) for a text en then use the shortcuts for “FindNext” and “FindPrev”, nothing happens. - If I invoke the scripts via Plugins --> Python Scripts (rather than via shortcuts), one of them (“FindPrev”) does work, the other (“FindNext”) doesn’t. - If I use the shortcuts after the first call (via Plugins --> Python Scripts), “FindPrev” continues to work, but “FindNext” doesn’t. This has nothing to do with the specific shortcuts I use. I have changed both shortcuts for testing, and the result was the same. Is there anyone who has tried this as well? Is this an idiosyncrasy of my configuration or a general problem with Scott’s script? This is a subtlety I hadn’t paid attention to before. Now that I think about it, the following seems the “minimum keystrokes” solution to me: - You are in the document window in which you want to perform the search. - You type (Ctrl+Alt+I) for opening the Incremental Search window (which you need anyway to type the text you are searching for). - The first hit does not satisfy you, so you want the next one. This is while you are still in Incremental Search window, indeed. Do you happen to have time for modification of the script along this line? I have no experience with Python whatever, nor with coding this type of scripts anyway, so I’m afraid that modifying it myself is not an option. @Stefan-Boeters said: Is there anyone who has tried this as well? I just tried the following series of steps: - grab N++ 7.5.1 portable install; unzip it - add Plugin Manager (ugh! and double-ugh!) by manual copying from my normal N++ install that I use normally - run virgin 7.5.1 (with Plugin Mgr addition) - install PS 1.0.8 via Plugin Mgr - change PS config to be AT STARTUP instead of LAZY - add the 2 scripts by copying text out of the code window from above in this thread, naming the files the same as indicated above - in PS Configuration, add the 2 scripts so that they can be found by Shortcut Mapper - in Shortcut Mapper, bind the “next” script to Ctrl+Shift+. (period) - in Shortcut Mapper, bind the “prev” script to Ctrl+Shift+, (comma) - invoke Incremental Search by pressing Ctrl+Alt+i - put some text in the Find: box and press Enter - press Esc (input focus is now back in doc I’m editing) - press Ctrl+Shift+, and verify selection changes to previous occurrence of my Find: text – IT DID! - press Ctrl+Shift+. and verify selection changes to next occurrence of my Find: text – IT DID! @Stefan-Boeters said: The first hit does not satisfy you, so you want the next one. This is while you are still in Incremental Search window In this situation, just hit the Enter key. It will move the selection the the next match in the editor tab without leaving the Incremental Search pane. OR Press Esc (which closes the Incremental Search pane) and returns input focus to the document tab you were on when you invoked the Incremental Search, leaving you ready to press: - Ctrl+Shift+. (my shortcut, YSMV) to move the selection to the next match - Ctrl+Shift+, (my shortcut, YSMV) to move the selection to the previous match [YSMV = Your Shortcut May Vary] Note: You can’t run a PS from an assigned shortcut when the Incr Seach pane has input focus. Strangely enough, “FindPrev” works perfect in this way, whereas “FindNext” doesn’t. I’ve adjusted the following line in the script of “FindNext”: caption_of_button_to_press = '>' if 'FindNext' in currently_running_pythonscript else '<' to become caption_of_button_to_press = '>' (Actually you don’t need any experience with Python to do this). Now it works. This suggests that I had somehow misspelled the file name, but as far as I can see, I hadn’t. Anyway, with this (admittedly ugly) fix it does work for me. Thanks a lot. Even after this cumbersome start, the investment will pay off in the long run. Yea…that was just my little technique to not have 2 files that differed only by one little thing–even having 2 identical files is not the best idea… It would be nice if you could pass arguments to pythonscripts or somehow know which keycombo invoked them, but this is not currently possible. [Actually both things are possible but not easy so I’ll just leave it there.] :-) Hello @andrew, @stefan-boeters,@scott-sumner and All, I simply asked myself the question : How to have the editor window and the incremental search window present, at the same time and switch from one to the other, with a keyboard shortcut ? I found out a weird way to do it but, at least, it seems to work ! I supposed that you previously got the incremental search windows, hitting the Alt + Ctrl + Ishorctut, once : Now : To move from the incremental search window to the main editor window, just hit the Win Logo key, twice: a first hit on the Win logo key, to get the Start menu a second hit, on the Win logo key, to close the Start menu As a result, the focus should be on the current editor window, with the cursor at its present location :-)) - To move from the main editor window to the incremental search window, simply hit, again, the Alt + Ctrl + Ishorctut And so on… This method works nice on my [ old ] Wind XP laptop ! Just verify that it’s the same, on newer Windows OS ?! Best Regards, guy038 P.S. : ONCE the focus is on the incremental search window : Press the Tabkey, to cycle through the six zones ( Find zone, < and > buttons, Highlight all and Match case options , button X ) Press the Shift + Tabshortcut, to cycle, in reverse order To set/unset the Highlight all or Match case options, you may, either : From any location, hit the Alt + Hor Alt + Cshortcuts From the exact location, just hit the Space key When a direction is chosen ( <or >), just press the Enterkey, to go on searching, in the same direction And, of course, hitting the Escapekey, close the incremental search window ! just hit the Win Logo key, twice Works for me on Windows 7 Enterprise SP1 64-bit, running Notepad++ 32-bit! The double hit of the Windows logo key also more efficiently (less keystrokes) solves the problem from this thread:, although I’ll only use this new way interactively (and will keep the existing SendKeys-based solution in my startup.py). I like it! :-D The double-Windows-key works because when Notepad++ becomes the active application (second Windows logo keypress), focus is moved back to the current document tab if it was not there when N++ ceased being the active app. This seems to always be the case… So another easy(?) keyboard option is to hold Alt+Tab and at the same time tap Esc! :-D Hi @scott-sumner and All, I did some tests and it happens that the double hit on the Windows logo key allows to put the focus back on the main editor windows, again, if a window can be anchored to the main editor windows, at its right, left, top or bottom side So, it concerns, from native N++, the Character Panel, Clipboard History, Search Results, Project, Folder as Workspace and the Function List windows, as well as most of plugin’s windows as, for instance, the Python or Lua console window ! However, just note that if any of these “dockable” panels is not docked and is, simply, floating like a separate windows, the double hit on the Windows logo key does not allow, anymore, to have the focus back, on the main editor windows ! Strangely, it does not work too, with the Document Map panel, which, however, can be anchored ! Cheers, guy038
https://community.notepad-plus-plus.org/topic/14271/keyboard-shortcut-for-next-previous-incremental-search-result
CC-MAIN-2020-34
refinedweb
2,465
59.13
Hello, My Electron goes into a Listening Mode some seconds after “Breathing White”. The device is not claimed, without SIM (never inserted the SIM). No battery or antenna connected. system firmware version: 0.6.2 CLI: particle --version gives 1.25.0 There is no difference if the user code running is mine (see below) or the Tinker. Odd thing is - it worked well for some days. I have been developing and testing my software successfully using the device. The code I am flashing is: #include "application.h" SYSTEM_MODE(SEMI_AUTOMATIC); //SYSTEM_MODE(MANUAL); void setup() { Cellular.off(); Serial.begin( 9600); Serial.print( "Setting up the device ..."); Serial.println( "OK"); } void loop() { Serial.println("Test"); delay( 100); } Not only there is nothing on the terminal, but as I mentioned - the device drops into a Listening Mode. I am aware about the tons of topics with the similar subject - tried all of them that seemed relevant. My question is - what else can I try before deciding that “mode” button is broken and replacing it. Thanks in advance!
https://community.particle.io/t/electron-jumps-to-listening-mode-frequent-blue-led-blinking/37422
CC-MAIN-2018-51
refinedweb
174
61.83
Home » Support » Index of All Documentation » How-Tos » How-Tos for GUI Development » Wing IDE is an integrated development environment that can be used to speed up the process of writing and debugging Python code that is written for matplotlib, a powerful 2D plotting library. Wing provides auto-completion, call tips, a powerful debugger, and many other features that help you write, navigate, and understand Python code. For more information on Wing IDE see the product overview. If you do not already have Wing IDE installed, download a free trial now. Note: This document contains only matplotlib specific tips; please refer to the tutorial in the Help menu in Wing and/or the Wing IDE Quickstart Guide. Working in the Python Shell Users of matplotlib often work interactively in the Python command line shell. For example, two plots could be shown in succession as follows: from pylab import plot,show,close x = range(10) plot(x) show() y = [2, 8, 3, 9, 4] plot(y) close() In some environments, the show() call above will block until the plot window is closed. By default Wing IDE, and often will happen if you evaluate code from a source file in the Python Shell). This allows for easier interactive testing of new code and plots., WXAgg (for wxPython 2.5+), Qt4Agg, and MacOS, you can set a breakpoint on show() in the code and then work in the Debug Probe. Wing adds an item Evaluate Selection in Debug Probe to the editor context menu (right click) when the debugger is active. Trouble-shooting If show() blocks when typed in the Python Shell or Debug Probe, if plots fail to update, or if you run into other event loop problems working with matplotlib you can: (1) Try the following as a way to switch to another backend before issuing any other commands: import matplotlib matplotlib.use('TkAgg') (2) Try disabling the matplotlib support entirely in Project Properties under the Extensions tab and then restart the Python Shell from its Options menu and restart your debug process, if any. However, this prevents interactive use of matplotlib in the Python Shell and Debug Probe. Please email support@wingware.com if you cannot resolve problems without disabling Wing's matplotlib support. Related Documents Wing IDE provides many other options and tools. For more information: - Wing IDE Reference Manual, which describes Wing IDE in detail. - The matplotlib home page, which provides links to documentation. - Wing IDE Quickstart Guide which contains additional basic information about getting started with Wing IDE.
http://www.wingware.com/doc/howtos/matplotlib
CC-MAIN-2015-18
refinedweb
421
60.35
User talk:Sannse From Uncyclopedia, the content-free encyclopedia edit While) edit Help) edit) edit I apologise ...for vandalising your signature. Also, hi. -— Lyrithya ༆ 05:02, November 15, 2012 (UTC) edit nefarious microscope.) edit Extra! Extra! News that's not new to you! The Newspaper That Replaces Analysis With Flashy Graphics!:07 (UTC) edit That content warning thing What about this? If not this, then how about barking dogs? Or room temperature egg salad? Sir Modusoperandi Boinc! 18:10, November 20, 2012 (UTC) - All of them are a problem :( Having a warning just for specific pages would mean the current extension would need recoding. I'm not sure if/when that could happen. I'm also not sure how it would work to minimize views. The current version is only supposed to show once per visit (or less, I'm not sure), maybe that could still work with individual pages... - Anyway, I'll pass it on (the idea, not the barking egg salad) and see what comes back -- sannse (talk) 18:59, November 21, 2012 (UTC) - If someone comes here and searches for things that make the squares and prudes freak out, they get to see this: - ...generally (and that's after the one-time click through warning warning that's got the kids here in a tizzy), but if they go to Wikipedia and, say, search for "vagina"... - Discuss. Sir Modusoperandi Boinc! 19:36, November 21, 2012 (UTC) - Wikia is not Wikipedia -- sannse (talk) 19:17, November 27, 2012 (UTC) - That explains why Wikia put the kibosh on my wiki! Sir Modusoperandi Boinc! 20:02, November 27, 2012 (UTC) - We did what where? -- sannse (talk) 19:42, November 28, 2012 (UTC) - Hoohoowiki. And I don't think Dickywiki's gonna pass, either. Harrumph! Sir Modusoperandi Boinc! 20:34, November 28, 2012 (UTC) - Well that really depends whether it's a comprehensive and accurate project to record all famous people named Richard, or a wiki on the political ambitions and policies of the Democratic Indira Congress (Karunakaran), or a directory of Private detectives in the Lower Manhattan area..... or.... something else -- sannse (talk) 21:56, November 28, 2012 (UTC) - Are you trying to be funny? We don't much tolerate humour around here. Comedy is serious business. We don't much tolerate serious business around here either. Kind of a catch 22, really. Sir Modusoperandi Boinc! 06:20, November 29, 2012 (UTC) - Wait... I thought we didn't tolerate catch 22s around here? -- sannse (talk) 19:11, November 30, 2012 (UTC) - True, but that's only because we think Catch22 is a boy band. Sir Modusoperandi Boinc! 22:16, November 30, 2012 (UTC) edit The UnSignpost! Cancel Your Subscription Today! The Newspaper That Openly Admits Its Liberal And Conservative Biases! Nov 27, 2012 • Issue 176 • I scream, you scream, we all scream...for painful orgasms edit SANNSE!!!!!!!! I need to have a talk with you on IRC later, if that is doable... --Revolutionary, Anti-Bensonist, and TYATU Boss Uncyclopedian Meganew (Chat) (Care for a peek at my work?) (SUCK IT, FROGGY!) 20:03, December 4, 2012 (UTC) - If I'm there, you can talk to me... and sometimes I even reply!! -- sannse (talk) 23:17, December 6, 2012 (UTC) - Am on IRC right now, so... --Revolutionary, Anti-Bensonist, and TYATU Boss UncyclopedianMeganew (Chat) (Care for a peek at my work?) (SUCK IT, FROGGY!) 23:21, December 6, 2012 (UTC) - Sorry, if you need something you can look for me there, but I don't go on during work hours (usually), and only rarely otherwise. It really is a lot better to use Special:Contact -- sannse (talk) 22:09, December 7, 2012 (UTC) edit Journalism so yellow it's orange: The UnSignpost The Newspaper That Replaces Analysis With Flashy Graphics!:01 (UTC) edit Sloppy, falling-apart, and duct-taped-together: the UnSignpost! The Newspaper That DOESN'T Think It's Better Than You! Dec 12th, 2012 • Issue 178 • Only wild horses can tear me apart. edit Watch your step! It's a steaming-hot pile of UnSignpost The Newspaper Not Secretly Controlled By ME, I Swear! Dec 19th, 2012 • Issue 179 • YOUR JOKE HERE! Contact management for details. edit Drop your pants and grab the eggnog! It's the UnSignpost. Just like Grandma used to make! January 2nd, 2013 • Issue 180 • We always do it Manually! edit Name change, how does that work? I wanted to change my user name officially to just "Aleister" but have procrastinated. What would that do to my edit history, user page, etc. Would it change everything at once, or would I have to copy and paste some stuff? And I tried to create a new account as Aleister, but it says the name is already taken although when I try to log in as Aleister (I may have already done this) it says their is no user by that name. So chains for the moment until this gets cleared up. Aleister 12:58 3-1-'13 - Do you own the account "Aleister" that was used on de.uncyclopedia? If so, and if you can still log into it, I can give you the name here. All your edit history and so on would transfer to the new account, so that's not a problem. - Although Uncyclopedia has a different user database from the rest of Wikia, we still consider a name "taken" if it's registered in either place. It's just so someone can't pretend to be another user by registering the same name on the other database. But if you own the de.uncyc account, I can reconcile them. If not, maybe you can go for another variation? -- sannse (talk) 19:19, January 3, 2013 (UTC) edit Well, it's over. I've got some free time and I always wanted to feel important and be a big-and-buff admin. Can I get that status now that everyone else has left, and I'd be the only one around to manage the site? →A (Fallen Reich)17:48 5 January 2013 - Trying to match those two statements together. Are you sure you don't have Dissociative Identity Disorder? • Puppy's talk page • 03:26 06 Jan - Isn't there a page or something around here for voting in new admins? I'm sure I saw one, somewhere... -- sannse (talk) 05:11, January 6, 2013 (UTC) - Do we have any admins who are staying around? --Mn-z 13:41, January 6, 2013 (UTC) - Yes to that answer Mnbvcx:16, January 6, 2013 (UTC) - I don't know about anyone else, but I'm going to Road Warrior the shit out of this place. It's Mrthejazz... a case not yet solved. 15:08, January 6, 2013 (UTC) - Sannse, I have a short, impulsive temper :) But yeah, since you could make people admins....and honestly like four people are going to be here. So very few people to maintain the entire site. I'd like to be one of the people who flips between sites, and has the ability to maintain our reputation. →A (Fallen Reich)22:55 6 January 2013 - It's great to see you'd like to be a part of the administration of this site, but as Sannse very plainly said, we have a page for voting for new admins. It has something to do with being in a sandwich. If Wikia ever started to just arbitrarily decide to appoint admins - ignoring the will of an active community - then there'd be a shitstorm. If you want to become an admin then suggest at VFS that we need new admins, and then wait ands see if you're nominated, and then wait to see if you're voted into the role. In the meantime, start looking or ways to actually act like an admin - patrol recent changes and put forward pages to be deleted, revert vandalism, welcome n00bs, pee review articles - but the most important part of being an admin - wear a sign on your back that says "kick me". Because being an admin is effectively asking for everyone to start treating you like scum of the Earth, and accepting abuse for being a glorified janitor. - If you want support in your quest to become an admin, I'm happy to metaphorically stick your head in a toilet and flush it repeatedly at any given stage. • Puppy's talk page • 11:37 06 Jan - What Puppy said. Minus the bits about sticking your head in a toilet. I wouldn't do that, even metaphorically. Especially not with all the rumors that you have a short, impulsive temper -- sannse (talk) 00:01, January 7, 2013 (UTC) edit Page Moves and user rights If I am not mistaken, there was a page-move limit for regular users when I left. Was that removed, because it appears that a recent vandal was page move vandalizing rather quickly. --Mn-z 13:53, January 12, 2013 (UTC) - The term for that is "throttling" if I'm not mistaken. --Mn-z 22:07, January 12, 2013 (UTC) - Humm... yeah... looks like we'd need to set a rate limit. I don't see an old one removed, but maybe I'm not looking far enough back. Anyway, we can put one in place. I'm not fully confident in setting it without getting it checked though (I'm pretty good at missing out the bit of the code that means it doesn't blow up half the office) but I'll find someone to help me with it. In the mean time, perhaps a forum to decide exactly what rate you all want? It needs to be high enough to let genuine people do enough moves, but low enough to slow vandals. For example, you could allow 5 moves per minute, or 2 moves per 30 minutes, and so on. You can also set a different rate for newbies (and for IPs, except they can't move pages anyway) --- sannse (talk) 06:47, January 13, 2013 (UTC) - I remember it being 2 moves a minute or some similar rate. A larger move rate over a longer time frame might make more sense. I think it should be removed for rollback and above, since rollbacks can already suppress redirects. --Mn-z 07:06, January 13, 2013 (UTC) - Since there is already a 'cooling period' for new users, perhaps the multiple page moving rights should be made longer. So if we can extend that, it will help the site considerably. The vandalism was done by two users who had made accounts and remained dormant until the triggering their bot (or what ever it:59, January 13, 2013 (UTC) - I think this forum could be combined with the one for VFS as that will decide on admins for this site:10, January 13, 2013 (UTC) - That is kind of a separate issue though. From what I can tell, the page move throttle was removed by accident. Then again, I wasn't active when it was removed. --Mn-z 08:12, January 13, 2013 (UTC) - I'd say it's a separate issue, but it's probably one that the admins should decide in consultation with the community, and that might be best when there's more admins. Maybe for now Romartus and the Chief can just decide on a number that feels about right, and we can see how it goes -- sannse (talk) 22:32, January 14, 2013 (UTC) - Hi Sannse, The Chief agreed with Mnbvcxz here and I can agree with that too for:07, January 14, 2013 (UTC) - There was a suggestion after that for 10 per 10 minutes... shall I set that instead? Let me know on the forum -- sannse (talk) 00:57, January 15, 2013 (UTC) edit Suicide Hi Sannse, following a brief discussion on Romartus' talk page about the counselling phone numbers on articles like HowTo:Commit Suicide I have made an addition to the article, at the bottom under external links. Is that an acceptable change? I felt that it does the appropriate job without being too in your face. Let me know if that's acceptable. --Chiefjustice3DS 13:22, January 15, 2013 (UTC) - I would prefer it being the first thing people see... but this was always a (somewhat personal) request rather than a requirement, so I'll take what I can get ;) Thanks Chief -- sannse (talk) 20:18, January 15, 2013 (UTC) edit Thank you For this and the following edit. Much appreciated. • Puppy's talk page • 10:34 21 Jan edit Signatures with external website links Just a quick question. Is there a policy where someone's sig can link to or advertise their own non-wikia website? See here User_talk:Romartus under the heading 'talk VFS'. Check the sig of User:Madclaw. --:12, January 24, 2013 (UTC) - We consider it spam. We'd ignore it if it were an unrelated personal site, say a personal facebook page. But if it's an advert for a commercial site (tripadvisor or something) or a facebook (or similar) page advertising another site, then it's not OK. And we particularly consider it a problem if it's linking to a wiki that forked from Wikia, or another one of our esteemed competitors. Hope that helps -- sannse (talk) 18:39, January 24, 2013 (UTC) - Well Phooeeyy, this makes me a sad Madclaw, or a Sadclaw if you will. Madclaw talk 18:53, January 24, 2013 (UTC) - Then I shall be a Sannsad that you are a Sadclaw :( -- sannse (talk) 19:02, January 24, 2013 (UTC) - Sannsad sounds like an amazon sumo bodyguard for Syrian dictator Assad, are you sure you wan't to be seen as such? Madclaw talk 19:24, January 24, 2013 (UTC) - Hell yeah, that would mean I'd have to put on weight. Instead of being a stereotypical dieting fatpleasantly plump woman. Show me the pie! -- sannse (talk) 19:51, January 24, 2013 (UTC) - 3.1415927… oh, sorry. My mistake. • Puppy's talk page • 09:49 24 Jan edit This Pie is no lie Sannse asks for Pie, Madclaw provides! Dear Sannse enjoy your Bea Arthur Pie my dear!! Madclaw talk 14:44, January 25, 2013 (UTC) - Wow, that's... scary. Thanks! -- sannse (talk) 21:27, January 25, 2013 (UTC) edit Verification Hey, sannse. It's Sir Peasewhizz from the IRC. This is my message confirming myself.--Sir Peasewhizz de New York (Chat) (Stalk?) 04:08, January 27, 2013 (UTC) edit DMCA Takedown notice Apparently, an old image of File:Hamburger.jpg was removed due to a DMCA takedown notice. However, the image was a hamburger, and has not been used in almost 6 years since a new version was uploaded. I really could not care less that it is deleted, but I'm wondering if that was an error. With all the tenuous fair-use claims on this wiki, I'm surprised someone had an issue with THAT image of all things. On a related note, this does show one advantage of being hosted by a evil large corporation. --Mn-z 14:25, January 29, 2013 (UTC) - Dittos; what happens when the Fork receives its first DMCA notice? do they flip the sender the bird and announce that they are on a crusade against corporatism? If the offending image is not the most recent version, then it should be removed from the history, and any newer, legal version should survive. Or let's just upload something new that is suitable. Spıke Ѧ 14:39 29-Jan-13 - PS--Could other Wikia staff be asked to notify us of such decisions to delete, such as in the Forum Sannse opened for obscene photos? This would let us react more smoothly than simply having photos disappear. Spıke Ѧ 14:42 29-Jan-13 - The image is a non-issue. We have a newer, non-offending image, which replaced the offending in the edit history back in 2007. In other words, the offending image ONLY occurred in the history of another image. This is probably the least important takedown notice in the history of takedown notices. - Regarding notification, the deleting person (or bot?) left a message in the huff log. --Mn-z 14:50, January 29, 2013 (UTC) - So what happens with DMCAs at Wikia: we get a takedown notice, we check it's all legal and correct, then we remove the image (we don't have a choice here, legally speaking). Then there's a chance for you (or the uploader usually, as they should know the source) to send a counter notice. We check if that's all legal and correct, then we replace the image (again, all clearly set out in law). Then it's up to the person complaining and the person uploading to fight it out in a cage, with hammers and hand-held sharksthe courts. There's bits in the official notices that make it more dangerous for the uploader to falsely send in a counter notice than it is for the complainant to send in a fake DMCA. This is because politics. - Anyway, in this case, as Mnbvcxz says, it's a minor one that won't need any sort of counter notice, but it seemed a good time to explain the process. - Semanticdrifter isn't a bot btw, just the guy that deals with most notifications, and so who has a standard summary explaining them. I've checked the takedown notice, and the deleted file, and yep... that's the one they wanted removed. Weird. - As for the fork, I can't comment on that - it depends on how they are hosted and stuff. I know we get (most) notices directly, but I don't know how that works for other sites -- sannse (talk) 18:26, January 29, 2013 (UTC) - Oh, and on the request for us to notify - I'm afraid it's as Mnbvcxz said (he keeps saying stuff) it's in the log, and while I understand the desire for more explicit notification, that'll have to do... I don't want to add extra steps to a process that we really need to be swift so we can move on to other stuff that needs to be done -- sannse (talk) 18:31, January 29, 2013 (UTC) - I'm still giggling over Semanticdrifter being referred to as a bot. • Puppy's talk page • 10:36 29 Jan - I checked the page at FreeUncy and it looks like the pic is of some fast-food chain's cheap product, and their shame on people seeing it probably made them ask for its removal. Or an anal lawyer making a few thousand dollars in billable hours by having his kid look for pics of their product here. Aleister 22:42 29-1-'13 - If the chain's trademark is in the photo, it's unsurprising that they don't want us using it to lampoon them or ridicule their customers. But we do have an article on most fast-food chains and we do use their trademarks, with a claim of Fair Use. My query about how this is handled at the Fork--which the chain must pursue next--is of course something Sannse can't answer; it's rhetorical, by way of again noting that Wikia does stuff for us that must be done in order to operate a website in the lawsuit-happy USA, and I hope but do not expect that the Forkers thought of the problems they might be taking on by going rogue. However, to Sannse's nice way of saying that Wikia does not have the time to tell us explicitly before yanking stuff out of our photo gallery: It really should make time. Spıke Ѧ 22:55 29-Jan-13 - Re notification: Storm meet teacup. Wikia are obliged to remove content based upon a DMCA takedown notice that has merit. Because of the way DMCA is written they have to do it immediately. - This particular issue (the hamburger) has almost no impact on this wiki. Starting a forum on “We've taken down an image that is in the history of one image page and used nowhere else” would be overkill. On more substantially impacting complaints they have received in the past they have raised the issue to the community. - Re the fork's response: I don't know if they have received a similar takedown notice, but it'd put their cabal in a similar position. Acting on it immediately and taking down the image keeps them out of potential protracted and expensive lawsuits. It's a risk v reward measure. - The intelligent response would be to take it down. They don't have the capital to fight it as a legal battle. - But that relates to only this particular request. As Sannse said, they look at the merit of a takedown notice before acting. If it were frivolous then choosing to not act on it is well within their rights. • Puppy's talk page • 11:10 29 Jan - Keep in mind that the full extene of my legal knowledge comes from Boston Legal episodes. If Alan Shore didn't mention it, I don't know. • Puppy's talk page • 11:14 29 Jan - Actually, as fair use has been mentioned, I'll go on a bit about that too. Although, similarly to PuppyOnTheRadio, my legal knowledge mostly comes from episodes of Star Trek. Consider that fair warning - The thing about fair use, is that it's a defense not a right. So images used as fair use can still be removed by the DMCA process. If it's a valid notice, we need to take it down, even if the image seems likely to be legitimately under fair use. But that's where the counter notice can come in, the uploader sends in a counter notice, and the image goes back up. Then, if the person who sent the original notice wants to fight it out further, it goes to court - and that's when the defense of "fair use" comes into play. So you can see that claiming fair use can actually be pretty difficult and potentially expensive. But on the other hand, it's pretty unlikely to go that far, and in most cases it's easy enough to find a alternative image anyway -- sannse (talk) 19:05, January 30, 2013 (UTC) - I would also like to point out, that, in the case in question, we would have no possible fair-use defense, as we aren't using the image anywhere. Also, one is not obliged to protect copyrights, but only trademarks. Copyrights and patents are "property" in a sense that trademarks aren't. In theory, one can ignore a copyright violation for literally 100 years, and then file a DMCA takedown notice. --Mn-z 14:39, January 31, 2013 (UTC) - Also, if someone were to win a copyright lawsuit over fair use, the fair use right would only apply to where the image was being lawfully used. If someone were to add such a image to their userpage, then the copyright holder could launch another copyright claim. --Mn-z 18:42, January 31, 2013 (UTC) - Regarding Spike's question of what the fork would do in a similar situation, this forum topic over there might shed some light on the issue. --Mn-z 20:41, February 5, 2013 (UTC) - To quote one of the Fork's luminaries (who was nominated for Admin here): "We should just give a traditional "Fuck you" to anyone who dares bring a lawsuit against us." Life is so easy when you reject reality. Profit might be an awful basis for creative writing, but people are going to find out that Loss is even worse. Spıke Ѧ 21:04 5-Feb-13 edit Question I heard there is/was a way to completely delete/destroy one's user account and contributions entirely. Like nuking an entire account. Is that still possible? →A (Fallen Reich)03:45 3 February 2013 - No. Anyone can choose to stop using an account, but (as shown on the fork) once anyone has made a contribution to have released it under NC-BY-CC-SA licence. (Although the licence may differ from wiki to wiki.) What the contributor chooses to contribute is governed by that licence as soon as it's submitted. • Puppy's talk page • 05:32 03 Feb - Not what I meant, Pup. I meant if someone could "delete" an Uncyclopedia account. I was told it was possible by EMC. →A (Fallen Reich)20:32 3 February 2013 - I would imagine it is not possible for you to "delete" your account, since your account is shown in the history of all the pages you have contributed to. If the account were deleted it would have to be removed from there. Out of interest, why do you want to get your account deleted? --Chiefjustice3DS 21:35, February 3, 2013 (UTC) - What is possible is that one can rename one's account. Their contributions would remain intact but reflected under a different name. That's what I've done at the fork. The other thing is remove the email address from preferences and scramble the password. That's what Hyperbole did (accidentally) with his account. But either option is fairly useless. Contributions remain intact. There's a difference between pseudonyms and real names, so it doesn't identify as you. At best the outcome is a momentary confusion. At worst after this has been done the contributor cannot reclaim that old identity, even if they want to. - If EMC is aware of another option then he can do that on the fork. But given it's a fairly futile exercise, as Chief asks, why would anyone want to? • Puppy's talk page • 10:33 03 Feb - Basically... what Pup said. We can change your nick, or disable your account by removing your email address and password, but that's it. Otherwise you have that confusion of contributions with no account attached -- sannse (talk) 22:15, February 4, 2013 (UTC) edit Hey there dude- I've been off the site for a while and that makes me feel sad inside (of course it does) and I'm working on coming back- and then I get an email from this yokel named 'Bizzeebeever' about how there is a new Uncyclopedia- what is the f-ing deal...? I mean- yeah I haven't been around but what up with that? --) 22:41, February 6, 2013 (UTC) - Hi, I'm guessing you mean via the Uncyclopedia user mailing system? Well that makes me sad inside too. If possible, could you forward the mail to me at community@wikia.com please? - On the fork, if you look on the Dump you'll see all the history there. But it's totally uncool for Bizzeebeever to have used this site to contact you about it (did you notice the Dude-speak I slipped in there?). Anyway, I'm going to turn off the email functionality for this wiki for now... hopefully I'll be able to turn it back on later -- sannse (talk) 00:40, February 7, 2013 (UTC) - Yeah, make sure there is NO WAY for him to find out about the new site. That will prevent anyone from finding it. Good, Feb 7 '13 2:10 (UTC) - As the Chief Justice has now implemented a more targeted remedy for the duration of the misconduct, you may see fit to switch email back on. Spıke Ѧ 10:57 7-Feb-13 - Actually, i'd prefer you didn't. Sorry to contradict, but blocking a user does not stop the user sending emails. And a clever user can work around the “one email every 24 hours” restriction. I'd rather not open the gates to spam email. The restriction is minimal, and keeping things in the public domain is my preferred way to do things. • Puppy's talk page • 11:19 07 Feb - Let's see how things are after a week or so. Anyone who really wants to talk via email, can still do so without Wikia of course, it just means exchanging email addresses directly -- sannse (talk) 21:18, February 7, 2013 (UTC) - One quibble: Preventing users from initiating unsolicited contact with other users might be appropriate now, but in the case of consenting users, the block also forces one of them to publish his email address, typically on one of these very public pages. Spider 'bots surf wikis and scoop up anything with an @ in it, and it's daily spam from then on. So it's not a matter of "just" exchanging addresses. Cheers. Spıke Ѧ 21:30 7-Feb-13 - PS--Anon has edited Terms of Use (one grammar correction, one cynical comment on the value of the articles). Spıke Ѧ 21:33 7-Feb-13 - I know it's not perfect, but they can (for example) jump on to a chat and exchange addresses in PM. - I see the ToU page got reverted, but you know those aren't the real ToU, right?... -- sannse (talk) 01:05, February 9, 2013 (UTC) - Ahem Um, sure. Knew it all along Spıke Ѧ 14:21 9-Feb-13 - And you know I hate that. Spıke Ѧ 14:46 9-Feb-13 - Touché. And the consequences of taking issue with a preference of mine are minor by comparison. Spıke Ѧ 16:36 9-Feb-13 - Although, the guy filing the DMCA might be laughing all the way to the bank for all I know. --Mn-z 16:38, February 9, 2013 (UTC) - I assume that the particular corporation involved pay someone to trawl through images online in order to give DCMA notices. He probably gets paid as a corporate lawyer. In which case he earns money by looking a photos of burgers all day. Nice sinecure if you can get it. • Puppy's talk page • 09:59 09 Feb edit Parser change It looks like most of the main project pages is broken, including the main page. That would seem to imply a parser change. --Mn-z 07:07, March 2, 2013 (UTC) - I tried reverting Romartus's last edit to the featured article queue, in case it had a typo; that didn't work. I can't debug this further. Spıke Ѧ 15:18 2-Mar-13 - It appears the issue is with <DPL> queries. For instance, have a look at User:PuppyOnTheRadio/image. As that uses pure DPL to generate that page, that suggests to me that's where the issue lies. • Puppy's talk page • 03:41 02 Mar 2013 - Separately (or maybe not), something is bollixing up BB's Java buttons that let me patrol multiple edits with a single keystroke; I am two days behind at this. Spıke Ѧ 15:53 2-Mar-13 - It looks as though the issue with <DPL> queries has resolved, but may require a purging of pages that are still impacted. I just tested User:PuppyOnTheRadio/image and as of 5 seconds ago - after I purged - it's now working again. As for the script - it looks like that is also working again, but haven't had a chance to fully test it. • Puppy's talk page • 10:31 04 Mar 2013 - I am back to normal as well. It would be nice to know what happened. Spıke Ѧ 22:37 4-Mar-13 - Hi guys. Yes, the problem was with DPL. We've had some issues over the last few days, which either meant error messages when pages loaded, or problems with Javascript (and a few other effects as well). During all this, we had to make server changes, that put more strain on the site. And to help reduce that, we had to turn off DPL for a while. So all in all, it was what we in the business call "an unpleasant weekend". Everything seems to be back to normal now and, of course, our techy guys are figuring out exactly what happened and how to make sure it doesn't again. Sorry for the problem all -- sannse (talk) 00:47, March 5, 2013 (UTC) - Oh, also, we generally post to twitter and facebook if we can't post on the wiki (which, at times, we couldn't). We also have a Skype channel that's open to regular users, and is a good way to find out quick info to take back to your wiki. Let me know if you want me to add you there -- sannse (talk) 00:49, March 5, 2013 (UTC) - As posted elsewhere, I drove down to the Public Library on Saturday in case some of the problem was my Internet connection, but hit youse at the depths of the outage. I think Simsie said she noticed the problems too. Email is the best way to contact me--not saying you need to whenever a problem arises, though if the site were to go down for a whole day, I wish you would. Spıke Ѧ 01:27 5-Mar-13 - This was an irritating one, because we were never "down" (or not for more than a short time), but various people in various areas had more or less problems. That's why we try to have the central places for updates: w:c:community:Blog:Wikia_Technical_Updates on-wiki (although, looks like we could have updated that more quickly) and twitter and facebook off-wiki. Personally, I wanted the chip-in-every-user's-head option, but someone pointed out that if we had technical issues with those, it could get... messy. I don't understand why though, my Wikia chip is still working perfectly! -- sannse (talk) 18:31, March 5, 2013 (UTC) - I'm already having issues with my Geocities and Alta Vista chips conflicting. Another chip may be overkill.(Psst… what's the twitter account?) • Puppy's talk page • 10:36 05 Mar 2013 - Simsilikesims reports on my talk page that a comparable malfunction is still seen at the BHOP section of the Forum. Spıke Ѧ 04:02 6-Mar-13 - If you purge any pages that have these issues still (like ) that'll kick them back into working order. • Puppy's talk page • 06:39 06 Mar 2013 edit Content warning borked? Hi S, the content warning seems to be broken on Chrome (approving it doesn't do anything) while it works fine under IE shell. Can you check? Also, Hi Sannse, how has you have has been? ~ 12:27, March 8, 2013 (UTC) - Mordilly! it's great to see you. All's good for me, I got a dog. How's Mrs Mordilly and the Dilliroos? (are there Dilliroos? My memory is like a goldfish) - I just downloaded Chrome, and the button works for me, which is confusing. Could you try one of the unchanged warnings like - does that show the same problem? If you are using an over version of the browser, you may want to update it, that can cure JS problems. Either way, let me know what you see, and we'll try to figure it out -- sannse (talk) 19:39, March 8, 2013 (UTC) - Also check browser security settings. If cookies are disabled that may impact on this as well. (Although I have no idea how to check that on Chrome. Never had any reason to block cookies.) I've also tried to replicate and had no problems. • Puppy's talk page • 07:45 08 Mar 2013 - Just checked this on my Google Chrome and didn't have any problems either. Do you have javascript enabled in Google Chrome? -- Simsilikesims(♀UN) Talk here. 21:39, March 8, 2013 (UTC) - Well shit, I know ya`ll just pressed the button that turned that thing off, as everything works just fine a dandy. I'm allowing cookies and JS, so no idea what happened. I'll let you know if this happens again, could be something to do with my work IT Security policy that blocks certain services that interfere here. Also, Sannse, Mordilla says hi back, one Dillon at this moment (and he's more than enough for now!). I'm already training him with the banstick, he seems to be doing fine with the kids at the creche, pretty soon he'll be ready for real nasty trolls! ~ 13:47, March 10, 2013 (UTC) - Excellent! I know he'll grow up to be as vicious and scary an admin as his father. No... wait... am I confusing you with Famine? -- sannse (talk) 19:09, March 11, 2013 (UTC) edit Added element to content warning While we're arguing over the content warning (again) I had an idea. At the moment the content warning doesn't appear to logged in users. Unless someone is a regularly logged in user though, they'll have no idea about that. Are we able to establish a link from the content warning that has a two part element that will: - Establish an agreement to the CW and, - Send a person to the log-in/register screen with a return to whatever page they landed on when entering? This way we can have an explanation that they can dismiss the content warning by creating an account or logging in, but keep them navigating towards wherever they were. This also helps promote Wikia account creation, which will encourage people to return to the site more regularly. It's a rough idea, but it should be doable. (As far as I can see the acceptance of the CW adds a cookie to the user's browser. Adding another link to an acceptance button that is not just returning to the page they came should be easy. I wouldn't use this to replace the current button, but as a third option.) • Puppy's talk page • 01:53 10 Mar 2013 - Interesting thought.... I think the best thing is for me to send the idea over to the people who decide on such things, and see what they think. There might be ways to hack it in, but possibly a neater solution could be coded (although, such questions can take a while to get back). I definitely think keeping it relatively simple is important but, as you say, this might be a good way to encourage that log in -- sannse (talk) 19:12, March 11, 2013 (UTC) edit Image Removal Received an alert that this pic File:Spart03.jpg from Spartacus:Gore and Nudity was violating something or other. It is a scene in the TV show (I know, I have watched it). Since the article was to poke fun at the show, the picture was to show the regular coupling and orgy scenes. Or was it the boob grab that was:47, March 14, 2013 (UTC) edit UnBooks:Where do babies come from? Most of the images from this page have been deleted. It's being marked as a ToU vio. These images are all from a children's book by WP:Per Holm Knudsen. There is no way to substitute for these images. As a result it's destroying a featured article and previous PLS winner. Are we able to restore these images? • Puppy's talk page • 08:28 15 Mar 2013 - Simsilikesims has spent tons of time this afternoon trying to sew up the holes ripped in many Uncyclopedia articles, including one of Romartus's, based on a TV show, that is now on VFH. Is Wikia's position still that there is no time to inform us of these deletions and the reasons for them, much less to give us a chance to censor or adapt them before they disappear, as you used to do? (PS--"Children's books" from Denmark are only sold here in mysterious shops with wrapping paper on the doors and windows, and in certain convenience stores but they are behind the cashier.) Spıke Ѧ 20:37 15-Mar-13 - What the unmentionable unmentionables?? Something is wrong here. Those images were not set for deletion, I'm sure of it. I don't understand it yet, but this is not intentional. Gah! This is where I'm seriously limited by being all staff-like and stuff... please insert some very annoyed words here! -- sannse (talk) 23:58, March 15, 2013 (UTC) - OK, there's three that I can't undelete, and I can't work that out right now (I've really got to go <somewhere other than at this computer>). Again, I'm sorry about this... we'd worked out a process for these (and I had put a load on hold until I had time/inclination to go through that process) and this wasn't it. I'll be doing some testing over the weekend to find out what exactly happened -- sannse (talk) 00:43, March 16, 2013 (UTC) - I can restore the images from off-site versions. If you can dredge up the page history (without images) I'll re-upload them. (Assuming that's all kosher). • Puppy's talk page • 01:06 16 Mar 2013 - I see that it has been fixeded. Never mind. • Puppy's talk page • 01:09 16 Mar 2013 edit New content warning I'll install the voted-on content warning at the top of the hour. Please confirm that it's working if you are near a screen. Spıke Ѧ 00:56 27-Mar-13 - We've gone from the most interesting content warning on the net to the most boring content warning on the net. Aleister It does have clouds! I trust your message means you can see it. So can I, only for the minute it takes the cloud photo to arrive, it is white on very light blue (and if it were not for my local CSS, it would be white on white). - I'm definitely happy to see the storm clouds gone - and perhaps the element of humor can grow over time... in a not-too-distracting-and-difficult-to-click-through way -- sannse (talk) 19:08, April 2, 2013 (UTC) edit Censored iconic photograph Now here is a problem which you should bring to your board, or to Jimbo Wales, or to your "new" CEO who probably never posted here - why would you remove the pic of the child who had just been napalmed in Vietnam and tore off her clothes? That is one of the most iconic photographs of the Vietnam War. The chop of the photo had a large American attack plane seen as skidding towards the children, yet it was made very well and portrayed one of those "pictures worth 1000 words". Now, did Wikia remove it because it's a naked picture of a little girl? Removing this work of art, this iconic photo (did it win a Pulitizer? I'm not sure but it may have), may be a new low of this censorship policy. And I'd like a longer answer than your standard answers to me which usually take the tone of "Oh Aleister!" Thanks. Aleister 1:09 27-3-'13 - For the record, I saw Sannse's request and I deleted it. As I noted in the same Forum, the nudity was gratuitous to the point of the photo, showing a jetliner chasing people on the ground. Spıke Ѧ 01:17 27-Mar-13 - "Sannse's request" are the key words here. This is much more than a jet chasing people on the ground, it is a chop using an iconic photograph and adding a layer of terror onto it - that picture should be featured and honored and not censored. This needs a forum here too, coming right up.Aleister 1:30 same day Wow. You are taking down a Pulitzer Prize–winning photograph claiming it's "porn"? Oh boy. That's the funniest thing I have seen on "Uncyclopedia" for some time. It was featured on the front page of the New York Times, got a Pulitzer Prize and was chosen as the World Press Photo of the Year for 1972. Yet it's "porn". Ohhhhh., Mar 27 - It's not about the image itself, or even the nudity alone... it's about using a picture of a naked burning child for a few laughs. That's something I'm not comfortable with. -- sannse (talk) 19:04, April 2, 2013 (UTC) The Newspaper That DOESN'T Think It's Better Than You! April 9th, 2013 • Issue 181 • Voted best newspaper of Uncyclopedia: 2010, 2011 and 2013. edit Express Delivery...is not available today (just normal delivery) The Newspaper That Gets Its News Solely From Vandalism! May, 4th 2013 - May the Fourth be with you! • Issue 182 • Sponsered by (and biased towards) the Rebel Alliance. edit This UnSignpost may be unsuitable for some viewers! The Newspaper 4 out of 5 Dentists Agree On! May, 10th 2013 • Issue 183 • Uncyclopedia set to have a bright future. Sunglasses stocks are running low. edit The UnSignpost has arrived...Quick hide! STOP... SIGNPOST TIME!! May, 18th 2013 • Issue 184 • Vandalpedia strikes back! Luckily the Jedi will return. edit The UnSignpost hath cometh The Newspaper With No Ambitions, Goals, Hopes or Dreams! Summer's here! And so is the post The Newspaper That DOESN'T Think It's Better Than You! June, 14th 2013 • Issue 186 • This newspaper may not be able to tell you who Denza but then it can't tell you much anyway! edit Phantom uploads ScottPat has just reported, at the bottom of my talk page, that the system has recorded him uploading media he says he did not upload. Aleister in Chains reported the same thing last week. I could do no more than tell him the media file confirmed the log and said he was the uploader. Shabidoo and I cross swords, also near the bottom of my talk page, regarding a rollback he says he did not do. (Denza/DungeonSiege led us on a comparable wild-goose chase last night but consensus, based on input from RAHB, was that this was a consequence of him being tricked into disclosing his password a long time ago.) Is there some sort of problem with media uploads being misattributed? Spıke Ѧ 19:13 14-Jun-13 - Although I have nothing to prove this with I have never disclosed my password to anyone. My contribution log claims that I uploaded these two files but I have not (as Spike pointed, June 14, 2013 (UTC) As with the Aleister case, the medium is a YouTube video. The medium history and the upload log says that it was uploaded today/recently by an Uncyclopedian who says he did not do it. There is no history of a previous version being deleted. But in this case, the file that references it (User talk:RAHB) has referenced it since 2012. Spıke Ѧ 19:29 14-Jun-13 PS--There are quite a lot of uploads tonight, all with the Change Summary, created video. Spıke Ѧ 03:07 18-Jun-13 edit Update Furry has provided a reasonable explanation for this, involving Wikia's attempt to make more efficient the inclusion of YouTube links in articles. Cancel Red Alert. Spıke Ѧ 13:06 18-Jun-13 edit Recent news from old newspapers The Newspaper With Words n' Shit! June, 27th 2013 • Issue 187 • Something you certainly were not expecting! Anton (talk) Uncyclopedia United 19:56, June 27, 2013 (UTC) edit If you don't know where to find the news The Newspaper That Won't Judge You! July, 5th 2013 • Issue 188 • A rag you can surely use for a clean-up of your own! Happy reading! Anton (talk) Uncyclopedia United 17:41, July 5, 2013 (UTC) edit PLS edition of UnSignpost with extra poo The Newspaper That Won't Judge You!:52, August 13, 2013 (UTC) edit It is back! August 1st, 2013 • Issue #190 • Archives • Press Room Anton (talk) Uncyclopedia United 12:26, August 28, 2013 (UTC) edit UnSignpost - Delivered every [other] week! August 1st, 2013 • Issue #191 • Archives • Press Room Anton (talk) Uncyclopedia United 10:38, August 29, 2013 (UTC) edit Account issue Hey, I was told you were the one to talk to. Long story short: Many years ago I made an account called Chocceh with no associated email. I want to make it so people Googling my long-time screen name can't find the personal information that's on User:Chocceh and User talk:Chocceh. Apparently these are my options (unless there are others I don't know about): • Recovering my account • Deleting the pages, hiding them, blanking them, or anything similar • Removing them from Google's index Can you help? Chocceh2 (talk) 17:50, August 28, 2013 (UTC) edit Terms of use Heya Sannse, I seriously doubt that linking to another wikia site in ones signature is a violation of Wikia's terms of use, I think SPIKE may have made a little error here. Could you look into it and offer your wisdom on the matter. Thanks in advance Madclaw @ talk 16:34, September 6, 2013 (UTC) - Have you spoken to Spike about this at all? If not, that's the first person to talk to in this regard. • Puppy's talk page • 11:04 06 Sep 2013 - The action Madclaw calls a "little error" here and "vandalism" on my talk page refers to my editing his signature page to remove a link to Darthpedia. The prohibition on using signatures to direct traffic elsewhere was clarified this during the VFS vote in January, in which both Darthpedia emissaries "participated." The issues are laid out in Sec. 40-42 of my talk pagemy archive. I don't believe this situation requires your intervention, unless you wish to say that I should treat links to Wikia-owned and non-owned sites differently. Spıke Ѧ 12:10 8-Sep-13 - I guess the sig linking to another Wikia site and a non-Wikia site will be different - certainly as regards as using Wikia resources to boost a non-hosted Wikia site. However, since the user data bases for Wikia and Uncyclopedia are separate, all users should use sigs that link to their talk page on Uncyclopedia as a matter of course. Many Uncyclopedians haven't got an account on other Wikia hosted sites. I only created one recently for admin purposes so I can talk and leave messages on other Wikia:20, September 8, 2013 (UTC) - The Wikia position is that we do not allow wikis that have forked to link to the new wiki, except in specific areas (the original conversations about the forks, a link on the user pages of those who have departed, that sort of thing). Sigs would definitely come under the "no" section of that. - However, Darthpedia isn't a fork of this wiki, so that's different. But, of course, it's absolutely fine for there to be a local policy that sigs must link to a talk page here. -- sannse (talk) 21:17, September 16,:12, September 15, 2013 (UTC) edit Images Spike alerted me to two images being removed. I don't know what the pole dancer one was but the one from the Liberal Party article was a still from a tv series of two people running into the sea. All you can see are a pair of bums! I was hoping that any image issues could be referred to an admin before just disappearing:15, September 16, 2013 (UTC) - Hi, see my email reply - just a slip of the finger, which you can attribute to either excitement at seeing those bums, or a technical error that temporarily stole my easy-to-see color coding on the review tool. Sorry about that -- sannse (talk) 21:19, September 16, 2013 (UTC) - Thanks Sannse. We want to keep our bums! --:39, September 17, 2013 (UTC) edit Mobile skin Hey. Something changed on the Wikia end around a week ago that means that I'm unable to switch from mobile skin to full mode. It also means that searching for pages has gone awry. (It does a full text search, rather than going directly to the page, and has trouble with pages in the “Special” namespace.) The mobile skin doesn't allow me to edit without adding in the full URL (appending “&action=edit”). It also makes it hard to see history, and diffs don't highlight changes. I've managed to partially work around using an app called “Wiki egg”, but that has it's own issues. (Can't edit directly, but sends me to Safari to edit in mobile view. And it won't load the “Share” links directly, so each time I open a page I have to dismiss 5 different messages. It also goes back to the last loaded page rather than refreshing, so I have to refresh each time I visit the same page.) I've put through something at Special:Contact about it, but got a useless response about this having been an ongoing issue, and something about it being fixed at some later stage. I'm somewhat stuffed in relationship to being able to edit here. On visiting other wikis (not Wikia) I don't have this issue. Can you speak to someone who knows magical stuff on your end (like Miralem) to see what can be done to expedite this? • Puppy's talk page • 01:44 17 Sep 2013 - Hey you, - Back when this first happened I sent through a response email saying I was completely unsatisfied with the outcome of my request (stating that the response was "woeful"). I was sent back an e-mail telling me that as we were just the one sub-domain we were unimportant, and that they had this fix down as a low priority, but they were expecting to get this fixed by the 10th October. - On the 10th this situation hadn't been rectified. Around the same time you did mention "...the importance of the mobile platform. Uncyclopedia has 30% hits via mobile devices including iPhones, Ipads etc. This is increasing rapidly. " You also mentioned "...Uncyclopedia is an important part of the Wikia group, it has a strong name recognition..." You also mentioned Alexa, where it shows Uncyclopedia makes up around 1% of Wikia's total traffic, just above marvel.wikia.com, harrypotter.wikia.com, pad.wikia.com and community.wikia.com. - The one reason I keep coming back to this is that this site gets around 3 mil pageviews a month. If we say that roughly 30% of these are people visiting via a mobile platform, that makes 1 mil page views per month where users cannot see the full site and cannot edit the site. - I've had to use and extremely circuitous method to edit here via a mobile device. It takes me around three times as long to get to an edit page while I'm on my mobile as it used to. And not to blow my own horn or anything, but I'm one of the most regular editors of this site (fifth most active user over the last 30 days, according to Special:ActiveUsers. - As an exercise I visited nonsensopedia.wikia.com. A very similar site, but has about a quarter of the traffic. Switching from mobile view to full view works there. I figured I'd take the experiment a step further and visited wazhack.wikia.com - this gets around 0.01% of Wikia's traffic - about 1/100th of the traffic Uncyc gets, and has just under 400 pages. You'll never guess what happened when I tried to go from mobile view to full view. - Can we please get this issue with the mobile view rectified? I've been patient enough to wait for over a month since I first reported this issue (ticket number 101522). Can we finally get this stupid thing fixed? - • Puppy's talk page • 10:30 22 Oct 2013 - Oh dear, I'm sorry... - I should say that it's not about how big Uncyc is (or how small wazhack is) the problem is something to do with Uncyclopedia's unique set up. It's the same reason that I don't get notifications of messages here in the way I do for other wikis. Various bits of this site (including, of course, the user database) aren't joined to the main group in the same way as elsewhere. I don't mean that as an excuse, just an explanation of why Uncyc is affected and not other wikis. But leaving that aside, I will talk to Mira tomorrow and get an update on the problem. I'll get back to you as soon as possible -- sannse (talk) 03:54, October 23, 2013 (UTC) - Okay, I'm told that various things got in the way of that estimate, I'm very sorry about that. The ticket has now been bumped to a higher priority and so should be completed in our next batch... hopefully in about 2 weeks. And, much better news.. you will very soon be able to edit on the mobile skin, without having the switch to the full site (which is the bit that's broken). That should make it a lot easier to edit all round. Keep an eye on Community Central for an announcement on that. - So overall, not exactly what I'd like to say to you (which would be "it'll be fixed tomorrow"), but it is coming -- sannse (talk) 18:10, October 24, 2013 (UTC) - Good to know that it's on its way at least. Appreciate the help. • Puppy's talk page • 08:30 24 Oct 2013:41, October 21, 2013 (UTC) edit Constantly changing and not evolving newspaper - the UnSignpost October 31st, 2013 • Issue #195 • Archives • Press Room Anton (talk) Uncyclopedia United 17:25, October 31, 2013 (UTC) edit All wikia blocks I don't want to wait 15 days, 360 hours, that's a long time to edit again. Just unblock me so i can edit on all wikias and on my wiki, Memory Delta wiki. I don't want to wait 15 days, 360 hours, that's a long time.98.236.110.176 22:51, December 17, 2013 (UTC) edit Who said 'late'? December 17th, 2013 • Issue #196 • Archives • Press Room edit Ban evasion alert On the French Logimalpédie, there were 3 edits made dy the KNOWN IP of banned Utilisateur:Cuillère sur plancher and her S/P Utilisateur:Foofoofoo. The known ranges are 99.240.X.X and 99.241.X.X. This same range has made edits on this Uncyclopedia, as an IP and as User:Llwy-ar-lawr. This person has declared herself to be against the Wikia projects in general. Please investigate this matter. Thanks. 1<473 (talk) 00:13, December 20, 2013 (UTC) (Utilisateur:Kate Susan), or just Kate. - Llwy-ar-lawr is no longer active here and if she comes back, it will probably be for good, as she no longer wants to argue with Wikia or anything link that. And she was a great proofreader and writer. Anton (talk) Uncyclopedia United 12:58, December 24, 2013 (UTC) - Sannse did not ban Llwy-ar-lawr; I did. A short career of good proofreading was followed by persistent manufacture of drama and ban evasion. Anton, please find better things to do than argue for the rehabilitation of banned users. Kate, Sannse was aware of the vandalism of Logimalpédie during a previous round. Local Admins are aware that Llwy has campaigned against Wikia on several sites including Wikipedia, but we do not act against Uncyclopedians either for their actions on other sites or for "be[ing] against the Wikia projects in general" but only for their conduct here. Spıke Ѧ 14:25 24-Dec-13 edit log in help Hey, I created an account on Bengali version on uncyclopedia, But i can't logging in with my same username & pass on enlish version or others. Do i need to create individual account for every version? Thanks. 58.97.216.150 08:37, December 23, 2013 (UTC) - You will need to log in and create a separate account here. It can have the same name and password you use on the Bengali version but if the name is already taken here, you will have to change:04, December 23, 2013 (UTC) edit The last UnSignpost of the year December 29th, 2013 • Issue #197 • Archives • Press Room edit Name change? Hey, I asked Romartus about this and was redirected to you, would you please change my name to "Just Joe"? - Joe edit Hi, email Sannse, please drop me an email, so I could write back to you. The emails here have been disconnected for some reason. Thanks. I'm at Aleister_in_Chains and that's over at yahoo. Aleister 00:35 26-1-14:52, February 18, 2014 (UTC) edit The UnSignpost is back from holiday March 28th, 2014 • Issue #199 • Archives • Press Room We have not forgotten about you (yet)! Anton (talk) Uncyclopedia United 16:00, Name change Could you name change to Felixed69? Initially misread the process (tried to post on your community page but does not refresh) Thanks Starpluck (talk) 13:53, August 20, 2014 (UTC) - I can only give you that name if you are the owner of the same account on the rest of Wikia. So I do need you to confirm that with an edit to my wall. Are you having problems posting to? If so, I can switch my test wikia to talk pages (it would also be good if you could file a bug report via) - sannse (talk) 19:05, August 20, 2014 (UTC) Thanks for the heads up. I just posted now on your wall and it worked. Starpluck (talk) 19:56, August 20, 2014 (UTC) edit Name Hey for some reason I can't post on your Wikia page. I've tried all browsers (including even TOR) logged in/out and it just refreshes the box without actually adding anything. I wanted to know if this was finally fixed: Thanks! —The preceding unsigned comment was added by Starpluck (talk • contribs) 02:18, August 28, 2014 - sorry, no, and I don't expect it to be in the near future. It's a tool that's used very rarely on one wikia, so it's pretty far down the list of things for the techys to work on. I have to suggest making a new account (with a name not used anywhere on Wikia) or staying with Starpluck. Sorry! -- sannse (talk) 17:28, August 28, 2014 (UTC) edit So it's been like 6 years and now there's two of them? I remember living most of my life at age 15/16 on the IRC #uncyclopedia room with you there. Good times. Sad to see the old place split in two, only for both to become like graveyards. Where did it all go:53, September 29, 2014 (UTC) - A house divided against itself cannot stand. Not unless it grows an extra leg or two. We're working on that, but we'll probably never be as good as we were before. Before I was here. We were too weak to be cut in half. -– Llwy-ar-lawr • talk • contribs • 17:56 29 September 2014 I think it all went wrong with that Big Bang idea. Although I'm willing to say it was okay until someone squished together those damn amino acids. But, things change, people change, and people do things that other people think is a bad idea but they think it's a good idea. I miss the old days too, but life moves on (there's that damn life thing again, bleh!) Good to see your name always, DJ :) -- sannse (talk) 18:15, September 29, 2014 (UTC) edit Name change request from PizzaAngel Hey can you change my username form PizzaAngel to SuckDaChuck?—The preceding unsigned comment was added by PizzaAngel (talk • contribs) edit Here's a very special UnSignpost November 9th, 2014 • Issue #202 • Archives • Press Room edit ConfirmationJust verifying I am indeed the owner of this Uncyclopedia account :) Lord Castabarus (talk) 09:59, April 13, 2015 (UTC)
http://uncyclopedia.wikia.com/wiki/User_talk:Sannse?t=20130204221534
CC-MAIN-2015-18
refinedweb
10,701
70.84
Queues and slow jobs with Laravel Queues are commonly used on a daily basis of software development, even the IoT world has an specific protocol that implements this concept. Laravel does the same providing developers with an amazing API. Here, we are going to focus on the theory and practice itself being independent of any vendor such as Amazon or Beanstalkd, for that you can check Laravel’s documentation. Basics The first thing to notice is how Laravel handles the configuration part, as usual the configuration part is in the config folder, the file queue.php is the place to set up the details of our service. <?php return [ /* |-------------------------------------------------------------------------- |', 'sync'), /* |-------------------------------------------------------------------------- | Queue Connections |-------------------------------------------------------------------------- | | Here you may configure the connection information for each server that | is used by your application. A default configuration has been added | for each back-end shipped with Laravel. You are free to add more. | */ 'connections' => [ 'sync' => [ 'driver' => 'sync', ], 'database' => [ 'driver' => 'database', 'table' => 'jobs', 'queue' => 'default', 'retry_after' => 90, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', 'host' => 'localhost', 'queue' => 'default', 'retry_after' => 90, ], 'sqs' => [ 'driver' => 'sqs', 'key' => 'your-public-key', 'secret' => 'your-secret-key', 'prefix' => '', 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], 'redis' => [ 'driver' => 'redis', 'connection' => 'default', 'queue' => 'default', 'retry_after' => 90, ], ], /* |-------------------------------------------------------------------------- | Failed Queue Jobs |-------------------------------------------------------------------------- | | These options configure the behavior of failed queue job logging so you | can control which database and table are used to store the jobs that | have failed. You may change them to any database / table you wish. | */ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], ]; The dotenv approach used is the best thing of it, as you could see the configuration file is almost enteirely driven by it. sync is the default driver to use queues, which means that Laravel won’t use any queue at all, it will just run the code synchronously as it runs normally. The first change is not in this file, it is in the .env file, created automatically when Laravel is installed, we are going to use the database drive. QUEUE_DRIVER=database Cool, the next thing to do is to create the necessary tables to handle the queue. Laravel has an Artisan helper to make it for us, when the database is properly configured, go in your terminal and run the folowing code: php artisan queue:table The Artisan command will genenrate a migration file, which contains the table struture, then we need to execute the migrate command to create the table in our database php artisan migrate Creating services The most common example is to send an email through the queue system. If you are wondering why, the answer is simple. Queues give a friedly feedback to the user, which means that they will receive an answer as fast as possible while the applicationis still working in the background. For this reason Laravel has a few methods that work great with sending email <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class EmailController extends Controller { public function send() { Mail::later(10, 'welcome.blade', ['data' => 'Email sent!'], function($message) { $message->to('[email protected]'); }); return 'Email has been sent successfully!'; } } The code above ilustrates how would it be to send an email using the queue, usually to send emails we invoke the method send, but the Laravel documentation gives to us a good reason to queue: “Since sending email messages can drastically lengthen the response time of your application, many developers choose to queue email messages for background sending. Laravel makes this easy using its built-in unified queue API.” - Laravel docs If you didn’t notice, the method invoked here is the later, and its first argument is how many seconds it should be delayed. In our case we are going to send the email after 10 seconds, but if you run this code you will immediately see the message: “Email has been sent successfully!”.
https://marabesi.com/php/2017/06/21/queues-and-slow-jobs-with-laravel.html
CC-MAIN-2020-16
refinedweb
632
56.29
supervised learning. But what is special about neural networks is, it works really well for image, audio, video and language datasets. A multilayer neural network and its variations are commonly called deep learning. In this blog, I will focus on handling and processing the image data. In the next blog, I will show how to train the model. I will use python for implementation as python as many useful functions for image processing. If you are new to python, I recommend you to quickly take a numpy (till array manipulation) and matplotlib tutorial. Main contents of this article: a) Exploring image dataset: Reading images, printing image arrays and actual images, decomposing images into different color channels b) Cropping and Resizing images: Cropping rectangle images to a square, resizing high resolution images to a lower resolution for easier processing, creating gray scale images from color images and standardizing image data c) Colormapping and Interpolation: Converting no color channel images to color images using different themes. Interpolating after resizing or reducing resolution of images to for retaining quality and information. d) Montage Creation and Preparing image data for modeling I originally used Jupyter notebook for the article. I am not sure how to upload it here. Hence each cell is shown between <Python code start> and <Python code end>. Apologies if the format is looking a little weird. Okay! Let's get started. First let's get some data set. This data is shared in the course on kadanze about Creative Applications of Deeplearning by Parag Mital. This data contains pictures of celebrities. Original source can be found here along with some description here. In the original dataset, there are around 200,000 pictures. For the purpose of this blog we will use 100 images. Following code will download 100 images. <Python code start> # Load the os library import os # Load the request module import urllib.request if not os.path.exists('img_align_celeba'): # Create a directory os.mkdir('img_align_celeba') # Now perform the following 100 times: for img_i in range(1, 101): # create a string using the current loop counter f = '000%03d.jpg' % img_i # and get the url with that string appended the end url = '' + f # We'll print this out to the console so we can see how far we've gone print(url, end='\r') # And now download the url to a location inside our new directory urllib.request.urlretrieve(url, os.path.join('img_align_celeba', f)) else: print('Celeb Net dataset already downloaded') <Python code end> If the dataset was not downloaded, the above code will download it. Let's read the downloaded images. <Python code start> files = [os.path.join('img_align_celeba', file_i) for file_i in os.listdir('img_align_celeba') if '.jpg' in file_i] <Python code end> Let's add a target column. Here we will try to identify whether a picture shows a male celebrity or female celebrity. Value 1 denotes 'Female celebrity' and 0 denotes 'male celebrity'. <Python code start> y=np.array([1,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,1,0,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,1,1,0,0,1,1,0,0,1,0,0,0,0,1,0,1,1,1,0,1,1,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1]) y=y.reshape(1,y.shape[0]) classes=np.array(['Male', 'Female']) y_train=y[:,:80] y_test=y[:,80:] <Python code end> Now let's take a closer look at our data set. For this we will use the matplotlib library for plotting. We can also use it to view the images in our data <Python code start> import matplotlib.pyplot as plt %matplotlib inline <Python code end> Exploring image dataset In this section we will try to understand our image data better. Let's plot an image from the data set(in this case the first image) <Python code start> plt.imread(files[0]) <Python code start> Output: array([[[253, 231, 194], [253, 231, 194], [253, 231, 194], ..., [247, 226, 225], [254, 238, 222], [254, 238, 222]], [[253, 231, 194], [253, 231, 194], [253, 231, 194], ..., [249, 228, 225], [254, 238, 222], [254, 238, 222]], [[253, 231, 194], [253, 231, 194], [253, 231, 194], ..., [250, 231, 227], [255, 239, 223], [255, 239, 223]], ..., [[140, 74, 26], [116, 48, 1], [146, 78, 33], ..., [122, 55, 28], [122, 56, 30], [122, 56, 30]], [[130, 62, 15], [138, 70, 23], [166, 98, 53], ..., [118, 49, 20], [118, 51, 24], [118, 51, 24]], [[168, 100, 53], [204, 136, 89], [245, 177, 132], ..., [118, 49, 20], [120, 50, 24], [120, 50, 24]]], dtype=uint8) It prints some numbers. Here each tuple (the innermost array) represents a pixel. As you can see, it has 3 values, one corresponding to each color channel, RGB (Red, Green Blue). To view the data as image, we have to use 'imshow' function <Python code start> img = plt.imread(files[0]) plt.imshow(img) <Python code end> Output: Let's see the shape(dimensions) of the image <Python code start> img.shape <Python code end> Output: (218, 178, 3) This means height of the image is 218 pixels,width 178 pixels and each pixel has 3 color channels(RGB). We can view the image using each of the color channels <Python code start> plt.figure() plt.imshow(img[:, :, 0]) plt.figure() plt.imshow(img[:, :, 1]) plt.figure() plt.imshow(img[:, :, 2]) <Python code end> Output: Cropping and resizing images: For many of the deeplearning and image processing applications, we will need to crop the image to a square and resize it for faster processing. The following function will crop any rectangle image(height != width) to a square image <Python code start> def imcrop_tosquare(img): if img.shape[0] > img.shape[1]: extra = (img.shape[0] - img.shape[1]) // 2 crop = img[extra:-extra, :] elif img.shape[1] > img.shape[0]: extra = (img.shape[1] - img.shape[0]) // 2 crop = img[:, extra:-extra] else: crop = img return crop <Python code end> Now we will resize the image to 64 by 64 pixels(height=64,width=64). For resizing, we can use the imresize function from scipy <Python code start> from scipy.misc import imresize square = imcrop_tosquare(img) rsz = imresize(square, (64, 64)) plt.imshow(rsz) print(rsz.shape) <Python code end> Output: (64, 64, 3) As we can see from the shape of the image, it has been resized to (64,64,3). If we take the mean of each color channels(RGB), we will get a grayscale image. <Python code start> mean_img = np.mean(rsz, axis=2) print(mean_img.shape) plt.imshow(mean_img, cmap='gray') <Python code end> Output: (64, 64) When there is no color channel for an image, you can use different availble color maps provided by matplotlib. Following code iterates through different color maps for the above image(with no color channel) and plots it. For your purposes, you can choose the best one if you come across such images. It is also an easy way to convert grayscale images to color. <Python code start> methods = [None,'] # Fixing random state for reproducibility np.random.seed(19680801) fig, axes = plt.subplots(10, 8, figsize=(16, 32), subplot_kw={'xticks': [], 'yticks': []}) fig.subplots_adjust(hspace=0.3, wspace=0.05) for ax, interp_method in zip(axes.flat, methods): ax.imshow(mean_img, interpolation='sinc',cmap=interp_method) ax.set_title(interp_method) <Python code end> Output: Now let's crop all the rectangle images as square and resize all the images in the dataset to size 64, 64, 3. <Python code start> imgs = [] for file_i in files: img = plt.imread(file_i) square = imcrop_tosquare(img) rsz = imresize(square, (64, 64)) imgs.append(rsz) print(len(imgs)) <Python code end> Output: 100 Let's combine all the images into a variable <Python code start> data = np.array(imgs) <Python code end> If you are familiar with machine learning, you will know the about data standardization. It means generally bringing down the range of an input variable. Same can be done with image data as well. However, for images there is an easy way to standardize. We can simply divide each of the values by 255, as each pixel can have values from 0-255. This will change the scale from 0-255 to 0-1. This will make sure while taking exponents in logistic regression, we won't overflow the system. <Python code start> data=data/255 plt.imshow(data[0]) <Python code end> Output: When we reduce the resolution, we lose some information. We can use different kinds of interpolation to overcome this. The following code shows the effect of different kinds of interpolation. While plotting images after resizing, you can choose any interpolation you like. <Python code start>(data[0], interpolation=interp_method, cmap=None) ax.set_title(interp_method) plt.show() <Python code end> Output: <Python code start> data.shape <Python code end> Output: (100, 64, 64, 3) The shape of the data is 100,64,64,3. This means there are 100 images of size(64,64,3) Montage creation Till now we have been inspecting one image at a time. To view all images, we can use the following function to create a montage of all the images <Python code start> plt.figure(figsize=(10, 10)) plt.imshow(montage(imgs,saveto='montage.png').astype(np.uint8)) <Python code end> Output: Data Preparation for modeling Let's split the data into train and test. Train data will be used to train the model. Then we will predict on test data to check the accuracy of the trained model <Python code start> train_x_orig=data[:80,:,:,:] test_x_orig=data[80:,:,:,:] <Python code end> Unlike regression model, logistic regression is used to predict a binomial variable.i.e means a variable which takes only two values. This suits perfectly for us as we are trying to predict from the images whether it is a male or female celebrity. <Python code start> m_train = train_x_orig.shape[0]_orig.shape)) print ("y_train shape: " + str(y_train.shape)) print ("test_x shape: " + str(test_x_orig.shape)) print ("y_test shape: " + str(y_test.shape)) <Python code end> Output: Number of training examples: m_train = 80 Number of testing examples: m_test = 20 Height/Width of each image: num_px = 64 Each image is of size: (64, 64, 3) train_x shape: (80, 64, 64, 3) y_train shape: (1, 80) test_x shape: (20, 64, 64, 3) y_test shape: (1, 20) For the purpose of training, we have to reshape our data or flatten our data. After flattening, shape of our data should become (height * width * 3, number of examples). After flattening, every column will represent an image. <Python code start> train_x = train_x_orig.reshape(train_x_orig.shape[0],-1).T test_x = test_x_orig.reshape(test_x_orig.shape[0],-1).T print ("train_x flatten shape: " + str(train_x.shape)) print ("test_x flatten shape: " + str(test_x.shape)) <Python code end> Output: train_x flatten shape: (12288, 80) test_x flatten shape: (12288, 20) Now we have our data set ready. In the next part I will talk about how to train the model using simple logistic regression using gradient descent. Meanwhile If you want to know more about gradient descent check it out here To read original article,click here. References: 'Creative Applications of Deep Learning with Tensorflow' on Kadenze by Parag Mital 'Neural Networks and Deep Learning' on Coursera by Andrew Ng. Views: 4409 Comment You need to be a member of Data Science Central to add comments! Join Data Science Central
https://www.datasciencecentral.com/profiles/blogs/image-processing-and-neural-networks-intuition-part-1
CC-MAIN-2021-17
refinedweb
1,943
66.33
Need help on AoH or array or any other help I can get for this task Discussion in 'Perl Misc' started by cyrusgreats@gmail.com, Oct 17, 2008.,847 - Victor - Sep 1, 2004 - Replies: - 1 - Views: - 9,315 - Marco Meschieri - Aug 9, 2006 Accessing ant task name when running a taskteggy, May 29, 2007, in forum: Java - Replies: - 0 - Views: - 821 - teggy - May 29, 2007 [Rake] call a task of a namespace from an other task.Stéphane Wirtel, Jun 14, 2007, in forum: Ruby - Replies: - 3 - Views: - 373 - Stephane Wirtel - Jun 15, 2007 Need help on AoH or array or any other think that might help!, Oct 17, 2008, in forum: Perl Misc - Replies: - 17 - Views: - 151 - Tim Greer - Oct 22, 2008
http://www.thecodingforums.com/threads/need-help-on-aoh-or-array-or-any-other-help-i-can-get-for-this-task.908682/
CC-MAIN-2014-41
refinedweb
122
81.56
06 February 2012 09:43 [Source: ICIS news] NEW DELHI (ICIS)--Finolex Industries plans to expand its polyvinyl chloride (PVC) pipe capacity by setting up a 40,000 tonne/year unit at Vadodara in ?xml:namespace> “About 25% of this new capacity (10,000 tonnes/year) will be chlorinated-PVC (C-PVC) pipes, which are in high demand in the country currently,” the source said on the sidelines of the 8th PlastIndia exhibition at Demand for C-PVC pipes in The expansion will bring the total pipes capacity of Finolex to 240,000 tonnes/year. The company currently runs two pipes units at Ratnagiri and Pune in Finolex operates two PVC units at Ratnagiri with a total capacity of 260,000 tonnes/year. Finolex also plans to double its emulsion PVC line at Ratnagiri to 22,000 tonnes/year by the end of the year, a second source said. “Emulsion PVC demand is currently at 90,000 tonnes/year, but is growing at 8-9% per year, “the source said. The main demand segments are synthetic leather and coir tufting, he added. Local production of emulsion grade PVC is currently at 54,000 tonnes/year.
http://www.icis.com/Articles/2012/02/06/9529542/indias-finolex-to-expand-pvc-pipe-capacity-by-40000.html
CC-MAIN-2015-22
refinedweb
195
54.66
Table of contents Created 4 May 2011 Requirements Prerequisite knowledge Knowledge of Flex and ActionScript, basic knowledge of XMP Metadata User level All Additional required Adobe products - At least one Creative Suite 5 (or later) product: - Open Extension Builder and select XMP Namespace Designer Project from the New Project Wizard. - Specify a name for the project, a prefix and URL for the custom namespace, and a package name for the generated library. - Click Finish. - In the XMP Namespace Designer, use the Add and Remove buttons to set the properties of the custom namespace, and edit them in the table. The container types and value types should be more or less self-explanatory; if you need more information, these are explained in the XMP Specification. There are now two automatically generated projects in the project explorer, Artwork_lib and Artwork_panel, in addition to the original Artwork project. - Artwork_lib is the library project, which allows us to work with our new XMP namespace from ActionScript. - Artwork_panel is the FileInfo panel project, which allows us to access the properties of our custom namespace from within Creative Suite applications. Adding validation rules We can add validation rules to our custom namespace properties to make the generated resources even more useful. To add validation rules: - In the XMP Namespace Designer, click the icon in the validation column. - In the Edit Validation Rules dialog box, click Add Rule. - For the first rule, select the criteria must be, after, and 1990. - Click Add Rule again. - For the second rule, select the criteria must not be, after, and 2050. - When you're finished adding rules, click Done. If you select the Strict validation option, the generated library and FileInfo panel accept only valid values, and remove any preexisting invalid values. If you deselect this option, the library and FileInfo panel accept invalid values. Specifying Validation Rules in Expert Mode For extra flexibility, we can specify validation rules for a property using Expert Mode, which allows us to enter a regular expression for the property. For this example, we'll specify a rule for the Artist property. To add a regular expression: - In the XMP Namespace Designer, click the validation icon for the Artist property. - In the Edit Validation Rules dialog box, select the Expert Mode option. - Enter the regular expression ([A-Z][a-z]+ ?)+ in the text box. This means one or more words separated by a space, each at least two letters long, and each starting with a capital letter. For more information, see Regular expression syntax. - When you've completed the rule, click Done. Setting choices for Closed Choice and Open Choice value types The Closed Choice and Open Choice value types define a property that can contain one of a predefined set of specific values: - A Closed Choice property can only have one of the predefined value choices. - For an Open Choice property, the predefined values offer suggested choices, but other values can also be chosen. To set the choices for a property of this type: - In the XMP Namespace Designer, click the validation icon for the Style property. - Because this has the type Closed Choice, the Choices dialog opens. Click Add to enter a predefined value choice. - Enter several choices, as shown. - When you've finished adding choices, close the dialog.: - In the context menu for the Artwork_panel project, choose Run As > Adobe Illustrator Extension. - Create a new document, choose File > File Info, and then select the Art tab. The FileInfo panel shows the appropriate controls for all of the properties of the art namespace. - Fill out the fields of the Art tab as shown in the example. The data must match the criteria specified earlier. If you enter invalid data for the Artist or Release properties, the FileInfo panel rejects them. - When all data is entered, click OK. The Raw Data tab of the FileInfo dialog box shows the properties of our custom namespace serialized into XML. : - In Extension Builder, select a new Creative Suite Extension Project from the new project wizard. - Name the project something like ArtworkExtension, and select Adobe Illustrator as one of the target host applications. - In the properties dialog box for the ArtworkExtension project, add the Artwork_lib project to the Flex Build Path. Okay, now to write some code. There should be two files in the project src directory: - ArtworkExtension.mxml defines the UI for your extension; initially, it defines only one button. - ArtworkExtensionIllustrator.as contains the code that is executed when you click the button. Open this file to add some new code to the button-click handler. - In the run()function, add this line to extract the XMP packet from the active Illustrator document: var xmpPacket:String = app.activeDocument.XMPString; - Create an object to represent our custom art namespace, in the context of the XMP packet: - There are more lines we can add to the run()function to work with the XMP properties. For instance, we can update the values of the properties as follows: context.art.style = "Sketch"; context.art.artist = "j.c. anderson"; - If we add a couple of trace statements, we can check the actual values that are stored in the XMP itself: Adding encryption: To decrypt these properties, we simply pass in the decryption key to the constructor of the context object: var context:ArtXMPContext = new ArtXMPContext(xmpPacket,"password"); This decrypts the properties in the new context object. Binding properties Using the [Bindable] and [xmp] tags in ActionScript, we can bind properties of our custom XMP Namespace to ActionScript variables, so that they're automatically kept in sync.
https://www.adobe.com/devnet/creativesuite/articles/handling-metadata.html
CC-MAIN-2019-26
refinedweb
924
54.63
Adding GitLab Pages to CE WhatWhat Adds GitLab Pages to CE as promised in #14605 (closed) via We’re bringing GitLab Pages to the Community Edition TodoTodo - Add a changelog file - Fix rubocop errors - Migration must either have DOWNTIME=true for ApplicationSettings, or use add_column_with_default, as adding a column with a default value requires downtime - Check it works! Play around with on dev, using gitlab-runner with gdk with the pages daemon - Ensure this doesn't accidentally close CE issues where an EE issue was mentioned in the commit To checkTo check - Test on a server, including nginx config examples work, etc. - Check through changed files and ensure that things like CHANGELOG entries are excluded - Ensure that migrations work, and doesn't mess with migrations on EE. - Check for security fixes and bug fixes which might only mention pages in comments, on dev.gitlab.org, etc and ensure they are picked. - Consider squashing some commits. Check if fewer commits would be preferred. Docs changes could be filtered out and done in a single commit, commits from each MR could be combined to remove WIP commits and version updates. Todo afterTodo after - Check documentation was updated to reflect inclusion in CE from 8.17. E.g. in doc/user/project/pages/index.md - Ensure that the CE->EE merge doesn't include changes from these commits - EE merge request: gitlab-ee!1156 (merged) - Move pages related issues and open MRs from EE project to CE project. Create %pages% label. Closes #14605 (closed) - I think using git-filter-branchwas a mistake! More difficult than I expected but learnt so, so much about how git actually works underneath the hood. From slack: jedwardsjones [1:29 PM]: Definitely aiming for it! I should be able to spend the whole of Wednesday (18th) on it, but not sure how much longer it will take. My initial attempt was a bit overcomplicated/difficult in hindsight! Maybe 60% chance that will be enough time. I’ll also work on it Tuesday/Thursday/Friday if its not done, but might not leave enough time for review. @jamedjo fyi I'm working on simplifying the docs in gitlab-ee!1072 (merged). I haven't yet create an MR to CE, I'm waiting on the port to be merged first. I'll probably merge the new docs as soon as I finish the refactoring. - Sure, didn't get as much done yesterday as I'd hoped. Maybe 30% chance now, because even if done today there will only be one day to review. I'll give a more accurate update later today/tonight. Files used in original (terribly overcomplicated) approach: - Files touched by GitLab Pages in EE - Files changed as part of GitLab Pages, but which don't have 'pages' in their file path - Yes/no for selecting commits and Yes/no for selecting commits to skip - Exploration of git filter-branch - Script for git filter-branch by timestamp, files touched and list of commits - Create list of commits to keep using modified (snippets/35745) Used MR commits only via Script to get commits matching 'pages' label. Much better but started getting error: app/.../.../...: does not exist in index and error: doc/.../...: patch does not apply during the index-filter. Going to try again using an interactive rebase which selects only those commits. If this also fails or takes too long I'll go back to the branch in this MR which contains only pages files. I'll then manually find changes to non-pages files and add them in a single commit. mentioned in issue #14605 (closed)Toggle commit list mentioned in merge request gitlab-ee!1072 (merged)Toggle commit list @jamedjo how easy is it to exclude the docs from this MR? I'm refactoring a lot of stuff in gitlab-ee!1072 (merged) and there are a lot more to come, so maybe it would be easier to leave the docs port to CE to me. - - - - added 2075 commits - aedca506...659cceb0 - 1910 commits from branch master - 120f9aba - Add GitLab Pages - 732a821d - Fix specs - ac09f857 - Remove locking and add force to FileUtils methods - fa68e403 - Support https and custom port for pages - b27371d8 - Change pages domain to host - adc1a9ab - Re-add missing gitlab_on_standard_port - d28f1a7f - Split PagesWorker - 35dd2e12 - Fix tests - 0f2274cc - First draft of pages documentation - c5788139 - Add missing jekyll website link - f934460e - Fix wrong assumption that the public dir must be present in your git repo - f8b0d06b - Fix pages storage path - ab220022 - Add GitLab Pages administration guide - a60f5f6c - GitLab Pages admin guide clean up [ci skip] - 38028d92 - Add example when using a subdomain [ci skip] - 94fdf58a - Store pages in shared/pages/fqdn/fqdn/public or shared/pages/fqdn/subpath/public… - 6fd06943 - Point to GP administration guide, no need to duplicate things [ci skip] - 4e03436b - Small lines improvement [ci skip] - 6f999703 - Finish GitLab Pages user documentation - 139ebce6 - Clean up the text in pages view - cab3ea00 - Add missing intro [ci skip] - 31454eb2 - Capitalize Pages [ci skip] - 5e8675c1 - Add section on storage path [ci skip] - 6bb7a19c - Revert "Small lines improvement [ci skip]" - 4afab3d4 - Revert "Store pages in shared/pages/fqdn/fqdn/public or shared/pages/fqdn/subpat… - 2c244777 - Rename pages namespace or project path when changed - d26eadf3 - Fix small typos in GP user guide - a691e9f4 - Minor cleanup, use gitlab.io as an example domain for GP - 9ff381c4 - Add pages to excluded directories in backup task [ci skip] - e9e8a2f6 - Asynchronously remove pages - 2c6a8525 - Refer to server_name with regex - 3fbe9b3b - Add comment about the sequence when removing the pages - 6c9ba469 - Bring back GitLab Pages SSL config - 324fe12a - Fix pages path settings option. - 9c78a206 - Typo fixes, remove unnecessary information about pages path [ci skip] - c66b1580 - Fix confusing implementation detail in nginx config about how gitlab-pages work [ci skip] - 0bb480dc - Add note about shared runners [ci skip] - 8aba28e1 - Clarify some things in Pages [ci skip] - a7fa7f26 - Add missing dot in .gitlab-ci.yml [ci skip] - 1d159ffb - Fix URL to GitLab pages documentation - 6e70870a - Move most of PagesWorker logic UpdatePagesService - c4c8ca04 - Added support for zip archives in pages - 5f7257c2 - Initial work on GitLab Pages update - 930a7030 - Implement proper verification of certificate's public_key against the private_key - f034f6b3 - WIP - 6e99226c - Added PagesDomain - 13b6bad1 - Implement extra domains and save pages configuration - e5e2e7b7 - Fix the remove_pages - 0552c0b6 - Fix views - d3b82848 - Pages domain model specs - b7fd7dae - Fix rubocop complains - db35f3dc - Add tests for Active Tab - 84edc9a2 - Added spinach tests - 7f12cb0e - Split PagesController into PagesController and PagesDomainsController - c6723ed3 - Updated configuration saving - fd7756ec - Added information about the CNAME record - 361047a7 - Updated according to comments - 4d233717 - Final fixes - 3bcb65c9 - Added pages version [ci skip] - 8f09ec28 - Verify trusted certificate chain - 63eb4156 - Fix certificate validators - 92a1efe6 - Use GitLab Pages 0.2.0 - c089f103 - Update comments - 492627c9 - Fix the URL of group pages - 3e6cbcdd - Fix pages abilities - 8a861c87 - Describe #pages_url instead of :pages_url - 06d96a9a - Introduce pages_deployed? to Project model - 861129c3 - Mock Dir::exist? in project_spec.rb - a621b9d5 - Update docs - c634ff42 - Fix broken feature tests - d5ccea02 - Add init scripts for GitLab Pages daemon - 50bbc326 - Change NGINX pages configs to account for the Pages daemon - 4b45f284 - Change the pages daemon proxy listen port to 8090 - deb9481e - Add missing variables for gitlab-pages - fd9916c8 - Add section about changes from 8.4 to 8.5 - 055b8230 - Add Changelog of GitLab Pages - 96fed044 - Add first draft of architecture - 0a4585be - Add MR that custom CNAMEs were introduced - 516a95dd - Add TOC - f8927dad - More changelog clarification - acf7ae5e - Add info about the pages daemon - dfc3e58a - Add configuration scenarios - 39dff1e1 - Update TOC - cfc54df4 - Set pages daemon to false - b3994786 - chmod 644 gitlab.default.example - 2a484c6a - Introduce custom domains setup for source installations - 54c943a5 - Reword pages daemon intro - ca26884c - Add info about the loadbalancer - fed8b62c - Remove pages daemon from table and add it as prerequisite - d24763fa - Add the four scenarios and NGINX caveats - 228455af - Rename NGINX section - 3858443f - Add heading to the GitLab Pages setup scenarios - f8c8dc03 - Add remaining Omnibus configs - d9e3bb0e - Add a separate NGINX section - 84ff07cd - Simplify NGINX server_name regex - aadbb606 - Move Omnibus storage path - 37fc486c - Link to backup task - 9ca23461 - Add link to Omnibus 8-3 docs - e5c7c8ca - Small reword fixes - bdc7301a - Add configuration prerequisites section - e4069304 - Checkout the tag of pages daemon - 8094a9d1 - Add missing Omnibus settings - 5556db04 - Add missing gitlab-pages related vars in init.d/gitlab - 639cf728 - Fix adding pages domain to projects in groups - 55214fe1 - First iteration on simplifying the pages user docs - 47bff50f - Reorganize sections - 5b9d8869 - Add links to CI and runner - 81533b8f - More section cleanup - edc8782e - Split user and group sections - bcf89171 - Convert CI quick start guide into a note - dbfde1d0 - Add requirements section - 34d75cff - Rephrase - 8f7eb4e3 - Add image for pages removal - c9b63ee4 - Add pages job in yaml document - 5009acc0 - Convert shared runners into a note - 69854d97 - Merge user and group pages - 7e7da5b2 - Add table explaining the types of pages - ea8ff392 - Rename user/project pages headings - d1fe6a6f - Mention the power of CI and that Pages support all static generators - 758f5599 - Move Pages removal to Next steps section - fa374abd - Add note to use gitlab.io when using GitLab.com - 3d91145c - Be more precise who people are - a3aef355 - Be more clear what project name is referred to - 18478e5d - Reword - e7b2784c - Add new sections and clean-up - 52dcde27 - Move examples to own section - 50d32d6c - Add examples to 404 pages - 231e3a2b - Add example of hosting Pages in a specific branch - 8442e3f0 - Add sections on custom domains - aaebb216 - Clarify where 403 and 404 pages should exist - 0255a858 - Use the default ruby:2.1 image - a77a101d - Add separate section for GitLab.com - 552e8993 - Clarification - 1fe13d63 - Remove confusing FAQ question - d557b3fe - Fix markdown anchor link - 9a8818f8 - Add FAQ on Pages website type precedence - 873eacaf - Mention that shared runners on GitLab.com are enabled by default - 2b18f020 - Add section on redirects - 1bdfdd87 - Add known issues section - 8fc3030a - Add note on custom domains limitation - 8f5e7c36 - Update links to new pages group. - 39f9056d - Update GitLab Pages to 0.2.1 - 2c1eeb5c - Update GitLab Pages to 0.2.2 - fd61cd08 - pages: Fix "undefined local variable or method `total_size'" when maximum page size is exceeded - b22c06d3 - Bump GitLab Pages to 0.2.4 - caedc996 - Adds algorithm to the pages domain key and remote mirror credentials encrypted a… - 0168a240 - Only show the message if user is not the owner - e6a7eb43 - If no pages were deployed, show nothing. Feedback: - 0763b5ea - Add a test for checking pages setting - c3e483b0 - Stub to enable it so that we could test this - 109553af - Fix EE specs after ci_commit rename to pipeline - 8fd926fe - Project#ensure_pipeline changed the args order - d8ae0922 - Remove Pages ToC from docs - baac5365 - Clarify where the settings are in Pages docs - f6c66f45 - Fix reconfigure link on doc/pages/administration.md - 80f9794c - Fix restart link on doc/pages/administration.md - 86f4767d - Fix 500 error while navigating to the pages_domains'show' page. - 66bfc9e9 - [CE->EE] Fix specs - 12d44272 - Fix Rubocop offenses - 91c07d16 - Fixed Rubocop deprecation warnings - 7163da60 - Fix GitLab Pages test failures - 6ba14927 - Update validates_hostname to 1.0.6 to fix a bug in parsing hexadecimal-looking domain names - 8a09a251 - small but mighty confusing typo - 877c121c - Fixed typo ("server" -> "serve") - 5075fb3b - fix attr_encrypted in EE Compare with previous versionToggle commit list mentioned in merge request !8921 (merged)Toggle commit list added 3 commits - 94545e58 - Active tense test coverage in pages spec - 9677b538 - Excluded pages_domains from import/export spec - 23974334 - Fix GitLab Pages not refreshing upon new content Compare with previous versionToggle commit list added 1 commit Compare with previous versionToggle commit list mentioned in merge request gitlab-ee!1134 (merged)Toggle commit list added 8 commits - e7d4b8a0 - First iteration on Pages refactoring - b14ee42f - Move Pages docs to new location - 749d8051 - Bump GitLab version that Pages where ported to CE - 39e74b1c - Fix link to new pages location - 452b9c8b - Merge multiple notes into one in Pages user docs - 2c787bca - Better highlight prerequisites for Pages - e9c08231 - Bump pages daemon and place Omnibus settings on top - e2123de5 - Split Omnibus and source installation Pages admin docs Compare with previous versionToggle commit list New approach much more successful! Instead of using filter-branch, I've found all EE merge requests with the pages in GitLab Enterprise Edition label and cherry-picked them to a new branch. I've done a git diff files created for pages to confirm that they match. @axil I've included your changes here as part of that, so no need to create a separate MR. I'm going to update the MR description, so have copied the current version below What Adds GitLab Pages to CE as promised in #14605 (closed) via We’re bringing GitLab Pages to the Community Edition Todo Brainstorm of things to do in no particular order: - Update documentation to reflect inclusion in CE from 8.16 - Check for auxiliary changes such as to Gemfile and code used by pages - Check for commits on pull requests related to pages - Maybe get history of files which have touches pages feature - Check for bugfixes in other files which affect how pages works. Maybe look for pages in commit messages - Move pages related issues and open MRs from EE project to CE project. Create %pages% label. - Consider if there are any aspects of pages which are still more relevant in EE only. Unlikely but might be complex HA support or something which isn't interesting to <1000 user installations. Might move those to CE anyway for various reasons. - EE usage ping methods shouldn't be included for example, but won't get included with the way I'm currently thinking of doing this - Coordinate with EE merge to ensure that additions in CE are skipped in EE, but also that documentation changes are included in both - Create alternative branch to try and recreate changes from git history instead of as my own commits. - Add a changelog file - As well as checking specs pass, it is also important that all specs are included, that documentation is updated, that nginx config examples work, etc. - There will be conflicts as things are added to non-pages files, but moved/changed later on. E.g. added to routes, but then routes were split later in a commit which won't mention pages. - Changelogs updates should probably be ignored. There is a choice between removing the changes in the merge commit, vs amending/rebasing/filtering the commit to not include changes to CHANGELOG. Will see conflicts when trying to make changes to CHANGELOG-EE - Ensure that migrations work, and doesn't mess with migrations on EE Process outline - Play around trying to get basics working on CE, finding which files are essential - Create branch containing just pages related commits, by merging in pages MRs - Create list of all commits which touch pages files - Include all merge commits for MRs including pages in the title - Will need to look at order merged into EE - Rewrite the history to only include changes to pages. Might be done as part of the merge process, and might need to be done to individual commits rather than in the merge so as to avoid having sha hashes which point to unsanitized versions. Especially things like style changes which might touch every file in the project unnecessarily. - Run a diff on all files with pages in their path from ee, to ensure that they are in the correct state. If not, then commits have been missed and probably ones which don't touch those files too. Might want to run diff on auxiliary files too. - Check for security fixes and bug fixes which might only mention pages in comments, on dev.gitlab.org, etc and ensure they are picked. Alternative process idea - Merge EE into a CE branch - Filter history to ignore all commits which don't touch relevant files. Relevant files either include "pages" in the path or are listed as auxiliary changes below. - Rewrite commits with irrelevant changes to only include relevant ones. - Drop changes to EE only files such as CHANGELOG-EE - Changes to auxiliary files should be from related MRs and fixes only. E.g. We don't want all changes to Gemfile - Check diffs - - marked the task Migration must either have DOWNTIME=true for ApplicationSettings, or use add_column_with_default, as adding a column with a default value requires downtime as completedToggle commit list added 3 commits - 01b14b2d - Fix rubocop error from pages EE->CE port - f868fa35 - Use non-downtime migration for ApplicationSetting’s max_pages_size - f9d2ca4b - Added Changelog for Pages to CE port Compare with previous versionToggle commit list marked the task Check it works! Play around with on dev, using gitlab-runner with gdk with the pages daemon as completedToggle commit list - @DouweM Can you review this? Most changes have been cherry-picked apart from my changes in 3c571baf and 9677b538 - - added 2 commits - 3c571baf - Use non-downtime migration for ApplicationSetting’s max_pages_size - a14f1139 - Added Changelog for Pages to CE port Compare with previous versionToggle commit list - - - - Consider squashing some commits. Check if fewer commits would be preferred. Docs changes could be filtered out and done in a single commit, commits from each MR could be combined to remove WIP commits and version updates. In this case, more commits is good, because we will still be able to find why some line was added or changed at some point. - - - added 1 commit Compare with previous versionToggle commit list - mentioned in issue gitlab-ee#1480 (closed)Toggle commit list - added 1 commit Compare with previous versionToggle commit list - - Fixed in 5af4cae5, created gitlab-ee!1164 (merged) for EE - - added 231 commits - 67c85260...bd8f2b15 - 230 commits from branch master - 1af3f3b6 - Merge branch 'master' into jej-pages-picked-from-ee Compare with previous versionToggle commit list - marked the task EE merge request: gitlab-ee!1156 (merged) as completedToggle commit list @rymai In this MR there are a lot of CE-only changes, and I’ve created an EE MR. I don’t really understand how this will be used to avoid conflicts, and it isn't mentioned in the Merge GitLab CE into EE docs. How is this done? One huge revert commit? added 1 commit Compare with previous versionToggle commit list - - - - - Maintainer added 201 commits - 5af4cae5...53db7d1d - 200 commits from branch master - b988faaf - Merge branch 'master' into 'jej-pages-to-ce' Compare with previous versionToggle commit list Fixed, hopefully passing with new master merged! Build failure was js-lint from merging master and conflict was schema.db from within the last hour. I've thought of a new productivity metric we could track: time spent with master in a 'green'/passing state vs time spent failing or pending tests. - - - mentioned in merge request omnibus-gitlab!1283 (merged)Toggle commit list mentioned in merge request !9018 (closed)Toggle commit list mentioned in merge request !9031 (merged)Toggle commit list I don’t really understand how this will be used to avoid conflicts, and it isn't mentioned in the Merge GitLab CE into EE docs. How is this done? One huge revert commit? @jamedjo I think this case (backporting a feature to CE) is special but in general if conflicts when merging CE into EE, if there was a EE-specific MR it's as simple as keeping the EE changes and discarding the CE one.
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8463
CC-MAIN-2018-26
refinedweb
3,171
54.05
Introduction to MongoDb with .NET part 30: starting with indexing May 19, 2016 Leave a comment Introduction In the previous post we finished our discussion of the aggregation framework in MongoDb. We now know the basics of building aggregation pipelines in both the mongo shell using JavaScript with JSON and using the MongoDb .NET driver. In particular we looked at how to write strongly typed aggregation queries with dedicated methods in the aggregation fluent API. Starting with this post we’ll shift our focus towards a different topic within MongoDb: indexes and related topics in performance. General remarks Chances are that you know approximately what indexes do in a database. Full-stack developers normally cannot avoid them while optimising the database tables. MongoDb also offers indexes in much the same way as relational databases do. They offer a way to make searches much quicker by maintaining sort of a sorted register over the documents. Sorting is important as it makes for a very quick and efficient search compared to an unsorted set of documents. If you want to query a collection with a million documents and no indexes then the search engine will need to look at every single document in that collection. If, however, there’s an index in front of the collection then the search engine can quickly find the relevant documents by consulting the index, i.e. the sorted register first. The kind of index you build will depend on a several parameters: - Queries: you as the developer will – or at least should – have a good idea about the type of queries hitting the database from the application. If there are a lot of searches on specific fields such as the “name” then it can be a good idea to have an index on that field. Composite indexes, i.e. indexes that comprise multiple keys can handle queries that cover more than one field, such as searches on the “name”, “age” and “hobbies” fields - Reads vs. writes: indexes don’t come for free. In MongoDb indexes are documents that are updated with every new record in the database. If you build an index on the “name” field then the name index must be updated with every new document of course otherwise they will not show up in the search result. A name index will keep the names in ascending or descending order depending on how the index was specified. This ordering will make searches very efficient. Then if there’s a new document with a new name then this name must be squeezed into the name. - Index size: since indexes are also documents they will keep growing with the number of new documents - Single-key vs. multi-key indexes: as mentioned above it’s possible to build composite indexes. If there’s a frequent search on the name and age fields then it can be a good idea to create a composite index of “name” and “age”. That kind of index will also help with searches on the name field alone. However, if there’s a search solely on the age field then the multi-key index won’t be usable as the primary sorting key is the name. Age is only the secondary sorting key in that case and an age-based query will need to go through all documents MongoDb collection statistics Before we actually create indexes I briefly want to mention a utility function that can be called on a collection in the Mongo shell: stats(). Recall that we’ve been working with 2 demo collections in this tutorial: zip codes and restaurants. If you’d like to extract some basic statistics about a collection then you can write something like this in the Mongo shell: db.zipcodes.stats() It will return a large JSON document where most of the output is actually related to the storage engine of the database. A storage engine “is the component of the database that is responsible for managing how data is stored, both in memory and on disk. MongoDB supports multiple storage engines, as different engines perform better for specific workloads.“. In other words it is the soul of the database. MongoDb offers a pluggable interface where the storage engine implementation can be replaced in much the same way as we can have multiple implementations of a certain C# interface. If you have the time and knowledge and happen not be satisfied with the query performance then you could develop your own MongoDb storage engine. I guess not too many people out there do that. As of version 3.2.4 the default storage engine that ships with the standard installation package is called WiredTiger. You’ll see a sub-document called “wiredTiger” in the stats output with a lot of meta-data in it. I think it’s safe to assume that most developers won’t need to know about the details of the storage engine but it’s good to know that it exists and where to find information about it. To be honest I don’t really know what all those properties like “LSM” and “block-manager” mean and I’ve never needed to dig deeper there either. DBAs might want to know more about it though. The other properties in the JSON document can be more interesting for us: - “ns” : the collection namespace, “model.zipcodes” for the case of the demo zip codes collection, where “model” is the database name - “count” : the number of documents in the collection - “size” : the total space reserved for the collection in bytes - “avgObjSize” : the average document size which is the total size divided by the number of documents - “capped” : capped collections “are fixed-size collections. … Capped collections work in a way similar to circular buffers: once a collection fills its allocated space, it makes room for new documents by overwriting the oldest documents in the collection.” By default a collection is not capped, it must be explicitly set in the createCollection function as described here. The final section of the statistics shows a number of properties related to indexes: - “nIndexes” : the number of indexes, currently 1. By default there’s always an index on the _id field - “totalIndexSize” : the total size of all indexes in the database - “indexSizes” : this sub-document shows the size of each index. Currently there’s only one index on the _id field In the next post we’ll start looking into index creation in the Mongo shell. You can view all posts related to data storage on this blog here.
https://dotnetcodr.com/2016/05/19/introduction-to-mongodb-with-net-part-30-starting-with-indexing/
CC-MAIN-2022-40
refinedweb
1,088
59.43
Building J2EE applications with Eclipse Web Tools Servers, Dynamic Web Projects, and Servlets WTP uses the term dynamic Web project to describe projects that let you develop Web applications that make use of a middle tier Web application server . At present WTP includes support for J2EE Web application servers in the JST subproject. We will: 1 add Apache Tomcat to your workspace, 2 create a dynamic Web project that uses Tomcat, and 3 develop a servlet that dynamically generates HTML using server-side XSLT. Servers The main feature that distinguishes Web applications from ordinary Web sites is that Web applications generate dynamic content. Rather than seeing unchanging content on Web pages, users sees content that changes in response to their requests. Web application servers are Web servers that have been extended with additional capabilities for hosting Web applications. Although Web servers have almost always supported the generation of dynamic content through technologies such as server-side includes and Common Gateway Interface (CGI) scripts, Web application servers go above and beyond ordinary Web servers by providing additional services for hosting and managing applications. Web applications become first-class objects that can be configured, deployed, started, and stopped. One of the most important application services provided by Web application servers is session management which layers the notion of sessions on top of the inherently sessionless HTTP. Shortly after Netscape imbedded a Java virtual machine in its Web browser to support applets, they proposed Java servlets as a superior alternative to CGI. Servlets had the advantage of using threads instead of the more costly proceseses used by CGI. Servlet are what really started the use of server-side Java, which has become the sweet spot for Java development. Sun then standardized the API for Java servlets and added them to J2EE. In J2EE, the presentation functions are hosted in a Web container or, as it is sometimes called, a servlet engine . Sun provided an initial implementation of servlets in the Java Servlet Development Kit which they subsequently contributed to the Apache Jakarta project. This contribution resulted in the Tomcat servlet engine. Although there are many other servlet engines available now, Tomcat remains very popular and you'll be using it here. WTP extends Eclipse with server runtime environments which are similar in spirit to the familiar Java runtime environments supported by JDT. Just as with JST you can select a Java main class and run it as a Java application using an installed Java runtime environment, with WTP you can select Web resources, such as HTML, JSP, and servlets, and run them on an installed server runtime enviroment. The WTP concept of server is not restricted to Web resources though. For example, database servers could be treated this way too. It would make perfect sense to select a Java stored procedure class and run it on a database server. Using a server with WTP is a three-step process: 1 Obtain and install the server runtime enviroment. 2 Add the server runtime enviroment to your workspace. 3 Create a server configuration, and add dynamic Web projects to it. First, you must obtain and install the server runtime environment. Like Eclipse, WTP does not include any runtimes. You must obtain the server runtime from elsewhere and install it on your machine. WTP does include an extension point that server providers can use to simplify the process of installing the runtime. Second, you add the server runtime enviroment to your workspace. To add the server runtime environment, you need a server adapter for it, which is a special plug-in that lets you control a server using the server tools provided by WTP. WTP comes with a respectable list of server adapters and you can obtain others from commercial vendors and other Open Source projects. WTP includes an extension point where other server adapter providers can advertise the availability of server adapters and have them added to your Eclipse installation. Configuring the adapter involves telling WTP where to find the server runtime installation, and setting other parameters, for example, what JVM to use. Although at present you need a specific server adapter for each type of server, the situation may change in the future. The task of server control is in the process of being standardized using the Java Management Extension (JMX). JSR 77 defines J2EE Management APIs [JSR77] and JSR 88 defines J2EE Deployment APIs [JSR88] . As these aspects of server control become more widely supported it should be possible to create a common server adapter that works with servers from many providers. Finally, you create a server configuration and add dynamic Web projects to it. A server configuration is a list of dynamic Web projects, and other configuration parameters, such as port numbers. When you select a Web resource to run, it gets deployed to a server that includes its project, the server gets started, and a Web browser is launched on a URL for the selected resource. Do the following to add Tomcat to your workspace: 1 Open the Preferences dialog and select the Server page (see Figure 7.51, “Server Prefererences” ). The main server preferences page lets you control how WTP reacts to various events that effect servers. For example, you can have WTP automatically publish changed resources to servers. Leave these settings as is and explore them later at your leisure. 2 Select the Audio preferences page (see Figure 7.52, “Server Audio Preferences” ). This page lets you associate sounds with various server events. For example, you can associate a sound to play after the server has completed its startup sequence. This is handy for servers that take a long time to start. Play with these settings later. 3 Select the Installed Runtimes preferences page (see Figure 7.53, “Installed Server Runtimes” ). This is where you add server runtime enviroments to your workspace. 4 Click the Add button. The New Server Runtime wizard opens (see Figure 7.54, “New Server Runtime” ). Note that you can also add server runtimes by means of the Search button The server tools will then search your hard disk for installed server runtimes and add them automatically. If you do that be patient since it takes a few minutes. Figure 7.54. New Server Runtime 5.The New Server Runtime dialog lists all of the server adapters that are currently installed. WTP includes server adapters for many popular servers. WTP also provides an extension point where server adapter providers can list additional ones. Any provider is welcome to contribute an extension to WTP to advertise their adapters. To see the list of other available adapters, click the link labelled: Don't see your server listed? Click here. The Install New Server wizard opens (see Figure 7.55, “Install New Server” ). 6.The downloadable server adapters advertised here simply Eclipse Features hosted on remote Update Manager sites. At the time of writing, only the Apache Geronimo project has contributed an extension to advertise their WTP server adapter, however, we expect other projects to follow suit once this capability is more well-known. Hosting the server adapter at the site where the server is developed lets it evolve independently of the WTP release schedule. This capability is also attractive for commercial vendors who may not want to contribute their adapters to WTP. Select Finish to install the Geronimo server adapter that works with the WAS CE App server we will be using in our exercise. Allow the workbench to restart to finish the install. We are going to use WAS CE for our server, download the server instance here: WTP provides an extension point for server adapters to simply the process of downloading and installing server runtimes. A server runtime provider can package their runtime as an Eclipse Feature and the server adapter can advertise the location of the Update Manager site. At present, the Apache Geronimo server adapter takes advantage of this capability. The Geronimo Server wizard requires you to specify the location of the Geronimo installation directory. Enter the location or select it using the Browse button. You also need to specify a JRE. Be sure to specify a full JDK instead of a JRE since later you will be developing JSPs. JSP development requires a Java compiler which is not included in JREs. You can also specify a descriptive name for the server rutime envirnoment. Accept the default for now. Click the Finish button. The Installed Runtimes preference page now lists Geronimo (see Figure 7.57, “Installed Runtimes -Geronimo” ). Click the checkbox to make Geronimo the default server runtime environment. Figure 7.57. Installed Runtimes -Geronimo You have now added Geronimo to your workspace and are ready to use it to run a Dynamic Web project. Dynamic Web Projects WTP provides Dynamic Web projects to host the development of J2EE modules. Since J2EE modules contain Java code, each module is developed in a separate Dynamic Web project so it can have its own Java class path as defined by JDT. Within a Dynamic Web project, you can freely arrange the Web resources in separate folders, just as JDT let's you arrange Java source in separate source folders. When you are ready to run your Web resources, WTP assembles them into the format specified by J2EE and deploys them to the server associated with the project. In fact, one Dynamic Web project can be associated with one or more server configurations. You can select one of the server configurations as the project default. Here you create a Web module for League Planet ice hockey schedules. Do the following: 1 In the Project Explorer view, select the Dynamic Web Projects folder, right click, and select the New->Dynamic Web Project menu item. The New Dynamic Web Project wizard opens (see Figure 7.58, “New Dynamic Web Project” ). 2 Enter IceHockeyWeb for the Project Name and select Geronimo as the Target runtime. Click the Next button. The Select Project Facets page is displayed (see Figure 7.59, “Select Project Facets” ). 3 A project facet describes some runtime aspect of the Web module. For Geronimo 5.0, you can specify the J2EE version, the Java version, and, optionally, the XDoclet version. Each server defines a set of supported facets and their allowed values. WTP configures the Web module and sets up the class path for the project so that it matches the specified facets. Accept the defaults here and click the Next button. The Web Module page is displayed (see Figure 7.60, “Web Module” ). 4 The Web Module page lets you specify its context root name and the directories for its Web and Java resources. The context root is the name that appears in the URL for the Web application. Specify icehockey as the context root and accept the defaults for the directory names. Click Finish. WTP creates the project and populates it with configuration files such as the J2EE Web deployment descriptor, web.xml (see Figure 7.61, “ Dynamic Web Project -IceHockeyWeb ” ). Figure 7.61. Dynamic Web Project -IceHockeyWeb You have now created a Dynamic Web project named IceHockeyWeb and targetted it to Geronimo. Next you'll add a servlet to it. Servlets The first server-side component defined by J2EE was called a servlet as the counterpart to the J2SE client-side applet component. Since the introduction of the servlet, J2EE has expanded to include JSPs, EJBs, and Web services. In practice, you will develop these more specialized components rather than servlets. However, servlets still have their uses, and a knowledge of servlets will help you understand JSPs which are compiled into servlets. In the previous iterations, you developed schedule.xml, an XML version of the hockey schedule, and schedule.xsl, an XSLT stylesheet for transforming it to HTML. You included a processing instruction in schedule.xml so that Web browsers could apply schedule.xsl to it and display the result as HTML. Although client-side XSLT is appealing, it has a few drawbacks. First, not all Web browsers support XSLT, and those that do support it have some minor differences. If you want to reach the maximum number of browsers and ensure the highest possible fidelity on them, then you can't rely on client-side XSLT support. However, the situation is sure to improve over time as users upgrade to modern Web browsers and the minor bugs are corrected. In this iteration, you will develop a servlet that applies XSLT on the server using the Transformation API for XML (TrAX) which is part of JSR 63: The Java API for XML Processing (JAXP) [JSR63] . Do the following: 1 The new project has no Web resources. Copy schedule.xml , schedule.xsl , and schedule.css from the icehockey folder into the WebContent folder of IceHockyWeb. This completes project setup. 2 In the Project Explorer, select the IceHockeyWeb project, right click, and select the New->Servlet menu item. The New Servlet wizard opens (see Figure 7.62, “New Servlet” ). Figure 7.62. New Servlet 1 With Web->Servlet selected, click the Next button. The Create Servlet wizard opens (see Figure 7.63, “Create Servlet” ). 2 Ensure the IceHockeyWeb is selected as the Project and \IceHockeyWeb\src is selected as the Folder. Enter org.leagueplanet as the Java package and ScheduleServlet as the Class name. The Superclass should be set to javax.servlet.http.HttpServlet. Click the Next button. The next page of the wizard is displayed (see Figure 7.64, “Create Servlet -URL Mappings” ). Figure 7.64. Create Servlet -URL Mappings 1 This page lets you specify information that goes in web.xml, the Web module deployment descriptor. Accept the default Name and enter a brief Description. You'll modify the URL mappings next. A URL mapping defines how the server runtime maps URLs to servlets. The default mapping uses the prefix /ScheduleServlet. However, this is a bad choice since it exposes the implementation technology. You may want to change the implementation technology later, but not break any existing URLs. A better choice is to use a prefix that doesn't expose the implementation technology. Select the /ScheduleServlet URL mapping and click the Remove button. Then click the Add button and enter the mapping /schedule. Click the Next button to continue. The final wizard page appears (see Figure 7.65, “Create Servlet -Method Stubs” ). 2 The final page lets you specify details about the servlet class. The superclass contains methods that handle some of the most comment HTTP methods, such as GET and POST. The wizard lets you select the methods that you want to handle in your servlet and will create stubs for these. You will only handle the GET method so just leave the doGet method checked. Click the Finish button. The wizard adds the new servlet information to web.xml, generates the Java source file for the servlet, and open it in the Java source editor (see Figure 7.66, “ScheduleServlet Created” ). Figure 7.66. ScheduleServlet Created 7. Edit ScheduleServlet.java so that it matches Example 7.12, “Listing of ScheduleServlet.java” . package org.leagueplanet; import java.io.IOException;import java.io.InputStream;import java.io.PrintWriter; import javax.servlet.ServletContext;import javax.servlet.ServletException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.xml.transform.Result;import javax.xml.transform.Source;import javax.xml.transform.Templates;import javax.xml.transform.Transformer;import javax.xml.transform.TransformerException;import javax.xml.transform.TransformerFactory;import javax.xml.transform.stream.StreamResult;import javax.xml.transform.stream.StreamSource; /** * Servlet implementation class for Servlet: ScheduleServlet * */ public class ScheduleS { try {ServletContext context = getServletContext();InputStream xsl = context.getResourceAsStream("schedule.xsl");Source xslSource = new StreamSource(xsl); TransformerFactory factory = TransformerFactory.newInstance();Templates templates = factory.newTemplates(xslSource);Transformer transformer = templates.newTransformer(); InputStream xml = context.getResourceAsStream("schedule.xml"); Source xmlSource = new StreamSource(xml); PrintWriter out = response.getWriter(); Result htmlResult = new StreamResult(out); transformer.transform(xmlSource, htmlResult); response.flushBuffer( );out.flush();} catch (TransformerException e) {throw new ServletException(e);} }} The servlet uses TrAX to apply schedule.xsl to schedule.xml. TrAX uses the AbstractFactory creational pattern as described in Chapter 3 of Design Patterns [Gamma1995] by Erich Gamma et al.This pattern lets you create a transformer without specifiying the concrete implementation class.There are several Java XSLT implementations, such as Xalan and Saxon, so using the Abstract-Factory pattern lets your code be independent of the particular implementation that is configured inyour JDK. Using TrAX therefore makes your code more portable. The servlet uses the servlet context to get input streams for schedule.xml and schedule.xsl. Thistechnique is prefered to directly accessing the file system since these resources might not be available as loose files. For example, the servlet engine may be executing the Web application withoutunzipping its WAR file. The servlet wraps these input streams as TrAX source streams. The servletgets the output writer from the HTTP response and wraps it as a TrAX result stream. The servlet creates a transformer from the schedule.xsl source stream and then applies it to theschedule.xml source stream, writing the HTML output to the response result stream. 8.Select ScheduleServlet.java, right click, and select the Run AS -> Run on Server menu item. The Run On Server wizard opens (see ). Figure 7.67. Define a New Server 1 You now must create a new server configuration. Although you already added Geronimo to your workspace, that just specifies where the runtime is installed. Now you have to create a configuration for it. Recall that a configuration is a list of Dynamic Web projects that will be deployed to the server and some other information such as port numbers. WTP uses the term Server to mean a server configuration. This page of the wizard lets you select the server runtime to use. Since you only have Geronimo(WAS CE) installed, leave that as the select. You can also set this Server to be the default associ- ated with the project. Click Next to continue. The Add and Remove Projects page is displayed (see Figure 7.68, “Add and Remove Projects” ). 10. You can select the Dynamic Web projects to include in the Server. You only have one project available, IceHockyWeb, which has been automatically added for you since it contains the servlet you want to run. Click the Finish button. The wizard creates the Server, starts it, publishes the Ice-HockeyWeb project to it, and launches the Web browser using the URL mapping for the servlet (see Figure 7.69, “ Run On Server -ScheduleServlet.java ” ). As the Server starts, startup messages are displayed in the Console view. 2 The wizard created a special new project named Servers to hold the Server you just created (see Figure 7.70, “Servers Project” ). The new Server is named Apache Geronimo v1.0 Server @ local-host-config . The Server configuration files are normal project resources so you and view and edit them using the WTP editors. Doing so, however, requires a knowledge of server administration. Many of the Geronimo configuration files contain detailed comments to assist you. Consult the Geronimo documentation for more details. Figure 7.70. Servers Project 12.The new Server is also displayed in the Servers view where you can control it using pop-up menu items (see Figure 7.71, “Servers View” ). The Servers view lets you start, stop, and restart servers, optionally in debug mode. You can also create new Servers and add and remove their projects. Creating JSP’s JSP is the J2EE recommended way to dynamically generate Web pages. You will normally use JSP to generate HTML, however you can generate any textual content, XML for example. JSP is a template language. A JSP document consists of template text and JSP markup. The template text is send back to the client unchanged, but the JSP markup is executed on the server and the results are inserted into the output stream. A JSP document has access to Java objects that live in various scopes , including application, session, request, and page. Application-scoped objects are accessible by all pages in the Web application. These are like global variables. Session-scoped objects are accessible by all pages within a single HTTP session. You'll explore session objects in the next two iterations. Request-scoped objects are accessible by all pages within a single request. Typically a servlet will set up request objects and forward the request to a JSP. Page-scoped objects are accessible only within a single JSP. These are like local variables. When a Web browser requests a JSP, the server tranlates it into a Java servlet, compiles it, and then executes it. The fact that JSPs are compiled instead of interpretted makes them very efficient at runtime. The compilation is only done when the JSP is first requested, or if the JSP has been modified since the last request. You can also precompile JSPs into servlets to avoid the overhead of compilation in production. JSP markup consists of directives, tags, and scriptlets. Directives control aspects of the page, such as if it is session aware. Tags are like HTML markup and are suitable for use by non-programmers. Scriptlets consist of arbritary Java source code fragments and are suitable for use by programmers. In general, scriptlets should be kept to a minimum so that the pages can be easily modified by non-programmers. The recommended design pattern for JSP is to use servlets which should handle the requests, perform detail computations, generate results to be displayed, and then forward the request to a JSP for presentation. Another reason to mimimize the amount of Java code in JSP scriplets is that it can't be easily reused elsewhere. You'll have to copy and paste useful scriptlets from one JSP to another. Copy and paste is a bad development practice since it increases code bulk and makes maintentance difficult. If you need to correct an error or make an enhancement, you'll have to locate every JSP that contains the scriptlet. If you find yourself copying and pasting scriplets, you should refactor the common code into Java source sources files so it can be reused across multiple JSPs. A more complete discussion of JSP markup is beyond the scope of this book. See JavaServer Pages [Whitehead2001] by Paul Whitehead or JSP: JavaServer Pages [Burd2001] by Barry Burd for good treatments of this topic. WTP includes a JSP creation wizard and a JSP structured source editor. JSP is actually a very complex source format since it combines HTML, JavaScript, and CSS in the template text with the JSP directives, tags, and scriptlets. The JSP editor provides many advanced features including syntax highlighting and content assist for JSP tags as well as full content assist for Java scriptlets. You can set breakpoints in JSP source files and debug them just like you debug Java code. You can step from the JSP source code into any Java source code called by scriplets and tags. In fact, since JSPs are compiled into servlets, you are debugging Java code. However, the debugger shows you the JSP source code instead of the translated Java servlet code. The mapping from the Java bytecodes back to the original JSP source code has been standardized in JSR 45: Debugging Support for Other Languages [JSR45] . In this iteration you'll develop JSPs that allow League Planet users to log in and out of the Web site. Users are not required to log in, but if they do then additional function is available to them. For example, fans can set up interest profiles and managers can update game schedules and scores. These functions require that users identify themselves to the League Planet Web application. The login state of each user is held in a session variable. We'll discuss the how J2EE manages sessions in the next iteration. To develop the login and logout JSPs, do the following: 1.In the Project Explorer, select the src folder of the IceHockeyWeb project, right click, and select the New->Class menu item to create a Java class named User in the org.leagueplanet package. This class will be used to hold the login state of a user. Edit User.java so that it matches Example 7.13, “Listing of User.java” . User is a simple JavaBean. It contains two properties: a boolean flag that indicates if the user if logged in, and a string that holds the user id. The class also has two methods: one to login and another to logout. Example 7.13. Listing of User.java package org.leagueplanet; public class User { private boolean loggedIn = false; private String userId = ""; public boolean isLoggedIn() {return loggedIn;} public void setLoggedIn(boolean loggedIn) {this.loggedIn = loggedIn;} public String getUserId() {return userId;} public void setUserId(String userId) {if (userId == null) {this.userId = "";} else {this.userId = userId;}} public void logIn(String userId) { setLoggedIn(true); setUserId(userId); } public void logOut() { setLoggedIn(false); setUserId(""); } } 2.Create a new servlet class named LoginServlet in the org.leagueplanet package using the steps you learned in the previous iteration. Map this servlet to the URL /login. Edit LoginServlet.java so that is matches Example 7.14, “Listing of LoginServlet.java” . This servlets handles GET and POST methods. For the GET method, the servlet simply forwards the request to either login.jsp or logut.jsp which you'll create next. The servlet determines the correct JSP by examining the User object in the session. The getUser method retrieves the session object from the request. The boolean true argument on the getSession method causes a new session object to be created if one doesn't already exist. The forward method selects login.jsp if the user is not logged, and logout.jsp if the user is logged in. For the POST message, the servlet looks for an action parameter. If the action if Logout, the servlet logs out the user. If the action is Login, the servlet looks for the userId and password parameters and validates them. The validation logic here is trivial. The userId must be at least two characters long and the password must be guest. In practice, the login request would come over a secure connection and the password would be checked against a database. If a validation error occurs, the error message is attached to the request so login.jsp can display it. The userId is also attached to the request so it can be redisplayed. This illustrates the technique ussing of request-scoped objects. Example 7.14. Listing of LoginServlet.java package org.leagueplanet; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext;import javax.servlet.ServletException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession; /** * Servlet implementation class for Servlet: LoginServlet * */ public class LoginServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { private static final long serialVersionUID = 1L; private User getUser(HttpServletRequest request) { // get the current session or create itHttpSession session = request.getSession(true); // get the user or create it and add it to the sessionUser user = (User) session.getAttribute("user");if (user == null) { user = new User();session.setAttribute("user ", user);} return user; } private void forward(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { User user = getUser(request);String url = user.isLoggedIn() ? "/logout.jsp" : "/login.jsp"; ServletContext context = getServletContext();RequestDispatcher dispatcher = context.getRequestDispatcher(url);dispatcher.forward(request, response); } protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {forward(request, response);} protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { User user = getUser(request); String userId = request.getParameter("userId"); if (userId == null)userId = "";request.setAttribute("userId ", userId); String password = request.getParameter("password");if (password == null)password = ""; String action = request.getParameter("action");if (action == null)action = "Login"; if (action.equals("Logout")) {user.logOut();} else {if (userId.length() < 2) {request.setAttribute("userIdM essage","User id must have at least 2 characters!");} else {if (!password.equals("guest")) {request.setAttribute("passwor dMessage","Wrong password! Try using: guest");} else {user.logIn(userId);}}} forward(request, response); } } 1 Select the WebContent folder, right click, and select the New->JSP menu item. The New JSP wizard opens (see Figure 7.72, “New JSP”). 2 Enter the name login.jsp and click the Next button. The Select JSP Template page of the wizard is displayed (see Figure 7.73, “Select JSP Template” ). Figure 7.73. Select JSP Template 5.The wizard lets you select a template for the style of JSP you want. You can select templates that use the traditional JSP markup syntax and that generate HTML or XHTML pages, or the newer XML-compliant syntax for use with XHTML. Select the New JSP File (html) template and click the Finish button. The wizard creates login.jsp and opens it in the JSP source editor. Edit it so that it matches Example 7.15, “Listing of login.jsp” . Experiment with content assist as you edit. Note the first line of login.jsp which contains a page directive with the session="true" attribute. This enables HTTP session tracking. login.jsp also contains a scriptlet that retrieves the userId and error messages for the request object. The remainder of the login.jsp is HTML template text, except for the small scriplets that write the userId and error messages into the HTML form. This illustrates the technique of server-side validation. Example 7.15. Listing of login"><title>League Planet Login</title><link rel="stylesheet" href="schedule.css" type="text/css"><link rel="stylesheet" href="validator.css" type="text/css"><%String userId = (String) request.getAttribute("userId"); if (userId == null)userId = ""; String userIdMessage = (String) request.getAttribute("userIdMess age");if (userIdMessage == null)userIdMessage = ""; String passwordMessage = (String) request.getAttribute("passwordMes sage");if (passwordMessage == null)passwordMessage = "";%> </head> <body> <h1>League Planet Login</h1> <form action="login" method="post"> <table> <tr><th align="right">User id:</th><td><input name="userId" type="text" value="<%= userId %>"></td><td><span class="validator"><%= userIdMessage %></span></td> </tr> <tr><th align="right">Password:</th><td><input name="password" type="password" value=""></td><td><span class="validator"><%= passwordMessage %></span></td> </tr> <tr><td colspan="2"> </td><td><input name="action" type="submit" value="Login"> <input name="reset" type="reset" value="Reset" /></td> </tr> </table> </form> </body> </html> 6.Create a second JSP named logout.jsp and edit it so that it matches Example 7.16, “Listing of logout.jsp” . logout.jsp also contains a page directive that enables HTTP session tracking. the user session object is retrieved in the HTML <head> element using the <jsp:useBean> tag. The userId is written into the page using the <jsp:getProperty> . Example 7.16. Listing of logout"><jsp:useBean<title>League Planet Logout</title><link rel="stylesheet" href="schedule.css" type="text/css"></head><body><h1>League Planet Logout</h1> <form action="login" method="post"> <table> <tr><th align="right">User id:</th><td><jsp:getProperty</td> </tr> <tr><td colspan="2"></td><td><input name="action" type="submit" value="Logout" /></td> </tr> </table> </form> </body> </html> 7.In the Project Explorer, select the LoginServlet in either the src folder or under the Servlets category of the IceHockey Web item, right click, and select the Run As->Run on Server menu item. The project is published, the server starts, and a Web browser is opened on the URL: The LoginServlet recieves the GET request and forwards it to login.jsp. The Web browser displays the League Planet Login page (see Figure 7.74, “League Plant Login” ). 8.Enter an invalid userId and password and click the Login button to test the server-side validation logic. Enter a valid userId, e.g. anne , and password, i.e. guest, and click the Login button. The Web browser displays the League Planet Logout page (see Figure 7.75, “League Planet Logout” ). Note that logout.jsp correctly retrieved the userId from the session object and displayed it in the Web page. Figure 7.75. League Planet Logout 9.Experiment with debugging by setting breakpoints in the servlet and JSP scriplets, and repeating the above testing. This time select the Debug As->Debug on Server menu item instead of Run As>Run on Server. All the familiar Java debugging views open. At this point you should be comfortable with creating HTML, CSS, JavaScript, XML, DTD, JSP, and servlets in both static and dynamic Web projects. You should also be able to control
https://www.techylib.com/el/view/drivercut/servers_dynamic_web_projects_and_servlets
CC-MAIN-2018-17
refinedweb
5,365
58.79
§Play 2.2 Migration Guide This is a guide for migrating from Play 2.1 to Play 2.2. If you need to migrate from an earlier version of Play then you must first follow the Play 2.1 Migration Guide. §Build tasks §Update the Play organization and version Play is now published under a different organisation id. This is so that eventually we can deploy Play to Maven Central. The old organisation id was play, the new one is com.typesafe.play. The version also must be updated to 2.2.0. In project/plugins.sbt, update the Play plugin to use the new organisation id: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0") In addition, if you have any other dependencies on Play artifacts, and you are not using the helpers to depend on them, you may have to update the organisation and version numbers there. §Update SBT version project/build.properties is required to be updated to use sbt 0.13.0. §Update root project If you’re using a multi-project build, and none of the projects has a root directory of the current directory, the root project is now determined by overriding rootProject instead of alphabetically: override def rootProject = Some(myProject) §Update Scala version If you have set the scalaVersion (e.g. because you have a multi-project build that uses Project in addition to play.Project), you should update it to 2.10.2. §Play cache module Play cache is now split out into its own module. If you are using the Play cache, you will need to add this as a dependency. For example, in Build.scala: val addDependencies = Seq( jdbc, cache, ... ) Note that if you depend on plugins that depend on versions of Play prior to 2.2 then there will be a conflict within caching due to multiple caches being loaded. Update to a later plugin version or ensure that older Play versions are excluded if you see this issue. §sbt namespace no longer extended The sbt namespace was previously extended by Play e.g. sbt.PlayCommands.intellijCommandSettings. This is considered bad practice and so Play now uses its own namespace for sbt related things e.g. play.PlayProject.intellijCommandSettings. §New results structure in Scala In order to simplify action composition and filtering, the Play results structure has been simplified. There is now only one type of result, SimpleResult, where before there were SimpleResult, ChunkedResult and AsyncResult, plus the interfaces Result and PlainResult. All except SimpleResult have been deprecated. Status, a subclass of SimpleResult, still exists as a convenience class for building results. In most cases, actions can still use the deprecated types, but they will get deprecation warnings. Actions doing composition and filters however will have to switch to using SimpleResult. §Async actions Previously, where you might have the following code: def asyncAction = Action { Async { Future(someExpensiveComputation) } } You can now use the Action.async builder: def asyncAction = Action.async { Future(someExpensiveComputation) } §Working with chunked results Previously the stream method on Status was used to produce chunked results. This has been deprecated, replaced with a chunked method, that makes it clear that the result is going to be chunked. For example: def cometAction = Action { Ok.chunked(Enumerator("a", "b", "c") &> Comet(callback = "parent.cometMessage")) } Advanced uses that created or used ChunkedResult directly should be replaced with code that manually sets/checks the TransferEncoding: chunked header, and uses the new Results.chunk and Results.dechunk enumeratees. §Action composition We are now recommending that action composition be done using ActionBuilder implementations for building actions. Details on how to do these can be found here. §Filters The iteratee produced by EssentialAction now produces SimpleResult instead of Result. This means filters that needed to work with the result no longer have to unwrap AsyncResult into a PlainResult, arguably making all filters much simpler and easier to write. Code that previously did the unwrapping can generally be replaced with a single iteratee map call. §play.api.http.Writeable application Previously the constructor to SimpleResult took a Writeable for the type of the Enumerator passed to it. Now that enumerator must be an Array[Byte], and Writeable is only used for the Status convenience methods. §Tests Previously Helpers.route() and similar methods returned a Result, which would always be an AsyncResult, and other methods on Helpers such as status, header and contentAsString took Result as a parameter. Now Future[SimpleResult] is returned by Helpers.route(), and accepted by the extraction methods. For many common use cases, where type inference is used to determine the types, no changes should be necessary to test code. §New results structure in Java In order to simply action composition, the Java structure of results has been changed. AsyncResult has been deprecated, and SimpleResult has been introduced, to distinguish normal results from the AsyncResult type. §Async actions Previously, futures in async actions had to be wrapped in the async call. Now actions may return either Result or Promise<Result>. For example: public static Promise<Result> myAsyncAction() { Promise<Integer> promiseOfInt = Promise.promise( new Function0<Integer>() { public Integer apply() { return intensiveComputation(); } } ); return promiseOfInt.map( new Function<Integer, Result>() { public Result apply(Integer i) { return ok("Got result: " + i); } } ); } §Action composition The signature of the call method in play.mvc.Action has changed to now return Promise<SimpleResult>. If nothing is done with the result, then typically the only change necessary will be to update the type signatures. §Iteratees execution contexts Iteratees, enumeratees and enumerators that execute application supplied code now require an implicit execution context. For example: import play.api.libs.concurrent.Execution.Implicits._ Iteratee.foreach[String] { msg => println(msg) } §Concurrent F.Promise execution The way that the F.Promise class executes user-supplied code has changed in Play 2.2. In Play 2.1, the F.Promise class restricted how user code was executed. Promise operations for a given HTTP request would execute in the order that they were submitted, essentially running sequentially. With Play 2.2, this restriction on ordering has been removed so that promise operations can execute concurrently. Work executed by the F.Promise class now uses Play's default thread pool without placing any additional restrictions on execution. However, for those who still want it, Play 2.1’s legacy behavior has been captured in the OrderedExecutionContext class. The legacy behavior of Play 2.1 can be easily recreated by supplying an OrderedExecutionContext as an argument to any of F.Promise’s methods. The following code shows how to recreate Play 2.1’s behaviour in Play 2.2. Note that this example uses the same settings as Play 2.1: a pool of 64 actors running within Play’s default ActorSystem. import play.core.j.OrderedExecutionContext; import play.libs.Akka; import play.libs.F.*; import scala.concurrent.ExecutionContext; ExecutionContext orderedExecutionContext = new OrderedExecutionContext(Akka.system(), 64); Promise<Double> pi = Promise.promise(new Function0<Double>() { Double apply() { return Math.PI; } }, orderedExecutionContext); Promise<Double> mappedPi = pi.map(new Function<Double, Double>() { Double apply(x Double) { return 2 * x; } }, orderedExecutionContext); §Jackson Json We have upgraded Jackson to version 2 which means that the package name is now com.fasterxml.jackson.core instead of org.codehaus.jackson. §Preparing a distribution The stage and dist tasks have been completely re-written in Play 2.2 so that they use the Native Packager Plugin. Play distributions are no longer created in the project’s dist folder. Instead, they are created in the project’s target folder. Another thing that has changed is the location of the Unix script that starts a Play application. Prior to 2.2 the Unix script was named start and it resided in the root level folder of the distribution. With 2.2 the start script is named as per the project’s name and it resides in the distribution’s bin folder. In addition there is now a .bat script available to start the Play application on Windows. Please note that the format of the arguments passed to the startscript has changed. Please issue a -hon the startscript to see the arguments now accepted. Please consult the "Starting your application in production mode" documentation for more information on the new stage and dist tasks. §Upgrade from Akka 2.1 to 2.2 The migration guide for upgrading from Akka 2.1 to 2.2 can be found here. Next: Play 2.1 migration guide.
https://www.playframework.com/documentation/tr/2.4.x/Migration22
CC-MAIN-2021-43
refinedweb
1,395
51.24
these are the instructions that i was given Write a program that calculates the area of a circle from its radius. The radius will be an integer entered via the keyboard. Use this formula : area = PI * radius2 You will need to use the constant PI which you get by using Math.PI A sample run would look like this : Enter radius : 3 The radius is : 3 The area is : 28.274333882308138 when i try to run the program nothing happens?? cross posted, thanks can someone tell me if my program looks right?? - Java Forums import java.util.Scanner; public class Assign1_Roberts{ public static void main(String[]args){ Scanner input = new Scanner(System.in); //Prompt the user for input final double PI = 3.14159;//Declare a constant //Assign a radius double radius = input.nextInt(); //Compute area double area = radius * radius * PI; System.out.println("Enter radius :" + input.nextInt()); System.out.println("The radius is : " + radius); System.out.println("The area is: " + area); } }
http://www.javaprogrammingforums.com/whats-wrong-my-code/7054-can-someone-tell-me-if-looks-right.html
CC-MAIN-2016-30
refinedweb
161
61.33
In my field, signal processing, Matlab is heavily used, and I see Python as becoming a valid competitor, eventually. However, one of the advantages of Matlab is that it has a just-in-time compiler (JIT), making it much faster. Here, I test to see how much faster. I use Python's JIT, Numba, as well, and also include a C file to compare against. Any file compared is viewable at my GitHub. It's over 800 lines of code, the reason it's not in this notebook. As for overhead, I've tested the notebook GUI out, and there's no added overhead. This notebook is best viewed at nbviewer.ipython.org. My field is called compressed sensing. It's where you reconstruct missing data from existing structure. For example, you know that your signal doesn't have an infinite number of changes. You use this fact to your advantage, minimizing the number of changes an in image. This relies on the fact that many areas in a picture are nearly solidly colored. The algorithm, iterative soft thresholding (IST), is complex, so I'll just show you an example of what it can do. from IST import * I = imread('./lenna.jpg') sample = zeros_like(I) for i in arange(3): x, ys = ISTreal(I[:,:,i], its=100, p=0.5) # takes around 20 minutes on this machine I[:,:,i] = idwt2_full(x) sample[:,:,i] = ys figure(figsize=(14,14)) subplot(121) imshow(sample) axis('off') title('The sampled image') subplot(122) imshow(I) axis('off') title('The reconstructed image') show() As you can see, a fairly good reconstruction. This algorithm is widely used in my field, and is an iterative process, good for testing JITs. So now, we'll get onto the meat of this notebook and test it the speed of this in Python, NumPy, Numba, Matlab and C. Here, we're going to define a several functions (discrete wavelet operations, inverse and forward), then test the iterative soft thresholding (IST). You can see all the declarations in the GitHub repo. This pure python module uses for-loops as well as Numpy, but Numpy is famously bad at for-loops. %%capture string import ISTpython as ISTp #%timeit ISTp.IST() # it takes a long time for this to finish #print string.stdout #python = float(string.stdout.split()[-4]) string = '1 loops, best of 3: 283 s per loop' print string python = float(string.split()[-4]) 1 loops, best of 3: 283 s per loop The only change we make is that we vectorize our for-loops in our two fundamental functions (done thanks to a Reddit comment. Instead of for i in arange(16): y[i] = x[2*i] + x[2*i+1] y[i+l] = x[2*i] - x[2*i+1] we have i = arange(16) y[i] = x[2*i] + x[2*i+1] y[i+l] = x[2*i] - x[2*i+1] I also vectorized dwt2 and idwt2, a more difficult task. I had to use zeros_like, not zeros(len(x)). %%capture string import IST as ISTnumpy %timeit ISTnumpy.IST() print string.stdout numpy = float(string.stdout.split()[-4]) 1 loops, best of 3: 3.1 s per loop %%capture string import ISTnumba %timeit ISTnumba.IST() print string.stdout numba = float(string.stdout.split()[-4]) 1 loops, best of 3: 3.28 s per loop string = !matlab -nodisplay -nosplash -r "run IST.m; exit" string = string[-1] print string matlab = float(string.split()[-2]) Elapsed time is 12.505537 seconds. !gcc IST.c -o IST.o string = !time ./IST.o c = float(string[1].split()[1][2:-1]) print "Total time in seconds: ", c Total time in seconds: 0.976 !gcc -O2 IST.c -o IST_O2.o string = !time ./IST.o c_O2 = float(string[1].split()[1][2:-1]) print "Total time in seconds: ", c_O2 Total time in seconds: 0.979 !gcc -O3 IST.c -o IST_O3.o string = !time ./IST_O3.o c_O3 = float(string[1].split()[1][2:-1]) print "Total time in seconds: ", c_O3 Total time in seconds: 0.513 !llvm-gcc -O3 IST.c -o IST_llvm.o string = !time ./IST_llvm.o c_llvm = float(string[1].split()[1][2:-1]) print "Total time in seconds: ", c_llvm Total time in seconds: 0.495 !mpicc -O3 ISt.c -o ISTparallel.o string = !time ./ISTparallel.o mpicc = float(string[1].split()[1][2:-1]) print "Total time in seconds: ", mpicc Total time in seconds: 0.494 from pylab import * labels = ['python', 'numpy', 'numba', \ 'matlab', 'gcc', 'gcc --O2', \ 'gcc --O3', 'llvm --O3'] timings = [python, numpy, numba, matlab, c, c_O2, c_O3, c_llvm] x = np.arange(len(labels)) # plotting from slowest to fastest i = argsort(timings) timings = sort(timings)[::-1] labels = asarray(labels) labels = labels[i][::-1] fastest = timings[-1] figure(figsize=(10,10)) matplotlib.rcParams.update({'font.size': 15}) ax = plt.axes(xticks=x, yscale='log') ax.bar(x - 0.3, timings, width=0.6, alpha=0.4, bottom=1E-6) ax.grid() ax.set_xlim(-0.5, len(labels) - 0.5) ax.set_ylim(1E-1, python*1.3) ax.xaxis.set_major_formatter(plt.FuncFormatter(lambda i, loc: labels[int(i)])) ax.set_ylabel('\\textrm{time (s)}') ax.set_title("\\textrm{Iterative Soft Thresholding}") show() And zooming closer in on the range we're interested in, and doing those comparisions... (with a linear, not log, scale!) labels = ['numpy', 'numba', 'matlab'] timings = [ numpy, numba, matlab] x = np.arange(len(labels)) # plotting from max to min times i = argsort(timings) timings = sort(timings)[::-1] labels = asarray(labels) labels = labels[i][::-1] ax = plt.axes(xticks=x)#, yscale='log') ax.bar(x - 0.3, timings, width=0.6, alpha=0.4, bottom=1E-6) ax.grid() ax.set_xlim(-0.5, len(labels) - 0.5) ax.set_ylim(0, 1.05*max(timings)) ax.xaxis.set_major_formatter(plt.FuncFormatter(lambda i, loc: labels[int(i)])) ax.set_ylabel('\\textrm{time (s)}') ax.set_title("\\textrm{Iterative Soft Thresholding}") show() print "C comparisions:" print "NumPy / C :", numpy / fastest print "Numba / C :", numba / fastest print "Matlab / C :", matlab / fastest print "\nThe comparision that we care about, NumPy and Matlab:" print "Matlab / NumPy: ", matlab / numpy print "Matlab / Numba: " , matlab / numba C comparisions: NumPy / C : 6.26262626263 Numba / C : 6.62626262626 Matlab / C : 25.2637111111 The comparision that we care about, NumPy and Matlab: Matlab / NumPy: 4.03404419355 Matlab / Numba: 3.81266371951 It should be noted that Matlab has had a JIT compiler since 2002, and Numba is a recent development that was only started a year ago (in Mar. 2012). My sense is that it will go the way of IDL, another high-level and technical programming language that cost thousands, and is all but extinct now. The freedom for anyone to run your code and encourages collaboration, the reason I don't think Python will go the way of Matlab. As it stands, autojit doesn't add much if anything when the code depends on low level libraries. Because your code is only fast if it's optimized, it's hard to program. For example, while prototyping code, I had to depend on a for loop in Python -- something really slow, meaning it took me about 30 minutes to get feedback/results. The same code in Matlab would have been much, much faster since this test is essentially the same code as plain Python. For prototyping, I say use Matlab. Will I still write my final programs in Python? Yes. Will I still write sk-learn functions? Yes. Do I like using Matlab? No.
https://nbviewer.ipython.org/github/scottsievert/side-projects/blob/master/matlab_vs_python/Python%20vs%20Numba%20vs%20Matlab%20vs%20C.ipynb
CC-MAIN-2021-49
refinedweb
1,241
69.48
14 December 2007 16:16 [Source: ICIS news] LONDON (ICIS news)--Deutsche Bank on Friday said Dow Chemical faced a significant challenge in finding a viable acquisition target with its joint venture (JV) proceeds, due to the highly priced M&A environment.?xml:namespace> Dow announced plans to put several petrochemical businesses in a 50/50 JV with ?xml:namespace> “Dow faces a significant challenge in deploying $7bn of cash from this transaction into a highly priced acquisition environment,” said Deutsche Bank analyst David Begleiter in a note to investors. Dow’s shares surged over 6% after the JV announcement, with the company hitting a market capitalisation of around $42bn. “While we believe Dow's petrochemical JV with a subsidiary of Kuwait Petroleum Corp is positive on a number of fronts, we believe much of the immediate value creation of $3.5bn was priced in by yesterday's $2.5bn increase in Dow's market cap,” said Begleiter. However, Dow was expected to benefit from longer term value creation from the JV and multiple expansion from a more stable earnings profile, Begleiter added. Dow will contribute its polyethylene, polypropylene, polycarbonate and amines business to the JV with 2006 total sales of $11bn and $2.5bn in earnings before interest, tax, depreciation and amortisation (EBITDA). The deal is expected to close in late 2008. The bank maintained its ‘hold’ rating on Dow Chemical shares with a price target of $47.00. At 10:30 EST, Dow Chemical shares were valued at $43.13 on New York Stock Exchange - nearly 3% lower than Th
http://www.icis.com/Articles/2007/12/14/9087097/dow-faces-challenge-to-find-m.html
CC-MAIN-2013-48
refinedweb
262
53.71
Configuration¶ Introduction¶ When you use a Morepath directive, for example to define a view, a path, a setting or a tween, this is called Morepath configuration. Morepath configuration can also be part of third-party code you want to use. How it works¶ Morepath needs to run. Scanning dependencies¶ Morepath is a micro-framework at its core, but you can expand it with other packages that add extra functionality. For instance, you can use more.chameleon for templating or more.transaction for SQLAlchemy integration. These packages contain their own Morepath configuration, so when we use these packages we need to make sure to scan them too. Manual scan¶ The most explicit way of scanning your dependencies is a manual scan. Say you depend on more.jinja2 and you want to extend the the first example. This is what you do: import more.jinja2 if __name__ == '__main__': morepath.scan(more.jinja2) # scan Jinja2 package morepath.scan() # scan this package App.commit() application = App() morepath.run(application) As you can see, you need to import your dependency and scan it using scan(). If you have more dependencies, just add them in this fashion. Automatic scan¶ Manual scanning can get tedious and error-prone as you need to add each and every new dependency that you rely on. You can use autoscan() instead, which scans all packages that have a dependency on Morepath declared. Let’s look at a modified example that uses autoscan: if __name__ == '__main__': morepath.autoscan() morepath.scan()', 'morepath' ]) with the code in a Python package called myapp (a directory with an __init__.py file in it). See Organizing your Project for a lot more information on how to do this, including tips on how to best organize your Python code. Once you put your code in a Python project with a setup.py, you can simplify the setup code to this: if __name__ == '__main__': morepath.autoscan() App.commit() morepath.run(App()) morepath.autoscan() makes sure to scan all packages that depend on Morepath directly or indirectly. Writing scannable packages¶ A Morepath scannable Python package has to fulfill a few requirements. The package must be made available using a setup.pyfile. See Organizing your Project and the Setuptool’s documentation for more information. The package itself or a dependency of the package must include morepathin the install_requireslist of the setup.pyfile. Morepath only scans package that depend directly or indirectly on Morepath. It filters out packages which in no way depend on Morepath. So if your package has any Morepath configuration, you need to add morepathto install_requires: setup(name='myapp' ... install_requires=[ 'morepath' ]) If you set up your dependencies up correctly using install_requiresthis should be there anyway, or be a dependency of another dependency that’s in install_requires. Morepath just uses this information to do its scan. The Python project name in setup.pyshould have the same name as the Python package name, or you use entry points to declare what should be scanned. Scan using naming convention: The project name defined by setup.pycan be imported in Python as well: they have the same name. For example: if the project name is myapp, the package that contains your code must be named myappas well. (not my-appor MyAppor Elephant): So if you have a setup.pylike this: setup( name='myapp', packages=find_packages(), ... you should have a project directory structure like this: setup.py myapp __init__.py another_module.py In other words, the project name myappcan be imported: import myapp If you use a namespace package, you include the full name in the setup.py: setup( name='my.app' packages=find_packages() namespace_packages=['my'] ... This works with a project structure like this: setup.py my __init__.py app __init__.py another_module.py We recommend you use this naming convention as your Python projects get a consistent layout. But you don’t have to – you can use entry points too. Scan entry points: If for some reason you want a project name that is different from the package name you can still get it scanned automatically by Morepath. In this case you need to explicitly tell Morepath what to scan with an entry point in setup.py: setup(name='elephant' ... entry_points={ 'morepath': [ 'scan = my.package' ] } Note that you still need to have morepathin the install_requireslist for this to work.
http://morepath.readthedocs.io/en/latest/configuration.html
CC-MAIN-2017-22
refinedweb
716
68.16
The Crazy and Wonderful State of Web Development A brief look at where we’ve been, where we‘re going, and how to stay sane along the way. One of my students pointed me towards an article on Medium that lamented the complex and fast-paced progress in web development. While I can certainly understand the frustration of that author (a frustration I’ve heard echoed by many others), I want to offer a different perspective. As you read this article, I want you to realize two things. First, even though I’m writing about these things linearly, most of these developments were happening simultaneously. Second, this isn’t meant to be an exhaustive treatment of the history of web development technology. My goal in writing this was to help illustrate both how far we’ve come, and far we still have to go. If I left out your favorite technology, please give it a shout out in the comments. In the Beginning I started doing web development work in the mid 90’s. CSS and JavaScript had just come onto the scene. Most people had begun to gravitate away from nested frames, and the current debates were all about table-based vs div-based layouts. Most of us saw the sense in div-based design, but while it was a fantastic idea, the patchy browser support for CSS made it impossible to rely on for anything but trivial styling. So we were forced to continue using tabular layouts, even though we all pretty much agreed that they were suboptimal. So we continued to slice up our images into 9-parts, adjusted the cell spacing, and possibly adding some transparent images in various cells, in order to prevent certain browsers from collapsing them. But, even though it would take hours to handcraft the simplest designs and make sure they worked decently well across all major browsers, we were happy because we were creating things that anyone on the planet could see. The Demand for Interactivity Meanwhile, the desire to make web pages more interactive was growing. JavaScript had been on the scene for a while, but as with CSS, browser support was so bad that it was tough to rely on JavaScript for anything but the most trivial uses. So, we looked elsewhere for interactivity. Browser-hosted application frameworks like Flash and Java had begun to rise in popularity. Suddenly you could develop a full-fledged, interactive application or game, and then deploy it over the web. We even had something called Shockwave, though many of us couldn’t keep the differences between Shockwave and Flash straight in our minds. This was pretty exciting stuff. The only trouble was, you had to make sure the user’s browser supported the necessary 3rd party plug-ins to make this technology work, and that they had installed the right versions of those plug-ins. But, that was okay, because now, instead of just having tinny-sounding midi files playing on our Geocities sites, we could have real audio and video files. Suddenly, everyone in the world could watch creepy videos of dancing babies! Using Flash meant working with ActionScript, while Java was its own language, one that seemed to be obsessed with patterns of use that seemed new and foreign to many of us. Microsoft offered a proprietary solution using DHTML and JScript, and since they had the most dominant browser, many companies opted for this technology, leading to the proliferation of the popular error message, “This site has been designed to work for Internet Explorer”. But even though we had to fight with new, proprietary languages, deal with plugin versioning conflicts and security restrictions, and make tough decisions about browser support, our websites were more interesting than ever. Talking to Servers Meanwhile, there was a growing demand to let our websites pull information from the server dynamically, which usually involved communication with a database. As demand for this type of interaction grew, things really began to fracture. Most of us were tired of dealing with perl-based cgi-bin scripts by this point, and so we were all happy to see some innovation on this front. The major players in this area were ASP, PHP, JSP, and ColdFusion. All of these technologies followed the same basic model of allowing you to embed database query and processing logic right in the page. After the client requested the page, the logic would be executed, the data populated, and the page served. Soon, we were moving beyond what we could do with simple cookies and having real, server-stored session state. E-commerce hit its heyday as it was suddenly easy to present a large, online catalog and deal with payment processing. Who cared if the user’s browser didn’t support some aspect of JavaScript, we’d just let the server handle it all! But there were problems…so many problems. First, choosing a vendor tied you not just to that technology, but also dictated which web server and database technologies were available to you. Second, we suddenly had to deal with things like web security, caching, load-balancing, and a dozen other things none of us had ever thought much about before. But even though we were dealing with even more proprietary technologies and the headaches that came with them, now the data we used to have to painstakingly handcode into HTML was being pulled from the server dynamically! CSS Strikes Back While all of this was happening, browser vendors were listening to the pleading of web developers to make it easier to style their pages. Cross-browser support for CSS was finally at a state where it was viable to use. As new browsers came into being, one of the things they often promised was greater support for web standards like CSS. Now, everybody who was anybody was separating their design from their markup. CSS ZenGarden came on the scene, showing us ways to push the boundaries of what CSS offered. We still had cross-browser support issues, and dealing with relative and fixed positioning was often painful, but design changes became easier to manage than ever before. XML While all of this was going on, people were trying to decide the best way to transfer large amounts of data. XML had been around for a couple of years, but there was some general confusion about what it was. Books like “Programming XML” helped to spread the confusion about the purpose of this new technology. But, SOAP and XML-RPC were becoming the new way to send data around the web, so it became important to understand this format and how to use it. So, we had to deal with not just XML but, XML namespaces and DTDs, and learning to turn XML into HTML using XSLT and XPath, and suddenly it was X-this and X-that and before we knew it, XML was everywhere. Now we had the ability to transfer a hundred bytes of data with just a few kilobytes of markup and a few more kilobytes of post-processing scripts and data queries, but we had structured data locked into a predictable, parsable format, so we were pretty happy with that. AJAX and the Resurgence of JavaScript While all of that was going on, everyone started to buzz about something called AJAX, a way to communicate with the server asynchronously without having to reload the entire page. It used JavaScript and XML to accomplish this magic, but as with all things JavaScript, cross-browser support was still pretty spotty. So we had to write a bunch of boiler-plate code to make the request in a way that would work across all of the major browsers. But this was asynchronous data retrieval! Who cared if it took dozens of lines of horrible-looking JavaScript to make it work. Sure, we had to deal with XML again, but we’d been down that road, we could handle the pain for the sake of asynchronous partial page updates. Then people started wondering if there was a better alternative to XML, and JSON began to rise in popularity. It was lean and worked great with the RESTful web services that everyone was discussing as an alternative to SOAP. Yes, we still had major issues with cross-browser support, and our web services now had to emit multiple data formats, but our webpages were so much more responsive, and we could connect remote data stores in new and exciting ways. JavaScript Starts to Grow Up The adoption of AJAX seemed to open a floodgate of JavaScript development. Amazing libraries like jQuery were developed to help abstract away the cross-browser issues we all hated to deal with. Eventually, as browser-support for JavaScript became better and better, and vendors like Google put real effort into optimizing their JavaScript engines, suddenly, a new vista opened up in the world of web development: pure JavaScript. We suddenly had access to a dynamic scripting language that worked pretty well on every browser, which meant we could develop real web apps used by everyone, but nobody was completely sure how they should be architected. As languages evolve, community-sanctioned best-practices tend to coalesce around them. But with JavaScript, everything was happening so fast, and the language had such a long and confusing history, that people started to run in a bunch of different directions. Eventually, a set generally accepted ideas started to emerge. Douglas Crockford wrote JavaScript the Good Parts, people began to develop utility libraries like underscore and backbone, and to migrate away from big toolsets like jQuery towards “pure JavaScript”. Even StackOverflow users had stopped saying “use jQuery” in response to every JavaScript question. Suddenly, things we used to write as ad-hoc, almost throw-away scripts had to be considered in light of the larger architecture. This required learning about and adopting new patterns. But, as we adopted these ideas, our code became more modular and maintainable in the long run. The Rise of the Web Frameworks Now things began to really move forward. With the rise of resources like GitHub and GitHub Pages, it was easier than ever to create a new JavaScript framework and share it with the world. People began to discuss the best ways to implement JavaScript for large-scale projects. People began discussing new, JavaScript-specific design patterns like IIFE, Modules, and more. Hundreds of frameworks like Ember, Meteor, Angular, and many others, rose and fell around these ideas as people looked for the best abstractions to use when structuring large-scale web apps. The idea of using MVC and single-page apps developed, and suddenly we had a whole host of frameworks being developed to help us follow this design. There were tons of choices before us now, loads of frameworks to explore, all of which approached web app architecture in slightly different ways. The number of possible ways to structure an app became staggering, but our web apps were better than ever, and the frameworks abstracted away so many of the cross-browser nightmares we’d been dealing with for so long. Making Things Look Better Meanwhile, browser-based visualization technologies like SVG had gained in popularity, allowing things like the amazing D3 framework. Eventually, HTML5 and CSS3 had reached a high enough adoption level that we could create beautiful interactive visualizations without using plug-in based tools like Flash or Java. CSS preprocessors like Sass and Less become mainstays in web development, allowing us to optimize and modularize even our CSS files. As mobile devices became one of the major clients of websites, new responsive frameworks like Foundation and Bootstrap emerged to help us deal with issues like “mobile-first web design”. We’ve went from a deluge of Times New Roman and Arial-based text, to a huge array of typography choices thanks to resources like Google Fonts, TypeKit, FontAwesome and GlyphIcons. And yes, even though it seems like Flat design just won the war with Skeuomorphic, and we’re now debating Flat vs Material, that’s okay, because our websites are looking better and better. Server-Side JavaScript While all this that was happening, people began thinking about using JavaScript across the entire stack, not just for client-side scripting, but for the server-side as well. The appeal of having a unified language across the stack was so strong, this idea gained traction very quickly. With the adoption of MongoDB, we suddenly had things like the MEAN stack as a replacement for LAMP, where we could use JavaScript not just on the web server and client, but in the database as well! The entire development stack could now be written in a single language! As people used these various frameworks and combinations of frameworks, they began to run into things they didn’t like. Shortcomings in the abstractions, tradeoffs between convention vs configuration, and architectural constraints they didn’t want to deal with. So, developers took their favorite parts of the existing frameworks and began working on the next generation, leading to the creation of frameworks like React and Angular 2. Then people wanted to bring some of the best ideas from functional programming into the mix, and frameworks like Immutable and Redux were created and began to gain in popularity. This new generation of frameworks gave rise to the MERN stack as a replacement for MEAN, and on and on and on… Today it seems like there are new frameworks appearing every week, along with an accompanying set of new design patterns. Every few months, new tools like Gulp, Grunt, NPM, and Webpack emerge to help us manage the complexity of our development cycle. During this time, people were also lauding the upcoming release of ECMAScript, which was once based on JavaScript, but has advanced so much that now JavaScript is based on it. And people are so excited to use these features before they’re released and adopted by major browser vendors that they have developed frameworks like Babel, which allow you to “transpile” your ES6 code to browser-compatible JavaScript. We have amazing frameworks like socket.io that allow us to use advanced technologies like websockets, even where they haven’t been fully implemented by browser vendors. And then, just as you think you’ve gotten a handle on everything, people start talking about Isomorphic JavaScript, where the same code is used on the client and the server. And you’re either super excited, or you’re ready to throw in the towel and go back to C++ programming, where the biggest innovation you have to worry about is Boost. Advice for Staying Sane And so it goes, on and on. Five years from now, people will look at React and Node and Sass and chuckle at the “good old days” as they work on web development in whatever new and exciting form it has taken. So yes, there is complexity, and sometimes the complexity can seem staggering and overwhelming. But here are a few quick tips I use to stay sane: Remember where we’ve come from, because that puts the current state of the art in the proper perspective. Why are we so excited about React? Because of where we were with Angular. Why were we excited about Angular? Because of where we were with the previous generation of dynamic DOM manipulation tools. You don’t have to learn every single new framework that exists in the community. Don’t feel like you have to be what Jeff Atwood refers to as a “Magpie Developer”. I never looked at Meteor JS, because I never needed to. I used Ember quite a bit, but didn’t use Angular very much. I never used backbone.js at all. If you’re going to chase frameworks, focus on major paradigm shifts. Angular/Ember/Other MVC frameworks were all basically doing different versions of the same thing. The same could be said for ASP/PHP/JSP/ColdFusion. But just as Angular and friends were big paradigm shifts compared to developing with PHP, so React is a big paradigm shift compared to Angular. Don’t rewrite your old stuff just for the sake of rewriting it. My favorite development stack right now is Node + React + Redux + Immutable. But I have plenty of PHP-based projects that I have no plan to rewrite in that stack. If your goal is to gain experience or try out a new technology, then you should absolutely use the technology to create a new project, or port a small project to it. Don’t think for a minute that rewriting your “legacy” Angular code using React is going to somehow help you gain more customers or dramatically increase your profit margins. There are plenty of major companies still doing quite well with the LAMP stack. Your customers don’t care what framework you use. When people go to your site to read your content or purchase your product, they don’t care if you’re using immutable data structures, a CSS preprocessor, or a proper MVC architecture. For all they know, you’ve got a team of people in a basement somewhere, manually updating <font> tags on all of your pages. VC’s don’t care which framework you use. If a major part of your VC elevator pitch centers around the technology stack you’re using, you’ve probably already lost. Conclusion Web development trends seem to come and go at breakneck speed. When you’re feeling overwhelmed by the latest framework of the week, take a deep breath, and look at it objectively. If it looks like a major paradigm shift that excites you, jump in and explore it. If not, ignore it for now, and wait for the next one. Remember why you got into web development in the first place. Remember how far we’ve come, and how far we still have to go. As I mentioned at the start, if I left out your favorite technology or web dev headache, please give it a shout out in the comments.
https://medium.com/@lee.falin/the-crazy-and-wonderful-state-of-web-development-5baa373a1ea2?source=---------2------------------
CC-MAIN-2020-10
refinedweb
3,019
58.72
Disclaimer The Buzz library is just for experimental use only, and is not intended for providing a home/business security solution. Explanation Due to the ATMega328p's ADC being very high impedance, it can easily detect the AC electricity waves that leak into the air via open outlets, bad shielding, and more. When something statically charged (human, pet, blanket, etc.) passes near the antenna, it increases or decreases the voltage perceived at the input. Even without rubbing a balloon on your head, you'll always have enough static charge to affect this value a measurable amount. The Buzz library allows you to easily monitor these changes, and attach your own functions that will execute when motion exceeds a specified threshold. Usage Using the Buzz library is very simple, you only need the following to get started: #include "Buzz.h" // Include the Buzz library Buzz buzz; void setup() { Serial.begin(115200); buzz.begin(A0,60,3000); } void loop() { Serial.println(buzz.level()); delay(1); } Next, connect a wire/jumper (6-12") to pin A0, and open the Arduino IDE's Serial Plotter to see the current motion value! Try waving your hand near the antenna, or walking past it. I'm doing home-based scientific research on static electricity and why people believe they see ghosts. I think it is possible to measure if static can affect a humans sensory systems. I'm trying to develop the instrumentation to do this using an Raspberry Pi 3B+ board, but, I also have an Arduino Uno I have never used. Do you think it could be adapted to this project. (I have no experience with these. I'm 59 and just want to learn how to use them so I can do the stuff like my research.) Any help would be great.
https://hackaday.io/project/11982-detecting-motion-with-acstatic-electricity
CC-MAIN-2019-30
refinedweb
299
64.3
In one of my previous articles, we examined how we can use JSX in Vue.js to export multiple Vue.js components from a single Single File Component (SFC) .vue file. Just recently I found an even easier solution to this problem. Although it can be very useful to use JSX for simple UI components, as I described in my article, there are also some drawbacks to this approach. First, JSX doesn’t feel very natural in a Vue.js environment, and second, you lose many of the advantages of Vue.js Single File Components, such as scoped styles. Proxy exports The concept I’ve come up with is quite simple: All components live in their own SFC, but there is one master component that proxies all associated components. Let’s say we have a custom form and we want to split it up into multiple components for each part of the form. components ├─ FancyTable.vue ├─ FancyTableBody.vue ├─ FancyTableCell.vue ├─ FancyTableHead.vue └─ FancyTableRow.vue If we now want to use these generic form components to create a new, more specific component like a DataList component, it would look something like this. <template> <FancyTable> <!-- ... --> </FancyTable> </template> <script> // src/components/DataList.vue import FancyTable from './FancyTable.vue'; import FancyTableBody from './FancyTableBody.vue'; import FancyTableCell from './FancyTableCell.vue'; import FancyTableHead from './FancyTableHead.vue'; import FancyTableRow from './FancyTableRow.vue'; // ... </script> Let’s improve this somewhat by updating our FancyTable component to serve as a proxy component that also exports all associated components. <template> <table class="FancyTable"> <slot/> </table> </template> <script> // Export the root component as named export. export const FancyTable = { name: 'FancyTable', // ... }; // Proxy export all related components. export { default as FancyTableBody } from './FancyTableBody.vue'; export { default as FancyTableCell } from './FancyTableCell.vue'; export { default as FancyTableHead } from './FancyTableHead.vue'; export { default as FancyTableRow } from './FancyTableRow.vue'; // A Vue.js SFC must have a default export. export default FancyTable; </script> Now our FancyTable component serves as a proxy for all related subcomponents. Shout-out to Philipp Kühn for showing me this shortened export / from syntax. Do you want to learn more about advanced Vue.js techniques? Register for the Newsletter of my upcoming book: Advanced Vue.js Application Architecture. <template> <FancyTable> <!-- ... --> </FancyTable> </template> <script> // src/components/DataList.vue import { FancyTable, FancyTableBody, FancyTableCell, FancyTableHead, FancyTableRow, } from './FancyTable.vue'; // ... </script> As you can see above, we now only have to use one import statement to import all parts of the table we need to build our DataList component. Wrapping it up The benefits of this approach are most likely not a big deal, but in my opinion it can still be a useful improvement in certain situations. Situations in which I already use this pattern are for generic table components such as in the example above and also for form components such as various types of input and general form layout components.
https://markus.oberlehner.net/blog/multi-export-vue-single-file-components-with-proxy-exports/
CC-MAIN-2020-50
refinedweb
474
50.94
IC. Put simply, new domains will be able to make use of nearly any string of letters—including common file extensions such as .exe, .doc, and .pdf—but there will be a number of other restrictions. Why is this important? Currently, there is no way for organizations to apply for new TLDs whenever they want, as ICANN's Jason Keenan pointed out to us in November. In order to get approved, domains must go through a round of ICANN applications when such a round is open (you cannot apply for a new domain today, for example). The policies for 2008's round are being developed by ICANN's Generic Names Supporting Organization (GNSO) in such a way that the process for approval will be streamlined, and the GNSO expects to see a large number of new applicants. The GNSO acknowledges that such potentially large expansion of TLDs could impact the stability of the current DNS system (which currently only needs to handle a handful of TLDs). "The addition of gTLDs to the namespace is an expansion of the DNS on a potentially large scale, to include many more names at the top level," wrote the GNSO in its paper last week. "Strings must not cause any technical instability." As a result, the group has put together a number of recommendations for what is and isn't acceptable as a gTLD. First, gTLDs must conform to all existing syntax rules which forbid the use of blank spaces as part of a name, specify that TLDs are not case-sensitive, and stipulate that the first character must be a letter from the Latin alphabet. But the GNSO also recommends that ICANN prohibit gTLDs that are entirely numeric in order to avoid confusion with IP addresses, which are also numeric and separated by dots. Extensions beginning with "0x" and followed by another hexadecimal character should also be prohibited, GNSO says, because they could be confused for a hex string that is usually converted to an IP address. When it comes to certain string combos, though, the organization says that it has given considerable thought to whether certain popular file extensions should be prohibited. GNSO points out that browsers would need to be able to identify the difference between a domain ending in, for example, .pdf and a link to a file that has the extension of .pdf, but says that this would need to be a function of the application and not the DNS system. There's also a much greater danger of user confusion when it comes to using common file extensions, but GNSO says that the task of determining exactly which extensions are "too popular" would be a rather large one that can't yet be addressed. "If ICANN wished to prevent potentially significant problems in the application layer or avoid user confusion issues resulting from a string like .EXE, it would need to do so based on a defined list of extensions that were disallowed, a list maintained outside of ICANN and internationally recognized as the authoritative source for 'commonly used file extensions,'" wrote the organization. "Additionally, a mechanism for maintaining and updating such a list would need to be in place, because new file extensions could become prevalent at any time. To date, staff has not been able to locate a list of common file extensions that is generally acknowledged to be authoritative." These guidelines are not yet set in stone, and ICANN is soliciting feedback on the proposed rules from the community. If you have comments, they can be sent to new-gtlds-dns-stability@icann.org and viewed on ICANN's forum. Further reading: You must login or create an account to comment.
http://arstechnica.com/uncategorized/2008/02/icann-tlds-could-end-with-exe-confused-users-may-be-too/
CC-MAIN-2014-52
refinedweb
616
56.49
It is important to learn about the foundations in each area. You need to have basic information to be a professional. Good usage of tools is almost as important as the foundation. Without good tools, your foundation won't be used well. This chapter is about tools that will help to build better CSS code. It describes features of preprocessors and finally the foundation knowledge about SASS. In this chapter, you can get basic knowledge about automatization of repeatable processes in frontend development with GULP.js. Finally, you can find an example of file structure, which will partialize your project into small, easy to edit, and maintainable files. In this chapter, we will: Create a CSS project with a proper structure. Building CSS code is pretty simple. If you want to start, you just need a simple text editor and start writing your code. If you want to speed up the process, you will need to choose the right text editor or integrated development environment (IDE). Currently the most popular editors/IDEs for frontend developers are as follows: Sublime Text Atom WebStorm/PHPStorm Eclipse/Aptana Brackets Your choice will be based on price and quality. You should use the editor that you feel most comfortable with. When you are creating a code, you have parts of codes that you repeat in all projects/files. You will need to create snippets that will help you to speed up the process of writing code. As a frontend developer, I recommend you to get a basic knowledge about Emmet (previously Zen Coding). This is a collection of HTML/CSS snippets, which will help you build code faster. How to use it? It is basically included in modern frontend editors (Sublime Text, Atom, Brackets, WebStorm, and so on). If you want to check how Emmet works in CSS you need to start a declaration of some class for example .className, open the brackets ( {}) and write for example: pl Then press the Tab button, which will trigger the Emmet snippet. As a result, you will get the following: padding-left Following are examples of the most used properties and values: For a better understanding of Emmet and to get a full list of features, it is recommended to check the official website of the project at:. Do you remember when you learned the most impressive keyboard shortcuts Ctrl + C ,Ctrl + V? It helped you to save about 2 seconds each time you wanted to make an operation of copying and pasting some text or any other element. But what about automizing some processes in building code? Yeah, it's going to be helpful and you can do it with keyboard shortcuts. Shortcuts that you should know in your IDE are as follows: Duplicating line Deleting line Moving line Formatting code To test your code, you will need all the modern web browsers. In your list, you should have the following browsers: Google Chrome (newest version) Mozilla Firefox (newest version) Mozilla Firefox developers edition (newest version) Opera (newest version) Safari (newest version) Internet Explorer Internet Explorer (IE) is the biggest issue in frontend developers' lives because you will need a bunch of IEs on your machine, for example, 9, 10, and 11. The list is getting smaller because back in the days the list was longer. IE6, 7, 8, 9, and so on. Now IE6, 7, and 8 are mostly not supported by the biggest web projects like YouTube and Facebook. But it sometimes occurs in big companies in which the changing of operating systems is a pretty complicated process. To easily test your code on a bunch of browsers, it is good to use online tools dedicated for this test: But an easy and free way to do it is to create a virtual machine on your computer and use the system and browser which you need. To collect the required versions of IE, you can refer to. With modern.ie, you can select the IE version you need and your version of virtual machine platform (VirtualBox, Parallels, Vagrant, VMware). Dealing with HTML and CSS code is almost impossible nowadays without inspector. In this tool, you can see the markup and CSS. Additionally, you can see the box model. This is well known too in browsers for web developers. A few years ago, everybody was using Firebug dedicated for Firefox. Now each modern browser has its own built-in inspector, which helps you to debug a code. The easiest way to invoke inspector is to right-click on an element and choose Inspect. In Chrome, you can do it with a key shortcut. In Windows, you have to press F12. In MAC OSX, you can use cmd + alt + I to invoke inspector. A preprocessor is a program that will build CSS code from other syntax similar or almost identical to CSS. The main advantages of preprocessors are as follows: Code nesting Ability of using variables Ability of creating mixins Ability of using mathematical/logical operations Ability of using loops and conditions Joining of multiple files Preprocessors give you the advantage of building code with nesting of declarations. In simple CSS, you have to write the following: .class { property: value; } .class .insideClass { property: value; } In the preprocessor, you just need to write the following: .class { property: value; .insideClass { property: value; } } Or in SASS with the following indentation: .class property: value .insideClass property: value And it will simply compile to code: .class { property: value; } .class .insideClass { property: value; } The proper usage of nesting will give you the best results. You need to know that good CSS code. In good CSS code, there is no possibility to use variables in all browsers. Sometimes you are using same value in the few places, but when you have change requests from client/project manager/account manager, you just immediately need to change some colors/margins, and so on. In CSS, usage of variables is not supported in old versions of Internet Explorer. Usage of variables is possible with CSS preprocessors. In classic programming language, you can use functions to execute some math operations or do something else like displaying text. In CSS, you haven't got this feature, but in preprocessors you can create mixins. For example, you need prefixes for border-radius (old IE, Opera versions): -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; You can create a mixin (in SASS): @mixin borderRadius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius; } @include borderRadius(20px) In preprocessors, you can use math operations like the following: Addition Subtraction Multiplying Dividing As an example, we can create simple grid system. You will need, for example, 10 columns with a resolution of 1,000 pixels: $wrapperWidth: 1000px; $columnsNumber: 10; $innerPadding: 10px; $widthOfColumn = $wrapperWidth / $columnsNumber; .wrapper { width: $wrapperWidth; } .column { width: $widthOfColumn; padding: 0 10px; } Without a logical operator's comparison of operations and loops, you cannot create a good program in classic programming language. The same applies to preprocessors. You need them to automatize the creation of classes/mixins, and so on. The following is the list of possible operators and loops. The list of comparison operators is as follows: <: less than >: greater than ==: equal to !=: not equal to <=: less or equal than >=: greater or equal than The list of logical operators is as follows: and or not The list of loops is as follows: if for each while In classic CSS, you can import files into one CSS document. But in a browser, it still makes additional requests to the server. So, let's say when you have a file with the following content: @import "typography.css" @import "blocks.css" @import "main.css" @import "single.css" It will generate four additional requests to CSS files. With a preprocessor, each @import makes a merging for you, and in this place you will have the content of the mentioned file. So, finally, you have four files in one. Less is a preprocessor mainly used in a Bootstrap framework. It has all the features of a preprocessor (mixins, math, nesting, and variables). One of the good features is the quick invoking of declared mixins. For example, you have created a class: .text-settings { font-size: 12px; font-family: Arial; text-align: center; } Then you can add declared properties with its values in other elements declared in your less file (it works like a mixin): p { .text-settings; color: red; } You will finally get the following: p { font-size: 12px; font-family: Arial; text-align: center; color: red; } Stylus has two versions of code (like SASS): one with braces/semicolons and the other without braces/semicolons. Additionally (over SASS), you can omit colons. If it continues to be developed and still retains its present features, it's going to be the biggest competitor for SASS. SASS stands for Syntactically Awesome Stylesheets. It first appeared in 2006 and was mainly connected to Ruby on Rails (RoR) projects. Agile methodology used in RoR had an influence on frontend development. This is currently the best known CSS preprocessor used in the Foundation framework with the combination of Compass. A new version of the Twitter Bootstrap (fourth version) framework is going to be based on SASS too. In SASS, you can write code in a CSS-like version called SCSS. This version of code looks pretty similar to CSS syntax: a { color: #000; &:hover { color: #f00; } } The second version of code is SASS. It uses indentations and is the same as the preceding code, but written in SASS: a color: #000; &:hover color: #f00; You can see bigger differences in mixins. To invoke a mixin in SCSS, write the following: @include nameOfMixin() To invoke a mixin in SASS, write the following: +nameOfMixin() As you can see, SASS is a shorter version than SCSS. Because of the shortcuts and the automatization processes it is highly recommend to use SASS over SCSSâwrite Lessâget more. Personally I'm using SASS. Why? The first reason is its structure. It looks very similar to Jade (an HTML preprocessor). Both of them are based on indentation and it is easy stylize Jade code. The second reason is the shorter versions of functions (especially mixins). And the third reason is its readability. Sometimes, when your code is bigger, the nesting in SCSS looks like a big mess. If you want, for example, to change a nested class to be in any other element, you have to change your {}. In SASS, you are just dealing with indentation. I've been working a lot with Less and SASS. Why did I finally chose SASS? Because of the following reasons: It's a mature preprocessor It has very good math operations It has extensions (Compass, Bourbon) Usage of Compass is recommended because: It has a collection of modern mixins It creates sprites Most preprocessors have the same options and the reason you will choose one is your own preferences. In this book, I will be using SASS and Compass. In the following table, you can find a short comparison: Using the SASS preprocessor is really simple. You can use it in two ways: SCSS and SASS itself. Using the SASS preprocessor is really simple. You can use it in two ways: SCSS and SASS. The SCSS syntax looks like extended CSS. You can nest your definitions using new braces. SASS syntax is based on indent (similar for example to Python language). Using variables is the essential feature of SASS, which is mostly impossible in CSS that is used on most modern browsers. Variables can be used in every element that you want to parametrize, such as colors, margins, paddings, and fonts. To define variables in SASS, you just need to do it with the $ sign and add the name of your variable after it. In SCSS: $color_blue: blue; Usage: .className { color: $color_blue; } As mentioned in the previous section, variables can be used to parametrize the code. The second best known feature is to add some predefined block of code that you can invoke with some shorter version. In SCSS, you can predefine it this way: @mixin animateAll($time) { -webkit-transition: all $time ease-in-out; -moz-transition: all $time ease-in-out ; -o-transition: all $time ease-in-out; transition: all $time ease-in-out; } And then invoke with: @include animateAll(5s) In the SASS version: =animateAll($time) -webkit-transition: all $time ease-in-out -moz-transition: all $time ease-in-out -o-transition: all $time ease-in-out transition: all $time ease-in-out +animateAll(5s) Example: SASS: .animatedElement +animateAll(5s) Compiled CSS: .animatedElement { -webkit-transition: all 5s ease-in-out; -moz-transition: all 5s ease-in-out; -o-transition: all 5s ease-in-out; transition: all 5s ease-in-out; } What does @extend make in SASS code? For example, you have a part of code that is repeating in all fonts: .font-small { font-family: Arial; font-size: 12px; font-weight: normal; } And you don't want to repeat this part of code in the next selector. You will write in SASS: .font-small-red { @extend .font-small; color: red; } The code it will generate will look like the following: .font-small, .font-small-red { font-family: Arial; font-size: 12px; font-weight: normal; } .font-small-red { color: red; } This SASS feature is great to build optimized code. Remember to use it in your project over mixins, which will generate more code. In CSS, you could import CSS files into one root file with @import. For example: @import "typography.css" @import "grid.css" In SASS, you can import SASS/SCSS files into one with an automatic merge option. In case you have, for example, two files that you want to include in one SASS file, you need to write the following code: @import "typography" @import "grid" As you can see in the preceding code, you don't need to add an extension of the file into import as it automatically loads the SASS or SCSS file. The only thing you need to remember is to have only one file in this example named, typography. Let's check how it will behave in real code. Imagine that we have two files, _typography.sass and _grid.sass. File _grid.sass: .grid-1of2 float: left width: 50% .grid-1of4 float: left width: 25% .grid-1of5 float: left width: 20% File _typography.sass: Now let's create a style.sass file: @import _typography @import _grid After compilation of style.sass, you will see a style.css file:; }â© .grid-1of2 { float: left; width: 50%; } .grid-1of4 { float: left; width: 25%; } .grid-1of5 { float: left; width: 2%; } As you can see, two files are merged into one CSS, so, additionally, we made a small optimization of code because we reduced the number of requests to the server. In case of three files, we have three requests ( style.css, then typography.css, and grid.css). Now there will be only one request. Sometimes, in nesting, you will need to use the name of the selector that you are currently describing. As a best description of the problem, you need to first describe a link: a { color: #000; } and then: a:hover { color: #f00; } In SCSS, you can use & to do that: a { color: #000; &:hover { color: #f00; } } In SASS: a color: #000 &:hover color: #f00 You can resolve with this element other problems like combining names: .classname {} .classname_inside {} In SCSS: .classname { &_inside { } } In SASS: .classname &_inside This option has been possible since SASS 3.5. It will be very helpful in creating code build in BEM methodologies. Compass is a very useful SASS framework, especially when you are working with a big list of icons/reusable images. What you need to do is gather all the images in one folder in your project. For example, yourfolder/envelope.png and yourfloder/star.png. Then in your SASS code: @import "compass/utilities/sprites" @import "yourfolder/*.png" @include all-yourfolder-sprites Then in your code, you can use images as an example: .simple-class-envelope @extend .yourfolder-envelope .simple-class-star @extend .yourfolder-star And it will add a code to your classes: .simple-class-envelope { background-image: url('spriteurl.png'); background-position: -100px -200px; } Where -100px and -200px are examples of offset in your sprite. Every time we are compiling project files (for example, Compass, Jade, image optimization, and so on), we are thinking about how we can automatize and speed up the process. The first ideaâsome terminal snippets and compiling invokers. But we can use grunt.js and gulp.js. What are Grunt and Gulp? In shortâtask runners. You can define a list of tasks, which you repeat all the time, group them into some logical structure, and run. In most projects, you can use them to automatize a process of SASS/Compass compilation. I assume that you have installed Node.js, Ruby, sass, and Compass. If not, I recommend you to do this first. To install all of the listed software, you need to visit: to install Node.js to install Ruby to install SASS to install Compass to install Gulp globally on your machine On these pages, you can find guides and tutorials on how to install all of this software. Then you will need to create a basic structure for your project. It is best to create folders: src: In this folder we will keep our source files dist: In this folder we will keep our compiled files In the src folder, please create a css folder, which will keep our SASS files. Then in the root folder, run the following command line: npm init npm install gulp-compass gulp --save-dev In gulpfile.js add the following lines of code: var gulp = require('gulp'), compass = require('gulp-compass'); gulp.task('compass', function () { return gulp.src('src/styles/main.sass') .pipe(compass({ sass: 'src/styles', image: 'src/images', css: 'dist/css', sourcemap: true, style: 'compressed' })); }); gulp.task('default', function () { gulp.watch('src/css/**/*.sass', ['compass']); }); Now you can run your automatizer with the following in your command line: gulp This will run the default task from your gulpfile.js, which will add a watcher to the files with .sass extensions, which are located in the src/css folder. Every time you change any file in this location, your task compass will run. It means that it will run the compass task and create a sourcemap for us. We could use a default compass command, but gulp.js is a part of the modern frontend developer workflow. We will be adding new functions to this automatizer in the next chapters. Let's analyze the code a little deeper: gulp.task('default', function () { gulp.watch('src/css/**/*.sass', ['compass']); }); The preceding code defines the default task. It appends a watcher, which checks the src/css/**/*.sass location for sass files. It means that every file in a src/css folder and any subsequent folder, for example, src/css/folder/file.sass, will have a watcher. When files in this location are changed, the task defined in the array [compass]will run. Our task compass is the only element in the array but it, of course, can be extended (we will do this in the next chapters). Now let's analyze the task compass: gulp.task('compass', function () { return gulp.src('src/styles/main.sass') .pipe(compass({ sass: 'src/styles', image: 'src/images', css: 'dist/css', sourcemap: true, style: 'compressed' })); }); It will compile the gulp.src('src/styles/main.sass)file and save the compiled file in pipe ( gulp.dest('style.css')). The compass task is defined in pipe: .pipe(compass({ sass: 'src/styles', image: 'src/images', css: 'dist/css', sourcemap: true, style: 'compressed' })) The first line of this task defines the source folder for SASS files. The second line defines the images folder. The third line sets the destination of the CSS file. The fourth line is set to generate a source map for the file (for easier debugging).The fifth line defines the style of the saved CSS file; in this case, it will be compressed (it means that it will be ready for production code). In a common workflow, a graphic designer creates the design of a website/application. Then, next in the process is the HTML/CSS coding. After the development process, the project is in the quality assurance (QA) phase. Sometimes it's focused only on the functional side of the project, but in a good workflow, it checks of graphic design phase. During the QA process, the designer is involved, he/she will find all pixels that are not good in your code. How would check all the details in a pixelperfect project? The question is about mobile projects. How to check if it is still pixel perfect when it needs to be flexible in browsers? You will need to make it in described ranges. For example, you have to create HTML/CSS for the web page, which has three views for mobile, tablet, and desktop. You will need plugins, which will help you to build pixel perfect layouts. Pixelperfect plugin will help you to compare design with your HTML/CSS in your browser. This plugin is available on Firefox and Chrome. To work with it, you need to make a screenshot of your design and add it in a plugin. Then you can set a position of image and opacity. This plugin is one of the most used by frontend developers to create pixel perfect HTML layouts. This plugin will help you to keep proper distances between elements, fonts, and so on. As you can see in the following screenshot, it looks like a ruler over your web page. It is easy to useâjust click on the plugin icon in the browser and then click on the website (it will start the ruler), and move the cursor to the place to which you want to know the distance, and voila! Some CSS features don't work in all browsers. Some new properties need browser-specific prefixes (like -ms, -o, -webkit) to work properly across all modern browsers. But how to check if you can use some properties in your project? Of course, you can check it yourself, but the easiest way is to check it on. You can open this web page and check which properties you can use. While you are creating CSS code, you have to remember initial assumptions that will help you to keep clear and very readable code. These assumptions are as follows: Naming conventionâYou need to remember that your code needs to be the exact names of classes. Use comments, but not everywhere, only in places where they are needed. Yeah, but when they are needed? They are especially needed when you have some exception or when you have some quick fixes for browsers. With comments, you can describe blocks of code, which describes the views, for example, of footer/header, or any other element. Try to keep code which is readable and logical. But how does unlogical code look like? Look at the following two examples: Example 1 is as follows: .classname { font-size: 12px; color: red; font-weight: bold; text-align: center; margin: 10px; padding-left: 2px; text-transform: uppercase; } Example 2 is as follows: .classname { margin: 10px; padding-left: 2px; font-size: 12px; font-weight: bold; text-align: center; text-transform: uppercase; color: red; } Which code looks better? Yeah, of course, the second example because it has grouped declarations. First the description of the box model, then the font and text behaviors, and finally color. You can try to keep it in another hierarchy which will be more readable for you. Using sample 2 in SASS: .classname margin: 10px padding: left: 2px font: size: 12px weight: bold text: align: center transform: uppercase color: red Isn't it shorter and more logical? Create proper selectors (this will be described later in this chapter). Create an elastic structure for your files. The main problem of the CSS coder is creating proper selectors. Knowledge about priors in selectors is mandatory. It will help you to omit the !important statement in your code and will help you to create smaller and more readable files. Using of IDs in CSS is rather bad behavior. The foundation of HTML says that an ID is unique and should be used only once in an HTML code. It is good to omit IDs in CSS and use them only when it is the only way to style some element: #id_name { property: value; } Usage of IDs in CSS code is bad behavior because selectors based on ID are stronger than selectors based on classes. This is confusing in legacy code when you see that some part of the code is still preceded by another selector because it is added in the ID's parents-based selector as follows: #someID .class { /* your code */ } It is good to omit this problem in your projects. First, think twice if a selector based on an ID is a good idea in this place and if this cannot be replaced with any other "weaker" selector. Classes are the best friends of the HTML/CSS coder. They are reusable elements that you can define and then reuse as much as you want in your HTML code, for example: .class_name { property: value; } You can group and nest selectors. First, let's nest them: .class_wrapper .class_nested { property: value; } Then let's group them: .class_wrapper_one, .class_wrapper_two { property: value; } In CSS code, you need to be a selector specialist. It is a very important skill to make a right selector that will match a specific element in the DOM structure. Let's provide a little bit of fundamental knowledge about selectors. The plus sign in CSS can be used in selectors in which you will need to select an element right after the element on the left side of the plus sign, for example: p + a { property: value; } This selector will return a, which is right after the p selector, like in the following example: <p>Text</p> <a>Text</a> But it won't work in the following case: <p>Text</p> <h1>Text</h1> <a>Text</a> With element ( >) in the selector, you can match every element that is right into the element. Let's analyze the following example: p >a { property: value; } This selector will return all <a> elements which are into <p> element but are not nested deeper, for example: <p> <a>text</a> </p> But this won't work in the following case: <p> <span> <a>text</a> </span> </p> With ~, you can create a selector that will match every element that is parallel in the DOM structure, for example: p ~ a { color: pink; } This selector will work in the following cases: <p></p> <a></a> and: <p>Text</p> <span>Text</span> <a>Text</a> Sometimes, there is no way to create a selector based on elements, classes, and IDs. So this is the moment when you need to search for any other possibility to create the right selector. It is possible to get elements by their attributes ( data, href, and so on): [attribute] { property: value; } It will return the following: <p attribute>text</p> And will also return the following: <p attribute="1">text</p> In real CSS/HTML code, there are examples when you will need a selector which is based on attributes with an exact value like inputs with the type as text or when elements data attribute is set with some value. It is possible with a selector which is similar to this example code: input[type="text"] { background: #0000ff; } will match: <input type="text"> This selector is very useful when you want to match elements with attributes that begin with some specific string. Let's check an example: <div class="container"> <div class="grid-1of4">Grid 2</div> <div class="grid-1of2">Grid 1</div> <div class="grid-1of4">Grid 3</div> </div> SASS code: .grid-1of2 width: 50% background: blue .grid-1of4 width: 25% background: green [class^="grid"] float: left Compiled CSS: .grid-1of2 { width: 50%; background: blue; } .grid-1of4 { width: 25%; background: green; } [class^="grid"] { float: left; } Let's analyze this fragment in SASS code: [class^="grid"] float: left This selector will match every element that has an attribute with a grid word in the beginning of this attribute. This will match in our case: .grid-1of2 and .grid-1of4. Of course, we could do it with SASS: .grid-1of2, .grid-1of4 float: left And get it in compiled code: .grid-1of2, .grid-1of4 { float: left; } But let's imagine that we have about 10 or maybe 40 classes like the following: .grid-2of4 width: 50% .grid-3of4 width: 75% .grid-1of5 width: 20% .grid-2of5 width: 40% .grid-3of5 width: 60% .grid-4of5 width: 80% In compiled CSS: .grid-2of4 { width: 50%; } .grid-3of4 { width: 75%; } .grid-1of5 { width: 20%; } .grid-2of5 { width: 40%; } .grid-3of5 { width: 60%; } .grid-4of5 { width: 80%; } And now we want to apply a float: left to these elements like: .grid-1of2, .grid-1of4, .grid-2of4, .grid-3of4, .grid-1of5, .grid-2of5, .grid-3of5, .grid-4of5 float: left In CSS: .grid-1of2, .grid-1of4, .grid-2of4, .grid-3of4, .grid-1of5, .grid-2of5, .grid-3of5, .grid-4of5 { float: left; } It is easier to use a selector based on [attribute^="value"] and match all of the elements with a class which starts with a grid string: [class^="grid"] float: left With this selector you can match all elements which in list of "attributes" that contains a string described as a "value". Let's analyze the following example. HTML: <div class="container"> <div data-Element green font10</div> <div data-Element black font24</div> <div data-Element blue font17</div> </div> Now in SASS: [data-style~="green"] color: green [data-style~="black"] color: black [data-style~="blue"] color: blue [data-style~="font10"] font: size: 10px [data-style~="font17"] font: size: 17px [data-style~="font24"] font: size: 24px Compiled CSS: [data-style~="green"] { color: green; } [data-style~="black"] { color: black; } [data-style~="blue"] { color: blue; } [data-style~="font10"] { font-size: 10px; } [data-style~="font17"] { font-size: 17px; } [data-style~="font24"] { font-size: 24px; } And the effect in the browser is as follows: In one of the previous sections, we had an example of a selector based on beginning of an attribute. But what if we need an attribute ending? With this feature comes a selector based on a pattern [attribute$="value"]. Let's check the following example code: <div class="container"> <a href="/contact-form">Contact form</a><br> <a href="/contact">Contact page</a><br> <a href="/recommendation-form">Recommendation form</a> </div> SASS: [href$="form"] color: yellowgreen font: weight: bold Compiled CSS: [href$="form"] { color: yellowgreen; font-weight: bold; } The effect in the browser is as follows: With the selector [href$="form"],we matched all elements whose attribute href ends with the string form. With this selector, you can match every element that contains a string in a value in any place. Let's analyze the following example code. HTML: <div class="container"> <a href="/contact-form">Contact form</a><br> <a href="/form-contact">Contact form</a><br> <a href="/rocommendation-form">Recommendation form</a><br> <a href="/rocommendation-and-contact-form">Recommendation and contact form</a> </div> SASS: [href*="contact"] color: yellowgreen font: weight: bold Compiled CSS: [href*="contact"] { color: yellowgreen; font-weight: bold; } In the browser we will see: With the selector [href*="contact"], we matched every element that contains the contact string in the value of the attribute href. Hah⦠the magic word in CSS, which you can see in some special cases. With !important, you can even overwrite inline code added by JavaScript in your HTML. How to use it? It is very simple: element { property: value !important; } Remember to use it properly and in cases where you really need it. Don't overuse it in your code because it can have a big impact in the future, especially in cases when somebody will read your code and will try to debug it. Starting your project and planning it is one of the most important processes. You need to create a simple strategy for keeping variables and mixins and also create a proper file structure. This chapter is about the most known problems in planning your file structure and the partialization of files in your project. The most important thing when you are starting a project is to make a good plan of its process. First, you will need to separate settings: Fonts Variables Mixins Then you will need to partialize your project. You will need to create files for repeatable elements along all sites: Header Footer Forms Then you will need to prepare next partializationâspecific views of styling and elements, for example: View home View blog View contact page What can you keep in variables? Yeah, that is a good question, for sure: In this file, you can collect your mostly used mixins. I've divided it into local and global. In global mixins, I'm gathering the most used mixins I'm using along all projects. In local mixins, I recommend to gather those mixins that you will use only in this project: Dedicated gradient Font styling including font family size and so on Hover/active states and so on This file is dedicated for all the most important text elements: h1- h6 p a strong span Additionally, you can add classes like the following: .h1- h6 .red .blue(or any other which you know that will repeat in your texts) .small, .large Why should you use classes like .h1- .h6? Yeah, it's a pretty obvious question. Sometimes you cannot repeat h1- h6 elements, but, for example, on a blog, you need to make them the same font style as h1. This is the best usage of this style, for example (HTML structure): <h1> Main title</h1> <h2>Subtitle</h2> <p>... Text block ... </p> <h2>Second subtitle</h2> <p>... Text block ... </p> <p class="h2">Something important</p> <p>... Text block ... </p> <p class="h1">Something important</p> <p>... Text block ... </p> In the following listed files, you can gather all elements that are visible in some specific views. For example, in a blog structure, you can have a view of single post or page view. So you need to create files: _view_singlepost.sass _view_singlepage.sass _view_contactpage.sass Tip. You can also download the code files by clicking on the Code Files button on the book's webpage: WinRAR / 7-Zip for Windows Zipeg / iZip / UnRarX for Mac 7-Zip / PeaZip for Linux In this chapter, you gathered information about the fundamentals of modern CSS workflow. We started with choosing an IDE and then we focused on speeding up the process through the usage of snippets, preprocessors, and processes automatization. In the next chapter, we will focus on the basics of CSS theory, box models, positions, and displaying modes in CSS.
https://www.packtpub.com/product/professional-css3/9781785880940
CC-MAIN-2020-40
refinedweb
5,823
64.2
Hey, Hey, Scripting Guy! Is there a way to scan a directory structure or a whole drive for files that were created or last accessed by a specific user account? - TA)" OneLineOperatingSystemVersion.vbs '========================================================================== ' ' NAME: OneLineOperatingSystemVersion.vbs ' ' AUTHOR: ed wilson , MSFT ' DATE : 4/8/2009 ' ' COMMENT: Uses a one line technique to report the OS Version. This only works On ' Vista and above due to the change in the win32_OperatingSystem class being a ' singleton ' '========================================================================== wscript.echo GetObject("winmgmts:win32_OperatingSystem=@").Version.. Hi GM, This may help: AddPrinterConnection.vbs Set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.AddPrinterConnection "LPT1", '========================================================================== ' ' ' NAME: <PingTestAndConnectToRangeOfPorts.vbs> ' ' AUTHOR: Ed Wilson , MS ' DATE : 1/18/2006 ' ' COMMENT: <Uses netDiagnostics class from the netdiagProv> '1. Uses two methods from the netdiagProv in the cimv2 namespace '2. The methods are: ping and connectToPort. Each will return a -1 or 0 '3. a -1 is true (success) a 0 is false (failure) '4. It MUST run on a Windows XP machine, but can target Windows 2003. '========================================================================== Option Explicit 'On Error Resume Next dim strComputer dim wmiNS dim wmiQuery dim objWMIService dim colItems dim objItem Dim IP, strPorts, arrPorts, size, errRTN, errRTN1 Dim aPort 'single port at a time Dim strOUT 'output string. IP = "London" size = "32" strPorts = "53,88,135,389,445,464,593,636,1025,1026,1028,1051,1110,3268,3269" arrPorts = Split(strPorts,",") strComputer = "." 'The) Ed Wilson and Craig Liebendorfer, Scripting Guys
http://blogs.technet.com/b/heyscriptingguy/archive/2009/05/22/quick-hits-friday-the-scripting-guys-respond-to-a-bunch-of-questions-05-22-09.aspx
CC-MAIN-2014-35
refinedweb
231
51.04
> From: Colin Walters <address@hidden> > On Mon, 2003-11-17 at 04:00, Miles Bader wrote: > > The only way I can see to solve this is to move the conflicting > > namespace (all the alphanumeric dirs) into a subdir, but that would be a > > more drastic change. > That's exactly what I suggested earlier. Then we bump the project > format version to 2. No, it's goofy. Miles has understated the problem. There's a very general problem which might be stated this way: I have some directory, used as a data structure for arch or a related system, in which I want to create subdirectories named after categories (or branches or versions or archives or revisions). That's easy enough to solve: I simply name the subdirs after the category (or branch or ....). Now, later, I have a second problem. I want to attach some extra data to that directory. I want to create a new "field" on the data structure, so to speak. How do I do that? The answer is that, in general, I pick a name for the new field that doesn't clash with a valid arch category (or whatever) name. Simple. Effective. Moving all the category subdirs to a nested subdirectory doesn't solve the problem. It just pushes the same problem one level deeper. Then some people come along and say "Oh, you picked the name =foo. That messes up the version of sh that I use. Please change it." And you say in reply "Hmm. Looking at the standard, it seems that '=' as a filename prefix can't possibly be confused with a shell meta-character except if the filename in question is an executable being used in the command name position of a shell expression. This file isn't an executable. I think your shell is broken." And then they say, "Oh, please. We're not free to fix the shell. It would be much better if you compound the problem." So then you tell them stories about the history of completion in bash and how that history effected people designing things like zsh and what it was like to use tops-20 and how the itla framework is a much better idea anyway. And then if history is any indication, you get flamed for "imposing policy" or adopting bad tone or being otherwise recalcitrant to the needs of users when, really, you're just trying to help them see more clearly what you think their real needs are. And then you become filled with self doubt. "Perhaps I'm just being stubborn?" you might think. So you think about it a while. And then think some more. You think about the consequences of "compounding the error". You think about all the stern and frightening stories justifying engineering stubbornness (and humility) that were a prominent part of your experience as an engineering student. You try to weight it on that scale. You think about patches floating around that would fix this instance of bash's completion breakage. You think about "~~" being a more reasonable alternative to "=" as zsh uses it. And so you just take to repeating yourself but at least trying to mix up the style in the hopes that some expression of the issues will actually be clearer than the earlier ones you tried. At least that's been my experience. "Every litter bit hurts" -- slogan on public trash cans in some cities and a good thing to keep in mind when contemplating compounding an error made by 2-3 programs. -t
https://lists.gnu.org/archive/html/gnu-arch-users/2003-11/msg00394.html
CC-MAIN-2019-26
refinedweb
592
73.47
UPDATED LINK: (tl;dr) Our friends over in the ASP.NET team are working on a very nice, lightweight web-browser eventing technology called SignalR. SignalR allows server-pushed events into the browser with a variety of transport options and a very simple programming model. You can get it via NuGet and/or see growing and get the source of on github. There is also a very active community around SignalR chatting on Jabbr.net, a chat system whose user model is derived from IRC, but that runs – surprise – on top of SignalR. For a primer, check out the piece that Scott Hanselman wrote about SignalR a while back. At the core, SignalR is a lightweight message bus that allows you to send messages (strings) identified by a key. Ultimately it’s a key/value bus. If you’re interested in messages with one or more particular keys, you walk up and ask for them by putting a (logical) connection into the bus – you create a subscription. And while you are maintaining that logical connection you get a cookie that acts as a cursor into the event stream keeping track of what you have an have not seen, which is particularly interesting for connectionless transports like long polling. SignalR implements this simple pub/sub pattern as a framework and that works brilliantly and with great density, meaning that you can pack very many concurrent notification channels on a single box. What SignalR, out-of-the-box, doesn’t (or didn’t) provide yet is a way to stretch its message bus across multiple nodes for even higher scale and for failover safety. That’s where Service Bus comes in. msec more latency. If you want to try it out, here are the steps (beyond getting the code): In the above example, {namespace} is the Service Bus namespace you created following the tutorial steps, {account} is likely “owner” (to boot) and {key} is the default key you copied from the portal. {appname} is some string, without spaces, that disambiguates your app from other apps on the same namespace and 2 stands for splitting the Service Bus traffic across 2 topics. Most of the SignalR samples don’t quite work yet in a scale-out mode since they hold local, per-node state. That’s getting fixed. © Copyright 2014, Clemens Vasters - Powered by: newtelligence dasBlog 1.9.7067.0
http://vasters.com/clemensv/CommentView,guid,e8d14433-f773-4a19-91c0-138a9770a7c8.aspx
CC-MAIN-2014-52
refinedweb
397
60.95
Frequently Asked Questions¶ - I try to bind key-value pairs but they don’t appear in the log files? structlog‘s loggers are immutable. Meaning that you have to use the logger that is returned from bind(): >>> import structlog >>> log = structlog.get_logger() >>> log.bind(x=42) >>> log.msg("hello")>> new_log = log.bind(x=42) >>> new_log.msg("hello") x=42 event='hello' - How can I make third party components log in JSON too? Since Twisted’s logging is nicely composable, structlogcomes with integration support out of the box. The standard library is a bit more complicated and tough to solve universally. But generally speaking, all you need is a handler that will redirect standard library logging into structlog. For example like this: import logging class StructlogHandler(logging.Handler): """ Feeds all events back into structlog. """ def __init__(self, *args, **kw): super(StructlogHandler, self).__init__(*args, **kw) self._log = structlog.get_logger() def emit(self, record): self._log.log(record.levelno, record.msg, name=record.name) root_logger = logging.getLogger() root_logger.addHandler(StructlogHandler()) There are two things to keep in mind: - You can’t log out using the standard library since that would create an infinite loop. In other words you have to use for example PrintLoggerfor actual output (which is nothing wrong with). - You can’t affect the logging of your parent process. So for example if you’re running a web application as Gunicorn workers, you have to configure Gunicorn’s logging separately if you want it to write JSON logs. In these cases a library like python-json-logger should come in handy.
http://www.structlog.org/en/stable/faq.html
CC-MAIN-2017-13
refinedweb
261
59.8
...one of the most highly regarded and expertly designed C++ library projects in the world. — Herb Sutter and Andrei Alexandrescu, C++ Coding Standards boost::python::objectfrom PyObject* Python is dynamically typed, unlike C++ which is statically typed. Python variables may hold an integer, a float, list, dict, tuple, str, long etc., among other things. In the viewpoint of Boost.Python and C++, these Pythonic variables are just instances of class object. We will see in this chapter how to deal with Python objects. As mentioned, one of the goals of Boost.Python is to provide a bidirectional mapping between C++ and Python while maintaining the Python feel. Boost.Python C++ objects are as close as possible to Python. This should minimize the learning curve significantly. Class object wraps PyObject*. All the intricacies of dealing with PyObjects such as managing reference counting are handled by the object class. C++ object interoperability is seamless. Boost.Python C++ objects can in fact be explicitly constructed from any C++ object. To illustrate, this Python code snippet: def f(x, y): if (y == 'foo'): x[3:7] = 'bar' else: x.items += y(3, x) return x def getfunc(): return f; Can be rewritten in C++ using Boost.Python facilities this way: object f(object x, object y) { if (y == "foo") x.slice(3,7) = "bar"; else x.attr("items") += y(3, x); return x; } object getfunc() { return object(f); } Apart from cosmetic differences due to the fact that we are writing the code in C++, the look and feel should be immediately apparent to the Python coder. Boost.Python comes with a set of derived object types corresponding to that of Python's: These derived object types act like real Python types. For instance: str(1) ==> "1" Wherever appropriate, a particular derived object has corresponding Python type's methods. For instance, dict has a keys() method: d.keys() make_tuple is provided for declaring tuple literals. Example: make_tuple(123, 'D', "Hello, World", 0.0); In C++, when Boost.Python objects are used as arguments to functions, subtype matching is required. For example, when a function f, as declared below, is wrapped, it will only accept instances of Python's str type and subtypes. void f(str name) { object n2 = name.attr("upper")(); // NAME = name.upper() str NAME = name.upper(); // better object msg = "%s is bigger than %s" % make_tuple(NAME,name); } In finer detail: str NAME = name.upper(); Illustrates that we provide versions of the str type's methods as C++ member functions. object msg = "%s is bigger than %s" % make_tuple(NAME,name); Demonstrates that you can write the C++ equivalent of "format" % x,y,z in Python, which is useful since there's no easy way to do that in std C++. Python: >>> d = dict(x.__dict__) # copies x.__dict__ >>> d['whatever'] = 3 # modifies the copy C++: dict d(x.attr("__dict__")); // copies x.__dict__ d['whatever'] = 3; // modifies the copy Due to the dynamic nature of Boost.Python objects, any class_<T> may also be one of these types! The following code snippet wraps the class (type) object. We can use this to create wrapped instances. Example: object vec345 = ( class_<Vec2>("Vec2", init<double, double>()) .def_readonly("length", &Point::length) .def_readonly("angle", &Point::angle) )(3.0, 4.0); assert(vec345.attr("length") == 5.0); At some point, we will need to get C++ values out of object instances. This can be achieved with the extract<T> function. Consider the following: double x = o.attr("length"); // compile error In the code above, we got a compiler error because Boost.Python object can't be implicitly converted to doubles. Instead, what we wanted to do above can be achieved by writing: double l = extract<double>(o.attr("length")); Vec2& v = extract<Vec2&>(o); assert(l == v.length()); The first line attempts to extract the "length" attribute of the Boost.Python object. The second line attempts to extract the Vec2 object from held by the Boost.Python object. Take note that we said "attempt to" above. What if the Boost.Python object does not really hold a Vec2 type? This is certainly a possibility considering the dynamic nature of Python objects. To be on the safe side, if the C++ type can't be extracted, an appropriate exception is thrown. To avoid an exception, we need to test for extractibility: extract<Vec2&> x(o); if (x.check()) { Vec2& v = x(); ... The astute reader might have noticed that the extract<T> facility in fact solves the mutable copying problem: dict d = extract<dict>(x.attr("__dict__")); d["whatever"] = 3; // modifies x.__dict__ ! Boost.Python has a nifty facility to capture and wrap C++ enums. While Python has no enum type, we'll often want to expose our C++ enums to Python as an int. Boost.Python's enum facility makes this easy while taking care of the proper conversions from Python's dynamic typing to C++'s strong static typing (in C++, ints cannot be implicitly converted to enums). To illustrate, given a C++ enum: enum choice { red, blue }; the construct: enum_<choice>("choice") .value("red", red) .value("blue", blue) ; can be used to expose to Python. The new enum type is created in the current scope(), which is usually the current module. The snippet above creates a Python class derived from Python's int type which is associated with the C++ type passed as its first parameter. You can access those values in Python as >>> my_module.choice.red my_module.choice.red where my_module is the module where the enum is declared. You can also create a new scope around a class: scope in_X = class_<X>("X") .def( ... ) .def( ... ) ; // Expose X::nested as X.nested enum_<X::nested>("nested") .value("red", red) .value("blue", blue) ; When you want a boost::python::object to manage a pointer to PyObject* pyobj one does: boost::python::object o(boost::python::handle<>(pyobj)); In this case, the o object, manages the pyobj, it won’t increase the reference count on construction. Otherwise, to use a borrowed reference: boost::python::object o(boost::python::handle<>(boost::python::borrowed(pyobj))); In this case, Py_INCREF is called, so pyobj is not destructed when object o goes out of scope.
http://www.boost.org/doc/libs/1_51_0/libs/python/doc/tutorial/doc/html/python/object.html
CC-MAIN-2015-48
refinedweb
1,032
67.86
#include <inspsocket.h> BufferedSocket is an extendable socket class which modules can use for TCP socket support. It is fully integrated into InspIRCds socket loop and attaches its sockets to the core's instance of the SocketEngine class, meaning that all use is fully asynchronous. To use BufferedSocket, you must inherit a class from it. This constructor is used to associate an existing connecting with an BufferedSocket class. The given file descriptor must be valid, and when initialized, the BufferedSocket will be placed in CONNECTED state. Begin connection to the given address This will create a socket, register with socket engine, and start the asynchronous connection process. If an error is detected at this point (such as out of file descriptors), OnError will be called; otherwise, the state will become CONNECTING. Dispatched from HandleEvent Reimplemented from StreamSocket. This method is called when an outbound connection on your socket is completed. When there is data waiting to be read on a socket, the OnDataReady() method is called. Implements StreamSocket. Implemented in ThreadSignalSocket. When an outbound connection fails, and the attempt times out, you will receive this event. The method will trigger once maxtime seconds are reached (as given in the constructor) just before the socket's descriptor is closed. A failed DNS lookup may cause this event if the DNS server is not responding, as well as a failed connect() call, because DNS lookups are nonblocking as implemented by this class. The state for this socket, either listening, connecting, connected or error. Timeout object or NULL
http://www.inspircd.org/api/2.0/class_buffered_socket.html
CC-MAIN-2018-09
refinedweb
255
55.44
This module. This modules re-exports everything from System.IO so you can just replace: import System.IO with: import System.IO.ExplicitIOModes, change some type signatures and expect everything to type-check. There's one exception to this last statement: If you are using the standard handles stdin, stdout or stderr in a mode which isn't their default mode (R for stdin and W for stdout and stderr) you have to cast these handles to the expected IOMode. A handle to a file with an explicit IOMode. Wraps: System.IO.Handle. The IOMode GADT which for each constructor specifies the associated IOMode type. Also see: System.IO.IOMode.
http://hackage.haskell.org/package/explicit-iomodes-0.1/docs/System-IO-ExplicitIOModes.html
CC-MAIN-2018-05
refinedweb
110
67.45
05 October 2012 17:47 [Source: ICIS news] HOUSTON (ICIS)--Several US methyl methacrylate (MMA) market players said on Friday they were surprised by Evonik's plan for a new US plant, citing what they see as long supply and weaker-than-expected demand growth. Evonik said it plans to build a 120,000 tonne/year MMA plant in ?xml:namespace> “I think the announcement is good, but breaking ground is better,” a market source said. “It’s pretty far away, but it’s good for purchasers.” Several other sources agreed, citing that the new supply could lead to lower prices for buyers. “The MMA market is already extremely long,” another source said. “It will take some time to digest the material.” There are expectations that market growth for MMA will have to come from the consumer electronics market, especially flat-panel TVs. However, sources said that market is not growing as quickly as expected, especially compared to projections made several years ago. “Producers are in denial about the LED [light emitting diodes for TV screens] market being a major driver of consumption,” a source said. “I’m confused about the timing of this announcement.” However, other sources were less surprised, saying they had heard rumors of an Evonik MMA plant being planned for several years. “We’ve been expecting an announcement on an Evonik build for several years now,” a source said. “And the The source added that the timing of the plant’s construction could be difficult, and noted that the plant is still in the development phase. US MMA contract prices for September were assessed by ICIS at $1.075-1.125/lb ($2,370-2,480/tonne, €1,825-1,910/tonne) FD railcar (free delivered via railcar). (
http://www.icis.com/Articles/2012/10/05/9601631/evoniks-plan-for-new-us-mma-plant-surprises-many-market-players.html
CC-MAIN-2014-41
refinedweb
292
63.09
Here's an example from a recent project. I needed to create UUIDs. Looking around, I found RFC 4122, which describes UUID generation, and helpfully provides a sample implementation in C. Unfortunately, that code generates random UUIDs that aren't very random (32 bits of randomness in a 128 bit value). Now, I could reimplement this code (or something similar) in Haskell, and fix the lack-of-randomness issue. Or I could find another UUID generator, and reimplement that directly. But really, my goal here is to grab random 128-bit UUID values and move on. Getting distracted by a research project isn't part of the plan. A little googling found that a version of uuid_generate(3)is bundled within e2fsprogs. My target system has e2fsprogsinstalled, so that's a plus. And, interestingly enough, ' man uuid_generate' on my MacBook turns up this manpage: UUID_GENERATE(3) UUID_GENERATE(3)(Turns out that Apple includes this as part of the standard C library. Thanks, Apple!) NAME); .... AUTHOR Theodore Y. Ts'o AVAILABILITY A little more lurking, and I see that a uuid_tis merely an array of 16 characters. As the man page says, this is an output parameter. (It's odd to see code like this after programming in high level languages for so long, but this is C, and what are you going to do?) Next, I started paging through the GHC User's Guide and the Standard Libraries documentation, and came up with this declaration: foreign import ccall unsafe "uuid_generate" uuid_generateThis declaration is a direct translation out of the man page. :: Ptr Word8 -> IO () Next, I needed to construct a 16-byte buffer to receive the UUID value from uuid_generate, which requires using some functions in the Foreignlibrary. As soon as uuid_generatefinishes, the buffer needs to be translated into a Haskell string. Note that the return value is a 128-bit integer, and I want to convert that into sequence of printable hex digits. Here's the more convenient interface into the UUID generator: import ForeignThats it! Easy Peasy. import Numeric (showHex) uuid :: IO String uuid = allocaBytes 16 $ \p -> do uuid_generate p uuid <- peekArray 16 p return $ concat $ map toHex uuid toHex :: Word8 -> String toHex w = case showHex w "" of w1:w2:[] -> w1:w2:[] w2:[] -> '0':w2:[] _ -> error "showHex returned []" 1 comment: Nice work! UUIDs are really useful and important library additions, so I think it would be useful to find out how you could get something like this added to a library or put this code in a more visible place. Perhaps here: (I'm not affiliated with the maintainers of) Thanks!
http://notes-on-haskell.blogspot.sg/2007/02/ffi-in-haskell.html
CC-MAIN-2017-51
refinedweb
434
61.77
Issues ZF-1524: introduction of cache_id_prefix Description Patch files are attached to this task to add cache id prefix to Zend_Cache_Core so that it is available to all front and backends. Patch files are attached to this task to add cache id prefix to Zend_Cache_Core so that it is available to all front and backends. Posted by Bill Karwin (bkarwin) on 2007-06-12T17:57:38.000+0000 Assign to Fabien Marty. Posted by Fabien MARTY (fab) on 2007-06-19T16:34:02.000+0000 ok for 1.1.0 serie Posted by Bill Karwin (bkarwin) on 2007-06-28T20:13:16.000+0000 Marking fix version as unknown. Please set fix version when this issue is resolved. Posted by Tony Ford (tony4d) on 2008-01-11T10:11:38.000+0000 Hey, this is Tony, the one that submitted the original patch for this feature through the mailing list. Do you guys think we can we get this into the 1.5 preview release? And/or, how can I help to make that happen? Posted by Geoffrey Tran (potatobob) on 2008-01-14T18:53:26.000+0000 I too would like to see this implemented for the 1.5 seriers Posted by Fabien MARTY (fab) on 2008-01-15T12:14:53.000+0000 is this feature needed for all backends or only for the memcached one ? Posted by Tony Ford (tony4d) on 2008-01-15T16:57:52.000+0000 FYI, I signed a ZF CLA today and sent it in. Looks like they took care of it, so I'm all set on that front now. Fabien, in my opinion this cache id prefix is only necessary for the memcached and apc backends. The file backend already has a prefix of sorts, a "file name" prefix. Doesn't really matter though, cause it serves the same purpose. Even so, might not be a bad idea to change that to a cache id prefix for consistency. Whether its a file name prefix or a cache id prefix, it doesn't really matter for the File backend, because the cacheid is used to create the final file name anyway. Less work if we don't fool with it, but more consistent with the other backends if we do change it ... The only other two backends are sqlite and Zend Platform. Both of those support tags though, so I don't feel the prefix is necessary. The whole point is to create namespaces with the cache, that's one of the things tags do for you. I'm willing to finish this task when I have some answers. I'll provide up to date patches for memcached and apc backends, and I'll do unit tests and any docs too. Thanks Posted by Fabien MARTY (fab) on 2008-01-22T14:16:15.000+0000 IMHO, this feature is a sort of namespaces one. So, it is not logic to introduce this on specific backends. IMHO, this feature must be in Core.php. In this way, it will be completly transparent for all backends. Tony, do you want to take care of it (in this way) ? Posted by Tony Ford (tony4d) on 2008-02-13T02:32:07.000+0000 Fabien, yea, that sounds good. I'm working on it now. I'll submit a patch against the 1.5 preview release very soon. Posted by Tony Ford (tony4d) on 2008-02-13T12:09:56.000+0000 This patch is against:… Posted by Tony Ford (tony4d) on 2008-02-13T12:11:14.000+0000 This patch is against:… Posted by Tony Ford (tony4d) on 2008-02-13T12:13:06.000+0000 Removed old patch that was only relevant for memcached backend. New patches are attached now. Posted by Tony Ford (tony4d) on 2008-02-13T12:14:32.000+0000 Sorry, last comment. Fabien, I do not believe any additional tests are necessary, so I've attached changes to cache core and documentation updates, for the English version only ... Let me know if there is anything additional, thanks. Posted by Fabien MARTY (fab) on 2008-02-17T14:35:14.000+0000 commited in SVN trunk Tony (thanks !)
http://framework.zend.com/issues/browse/ZF-1524?focusedCommentId=19202&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
CC-MAIN-2016-26
refinedweb
691
85.79
Have. It’s how I taught myself React, and it’s how I approach a lot of problems in software. Rule #0: One thing at a time, if you can It’s a lot easier to learn a thing if you can isolate it. For an instrument like the piano, that’d be “learn to play one note”, then “learn to play an easy chord, with one hand”. Then later, two hands. That’s very different from saying “I’m gonna learn this complex song and play every note, hands together, from the very start.” So when it comes to learning React (or any programming thing), try to make a checklist of the things you need to learn, and their dependencies, and then start at the bottom and work your way up. Choosing to learn a whole cluster of skills simultaneously (e.g. build an app with React, having barely used JS before) is like playing the game on hard mode. You can do it, you absolutely can, but it’s probably gonna be harder. I’m not trying to say “you MUST learn JS before touching React”. I don’t think it’s absolute like that. Everyone has a different set of experience coming in, and everything is a gradient. You don’t need to be a Jedi Master at each of these skills before moving on to the next, either. Learn enough to where you feel a bit of confidence, then continue. It’s a bit like juggling. Add one ball at a time. Soon you’ll be juggling the whole set. Rule #1: Get it working, and keep it working Errors are the worst. Especially when you’re first learning a thing. They feel like a big setback and can be tough to diagnose. So I try to avoid causing errors by making small, cautious changes. In React, this looked like writing a small simple “Hello World” component, and expanding on it, bit by bit. I had gone through the official tutorial and I went forward with the assumption that React was “pretty much HTML inside functions”. (I already knew HTML well at this point, and I knew JavaScript, since I’d been working with AngularJS for a while.) So I started with Hello World. function HelloWorld() { return <div>Hello World!</div> } Then what if I try to render more stuff inside that div, does that work? function HelloWorld() { return <div>Hello World! <p>More stuff and <strong>bolded</strong></p></div> } Cool, ok. Can I put it on multiple lines so it doesn’t look like a travesty? function HelloWorld() { return ( <div> Hello World! <p> More stuff and <strong>bolded</strong>! </p> </div> ); } Yep, nice. How about inserting the value of a variable with curly braces? function HelloWorld() { const name = 'Dave' return <div>Hello {name}!</div> } Sweet, I can make it say “Hello Dave”. Ok, now if I make a second component… and try to render that inside of HelloWorld? function Name() { return <span>Dave</span> } function HelloWorld() { return <div>Hello <Name/></div> } Nice, I can nest components like HTML tags. Makes sense. Let’s pass a “prop” into Name to tell it the name to display… function Name({ name }) { return <span>{name}</span> } function HelloWorld() { return <div>Hello <Name name="Dave"/></div> } Hey that worked too! … I poked around like this, making small changes, seeing what was possible. Personally I have more fun learning things when I treat it like a fun exploratory experiment. Can I do X? Oh nice. What about X+Y? Awesome. Pushing the bounds a little each time, and aiming for “tiny wins” along the way. Rule #2: Cause errors on purpose You’ve gotta know what syntax is valid and what isn’t. To build up that intuition, it can be helpful to break the code on purpose, and learn where the boundaries are. Can I put the JSX on a separate line from the return? function HelloWorld() { return <div>Hello World</div> } Nope, that breaks. Right, because in JS return<newline> is the same as return; and that returns undefined. Ok, what about a tag like <br>… do I have to close it? function HelloWorld() { return <div>Hello <br> World</div> } Huh, that broke. Guess I have to close the br tag then. That’s different from HTML. Ooh, does that mean I can write a self-closing div? I always hated having to write <div></div> in HTML… function HelloWorld() { return <div>Hello <div/> World</div> } Nice! That’s awesome. Ok, so tags have to be closed, and they can all be self-closing. … This is similar to Rule 1, but here you’re testing the limits in the other direction. Intentionally causing errors, reading the errors, learning how they work. This way the errors aren’t so scary, and they don’t catch you off guard. And because you’re making small changes, it’s easy to revert them back to a working state. Plus, you’re building up an inventory of a bunch of different potential errors, so you’ll know how to fix them if you hit a snag when you’re building a real thing. Rule #3: Start small, and build from there If Rule 1 was all about taking tiny risks that will almost definitely work, Rule 3 is more about the bigger risks. If I can write HelloWorld, and I can nest components… could I design a whole page this way? (probably!) After building a few small things, I had the idea of building a Slack clone. This was a bit more risky. I had only used state a little bit, but building a chat app seemed like a good leap forward, so I gave it a shot. I kept Rule 0 in mind - one thing at a time. I would focus on JUST the React app and use static data for chat messages. At first it was literally a static webpage that looked a lot like Slack. Once that worked, I implemented “sending messages” by updating the app’s local state. There was no server in the picture yet, so I couldn’t actually CHAT with anyone, but it was fun because it felt like React was making sense. Teach Others I was feeling pretty happy with React, and having a fun time building little things. But looking around at forums, Twitter, Reddit… it seemed others weren’t faring so well. Lots of folks were having trouble getting started with React, often because of all the tooling (this was before Create React App existed), and then because of trying to learn everything at once. So I started writing about React on my blog, and a while later wrote a book, Pure React. My goal was to teach React to others in the way that had worked for me: with one new thing at a time, small examples, and practice exercises to build confidence. Almost 2,000 people have used Pure React at this point, and I now feel pretty safe saying “it works” :) I get a lot of happy emails from folks saying how React finally clicked for them, or that the book helped them “get it” in a way that a 35-hour course hadn’t. Emails like that make my day. Over the last few months I’ve been working hard on expanding Pure React beyond just a book, and I’m almost ready to share it with the world. In about two weeks, on November 1, I’ll be opening the doors for early access. Sign up below to hear when it’s ready and get an early access discount.
https://daveceddia.com/how-i-learned-react/
CC-MAIN-2019-47
refinedweb
1,272
81.83
FAQ Service Data Control Center (SDCCN) Below you will find some questions which are often raised in connection with transaction SDCCN (Service Data Control Center). 1. Q: What authorisations are needed to work with SDCCN? A: The following authorisations exist: Profile (in Basis rel 40*-46D) - S_SDCC_READN Read authorization - S_SDCC_SERVN Collect and send data - S_SDCC_ADM_N Admin authorization Roles (as of Basis Release 6.10) - SAP_SDCCN_DIS Read authorization - SAP_SDCCN_EXE Collect and send data - SAP_SDCCN_ALL Admin authorization When assigning the roles for the first time please ensure that they contain the corresponding profile. 2. Q: I want to activate SDCCN - do I have to deactivate SDCC? A: Yes. If you have used the old transaction SDCC this must be deactivated prior to the activation of SDCCN. To do this please delete any future background jobs connected with SDCC: AUTO_SESSION_MANAGER, SESS* , SASM* Then you can. locally activate SDCCN via 'Utilites -> Activate'.SDCCN in a satellite system can also be activated from a connected SAP Solution Manager system. 3.Q: What is the minimum set up needed for SDCCN? A: To ensure that SDCCN can continuously monitor your systems for sessions created in connected SAP Solution Manager systems as well as sessions ordered from SAP a number of prerequisites must be met. SDCCN must be activated as described in the documentation. After a succesful activation the customizing in Goto -> Settings -> Task specific settings is filled with the SAP proposed default values. In Goto -> Settings -> Task Processor you should see that the Task Processor job is 'active'. Two tasks should have been created: Service Preparation Check This is an interactive Task which you can start by clicking on it. This leads you to RTCCTOOL, which gives you an overview of tools and notes needed for the correct preparation of any service session. More information about RTCCTOOL is in note 69455. Note 91488 documents the various preparations for a service session. The Service Preparation Check is a periodic task, i.e when the original task has been executed, the next task of the same type is scheduled as per the customizing in the 'Task specific settings'. Maintenance package The maintenance package is a periodic task, which should run every day. It consists of 3 'housekeeping' tasks, which each get executed when necessary. The frequency of the individual tasks is based on the customizing in the 'Task specific settings'. - Session refresh The session refresh which is triggered by a maintenance task checks all destinations known in the list of RFC destinations (Goto -> Settings -> Task specific settings -> RFC destinations) Destinations from SM59 can be added to this list manually. - Service definition refresh The service definition refresh is also based on the above list of destinations. It uses either the destination for which the 'Master' flag has been set, or if this flag has not been set, SDCC_OSS. - Delete data This task is executed as per the customizing in the task specific setting. When the Task Processor is active, and Service Preparation Task and Maintenance Task have been created succesfully, no further tasks are needed. For control purposes individual tasks can be created, but these should generally created with mode 'runs once'. The old transaction SDCC should now be locked. 4. Q: SDCCN is activated, but SDCC can still be called. How can SDCC be locked? A: Most likely you have activated SDCCN when the system was on basis release 4.x, and then upgraded to basis release 6.x This has to do with the change of the namespace for the old SDCC , from /BDL/* on basis release 4.x to BDL*. When SDCCN was activated on 4.x SDCC was locked via table /BDL/CUST. In 6.x the relevant table is called BDLCUST and does not yet have the lock entry. It must be created manually, with report BDLSETUP: KEY = LOCKED VALUE = X Delete = unchecked 5. Q: When trying to create a task in SDCCN an error message appears: ' No action possible '. Why can the task not be created? A: SDCCN has not yet been initialised correctly, and so the customizing for the tasks has not been filled yet. SDCCN can be initialised locally by following these steps: Ensure that the task processor job is deactivated, via SDCCN -> Goto -> Settings -> Task processor Then initialise the tool via SDCCN ->Utilities -> Activate. If the initialisation was succesful you should get the following messages: Local initialisation of new Service Data Control Center Activation successful Destination to SAP created AUTO_SESSION_MANAGER descheduled Settings filled Service Data Control Manager tasks created Task processor scheduled Jobname /BDL/TASK_PROCESSOR 6.. Q: A task in SDCCN appears 'active' in the 'To do' tab, but the corresponding back ground job /BDL/TASK_PROCESSOR* has been cancelled.The apparently 'active' task cannot be cancelled. A: At the moment only a workaround can be offered: Highlight the task -> right click -> select 'Start now'. The icon should change to 'match stick' while the task searches for a free background job. Now you must immediately delete the task (if you wait, the task will actually be re-started). 7. Q: Testing a destination to SAP in SM59 returns error message " service 'sapdp99' unknown " or " error opening an RFC connection ". How can this be fixed? A: The services file may not be maintained correctly. There are several options: a) Add the entry sapdp99 3299/tcp in the 'services' file of the customer system. This is usually: UNIX: /etc/service , NT: <windir>system32driversetcservices. ( 3299 is the port number and tcp is the protocol) This method should be preferred to option b). b) (ii) Alternatively you can change from 'sapdp99' to '3299' directly in the destination. If this information is not sufficient to fix the problem please open a message in component XX-SER-NET. 8. Q: Can I force the Task Processor background job to run on a particular instance? A: Yes, provided the below conditions apply. To execute a Task Processor job succesfully an instance has to fulfill two conditions a background process of class 'C' has to be available the connection to the target system has to be functional from this instance. To identify which instances can be used to succesfully run the Task Processor background job you can follow this path: SDCCN -> Goto -> Settings -> Task Processor -> Job settings -> Check hosts. Select the destination you wish to check against -> Confirm The check will bring back a list of instances.For each you can see if a 'ping' was succesful, and if background processes exist. At the bottom of the list instances which meet both prerequisites are listed. In SDCCN -> Goto -> Settings -> Task Processor -> Job settings -> Target host you can use the F4 help to choose a host which fullfills the above prerequisites. Deactivate the Task Processor. Maintain the target host as described above. Reactivate the Task Processor. All future tasks will be executed on the maintained target host. 9. Q: In the log for the task 'Service Preparation Check' I find errors about a failed attempt to connect to SAP. What should be done? A: Destination SAPNET_RTCC is used by RTCCTOOL, which executes the 'Service Preparation Check'. SAPNET_RTCC gets created automatically when RTCCTOOL connect to OSS the first time. After an update of SAPOSS via TA OSS1 SAPNET_RTCC does NOT get updated automatically. The easiest way to ensure it is updated correctly is to delete the destination and then to recreate it via: SAPNET_RTCC: SE38 -> RTCCTOOL or executing a task 'Service Preparation Check' . 10. Q: A task was not processed at the time it was scheduled for. Why? A: How close to the scheduled time a task can be processed depends on the frequency of the 'Task processor'. The Task processor can only process tasks in the past. If, for example,the Task processor is scheduled to run only once a day, at 21:14, all the tasks in the to do list , which are in the past, will be processed after 21:14. The sequence in which they are processed is determined by the time they are scheduled for; the task scheduled for the earliest time is processed first. 11. Q: Job /BDL/TASK_PROCESSOR is cancelled. In SM37 the job log has entries similar to this: Job started Step 001 started (program /BDL/TASK_SCHEDULER, variant &0000000000000, user ID <user name> ) Variant &0000000000000 does not exist Job cancelled How can this be resolved? A: Deactivate and then reactivate /BDL/TASK_PROCESSOR as follows: Logon to the productive client. SDCCN->GoTo->Settings->Task Processor->Change settings->Deactivate. Enter Change Modus again -> Set Defaults->Activate.
https://www.stechies.com/faq-service-data-control-center-sdccn/
CC-MAIN-2017-47
refinedweb
1,411
55.24
I have to write code for class that sums numbers up to a certain point like 5 billion using an increment that we put in using cin, so if we start at 0 and go to 5 billion by increments of 2 it would be like 0+2=2 2+2=4 and so on. When i cout my sums they always read zero can anyone help Code:#include <iostream> #include <iomanip> using namespace std; int main () { /* Declared Integers*/ double dsum, dx, da, i, ep, ci, pl; /*Assign Variables*/ cout << "What is your starting point using a decimal"<< endl; cin >> dx; cout << "What is your ending point using a decimal"<< endl; cin >> ep; cout << "What is your counting increment using a decimal"<< endl; cin >> ci; cout << "How many times should a sum be printed" << endl; cin >> pl; dsum = 0.0; da = 1.0; /* Prints Columns */ cout << "Line" << "\t" << "Every "<< pl<< "th" << "\t" << "Sum" << "\n" << endl; /*Sums the Numbers*/ while (da<=pl) { i = 1.0; while (i <= ep/pl) { dsum = dsum + dx; i++; dx+ci; } /* prints out the numbers*/ cout << setprecision(20)<< da << "\t" << (ep/pl)*da << "\t" << dsum << "\n" << endl; da++; } system ("pause"); return 0; }
https://cboard.cprogramming.com/cplusplus-programming/129857-need-help.html
CC-MAIN-2017-34
refinedweb
195
60.11
Hello everybody. I have experience with c++ and c programming. I wasn't expecting Java to give me such a difficult time, but I am having a hard time grasping in. In c/c++, you have a main function and other functions that come up as you call them from your main function. I see this isn't the case in Java. For example, I am studying the following code from Sam's Teach yourself java in 24 hours: import java.awt.*; import javax.swing.*; import java.awt.event.*; class PrimeFinder extends JFrame implements Runnable, ActionListener { Thread go; JLabel howManyLabel = new JLabel("Quantity: "); JTextField howMany = new JTextField("400", 10); JButton display = new JButton("Display primes"); JTextArea primes = new JTextArea(8, 40); PrimeFinder() { super("Find Prime Numbers"); setSize(400, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); BorderLayout bord = new BorderLayout(); setLayout(bord); display.addActionListener(this); JPanel topPanel = new JPanel(); topPanel.add(howManyLabel); topPanel.add(howMany); topPanel.add(display); add(topPanel, BorderLayout.NORTH); primes.setLineWrap(true); JScrollPane textPane = new JScrollPane(primes); add(textPane, BorderLayout.CENTER); setVisible(true); } public void actionPerformed(ActionEvent event) { display.setEnabled(false); if (go == null) { go = new Thread(this); go.start(); } } public void run() { int quantity = Integer.parseInt(howMany.getText()); int numPrimes = 0; // candidate: the number that might be prime int candidate = 2; primes.append("First " + quantity + " primes:"); while (numPrimes < quantity) { if (isPrime(candidate)) { primes.append(candidate + " "); numPrimes++; } candidate++; } } public static boolean isPrime(int checkNumber) { double root = Math.sqrt(checkNumber); for (int i = 2; i <= root; i++) { if (checkNumber % i == 0) { return false; } } return true; } public static void main(String[] arguments) { PrimeFinder fp = new PrimeFinder(); } } I see that main calls PrimeFinder(), but from there the other functions aren't called. Why does this work? does run() start up on its own because Runnable is implemented at the top? In c/c++ I would call the run() from withing my main(). actionPerformed isn't even called from what I can see. What makes this work? Sorry for the newb question. I just really want to learn this stuff. Thanks in advance
http://www.javaprogrammingforums.com/java-theory-questions/6994-noob-needs-some-clearing-up-java-style-programming.html
CC-MAIN-2016-30
refinedweb
338
51.44
What’s In This Chapter? Wrox.com Code Downloads for This Chapter The wrox.com code downloads for this chapter are found at on the Download Code tab. The code for this chapter is divided into the following major examples: This chapter takes a fairly practical approach to networking, mixing examples with a discussion of relevant theory and networking concepts as appropriate. This chapter is not a guide to computer networking but an introduction to using the .NET Framework for network communication. This chapter shows you how to create both clients and servers using network protocols. It starts with the simplest case: sending an HTTP request to a server and storing the information that’s sent back in the response. Then you see how to create an HTTP server, using utility classes to split up and create URIs and resolve hostnames to IP addresses. You are also introduced to sending and receiving data via TCP and UDP and find out how to make use of the Socket class. The two namespaces of most interest for networking are System.Net and System.Net.Sockets. The System.Net namespace is generally concerned ... No credit card required
https://www.oreilly.com/library/view/professional-c-6/9781119096603/c25.xhtml
CC-MAIN-2019-04
refinedweb
194
57.98
All Java classes eventually have java.lang.Object, hereafter referred to simply as Object, as a base class. Because of this, all Java classes inherit methods from Object. Half of these methods are final and cannot be overridden. However, the other methods in Object can this matters. The second theme is that methods have contracts -- defined behavior -- and when implementing or overriding a method, the contract should be fulfilled. The equals method of Object provides an example of a contract: the contract states that if the parameter to equals is null, then equals must return false. When overriding equals, you are responsible for ensuring that all the specifics of the contract are still met. Implementing clone The clone method allows clients to obtain a copy of a given object without knowing the precise class of the original object. The clone method in Object is a magic function that generates a shallow copy of the entire object being cloned. To enable shallow cloning of your class, you implement the Cloneable interface. (For a full discussion of shallow copying versus deep copying, see the sidebar below.) Since Cloneable is a tagging interface with no methods, it's simple to implement: public class BaseClass implements Cloneable { // Rest of the class. // Notice that you don't even have to write the clone method! } clone is a protected method. If you want objects from other packages to be able to call it, you must make clone public. You do this by redeclaring clone and then calling the superclass's clone method: public class BaseClass implements Cloneable { // Rest of the class. public Object clone () throws CloneNotSupportedException { return super.clone(); } } Finally, if you want some of the member data in the class to be copied deeply, you must copy these members yourself: public class BaseClass implements Cloneable { // SomeOtherClass is just an example. It might look like // this: // // class SomeOtherClass implements Cloneable // { // public Object clone () throws CloneNotSupportedException // { // return super.clone(); // } // } // private SomeOtherClass data; // Rest of the class. public Object clone () throws CloneNotSupportedException { BaseClass newObject = (BaseClass)super.clone(); // At this point, newObject shares the SomeOtherClass // object referred to by this.data with the object // running clone. If you want newObject to have its own // copy of data, you must clone this data yourself. if (this.data != null) newObject.data = (SomeOtherClass)this.data.clone(); return newObject; } } That's it. So, what mistakes should you look out for?
http://www.javaworld.com/article/2076332/java-se/how-to-avoid-traps-and-correctly-override-methods-from-java-lang-object.html
CC-MAIN-2014-42
refinedweb
397
65.62
Simple API Calls with Python Hiro Nishimura ・5 min read Learning API from Zero I am in the process of wrapping my head around the "concept" of API. For Day 1 of my API studying, I learned about venv, SQLite, Flask, and how to make basic API GET requests with a help of a Twitter friend. I am using a Mac with Terminal for this exercise. Installing Virtual Environment (venv) VENV is a lightweight virtual environment for Python that can be installed into a directory (folder) on your computer where you can essentially "run a server" to run Python without the environment impacting the rest of your computer. (Kind of like a little server "living" inside one specific folder you create?) $ pip install virtualenv // installs the Virtual Environment Create Virtual Environment I created a new folder on my Desktop and installed Python and Pip into the said folder using venv. Pip is a package installer for Python, and should come with Python if installed from their official website. $ cd Desktop // go to Desktop $ mkdir new_folder // create a new folder on Desktop called new_folder $ cd new_folder // change directory ("go into") the folder new_folder $ virtualenv venv // installs Python and Pip into new_folder $ source venv/bin/activate // activates Virtual Environment Install Flask & JSONify I installed Flask, Flask-SQLAlchemy, Flask-RESTful, and JSONify, as specified by this tutorial. Flask is a Python Web Framework, and JSONify is a minimal HTML-form to JSON to HTML-form converting plugin for jQuery. $ pip install flask flask-jsonpify flask-sqlalchemy flask-restful Download a Sample Database I downloaded a sample SQLite database from SQLite Tutorial HERE, and saved it in my folder on my Desktop that I created earlier ( new_folder). Unzip the folder and you should get a .db file. In this case, the file was named chinook.db. Create a Python Script You can create a new file in Terminal: $ touch server.py // creates file server.py in current folder You can use an IDE to edit the Python file, or you can edit it directly in Terminal by opening the file: $ nano server.py // opens server.py in Terminal To begin, you can copy and paste the script provided by the tutorial referenced above. from flask import Flask, request from flask_restful import Resource, Api from sqlalchemy import create_engine from json import dumps from flask_jsonpify import jsonify db_connect = create_engine('sqlite:///chinook.db') app = Flask(__name__) api = Api(app) class Employees(Resource): def get(self): conn = db_connect.connect() # connect to database query = conn.execute("select * from employees") # This line performs query and returns json result return {'employees': [i[0] for i in query.cursor.fetchall()]} # Fetches first column that is Employee ID class Tracks(Resource): def get(self): conn = db_connect.connect() query = conn.execute("select trackid, name, composer, unitprice from tracks;") result = {'data': [dict(zip(tuple (query.keys()) ,i)) for i in query.cursor]} return jsonify(result) class Employees_Name(Resource): def get(self, employee_id): conn = db_connect.connect() query = conn.execute("select * from employees where EmployeeId =%d " %int(employee_id)) result = {'data': [dict(zip(tuple (query.keys()) ,i)) for i in query.cursor]} return jsonify(result) api.add_resource(Employees, '/employees') # Route_1 api.add_resource(Tracks, '/tracks') # Route_2 api.add_resource(Employees_Name, '/employees/<employee_id>') # Route_3 if __name__ == '__main__': app.run(port='5002') (When I used it, we couldn't get it to run properly unless I changed from flask.ext.jsonpify import jsonify to from flask_jsonpify import jsonify so I've changed it in the script above, but try both if one doesn't work.) Exit and save the file. You can reopen server.py with nano server.py to confirm that your changes took hold. Run Python I found out that I could "run" a tiny Flask server right on my computer using venv and make API calls and run queries! I will be running server.py that we just created earlier. $ python server.py // runs server.py This command returns the following: * Serving Flask app "server" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: off * Running on (Press CTRL+C to quit) So now, the little server is puttering about in. And the database ( chinook.db) is also puttering about in port 5002 as was specified in server.py. Make API Calls We created 3 resources with the script in server.py. They are Employees, Tracks, and Employees_Name. class Employees_Name(Resource): For each, we also specified how each Route is accessed: api.add_resource(Employees, '/employees') # Route_1 api.add_resource(Tracks, '/tracks') # Route_2 api.add_resource(Employees_Name, '/employees/<employee_id>') # Route_3 So to make the API call, we can open a browser and type in the server IP address and the path specified in server.py: When I accessed that "URL," the JSON-ified GET request loaded: On the server side, I have a GET request log of the same information: 127.0.0.1 - - [09/Mar/2019 21:42:29] "GET /employees HTTP/1.1" 200 - 127.0.0.1 - - [09/Mar/2019 21:42:29] "GET /robots.txt?1552185749512 HTTP/1.1" 404 - I had made a GET call to this resource in server.py: class Employees(Resource): def get(self): conn = db_connect.connect() # connect to database query = conn.execute("select * from employees") # This line performs query and returns json result return {'employees': [i[0] for i in query.cursor.fetchall()]} # Fetches first column that is Employee ID Similar things happen when you try the other 2 resources created: Tracks and Employees_Name. For Employees_Name, the URL that we specified is /employees/<employee_id>. This means that to make the GET request for this specific resource, you choose the Employee ID that you want to request information from (I chose 5), and you would go to. The requested information about Employee ID #5 will load on your browser. CRUD CRUD stands for Create, Read, Update, Delete. With API, you can make four different types of calls: GET, PUT, DELETE, which corresponds with the CRUD functions. You should be able to GET or Create, PUT or Read, POST or Update, and Delete (self explanatory!) resources. Day 1 For a few hours' worth of learning, I think I got through quite a lot of content! Much thanks to a Twitter friend who led me through the whole process! Otherwise I would've been stuck at step 1, completely lost. Articles/Tutorials - Building a Basic RestFul API in Python - This is how easy it is to create a REST API - Pipenv & Virtual Environments - Why is Flask a good web framework of choice? - What is CRUD? Good job in starting out, I would suggest you can take a look at my series on building REST APIs through the use of flask, postman and pytest. I hope it might be useful for you too as I use Postman a lot in my daily work in building APIs. Building Restful API with Flask, Postman & PyTest - Part 1(Read Time: 6 Mins) Max Ong Zong Bao Building Restful API with Flask, Postman & PyTest - Part 2 (Read Time: 10 Mins) Max Ong Zong Bao Building Restful API with Flask, Postman & PyTest - Part 3 (Read Time: 20 Mins) Max Ong Zong Bao
https://dev.to/hiro/learning-api-for-newbies-day-1-294
CC-MAIN-2019-26
refinedweb
1,194
65.73
Hello - first post here - hopefully someone can help :) Im fairly new to C++, I've got MS Visual and I was experimenting the other day and came across a problem. I found a simple script and entered it into MS Visual. So I entered that into MS VIsual, Complied it and found the finished product.So I entered that into MS VIsual, Complied it and found the finished product.PHP Code: #include <iostream> using namespace std; void main() { int min=0, max=0, i=0; cout << "Input your first number to count from: "; cin >> min; cout << "Input your last number to count to: "; cin >> max; for(i=min; i <= max; i++) { cout << i << endl; } } I opened the .exe and the black screen appeared. It asked me for the first number - I entered it It asked me for the second number - I entered it Then as soon as I have pressed return it showed me the numbers inbetween for about 0.1 of a second and shut down. I know that after I press return it should say "press any key to continue" On mine - it doesnt. So basically does anyone know why is executes after that command, and how I can fix it... By the way I have tried with more than one script and it always shuts down at the end. Thanks in advance Mark :rolleyes:
http://cboard.cprogramming.com/cplusplus-programming/19852-exe-executing-after-final-command-printable-thread.html
CC-MAIN-2014-52
refinedweb
227
78.38
ODBC Class generator WEBINAR: On-demand webcast How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER > Most of the time, I had to display thousands of records in a list view. Using the CRecordset, it takes a lot of time. MFC also provides a way to do bulk fetch but it is tedious to implement. A simple comparison: The code generated by this tool along with virtual list view gets and displays 5000 records from SQL server database in justone second! Whereas, using the CRecordset, it takes around 20 seconds. These numbers are based on 266 MHz Pentium with 64MB RAM.. Features - Easily create a class which uses Bulk Row Fetching for faster data retrieval - Uses direct ODBC SDK calls which are easy to understand and flexible to modify - More methods can be easily added to the object - Creating Joins and using other SQL features is very easy, since the object uses direct SQL statements Usage of the Product Using the Class Generator is easy. - Click Open to display the list of Data Sources - Select the Data Source and click Next - Select the Table or View you want to use and click Next - Click Finish A list view displays the columns in the table along with the default member variables. You can easily change the name of the member variable and if you want to exclude any column from the object, you can do that by simply clicking Remove button. After changing /removing the variable names, click the Create button to open the Generate Dialog box. It shows the default values based the on the table name. After modifying the values click the OK button to generate the code. You can also print this list. Following is a sample header file generated by this tool: /* **ConsultantsSet.h **CONSULTANTS Definition file */ #if !defined(__DB_CONSULTANTS_FIELDS__) #define __DB_CONSULTANTS_FIELDS__ #ifndef __AFXTEMPL_H__ #pragma message("Include AfxTempl.h in StdAfx.h for faster Compilation") #include <afxtempl.h> #endif #define CONSULTANTS_NAME_SIZE 31 #define CONSULTANTS_HOME_ADDRESS_SIZE 81 #define CONSULTANTS_CLIENT_NAME_SIZE 31 #define CONSULTANTS_CLIENT_ADDRESS_SIZE 81 //Internal Cache for the data typedef struct { long m_ID; SDWORD m_IDInd; char m_Name[CONSULTANTS_NAME_SIZE]; SDWORD m_NameInd; char m_HomeAddress[CONSULTANTS_HOME_ADDRESS_SIZE]; SDWORD m_HomeAddressInd; char m_ClientName[CONSULTANTS_CLIENT_NAME_SIZE]; SDWORD m_ClientNameInd; char m_ClientAddress[CONSULTANTS_CLIENT_ADDRESS_SIZE]; SDWORD m_ClientAddressInd; }FF_DB_CONSULTANTS_FIELDS, *pFF_DB_CONSULTANTS_FIELDS; //structure to hold the final data typedef struct { long m_ID; CString m_Name; CString m_HomeAddress; CString m_ClientName; CString m_ClientAddress; }DB_CONSULTANTS_FIELDS, *pDB_CONSULTANTS_FIELDS; //Class Definition class CConsultantsSet { public: //Standard constructor CConsultantsSet(CDatabase* pDB = NULL); //Standard Destructor ~CConsultantsSet(); //Operations bool GetSpecific(pDB_CONSULTANTS_FIELDS); bool Insert(pDB_CONSULTANTS_FIELDS); bool Update(pDB_CONSULTANTS_FIELDS); bool Delete(pDB_CONSULTANTS_FIELDS); int Load(); //Attributes CTypedPtrArray <CPtrArray, pDB_CONSULTANTS_FIELDS> m_aData; private: CDatabase* m_pDatabase; HSTMT m_hstmt; int m_nRowSetSize; }; #endif /* ** end file */ The header file contains two structures FF_DB_CONSULTANTS_FIELDS and DB_CONSULTANTS_FIELDS. The first one is used for bulk row fetching. The second is used to in a CTypedPtrArray and contains the actual data. Using the Generated Code in your Application In order to use this class in your application, create a regular MFC application with database header support. The View can be either CFormView or CListView . In this example, m_List is a CListCtrl. #include "ConsultantSet.h" void OnInitialUpdate() { . . . CConsultantSet tblSet(&theApp.m_DB); int nCount = tblSet.Load(); for (int I = 0; I < nCount; I++) { pDB_CONSULTANT_FIELDS pdbFields = tblSet.m_aData.GetAt(I); m_List.InsertItem(I, pdbFields->m_Name; m_List.SetItemText(I, pdbFields->m_ClientName); } } If you want to insert an item to the table, CConsultantSet tblSet(&theApp.m_DB); DB_CONSULTANT_FIELDS dbFields; dbFields.m_ID = 100; dbFields.m_Name = "Some Name"; // Fill in rest of the fields tblSet.Insert(&dbFields); Rest of the functions, follow the same standard and very easy to understand. I always use a single CDatabase object in the Application class. Create a CDatabase member variable in the CWinApp derived class and also make the 'theApp' as extern in the header file. This way, you don't have to use AfxGetApp() and typecast it every time. This tool generates the code which can be compiled in VC++ 5.0. With minor modification, it can be used with any C++ compiler. I have tested this tool with MS Access and SQL Server only. So there may be a few bugs. If you encounter any bugs, please email me. I would appreciate your ideas for enhancements. Acknowledgments: I would like to thank the CodeGuru contributors for List Control and Bitmap buttons I have used in this tool. "Driver Not Capable !!"Posted by Legacy on 08/01/2002 12:00am Originally posted by: TVK After i have selected the table to be modeled, i get the "Driver Not Capable" message... Any ideas as to why ? i run on VC6 and Oracle 8.07Reply New versionPosted by Legacy on 11/18/2000 12:00am Originally posted by: jack zhang AppBuilder--A complete truly visual C/C++ IDE.it offers Microsoft Foundation Class developers a complete library of MFC extension classes that implement Authentic Looking GUIs like those seen in Microsoft money 2000? AppBuilder can help developers develop application with database.The classes fit seamlessly with MFC and inherit many of MFC's existing classes. You can now easily give your database application the MS money look, without going broke! that's not all,AppBuilder is also a code generater,it can generate database code based on ODBC API or MFC ODBC, this can help you develop manage information system easily and quickly. if you want learn more about appbuilder,Please visit: When is new version available & Where????Posted by Legacy on 04/01/2000 12:00am Originally posted by: Mike Malter When and where is the new version going to be available?Reply Good Program, but more bugsPosted by Legacy on 03/19/2000 12:00am Originally posted by: Tim Hein Great program. I did find some bugs though.Posted by Legacy on 03/10/2000 12:00am Originally posted by: PeterK I did contact Shekar with this information months ago, but I thought I should save some people some headaches. The memcpy commands need to be implemented somewhat differently. One variable is a character string (char *) the other is a CString. Here is an example of what the memcpy should look like: memset( HostData.m_Type, 0x00, sizeof(HostData.m_Type) ); memcpy(HostData.m_Type, (LPCTSTR)pData->m_Type, min(pData->m_Type.GetLength(), sizeof(HostData.m_Type) - 1)); HostData.m_TypeInd = SQL_NTS; Also the SQL indicator for variables that are numbers are not initialized. The easiest way to insure your program does what you expect it to do is to memset the entire HostData structure to NULL before calling the desited function from the ODBC API. This will also save you many lines of code because you no longer have to initialize each member of the HostData structure. Other than those two small problems this is a great program, very handy. Reply New Version Available!Posted by Legacy on 03/06/2000 12:00am Originally posted by: Shekar Narayanan Download the latest version from Sorry! Due to some problem with the ISP, this location is not available. I'll post the new version in some other location. Check later. Thanks Reply ODBC GeneratorPosted by Legacy on 08/12/1999 12:00am Originally posted by: Pat Sherrill nCount seems to always return 0(using Version 2). What am I doing wrong? As an aside the SQL Query generator forces upper case. I beleive this should be case sensitive for column name containing upper and lower case. I have many file handlers whose fields/columns are case sensitive (eg Ctree MySql). ThanksPosted by Legacy on 05/14/1999 12:00am Originally posted by: zhouuashan I'm looking for a tool to like crecordset to manage my gis data.Reply This is just i need! thank you! Great wizard!Posted by Legacy on 05/12/1999 12:00am Originally posted by: Jay Wheeler I'm using it in a current SQL Server 7 project, and it makes the whole process of working with direct SQL a lot easier! The only problem I have had with it is that it does not like the SQL type "nvarchar", but this is of little consequence to me, as the tables are really "char" of fixed type. Thanks for a great tool!Reply
http://www.codeguru.com/tools/standalonetools/article.php/c1359/ODBC-Class-generator.htm
CC-MAIN-2017-43
refinedweb
1,348
56.05
Articles 1/28/2013: ...8/24/2012 Overture Welcome to part 2 of our 3 part series of putting some basic windows phone concepts together. In this post we'll talk about making our app OAuth friendly (allowing user to post status feeds on Facebook). However before diving into codebase I will first present a summary of concepts involved to make it easier to comprehend for novice users. You may directly jump to section, "Facebook C# SDK" for code. Why not use Windows Phone built-in sharing mechanism? Though interaction with social networks is built into Windows Phone by means of launchers like ShareLinkTask class, our specific scenario requires that feeds be published from background process without user interaction which means that launchers can no longer be in play since a launcher is a point of interaction between user and the app to perform a task. The snapshot depicts launcher screen, ...8/2/2011. ...5/26/2011 by WindowsPhoneGeek Windows Phone Developer Tools 7.1 Beta (Mango) introduces several new launchers and choosers. From your WP7 application you can now choose an address, save a ringtone, retrieve contact details, etc. So, in this article I am going to talk about how to How to choose Contact and get Contact details in a Windows Phone 7 application. Previously we covered all WP7 Launchers and Choosers in our Launchers and Choosers "How to" series of posts. So now it is time to update this series with a few new posts. NOTE: Before we begin make sure that you have installed the Windows Phone Developer Tools 7.1 Beta(Mango). Using AddressChooserTask to choose a Contact Generally AddressChooserTask launches the Contacts application and allows the user to select a contact. If the user completes the task, the Completed event is raised and the event handler is passed an AddressResult object which exposes a string containing the physical address and the display name for the selected contact. in order to use this task at first include the following namespace: using Microsoft.Phone.Tasks; Example:Here is how you can get DisplayName and Address related to the selected contact: ...11/5/2010 In the last six posts I explained everything you need to know about the different windows phone 7 tasks. As a conclusion of the "How to" series I would like to post a list of all the topics I covered: ...11/4/2010 In this post I will talk about how to use the different Marketplace associated tasks in a Windows Phone 7 application. For more information about all available tasks take a look at the "Launcher and Choosers - introduction" post.(); ...11/4/2010. ...11/2/2010(); } ...10/29/2010 In this post I will talk about how to perform different phonenumber manipulations through the WP7 Launcher and Choosers APIs. You can check the "Launchers and Choosers - introduction" post form reference. Now it is time to focus on the PhoneNumber tasks : SavePhoneNumberTask, PhoneNumberChooserTask, , PhoneCallTask It is a pretty common scenario for a phone app to : - add new phone number to the contact details - select a particular phone number from the existing ones. - make a phone call. ...10/29/2010
http://www.geekchamp.com/articles/tag?name=tasks
CC-MAIN-2016-36
refinedweb
526
60.45
Learning Notes - Understanding the Weird Parts of JavaScript 标签 : 前端 JavaScript [TOC] The learning notes of the MOOC "JavaScript: Understanding the Weird Parts" on Udemy,including most important parts of JavaScript. - Course link: JavaScript: Understanding the Weird Parts - My Certification: UC-CWVEBCC5 Basic concept Conceptual Aside Conceptual Aside: Syntax Parser: a program that reads your code and determines what it does and if its grammer is valid Lexical Environment: where something sits physically in the code you write Execution Context: a wapper to help manage the code that is running Name/Value Pair: a name which maps to a unique value Object: A collection of Name/Value pairs undefined: a special value/a special keyword that JavaScript has within it internally that means that the value hasn's been set.It means that this is the value that was initially set by JavaScript. single threaded: one command is being executed at a time.It may not be under the hood of the browser. synchronous: one at a time and in order. dynamic typing: you don't tell the engine what type of data a variable holds,it figures it out while your code is running. operator: a special function that is syntatically (written) differently. coercion: converting a value from one type to another. by value vs. by reference: all primitive types are by value and all objects are by reference. array: collections of anything. inheritance: one object gets access to the properties and methods of another object. built-in function constructors: objects created by them have all the properties and methods on the functions' prototypeproperty and what's boxed inside of it is the primitive value itself.The built-in function constructors look like you're creating primitives but you're not,you are creating objects that contain primitives with a whole bunch of features. Framework Aside Framework Aside: - default value: e.g. window.libName = window.libName || "lib 1" - namespace: a container for variables and functions. - function overloading: JavaScript doesn't have it.There are other appoaches to deal with it. - whitespace: invisible characters that create literal "space" in your written code,like carriage returns,tabs, or spaces. - IIFEs and safe code: by wrapping code in an immediately invoked function, does not interfere with crash into,or be interfered by any other code that might be included in your application. - function factory: a function that returns or makes other things for you. Dangerous Aside Dangerous Aside: - automatic semicolon insertion: if you're going to return an object from a function,you need to type the {right after returnrather than in a new line. newand functions: don't forget the key word newin front of the function constructors,or you'll probably get undefinedreturned and cause in trouble.You'd better always have a capital letter as the name of the constructor. - built-in function constructors: strange things can happen during comparison with operator and coercion.In general,it's better not to use them.Use literals. - arrays and for..in: in the case of arrays,don't use for..inbecause arrays are objects in JavaScrip and their items are added properties. Execution Context and Lexical Environment Execution Context Execution Context(Global) was created at global level by the JavaScrip engine, and two things were also created for you: - Global Object - A special valiable called this When you open the file inside your browser, this object is the window object,which refers to the browser window.That is to say: this object equals window object at global level in this case. Global means "Not Inside a Funciton". Global variables and functions get attached to the global object. hoisting: variables and functions are to some degree available even though they're written later in the code. The phenomenon is because the exection context is created in two phases. - creation phase: global object and thisset up in memory,an outer environment, also set up memory space for variables and functions(this step called hoisting). - execution phase: runs the code you've written line by line,interpreting it,covering it,compling it,executing it. All variables in JavaScript are initally set to undefined,and functions are sitting in memory in their entirety. Function Invocation invocation: running a function.In JavaScrip,by using parenthesis (). Execution Stack: top execution context in the stack is the currently executing function.A new execution context is created and put on top of the stack for the function invoked,and popped off the stack when the function finished. Variable Environment: where the variables live.And how they relate to each other in memory. Every execution context has a reference to its outer environment.(that is to say,to its lexical environment) execution context vs. outer environment reference: - execution context is created when you invoke a function. - outer environment reference is created for the execution context and it looks at where the code is physically written in the JavaScrip file.(A different way of thinking about it: the outer reference is to the execution context in which the function was created.) Here is an example: function c(){ console.log(myVar);//1 (4th line) } function b() { var myVar; console.log(myVar);//undefined (3rd line) } function a() { var myVar = 2; console.log(myVar);//2 (2nd line) b(); c(); } var myVar = 1; console.log(myVar);//1 (1st line) a(); console.log(myVar);//1 (5th line) // result is (five lines): 1 2 undefined 1 1 Scope Chain:those links of outer environment references where you can access variables. scope: where a variable is available in your code. asynchronous: more than one at a time.(Asynchronous part is about what's happening outside the JavaScrip engine rather than inside it.) Any events that happen outside of the engine get placed into the event queue,an if the execution stack is empty,if JavaScrip isn't working on anything else currently,it'll process those events in the order they happend via the event loop synchronously. Types and Operators There are six primitive types in JavaScrip. primitive type: a type of data that represents a single value.That is,not an object. - undefined: represents lack of existence - null: represents lack of existence - boolean: true or false - number: floating point number.There's only one 'number' type. - string: a sequence of characters.Both 'and "can be used. - symbol: used in ES6 precedence and associativity: - operator precedence: which operator function gets called first. - associativity: what order operator functions get called in: left-to-right or right-to-left. Reference: Operator precedence == vs. === ==will try to coerce the values if the two values are not the same type. ===doesn't try to coerce the values.It's strict equality. Reference: Equality comparisons and sameness The example below shows the usage of coercion to check for existence and is used in a lot of really great frameworks and libraries. var a; //goes to internet and look for a value if(a){ console.log("Something is there"); } or opertator ||: if you passed it two values that can be coerced to true and false,it will return the first one that coerces to true. Objects and Functions Object have properties and methods: - Primitive "property" - Object "property" - Function "method" Both [] and . can find the property on the object and give you the value. var person = new Object(); person["firstname"] = "Brian";//use brackets [] person.lastname = "Way";//use dot . Object literal vs. JSON string - The object literal syntax uses the curly braces to define name and value pairs separated by colons. - JSON stands for JavaScript Object Notation.It looks like object literal syntax except for some differences.For example,property names have to be wrapped in quotes.JSON is technically a subset of the object literal syntax. JSON.stringify({firstname : "Brian", student: true}) JSON.parse('{"firstname":"Brian","student":true}'); First class functions: everything you can do with other types, you can do with functions.(Assign them to variables,pass them around,create them on the fly.) In JavaScrip,functions are objects.The function is an object with other properties,that is to say, a function is a special type of object.Two main other properties: - it has a hidden optional name property which can be anonymous then if you don't have a name. - we have code property that contains the code and that code property is invocable so we can run the code. expression: a unit of code that results in a value. Statement just does work and an expression results in a value. mutate: to change something. The keyword this points to what? Let's see an example. var c = { name: 'The c object', log: function() { this.name = 'Updated c object'; //this points to c object console.log(this); var setname = function(newname) { this.name = newname; //this points to the global object } setname('Updated again! The c object'); console.log(this); //this points to c object } } c.log(); In the example above,the internal function setname when its execution context was created,the this keyword points to the global object,even though it's sitting kind of inside an object that I created.To avoid this case,just use var self = this;(set equal to by reference) as the very first line of your object method. An array can be created in the following formmat: var arr = new Array(); var arr = [1, 2, 3]; Array in JavaScript is zero based and dynamically typed,it figures out what type of things are on the fly. arguments: the parameters you pass to a function.JavaScript gives you a keyword of the same name which contains them all.Although arguments doesn't contain the names of arguments,just the values,you could use it like an array.A new thing is called a spread parameter. ...other means take everything else and wrap it into an array of this name "other". IIFEs IIFEs - an immediately invoked function expressions // using an Immediately Invoked Function Expression (IIFE) var greeting = function(name) { return 'Hello ' + name; }('John'); To wrap your function in parentheses.This is when you want a function expression instead of normal function statement. //valid syntax but output nothing (function (name) { console.log("Hello " + name); }); // IIFE (function (name) { console.log("Hello " + name); }("Brian")); //also OK (function (name) { console.log("Hello " + name); })("Brian"); understanding closures Even though the outer function ended/finished,any functions created inside of it when they are called will still have a reference to that outer function's memory. Outer function is gone,the exectution context is gone.But what's in memory for that execution context isn't and JavaScript engine makes sure that the inner function can still go down the scope chain and find it. In this way we say that the execution context has closed in its outer variables.And so this phenomenon,of it closing in all the variables that it's supposed to have access to,is called a closure. This is the feature of the language JavaScript,very important. callback function: a function you give to another function,to be run when the other function is finished. call(),apply() and bind() All functions in JavaScript also get access to some special functions/methods, on their own.So all functions have access to a call method,an apply method and a bind method. bind()creates a new copy of whatever function you're calling it on.And then whatever object you pass to this method is what the thisvariable points to by reference. call()invokes the function you're calling it on.Also let you decide what the thisvariable will be.Unlike bind()which creates a new copy, call()actually executes it. apply()does the exact same thing as call()except that it wants an array of parameters as the second parameter rather than just the normal list. These functions can be used for function borrowing and function currying. function currying: creating a copy of a function but with some preset parameters. some open source libraries: Object-Oriented JavaScript and Prototypal Inheritance Classical vs. Prototypal Inheritance: - Classical Inheritance: verbose - Prototypal Inheritance: simple All objects include functions hava a prototype property.The prototype is simply a reference to another object. The prototype chain,the concept of prototypes is just I have this special reference in my object that says where to look for other properties and methods without manually going dot prototype. reflection: an object can look at itself,listening and changing its properties and methods. tip: the "for in" actually reached out and grabbed every property and method not just on the object but also on the object's prototype extend: here we just talk about the extend function in underscore.You can combine and compose objects in this extend pattern with relection,not just the prototype pattern. Building Objects function constructors: a normal function that is used to construct objects.(The this variable points a new empty object,and that object is returned from the function automatically.) There are many approaches to building an object: - object literal syntax: {} - the key word new: var john = new Person(); - first, an empty object is created. - then, it invokes the function with the thisvariable pointing to that empty object. - last, return the object if you don't return anything explicitly,or return what is returned in the function. Object.create: creates an empty object with its prototype pointing at whatever you have passed in to Object.create. - you can simply override/hide properties and methods on those created objects by setting the values of those properties and methods on new objects themselves. - ES6 and classes: another approach but still works the same under the hood,just syntactic sugar. - key word class: class is not the template or definition like other languages such as Java/C++,class is also an object. - key word extends: sets the prototype( __prototype__) for any of the objects created with this class. .prototype: this prototype property of all functions is where the prototype chain points for any objects created using that function as a constructor. - The prototypeproperty on a function is not the prototype property( __prototype__) of the function. - It's used only by the newoperator.In other cases,it's just an empty object,hanging out there. - It's the prototype of any objects created if you're using the function as a function constructor. - takes up less memory space if you add method to the prototype because it'll only have one,while it'll have many copies if you add it to function constructor. polyfill: code that adds a feature which the engine may lack. // polyfill if (!Object.create) { Object.create = function (o) { if (arguments.length > 1) { throw new Error('Object.create implementation' + ' only accepts the first parameter.'); } function F() {} F.prototype = o; return new F(); }; } syntactic sugar: a different way to type something that doesn't change how it works under the hood. Odds and Ends initialization: when come accross a large initialization of objects,don't get overwhelmed by the syntax. typeof and instanceof: typeof: it's an operator(essentially a function) that takes a parameter returns a string.It will tell you under most cases what something is. Object.prototype.toString.call(arr)gets array type( [object Array]) returned,or you'll get objectreturned. typeof undefinedreturns undefined typeof nullreturns object.It's been a bug since forever. instanceof: tells if any object is down the prototype chain.It will tell you what something has in its prototype chain. transpile: convert the syntax of one programming language to another. - Typescript - Traceur(Traceur is a JavaScript.next-to-JavaScript-of-today compiler) - features of ECMAScript 6 作者@brianway更多文章:个人网站 | CSDN | oschina
https://my.oschina.net/brianway/blog/892766
CC-MAIN-2019-18
refinedweb
2,595
57.77
I have a 800×800 array and I want to analize just the elements in the outter part of it. I need a new array without the elements of the slice [5:-5,5:-5]. It doesn’t necessarily have to return a 2d array, a flat array or a list will do as well. Example: import numpy >>> a = numpy.arange(1,10) array([1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> a.shape = (3,3) array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) I need to discard the core elements, something like: del a[1:2,1:2] I expect to have: array([1, 2, 3, 4, 6, 7, 8, 9]) I tried to use numpy.delete() but it seems to work for one axis at a time. I wonder if there is a more straight forward way to do this. Best answer You can use a boolean array to index your array any way you like. That way you don’t have to change any values in your original array if you don’t want to. Here is a simple example: >>> import numpy as np >>> a = np.arange(1,10).reshape(3,3) >>> b = a.astype(bool) >>> b[1:2,1:2] = False >>> b array([[ True, True, True], [ True, False, True], [ True, True, True]], dtype=bool) >>> a[b] array([1, 2, 3, 4, 6, 7, 8, 9])
https://pythonquestion.com/post/how-to-remove-an-2d-array-subset/
CC-MAIN-2020-16
refinedweb
232
81.43
Arrays.Thanks so much, that really helped a lot! Arrays.Hi everyone! I was wondering is someone was able to assist me with this question. I'm trying to find... For Loop Question! need assistance!yeah, i am sorry about that, heres the code i attempted: #include <iostream> using namespace std; i... For Loop Question! need assistance!I would be awesome if some can help me out with this :) For Loop Question! need assistance!Yes, since i am currently studying for loops, my teacher wants us to try and use for loops for this This user does not accept Private Messages
http://www.cplusplus.com/user/SamT/
CC-MAIN-2015-06
refinedweb
101
76.32