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
SML: Simplifying XMLby Robert E. La Quey November 24, 1999 "One should not increase, beyond what is necessary, the number of entities required to explain anything " William of Ockham (1285-1349) Much has been written about the "XML Revolution", and the advantages of XML's readily implementable nature. It is clear from the origins of XML and the avowed goals of the W3C that simplicity is a primary driver. The abstract of the W3C XML 1.0 Recommendation states: ." Of late, there are those that are thinking beyond this simplification of SGML into XML, and are pushing for an even simpler standard. Simple Markup Language (SML) is the newly-coined name for a de facto stripped-down variant of XML being used by two groups of developers. The first of these groups of SML users comprises those who believe that the revolution stopped too soon. The second, a much larger group, started using the core of XML and have no need for additional complexity. The first group knows its XML history and believes that SGML revisionists added document-centric complications that complicate XML beyond what is really needed for data-centric applications both on and off the Web. In fact, the reality is that many developers are already using a Simple Markup Languageessentially XML without DTDsto build useful systems. Simplifying XML In a recent message to the XML developers' mailing list XML-dev, Don Park explored a definition of SML. He characterized it as a subset of Canonical XML (a standard form of XML being specified by the W3C), but having: - No Attributes - No Processing Instructions (PI) - No Document Type Declaration (DTD) - No non-character entity-references - No CDATA marked sections - Support for only UTF-8 character encoding - No optional features The technical case against attributes is very strong. Kent Sievers has pointed out that "Two ways of representing the simplest of data (a name/value pair) has caused a fracture that has propagated through the DOM, DTDs, namespaces, queries, schemas, etc. and the higher it goes the more problems it is causing." The only argument for keeping attributes seems to be legalistic precedence, that is, "we made that mistake so long ago that we cannot fix it now." Kent goes on to note: "As evidence of this I give: 1) almost every other object oriented language in existence. author.name.firstname = 'joe' is easy to understand and, since even an INT is an object and even an "=" is a function, is done entirely in the spirit of "elements only" and 2) the obvious nature of everyone's first XML tutorial in which they are typically shown something like <Author><FirstName>joe<FirstName/><Author/> and understand it completely." Many developers who use a subset of XML -- using as much as needed to meet their application needs, but leaving out attributes, DTDs, processing instructions, and non-character entity-references -- don't understand the fuss. These users have been nicknamed Simpletons, as opposed to the docucentric DocHeads. Despite the sanguine position of the Simpletons, Park's message kicked off a thread of debate unusual in its length and diversity even for the frequently verbose people that hang out on XML-dev. So what is the big deal? Well for starters, as Michael Champion, wrote "What Don Park is doing is trying to get us to figure out what in XML is of 'fundamental significance' and what is merely a residue of the SGML legacy and impedes understanding, implementing, processing and using XML in the real world." One measure of the success of XML is to be found in the law of unexpected consequences. Developers are using XML for all sorts of purposes that its creators did not consider. Those complications remaining in XML from the document-focused days of its origin are unneeded and unwanted by this new class of XML developer. From the widespread de facto usage of a simple markup language emerges a call for standardization of that language as a well-defined subset of XML. The rapid spread of XML into areas other than Web publishing technology is a testimony to the advantages available to the development community from open standards and open source software. Thanks to the widespread availability of excellent XML parsers, especially James Clark's expat, a large number of developers have had a chance to experiment with XML in many ways that do not involve conventional documents. To further engage even the Desperate Perl Hacker, expat has been made available as a Perl module, XML::Parser, by no less than Larry Wall and Clark Cooper. A typical quote from the mailing list for Jabber (an open-source ICQ-like messaging system) demonstrates this point: "Anyone should compile the sample/elements.c file from the expat package and pipe something like<login> <user>jeremie</user> <pass>ph0niks</pass> <name>jabalot</name> </login>into it. That was an 'ahaaa' experience for me." Tue Wennerberg All over the world, developers have had this 'ahaaa' experience and are applying what is in fact SML to the solution of real problems that often have little or nothing to do with documents. Examples of this data-centric usage of XML include: - XUL, the user interface language in Mozilla - Configuration files: many programs are finding XML a convenient way to store configuration data in a flexible, future-proof manner - Messaging: the above-mentioned Jabber messaging system uses XML as a base for its protocols. The XML-RPC and SOAP efforts use simple XML to achieve their ends. This is without mentioning the vast efforts being made in e-business protocols which use a reduced-feature subset of XML. All of these data-centric applications just don't need to use the more complex machinery available in the full XML 1.0 specification. This ubiquity of XML is well-put by Mark Birbeck: "Now, am I using XML? Well of course I am, but I am also using binary, electricity, RDBMS, C++, COM, blah, blah, blah. Sure, XML is still new enough for it to have its own mailing listjust like electricity would have done if it could have ... Eventually XML will be 'seen' by the equivalent of 'particle physicists' today. The rest of us mere mortals will use their parsers, editors, class libraries, protocols, and so on". The motivation of the SML camp is to tie down this ubiquitous XML subset and make it as well-defined as XML is itself. Reaction from the XML establishment A number of the leading figures in the XML community have not been amused by the SML discussions. This is understandableany call for experts to re-examine their basic assumptions, to go back to ground zero, is guaranteed to evoke strong reactions. Especially when it comes at a time when the experts thought they had already done just that. XML is, after all, a vast simplification of SGML. A challenge to authority coming from a groundswell of outsiders is also seldom welcome: William of Ockham was forced to flee the papal court at Avignon for Germany because of his calls to simplify the accepted philosophy of "scholasticism" and his opposition to the temporal authority of the Pope. Mark Birbeck, quoted above for noting the ubiquity of XML, counts himself among those against SML. He argues that the time for talking about XML variants is past. It is now time to move up the chain of abstraction. The advocates of SML do not disagree about the need to look upward, but do ask "Up from what base?" and "With what intellectual baggage?" David Megginson, parser developer and leader of the initiative that created SAX, the Simple API for XML, is critical of the SML push. His perspective is that of a victorious XML revolutionary. "If we could go back in time, I'd be happy to argue that notations, unparsed entities, and some other junk be removed from XML 1.0," he said, "but it's too late now, and we won anyway." Megginson argues that people can simply leave things out when using the parser. The underlying problem of a "admittedly slightly-pudgy (though not bloated) XML grammar" is not worth fixing, simply because another dialect of XML will only split the community and lead to further confusion. Unfortunately, there is already a lot of confusion. The aspects of XML that are optionalin the sense that they are there, but you don't need to use themcreate havoc for the beginner. Simon St. Laurent, author of several XML books and defender of the XML newbie, sympathizes with the simplifiers. "I'd much rather see developers start from the simplest possible base and build out than require them to understand all of the parts involved in XML 1.0". This is a point of general agreement among the supporters of SML, who go on to point out that SML is evolving into a very well-defined and quite specific subset of XML. They ask, Why should this cause the existing XML community any problems? The SML perspective is not that SML is a watered-down SGML, despite its origins, but that it is an enabling technology for a vast array of applications, many of which are not even yet on the horizon. Like binary and electricity, they ask us to examine the fundamentals and listen closely to William of Ockham's sage advice from 700 years ago, even at risk of offending the establishment. Where does the SML movement go from here? It seems likely that an SML specification will be developed by paring down the existing W3C XML 1.0 Recommendation. Perhaps this will be submitted to the W3C for discussion, but it is more likely to be short and simple enough to send directly to the XML-dev mailing list for a larger and more open discussion. It could be great fun and attract a new crowd to the debate. The SML specification needs to be widely promulgated to other venues for discussion as well. Should a viable specification for SML emerge from such a discussion, then the creators of the specification will decide whether to take it to the W3C for review, or to the IETF as an Internet Draft. Since a Simple Markup Language is already a reality in many applications, there is some urgency to setting the standard in place. Such a standard is not likely to be difficult to define, nor is there good reason for it to be particularly controversial, so it should not take long for it to appear. Expect to see the draft no later than mid-December and a standard by January. A nice way to start the new millennium (or end the old one, depending on your choice of standards). The SML enthusiast can then start the new year with a well-defined standard that makes good use of existing XML tools. A clean slate is available to explore a wide range of issues and to build applications using the fundamental, almost molecular, structure inherent in SML. Several paths can then be explored as we develop understanding and experience with XML fragments, schemas, XPath, XSLT and the like. The opportunity to leverage other powerful technologies, for example MIME in XML, will also be easy to explore with SML. Look for a period of serious experimentation and innovation as developers all over the world realize the power of SML. Look, too, for continued scrutiny of each new XML-based technology. The Simpletons will continue to defend William of Ockham's razor -- even if a few cardinals and popes are offended.
http://www.xml.com/pub/a/1999/11/sml/
crawl-002
refinedweb
1,923
57.81
Hi all, I have an app that I’ve been happily building for a few months with Expo and I’ve really enjoyed the developer experience. Lately, though, I’ve been rejected from the Apple App Store for Stripe payment integration. The strange thing is I don’t use or reference the Stripe API anywhere in my code. After a few back-and-forths with an Apple reviewer this is what they’re seeing: the app still contains API calls to api.stripe.com/v1in its STPAPIClientclass as well as Stripe support in its EXTPSStripeManager, STPBankAccount, STPPaymentConfigurationand EXTPSStripeManager, among others. Here are the relevant details of my app: - built with vanilla Expo (i.e. not detached using expo-kit) - SDK v31.0.0 (latest as of writing) - no reference anywhere in JS code to the Expo Stripe API - native builds use Expo’s excellent build service via the Expo CLI - I’ve successfully submitted to and passed App Review for this app with previous builds The main change between the last version of my app that passed App Review and the first one that failed due to Stripe integration: I started using the Branch API. A few questions: - Could an import of Branch(which also lives in the DangerZonenamespace) in my JS code somehow (accidentally) signal to the Expo build service that the Stripe SDK should be bundled into the binary? - Is there a way to tell whether or not my *.ipa built with the Expo CLI includes the Stripe SDK calls that Apple is finding? I’ve tried unzipping and sifting through the .ipa package but grepping EXTPSStripeManager etc reveals nothing. - I do see a Stripe.bundlefile included in the native build, but if I start a new Expo project from scratch ( expo init) and build via the Expo CLI without any changes it also includes Stripe.bundle. - I see a ~50MB difference in file size between the rejected build .ipa and one where the only change was removing references to DangerZoneand Branch. I still see Stripe.bundle in the new binary, but could the 50MB account for the removal of Stripe integration? Is there any way to know for sure (decompile?) Some other relevant points that I’ve read up on: - As of the SDK v21 announcement the Stripe SDK should no longer be included in binaries built with the Expo standalone builder. - Apparently the Expo builder service used to include support for the past 6 SDK versions by default but according to James Ide’s blog post newer builds only include the latest SDK. My app binaries have definitely been built since this change was put into place so we can rule this out as a possibility. Has anyone else experienced this problem? Are there any other relevant details I can provide to help diagnose my problems? Thanks in advance for any and all help. Cheers, Eric
https://forums.expo.io/t/rejected-from-app-store-for-stripe-payments-integration-but-i-dont-use-stripe/16837
CC-MAIN-2019-09
refinedweb
480
62.07
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO | NOTES #include <sys/mhd.h> The mhd ioctl(2) control access rights of a multihost disk, using disk reservations on the disk device. The stability level of this interface (see attributes(5)) is evolving. As a result, the interface is subject to change and you should limit your use of it. The mhd ioctls fall into two major categories: One ioctl, MHIOCENFAILFAST, is applicable to both non-shared and shared multihost disks. It is described after the first two categories. All the ioctls require root privilege. For all of the ioctls, the caller should obtain the file descriptor for the device by calling open(2) with the O_NDELAY flag; without the O_NDELAY flag, the open may fail due to another host already having a conflicting reservation on the device. Some of the ioctls below permit the caller to forcibly clear a conflicting reservation held by another host, however, in order to call the ioctl, the caller must first obtain the open file descriptor. Non-shared multihost disks ioctls consist of MHIOCTKOWN, MHIOCRELEASE, HIOCSTATUS, and MHIOCQRESERVE. These ioctl requests control the access rights of non-shared multihost disks. A non-shared multihost disk is one that supports serialized, mutually exclusive I/O mastery by the connected hosts. This is in contrast to the shared-disk model, in which concurrent access is allowed from more than one host (see below). A non-shared multihost disk can be in one of two states: Exclusive access state, where only one connected host has I/O access Non-exclusive access state, where all connected hosts have I/O access. An external hardware reset can cause the disk to enter the non-exclusive access state. Each multihost disk driver views the machine on which it's running as the "local host"; each views all other machines as "remote hosts". For each I/O or ioctl request, the requesting host is the local host. Note that the non-shared ioctls are designed to work with SCSI-2 disks. The SCSI-2 RESERVE/RELEASE command set is the underlying hardware facility in the device that supports the non-shared ioctls. The function prototypes for the non-shared ioctls are: ioctl(fd, MHIOCTKOWN); ioctl(fd, MHIOCRELEASE); ioctl(fd, MHIOCSTATUS); ioctl(fd, MHIOCQRESERVE); Forcefully acquires exclusive access rights to the multihost disk for the local host. Revokes all access rights to the multihost disk from remote hosts. Causes the disk to enter the exclusive access state. Implementation Note: Reservations (exclusive access rights) broken via random resets should be reinstated by the driver upon their detection, for example, in the automatic probe function described below. Relinquishes exclusive access rights to the multihost disk for the local host. On success, causes the disk to enter the non- exclusive access state. Probes a multihost disk to determine whether the local host has access rights to the disk. Returns 0 if the local host has access to the disk, 1 if it doesn't, and -1 with errno set to EIO if the probe failed for some other reason. Issues, simply and only, a SCSI-2 Reserve command. If the attempt to reserve fails due to the SCSI error Reservation Conflict (which implies that some other host has the device reserved), then the ioctl will return –1 with errno set to EACCES. The MHIOCQRESERVE ioctl does NOT issue a bus device reset or bus reset prior to attempting the SCSI-2 reserve command. It also does not take care of re-instating reservations that disappear due to bus resets or bus device resets; if that behavior is desired, then the caller can call MHIOCTKOWN after the MHIOCQRESERVE has returned success. If the device does not support the SCSI-2 Reserve command, then the ioctl returns –1 with errno set to ENOTSUP. The MHIOCQRESERVE ioctl is intended to be used by high-availability or clustering software for a "quorum" disk, hence, the "Q" in the name of the ioctl. Shared multihost disks ioctls control access to shared multihost disks. The ioctls are merely a veneer on the SCSI-3 Persistent Reservation facility. Therefore, the underlying semantic model is not described in detail here, see instead the SCSI-3 standard. The SCSI-3 Persistent Reservations support the concept of a group of hosts all sharing access to a disk. The function prototypes and descriptions for the shared multihost ioctls are as follows: Issues the SCSI-3 command Persistent Reserve In Read Keys to the device. On input, the field k->li should be initialized by the caller with k->li.listsize reflecting how big of an array the caller has allocated for the k->li.list field and with k->li.listlen == 0. On return, the field k->li.listlen is updated to indicate the number of reservation keys the device currently has: if this value is larger than k->li.listsize then that indicates that the caller should have passed a bigger k->li.list array with a bigger k->li.listsize. The number of array elements actually written by the callee into k->li.list is the minimum of k->li.listlen and k->li.listsize. The field k->generation is updated with the generation information returned by the SCSI-3 Read Keys query. If the device does not support SCSI-3 Persistent Reservations, then this ioctl returns –1 with errno set to ENOTSUP. Issues the SCSI-3 command Persistent Reserve In Read Reservations to the device. Remarks similar to MHIOCGRP_INKEYS apply to the array manipulation. If the device does not support SCSI-3 Persistent Reservations, then this ioctl returns –1 with errno set to ENOTSUP. Issues the SCSI-3 command Persistent Reserve Out Register. The fields of structure r are all inputs; none of the fields are modified by the ioctl. The field r->aptpl should be set to true to specify that registrations and reservations should persist across device power failures, or to false to specify that registrations and reservations should be cleared upon device power failure; true is the recommended setting. The field r->oldkey is the key that the caller believes the device may already have for this host initiator; if the caller believes that that this host initiator is not already registered with this device, it should pass the special key of all zeros. To achieve the effect of unregistering with the device, the caller should pass its current key for the r->oldkey field and an r->newkey field containing the special key of all zeros. If the device returns the SCSI error code Reservation Conflict, this ioctl returns –1 with errno set to EACCES. Issues the SCSI-3 command Persistent Reserve Out Reserve. The fields of structure r are all inputs; none of the fields are modified by the ioctl. If the device returns the SCSI error code Reservation Conflict, this ioctl returns –1 with errno set to EACCES. Issues the SCSI-3 command Persistent Reserve Out Preempt-And-Abort. The fields of structure r are all inputs; inputs; none of the fields are modified by the ioctl. The key of the victim host is specified by the field r->victim_key. The field r->resvdesc supplies the preempter's key and the reservation that it is requesting as part of the SCSI-3 Preempt-And-Abort command. If the device returns the SCSI error code Reservation Conflict, this ioctl returns –1 with errno set to EACCES. Similar to MHIOCGRP_PREEMPTANDABORT, but instead issues the SCSI-3 command Persistent Reserve Out Preempt. Issues the SCSI-3 command Persistent Reserve Out Clear. The input parameter r is the reservation key of the caller, which should have been already registered with the device, by an earlier call to MHIOCGRP_REGISTER. For each device, the non-shared ioctls should not be mixed with the Persistent Reserve Out shared ioctls, and vice-versa, otherwise, the underlying device is likely to return errors, because SCSI does not permit SCSI-2 reservations to be mixed with SCSI-3 reservations on a single device. It is, however, legitimate to call the Persistent Reserve In ioctls, because these are query only. Issuing the MHIOCGRP_INKEYS ioctl is the recommended way for a caller to determine if the device supports SCSI-3 Persistent Reservations (the ioctl will return –1 with errno set to ENOTSUP if the device does not). The MHIOCENFAILFAST ioctl is applicable for both non-shared and shared disks, and may be used with either the non-shared or shared ioctls. Enables or disables the failfast option in the multihost disk driver and enables or disables automatic probing of a multihost disk, described below. The argument is an unsigned integer specifying the number of milliseconds to wait between executions of the automatic probe function. An argument of zero disables the failfast option and disables automatic probing. If the MHIOCENFAILFAST ioctl is never called, the effect is defined to be that both the failfast option and automatic probing are disabled. The MHIOCENFAILFAST ioctl sets up a timeout in the driver to periodically schedule automatic probes of the disk. The automatic probe function works in this manner: The driver is scheduled to probe the multihost disk every n milliseconds, rounded up to the next integral multiple of the system clock's resolution. If the local host no longer has access rights to the multihost disk, and access rights were expected to be held by the local host, the driver immediately panics the machine to comply with the failfast model. If the driver makes this discovery outside the timeout function, especially during a read or write operation, it is imperative that it panic the system then as well. Each request returns –1 on failure and sets errno to indicate the error. Caller is not root. Access rights were denied. The multihost disk or controller was unable to successfully complete the requested operation. The multihost disk does not support the operation. For example, it does not support the SCSI-2 Reserve/Release command set, or the SCSI-3 Persistent Reservation command set. See attributes(5) for a description of the following attributes: ioctl(2), open(2), attributes(5)open(2) The ioctls for shared multihost disks and the MHIOCQRESERVE ioctl are currently implemented only for SPARC and only for the following disk device drivers: sd(7D), ssd(7D). NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO | NOTES
http://docs.oracle.com/cd/E19683-01/816-5223/6mbco0a2m/index.html
CC-MAIN-2016-44
refinedweb
1,723
53.21
(I just found this sub-forum...sorry about posting it in the main Flash/Actionscript forum...) My program starts out this way: ......Code:public class MyProgram extends UIComponent { Now I heard that any UIComponent registers keyDownHandler automatically, so you just need to override that function. But although I get no errors, there is NO sign of life as far as keyboard input goes. I programmed the keys to do some drastic things (not shown below) but nothing ever happened. So I'm wondering what I'm doing wrong. Any help would be much appreciated.Any help would be much appreciated.Code:override protected function keyDownHandler(e:KeyboardEvent):void { if (e.keyCode == Keyboard.LEFT) { trace("LEFT"); } if (e.keyCode == Keyboard.UP) { trace("UP"); } if (e.keyCode == Keyboard.DOWN) { trace("DOWN"); } if (e.keyCode == Keyboard.RIGHT) { trace("RIGHT"); } } Thanks, Matthew
http://www.codingforums.com/adobe-flex/146056-how-read-keyboard-input.html
CC-MAIN-2016-26
refinedweb
138
54.79
HTML Serializer The secret to generating compliant 4.01 strict from Cocoon is to have the correct doctype declaration in the sitemap and to ensure the previous transformer does not have a default namespace. If the transformer that feeds the HTMLSerializer has a statement similar to this: <xsl:stylesheet Then you must remove the default namespace declaration like so: <xsl:stylesheet If you do not do this then some elements such as <br> and <link> tags will have a surplus '/' character appended and the html tag will have an illegal namespace attribute. Note also that the HTMLSerializer does not make any attempt to clean up illegal tags or attributes that may be fed to it. So for example if you feed it with <img align="left" src="picture.jpg"> then the 'align' attribute will be passed through even though its use is deprecated in HTML 4.01 strict because it is considered a presentational element. Example of a HTML 4.01 strict serializer <map:serializer <doctype-public>-//W3C//DTD HTML 4.01//EN</doctype-public> <doctype-system></doctype-system> </map:serializer> Page output should now be HTML 4.01 with no namespaces or '/' characters in <br> tags for example. (From a post by David Legg, 2005/11/10)
http://wiki.apache.org/cocoon/HTML_Serializer
crawl-003
refinedweb
208
55.84
Le Café Central de Deva ..... Deva blogs!! I started working from Visual Basic 6, where i had used XML Parser (MS XML) to fetch the data's using WebDAV. But the same logic won't apply for you when you do with .Net applications. So, where we need to use MSXML and .Net Framework classes's for XML? FYI: You can go through this below given article, which gives overall view and design goals of XML in the .Net Framework. Design Goals for XML in the .NET Framework No Official support. Do you know why it so? Officially Microsoft does not support the use of MSXML (Microsoft’s COM-based XML parser) in .NET applications. This is because MSXML uses threading models and garbage-collection mechanisms that are not compatible with the .NET Framework. Using MSXML in .NET applications through COM interoperability can result in unexpected problems that are difficult to debug. Please note that Microsoft does not recommend or support directly instantiating and using MSXML objects in .NET code, nor does Microsoft recommend or support marshalling MSXML interface pointers across the interop boundary So what is the workaround or best practice needs to be done? Support for implementing standards-based XML functionality in .NET applications is built into the .NET Framework. The .NET Framework classes in the System.xml namespaces should be used to implement standards-based XML functionality in .NET applications. Code snippets: FYI: I have enclosed couple of code snippets for your reference. Earlier we might have created a web request to a web server like this using MSXML, 1: Dim oXMLHttpRequest As New MSXML2.XMLHTTP 2: ' Provide the respective values 3: oXMLHttpRequest.open "GET", "http://[servername]/[virtualdirectory]/[filename.xml]", False, "", "" 4: oXMLHttpRequest.send 5: Debug.Print (oXMLHttpRequest.responseText) When you create the .Net applications, you need to do the same by using .Net framework classes like, 1: using System; 2: using System.Xml; 3: using System.Net; 4: 5: public class Sample 6: { 7: public static void Main() 8: { 9: // Provide the respective values 10: HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://[ServerName]/[virtualdir]/[filename.xml]"); 11: 12: // Provide the Username and password. 13: request.Credentials = new NetworkCredential("[username]", "[password]"); 14: 15: // It downloads the XML file from the specified server. 16: HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 17: 18: // Then it loads the XmlDocument. 19: XmlDocument doc = new XmlDocument(); 20: doc.Load(response.GetResponseStream()); 21: doc.Save(Console.Out); 22: 23: // Finally don't forgot to release the resources of the response. 24: response.Close(); 25: } 26: }
http://blogs.msdn.com/b/deva/archive/2008/10/23/nutshell-msxml-is-not-supported-in-net-applications.aspx
CC-MAIN-2014-23
refinedweb
420
52.87
Don't shout at me for top posting In this instance it's justified Thanks for your continued work on this. I have to get some lines of code down as release date is fast approaching but I will try your code as soon as I have time Thanks for you continued work on this Lyallex On 9 November 2012 05:08, Christopher Schultz <chris@christopherschultz.net>wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Russ, > > On 11/8/12 6:05 PM, Russ Kepler wrote: > > On Thursday, November 08, 2012 07:36:20 PM Lyallex wrote: > > > >> The only difference between the two executions is the fact that > >> the test code executes in it's own instance of the JVM whereas > >> the other execution runs in an instance shared with the > >> container. > >> > >> I accept that the behaviour may be undefined even though it is > >> consistently repeatable in both environments but surely given > >> everything else being equal the results should be the same ... or > >> maybe I'm just losing the plot. > > > > No, you're right but just missing some small difference in the > > environments. > > > > I'd verify that you get the same input data in the same order in > > both cases, and that you're starting with the same size container > > [...] > > After writing a bench test that I couldn't get to fail, your comment > here tripped a thought in my brain: the "container" size. So, I added > an element to my list of Strings and boom: failure. It turns out that > the collection size doesn't matter: I just hadn't been iterating > enough, so I added a loop that will run until the initial sorted order > doesn't match the re-sorted order (with shuffles in between). > > Lyallex, see the code below: it will fail after a few iterations to > produce the same element ordering. Switch from BrokenSorter to > WorkingSorter and you'll find that it runs forever. > > Are you *sure* that your database always returns the items in the same > order? If you plan on sorting alphabetically later, why bother sorting > by id when fetching? Unless you are really sorting by id when > fetching, the data can come back in any order. It may *often* be in > entry-sequenced order, but it is certainly not guaranteed to be. > > The code below shows that, without any funny business, the sort can > work sometimes and not in others. > > Enjoy, > - -chris > > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collections; > import java.util.Comparator; > import java.util.List; > > public class SortTest > { > public static void main(String[] args) > { > String[] fruits = new String[] { > "Apples", > "Bananas", > "Coconuts", > "Dates", > "Eggplants", > "Figs", > "Grapefruits", > "Honeydews", > "Ilamas", > "Jambolans", > "Kepels", > "Lemons", > "Miscellaneous", > "Nectarines" > }; > > List<String> fruitList = Arrays.asList(fruits); > > Comparator<String> sorter = new BrokenSorter(); > > System.out.println("Initial order: " + fruitList); > > Collections.sort(fruitList, sorter); > System.out.println("Sort 1: " + fruitList); > > List<String> saved = new ArrayList<String>(fruitList); > > int i = 1; > do > { > Collections.shuffle(fruitList); > Collections.sort(fruitList, sorter); > System.out.println("Sort " + (++i) + ": " + fruitList); > } > while(fruitList.equals(saved)); > System.out.println("Stopped after " + i + " iterations because > the list did not sort the same way."); > } > > static class BrokenSorter > implements Comparator<String> > { > @Override > public int compare(String a, String b) > { > if(a.equals("Miscellaneous")) > return 1; > return a.compareTo(b); > } > } > static class WorkingSorter > implements Comparator<String> > { > @Override > public int compare(String a, String b) > { > if(a.equals("Miscellaneous")) > return 1; > > if(b.equals("Miscellaneous")) > return -1; > > return a.compareTo(b); > } > } > } > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) > Comment: GPGTools - > Comment: Using GnuPG with Mozilla - > > iEYEARECAAYFAlCcj7cACgkQ9CaO5/Lv0PBpawCeORBT62XWcjyw+SruT6Bhkh50 > sDEAn1ZjSiPR70+DV/QVBFOjXKjH498o > =F3QS > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > >
http://mail-archives.apache.org/mod_mbox/tomcat-users/201211.mbox/%3CCAMqzz4TbCQ6_Wt0A_P3seChPvp_Xx_4=QzaX41OSf8hyx9SShA@mail.gmail.com%3E
CC-MAIN-2014-52
refinedweb
617
57.57
in reply to How can I unshare something? Like other responses, I'm confused by your description of what you are trying to do. You say: Why would I want to do this, people ask? Well, I can't add un-shareable values to shared hashes (objects), which I, sadly, need to do. But that seems to be the exact opposite of what you are asking for? Ie. You say you can't copy unshareable values into a shared hash, but you're asking how to 'unshare' shared data? To answer the question you've asked--how to unshare, shared data--delete it. Once it is deleted by one thread, no thread can access it. If you need one thread to continue to have access, duplicate it (Clone would work) into a thread local, none shared copy, and then (deep) delete the shared copy. You might need something like (Rmap or Data::Diver to ensure that if another thread has taken a reference to some subset of the original data structure (I'm assuming this is what you meant by "blob"), that it will no longer have access to the data. Of course, if it has already taken a copy (shared or otherwise), you will not be able to prevent it from continuing to access the copy! But, I suspect, that that isn't what you meant to ask. My suspicion is that you have a non-shared, complex, data-structure, and what you want to do is transfer a copy of to another thread. And you are falling foul of the threads::shared::share() inability to share nested data structures? If this is the case, then you need to traverse the data structure manually and share then copy nested elements individually and recursively. You might find this (lightly tested and unpublished...it still has limitations) module useful: { package shareDeep; ## threads::shareDeep is the intended name for +release... use strict; use warnings; use threads; use threads::shared qw[ bless ]; use Carp qw[cluck carp]; use Scalar::Util qw[ readonly reftype blessed ]; require Exporter; our @ISA = 'Exporter'; our @EXPORT = qw[ shareDeep ]; our $TRACE = 0; *_trace = $TRACE ? sub{ my $fmt = shift; warn( sprintf "%3d %s(%d): %s\n", threads->self->tid || 0, __FILE__, __LINE__, $fmt, @_ ); } : sub(){ 0 }; sub _invalid { warn( "Can't share '$_[ 0 ]'; substituting as placeholder\ +n", ); return "$_[ 0 ]"; } sub getType { blessed( $_[ 0 ] ) ? reftype( $_[ 0 ] ) : ref( $_[ 0 + ] ); } my %do; %do = ( '' => sub { _trace( "VALUE: @_ : " . getType( $_[ 0 ] ) ); $_[ 0 ] }, SCALAR => sub { _trace( "SCALAR: @_ : " . getType( $_[ 0 ] ) ); my $scalar :shared = ${ $_[ 0 ] }; \$scalar }, HASH => sub { _trace( "HASH: @_ : " . getType( $_[ 0 ] ) ); my $in = shift; my %hash :shared = map { $_ => $do{ getType( $in->{ $_ } ) }->( $in->{ $_ } ) } keys %{ $in }; \%hash; }, ARRAY => sub { _trace( "ARRAY: @_ : " . getType( $_[ 0 ] ) ); my @array :shared = map{ $do{ getType( $_ ) }->( $_ ) } @{ $_[ 0 ] }; \@array; }, REF => sub { _trace( "REF: @_ : " . getType( $_[ 0 ] ) ); my $ref :shared = $do{ getType( ${ $_[ 0 ] } ) }->( ${ $_[ + 0 ] } ); \$ref }, GLOB => \&_invalid, LVALUE => \&_invalid, CODE => \&_invalid, Regexp => \&_invalid, ); readonly( \%do ); sub shareDeep { my( $in ) = shift; return my $out :shared = $do{ getType( $in) }->( $in ); } } return 1 if caller; package main; use threads; use threads::shared qw[ bless ]; use Data::Dump qw[ pp ]; $Data::Dump::MAX_WIDTH = 500; shareDeep->import; sub test{ print "test sub @_" }; my %test = 1 .. 10; my $rSharedHash = shareDeep( \%test ); pp $rSharedHash; my @test = 1 .. 10; my $rSharedArray = shareDeep( \@test ); pp $rSharedArray; my $test = 'test'; my $rSharedScalar = shareDeep( \$test ); pp $rSharedScalar; my $rSharedRef = shareDeep( \\$test ); pp $rSharedRef; $rSharedRef = shareDeep( \\\\\\\\\\$test ); pp $rSharedRef; my $lvalue = \substr( 'fred', 1, 2 ); my $sharedLvalue :shared = shareDeep( $lvalue ); pp $sharedLvalue; my $glob = do{ local *GLOB; \*GLOB }; my $sharedGlob :shared = shareDeep( $glob ); pp $sharedGlob; my %hash = ( array => \@test, hash => \%test, ); my $nested :shared = shareDeep( \%hash ); pp $nested; my $blessed :shared = shareDeep( threads::shared::bless [], 'fred' ); print pp $blessed; [download] It exports a single entrypoint, shareDeep() that will return (by reference) a fully shared duplicate of the structure passed in. (Also by reference.) It currently issues a warning for any unshareable elements contained in the structure to be copied, and substitutes a placeholder. Probably not the best design choice, but useful while I decide if there is a better approach. The embedded tests should serve as a guide to
http://www.perlmonks.org/?node_id=698760
CC-MAIN-2014-23
refinedweb
703
66.47
Led Howto From OESF Current revision Howto utilize the led's on the Zaurus Intro The Sharp Zaurus has two led's on the device that can be controled from applications. This device can make the led turn on and off and blink at several different speeds as defined in "sharp_char.h" Basics If an application want to use the led it needs to do at least the following three things: Include sharp_char.h in the application to use the headers defines. The header is installed in : /opt/Embedix/tools/arm-linux/include/asm/. You may want to manually copy the file locally or create a sym-link to the file into the local directory. #include <sharp_char.h> Open /dev/sharp_led. Use normal error checking here. int fd= open("/dev/sharp_led", O_WRONLY); Make an ioctl cal on /dev/sharp_led replacing LED_COLLIE_0_DEFAULT with the desired action from sharp_char.h ioctl(fd, SHARP_LED_SETSTATUS, LED_COLLIE_0_DEFAULT); Example Download example source and binary led demo is in a tar.gz file here. Simply copy the led executable over to the Zaurus and run it from the command line. This gui test program will open the driver and allow the selection of what each of the two led's should do. The souce is included in the tar.gz for further review and exploration.
http://www.oesf.org/index.php?title=Led_Howto&diff=9033&oldid=6932
CC-MAIN-2013-48
refinedweb
218
66.64
Given two variable a and b, construct a function f(a,b) which return the maximum one in {a,b}. You can only use +- · / and abs() (to take the absolute value). NO if() is allowed in your construction. Pure arithmetic ; ) {a+b+abs(a-b)}/2 Also, {a+b-abs(a-b)}/2 is the smaller one in {a,b} Here's an intuitive explanation by @Grant Goodman (in comments): "" Great question! Thoroughly enjoyed thinking about this one. sure it would b wrong...but i tried something... int res=(a-b)>0?a:b; it too doesn't have if() That's a good point, but I think the idea is to avoid conditionals altogether. Your compiler turns the ternary ( ? : ) operator into the same code that it turns an if statement into (i.e. a conditional branch with two blocks). You didn't say you could use a 2 in there. So you'll need to make one with (a/a + b/b) or something like that. That's a good point. More verbosely, {a+b+abs(a-b)} / [{a+b+abs(a-b)}+{a+b+abs(a-b)}] Good point. Nod. But we have to exclude 0. Whatever, the question should just emphasize on "pure arithmetic" or ask for an algebra expression. Or: {a + b + abs(a-b)}/(a/a + a/a). Slightly shorter version. This,)} Agreed, unless both a and b are zero... this won't hold true if a and b both are odd Isn't that just 1/2? Thinking about this, I'm fairly sure it is impossible unless you do one of the following: 1. allow numbers in the algorithm (as per solution) 2. assume at least one of the values is not 0. (as per below) 3. allow ^ 4. use a system that defines 0/0 as 1 (i.e. is wrong). the last two would allow you to implicitly get a 1 by doing (a^a)/(a^a) or a/a respectively (and thus a 2 through addition). =(ABS(A1-B1)+A1+B1)/2 Here's an intuitive derivation of the solution: That's an awesome explanation. MoralMachine, I suggest adding it to the puzzle solution. Wohooo touring-completeness achieved once again! Time to play with this in Haskell. max(a,b) = ((a+b)+|a-b|)/2 This is the solution I came up with in C++; int largerNum(int x, int y){ } I decided it would be easier for me to get to the solution if I broke it up into individual parts. But working from that, as a single expression; return (abs((x - y - abs(pt1)) / (x/x + y/y))) + x; But as highlighted in other posts, it doesn't work if either number is zero. It actually crashes my compiled application. Probably due to dividing by zero. Correction; as a single return statement it should be return (abs((x - y - abs(x - y)) / (x/x + y/y))) + x; I accidentally left variable pt1 in there.
http://www.mindcipher.com/puzzles/134
CC-MAIN-2015-35
refinedweb
496
76.72
Patch-gapping is the practice of exploiting vulnerabilities in open-source software that are already fixed (or are in the process of being fixed) by the developers before the actual patch is shipped to users. This window, in which the issue is semi-public while the user-base remains vulnerable, can range from from days to months. It is increasingly seen as a serious concern, with possible in-the-wild uses detected by Google. In a previous post, we demonstrated the feasibility of developing a 1day exploit for Chrome well before a patch is rolled out to users. In a similar vein, this post details the discovery, analysis and exploitation of another recent 1day vulnerability affecting Chrome. Background Besides analyzing published vulnerabilities, our nDay team also identifies possible security issues while the fixes are in development. An interesting change list on chromium-review piqued our interest in mid-August. It was for an issue affecting sealed and frozen objects, including a regression test that triggered a segmentation fault. It has been abandoned (and deleted) since then in favor of a different patch approach, with work continuing under CL 1760976, which is a much more involved change. Since the fix turned out to be so complex, the temporary solution for the 7.7 v8 branch was to disable the affected functionality. This will only be rolled into a stable release on the 10th of September, though. A similar change was made in the 7.6 branch but it came two days after a stable channel update to 76.0.3809.132, so it wasn’t included in that release. As such, the latest stable Chrome release remains affected. These circumstances made the vulnerability an ideal candidate to develop a 1day exploit for. The commit message is descriptive, the issue is the result of the effects of Object.preventExtensions and Object.seal/freeze on the maps and element storage of objects and how incorrect map transitions are followed by v8 under some conditions. Since map handling in v8 is a complex topic, only the absolutely necessary details will be discussed that are required to understand the vulnerability. More information on the relevant topics can be found under the following links: - Fast frozen & sealed elements in V8 - Fast properties in V8 - The story of a V8 performance cliff in React Object Layout In v8 JS engines implement several optimizations on the property storage of objects. A common technique is to use separate backing stores for the integer keys (often called elements) and string/Symbol keys (usually referred to as slots or named properties). This allows the engines to potentially use continuous arrays for properties with integer keys, where the index maps directly to the underlying storage, speeding up access. String keyed values are also stored in an array but to get the index corresponding to the key, another level of indirection is needed. This information, among other things, is provided by the map (or HiddenClass) of the object. The storage of object shapes in a HiddenClass is another attempt at saving storage space. HiddenClasses are similar in concept to classes in object-oriented languages. However, since it is not possible to know the property configuration of objects in a prototype-based language like JavaScript in advance, they are created on demand. JS engines only create a single HiddenClass for a given shape, which is shared by every object that has the same structure. Adding a named property to an object results in the creation of a new HiddenClass, which contains the storage details for all the previous properties and the new one, then the map of the object is updated, as shown below (figures from the v8 dev blog). These transitions are saved in a HiddenClass chain, which is consulted when new objects are created with the same named properties, or the properties are added in the same order. If there is a matching transition, it is reused, otherwise a new HiddenClass is created and added to the transition tree. The properties themselves can be stored in three places. The fastest is in-object storage, which only needs a lookup for the key in the HiddenClass to find the index into the in-object storage space. This is limited to a certain number of properties, others are stored in the so-called fast storage, which is a separate array pointed by the properties member of the object, as shown below. If an object has many properties added and deleted, it can get expensive to maintain the HiddenClasses. V8 uses heuristics to detect such cases and migrate the object to a slow, dictionary based property storage, as shown on the following diagram. Another frequent optimization is to store the integer keyed elements in a dense or packed format, if they can all fit in a specific representation, e.g. small integer or float. This bypasses the usual value boxing in the engines, which stores numbers as pointers to Number objects, thus saving space and speeding up operations on the array. V8 handles several such element kinds, for example PACKED_SMI_ELEMENTS, which denotes an elements array with small integers stored contiguously. This storage format is tracked in the map of the object and needs to be kept updated all the time to avoid type confusion issues. Element kinds are organized into a lattice, transitions are only ever allowed to more general types. This means that adding a float value to an object with PACKED_SMI_ELEMENTS elements kind will convert every value to double, set the newly added value and change the element kind to PACKED_DOUBLE_ELEMENTS. preventExtensions, seal and freeze JavaScript provides several ways to fix the set of properties on an object. - Object.preventExtensions: prevents new properties from being added to the object. - Object.seal: prevents the addition of new properties, as well as the reconfiguration of existing ones (changing their writable, enumerable or configurable attributes). - Object.freeze: the same as Object.seal but also prevent the changing of property values, thus effectively prohibiting any change to an object. PoC analysis The vulnerability arises because v8 follows map transitions in certain cases without updating the element backing store accordingly, which can have wide-ranging consequences. A modified trigger with comments is shown below. // Based on test/mjsunit/regress/regress-crbug-992914.js function mainSeal() { const a = {foo: 1.1}; // a has map M1 Object.seal(a); // a transitions from M1 to M2 Map(HOLEY_SEALED_ELEMENTS) const b = {foo: 2.2}; // b has map M1 Object.preventExtensions(b); // b transitions from M1 to M3 Map(DICTIONARY_ELEMENTS) Object.seal(b); // b transitions from M3 to M4 const c = {foo: Object} // c has map M5, which has a tagged `foo` property, causing the maps of `a` and `b` to be deprecated b.__proto__ = 0; // property assignment forces migration of b from deprecated M4 to M6 a[5] = 1; // forces migration of a from the deprecated M2 map, v8 incorrectly uses M6 as new map without converting the backing store. M6 has DICTIONARY_ELEMENTS while the backing store remained unconverted. } mainSeal(); In the proof-of-concept code, two objects, a and b are created with the same initial layout, then a is sealed and Object.preventExtensions and Object.seal is called on b. This causes a to switch a map with HOLEY_SEALED_ELEMENTS elements kind and b is migrated to slow property storage via a map with DICTIONARY_ELEMENTS elements kind. The vulnerability is triggered in lines 10-13. Line 10 creates object c with an incompatibly typed foo property. This causes a new map with a tagged foo property to be created for c and the maps of a and b are marked deprecated. This means that they will be migrated to a new map on the next property set operation. Line 11 triggers the transition for b, Line 13 triggers it for a. The issue is that v8 mistakenly assumes that a can be migrated to the same map as b but fails to also convert the backing store. This causes a type confusion to happen between a FixedArray (the Properties array shown in the Object Layout In v8 section) and a NumberDictionary (the Properties Dict). A type confusion the other way around is also possible, as demonstrated by another regression test in the patch. There are probably also other ways this invalid map transition could be turned into an exploitable primitive, for example by breaking assumptions made by the optimizing JIT compiler. Exploitation The vulnerability can be turned into an arbitrary read/write primitive by using the type confusion shown above to corrupt the length of an Array, then using that Array for further corruption of TypedArrays. These can then be leveraged to achieve arbitrary code execution in the renderer process. FixedArray and NumberDictionary Memory Layout FixedArray is the C++ class used for the backing store of several different JavaScript objects. It has a simple layout, shown below, with only a map pointer, a length field stored as a v8 small integer (essentially a 31-bit integer left-shifted by 32), then the elements themselves. pwndbg> job 0x065cbb40bdf1 0x65cbb40bdf1: [FixedDoubleArray] map: 0x1d3f95f414a9 length: 16 0: 0.1 1: 1 2: 2 3: 3 4: 4 … pwndbg> tel 0x065cbb40bdf0 25 00:0000 0x65cbb40bdf0 -> 0x1d3f95f414a9 <- 0x1d3f95f401 01:0008 0x65cbb40bdf8 <- 0x1000000000 02:0010 0x65cbb40be00 <- 0x3fb999999999999a 03:0018 0x65cbb40be08 <- 0x3ff0000000000000 04:0020 0x65cbb40be10 <- 0x4000000000000000 … The NumberDictionary class implements an integer keyed hash table on top of FixedArray. Its layout is shown below. It has four additional members besides map and length: - elements: the number of elements stored in the dictionary. - deleted: number of deleted elements. - capacity: number of elements that can be stored in the dictionary. The length of the FixedArray backing a number dictionary will be three times its capacity plus the extra header members of the dictionary (four). - max number key index: the greatest key stored in the dictionary. The vulnerability makes it possible to set these four fields to arbitrary values in a plain FixedArray, then trigger the type confusion and treat them as header fields of a NumberDictionary. pwndbg> job 0x2d7782c4bec9 0x2d7782c4bec9: [NumberDictionary] - map: 0x0c48e8bc16d9 <Map> - length: 28 - elements: 4 - deleted: 0 - capacity: 8 - elements: { 0: 0x0c48e8bc04d1 <undefined> -> 0x0c48e8bc04d1 <undefined> 1: 0 -> 16705 2: 0x0c48e8bc04d1 <undefined> -> 0x0c48e8bc04d1 <undefined> 3: 1 -> 16706 4: 0x0c48e8bc04d1 <undefined> -> 0x0c48e8bc04d1 <undefined> 5: 0x0c48e8bc04d1 <undefined> -> 0x0c48e8bc04d1 <undefined> 6: 2 -> 16707 7: 3 -> 16708 } pwndbg> tel 0x2d7782c4bec9-1 25 00:0000 0x2d7782c4bec8 -> 0xc48e8bc16d9 <- 0xc48e8bc01 01:0008 0x2d7782c4bed0 <- 0x1c00000000 02:0010 0x2d7782c4bed8 <- 0x400000000 03:0018 0x2d7782c4bee0 <- 0x0 04:0020 0x2d7782c4bee8 <- 0x800000000 05:0028 0x2d7782c4bef0 <- 0x100000000 06:0030 0x2d7782c4bef8 -> 0xc48e8bc04d1 <- 0xc48e8bc05 ... 09:0048 0x2d7782c4bf10 <- 0x0 0a:0050 0x2d7782c4bf18 <- 0x414100000000 0b:0058 0x2d7782c4bf20 <- 0xc000000000 0c:0060 0x2d7782c4bf28 -> 0xc48e8bc04d1 <- 0xc48e8bc05 ... 0f:0078 0x2d7782c4bf40 <- 0x100000000 10:0080 0x2d7782c4bf48 <- 0x414200000000 11:0088 0x2d7782c4bf50 <- 0xc000000000 Elements in a NumberDictionary are stored as three slots in the underlying FixedArray. E.g. the element with the key 0 starts at 0x2d7782c4bf10 above. First comes the key, then the value, in this case a small integer holding 0x4141, then the PropertyDescriptor denoting the configurable, writable, enumerable attributes of the property. The 0xc000000000 PropertyDescriptor corresponds to all three attributes set. The vulnerability makes all header fields of a NumberDictionary, except length, controllable by setting them to arbitrary values in a plain FixedArray, then treating them as header fields of a NumberDictionary by triggering the issue. While the type confusion can also be triggered in the other direction, it did not yield any immediately promising primitives. Further type confusions can also be caused by setting up a fake PropertyDescriptor to confuse a data property with an accessor property but these also proved too limited and were abandoned. The capacity field is the most interesting from an exploitation perspective, since it is used in most bounds calculations. When attempting to set, get or delete an element, the HashTable::FindEntry function is used to get the location of the element corresponding to the key. Its code is shown below. // Find entry for key otherwise return kNotFound. template <typename Derived, typename Shape> int HashTable<Derived, Shape>::FindEntry(ReadOnlyRoots roots, Key key, int32_t hash) { uint32_t capacity = Capacity(); uint32_t entry = FirstProbe(hash, capacity); uint32_t count = 1; // EnsureCapacity will guarantee the hash table is never full. Object undefined = roots.undefined_value(); Object the_hole = roots.the_hole_value(); USE(the_hole); while (true) { Object element = KeyAt(entry); // Empty entry. Uses raw unchecked accessors because it is called by the // string table during bootstrapping. if (element == undefined) break; if (!(Shape::kNeedsHoleCheck && the_hole == element)) { if (Shape::IsMatch(key, element)) return entry; } entry = NextProbe(entry, count++, capacity); } return kNotFound; } The hash tables in v8 use quadratic probing with a randomized hash seed. This means that the hash argument in the code, and the exact layout of dictionaries in memory will change from run to run. The FirstProbe and NextProbe functions, shown below, are used to look for the location where the value is stored. Their size argument is the capacity of the dictionary and thus, attacker-controlled. inline static uint32_t FirstProbe(uint32_t hash, uint32_t size) { return hash & (size - 1); } inline static uint32_t NextProbe(uint32_t last, uint32_t number, uint32_t size) { return (last + number) & (size - 1); } Capacity is a power-of-two number under normal conditions and masking the probes with capacity-1 results in limiting the range of accesses to in-bounds values. However, setting the capacity to a larger value via the type-confusion will result in out-of-bounds accesses. The issue with this approach is the random hash seed, which will cause probes and thus out-of-bounds accesses to random offsets. This can easily results in crashes, as v8 will try to interpret any odd value as a tagged pointer. A possible solution is to set capacity to an out-of-bounds number k that is a power-of-two plus one. This causes the FindEntry algorithm to only visit two possible locations, one at offset zero, and one at offset k (times three). With careful padding, a target Array can be placed following the dictionary, which has its length property at just that offset. Invoking a delete operation on the dictionary with a key that is the same as the length of the target Array will cause the algorithm to replace the length with the hole value. The hole is a valid pointer to a static object, in effect a large value, allowing the target Array to be used for more convenient, array-based out-of-bounds read and write operations. While this method can work, it is nondeterministic due to the randomization and the degraded nature of the corrupted NumberDictionary. However, failure does not crash Chrome and is easily detectable; reloading the page reinitializes the hash seed so the exploit can be attempted an arbitrary number of times. Arbitrary Code Execution The following object layout is used to gain arbitrary read/write access to the process memory space: - o: the object that will be used to trigger the vulnerability. - padding: an Array that is used as padding to get the target float array at exactly the right offset from o. - float_array: the Array that is the target of the initial length corruption via the out-of-bounds element deletion on o. - tarr: a TypedArray used to corrupt the next typed array. - aarw_tarr: typed array used for arbitrary memory access. - obj_addrof: object used to implement the addrof primitive which leaks the address of an arbitrary JavaScript object. The exploit achieves code execution by the following the usual steps after the initial corruption: - Create the layout described above. - Trigger the vulnerability, corrupt the length of float_array through the deletion of a property on o. Restart the exploit by reloading the page in case this step fails. - Corrupt the length of tarr to increase reliability, since continued usage of the corrupted float array can introduce problems. - Corrupt the backing store of aarw_tarr and use it to gain arbitrary read write access to the address space. - Load a WebAssembly module. This maps a read-write-executable memory region of 4. The complete exploit code can be found on our GitHub page and seen in action below. Note that a separate vulnerability would be needed to escape the sandbox employed by Chrome. Subscribers of our nDay feed had access to the analysis and functional exploit 5 working days after the initial patch attempt appeared on chromium-review. A fix in the stable channel of Chrome will only appear in version 77, scheduled to be released tomorrow. Malicious actors probably have capabilities based on patch-gapping. Timely analysis of such vulnerabilities allows our customers to test how their defensive measures hold up against unpatched security issues. It also enables offensive teams to test the detection and response functions within their organization.
https://blog.exodusintel.com/2019/09/09/patch-gapping-chrome/
CC-MAIN-2021-10
refinedweb
2,765
52.39
A nested class is another way to control the visibility and access to a class. To create a nested class you simply declare the class in the usual way but within the definition of another class. For example: public class MyClass1{ public class MyNestedClass { public void MyMethod2() { Console.WriteLine("Method2"); } }} MyNestedClass is declared within MyClass1 and so is nested within MyClass1. Compare this to the simpler idea of creating an instance of a class as a member of a class, e.g: public class MyClass1{ public MyClass2 myobj=new MyClass2(); etc. This isn't a nested class just an instance of MyClass2 that is a member of MyClass1. Notice that both classes are declared as public and this isn't good practice but let's follow the example a little further to see how it works. If we also declare a method within MyClass1 it can make use of the nested class in the usual way: public void MyMethod1(){ MyNestedClass myObj1 = new MyNestedClass(); myObj1.MyMethod2(); Console.WriteLine("Method1");}} Any code within MyClass1 can create and use objects of type MyNestedClass. If you move outside of MyClass1 then your code can create objects of type MyClass1 which in turn use objects of MyNestedClass. For example: MyClass1 myob2 = new MyClass1();myob2.MyMethod1(); However, MyNestedClass isn't directly accessible from code outside of MyClass1. As the nested class is public it can be accessed using a qualified name. For example, to create an instance of MyNestedClass outside of MyClass1 you would use: MyClass1.MyNestedClass myobj3 = new MyClass1.MyNestedClass(); and you could then access the object's methods and properties in the usual way: myobj3.MyMethod2(); This use of nested classes to create types with qualified names isn't usual and most programmers, and the Microsoft recommendations, say that this isn't a good use. Also notice that nested classes are just a special case of nested types where a type, a struct say, is declared within a class. In most cases nested classes are used as a way of hiding the implementation of a class. Normally classes cannot use the private or protected type modifier but nested classes can. What this means is that if you declare the nested class to be private or protected it is no longer accessible to code outside of the containing class, even if you use a qualified name. However it is accessible from within the containing class. In short the whole of a nested class is private or protected according to its declaration. A nested class also has access to all of the members of the outer containing class but a reference to the instance of the class isn't provided automatically. That is, "this" within the containing class refers to the instance of the containing class and "this" within the nested class refers to the instance of the nested class not the containing class. To allow the nested class access to the containing class you have to pass it a reference to the instance. For example: public class MyClass1{ protected class MyNestedClass { private MyClass1 that; public MyNestedClass( MyClass1 outerthis) { that= outerthis; } Now when the nested class is created the container passes a reference to its current instance: MyNestedClass myObj1 = new MyNestedClass(this); The inner class can use the variable name "that" to access members of the container class including private and protected members. This is the C# equivalent of the Java inner class where the instance of the nested class is bound to an instance of the containing class. Clearly the intended use for a nested class is to allow the creation of classes, and types in general, that are only to be used within another class. Hence the reason why public nested classes are generally thought to be bad practice. <ASIN:0470261293> <ASIN:0596527578>
http://i-programmer.info/ebooks/deep-c/559-chapter-five.html?start=3
CC-MAIN-2014-52
refinedweb
629
51.68
I was trying to add a dockerconfigjson secret to pull images from my private github repo docker.pkg.github.com. I was following the docs on I created the secret and updated my deployment to read from it on the imagePullSecrets block. Everything seems to work fine on my DOKS 1.19. I can successfully pull my private images. However, on 1.20 and 1.21, the same manifests/configuration throws me a “401 Unauthorized” error. I tried to delete and recreate both of them. I checked the namespace, used the same version of kubectl as the cluster, but couldn’t make it work. Does someone facing the same problem with DOKS 1.20 and 1.21? Running into this as well. If I deploy my stack to k8s on docker-desktop it spins right up with my given image pull secret connecting to AWS ECR.I switch the k8s context to DO and getting that 401.
https://www.digitalocean.com/community/questions/problems-setting-imagepullsecrets-on-doks-1-20-and-1-21
CC-MAIN-2022-21
refinedweb
157
77.84
Tax Calculation Program for Multiple Stores I need two separate codes for each request. Thanks. #include <stdio.h> /*Using define macros for assigning tax to different stores */ #define DelMar 7.25 #define Encinitas 7.5 #define LaJolla 7.75 /* Input: ? Del Mar - 7.25% ? Encinitas - 7.5% ? La Jolla - 7.75% Output: The sales tax amount for each store of the 125.00 Purchase for each. */ int main(){ // The total sales for each store is float sales = 125.00; //Display Program Header printf("Tax Calculator for Kudler Fine Foods for All locationsnnn"); //Calculate and print the Tax for Del Mar printf("The Sales Tax for Del Mar Store is $ %.2fnn", sales * DelMar/100); //Calculate and print the Tax for Encinitas printf("The Sales Tax for Encinitas Store is $ %.2fnn", sales * Encinitas/100); //Calculate and print the Tax for La Jolla printf("The Sales Tax for La Jolla Store is $ %.2fn", sales * LaJolla/100); getch(); return 0; } ************************************************************************** Service Request: SR-kf-008 Change Request: 1 Requestor: Harvey Stephens Modify the C program so that the user inputs the purchase amount. Check the user's input for validity. In addition to calculating the sales tax for each location, calculate and display the total sale amount for each location. ******************************************************************** Service Request: SR-kf-008 Change Request: 2 Requestor: Harvey Stephens Modify the C program so that the user inputs the purchase amount. Check the user's input for validity. Have the user select from a menu which store to use for the tax calculation. Calculate and display the tax amount for the store selected and the total sale amount for that store. Solution Summary With Input Validation, Total Sales figures in each location, and much more.
https://brainmass.com/computer-science/files/119930
CC-MAIN-2018-22
refinedweb
283
66.64
This package CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS1302 provides a device driver for the wallclock device in the Dallas DS1302 Real-Time Clock chips. This combines a real-time clock and 312: #include <cyg/io/wallclock/ds1302.h> externC unsigned char cyg_wallclock_ds1302_read_tcs_ds_rs(void); externC void cyg_wallclock_ds1302_write_tcs_ds_rs(unsigned char val); externC void cyg_wallclock_ds1302_read_ram(int offset, unsigned char* buf, int len); externC void cyg_wallclock_ds1302_write_ram(int offset, unsigned char* buf, int len); The _tcs_ds_rs functions allow applications to read and update the trickle charge register in the DS1302. The manufacturer's data sheet should be consulted for further information on this register. _tcs_ds_rs The _ram functions allow applications to read and modify the contents of the 31 bytes of battery-backed RAM. The offset specifies the starting address within the RAM and should be between 0 and 31. The buffer provides the destination or source of the data, and the length gives the number of bytes transferred. Wrap-around is not supported so the sum of the offset and length should also be less than 31. The package's ds1302.c testcase provides example code. _ram The wallclock package is initialized by a static constructor with a priority immediately after CYG_INIT_DEV_WALLCLOCK. Applications should not call any wallclock-related functions nor any of the DS1302-specific functions before that constructor has run. The DS1302 is accessed via a 3-wire bus. At the time of writing there is no generic 3-wire support package within eCos, so instead the wallclock driver expects to bit-bang some GPIO lines. Typically the platform HAL provides appropriate hardware-specific macros for this, via the header file cyg/hal/plf_io.h. The required macros are: HAL_DS1302_CE(_setting_); HAL_DS1302_SCLK(_setting_); HAL_DS1302_OUT(_setting_); HAL_DS1302_IN(_setting_); HAL_DS1302_SELECT_OUT(_setting_); The argument to the first three macros will always be 0 or 1 and corresponds to the desired state of the chip-enable, clock, or I/O line. For example, at the start of a transfer the wallclock driver will invoke: … HAL_DS1302_CE(1); … Asserting the CE line should activate the DS1302 chip. The HAL_DS1302_IN macro is used to sample the state of the I/O line and should set its argument to 0 or 1. The HAL_DS1302_SELECT_OUT macro is used to switch the I/O line between output (1) or input (0). HAL_DS1302_IN HAL_DS1302_SELECT_OUT Platform HALs may provide two additional macros: HAL_DS1302_DATA HAL_DS1302_INIT(); HAL_DS1302_DATA can be used to define one or more static variables needed by the other macros, for example to hold a shadow copy of the GPIO output register. If defined, HAL_DS1302_INIT will be invoked during driver initialization and typically sets up the GPIO lines such that the CE and SCLK lines are outputs. HAL_DS1302_INIT In addition the DS1302 device driver package CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS1302 should be included in the CDL target entry so that it gets loaded automatically whenever eCos is configured for that target.
http://www.ecoscentric.com/ecospro/doc/html/ref/devs-wallclock-dallas-ds1302.html
crawl-003
refinedweb
468
51.48
#include "audiere.h" audiere::OutputStreamPtr* output_stream2; //Alot of code that you don't need to see in order to help. enum SampleFormat file_noise_format = SF_S16; FILE* file_a = fopen ("ljudfiler/HF01.wav", "rb"); long len; short int *buffer; long len2; short int *buffer2; int nr_of_channels =1; int sample_rate2 =44100; if (! file_a) //Error message else { len=100000*44100*1; buffer = (short int*) malloc (len); //malloc buffer fread (buffer, len, 1, file_a); //read into buffer } FILE* file_b = fopen ("ljudfiler/noise/cocktail_noise.wav", "rb"); if (!file_b ) //TODO:Error message else { len2=100000*44100*1; buffer2 = (short int*) malloc (len2); //malloc buffer fread (buffer2,len2 ,1, file_b); //read into buffer } SampleBuffer* sample_buffer = CreateSampleBuffer (buffer,100000,1,44100,SF_S16); SampleBuffer* sample_buffer2 = CreateSampleBuffer (buffer2,100000,1,44100,SF_S16); //Open a seekable sample source using the samples contained in the buffer. SampleSource* sample_source = sample_buffer->openStream (); SampleSource* sample_source2 = sample_buffer2->openStream(); //The samples are placed in a buffer and we can manipulate with buffers. for (int i =0; i < file_number_of_frames; i++ ) { buffer[i] = buffer[i]+buffer2[i]; } //In sample_buffer3 we will store what should be played. SampleBuffer* sample_buffer3 = CreateSampleBuffer (buffer,100000,1,44100,SF_S16); SampleSource* sample_source3 = sample_buffer3->openStream (); AudioDevice* dev; dev = OpenDevice (0, "buffer=10000, rate=44100"); if (dev == 0) //TODO: Error message: SampleSourcePtr sample_device_ptr(sample_source3); sample_buffer3->getFormat ((int&)nr_of_channels,(int&)sample_rate2,file_noise_format); //true stands for that the audio file should be played. output_stream2 = new OutputStreamPtr (OpenSound(dev,(const SampleSourcePtr&)sample_device_ptr Visual Studio, then perhaps the following will help. Instead of FILE* file_a = fopen ("ljudfiler/HF01.wav", "rb"); try FILE* file_a = fopen ("ljudfiler\\HF01.wav", "rb"); and change FILE* file_b = fopen ("ljudfiler/noise/cocktail to FILE* file_b = fopen ("ljudfiler\\noise\\cockta But do put in the error TODOs and exit. I did have an error message, so I shouldn't have written "TODO". I wrote that instead of the Visual C++-code that printed out an error message on the GUI. I didn't mean to give an incorrect description, I just erred in my sleepyness. I gave up using the Audiere-library. I instead chose another solution in which I create a wav file with the mixed sound and play that file; instead of playing the file from the buffer. Anders Branderud 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 In any case good for you to find a new approach that is working for you. Interesting link you have there. I didn't understand the sources well. But the bottom line of the first section, well, it would appear that something like this would be in a best-selling book. (Someone could even make a movie with enough creativity.) This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings. A few things with your code: - Where is file_number_of_frames being set? Is it set correctly? - Same for file_noise_format. - Additive mixing may produce garbage, due to overflow. But at least you would hear something. - I'm not sure, but are you supposed to read the entire wav file (including non-data chunks) and pass those to CreateSampleBuffer? I havent used that lib therefore cant say besides these at the moment. Can you please also comment out the mixing part and see if the non-mixed samples (single file) plays well? No, it wasn’t. “Interesting link you have there. I didn't understand the sources well. But the bottom line of the first section, well, it would appear that something like this would be in a best-selling book. (Someone could even make a movie with enough creativity.)” Thanks! If interested more information is found in the website of Netzarim (), especially the History Museum-pages It is in a book, but it is not best-selling. Anders Branderud Bloganders.blogspot.com
https://www.experts-exchange.com/questions/25683986/Putting-audio-files-into-buffers-mixing-them-and-playing-the-result-from-the-buffer.html
CC-MAIN-2018-39
refinedweb
666
57.16
: - BitBucket - - PyPI - Original suds Python library development project information - Project site - - Documentation - - Epydocs - For development notes see the HACKING.rst document included in the distribution. Installation Standard Python installation. Here are the basic instructions for 3 different installation methods: - Using pip - Have the pip package installed. - Run pip install suds-jurko. - Using easy-install - Have the setuptools package installed. - Run easy_install suds-jurko. - From sources - Unpack the source package somewhere. - Run python setup.py install from the source distribution's top level folder. Installation troubleshooting: - Released prior to 0.7 have many known installation issues requiring the target Python environment to be manually prepared when using some ancient Python versions, e.g. 2.4, 2.5 or 3.1. - Releases 0.4.1. jurko 5 < x <= 0.6 may not be installed using pip into a Python environment with an already installed setuptools package older than the version expected by our project. Displayed error message includes instructions on how to manually upgrade the installed setuptools package before rerunning our installation. - pip internally imports existing setuptools packages before running our setup, thus preventing us from upgrading the existing setuptools installation inplace. - If automated setuptools Python package installation fails (used in releases 0.4.1 jurko 5 and later), e.g. due to PyPI web site not being available, user might need to install it manually and then rerun the installation. - Releases prior to 0.4.1. jurko 5 will fail if the distribute Python package is not already installed on the system. - Python 2.4.3 on Windows has problems using automated setuptools Python package downloads via the HTTPS protocol, and therefore does not work correctly with PyPI which uses HTTPS links to all of its packages. The same does not occur when using Python version 2.4.4. Release notes version 0.7 (development) -+, except for the following versions: - Python 3.0.x - not supported by setuptools, pip or pytest. - Basic sources prepared for Python 2.x. - For using Python 3 the sources first processed by the Python py2to3 tool during the setup procedure. - Tested in the following environments: - Python 2.4.3/x86 on Windows 8.1/x64. - Python 2.4.4/x86 on Windows 8.1/x64. - Python 2.5.4/x86 on Windows 8.1/x64. - Python 2.5.4/x64 on Windows 8.1/x64. - Python 2.6.6/x86 on Windows 8.1/x64. - Python 2.6.6/x64 on Windows 8.1/x64. - Python 2.7.6/x86 on Windows 8.1/x64. - Python 2.7.6/x64 on Windows 8.1/x64. - Python 2.7.7/x86 on Windows 8.1/x64. - Python 2.7.7/x64 on Windows 8.1/x64. - Python 2.7.8/x86 on Windows 8.1/x64. - Python 2.7.8/x64 on Windows 8.1/x64. - Python 3.1.3/x86 on Windows 8.1/x64. - Python 3.1.3/x64 on Windows 8.1/x64. - Python 3.2.5/x86 on Windows 8.1/x64. - Python 3.2.5/x64 on Windows 8.1/x64. - Python 3.3.3/x86 on Windows 8.1/x64. - Python 3.3.3/x64 on Windows 8.1/x64. - Python 3.3.5/x86 on Windows 8.1/x64. - Python 3.3.5/x64 on Windows 8.1/x64. - Python 3.4.0/x86 on Windows 8.1/x64. - Python 3.4.0/x64 on Windows 8.1/x64. - Python 3.4.1/x86 on Windows 8.1/x64. - Python 3.4.1/x64 on Windows 8.1/x64. - Python 3.4.2/x86 on Windows 8.1/x64. - Python 3.4.2/x64 on Windows 8.1/x64. - Improved support for decimal XSD types. - Now modeled internally using Python's decimal.Decimal type instead of float - see the new suds.xsd.sxbuiltin.XDecimal class. - Based on a patch included with #454 for the original suds library implementation. - In order to get a decimal value formatted correctly in constructed SOAP request XML documents, pass it to suds as decimal.Decimal or an int/long. - In general, passing a value of a Python type other than decimal.Decimal causes that type's native string representation to be used which might not strictly match the lexical representation rules defined in the XSD specification for the decimal XSD type. For instance, a float value may be represented using scientific notation, or a fractions.Fraction may be represented using its numerator & denominator values. - Specific user applications can easily register their own customized XDecimal implementation using suds.xsd.sxbuiltin.Factory.maptag() if they want to use more specialized decimal value handling. - Updated how suds constructs its cached WSDL & XML identifiers to allow cached data reuse between different processes with Python's hash randomization feature enabled. - Previously constructed using the built-in Python hash() function, while now it gets constructed using md5 hash. - Python's hash randomization (implemented since Python 2.6.8, enabled by default since Python 3.3) was causing different processes to mangle their cached data names differently. - Many thanks to Eugene Yakubovich for reporting the issue as well as providing the initial fix. - Made suds no longer eat up, log & ignore exceptions raised from registered user plugins (detected & reported by Ezequiel Ruiz & Bouke Haarsma, patch & test case contributed by Bouke Haarsma). - Fixed places in code where suds could eat up & silently ignore internal Python exceptions like KeyboardInterrupt or SystemExit. - Fixed the exception message used when attempting to construct a suds.sax.element.Element with a non-Element parent. - suds.xsd.sxbase.SchemaObject.content() now runs in linear instead of quadratic time. - DepList class replaced with a simple dependency_sort() function taking a single dependency dictionary as input. - The original implementation's interface was too heavy-weight with no added value. - Anything tried with the original interface outside the basic use-case covered by dependency_sort() was actually or could be easily broken. - suds.xsd.deplist module renamed to suds.xsd.depsort. - A referencing XSD element's form value now read correctly from the referenced element. - Many thanks to Andrew Yager from BitBucket for reporting the issue. - suds.cache module cleanup. - Fixed FileCache default cache location related security issue. - Each process now uses a separate temporary folder as its default cache location. - Different FileCache instances within the same process still use the same default cache location and user may still explicitly specify a non-default location for each FileCache instance. - Default cache location now gets removed automatically on process exit. User code may disable this removal by setting the FileCache.remove_default_location_on_exit class attribute to False. - Additional external information on this issue: - Many thanks to Rolf Krahl for the initial report, providing links to related external resources as well as helping brainstorm the whole issue. - Fixed a bug causing DocumentCache to never actually cache any documents since one of the last commits made to the original suds project. - That commit refactored suds.sax.document.Document so it is no longer derived from suds.sax.element.Element while the suds.cache.DocumentCache.put() implementation simply did nothing when passed something other than a suds.sax.element.Element instance. suds.reader.DocumentReader on the other hand always passes suds.sax.document.Document instances to its cache's put() method. - Many thanks to bgr_ at BitBucket for reporting the issue. - Fixed a bug causing DocumentCache & ObjectCache to not remove their cached files when failing to read data from them or process the data read from them. - FileCache version file operations now take care to close the file in case of a failed read/write operation. - Removed FileCache.setlocation() method as it was never used inside suds and if used from user code would have caused the cache to use a specific folder but without making sure that the data already stored in it has been prepared for the correct suds version, as done when passing a location parameter to the FileCache constructor. - Private and protected FileCache interface methods renamed to use leading underscores. - FileCache.getf() --> FileCache._getf(). - FileCache.__fn() --> FileCache.__filename(). - FileCache.checkversion() --> FileCache.__check_version(). - FileCache.mktmp() --> FileCache.__mktmp(). - FileCache.open() --> FileCache.__open(). - FileCache.setduration() --> FileCache.__set_duration(). - FileCache.validate() --> FileCache.__remove_if_expired(). - Updated FileCache duration implementation. - FileCache construction now takes standard datetime.timedelta duration related keyword arguments instead of just weeks, days, hours, minutes & seconds. More to the point, it now also supports milliseconds & microseconds keyword arguments. - Corrected FileCache docstring stating that it accepted a months keyword argument. Using that argument would actually have caused a failure when passing it to a datetime.timedelta initializer internally. - You may now specify multiple duration keyword arguments in FileCache construction and they will all get summed up when constructing the internal datetime.timedelta duration representation. Before, you could specify such multiple arguments, but that would only make the FileCache silently use duration 0, i.e. its cache entries would never expire. - Fixed suds.sax.document.Document str conversion broken around the end of 2011 by some accidental interaction between our Python 3 compatibility fixes and one of the final official suds project commits making suds.sax.document.Document no longer be derived from suds.sax.element.Element. - Many thanks to Ezequiel Ruiz (emruiz81 at BitBucket) for detecting & reporting the issue, as well as providing the initial patch. - Cleaned up suds.transport ASCII/unicode URL/data handling. - suds.transport.Request now allows specifying its URL input as either a byte or a unicode string with any Python version. Internally that URL information is always converted to the used Python interpreter's native str data type (byte string for Python versions prior to 3.0, or unicode string for later ones). - Given URLs must not contain any non-ASCII characters, and any attempt to create a suds.transport.Request with such an invalid URL is reported as a UnicodeError (either UnicodeDecodeError or UnicodeEncodeError depending on the exact Python version and the given URL data type used). - suds.transport.Reply & suds.transport.Request string representation cleaned up and no longer raises an error when their message data contains non-ASCII characters. - suds.client module cleanup. - Removed unused suds.client.Client.messages attribute. - Renamed private SoapClient & SimClient classes: - SoapClient --> _SoapClient. - SimClient --> _SimClient. - Several private methods renamed: - _SoapClient.location() --> _SoapClient.__location(). - _SoapClient.get_fault() --> _SoapClient.__get_fault(). - _SoapClient.headers() --> _SoapClient.__headers(). - RequestContext no longer has client & original_envelope attributes. - client attribute seems unnecessary. - original_envelope was an incorrectly documented bug trap - it represented the XML request envelope as a SAX XML document from after being processed by registered marshalled plugins, but before being processed by registered sending plugins. Users should use the envelope attribute instead which can easily be converted into a SAX XML document if needed by parsing it using suds.sax.parser.Parser.parse(). That envelope has been consistently processed by all relevant registered plugins and matches the data to be sent over the registered transport exactly. - Cleaned up _SoapClient debug log messages a bit. - suds.reader module cleanup. - Several private methods renamed: - DocumentReader.cache() --> DocumentReader.__cache() - DocumentReader.download() --> DocumentReader.__fetch() - DefinitionsReader.cache() --> DefinitionsReader.__cache() - Updated the BuildError exception message. - Reformatted. - Converted to a unicode string. - suds.binding.Binding converted to a new-style class. - suds.tostr() utility function may no longer silently eat internal Python exceptions like KeyboardInterrupt or SystemExit. - Removed the unused SoapHeadersNotPermitted exception class. - Extra input arguments now reported when invoking web service operations taking no input parameters. - Using injected requests/replies/error-information with a web service operation taking at least one input parameter no longer causes suds to report an invalid extra argument error. - Internal project development improvements. - The project will from now on be distributed as a wheel as well as a source distribution. - Added a script for automatically setting up required development Python environments for this project, hopefully supporting the full range of supported Python versions out of the box. - Improved internal project HACKING.rst documentation. - setup.py improvements. - Python 3.0.x releases explicitly marked as not supported. - Attempting to run setup.py in an unsupported Python environment now reports a clean error message. - Now uses setuptools 1.4.2 with Python 2.4 & 2.5, and setuptools 5.1 with all more recent Python releases. - Project may now be installed without even in environments when you can not install setuptools. - In such cases setup.py will attempt to use any preinstalled setuptools version, and if none is available, it will disable some of its features and fall back to using a plain distutils based setup. See the setup.py script comments for a more detailed listing of all setup.py features affected by this. - Several installation issues fixes when installing into Python 3.x environments prior to Python 3.2.3. - When installing the project into a Python 3.x environment prior to Python 3.2, setuptools is not installed automatically since one of its test modules contains UTF-8 BOM characters, which would cause such automated installation to fail. - If needed, setuptools can still be installed into such environments by manually running its ez_setup.py installation script. Such an installation will encounter the same errors but will ignore them, effectively just leaving the installed setuptools package with one defective test module, but fully operational at run-time. - When installing the project into a Window Python 2.5 environment, you no longer need to manually install a compatible colorama package versions in order to be able to run the project tests. - Package meta-data may now contain non-ASCII characters on platforms where that is allowed, namely with all Python versions except Python 3.x prior to 3.2.2. - setup.py test command improvements. - Now works in Python 2.4.x environments. - Now reports cleanly if it can not be used for some reason, both when run and in the command's --help-commands listing. - Better commented the related implementation. - Test suite improvements. - Test suite no longer installed together with the project, thus no longer causing confusion by existing in the target Python environment as a global tests package. - The tests may now be run from the source archive, and will always run on the suds version found installed in the used Python environment. - Refactored the quick & dirty batch script used to run all the project tests in multiple Python environments to remove much code duplication. - Automated project testing in several additional Python environment versions. - Added more detailed XSD modeling tests. - Added tests demonstrating how additional or replacement built-in XSD types can be registered with suds. - All project tests now using Python 2 & 3 compatible source code and so no longer need to be built separately for Python 3. - Added new and updated existing suds.cache module related tests. - Documented that all pytest test parametrizations should be prepared so they get ordered the same on all test runs. See Project implementation note #1 in HACKING.rst for more detailed information. - Many thanks to Bruno Oliveira (nicoddemus at BitBucket) for researching related pytest xdist usage problems, discovering & explaining the underlying issue as well as providing an initial project patch for it. version 0.6 (2014-01-24) -. - Fixed sending HTTP request containing non-ASCII unicode data using Python 2.7. - Many thanks to mduggan1 and Alexey Sveshnikov for reporting the issue and suggesting patches. - Fixed unicode data logging issue (contributed by Bouke Haarsma). - suds.transport.Request object string representation cleaned up a bit - added a missing space before the URL to make it consistent with how all the other Request & Reply data is represented in such strings. - Fixed issue with suds client failing to be create its default cache object (e.g. because a folder it needs is write protected) and thus preventing the client from being created without any chance for the user to specify an alternative cache. - The default client cache is now instantiated only if user does not explicitly specify some other alternate cache (or even None to disable the whole data caching system). - Many thanks to Arthur Clune for reporting the issue. - Added explicit tests for URL parameters being passed as unicode or single-byte strings under Python 2 but only unicode strings under Python 3, and improved how such invalid parameter values are reported. - This behaviour matches urllib implementation differences between Python 3 and earlier Python interpreter versions. - Many thanks to Mesut Tasci for reporting a related issue and preparing the initial patch for it. - Extra arguments used when making a web service operation call are now reported similar to how this is done for regular Python functions. - The extra argument error reporting may be disabled using the new extraArgumentErrors suds option. - Basic idea and the initial implementation for this feature contributed by Bouke Haarsma. - Corrected a typo in the BuildError exception message. - Removed partial support for pre-2.4 Python versions since such old Python versions are no longer officially supported nor are they tested anywhere. - Updated documented project links to use HTTP instead of HTTPS protocol. - Setup improvements. - Fixed setup to work with soft links in the current working folder path (contributed by ryanpetrello). - Project now installed as a zipped egg folder. - No longer attempts to work around Python 2.4.3 issues with urllib HTTPS downloads since now PyPI updated all of its links to HTTPS and the patch would need to become much more complex to deal with this, while making the setup much more difficult to understand and maintain. - On the other hand, this is now an extremely old Python version, so the change is not expected to have much impact. Anyone still using this version will just have to work around the issue manually, e.g. by downloading the necessary packages and running their setup procedures directly. - long_description field content wrapped to 72 characters, since PKG-INFO package distribution metadata file stores this text with an 8 space indentation. - Improved internal project development documentation. - HACKING.txt updated, converted to .rst format & renamed to HACKING.rst. - Started internal project design, research & development notes documentation. Stored in a new notes/ subfolder, included in the project's source distribution, but not its builds or installations. - Internal test suite improvements. - Added unit tests for transport related Request & Reply classes. - Improved HTTPTransport related unit tests. - Split up some web service operation invocation request construction tests into: - parameter definition tests - argument parsing tests - binding specific request construction tests - Many new tests added & existing ones extended. - Several redundant tests removed. - Added a basic development script for running the project's full test suite using multiple Python interpreter versions under Windows. - Better test support when running with disabled assertion optimizations enabled. - Cleaned up support for running test scripts directly as Python scripts. - May now be passed pytest command-line options. - Now return an exit code indicating the test result (0=success, !0=failure). - Known defects. - Extra argument errors not reported for web service operations taking no input parameters. - Invalid extra argument error reported when using an injected request/reply/ error-information with a web service operation taking at least one input parameter. - Security issue CVE-2013-2217 - using fixed default cache location. - Incorrect referencing XSD element's form attribute value handling - read directly instead of from the references XSD element. version 0.5 (2013-11. - Updated the project's versioning scheme and detached it from the original suds project. The original project's stall seems to be long-term (likely permanent) and making our version information match the original one was getting to be too much of a hassle. - For example, with our original versioning scheme, latest pip versions recognize our package releases as 'development builds' and refuse to install them by default (supply the --pre command-line option to force the install anyway). - Improved the suds date/time handling (contributed by MDuggan1, based on a patch attached to issue #353 on the original suds project issue tracker). - Replaces the timezone handling related fix made in the previous release. - More detailed testing. - Corrected subsecond to microsecond conversion, including rounding. - DateTime class no longer derived from Date & Time classes. - Recognizes more date/time strings valid 'by intuition'. - Rejects more invalid date/time strings. - Time zone specifiers containing hours and minutes but without a colon are rejected to avoid confusion, e.g. whether +121 should be interpreted as +12:01 or +01:21. - Time zone specifiers limited to under 24 hours. Without this Python's timezone UTC offset calculation would raise an exception on some operations, e.g. timezone aware datetime.datetime/time comparisons. - Removed several project files related to the original developer's development environment. - Removed several internal Mercurial version control system related files from the project's source distribution package. - Better documented the project's development & testing environment. - Known defects. - Security issue CVE-2013-2217 - using fixed default cache location. - Incorrect referencing XSD element's form attribute value handling - read directly instead of from the references XSD element. version 0.4.1 jurko 5 (2013-11-11) -.3/x64, on Windows 7/SP1/x64. - Python 3.2.3/x64, on Windows 7/SP1/x64. - Python 3.3.2/x86, on Windows 7/SP1/x64. - Python 3.3.2/x64, on Windows 7/SP1/x64. - Improved Python 3 support. - Cache files now used again. - Problems caused by cache files being stored in text mode, but attempting to write a bytes object in them. Too eager error handling was then causing all such cached file usage to fail silently. - WebFault containing non-ASCII data now gets constructed correctly. - Fixed issue with encoding of authentication in transport/http.py (contributed by Phillip Alday). - Unicode/byte string handling fixes. - Fixed encoding long user credentials for basic HTTP authentication in transport/http.py (contributed by Jan-Wijbrand Kolman). - Fixed an IndexError occurring when calling a web service operation with only a single input parameter. - Fixed a log formatting error, originated in the original suds (contributed by Guy Rozendorn). - Fixed local timezone detection code (contributed by Tim Savage). - Setup updated. - Fixed a problem with running the project setup on non-Windows platforms. - version.py file loading no longer sensitive to the line-ending type used in that file. - Stopped using the distribute setup package since it has been merged back into the original setuptools project. Now using setuptools version 0.7.2 or later. - Automatically downloads & installs an appropriate setuptools package version if needed. - distutils obsoletes setup parameter usage removed when run using this Python versions earlier than 2.5 as that is the first version implementing support for this parameter. - Removed different programming techniques & calls breaking compatibility with Python 2.4. - String format() method. - Ternary if operator. - Project README file converted to .rst format (contributed by Phillip Alday). - Corrected internal input/output binding usage. Output binding was being used in several places where the input one was expected. - HTTP status code 200 XML replies containing a Fault element now consistently as a SOAP fault (plus a warning about the non-standard HTTP status code) both when reporting such faults using exceptions or by returning a (status, reason) tuple. - Before this was done only when reporting them using exceptions. - Reply XML processing now checks the namespace used for Envelope & Body elements. - SOAP fault processing now checks the namespaces used for all relevant tags. - Plugins now get a chance to process received() & parsed() calls for both success & error replies. - SOAP fault reports with invalid Fault structure no longer cause suds code to break with an 'invalid attribute' exception. - SOAP fault reports with no <detail> tag (optional) no longer cause suds code to break with an 'invalid attribute' exception when run with the suds faults option set to False. - Added correct handling for HTTP errors containing no input file information. Previously such cases caused suds to break with an 'invalid attribute' exception. - SimClient injection keywords reorganized: - msg - request message. - reply - reply message ('msg' must not be set). - status - HTTP status code accompanying the 'reply' message. - description - description string accompanying the 'reply' message. - Added unwrap option, allowing the user to disable suds library's automated simple document interface unwrapping (contributed by Juraj Ivančić). - SOAP request parameter XML elements no longer constructed in incorrect namespaces in case they have been defined by XSD schema elements referencing XSD schema elements with a different target namespace. - DocumentStore instance updated. - Separate DocumentStore instances now hold separate data with every instance holding all the hardcoded suds library XML document data. - DocumentStore now supports a dict-like update() method for adding new documents to it. - Client instances may now be given a specific DocumentStore instance using the 'documentStore' option. Not specifying the option uses a shared singleton instance. Specifying the option as None avoids using any document store whatsoever. - Suds tests no longer have to modify the global shared DocumentStore data in order to avoid loading its known data from external files and so may no longer affect each other by leaving behind data in that global shared DocumentStore. - Documents may now be fetched from a DocumentStore using a transport protocol other than suds. When using the suds protocol an exception is raised if the document could not be found in the store while in all other cases None is returned instead. - Documents in a DocumentStore are now accessed as bytes instead file-like stream objects. - Made more DocumentStore functions private. - Corrected error message displayed in case of a transport error. - Many unit tests updated and added. - Unit tests may now be run using the setuptools setup.py test command. - Note that this method does not allow passing additional pytest testing framework command-line arguments. To specify any such parameters invoke the pytest framework directly, e.g. using python -m pytest in the project's root folder. - Internal code cleanup. - Removed undocumented, unused and untested binding.replyfilter functionality. - Binding classes no longer have anything to do with method independent Fault element processing. - Removed SoapClient last_sent() and last_received() functions. - Fixed file closing in reader.py & cache.py modules - used files now closed explicitly in case of failed file operations instead of relying on the Python GC to close them 'some time later on'. - Fixed silently ignoring internal exceptions like KeyboardInterrupt in the cache.py module. - Removed unused Cache module getf() & putf() functions. getf() left only in FileCache and its derived classes. - Known defects. - Security issue CVE-2013-2217 - using fixed default cache location. - Incorrect referencing XSD element's form attribute value handling - read directly instead of from the references XSD element. version 0.4.1 jurko 4 (2012-0464 on Windows XP/SP3/x64. - Python 3.2.2/x64 on Windows XP/SP3/x64. -. -. - Added Python 3 support: - Based on patches integrated from a Mercurial patch queue maintained by Bernhard Leiner. - Last collected patch series commit: 96ffba978d5c74df28846b4273252cf1f94f7c78. - Original sources compatible with Python 2. Automated conversion to Python 3 sources during setup. - Automated conversion implemented by depending on the distribute setup package. - Made suds work with operations taking choice parameters. -> - Known defects. - Security issue CVE-2013-2217 - using fixed default cache location. WSDL objects. - Provided for repeating values in reply for message parts consistent with the way this is) - Change hard coded /tmp/suds to tempfile.gettempdir() and create suds/ on demand. - Fix return type for Any.get_attribute(). - Update HTTP caching to ignore file:// URLs. - Better logging of messages when only the reply is injected. - Fix XInteger and XFloat types to translate returned arrays properly. - Fix xs:import schema with same namespace. - Update parser to not load external references and add Import.bind() for XMLSchema.xsd location. - Add schema doctor - used to patch XSDs at runtime (see (2009-04-16) - (2009-02-24) - Static (automatic) Import.bind(''), users no longer need to do this. - Basic ws-security with {{{UsernameToken}}} and clear-text password only. - Add support for sparse SOAP headers via passing dictionary. - Add support for arbitrary user defined SOAP headers. - Fixes service operations with multiple SOAP header entries. - Schema loading and dereferencing algorithm enhancements. - Nested SOAP multirefs fixed. - Better (true) support for elementFormDefault="unqualified" provides more accurate namespacing. - WSDL part types no longer default to WSDL targetNamespace. - Fixed Tickets: #4, #6, #21, #32, #62, #66, #71, #72, #114, #155, #201. version 0.3.3 ; - since most servers are happy with any of the SOAP bindings (SOAP 1.1 and 1.2), ambiguous references to methods when invoking then without the port qualification will work just fine in almost every case. So, why not just allow suds to select the port. Let us not make the user do it when it is not necessary. In most cases, users on 0.2.9 and earlier will not have to update their code when moving to 0.3.1 as they might have in 0.3. version 0.3 (2008-09-30) -) Update document/literal binding to always send the document root referenced by the <part/>. After yet another review of the space and user input, seems like the referenced element is ALWAYS the document root. Add support for 'binding' schemaLocation``s to namespace-uri. This is for imports that do not specify a ``schemaLocation and still expect the schema to be downloaded. E.g. Axis references '' without a schemaLocation. So, by doing this: > > from suds.xsd.sxbasic import Import > Import.bind('') > The schema is bound to a schemaLocation and it is downloaded. Basic unmarshaller does (2008-08-11) - Add detection/support for document/literal - wrapped and unwrapped. - Update document/literal {wrapped} to set document root (under <body/>) to be the wrapper element (w/ proper namespace). - Add support for <sequence/>, <all/> and <choice/> having maxOccurs and have the. This (2008-08-05). E.g.: > client.factory.create('{}Person') version 0.2.5 (2008-08-01) - Overhauled the xsd package. This new (merging) approach is simpler and should be more reliable and maintainable. Also, should provide better performance since the merged schema performs lookups via dictionary lookup. This overhaul should fix current TypeNotFound and <xs:extension/> problems, I hope :-). - Fixed dateTime printing bug. - Added infinite recursion prevention in builder.Builder for XSD types that contain themselves. version 0.2.4 (2008-07-28) - (2008-07-23) - Optimizations. version 0.2.2 (2008-07, moved hokey start() methods from schema, as well as, query incrementation. Add inject keyword used to inject outbound SOAP messages and/or inbound reply messages. Refactored. Change the default namespace used to resolve referenced types (having attributes base="", Shea R="") so that when no prefix is specified: uses XML (node) namespace instead of the targetNamespace. conversion to unmarshaller (XBoolean only); refactor unmarshaller to use Content class which makes APIs cleaner, adds symmetry between marshaller(s) and unmarshaller(s), provides good mechanism for schema-property based type conversions. Refactored marshaller with Appenders; add nobuiltin flag to resolve() to support fix for returned_type() and returned_collection() in bindings. Add support for (202, 204) HTTP codes. Add XBoolean and mappings; add findattr() to TreeResolver in preparation for type conversions. Updated schema and schema property loading (deep recursion and is returned by the Builder (factory) for schema-types without children such as: <element/> and <simpleType/>; Builder, Marshaller and Resolver updated to handle Properties; Resolver and so that users do suds releases.: XML/SOAP =>er and Unmarshaller classes into a hierarchy of Resolver classes. This reduces the complexity and redundancy of the Builder, Marshall Schema.find() was stateless, it resolved the intermediate path elements on every call. The new resolver classes are stateful (2008-05-08) Update the schema.py SchemaProperty loading sequence so that the schema is loaded in 3 steps: - Build the raw tree. - Resolve dependencies ensures that local imported one should use: > > (2008-04-28)okey names for attributes and methods in the service proxy. Instead, the service proxy has __client__ and __factory__ attributes (which really should be at low risk for name collision). For now the get_instance() and get_enum() methods have not been moved to preserve backward compatibility. Although, the preferred does not define a <schema/> section and suds can not resolve the prefixes for the namespace to detect builtin types such as xs:string. version 0.1.7 (2008-04-08) - Added Binding.nil_supported to control how property values (out) = None and empty tag (in) are processed. - service.binding.nil_supported = True -- means that property values = None are marshalled (out) as <x xsi:nil=true/> and <x/> is unmarshalled as '' and <x xsi:nil/> is unmarshalled as None. - service.binding.nil_supported = False -- means that property values = None are marshalled (out) as <x/> and <x xsi:nil=true/> is unmarshalled as None. The xsi:nil is really ignored. - THE DEFAULT IS True. - Sax handler updated to handle multiple character() callbacks when the sax parser "chunks" the text. When the node.text is None, the node.text is set to the characters. Else, the characters are appended. Thanks - 'andrea.spinelli@imteam.it'. - Replaced special text attribute with __text__ to allow for natural elements named "text". - Add unicode support by: - Add __unicode__() to all classes with __str__(). - Replace all str() calls with unicode(). - __str__() returns UTF-8 encoded result of __unicode__(). - XML output encoded as UTF-8 which matches the HTTP header and supports unicode. - SchemaCollection changed to provide the builtin() and custom() methods. To support this, findPrefixes() was added to the Element in sax.py. This is a better approach anyway since the WSDL and schemas may have many prefixes to ''. Tested using both doc/lit and rpc/lit bindings. - Refactored bindings packages from document & rpc to literal & encoded. - Contains the completion of full namespace support as follows: - Namespace prefixes are no longer stripped from attribute values that reference types defined in the WSDL. - Schema's imported using <import/> should properly handle namespace and prefix mapping and re-mapping as needed. - All types are resolved, using fully qualified (w/ namespaces) lookups. - Schema.get_type() supports paths with and without ns prefixes. When no prefix is specified the type is matched using the schema's target namespace. - Property maintains attribute names (keys) in the order added. This also means that get_item() and get_names() return ordered values. Although, I suspect ordering really needs to be done in the marshaller using the order specified in the WSDL/schema. - Major refactoring of the schema.py. The primary goals is preparation for type lookups that are fully qualified by namespace. Once completed, the prefixes on attribute values will no longer be stripped (purged). Change summary: -. - <import/> element handles properly in that both namespace remapping and prefix re-mapping of the imported schema's targetNamespace and associated prefix mapping - is performed. E.g. SCHEMA-A has prefix tns mapped as xmlns:tns= and has targetNamespace=''. SCHEMA-B is importing schema A and has prefix abc mapped as xmlns:abc=''. SCHEMA-B imports A as <import namespace= xxx schemaLocation=>. So, since SCHEMA-B will be referencing elements of SCHEMA-A with prefix abc such as abc:something, SCHEMA-A's targetNamespace must be updated as and all elements with type=tns:something must be updated to be type=abc:something so they can be resolved. - Fixes unmarshalling problem where nodes are added to property as (text, value). This was introduced when the bindings were refactored. - Fixed various Property print problems. Notes: Thanks to Jesper Noehr of Coniuro for the majority of the rpc/literal binding and for lots of collaboration on #suds. version 0.1.6 truly.
https://bitbucket.org/ovnicraft/suds
CC-MAIN-2015-14
refinedweb
5,831
51.14
Zim Standard By Caiphas Chimhete MOST new commercial farmers who occupiedformerly white-owned farms during the controversial land reform programme, are reportedly failing to pay their workers stipulated wages because of low production levels over the past three years, The Standard has been told. Apart from that, the gazetted monthly wages for farm workers are pathetically low that most of them are living in abject poverty. Deputy secretary of the General Agricultural Plantation Workers Union of Zimbabwe (GAPWUZ), Gift Muti, said the union was currently visiting the new farmers in an effort to make them pay the stipulated wages. Some workers go for two months without getting their wages. Muti said most of those failing to pay workers were farmers, who invaded prime farm land during the government-sponsored land invasions, which started in 2000. He said while some new farmers comply, others were hostile to GAPWUZ officials, forcing the union to seek recourse to the labour court. "Some comply after we have discussions with them but there are other cases where we end up at the labour court for arbitration," said Muti, who could not give the exact number of farmers the union had taken to court. Muti said the union had, in the past few months, successfully lobbied 120 new farmers in Mashonaland West, 60 in the Midlands and more than 50 in Masvingo to pay their workers the recommended wages. The president of the Zimbabwe Commercial Farmers' Union (ZCFU) Davison Mugabe confirmed the problem, saying the new farmers were having difficulties paying their workers because they were "starting up". Mugabe said the situation was compounded by drought that has ravaged Zimbabwe for the past three years. "Most of the farmers are new and they do not have enough money to fall back on when the situation is as bad as it is now unlike established farmers. You must bear in mind that we have been having drought for the past three years," Mugabe said. Farm workers who spoke to The Standard last week said apart from the erratic payment of wages, their monthly earnings were pathetically low. The lowest paid farm worker (A1) gets $450 000, a figure that still falls well below the poverty datum line. The Consumer Council of Zimbabwe (CCZ) says a family of six now requires about $9 million a month to live a normal life. Anna Ndlovu, who works at a farm in Matabelelalnd North, owned by a senior official in the President's Office, last week said at times they went for two months without being paid. She said most workers were living a deplorable life. "How do they expect us to survive on this amount, when a two-litre bottle of cooking oil is going for $167 000? They (government) should see what they can do for us," said Ndlovu, a single parent. As at the end of August, she grossed $192 400 while net earnings went down to $184 128 after NSSA deductions of $5 772 and the $2 500 that was subtracted after she borrowed maize meal from the farm owner's grocery shop. But Mugabe, however, tried to justify the low wages saying: "We know the $450 000 a month is low but you must also take into consideration that the workers do not incur transport costs and food is cheap at the farm." Zim Standard Letters I WRITE this letter as a former teacher who left the profession a few years ago because of the lousy salary that I was getting. Teachers, hard-working and crucial though they are, have been reduced to what one might term "useless form of human currency". For their predicament, teachers have no one to blame but themselves. Most teachers are just too humane and tender-hearted to the point of stupidity if not idiocy and need to be "radicalised". During my short stint as a teacher, I noticed that most teachers are hard-working and dedicated to their work and yet they are ridiculed, despised and earn salaries that barely constitute a living. Look at teachers when they retire - most become almost social welfare cases. The very same people they work so hard and tirelessly to educate are the ones who look down upon them later on in life. Show me a hard-working teacher and I will quickly show you a fool of the highest order. To all the teachers out there I say - your dedication to duty is your greatest undoing. Teachers can revolutionise their salaries and working conditions. For society and their employer to respect and reward them accordingly, there should be a deliberate attempt by teachers to produce poor results nationally. If teachers in their wildest imaginations think that their employer will come up with good salaries on a silver platter, they are living in dreamland and should come down to mother earth and get to grips with reality. As long as students continue to pass and proceed to secondary schools, colleges and universities teachers will always remain a laughing stock. I am fully cognizant of the fact that most teachers are peasants and they also have school-going children; this is where the problem lies. There is a need, however, to take cognizance of the fact that for anyone to win any war; they must turn a blind eye to whoever might be the victim or casualty. This is one of the painful principles of war. If doctors and nurses can go on strike and leave patients dying in order to be heard and rewarded appropriately, then surely teachers can emulate them in order to be taken seriously. Why take your work seriously when your employer is not serious about your well-being and welfare? Already the medical professional has its own board, in a bid to improve salaries and working conditions at the expense of other civil servants. Teachers are taken for granted because they cannot leave for greener pastures in droves like nurses, doctors and health technicians. Let it be known that teachers can be like hypertension or high blood pressure. They have the potential to kill silently. There is a great urgency for the powers that be to set up a board for the teaching profession, similar to the Health Services Board. To the powers that be, I ask: Which is more important and valuable, the golden eggs or the hen that lays the eggs? It is high time the teachers showed them where those doctors, nurses and pharmacists come from. You have been patient and sympathetic for far too long and to your own detriment. Finally and to all the teachers once more I say - wake up! Stop watching a game you are supposed to be playing. Son of the Soil Jahunda Gwanda Zim Standard Letters WHILE the Zimbabwe Tourism Authority (ZTA) is busy trying to persuade us to believe that tourism is showing signs of recovery, they could do several things that will make tourists feel most welcome. One of them is the safety of tourists once they set foot on Zimbabwean soil. South Africa has just published a report that says it is much safer than it was before. That can only persuade more tourists to feel they will be safer there and that can only be at the expense of Zimbabwe. The security of both domestic and international tourists at the various resort areas is key to promoting greater inflows of visitors. The other area needing the attention of the ZTA is the stretch of the road to the Harare International Airport just past 1 Commando Barracks, where visitors are greeted by the stench of overflowing septic tanks. This is not the image Zimbabwe wishes to portray. Where does the effluent go? Is there no one in the City Council or at the Barracks who sees this health hazard, year in year out? And why is the matter not resolved once and for all? In case they do not understand what I am suggesting, I am sure it would not cost a lot to connect the septic tanks to the sewerage lines either in St Martin's, Arcadia or Sunningdale compared to the threat to human life and pollution to tributaries feeding into Lake Chivero, Harare's main water reservoir. In any case, who is the councillor/commissioner or MP for the area and just what are they doing about this problem? It is such a negative point for tourists to be greeted by something like that after they touch down at the airport. Zimbabweans are so submissive. The residents of the three suburbs mentioned above have endured the stench for years yet they appear not to have protested demanding action on the overflowing effluent from the Barracks. They should demand action from whoever claims to represent them and serves their interests. Another area with a similar hazard is the T-junction of Sam Nujoma Street and Norfolk Road in Mount Pleasant opposite Golden Stairs garage. The septic tanks there are always overflowing and just how people at the garage can put up with something like that is puzzling. Surely their health is more important? The City Council and the Ministry of Health should order the Ministry of Defence to deal with the problem so that there is regular emptying of the tank. Not everyone in Harare can afford mineral water. Let's get things right the first time. M Watema Mount Pleasant Harare Zim Standard Letters SEVERAL recent events have helped to unmask the undemocratic nature of Zanu PF. One of these is the apparent absence of any consultations on what status to bestow on and the venue of Henry Matuku Hamadziripi's final resting place. If Zanu PF is as democratic as it misleads people into believing, it would have allowed/tolerated free and open discussion and in the end accepted the majority decision. As it is, it looks to me that it is the minority decision that prevailed over others. But the fact that others who should know better preferred silence and retreated into dark corners for fear of being seen, suggests fear instead of democracy rules Zanu PF. If Hamadziripi was instrumental in transforming Zanu PF from a constitutional reformist party to a revolutionary party pursuing the armed struggle, what was Robert Mugabe, as an individual, instrumental in? The second example of how undemocratic Zanu PF is the reported expulsion of war veterans' leader, Jabulani Sibanda. A democratic organisation would have asked Sibanda to appear before a hearing. No, in fact, they would have checked with people who are alleged to have carried out an interview during which Sibanda is alleged to have uttered things that so offended the ruling party. It could very well be that they find something different, but at any rate just suspending someone without giving them a platform to defend or present their own side of events is as undemocratic as you can get. What this case only confirms is that a decision to suspend Sibanda was taken long back and that an excuse to justify the action is being cooked up. Why does Zanu PF act so frightened of discovering the truth? Zanu PF is its own worst enemy, not Jabulani Sibanda, not Tony Blair or George W Bush. Yet another example of the undemocratic nature of Zanu PF is the decision by Elliot Manyika, the ruling party's political commissar, announcing that there will be no primaries to select potential candidates to take part in the race for the Senate. Manyika said Zanu PF would adopt a "common consensus method and as always the Central Committee and the Politburo have the final say." What the hell is that and since when has it subscribed to this view and why? What has changed and what is suddenly wrong with a process they used only in January and February this year ahead of the 31 March Parliamentary elections. Before they even start Zanu PF is preparing to rig the whole exercise against its members! That is democracy Zanu PF style. No wonder there is so much disgruntlement in the ruling party. Why have an election if the central committee and the politburo are going to have a final say. Why doesn't it just go ahead and handpick those it wants as its candidates instead of this hoax of an election exercise. Next, they will extend the "common consensus method" to everything. This is how a dictatorship operates. Even in traditional societies, the chiefs consulted their court officials and once in a while the court jester acted as their conscience, ridiculing and amplifying their misplaced decisions, forcing them now and then to evaluate their decisions. Further examples of Zanu PF's intolerance can be found in Cain Mathema's attack on non-governmental organisations that have provided boreholes for rural communities to draw water for their drinking and livestock purposes. The issue for Mathema to answer is: Why are non-governmental organisations providing boreholes when the government was supposed to provide rural communities with tap water? Would he rather the rural communities had no water at all, because that is what he seems to suggest - so that more people can die from waterborne diseases! The other face of Zanu PF's undemocratic and intolerant nature is Edwin Muguti's attack against the British. Thankfully the local chief and villagers - the real beneficiaries of the UK aid - were there to speak for themselves. Mathema, Muguti and the others on the gravy train do not represent the views of the majority. Where their own government fails to do anything they would rather no one did anything at all. Tirivanhu Mhofu Emerald Hill Harare Zim Standard Letters AT the moment there is job freeze in the public sector. The purpose is to save on government expenditure. But what is really happening is very puzzling. Posts which are in the lowest grade where a worker gets less than $3 million are being frozen. However, at the same time posts that pay millions more of dollars are being created for favourites. William Nhara got a new post in the President's Office, specially created for him since he had no job after losing the 2005 Parliamentary elections. This post definitely costs the government many millions of dollars. Is this a job freeze when bigger and more costly posts are opened any time for Zanu PF yes men? The other example of job creation is the Senate. New jobs are going to be created for 66 jobless Zanu PF hero-worshippers as well as the supporting staff and it will cost the taxpaying public billions of dollars. And yet the majority of the tax payers are living a hand to mouth existence while the government spends their taxes extravagantly and unplanned. The Zanu PF government should be ashamed of continuing to cause suffering to the people of Zimbabwe. D R Mutungagore Sakubva Mutare Zim Standard Letters I am surprised that you raised the issue "RBZ grants Gono farming loan". As far as our Reserve Bank Governor is concerned, corporate governance relates to other people and not RBZ employees. If you recollect when Gono was appointed, the Mashonaland East Governor asked him to declare his interests. As far as I can recall, it was widely believed in financial circles that Gono was the major shareholder in the Financial Gazette. Gono did not, among a number of things, declare his interest in the Financial Gazette. If Gono is untruthful about such a matter how can we trust him on other more important issues? I would be interested to know how much Productive Sector Support funding was granted to Gono's farms and the Financial Gazette. It is interesting to notice that appointments to financial institutions must be vetted by the central bank. Who vets potential employees for the central bank? Totemless Croydon South London Zim Standard ZIMBABWE'S problems would be fewer if belt-tightening by ordinary Zimbabweans was matched by similar measures and not just rhetoric from its leaders. Ten days ago, President Robert Mugabe thanked Zimbabweans for their resilience, in particular, in the light of problems facing the country. He said: "It is that spirit of endurance and commitment to the national cause which saw us defeat colonialism and win our freedom and independence." Last month Zimbabwe even surprised the International Monetary Fund by coughing up US$120 million to reduce its arrears to the Bretton Woods institution. This was followed by a further US$15 million this month. The IMF was startled by this sudden show of the spirit of sacrifice because it was acutely aware that while Zimbabwe was finally doing the right thing since 2000 other sectors were going to suffer. It was partly this realisation which led the IMF to question Zimbabwe's ability to find resources to enable it to reduce its arrears The same sacrifice made in order to pay off the country's arrears to international financial institutions is called for when dealing with the problems confronting the nation. It can be argued that Zimbabwe's problems emanate from a total lack of will to limit the penchant for lavish lifestyles or the sense to examine and question whether what is being considered or done is really necessary and in the greater national interest. If Zimbabwe's leadership had capacity for such reflection and the will, they would have, as far back as 2000, paused to question whether unleashing violence was an appropriate method of redressing historical land imbalances. They would also have reflected on how the country was going to afford goods it does not produce when every exporting sector was being run down or forced to cease operations. Last month and at a time when the country could scarcely afford fuel for its critical sectors, a decision was made to host regional air forces, when common sense would have dictated a postponement as part of belt-tightening. Counterparts from the region would have understood, given the country's predicament. But the show went ahead regardless of the effects. It was a remarkable demonstration of skewed priorities but one that unmasked how the country is being run. The national carrier, Air Zimbabwe, had to delay or transfer passengers paying in foreign currency because it had no fuel for its aircraft. But that is not all. At a time when the mention of Zimbabwe conjures up images of extreme hardships, the country boasts probably the largest population of luxury vehicles outside South Africa on the continent, especially by its government ministers and officials. Chad recently discovered oil yet it has placed limits on overseas travel while Rwanda has impounded 2 500 government vehicles questioning whether government ministers really need them. Rwanda suggests government ministers "be with the people". This maybe extreme, but it demonstrates the kind of belt-tightening alien to their Zimbabwean counterparts. Overseas trips by Zimbabwe's ministers are numerous, yet they cannot be justified in terms of real immediate or long-term benefits to the country. They are like investing in a pyramid scheme. Yet if the resources gobbled up by foreign trips were channelled to domestic needs, the fuel crisis would not be so critical. Industries would not be acutely affected and they would be able to produce scarce basic commodities while export earning-sectors would be supplying foreign markets and therefore generating hard currency to, in turn, enable the country to pay for its imports. Politics has largely become an avenue for pursuing private business ventures. MPs are granted constituency travel allowances, yet how many of them actually use this facility for the purpose of visiting and consulting with the people who elected them? If the MPs were genuinely engaged in consultative or report back processes there would be no complaints about legislators who only remember their constituencies when campaigning starts. It is clear therefore that the travelling allowances are being used for other purposes other than for what they are intended. A start could be to reduce the allowances to half of the present entitlement, as part of belt-tightening. Such a move may be used to justify underperformance, but even with all the allowances in the world, they would never deliver. The same could be extended to government ministers and their officials, as would a review of the number and performance of our expensive foreign missions. The Senate, whose elections are due at the end of November, is an indication of how the government expects belt-tightening by ordinary Zimbabweans without attendant responsibilities on its part. Opposition to the Senate is fuelled by the insensitive timing and because of scarce resources. Sixty-six new senators, offices and supporting staff will mean more in government expenditure, placing a greater burden on the taxpayers. Let's cut our suit according to our cloth. Belt-tightening must be for everyone. Zim Standard By our staff FOUR of Harare's suburbs have been hit by a spate of cable thefts with telephone services to more than 200 consumers affected during the month of September alone and service provider TelOne says replacement cables are not locally available. In one of the suburbs, which is worst affected by the cable thefts, services to more than 100 subscribers have been suspended. According to TelOne the suspension of services to subscribers will be for an indefinite period, owing to the unavailability of cables to restore services. Telephones services are critical in cases of emergencies. A delay in calling emergency services because of vandalised lines could mean the loss of lives. "The situation has been worsened by the fact that there are no cables available on the local market, hence they have to be imported. With current severe foreign currency shortages it would be difficult to get that allocation now as they are equally important sectors of the economy that urgently need foreign currency. "These problems have resulted in a huge backlog of faults in the said areas and this has resulted in customers experiencing delays in restoration of service," TelOne's public relations executive, Phil Chingwaru said. Zim Standard By our staff BULAWAYO - The Bulawayo City Council has been hit by a shortage of engineers, making it difficult for the authority to attend to essential services. Addressing residents at a city hotel recently, executive mayor Japhet Ndabeni-Ncube revealed that the city was facing a critical shortage of engineers. He said 27 engineers had left the council during the past few months. Residents have in recent weeks endured water blockages and burst sewer pipes, among other things and the council has failed to rectify the problems timeously. The non-availability of fuel has also forced the local authority to confine refuse removal to the central business district. Ndabeni-Ncube disclosed that the were 425 water leaks, 150 water blockages and many burst sewer pipes which could not be rectified due to serious staff shortages in the city. On the water situation, the mayor said the council was now pursuing plans to extend further north the Nyamandhlovu aquifer in a bid to augment the low water levels trickling into the city. In Nyamandhlovu, the mayor said, only 8 out of 78 boreholes were working as most of them were vandalised by war veterans at the peak of farm invasions in the year 2000. Zim Standard By Ndamu Sandu EMPOWERMENT outfit Nkululeko Rusununguko Mining Company of Zimbabwe (NRMCZ) has sought the intervention of President Robert Mugabe in its bid to acquire 15% stake in Zimplats Holdings Ltd. NRMCZ won the right to partner Zimplats last year ahead of National Investment Trust (NIT) and Needgate. Standardbusiness heard last week the move comes hard on the heels of efforts by Mines ministry to scuttle the transaction in favour of a created Special Purpose Vehicle (SPV) that would accommodate all losing bidders for the empowerment stake. Industry sources say while Mines minister Amos Midzi was pushing for an SPV, Reserve Bank of Zimbabwe (RBZ) Governor Gideon Gono was pushing for NIT to acquire the empowerment stake including the financing of the transaction. The letter to President Mugabe, sources say, outlines impediments faced by the empowerment group to acquire the transaction. While it could not be established the actual date the communication had been sent, sources told Standardbusiness last week that the letter had been sent to President Mugabe last month. Sources say NRMCZ had raised concern over the reluctance of the ministry of Mines and Mining Development on policy issues such as the final percentage on indigenous empowerment in the white metal producer. Zimplats had indicated that it wanted to know the final percentage as it was worried about political statements to the effect that indigenous players were entitled to 50% in mining ventures. Sources say concern was also raised on attempts by Midzi to scuttle a cabinet decision to award 15% to NRMCZ by sounding the idea of an SPV as a pre-condition for progress. Standardbusiness broke the story in August of plans by Midzi to set up an SPV that would accommodate losing bidders, Needgate and NIT. Nkululeko requested Midzi to put his proposal in writing. Sources say Midzi failed to do so. Sources say the empowerment group had raised concern on the role played by Gono in stifling the conclusion of the empowerment deal. Gono has in the past raised concern over the composition of NRMCZ saying it (NRMCZ) "was gate-crashing into platinum business riding on political connections". Sources say the empowerment group had expressed concern over the delay by Impala Platinum Mines (Implats) to conclude the transaction. Implats are the largest shareholder in Zimplats. "Implats are claiming that they cannot proceed with the transaction because a number of groups were introduced to them by the Mines ministry," a source said. Impala, sources say, were shifting the goal posts saying it was unable to conclude the transaction until the bilateral agreement between Zimbabwe and South Africa to protect South African investments in the country had been signed. Efforts to get comment from the usually reliable Gono were unsuccessful throughout the week so was NRMCZ spokesperson Alex Manungo. Under the arrangement, NRMCZ will buy 13.4 million shares in Zimplats at the ruling price on the Australian Stock Exchange (ASX). The empowerment stake has been at the centre of controversy with Needgate at one time saying, "they were the sole owners of the 15% equity and waiting for the official announcement". Zim Standard By Bertha Shoko HIV positive Zimbabweans could be living on the edge of death following revelations that the country's sole manufacturer of Anti-Retroviral drugs (ARVs) is failing to import raw materials used in the production of the vital medication. The Standard understands that Varichem Pharmaceuticals Private Limited, the country's sole manufacturer of generic ARVs is facing problems due to shortages of foreign currency needed for importation of raw materials. The foreign currency crunch is also understood to be affecting the whole pharmaceutical industry, which faces insurmountable hurdles in sourcing hard currency from the official market. Varichem manufactures the ARV combination Stalanev that contains the active ingredients, staduvine, lamudivine and nevirapine. Stalanev is used as a first line in the management of HIV. The other combination it manufactures contains Zidovudine and lamudivine also used as an alternative to Stalanev. Highly placed sources at Varichem told The Standard that the pharmaceutical company was last allocated foreign currency by the Reserve Bank of Zimbabwe through the auction system on 18 July 2005. The sources said the pharmaceutical company requires more than USD$350 000 a month but could require more as demand for ARVs increases. If a foreign currency injection is not made as a matter of urgency, they warned, the country could run dry of the ARVs on the private market where the majority of people using the anti-Aids drugs source them. "The pharmaceutical industry is forex-intensive and therefore lack or shortage of foreign currency will affect operations in a big way. Right now, the shortage of foreign currency is only affecting the private sector and if anything is not done, there will be no ARVs on the private market," the sources said. There are fears also that the shortages might affect government's public ARV programme, carried out at major institutions such as at Harare Central and Parirenyatwa hospitals in Harare. About 30 000 HIV positive people against a backdrop of more than 300 000 who need the drugs, are benefiting from this scheme which has failed to expand since its inception last year due to limited resources and lack of external funding. Contacted for comment, Dr David Parirenyatwa, the Minister of Health and Child Welfare, referred questions to Varichem saying they would be in a better position to say exactly what is happening. "Varichem may have its challenges like any organisation, but they would be in a better position to tell you. As for our government run ARV programmes they have been able to keep up with the supplies we need," Parirenyatwa said. An official with Varichem told The Standard that the company was working flat out to reverse the impending drug shortages. "Our parent ministry, the Ministry of Health and Child Welfare, is aware of this problem and they are assisting us by seeking dialogue with the central bank," said the official. Other players in the drug procurement and distribution industry confirmed that the pharmaceutical industry faced a foreign currency crisis. Benson Tamirepi, the managing director of Health Care Resources, told The Standard that most of the drugs being manufactured by Varichem have a "high import content" and therefore required foreign currency. Tamirepi, whose company distributes pharmaceuticals, surgical medication and equipment from Varichem and other companies, said the government must prioritise allocation of foreign currency to health institutions. Other than Varichem, the Medicines Control Authority of Zimbabwe recently licensed two Indian companies, Ranbaxy and Citla, to supply Zimbabwe with generic drugs, while Caps Holdings Limited has been awarded a licence to manufacture ARVs. These other players might help avert the pending drug crisis. Zim Standard By our staff KARIBA - VIP delegates attending the World Tourism Day celebrations in Kariba last week came face to face with the reality of the fuel crunch when a boat ran out of fuel in the middle of Lake Kariba. Dignitaries in the boat were Environment and Tourism minister Francis Nhema, Mashonaland West Governor Nelson Samkange and management officials of the Zimbabwe Tourism Authority (ZTA). The boat ran out of fuel on its way from Msambakaruma Island, the venue of the celebrations and delegates had to endure a two-hour anxious wait before a speed boat came with additional fuel. At the evening cocktail, Samkange chose to be economic with the truth blaming the fuel crisis on sanctions. Tour operators said the biting fuel shortage was affecting their businesses. Operators also blasted national carrier Air Zimbabwe for choosing flying days not conducive to travellers. Air Zimbabwe flies to Kariba thrice a week on Tuesday, Thursday and Saturday. Air Zimbabwe was also blasted for delaying in its flights and cancellation of some flights. Indeed tour operators' attack on Air Zimbabwe was opportune. The Saturday flight to the resort town was moved from 7.30 am to 10.00am. It was later cancelled. Nhema was initially booked on the Air Zimbabwe flight but because of the inconsistency of the national carrier, he cancelled the booking. Nhema and his entourage were booked on Alliance Aviation that flew the delegates to and from Kariba. Alliance Aviation is a new kid on block in the aviation industry that commenced operation in August. Meanwhile the 2005 Travel Expo open at the Harare International Conference on Thursday. The 13 -15 October exhibition will be held under the theme "Providing Hospitality for 25 years with a bright future". ZTA had set a target of 150. Over 170 international buyers have confirmed participation at the annual showcase as of Friday. Zim Standard By Caiphas Chimhete THE State will dole out more than $36 billion to former political prisoners, ex-detainees and restrictees, in what analysts said yesterday is economically dangerous "vote-buying" ahead of next month's Senate elections. The analysts warned that payment of gratuities to war collaborators was a repeat of a disastrous "appeasement policy" and would be a replica of the 1997 economic disaster triggered by the award of $50 000 each to war veterans, which sent the economy into free fall in what came to be known as "Black Friday". Last week, the government sanctioned a one-off payment of $6 million gratuity and provision of loans to finance commercial projects, education, medical as well as funeral expenses to ex-prisoners, detainees and restrictees, numbering about 6 000. Assistance would also be given to their dependent children wishing to pursue academic or vocational training, while those attending non-government schools and institutions will be entitled to an education grant equal in amount to the education benefit at government institutions. In addition, funeral grants to the beneficiaries would be availed at the same rate as those paid to civil servants. Beneficiaries intending to embark on income-generating projects will be able to apply for loans under the Ex-Political Prisoners, Detainees and Restrictees Act. University of Zimbabwe political scientist, Eldred Masunungure, said it had become a pattern for Zanu PF to "buy votes" ahead of any major election in which it expects a major challenge. He said the vote-buying campaign was a clear indication that the ruling party had lost the support of people who were suffering because of President Robert Mugabe's scorched earth economic policies. Mugabe, under siege from marauding war veterans led by the late Chenjerai "Hitler" Hunzvi, awarded former freedom fighters $50 000 each in 1997 - sending the economy into a tailspin from which it has never recovered. It appears the government has not learnt much from that disaster. Masunungure said: "That has become a pattern. It has to be understood in the context of politics of patronage - Zanu PF's political survival tactic. If Zanu PF fails to do that it will be gone for good and the leaders know that. It's going to be devastating. It will compound an already bad economic situation." Independent economic analyst John Robertson agreed, saying the $36 billion would have a huge negative impact on the country's shrinking economy because the government's excessive spending had not been matched by production. Paul Themba-Nyathi, the opposition Movement for Democratic Change spokesperson said the payment of gratuities was a campaign gimmick by Zanu PF, which always bribed gullible members of society towards major national elections. Two weeks ago, Mugabe told the same war collaborators that fuel, that has dogged the country for the past five years, would be readily available. That prophecy is still to be realised. Robertson said the payment would create problems for the Minister of Finance, Herbert Murerwa, who will need to accommodate the former war collaborators in next year's budget, considering that the country was failing to pay for fuel, feed the nation or service its international debts, but would factor salary increases of civil servants in January next year.
http://www.zimbabwesituation.com/old/oct10a_2005.html
CC-MAIN-2014-49
refinedweb
5,846
57.4
Data::PrettyPrintObjects - a pretty printing module with better support for objects This module is a fairly powerful pretty printer useful for printing out perl data structure in a readable fashion. The difference between this module and other data dumpers and pretty printers is that it can be configured to handle different types of references (or objects) in different ways, including using object methods to supply the printable value. If you have simple data structures without any blessed objects embedded in them, this module behaves similar to any other pretty printers. However, if you have objects embedded in them, this module is very useful for describing the data. Although modules such as Data::Dumper are often used for this purpose, this module is NOT a replacement for Data::Dumper, or any other similar module. Data::Dumper examines raw data (including printing out the full representation of an embedded object). A pretty printer, such as this one, is designed to print the data in a readable form, which may or may not mean displaying the raw data. As an example, if you have data structure which includes an Archive::Zip object, you may want the printable value of that object to be a list of all files in the archive, rather than a description of the Archive::Zip object. If you have a Date::Manip::Date object, you probably want the printable value to be a date contained in the object. For displaying a data structure, the structure is examined recursively, and turned into a string. The format of the string depends on the type of data and the options described below. Most of the time, a scalar is displayed exactly as it exists. If the scalar includes embedded quotes, commas, spaces, or newlines, it will be quoted. Embedded newlines will be emphasized by including '\n' in the string. This is not true perl quoting since embedded quotes will not be escaped. Embedded newlines will cause the output to be quoted, and an extra space added at the start of each line. For example: print PPO("a\nb\nc") => 'a b c' Note the leading extra space on the second and third lines. This is so printing out a multi-line scalar will correctly line up after quotes have been added. A list will be displayed as square brackets enclosing list elements. In other words: [ ELE1, ELE2, ... ELEN ] A has will be displayed as: { KEY1 => VAL1, KEY2 => VAL2, ... KEYN => VALN } Objects will typically be displayed using their scalar representation (i.e. what you get with the function scalar($object)), but this can be overridden using the options described below. Options may be set in one of two ways. They may be set in a file specified by the PPO_OptionsFile function, or they may be set by passing them to PPO_Options. The argument to PPO_Options is a hash containing option/value key pairs. The argument to PPO_OptionsFile is a file containing a YAML hash. The following keys are known: Each level of a data structure is indented a certain number of spaces relative per level. This defaults to 2, but this option can be used to change that. When displaying a list, the list_format option defines how it will be formatted. Possible values include: standard By default, a list is printed in a one per line format. In other words: [ a, b, c ] indexed This is one item per line with an index. In other words: [ 0: a, 1: b, 2: c ] In a nested data structure, the depth of a piece of data refers to how many levels deep it is nested. If max_depth is 0 (which is the default), all levels will be printed). For example, one data structure might be printed as: [ a, b, [ c, [ d ] ] ] (if max_depth were 0). In this example, 'a' and 'b' are both at depth 1, 'c' is at depth 2, and 'd' is at depth 3. Sometimes, you may only want to print out the top levels. By setting a max_depth to N, every scalar value (or object who's printable value is a scalar) who's depth is N or smaller will be printed out. It will not recurse into more deeply nested data structures, but instead will print them out using the max_depth_method described next. In this example, setting max_depth to 2 might result in the following output: [ a, b, [ c, ARRAY(0x111111) ] ] The format used to display the structures more deeply nested depend on the max_depth_method. When max_depth is set, structure that is more deeply nested than that depth are displayed in some method to indicated that the structure is there, but it is not recursed into to display the actual data contained there. The possible values for max_depth_method are: ref This is the default, and means to display the memory reference of the structure. For example, an array reference would be displayed: ARRAY(0x111111) and an object with a non-scalar printable value would include the class, so an Archive::Zip object (who's printable value might be defined to be a list of files contained in the archive) might be: Archive::Zip=HASH(0x15c8e50) If the printable value of an object is a scalar, it will be printed using the methods defined for that object. type This is a simpler version when you are only interested in seeing the type of structure/object but not the memory reference. They might be displayed as: ARRAY Archive::Zip If a data structure has circular references, or structure/objects embedded in it multiple times, there are different ways to display it. For example, if you have the code: $a = [1]; $d1 = [$a,$a] $d2 = []; push(@$d2,2,$d2); the structures '$d1' and '$d2' will be displayed depending on the value of the duplicates option. The value may be one of the following: link This is the default. In this case, the first occurence of a data structure is displayed normally, and the second (or higher) occurence is listed as a link to the first one. '$d1' would be printed as: [ [ 1 ], $VAR->[0] ] and '$d2' would be printed as: [ 2, $VAR ] reflink This adds memory references to all duplicates. So the '$d1' and '$d2' would be displayed as: [ ARRAY(0x111111) [ 1 ], ARRAY(0x111111) $VAR->[0] ] and ARRAY(0x111111) [ 2, ARRAY(0x111111) $VAR ] ref This simply prints second (or higher) occurrences as memory references (but doesn't indicate what it duplicates): [ [ 1 ], ARRAY(0x111111) ] and [ 2, ARRAY(0x111111) ] The objs option is used to set the options for each type of object. The value of this is a hash described in the OBJECT OPTIONS section below. The value of the objs option is a hash. The keys in this hash are the full names for various objects. The value for each entry is a hash containing the options for that object. For example, to set options for displaying an Archive::Zip object, you would need to pass in the following to the PPO_Options function: %obj_opts = ( 'Archive::Zip' => { OPT => VAL, OPT => VAL, ... } ); PPO_Options(..., objs => \%obj_opts ); The object options include the following: This tells how the printable value of an object should be obtained. Values can be: ref The object will be printed out as a reference: Archive::Zip(0x111111) This is the default method. method If this is passed in, the value is a string which is a method name that can be used to return the printable value. In other words, if $obj is an object, the printable value is obtained by calling: $obj->METHOD(ARGS) where METHOD is the value of the B<func> option, and ARGS is the value of the B<args> option. The arguments are passed unmodified. func This can either be the name of a function, or a function reference. The printable value for the object is obtained by calling: &FUNC(ARGS) where FUNC is the value of the B<func> option and ARGS is the value of the B<args> option. Exactly one of the ARGS should be the literal string '$OBJ' which will be replaced with the actual object. FUNC is looked for in the namespace of the caller, the namespace of the object, and the main namespace (in that order). data This treats the object as a data structure and displays it. This is the name of the method or function used to get the printable value of an object. It must be defined if print is 'method' or 'func'. There is no default value. This is a list of arguments to pass to the method or function. This is only used if the value of the print option is method or func. The output from the method/function will be treated as a scalar by default, but if this is set to any of the following, the output will be treated as that type of structure: scalar list hash If the return value is a scalar that is a reference, it will be displayed using the rules for that type of data. If this option is set to a non-zero value, the reference will be output along with the printable value. For example, if the object is an Archive::Zip object, and (using the method or func method) the printable value is defined to be the list of files, the printable version will be either: [ file1, file2 ] or Archive::Zip(0x111111) [ file1, file2 ] The second will be used if this is non-zero. This option is ignored if the print method is 'ref'. use Data::PrettyPrintObjects; Options(%options); OptionsFile($file); This sets any of the options described above. Any options already set which are not included in the %options argument are left unmodified. This does not hold true for the object options. If you set the object options for a type of object, it overrides completely all options previously set for that type of object. Any file passed in to OptionsFile must be a valid YAML file containing an %options hash. $string = PPO($var); This formats $var (which can be any type of data structure) into a printable string. None known. Please send bug reports to the author. This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Sullivan Beck (sbeck@cpan.org)
https://metacpan.org/pod/Data::PrettyPrintObjects
CC-MAIN-2014-23
refinedweb
1,710
68.3
How Wikipedia Works/Chapter 3 - Finding Wikipedia's Content. Contents - 1 Searching Wikipedia - 2 Ways into Wikipedia - 3 The Omnipresent Sidebar - 4 Joys of Hypertext - 4.1 A Hypertext Primer - 4.2 Three Types of Links - 4.3 Browsing by Topic - 4.4 Browsing by Categories - 4.5 Navigating Categories= - 4.6 Finding Excellent or Poor Content - 4.7 Finding Images - 5 Further Reading - 6 Summary Searching Wikipedia[edit] If you're looking for a particular topic, name, or phrase, searching the site directly is the way to start. Wikipedia's search function is like consulting the index volume of an encyclopedia, minus the tedium. In the best cases, you are only a few seconds away from answering a query. When you search Wikipedia, you're harnessing a powerful combination of technologies—the organic growth of the encyclopedia itself and the ability to sift instantly through hundreds of millions of words. The Wikipedia search engine searches not only the titles of all two million articles but also their full text. The search engine also includes alternate article titles (redirect titles). (In addition, you can search Wikipedia pages that are not articles, as we'll explain.) The search engine works on the current database, so it will find even the newest articles. If a search doesn't turn up anything, Wikipedia may not have let you down. Sometimes finding what you're looking for can take persistence. You can make your searches more focused, broad, or powerful. Learning about the structure of the site and the conventions governing how articles are named will also make your searches more worthwhile. Finally, search doesn't cover all situations. For example, you may suspect that you are using the wrong spelling. You could be looking for a medical term that you would recognize in context but can't remember. Or you might want to know what topics are related to a particular academic field. In those cases, start by browsing categories and portals, as described in "Browsing by Topic" on Section 3.3, “Browsing by Topic”. Basic Searching[edit] Searching is simple: First find the search box located in the middle of the left-hand sidebar (see Figure 3.1, “The Wikipedia search box”) or go to w:Special:Search. Type your keyword(s) in the search box and then click one of the two buttons: Go or Search. Clicking Go (or just pressing ENTER) takes you straight to the article with a title that is exactly the same as the words you entered. If no article with that title exists, a list of articles that contain the search words in their title or text appears. Here you can opt to search again, with either the Wikipedia search engine or an outside search engine. (You'll also see a redlink to create a new article with the exact title you searched for; we'll talk about this in Chapter 6, Good Writing and Research.) Figure 3.1. The Wikipedia search box If you click Search instead of Go, a list of articles that contain your search words in their title or text appears. The articles are listed in the following order: - Articles whose titles contain your search words - Articles whose full texts contain your search words somewhere Redirects and disambiguation pages might also be listed; these pages can point you to an appropriate article. The Go button is useful whenever you can guess the title of the article you're looking for. The Search button is a better bet if you're not sure about the exact title or if you're searching for less common terms. Sometimes Go searches don't end up where you expect—especially when redirects are involved! Plural search terms can be especially problematic, as article titles usually use the singular form. For example, there is no article titled Beatle—if you enter the word Beatle, you are taken instead to w:The Beatles. But searching for Rolling Stone doesn't take you to w:The Rolling Stones; it takes you to w:Rolling Stone, an article about the magazine. w:Trogg has nothing to do with w:The Troggs but instead redirects to w:List of characters in Sonic the Comic. Who knew? If you've been redirected, a notice will appear under the article's title in parentheses. If you don't get what you expect, a full-text search might help you find the article you're looking for. (And sometimes an article will helpfully point you toward unrelated articles with similar names.) Varying the Search[edit] If you can't find an article about a topic but you feel sure it must exist in Wikipedia, try a full-text search using different keywords. For instance, the article titled Flag of the United States could also be titled American Flag, The US Flag, or any of a dozen similar things. You will often be redirected to the proper article—but not always. Redirects will take you to similar articles only in the most popular and developed areas of Wikipedia, so searching for synonyms is also important. Searching for articles about people can be particularly tricky. The titles of biographical articles are supposed to be standardized (first name, last name, according to w:Wikipedia:Naming Conventions, shortcut WP:NAME), but often vary in practice, especially if the name contains a combination of initials. If you're trying to track down John Karl Doe, a nonfiction writer, start by searching for John Doe, but also search for Doe, John as well as J.K. Doe, J. Doe, and Doe, J. Contributors also bring their own referencing styles to the site, which may invert or shorten names, or mistakes can creep in (like Carl for Karl). In the end, you might only find the article John C. Doe with persistence, perhaps as a redirect from Doe, JK. For less common names, searching for the last name only may get you what you're looking for and save much time in the end. This technique is particularly true for transliterated names or names with several historical spellings. Power Variant Searching An especially organized researcher can compile a list of title variants in a word processor and then copy and paste each variant into Wikipedia's search box. If you're trying to find an article about Willie "The Lion" Smith, you might search for Willie Smith, Willy "The Lion" Smith, Willie the lion Smith, W. Henry Smith, William Henry Joseph Bonaparte Bertholoff Smith, and whatever else you can come up with. You can also reuse that list in an external search engine. Search Operators[edit] Using a full-text search, you can search for a complete phrase by placing it in quotes: "in the nick of time" Placing a phrase in quotes only returns results that contain exactly what you typed: all of the words in the order you entered them. On the other hand, if you don't use quotation marks, the search will find every article that contains—somewhere in it—each one of those words. You can add additional words after the phrase search; for instance, - "Benjamin Franklin" lightbulb returns all articles that contain both the phrase Benjamin Franklin and the word lightbulb. To exclude a word from the search result, put a minus sign in front of it; for instance, - benjamin -franklin returns all the articles that contain Benjamin but not Franklin. When searching for lengthy phrases, phrases with wildcards, and phrases with Boolean operators (that is, combining terms or phrases with and, or, or not), use an external search engine, as described in "External Search Engines" on Section 1.2, “External Search Engines”. Searching Other Namespaces[edit] By default, the search function only searches articles—which means it only searches pages in the main namespace. But you can also search other namespaces (that is, non-article Wikipedia content). Here's how: - Perform a full-text search for your terms. A results page appears. - At the very bottom of the results page, a list of checkboxes allows you to specify which namespaces to search (for example, you can search user pages or talk pages or both). You can search any combination of namespaces. Check the types of pages you want to search, and then click the Search button. If you commonly search non-article namespaces, you can automatically include them in your searches by changing your default search options under the Search tab in your User Preferences, in the upper right-hand corner if you are logged in. Some Special Searches[edit] Wikipedia's search function also has other uses. Searching for images or other media Unlike text, images cannot be parsed by search engines. But they can be tagged with text descriptions and other metadata, which itself can be searched. Wikipedia pulls many of its images from Wikimedia Commons. Searching for images in Commons is easy because images there are comprehensively categorized and indexed with text. The Commons project is described in Chapter 16, Wikimedia Commons and Other Sister Projects. You can also search Wikipedia's Image namespace, though this namespace also contains (counterintuitively) other types of media such as audio files. See the previous section, "Searching Other Namespaces." Again, searching the Image namespace actually searches the text attached to the images, not the images themselves. Searching for links from Wikipedia to outside websites You can find any "outgoing" links to other websites that are contained in Wikipedia. Go to w:Special:Linksearch and enter the URL you want to search for. (For example, typing whitehouse.gov returns all Wikipedia articles that link to the White House website.) Search Problems and Some Alternatives[edit] Wikipedia's full-text search has a number of limitations, including the following: - Case-sensitivity Wikipedia article titles are case-sensitive; for example, the article titled US is not the same as the article titled Us. This means if you search using the Go button, you might not be taken straight to the article you enter unless you use the exact same capitalization that the article's title uses! (See w:Wikipedia:Naming conventions (capitalization), shortcut WP:CAPS, for the full story.) However, if the Go button doesn't produce any results, the search engine will default to a full-text search, which is not case sensitive, so you should still be able to find the article in question. Additionally, in many cases redirects have been created to get around this problem. - Apostrophes Words containing apostrophes (such as the name Mu'ammar) can be found only if the apostrophe is included in the search. (One exception: Words that end with 's can be also found by searching for the word without the apostrophe and without the s.) - Special characters Searching for words that contain special characters such as accents and diacritical marks can be problematic. On Wikipedia, any character with a diaeresis over it (for example, the ë in Odiliënberg) might be stored as one character (in this case, ë) or as an HTML entity (ë). If a title is encoded with HTML, it may not show up in a simple search—for instance, you might have a hard time searching for Odilienberg or Odiliënberg. If this is the case, try searching for part of the title, such as just Odili. If these problems seem daunting, remember that with a little cleverness, you can use search engines like Google to replace Wikipedia's built-in search engine (see the next section). Outside search engines don't suffer from the problems plaguing the built-in search engine. Whenever your search comes up empty, try searching using an external engine. External Search Engines[edit] Wikipedia pages can also be found using ordinary search engines such as Google. Most search engines allow you to restrict your search results to pages from a particular site. If you restrict your results to pages from Wikipedia, the outside search engine can replace Wikipedia's built-in search engine. To search Wikipedia using Google, type site:en.wikipedia.org "high and low" into Google's search box. This search has two components. The first half, site:en.wikipedia.org, tells Google to only search pages that begin with en.wikipedia.org, which means every page in the English-language Wikipedia. (Use site:wikipedia.org to search Wikipedias in every language.) The second half—"high and low"—is an ordinary Google phrase search. Now click the Search button. The results page shows every Wikipedia article that contains the phrase high and low, including the Japanese film of that name and the feudal concept of high, middle, and low justice. You don't have to use Google; you can use any search engine capable of restricting its results to pages from Wikipedia. For example, the search phrase above works equally well in Yahoo! and Google. Wikipedia also has a drop-down menu next to the search field that allows you to choose, in addition to MediaWiki Search, an external search engine to use. As of mid-2008, the available search enginges include Google, Yahoo!, Windows Live, Wikiwix, and Exalead. For more information about searching, see Wikipedia:Searching (shortcut WP:SEARCH), which mentions many other possibilities. For example, other search engines designed for searching Wikipedia include LuMriX, WikiWax (not to be confused with Wikiwix), Qwika, and Wikiseek. LuMriX and WikiWax suggest article titles as you type, in the way an index might. Qwika is a search engine that searches Wikipedia across languages by using machine translation. Wikiseek searches across Wikipedia articles and groups its results into broad categories. w:Wikipedia:Searching also describes plug-ins that let you search Wikipedia using your web browser's interface. When to Use External Search Engines[edit] There are several cases when using external search engines instead of the onsite search is a good idea: - The onsite search is occasionally disabled when Wikipedia's servers are particularly strained. If you try to use the search engine while it's disabled, you'll be shown a list of links to external search engines. - You might prefer using a familiar search interface instead. - External engines often offer a short preview of each article on the results page. - You may need to perform a complex search that is difficult or impossible to achieve using Wikipedia's built-in engine. By default, external engines search across all Wikipedia namespaces, making it easier to find relevant policy, category, or image pages. Using Firefox's Search If you use the Firefox web browser, you probably know that you can search Google directly from the search box in Firefox's upper-right corner. You can also search Wikipedia with this search box. Click the search engine icon at the left side of the search box (this is a Google G by default) to get a drop-down list of available sites, and select the Wikipedia W. You can then search the English-language Wikipedia directly from your browser. (If the icon isn't present, click Manage Search Engines at the bottom of the list, and then click the Get More Search Engines link, where you can follow the directions to add a new search engine.) When Not to Use External Search Engines[edit] Search engines aren't magic. In order to find out what websites say, they send out computer programs called spiders that scurry out across the Internet, parse the contents of a web page just as a person might (though, of course, a million times faster), and carry the information back to the search engines. This means that if a web page has been created recently, Google might not be able to find it. New Wikipedia articles sometimes take days or weeks to appear in external search engines, but Wikipedia's built-in engine can find them minutes after they're created. Similarly, if a web page has changed recently, Google might "remember" the out-of-date version of the page, not the current version. For example, if the death of Catherine the Great has only just been added to the Wikipedia article Toilet-related injury, a Google search for might not find that page. Conversely, if the word breakfast has just been removed from the Youtiao article, a Google search for will return the Youtiao article if Google has not parsed the article since breakfast was removed. But once you click Google's link to the article, the word breakfast is nowhere to be found. In this event, you might investigate the article's history to discover the circumstances in which your search term was removed. When and How to Exclude Wikipedia from Your Google Search Just as you can exclude all pages that are not from Wikipedia, you can also exclude all pages that are from Wikipedia. Simply add -site: to your Google searches. (Don't forget the minus sign!) For example, you might want to find sources for claims made in an article. You might want to make sure text on Wikipedia has not been plagiarized from another website. Or you might already be familiar with everything Wikipedia has to say about a topic and want to find new sources. site:en.wikipedia.org "catherine the great" toilet site:en.wikipedia.org salted fried chinese breakfast dough - Further Reading Wikipedia's search box Overview of searching About the Go button A collection of tools and plug-ins developed to make searching easier The policy on naming conventions for articles Ways into Wikipedia[edit] Wandering aimlessly through Wikipedia is compulsive, addictive, and time-consuming. It's also one of the most enjoyable ways to experience the site. As an editor, you will invariably find just one more thing to add or fix up around every corner. But goal-directed Wikipedia browsing can also be useful and fun. This section explores some of those more structured methods to explore the site, beginning at Wikipedia's front door. Welcome to the Main Page[edit] The main page () is the first page many visitors to Wikipedia see, and it serves as an entry point to the many neighborhoods within Wikipedia. It is also updated daily with new content. The main page is thus a great place to start a general survey or to start browsing to most areas of the site. Note If you are at, which is a portal to all of the different language versions of Wikipedia, you are one click from the main page of the English-language Wikipedia. Moreover, the same is true if you are on any page of the English-language Wikipedia; you have only to click the Wikipedia logo in the upper left-hand corner or on the sidebar link called Main Page. [edit] The main page is packed so densely with content that it can be overwhelming (Figure 3.2, “The main page of Wikipedia, from September 12, 2007”). At the top, a header welcomes you to Wikipedia and offers an automated count of articles—2,428,969 at the time of writing. Clicking this number reveals more statistics about Wikipedia. To the right of the header, you'll find links to broad scholastic topics such as History and Mathematics. (See "Portals into the Encyclopedia," next.) Below the header, you'll find links to introductory information. Overview and Questions will give you basic information about the site; Editing takes you to the Wikipedia Tutorial, a good walk-through of basic editing techniques. Help links to the extensive help pages (this link is the same as the Help link on the left-hand sidebar). Portals into the Encyclopedia[edit] If you have a broad subject area in mind, notice the group of links on the upper right: - Arts - Biography - Geography - History - Mathematics - Science - Society - Technology - All Portals Figure 3.2. The main page of Wikipedia, from September 12, 2007 The main page of Wikipedia, from September 12, 2007 Follow any of these links and you will come to a portal. Just as Wikipedia's front page is a gateway to the encyclopedia as a whole, a portal is a gateway to a particular topic, offering selected articles, relevant links, and ways of finding editors with an interest in that particular subject. Note Many more portals exist than are listed here. The final link, All Portals (or Portal:List of portals), reveals portals on a broad range of topics. Category:Portals is another, more hierarchical way to explore portals. Portals are accessible and user-friendly ways to explore Wikipedia's coverage of a topic. A portal is also a project, attracting swarms of wiki editors who help beautify and maintain the articles in that subject area, not to mention the portal page itself. (The articles in the portal are hand-selected and are usually accurate and interesting.) Most portals feature an introduction to the topic; selected articles, biographies, and pictures; and links to any relevant WikiProjects and editor collaborations. - Note Portals originated in the Polish-and German-language Wikipedias. In early 2005, the idea was imported to the English-language Wikipedia; later that year, a special Portal namespace was created. Portal pages are, therefore, considered organizational pages, similar to the main page, rather than articles in their own right. Some portal topics are broad, others quite specific. For instance, there is a portal for science, Portal:Science, and one for the sport of cricket, Portal:Cricket (Figure 3.3, “Example of a featured portal: The Cricket Portal”). Figure 3.3. Example of a featured portal: The Cricket Portal Daily Content[edit] Below the main page's header, you'll find five sections that are updated every day: Today's featured article, In the news, Did you know … , On this day … , and Today's featured picture. Each provides a taste of the wide variety of content available on Wikipedia. - Today's featured article Featured articles are a select group representing some of Wikipedia's best content. In order to be called featured, an article must pass through a rigorous process that admits only about one article in a thousand. (See "Featured Articles" on Section 4.3, “Featured Articles”.) Each day, part of a featured article is excerpted here (typically the first paragraph). To read the rest of the article, click its title or the More link at the end of the excerpt. - In the news This section contains a selection of articles about current affairs. These articles typically concern breaking news stories of international interest. Articles about current events tend to be updated furiously (Wikipedia's newsroom is a few thousand people worldwide in front of computer monitors). Note, however, that these articles should not contain original reporting; for that, go to the Wikinews project (see Chapter 16, Wikimedia Commons and Other Sister Projects). - Where Is the News on Wikipedia? Wikipedia does not draw a distinction between "news" and "non-news" articles. Current events and new developments are constantly integrated into existing articles or generate new articles linked from older ones. A new article about a major current event is treated no differently from one about a historical figure. To see current news in one place, visit Portal:Current events, where news stories are collated (with appropriate links to the encyclopedia); the sidebar on the right side of the Current Events portal lists Wikipedia articles about breaking events and newsworthy people. The three remaining items of daily content are less reverent. - On this day … This section contains a selection of noteworthy anniversaries. (For events that happened on other days of the year, follow the More Anniversaries … link.) - Did you know … This section highlights random facts from articles that have been created or greatly expanded in the last five days. (Did you know … is put together at Wikipedia:Did you know, shortcut WP:DYK, where you can suggest factoids from new articles to include.) - Today's featured picture This section contains a photograph or image chosen from among Wikipedia's best. Constructing the Main Page[edit] In some ways, the main page is like any other page on Wikipedia: Delve in and you will find people at work. Like the rest of the site, the main page is maintained by a dedicated group of volunteer editors, who update each section on a regular schedule. But even when viewed in comparison to other Wikipedia pages, the main page is very unusual: - It receives a constant avalanche of traffic, averaging over 100,000 hits per hour. For this and other reasons, the main page is one of the few pages that are not open for everyone to edit (see "Who Can Edit What?"on Section 1.5, “Who Can Edit What?”). - Each section of daily content is constructed and updated separately from the rest of the page. The main page then draws these sections together with templates. (See "Templates" on Section 2.1, “Using Templates”.) - Because of this, the main page's page history doesn't track its daily changes, unlike most wiki pages (see "Article History" on Section 1.3, “Article History”). - Most Wikipedia pages are marked with the date and time they were most recently edited, but the main page is not. If you want to make suggestions about the main page and to learn more about how it is edited and maintained, see the corresponding discussion page Talk:Main Page. Each section of the main page is linked from the discussion page, and it is here that you can suggest new daily content. Time Travel If you have ever wanted to go forward in time, you can always look at tomorrow's main page early at Main Page/Tomorrow. Miss a day or want to go back in time? Try Wikipedia:Main Page alternative. Disclaimers, License, and Privacy[edit] Scrolling down the main page, you'll find links to other helpful sections, including links to help and community areas of Wikipedia and to the sister projects. After those, you'll find links to Wikipedias in other languages; these links are only a selection from the total (now over 200) languages available. At the very bottom of the page, the page footer, which is reproduced on every page, has a collection of disclaimers and links to copyright information. The general disclaimer in particular is worth reading. It states that Wikipedia makes no guarantee of validity—that is, the site doesn't promise to be correct, factual, or truthful in any way. Use Wikipedia for quick reference only. Double-check any important information—especially legal or medical advice, but information just for homework too. By accepting the disclaimer, you accept responsibility for any possible use you might make of information derived from Wikipedia. Although this disclaimer sounds dire, it is in fact not so unusual. Many general encyclopedias disclaim all responsibility; Wikipedia simply makes a stronger point of it than most. Using common sense is key, and Wikipedia is great if you can accept its limitations: that the site is a work in progress and individual article quality may vary (more on evaluating individual articles in the next chapter). In the footer, you'll also find a link to the GNU Free Documentation License, or GFDL, which was described in Chapter 2, The World Gets a Free Encyclopedia; this license is the one under which all Wikipedia content is released. Understanding the GFDL, or at least its most basic implications, matters for a contributor because anything you contribute (from copyedits to whole articles) will be placed under this license. As a reader, you only need to know that you can reuse content if you credit the source in a particular way. Wikipedia:Copyrights, also linked to in the footer, will tell you more about the rights you retain under the GFDL and the copyright status of Wikipedia. The privacy policy explains your privacy on Wikipedia and what information is collected about you (generally, a session cookie). Personal information about contributors is not collected or sold. However, newcomers to the site frequently misunderstand two key points. First, Wikipedia keeps a permanent record of everything transacted on the site: Every comment and edit is kept forever. Second, if you edit without being logged in, you are disclosing your IP address publicly and others may be able to trace it. Editing without being logged in is "anonymous" editing only in the sense that your name is not attached. To be more private, you should register an account. Because of Wikipedia's great prominence, you should be in no hurry to disclose any personal details on the site. Using your real name on Wikipedia is fine (the authors of this book do), but you should know the implications; the pros and cons are discussed in Chapter 11, Becoming a Wikipedian. Finally, the footer contains a link to the Wikimedia Foundation, the parent organization of Wikipedia. The footer also typically shows a date and timestamp telling when the page you are viewing was last edited. The Omnipresent Sidebar[edit] Every page on Wikipedia is framed by three unchanging elements: - Article tabs at the top (see Chapter 4, Understanding and Evaluating an Article) - Site information at the bottom - The sidebar on the left (see Figure 3.4, “The left-hand sidebar includes five sections of links to tools and various navigation pages.”) MediaWiki These elements are supplied by MediaWiki, the software that runs Wikipedia. You'll see versions of these elements on other websites, too, including on Wikipedia's sister projects and on entirely independent wikis. For more about MediaWiki, see Chapter 17, The Foundation and Project Coordination. This section explores the sidebar. The sidebar presents a handy navigation menu for both readers and editors and provides other essential tools and links. On the English-language Wikipedia, the sidebar contains five sections: Navigation, Interaction, Search, Toolbox, and Languages (though this last section does not always appear). Figure 3.4. The left-hand sidebar includes five sections of links to tools and various navigation pages. [edit] Navigation offers four links to major directory pages and one to a randomly chosen article: As might be expected, this link goes to the main page. (You can also click the Wikipedia logo just above it to get there.) Contents A book's table of contents lists its sections in the order they're printed. Wikipedia is not in any particular order, so its contents page provides a wide range of different ways to navigate Wikipedia by topic. Featured Content This section showcases articles, images, and other content that Wikipedia's community has deemed particularly good. Current Events This section gathers articles related to current news. Random Article Clicking this link is like throwing open a book to a random page. The link takes you to a different, randomly selected Wikipedia article each time you click it. Random browsing can be entertaining for anyone. New readers can grasp the range of content in Wikipedia, and editors can discover neglected articles that need fixing up, though some editors prefer a more methodical approach (see Chapter 7, Cleanup, Projects, and Processes). Interaction[edit] The links in this section help you find out more about Wikipedia or interact with the site as an editor: About Wikipedia This link takes you to a general overview of the project, intended to help newcomers orient themselves. About Wikipedia also links to other FAQ and help pages. Community Portal This page helps Wikipedia contributors communicate, collaborate, and mingle. The Community Portal is also a good place to learn more about current onsite happenings. (See Chapter 12, Community and Communication.) Recent Changes This page shows all edits made to Wikipedia in real time. This page is an important place that's covered in detail in the next section. Contact Wikipedia This link may be the least accurately named link in the sidebar. The contact page is devoted mostly to common complaints and their solutions, because, of course, no central authority is in charge of every Wikipedia article. Wikipedia:Questions (shortcut WP:Q) points to several other places answers might be found. For most questions, it is best to go to the WikiProject that deals with the topic you are interested in or a community forum to track down the active group of editors dealing with the issues you are interested in (see Chapter 12, Community and Communication for how to find community discussion forums). The contact page does provide a number of email addresses for media inquiries, legal issues, and other concerns. These addresses lead into an email system (the Open-source Ticket Request System, or OTRS) staffed by a selected number of volunteers. Hundreds of questions from the general public about all aspects of Wikipedia find their way to OTRS every week. Responses are generally quick and courteous, but may be delayed when the volunteers have a large backlog of questions. Donate to Wikipedia This page provides a form (and a pitch) encouraging people to donate via credit card, check, or other means to the foundation that runs Wikipedia. (It also advertises Wikipedia-themed merchandise and copies of Wikipedia on DVD.) Wikipedia has no deep-pocketed patron; most of its funding comes from a steady stream of small, private donations. If you like Wikipedia, consider pitching in to help keep it online. Note that the donation page is not located on the Wikipedia website. To return to Wikipedia from there, use your browser's Back button. Help takes you to a comprehensive index for Wikipedia readers and editors of every experience level. Many of these basic help pages are worth reading to get an overview of the site, and these pages are also a good place to start if you have a specific question about how to do something. Take note of the links across the top of the main help page. The glossary and the cheatsheet provide quick answers for editors, whereas the tutorial is a friendly introduction to editing a page. Of course, if you read this book cover to cover, you probably won't need to read it! Recent Changes[edit] Sandwiched in the middle of the sidebar's Interaction section is a link to one of the most important pages on Wikipedia. Recent Changes is a continuously updated list of every single edit made to Wikipedia, beginning with the most recent (see Figure 3.5, “The Recent Changes display”). This list of edits uses the same format as the editing histories of individual articles (see Chapter 4, Understanding and Evaluating an Article): Each new edit occupies a single line. Exploring the Recent Changes page can give you a feel for what is happening on Wikipedia at any particular moment. Experienced editors might even get a sense of the site's general mood. But using the Recent Changes page this way is a little like trying to predict a presidential election by looking at a satellite photo of the United States. Hundreds of edits happen each minute, so any given glance at this page offers only the tiniest window into Wikipedia's broader workings. The idea of Recent Changes, however, is a key part of Wikipedia's philosophy of transparent collaboration: Anyone can see any change that has been made to the site. All work in Wikipedia is open; there are no "hidden parts." Every edit made will show up on the Recent Changes page, even if it flashes by in a second. In practice, the Recent Changes page is primarily used for detecting damaging edits (such as deliberate inaccuracies, wholesale text deletion, and other vandalism) as soon as they occur. Some editors, acting as volunteer security guards, use automated tools that help them sift through recent changes more efficiently in order to find and fix these edits (see Chapter 7, Cleanup, Projects, and Processes). At the top of the page, above the main listing of changes, you'll find two sets of links. The first set (Projects, Utilities, About Us, Requests, and Challenges) are community utilities and help pages that are discussed separately throughout this book. Figure 3.5. The Recent Changes display The second set—beginning with Below are the last 50 changes—control how recent changes are displayed. You can change the number of edits listed, hide edits made by anonymous contributors, and so on. By default, minor edits are displayed, though automated edits by bots are not. You can also watch for entirely new pages as they are created; see Special:Newpages. The Search Box[edit] Returning to the sidebar, right in the middle you'll find the search box. This is where you enter terms for searching the English-language Wikipedia. Click the Go button to find an article with the exact title you entered; click the Search button to search for any occurrences of the words within the full text of all articles. See "Searching Wikipedia" on Section 1, “Searching Wikipedia”. Recent Changes Camp This conference is about wikis. Its name references the fact that almost every wiki software package offers a recent changes feature. It is one of the most recognizable parts of the technology. See for more information on the conference. Toolbox[edit] The Toolbox section of the sidebar (see Figure 3.6, “Close-up of the Toolbox section from the sidebar”) contains several utilities that give you more information about the page you're viewing, allowing you to fit the page into a broader context or letting you see the page in other formats. Figure 3.6. Close-up of the Toolbox section from the sidebar - Note Two incongruous links—Upload File and Special Pages—are included with these article-specific utilities. We'll discuss these links at the end of this section. What Links Here lists all the Wikipedia pages that link to the page you're viewing. (For example, Central Intelligence Agency and w;Acoustic Kitty both link to Acoustic Kitty.) You'll come to value this tool if you research less mainstream areas (see Chapter 4, Understanding and Evaluating an Article). Related Changes lists every recent edit to any page that links to the page you're viewing. Use this link to track activity in a particular topic area or to check for vandalism occurring across related articles. Printable Version is a version of the page you are viewing formatted for printing; for example, some wiki formatting is removed, external URLs are spelled out, the sidebar is removed, and the font is different. If your web browser was made within the last couple of years, you'll never need to use this link: Your browser will send this printable version to your printer even if you click Print while viewing the standard page. Because Wikipedia articles change unpredictably, linking to them can be problematic; someone might follow your link, only to discover a version of the article different from the one you saw. (The problem is especially acute on high-traffic pages that might be edited every few minutes.) When you click Permanent Link, you are taken to a time-stamped snapshot of the article as it currently appears. The text at this URL will never change, so you can link to it or cite it with confidence. (You can also link to any previous version of the article from the page history; every version of every page has a unique ID number.) Cite This Page provides a handy, appropriate bibliographic citation (with a permanent link) for the article you're viewing, which can then be easily cut and pasted into a list of citations. You can generate citations in various bibliographic styles, including MLA style, APA style, BibTex, and so on. If you're viewing a user page rather than an article or project page, you'll see two additional links: User Contributions, and, if the editor has enabled email contact, Email This User. User Contributions takes you to a list of all the edits made by that user (or that IP address). Email This User leads to a form where you can send an email to the editor without his or her email address being revealed. Two last links are for more advanced use. Before images can be displayed on Wikipedia, they must be uploaded to the site. Upload File takes you to a form for adding images and other files to Wikipedia. (See Chapter 9, Images, Templates, and Special Characters for a full description.) Finally, the Special Pages link accesses a list of pages in the Special namespace. Unlike most pages on Wikipedia, these pages are not editable; instead, they are generated automatically each time you visit them. Some, such as My Preferences and My Watchlist, are customized for you and are only valid if you're logged in. (You can locate these two pages more easily, however; they are also available in the top right-hand corner of the page if you're logged in.) Most special pages contain utilities for advanced users and will be discussed throughout this book by topic. Languages[edit] The last section of the sidebar, if it exists, contains links to versions of the article you're currently viewing in other language Wikipedias. For instance, while viewing the English article Astronaut, if you click the Español link in the Languages section, you'll go to the Spanish-language Wikipedia article Astronauta. Language links should be alphabetized by the name of the language (Figure 3.7, “The Languages section for the main page: Each of these links takes you to the main page of another language's Wikipedia.”). Figure 3.7. The Languages section for the main page: Each of these links takes you to the main page of another language's Wikipedia. An article written by speakers of another language often differs in focus and perspective. But even if you're a monoglot, browsing articles in other languages can be a good way to find images. These links are sometimes called interwiki links (see Chapter 15, 200 Languages and Counting for a more thorough discussion). The language links that appear depend on which Wikipedias contain an article about the topic in question. Even if a matching article exists in another language, an editor must first add an interwiki link to it before it will appear in the languages list. - Further Reading Browsing - The front door and main portal into Wikipedia - The Current Events portal for recent events and news - List of all portals Finding Out More - A complete list of Wikipedias in all languages - The privacy policy - The general disclaimer Sidebar Links - Recent Changes - The random article generator - Find a random article in another namespace Joys of Hypertext[edit] This section explores the many ways Wikipedia pages are grouped together. For example, pages can be grouped in the following ways: - Informally by topic - By date - Into hierarchical taxonomies (categories) - By format (for example, you can browse only high-quality featured articles) - Any way you like! If you follow links from one article to another, you create your own "group" of articles—your own personal story. A Hypertext Primer[edit] Written language has been around for thousands of years, but its format has changed many times. Stone carvings were expensive and time consuming (and decidedly nonportable) and were, therefore, used mostly for official state purposes. Medieval scholars wrote on valuable animal skins, which they periodically scraped clean and covered with new text. The printing press made written texts easily affordable and accessible. Writing is circulated today in many formats, and each format has its own way of doing things. For example, newspaper articles are worded tightly to cut down on printing costs, and the most important information is placed at the beginning of the article so that you can conveniently stop reading at any point. If you're an adult, books are second nature. Certain assumptions, such as the fact that the pages of a novel appear in a particular order or that the millions of extant copies of Sense and Sensibility all contain essentially the same text, are so ingrained that they hardly seem worth mentioning. But Wikipedia violates many of these assumptions. It is a new medium, with its own strengths, weaknesses, and conventions. The most striking feature of the World Wide Web—and of Wikipedia—is the link: text that takes you somewhere else and is traditionally underlined and colored blue. Early information theorists called links hypertext, and the term has become a catchall for the ways in which the Internet is different from the printed word. What does hypertext mean on Wikipedia? - Wikipedia articles can be read in any order. - A Wikipedia article need not be read "cover to cover." In a single browsing session, you can read ten different paragraphs from ten related articles; indeed, this grazing approach is often the best way to gather information. - Wikipedia articles can be grouped in many ways, and these groups can overlap. Hypertext Wikipedia is not the first hypertext encyclopedia, but its embrace of hypertext is complete and fundamental. A Wikipedia article that is not linked to by any other article is called an orphan and placed in a special cleanup category. Any word, name, or term in an article can be linked to an article about that concept. As a reader, the practical effect of this is that you can jump from one article and into another whenever you like. You are not constrained by the authors' view of the logical flow of the topic or the amount of background information in any particular article. If you're unfamiliar with a concept, you can easily refer to the article about that concept. More generally, hypertext means that every page on Wikipedia references (links to) other pages—and of course, every page is linked to by other pages. Understanding how Wikipedia pages are linked to one another is key to browsing Wikipedia. Because there are so many ways to explore related topics, Wikipedia is great for getting up to speed about subjects you don't know well—even areas in which you don't know what you don't know. (A search might lead you to a particular article, but that article itself can become a jumping-off point to another topic.) Three Types of Links[edit] There are three types of links on Wikipedia. - Internal links These links lead from one Wikipedia page to another. Clicking the link will take you to the Wikipedia page being linked to. Internal links (also called wikilinks) are blue. You'll see internal links throughout the text of articles and other pages. When you're editing an article, you can create an internal link by surrounding a word with double brackets. (See Chapter 5, Basic Editing.) - Note Wikification and wikifying are terms for adding wikilinks to a page. Internal links don't always have the exact title of the page they're linking to; any text can link to any page, which is occasionally confusing. For instance, clicking a bluelink that reads Samuel Clemens might take you to the page Mark Twain (and your reaction might be "Huh?" "I knew that, I suppose," or "Of course!"). - Naming This Twain example illustrates one of Wikipedia's painstakingly negotiated conventions about article titles. Even though Mark Twain is a pseudonym, this name is the most common way to refer to Samuel Clemens, so the article bears that title. - Redlinks These internal links lead to articles that don't exist yet. They look like ordinary internal links except that they're (unsurprisingly) red. Clicking a redlink takes you to a page asking if you want to create the new article. Appropriate redlinks are a natural part of the encyclopedia, as they show what topics have yet to be covered. - External links These are links to other websites. These links are always light blue and marked with a small arrow, but they can take three forms: - A full URL (such as) - A bracketed number ([3]) - Ordinary words or sentences linked to an external site External links normally appear at the bottom of an article in the External links section, but they can appear throughout article text. - Using Tabbed Browsing This feature, offered by most contemporary browsers, is a good option for serious study. By opening internal links in new tabs as you read through an article, you can add a new tab for each less-than-familiar term you encounter. After your first pass through some unfamiliar topic, your tabs will constitute a detailed set of Wikipedia notes. Browsing by Topic[edit] Using the Random Article link is fun, but if you have work to do, you need a way to find specific articles (unless your research area is the dynamics of online encyclopedias). Using search is the best-known way to find Wikipedia articles, but other ways to inform your understanding of a topic exist. For example, you can - Peruse lists of articles - Visit subject portals - Navigate categories Lists of Articles[edit] Most Wikipedia articles have traditional paragraph structures, but some take the form of lists. Each list item usually links to its own article. Thus, each list becomes a miniature index to its own topic area. Wikipedia is pieced together collaboratively, bit by bit. It relies on contributors bold enough to slide new information into a complete-looking article. In this context, lists can feel particularly welcoming to new writers: After "This is a list of items" and "This list was written by a bunch of different people," the next logical thought is often "I can add another line item to the end of this list." Consequently, lists abound throughout Wikipedia, indexing a staggering array of topics. Some are well maintained and quite complete, others more informal and amateurish. Sometimes they define an unexpected topic, such as List of songs about or referencing Elvis Presley), or provide a new view of a familiar topic, such as List of accidents and incidents on commercial airliners grouped by location. Smaller lists also exist within ordinary, paragraph-style articles. Figure 3.8. The Lists of Topics page - Note Lists help Wikipedia expand because they encourage the creation of redlinks—links to articles that haven't been written yet. Of course, lists can be grouped. They can be organized chronologically, by theme, or by annotation. Many lists are accessible through the main contents page, which is linked on the global sidebar. Some of the links available from the contents page include the List of academic disciplines, which provides a list of broad overview articles by academic discipline (such as engineering); these articles in turn link to more detailed articles. The List of overviews has a similar function: It presents a number of articles in a subject area (philosophy, for example) that give a survey of that area. The top-level page for lists is the Lists of Topics page, which is a directory of list articles. List Policy What makes for a sensible stand-alone list is supposed to be regulated by policy (see Wikipedia:Lists, shortcut WP:LIST), but Wikipedia policy, like much else on the site, is rarely static. In general, new lists should not advance a thesis, and "frivolous" lists are discouraged, though many have existed in the past (for example, a list of guesstimated IQs, including those of Beethoven and Madonna). Lists are subject to the Verifiability policy: One problem with having a List of geniuses is the verification of geniusness. See No original research and Verifiability. One interesting way to proceed from a list is to click Related Changes in the left sidebar. Related Changes is a list of recent changes to any articles that the current page links to, which, in the case of a list article, includes all items in that list. If you're seeking editors working in your field of interest, this is one way to make quick contact. You do have to filter out some noise: Related Changes shows changes to all pages linked to from a given page. If you apply it to List of glaciers, you may find edits to Glacier, Sierra Nevada, or Mount Kilimanjaro, alongside edits to less relevant articles such as Argentina and [[:w:2007]|]. For certain lists, Related Changes is an impractical way to proceed. - List of Our Favorite Lists - List of encyclopedias - List of unsolved problems - List of glaciers - List of glossaries - Timeline of chemistry - List of English words containing Q not followed by U - List of oldest continuously inhabited cities - List of states of matter - List of comic book superpowers - List of historical elephants - List of trees - List of problems solved by MacGyver - List of unusual units of measurement New lists are created all the time. But some existing lists are being phased out in favor of categories (a more rigid, automated classification scheme; see "Browsing by Categories" on Section 4, “Summary”). A great deal of debate has surrounded the relative merits of categories and lists. Lists can be annotated, reverted to older versions, and peppered with references. Categories, on the other hand, are more automated and thus work better with really large collections of pages. Traditional Classification Schemes[edit] If you're feeling nostalgic, you can browse Wikipedia using traditional library arrangement schemes: the Dewey Decimal Classification and the Library of Congress Classification. These schemes might seem archaic, but because they were designed to organize broad arrays of human knowledge (and secondarily to sort books), they can be interesting to browse. See Library of Congress Classification for the top level of the classification. If you click one of the 21 linked articles, you'll drill down into the next level of classification, with topics linked to the appropriate articles. Category:Library of Congress Classification also lists the breakdown by letter codes. The article List of Dewey Decimal classes gives the first three digits of the Dewey class, with some topics linked to those articles. Further, you can find an outline of Roget's Thesaurus, with appropriate articles wikilinked, at Wikipedia:Outline of Roget's Thesaurus. Date-Related Articles[edit] There are a wide variety of date- and time-related articles that list significant events during a particular date, year, or even century. Articles exist that summarize the following: - Every year between 1700 BC and the present (see List of years) - Every decade between the 1690s BC and the 2090s AD (List of decades) - Every century between the 40th century BC and the 31st century AD (List of centuries) - Every millennium between the 10th millennium BC and the 10th millennium AD (see List of centuries again) - Every geological division, epoch, period, and era (see List of time periods for these and many more) Simply type a year in the search box or go to one of these lists. As you might expect, the quality of these articles vary widely, usually in predictable ways. Jurassic, December 2004, and 1800s are detailed; 1485 BC is not. In general, the less-detailed articles are scattershot collections of factoids. If you're unsatisfied with a yearly article, move up to the decade or century level. For most modern years, such as 1954, dozens of dedicated articles exist—for instance, 1954 in architecture or 1954 in baseball. However, 1954 in cricket is a category rather than an article, and if you want to learn more about crime in 1954, you might look at FBI Ten Most Wanted Fugitives by year, 1954. The overall Category:1954 is the right place to start for intensive research, as it collects all these articles in one place and numerous subcategories will point you in the right direction. Note Year articles take precedence over other articles that might have numeric titles. For example, if you go to the article called 137, you get an article about the events occurring in the year 137 AD. As it happens, 137 is an interesting number in physics, but to read about that you should go to the article 137 (number). You can also find an article for every date from January 1 to December 31. These are lists of anniversaries, not articles specific to a given year. They convey the significant events, births, and deaths for any date, such as January 20th—helpful, perhaps, for college students looking for a party theme. These lists populate the On this day … section of the main page. (The title convention is simply the month and day number, or April 1; no suffix is required for ordinals.) List of historical anniversaries is a handily arranged list of all these pages. Note If you ever find it too tiring to work out 20th century dates in Roman numerals, such as those you might find in old copyright notices, copy the letters (for example, MCMLXVIII) into Wikipedia and let a redirect take the strain. Decade articles are in a familiar form: the first year of the decade plus s (for example, 1660s, no apostrophe). Again, List of decades is a handy list with coverage stretching from the 17th century BC to the 21st century AD. Century articles are found in either the form 18th century (for centuries AD, you can leave out the AD) or 2nd century BC (for centuries BC). The Common Era convention of writing BCE and CE, as many scholars do, is also supported and used within Wikipedia, coexisting with BC/AD (refer to Common Era for background); date links using this convention will redirect to the proper articles. (If you're really clever, type 0 AD into Wikipedia. Go ahead!) These by-date articles stretch not only into the past (there is a century article for 40th century BC, before which Wikipedia only has articles for millennia), but also into the far future. These future year articles record not only future anniversaries and future astronomical events, but also fictional events that are supposed to have happened in these years. (In the 25th century article, for instance, we are reminded that Buck Rogers lived around 2419.) Timelines provide detailed chronologies for various topics. The List of timelines lists timelines covering hundreds of topics, offering detailed perspectives for understanding history. If that's not enough, the Detailed logarithmic timeline and its linked pages could claim to be an education in itself. Browsing by Categories[edit] Another way to find articles is to browse through categories. Categories, like lists, collect related articles. But although Wikipedia's software treats a list the same way it treats any other article, it treats categories differently. In order to place an article in a category, an editor does not edit the category's page. Instead, the editor adds a specialized tag to the article itself, and the MediaWiki software automatically populates the category page with every article tagged as a member of that category. Alongside links and templates, categories help provide structure to the wiki. In every topic area, categories are created and used to group related pages together: For example, Category:American novelists contains thousands of articles about authors, for those interested in exploring American literature. In an area where you already have some expertise, the category system may be your best bet for finding content of interest. The categories in which an article has been placed are listed at the very bottom of the article page, underneath the article text, in a small shaded box (Figure 3.9, “The category listing at the bottom of an article, showing the categories in which an article appears: These are the categories for the article Exploding whale.”). Each category name is a link: Click one to visit the corresponding category page, which lists all the articles in that category. Figure 3.9. The category listing at the bottom of an article, showing the categories in which an article appears: These are the categories for the article Exploding whale. The category listing at the bottom of an article, showing the categories in which an article appears: These are the categories for the article Exploding whale. A page can be placed in any number of categories; indeed, most articles are in more than one. No category excludes any other, and categories can even be placed inside other categories, which can themselves be placed inside other categories! This creates a tree structure (or a taxonomy, if you prefer). For example, the article Malta is in Category:Malta, itself in Category:European microstates, which is in Category:Microstates, which is in Category:Countries by characteristic; this is then categorized under the broad category of Category:Countries. Browsing successive layers of subcategories is a useful way to find content: You can get to a high-level category any way you like and then drill down into a more specific area. Because Category is also a Wikipedia namespace, you can go directly to a category using the search box, for example, Category:Poets. Categories may be surprisingly specific as well as sweepingly broad. Some are just fun: Category:Toys has as subcategories Category:Toy cars and trucks and Category:Yo-yos, whereas Category:Teddy bears is one subcategory of Category:Fictional bears. Everyone is welcome to categorize pages as needed, either by placing an article in an existing category or creating an entirely new category (see Chapter 9, Images, Templates, and Special Characters). As with every type of content, guidelines for creating and placing categories have been established. See, for example, Wikipedia:Naming conventions (shortcut WP:NCCAT). Structure of a Category Page[edit] When you click a category name from the linked categories at the bottom of an article, you are taken to a category page located in the Category namespace. These pages are divided into four main parts (Figure 3.10, “Example of a category page (the category of Fictional Countries), showing editable sections”): - The top part describes the topic. This section is editable and may contain wikilinks to relevant encyclopedia articles. This section is not always present. - The second part lists the immediate subcategories of the category. For example, Category:American crime fiction writers is a subcategory of Category:American novelists. This section is only present if the category contains subcategories. - The third part of the page displays an automatically generated, alphabetical list of wikilinks to the articles in the category. This list is the heart of the category page—it is always present and is usually the section that proves most useful. A category can contain any number of pages; some contain thousands. It would be impractical to display such a large number of links on one page; on Wikipedia, a category page will only display as many as 200 links at a time, sorted alphabetically. Click the Next 200 link to jump to the next page of links. Note Alphabetical order is not always obvious: Articles about people, for example, are normally best sorted alphabetically by surname. However, if the correct sort tag hasn't been added to the biography, it will be alphabetized conventionally (i.e., by the first word in the page title, which is often the first name of the person). Details on sorting are in Chapter 9, Images, Templates, and Special Characters. The last part of the page shows supercategories—the categories that this category belongs to. These categories appear in a shaded box named (somewhat confusingly) Categories, just like the categories for articles. Figure 3.10. Example of a category page (the category of Fictional Countries), showing editable sections Missing Subcategories The 200-link limit creates rather unhelpful artifacts on some category pages. The main part of the category page shows up to 200 links, starting with the letter A; but the subcategories list is also paginated alphabetically. On the next category page, you will often see further subcategories. [edit] Categories form a kind of parallel Wikipedia universe. If you're lucky, a small cluster of categories will cover just the articles you're seeking. Think of subcategories as being under a category, and you'll appreciate that clicking can take you both "up" (to a more comprehensive category) and "down" (to a more specialized category). You can move to a category of greater scope and generality or (conversely) narrow things down. Therefore, the other significant part of a category page is the list of categories to which the page belongs, in other words, the supercategories for which this category is a subcategory. These are your ways inside the category system. Up-and-down navigation is a very handy way to move from a related article to the one you really want. For example, you can move from a place in the right state but wrong county to a category of places in the state to a subcategory of places in the right county, where you'll find the title of the article you want. That journey is like going in and up and then down and out of the category system. Most browsing using categories requires a combination of navigating up (to a more comprehensive category) and down (to a subcategory) in search of the category of greatest interest, followed by a systematic search of pages in that category. A Longer Journey Using Categories[edit] The article about the ocean sunfish (which is also known as the Mola mola) might be placed in the Molidae category, for the fish's scientific family name (Figure 3.11, “The ocean sunfish (Mola mola) or common mola is the heaviest bony fish in the world, with an average weight of 1,000 kilograms. The species is native to tropical and temperate waters around the globe. (From w:Mola mola, image from NOAA)”). Looking at the category page for Molidae displays the other species in this family (as long as those species have properly categorized articles). Figure 3.11. The ocean sunfish (Mola mola) or common mola is the heaviest bony fish in the world, with an average weight of 1,000 kilograms. The species is native to tropical and temperate waters around the globe. (From Mola mola, image from NOAA) Navigating from this category, you may go up, down, or out to one of the linked pages. w:Category:Molidae is a subcategory of Category:Tetraodontiformes. If you're interested in the biology of related fish, click that link. Once there, you'll see various families of the order Tetraodontiformes (such as the Puffers) listed as subcategories. This category system follows standard scientific classification. You can eventually get to Category:Water from the fish articles. Using a less-than sign (<) to mean "clicking up to the next category," here is the chain of subcategories: Ray-finned fish < Bony fish < Fish sorted by classification < Fish < Aquatic organisms < Water Tetraodontiformes is one of more than 50 subcategories of Category:Ray-finned fish. Going from Category:Water, Water < Inorganic compounds < Chemical compounds < Chemical substances < Chemistry to find out where Category:Chemistry fits in, look at Chemistry < Physical sciences < Scientific disciplines < Academic disciplines < Academia Is there no end to this? Actually, keep clicking through categories: Academia < Education < Society < Fundamental and you end up here: Fundamental < Articles < Contents The Category:Contents is the top category of all categories. This non-serious exploration makes a serious point: Wikipedia not only brings knowledge together, it also classifies it. You can find an exhaustive, unwieldy list of all categories at Special:Categories, or try Wikipedia:Categorical index for an arrangement by topic. The highest levels of categorization are so broad that they are usually impractical even as starting points. But they do provide a novel way to sort content from a distance, as Robert Rohde did in some statistics from October 2007.[19] Programmatically tallying the articles in the broadest categories (and their subcategories), he was able to estimate the composition of Wikipedia itself: 28.0 percent science, 10.5 percent culture, 16.0 percent geography, 6.3 percent history, 0.8 percent religion, 5.5 percent philosophy, 1.8 percent mathematics, 14.3 percent nature, 6.0 percent technology, 1.4 percent fiction, and 9.6 percent general biography. These categories are, of course, fluid and negotiable (for example, the Politics category is inside the Philosophy category). Categories and Content Policy Categories should always reflect the content of the page and be supported by the article's references, especially if the category is contentious: w:Category:Murderers should not be added to a biography without justification. Classification should not be used to make a point or comment on content (see Chapter 9, Images, Templates, and Special Characters for more on categorization guidelines). 3.5. Browsing by Page Type You can also browse by article type rather than by topic. Finding Excellent or Poor Content[edit] Perhaps you want to read only the very best Wikipedia content. In this case, browse the Featured Content portal at Portal:Featured content, which includes all types of content (including articles, images, and portals) deemed to be the best Wikipedia has to offer. Featured articles, available directly at Wikipedia:Featured articles (shortcut WP:FA), have been vetted, reviewed, and voted on by community members. They meet high standards of completeness, accuracy, and referencing, and represent some of the very best articles available on the site. Try your hand as a critic at Wikipedia:Featured article candidates (shortcut WP:FAC). Good articles are articles that may not be as extensive as featured articles but are still excellent quality; you can browse a collection of these articles at Wikipedia:Good articles (shortcut WP:GA). Featured lists can reveal odd Wikipedia content. Whereas a list page taken at random from Wikipedia will (at most) have some navigational value, a featured list such as List of Oz books will have a good lead section, images, and much greater credibility. See Wikipedia:Featured lists (shortcut WP:FL) for several hundred featured lists. Articles of poor quality or in need of attention are also collected in maintenance categories, such as Category:Cleanup by month. Another quick way to find articles with problems is to search for misspelled versions of commonly misspelled words in order to find errors and typos to correct, or (perhaps more interesting) search for dead-wood phrases such as "it is important to remember that," which can be replaced with more precise wording. The project page at w:Wikipedia:Cleanup, where you can add articles you find with problems, also provides a quick way to start getting involved. Finding poor-quality articles and systemized maintenance work will be covered thoroughly in Chapter 7, Cleanup, Projects, and Processes. Finding Images[edit] Apart from text, images are the most common and important kind of media used in Wikipedia. They help bring the encyclopedia to life, showing places and people, plants and animals, book covers, and machinery types. They illustrate processes and diagram complicated procedures and systems. They include logos, trademarks, heraldic devices, and flags. You can also find large numbers of maps. To find some of the very best images on Wikipedia, visit the list of featured images at Wikipedia:Featured pictures (shortcut WP:FP). There is also a link from this page to a category on the Wikimedia Commons for featured desktop backgrounds, or pictures whose aspect ratios are suitable for wallpapering your computer desktop. You can find some lovely images here. To browse for other images, go to the Wikimedia Commons, where images are organized by category. The Commons is actually designed as a repository of media and images that all the Wikimedia projects can use and link to. Thus you may find images, for instance, that are described in languages other than English. More on searching the Commons is in Chapter 16, Wikimedia Commons and Other Sister Projects. Finding Media Files[edit] Every media file found on Wikipedia is intended to illustrate an encyclopedia article, not to stand alone. Wikipedia and the Wikimedia Commons offer a range of these files, from short animations to sound recordings. For instance, in the article about Mozart, you'll find a list of a few dozen or so audio files; these are short excerpts of his works for illustrative purposes. All of the media files in Wikipedia should be freely available under the GFDL license. Like images, finding media files is a bit easier on Wikimedia Commons than on Wikipedia itself; on Commons, you'll find categories for sounds and videos, subcategorized into animations, animal sounds, and so on. Again, just as for images, each file has a description page. Confusingly at first, these pages are all within the Image namespace; Wikipedia does not separate different media file types into different namespaces. To play media files, you can try Wikipedia's embedded media player, which will play media files in your web browser. Simply click the Play in Browser link next to the file icon. Alternatively, you can download the file. However, playing it may present some obstacles as you may need to download special software. The major sound file type used on Wikipedia is the audio format Ogg Vorbis, whereas video files use the Ogg Theora format. These formats are broadly similar to others used to play digital audio and video, such as MP3 and MPEG, and can be played on almost all personal computers. Unlike MP3, QuickTime, and many other common formats, however, Ogg formats are completely free, open, and unpatented. Microsoft Windows and Mac OS X computers do not support Ogg formats by default and require additional software to play them. If your computer does not automatically play these files when you click them, you'll need to download and install free software from the Internet to play them. Go to for links to versions of downloadable players or codecs suitable for common systems. If you already have a media player such as Windows Media Player or RealPlayer, or iTunes for a Mac, you can first download the .ogg codecs—small programs that decrypt the format—for these players, which will enable them to play Wikipedia's files. For Linux/Unix users, many recent free Unix systems are able to play Vorbis audio without any new software; however, many media players are available if you don't have any audio software installed. Wikipedia:Media help (Ogg) has a list of the free players available for all systems and directions for downloading the Ogg codecs for other music players. Music files may occasionally use the MIDI format (.mid or .midi extension). MIDI is usually playable without new software. Most computers have a MIDI-enabled player and sound card. In addition to music files, a small but growing number of articles contain spoken versions of the article recorded in .ogg Vorbis format by volunteers. With the right player, you can listen to Wikipedia articles in your car! Go to Wikipedia:Spoken articles, Category:Spoken articles, and Wikipedia:WikiProject Spoken Wikipedia (shortcut WP:WSW) to find these articles. Further Reading[edit] - Linking - Information about orphaned articles - The list of orphaned and unlinked articles - Build the web guidelines and philosophy about internal linking and building hypertext - Only make links that are relevant to the context guideline; in other words, use judgment when linking - Indexes and Other Ways to Browse - An alphabetized, automatically generated index to all Wikipedia articles - A detailed list of academic disciplines with links to articles - Overview of basic articles for many fields - All sorts of lists arranged by topic - List of Dewey Decimal classes -'s_Thesaurus The classification used for Roget's Thesaurus, with terms linked - Timelines about various topics - A list of what happened on this day in history - A list of all the decade articles - A list of all the century articles - Browsing by Quality - The Featured Content portal for featured articles and more - Browsing by Categories - Information on how categories work - Topic index to all categories - Guidelines for categorization and category use - Finding Images and Sounds - Wikipedia's featured pictures - The Wikimedia Commons, where you can find free images, sounds, animations, and videos - The category of pictures on Commons that have aspect ratios suitable for computer desktop backgrounds - Help with playing media files, including downloading instructions for various players - A list of spoken Wikipedia articles by subject - Spoken articles by category - A list of full-length copyleft/public domain musical works available on Wikipedia or the Commons [19] These figures are taken from an October 2007 post to the WikiEN-l mailing list: Summary[edit] Wikipedia as a collection of information is amazing, but its real strength is as a collection of findable information. Searching is useful for finding articles on specific topics, but you may need to search using a variety of names to find the article you're looking for. You can configure Wikipedia's search to search multiple namespaces along with other options; you can also use external search engines. Access the search engine on the left-hand sidebar, which also includes a number of other links and tools. Some of these links and tools are consistent throughout the site, whereas others change depending on the page. Wikipedia also has intricate and well-developed structures for browsing, including links within articles, editor-constructed portals, the main page, and categories. These structures all use hypertext, where one page leads to another via links, with information split between various pages that reference each other. Categories, which show up as links at the bottom of pages that are categorized, provide a powerful way to browse through related pages, including pages categorized by quality (such as featured articles). Categories set up a classification system, with more specific areas becoming subcategories of broader areas. In the next chapter, we'll home in on the individual articles, describing their specific parts. We'll cover what you can expect to find, as well as how to evaluate the quality of a given article.
https://en.wikibooks.org/wiki/How_Wikipedia_Works/Chapter_3
CC-MAIN-2015-40
refinedweb
12,881
51.99
24 October 2012 04:31 [Source: ICIS news] By Chow Bee Lin ?xml:namespace> SINGAPORE Integrated PP margins in northeast Prices of the benchmark PP flat yarn fell by $20-30/tonne week on week to $1,390-1,430/tonne CFR (cost and freight) Most of the PP plants in “We will consider reducing our PP plant operating rates if the situation worsens,” said a source at SK Energy. Honam Petrochemical will consider whether to reduce its PP output if the spread between propylene and PP spot prices narrows further, a company source said. “We are still running our PP plants at full capacity now. We will consider whether to cut operating rates in November or not, depending on the market situation,” he said. PP markets in Weak downstream demand and uncertainty in the global economy had been weighing heavily on buyer sentiment and limiting purchases of the polymer in the spot market, resulting in thinning margins for PP makers, industry sources said. “It is really tough for us now,” a source at Korea Petrochemical Industry Co (KPIC) said. As of yet, KPIC has no definite plans to cut PP production, the source said. South Korea is expected to produce 2% more PP this year at 3.8m tonnes, and export 2.3m tonnes of the resin, representing a 2.3% increase from last year, according to the Korea Petrochemical Industry Association (KPIA). (
http://www.icis.com/Articles/2012/10/24/9606637/south-korea-pp-makers-may-cut-plant-runs-on-margin-squeeze.html
CC-MAIN-2014-35
refinedweb
234
61.06
I've always been very aligned with the styling philosophy of breaking the elements that form a component into smaller styled pieces with the opportunity to provide meaningful semantic names for those pieces. function MyAccount(){ return ( <Container> <Header> <BackButton onPress={handleGoBack}> <ArrowLeftIcon /> </BackButton> <HeaderText>My Account</HeaderText> </Header> ... </Container> ); } From my point of view it's easier to understand and maintain the components when the bits are named in such a way that it's clear what is the role of the component in the whole. It basically decouples what the component looks like from what it represents in the interface. The goal is to create my own utility to achieve something similar to what styled-components does but using objects instead of css; as well as taking advantage of Typescript's intellisense to help compose the style of a component with auto completion. The idea is quite simple, provide a way of creating simple named styled components which could be used on smaller projects and prototypes without having to install styled-components nor create runtime cost processing the css-ish styles. Something like this, very straight forward: const Heading1 = styled(Text, { fontSize: 24, fontWeight: 'bold', marginBottom: 12, marginTop: 24, }); Quick Note: This pattern of a function taking a component and potentially other arguments which then returns a new modified component is called Higher-order Components (HOC). The term is inspired by Higher-order Functions from functional programming which does a similar thing but with functions. I started with a simple HOC to do the job without concerning types nor intellisense. The function should take the component and the style and return a wrapped component with the provided styles applied to it. import React from 'react'; export function styled( Component, style, ) { return (props) => { return <Component {...props} style={[style, props.style]} />; }; } Basically takes a component and a style argument and return another component that bypasses the props and combine styles with the style passed. Notice that our style comes before the props.style so that we can override styles on the high end by either providing new styles or using styled multiple times on the resulting component. Done! Easy peasy lemon squeezy! Looks nice and it works. Now we can start adding types to create some constraints and, after all, we wanted to take advantage of intellisense as well. First things first, our HOC can only style actual components, therefore, we can start by enforcing this on our function to make sure no one passes in invalid components creating uncontrolled behavior. React has the perfect type for that, which is, ComponentType<P> where P is the properties type of that component. -import React from 'react'; +import React, { ComponentType } from 'react'; -export function styled( +export function styled<P>( - Component, + Component: ComponentType<P>, style, ) { - return (props) => { + return (props: P) => { return <Component {...props} style={[style, props.style]} />; }; } Notice the resulting component should as well be of properties type P because the HOC is supposed to return the "same" component but styled. Now our function only accepts components. Which is good, but we can still mess up the style argument; besides, Typescript still does nothing to help us create the style object. We can go next by addressing this particular problem which is, the style argument must be of the same type as the component's style. This, can be done by indexing the style property from our properties type P, that is, P['style']. import React, { ComponentType } from 'react'; export function styled<P>( Component: ComponentType<P>, - style, + style?: P['style'], ) { return (props: P) => { return <Component {...props} style={[style, props.style]} />; }; } The problem now is Typescript is not happy because not all properties type P might have style on it. Which makes sense, right? We should only style components that can be styled, therefore, our component must have a style property. So what we need to do to figure this constraint and consequently make typescript happy again is to enforce that the given component has a style property in its properties. Hence, we can state that P must have a style property on it. "But what best defines a style property"? you might ask. Well, after some time digging the React Native type definitions I found out styles are defined by StyleProp<T> where T is the custom style definition of a component, that is: TextStyle, ViewStyle, etc; in our case, T is not important because we already have style type info from P['style'], hence, we can simply use unknown and it should work just fine. import React, { ComponentType } from 'react'; +import { StyleProp } from 'react-native'; -export function styled<P>( +export function styled<P extends { style?: StyleProp<unknown> }>( Component: ComponentType<P>, style?: P['style'], ) { return (props: P) => { return <Component {...props} style={[style, props.style]} />; }; } And that's it! We are done! The function works and Typescript is happy again. Now intellisense of the style argument suggests valid style for the given component and we are good to go. We can even refactor the function to make it more readable, I ended up with the code bellow which is the final version of my tiny styled HOC. import React, { ComponentType } from 'react'; import { StyleProp } from 'react-native'; type StyleableProp = { style?: StyleProp<unknown> }; export function styled<P extends StyleableProp>( Component: ComponentType<P>, style?: P['style'], ) { return (props: P) => { return <Component {...props} style={[style, props.style]} />; }; } Here is some usage example: import React from 'react'; import { View, Text } from 'react-native'; import { styled } from './styled'; const Container = styled(View, { flex: 1, alignItems: 'center', justifyContent: 'center', }); const Heading1 = styled(Text, { fontSize: 24, fontWeight: 'bold', marginBottom: 12, marginTop: 24, }); export default function App(){ return ( <Container> <Heading1>Hello, world!</Heading1> </Container> ); } In conclusion, I don't think by any extent this is a complete production ready solution to replace styled-components or other similar solutions but it's a good starting point to build my own tiny styling utility suite. Next steps would be to figure ways to change attributes/props of the component, probably using a different HOC. Also, it would be interesting to figure a good theming by context solution, like styled-components but within the javascript/react way of doing things. Regardless, it was a great experience exploring typescript's capabilities applied to React Native, you always end up learning really interesting stuff along the journey. Besides. it's good sometimes to build your own stuff. I hope you've had a good read. Cheers! Discussion (0)
https://practicaldev-herokuapp-com.global.ssl.fastly.net/lenilsondc/writing-a-styled-hoc-for-react-native-using-typescript-3i25
CC-MAIN-2021-49
refinedweb
1,070
54.12
Problem: In a Java program, you need a way to find/match a pattern against a multiline String or in a more advanced case, you want to extract one or more groups of regular expressions from a multiline String. Solution: Use the Java Pattern and Matcher classes, and define the regular expressions (regex) you want to look for when creating your Pattern class. Also, specify the Pattern.MULTILINE flag when creating your Pattern instance. As usual with groups, place your regex definitions inside grouping parentheses so you can extract the actual text that matches your regex patterns from the String. In the following source code example I demonstrate how to extract the text between the opening and closing HTML code tags from a given multi-line String: import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A complete Java program to demonstrate how to extract multiple * HTML tags from a String that contains multiple lines. Multiple * lines are handled with the Pattern.MULTILINE flag. */ public class PatternMatcherGroupHtmlMultiline { public static void main(String[] args) { String stringToSearch = "<p>Yada yada yada <code>foo</code> yada yada ...\n" + "more here <code>bar</code> etc etc\n" + "and still more <code>baz</code> and now the end</p>\n"; // the pattern we want to search for Pattern p = Pattern.compile(" <code>(\\w+)</code> ", Pattern.MULTILINE); Matcher m = p.matcher(stringToSearch); // print all the matches that we find while (m.find()) { System.out.println(m.group(1)); } } } The output from this program is: foo bar baz Discussion The stringToSearch is created with several newline characters ( \n) to simulate the multiple strings you might get when reading a file (or input stream) that contains HTML. The most important part of the solution involves using the Pattern.MULTILINE flag when creating your Pattern object. As the name implies, this tells the Pattern class to look across multiple lines when parsing the String. Another important part of the solution is to use a while loop with the find method to make sure you find all occurrences of your regex pattern in the input String. If you only use an if statement with the find method, you will only get the first match.
https://alvinalexander.com/blog/post/java/how-extract-multiple-html-tags-groups-multiline-string/
CC-MAIN-2021-10
refinedweb
365
54.63
I2C sensor with WiPy2 Hi! I'm trying to read a VL6180x distance sensor with my WiPy2. The WiPy detects the sensor and can read stuff from it, but the results doesn't really make sense. According to the datasheet, register 0 should contain a model ID = 0xB4. The first time I read it I get the correct value, but if I keep reading it after that I get random values. If I reboot the sensor, I can read the correct value again one time. The same thing goes for all other registers I've tried to read. The code I use to read: from machine import I2C i2c = I2C(0, I2C.MASTER) i2c.readfrom_mem(0x29, 0, 1) The sensor is on a breakout board with a voltage regulator, and there's nothing wrong with it, because if I connect it to an Arduino and do the same thing, it works perfectly. I've tried both to have the sensor connected directly to the WiPy, running it on 3.3V, and via a levelshifter, running it on 5V. I have also tried different baudrates, but with no change. What am I doing wrong? @chumelnicu @JasonTimmins , @iotmaker Any update with VL53L0X library ? Thank you ! - chumelnicu last edited by chumelnicu @jasontimmins Hi , I dont know i suppose is not very hard ... try to find similar conversions for other sensors from Adafruit i2c mode and apply to pycom microphyton ... Or maybe u should try to use i2c workflow from @iotmaker and rest of code and registers from Adafruit The single difference that i see is the i2c addressing mode. I dont know Python programming ... If u have any result pls share :) thx! @chumelnicu This looks like a great library but I'm struggling to convert it to work on the Pycom device. Python is not my strong point. How different are Adafruit and Pycom devices? @iotmaker , @JasonTimmins Maybe that could help Yes thats a bug i have on the code, have not dig into it yet on how to fix it.. But if you figure it out, please share :) @iotmaker Thanks, that's got it working. I think I was missing... i2c_w(VL53L0X_REG_SYSRANGE_START, 0x02) It's now sitting here telling me how far my ceiling is above my desk!.. ~1690mm :-) I see a distance reading on 20mm quite often (30% of the time), why do you suppose that would be? Thanks again Jason. This is my full code just clean it up hehe from machine import UART from time import sleep_ms from network import Sigfox from machine import I2C import socket import pycom import re import binascii import ubinascii from machine import Pin import ustruct import time ### Sigfox Stuff sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ2) # create a Sigfox socket s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) # print Sigfox Device ID print("Sigfox ID") print(binascii.hexlify(sigfox.id())) # print Sigfox PAC number print("Sigfox PAC") print(binascii.hexlify(sigfox.pac())) # make the socket blocking s.setblocking(True) # configure it as uplink only s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) #Sigfox Stuff pycom.heartbeat(False) ##RGB Colors red=0xff0000 yellow=0xffff00 green=0x00ff00 blue=0x0000ff cyan=0x00feff purple=0xc442a1 orange=0xff8b55 dark=0x000000 def ledtoggle(color): pycom.rgbled(color) sleep_ms(50) pycom.rgbled(dark) sleep_ms(50) def i2c_w(reg,val): i2c.writeto_mem(sensor,reg,bytes([val]))##Put device on standby mode sleep_ms(1) ## address 0x1D i2c = I2C(0) # create on bus 0 i2c = I2C(0, I2C.MASTER) # create and init as a master i2c.init(I2C.MASTER, baudrate=400000) # init as a master sleep_ms(30) print("I2C Scan for devices") print(i2c.scan()))) sleep_ms(30) print("") cnt=0 val=0 a=0 while True: #print("Start Measuerment") i2c_w(VL53L0X_REG_SYSRANGE_START, 0x02) while (cnt < 100): #1 second waiting time max val=i2c.readfrom_mem(sensor,VL53L0X_REG_RESULT_RANGE_STATUS,1) if val==64: cnt=200 cnt=cnt+1 sleep_ms(30) datasensor=i2c.readfrom_mem(sensor,0x14,12)#Read sensor data distance=datasensor[10]*256+datasensor[11]#combine integers #print("distance") print(distance) if 100<=distance<=200: print('Sending Sigfox') s.send(bytes([datasensor[10], datasensor[11], 255, 255, 255, 255, 255, 255, 255, 255, 255, 255])) ledtoggle(blue) ledtoggle(blue) ledtoggle(blue) ledtoggle(blue) print("By law it will sleep 20 seconds") time.sleep(20) ledtoggle(green) # for x in range(0,12): # print(datasensor[x]) # # print(datasensor) # print(datasensor[10]) # print(datasensor[11]) # print("") sleep_ms(1000)``` @iotmaker Thanks for your code for the VL53L0X distance sensor. I've got the same configuration here and, although I can read the various registers you mention (Revision ID, Device ID, etc), I can't actually get a distance from the thing. VL53L0X_REG_RESULT_RANGE_STATUS is zero all the time and your 'distance' code gives zero too. This looks like a fairly complex device, am I missing some kind of initialisation procedure? Cheers Jason. @sesamproductions Did u manage to read VL53LX0 in long distance mode? Thx! @ledbelly2142 I know the diference between VL6180X and VL53L0X ! The question has target other response and was for @iotmaker I did asked him if he managed to read the VL53L0X in long range mode (that mean 200cm) - ledbelly2142 last edited by ledbelly2142 @chumelnicu It's in the specification of the sensor, see HERE that the VL6180X can measure up to 20 cm. The VL53L0X will measure up to 2 Meters (6.6Ft) away. You can see it on a breakout board HERE @iotmaker Hi , did u read distance using vl53l0x with this code? Wrking and long distance too? i mean 200cm? Thx! Great! Now I'm starting to understand this a bit! I can read and write stuff using @robert-hh's suggestions, and the sensor seem to output correct data. Now I just have to modify my library with new read/write methods. Thanks a lot for the help! @SesamProductions I'm afraid I don't have any more information on that library. But smbus is just the I2C library for whatever hardware platform it was written for. You should be able to substitute pycom's I2C functions readfrom_mem and writeto_mem for b.read_byte_data and b.write_byte_data, respectively. But note, I've never actually tried to access 16-bit addresses using pycom's I2C functions. If they don't work, please do submit a bug report, and in that case, you should be able to accomplish the same thing using the writeto and readfrom method that @robert-hh suggested earlier. - robert-hh Global Moderator last edited by robert-hh @SesamProductions For writing to a register, just append the data for the register to the address in a single write. About @iotmaker's comment. The VL53L0X device he uses requires just an 1 byte address just like the memory devices. Thanks for the suggestions! @robert-hh YES! That is working! Thank you! I can now read data from registers in a controller way. Unfortunately I'm now very confused about this. If the writeto function is used to tell the device what register I want to read, how do I write things to the registers? For instance to tell the device I want it to start measuring range. @iotmaker To me it looks like you're doing the exakt same thing I'm doing, and according to the short datasheet I found for your sensor, it should work similar to mine. So why yours is working and mine is not is definitely beyond me. @Eric24 When I've tried the sensor on the Arduino I've used the Adafruit library your linked code seem to be a python port of. I had myself not found that python version, so what I've done is my own python port of the Adafruit Arduino library. The problem is that in order to deal with all the complexities of the sensor and initialize it, I need to be able to read and write to registers, which is the part that isn't working. The python-version you're linking to is using a module called smbus to deal with everything I'm having problems with. Where do I get that from? I didn't find any links for that on the github page, and import smbusis not working on my WiPy. Where you using it on a WiPy, or some other Pycom device? I had not heard about smbus before and a quick google for it seem to indicate it's a different, but fairly similar, protocol than i2c. Was there a reason for using smbus instead of the builtin i2c? I have it working like this)) #To read first check the status val=i2c.readfrom_mem(sensor,VL53L0X_REG_RESULT_RANGE_STATUS,1) #if val is equal to 64 then it read the distance #read the value datasensor=i2c.readfrom_mem(sensor,0x14,12)#Read sensor data distance=datasensor[10]*256+datasensor[11]#combine integers I have it working on the VL53L0X hope it helps - robert-hh Global Moderator last edited by @SesamProductions From the spec, I assume that the sequence should be: i2c.writeto(0x29, b'\x00\x00') i2c.readfrom(0x29, 1) The address for a read is a two byte value.
https://forum.pycom.io/topic/1453/i2c-sensor-with-wipy2/16
CC-MAIN-2019-35
refinedweb
1,507
65.22
Hi, I am defining a resource adapter (connection factory) and then trying to access it via naming's InitialContext. The deployment appears to be fine, as I see: 21:00:53,693 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=comp/env/mule/connectionFactory' to JNDI name 'java:comp/env/mule/connectionFactory' Note that the JNDI name is defined in the -ds.xml via: <jndi-name>comp/env/mule/connectionFactory</jndi-name> and I am worried this is unusual (examples don't usually have so many slashes). When I try to access this via: initCtx.lookup("java:comp/env/mule/connectionFactory") I get the error "env not bound". This seems odd, given that the same string appears above. However, I am not sure if this "comp/env" name is the same as a JNDI name. But if it's not, I can't work out how to set it. The <env-entry> tag seems to be restricted to simple types, for example... I've read the docs until going crazy, but this must be something stupid on my part. Apologies, but any help appreciated (v4.0.3RC2 with EJB3, JDK5). What am I doing wrong? Thanks, Andrew It looks like you have been trying to mix a number of principles discussed on the web into one and unfortunately this is not how it works. The 'java:comp/env' namespace is a namespace that each compnent has its own private version of. In the deployment descriptors of a component using ejb-ref and resource-ref (and different variations of these) you can specify what needs to be references from the components namespace. These can really be thought of a symbolic links that can be altered so the component does not need to be recompiled if the resources it used are changed. There is another namespace the 'java:' namespace, this contains items that are global to the container but can only be accessed within the container. This (as you have already worked out) is the default place the resource adapter will be bound. In your deployment descriptor you have configured it to bind to the 'java:' namespace using the same String that would be used to access the components namespace. Try removing the 'comp/env' from the name your resource adapter is bound to and adjust the client accordingly and see if that works.
https://developer.jboss.org/thread/72585
CC-MAIN-2017-43
refinedweb
393
55.34
Service URLs for tastypie Project description A simple API end point that we’ve found useful for our Tastypie API services at Mozilla. Installation Install using pip: pip install tastypie-services Note: version 2 renamed the lib from services to tastypie_services. Configuration Add to your urls: from tastypie_services.urls import services urlpatterns = patterns('', ... url(r'^', include(services.urls)), ) If you want to allow settings access, set: CLEANSED_SETTINGS_ACCESS = False The actual server status is very specific to your server, so you need to create a base class overriding the one in services. The tell the library where the object is. For example: SERVICES_STATUS_MODULE = 'lib.services.resources' Then in lib.tastypie_services.resources: from tastypie_services.services import StatusObject as Base class StatusObject(Base): def test_cache(self): cache.set('status', 'works') if cache.get('status') == 'works': self.cache = True See solitude for an example of this. Project details Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/tastypie-services/
CC-MAIN-2021-39
refinedweb
165
53.17
Incremental Parsing The iterparse function builds an element tree with data from a file or a file-like object, but also lets you inspect the tree during the build process. This is similar to parsing a file and then iterating over it with iter (or getiterator, in 1.2 and earlier), but the parsing and the iteration are done in parallel. This has several advantages; you can for example remove parts of the tree that you don’t need, stop parsing when you find what you’re looking for, or just gain a little performance by parsing XML from a remote site as it arrives over the wire. For example, here’s an example that shows how to print all item links from an RSS 2.0 file: for event, elem in ET.iterparse("blog.rss"): if elem.tag == "item": print repr(elem.findtext("link")) elem.clear() # won't need this again for event, elem in ET.iterparse("blog.rss"): if elem.tag == "title": print repr(elem.text) break # we're done old. events = ("end", "start-ns", "end-ns") namespaces = [] for event, elem in iterparse(source, events=events): if event == "start-ns": namespaces.append(elem) elif event == "end-ns": namespaces.pop(-1) else: ...
http://effbot.org/elementtree/iterparse.htm
CC-MAIN-2016-30
refinedweb
203
67.55
plz send this coding.. sir, this code runs quite flawless..........but how could we can display image matrix good good and useful plz any one tell me hurry.. hey this worked thanx a lottt yaaarr Usefull! its too long..... You had mplemented the paint method, but you did not use it. thanks this really helped please tell java code to retrieve image details like camera model,data the folder and display in form of my project..... can u tell me how to do this????? i am using java swing......... import java.sql.*; import Image Processing Java ://...); } /* * This method just create a JFrame to display the image. Closing the window...Image Processing Java Using This Code I Compressed A JPEG Image Display Image in Java sharfudeen March 15, 2011 at 6:18 PM plz send this coding.. how to find display image matrixsumit June 20, 2011 at 12:18 PM sir, this code runs quite flawless..........but how could we can display image matrix java programingshefeeque July 1, 2011 at 2:41 PM good java programingshefeeque July 1, 2011 at 2:43 PM good and useful image attachhow to attach a .swf or .fla file in core java? July 4, 2011 at 9:31 AM plz any one tell me hurry.. thanxshri September 17, 2011 at 9:12 PM hey this worked thanx a lottt yaaarr Javaweiyi November 19, 2011 at 6:39 PM Usefull! codeneetu December 14, 2011 at 7:21 PM its too long..... where is the Paint method applied?mateus April 23, 2012 at 7:50 AM You had mplemented the paint method, but you did not use it. image displayingiupac July 16, 2012 at 8:17 PM thanks this really helped image detailsIMMADISETTY SURESH KUMAR March 10, 2014 at 10:00 AM please tell java code to retrieve image details like camera model,data taken Post your Comment
http://www.roseindia.net/discussion/5092-Display-Image-in-Java.html
CC-MAIN-2014-52
refinedweb
311
74.9
Example for abstract methods in java: What is the output of below Java program? class Base{ public abstract void disp(){ System.out.println("This is base class"); } } public class AbstractDemo1 { public static void main(String[] args) { Base b = new Base(); b.disp(); } } This is base class Compile time error in class Base, you can't give function body for abstract method disp(). Either we have to remove the keyword abstract or we have to remove the function body for disp() method. Compile time error in main method, we can't create object for class Base as it is having abstract method. all are false. An abstract method should not contain method body. Back To Top
http://skillgun.com/question/3054/java/interface-abstractclass/example-for-abstract-methods-in-java-what-is-the-output-of-below-java-program-class-base-public-abstract-void-disp-systemoutprintlnthis-is-base-class-public-class-abstractdemo1-public-static-void-mainstring-args-base-b-new-base-bdisp
CC-MAIN-2016-50
refinedweb
115
76.22
: The entire method should look this:: ``` <ProjectReference Include="..\stringModifier\stringModifier.csproj" /> ```. using stringModifier;. dotnet. dotnet build And go back into our library tester folder, and run a test again: dotnet test.]]> In this tutorial, I'll show you how easy it is to setup file sharing on your network using SAMBA. You can easily share files between Linux and Windows machines with a pretty minimal amount of setup. First, to give you little context, here's how I am using Samba file sharing, with something I recently set up for course development... Next we want to edit our smb.conf. Make a quick backup of the file sudo cp /etc/samba/smb.conf /etc/samba/smb.bak Now, let's edit the file sudo vi /etc/samba/smb.conf. ``` [fileshare] comment= my file share path = /srv/samba/secure valid users = jeremy public = no writable = yes browsable = yes printable = no create mask = 0765 ``` You want to test your configuration changes to make sure everything is correct. testparm Then, it's time to restart the smb and nmb services: sudo systemctl restart smb.service sudo systemctl restart nmb.service We'll have to add an entry to the firewall to allow the samba service to be accessible from outside the network: firewall-cmd --permanent --zone=public --add-service=samba firewall-cmd --reload Now, we can browse to the server from a Windows machine: You can even mount it as a mapped drive, or mount it on a linux machine. Samba setup is super easy, and great to use.: Like. If you have any questions, feel free to contact me about it.! Download Netling Here. Download Web Surge Here: It gives you quick results, and you can "drill down" to get more detailed data.. Download JMeter Here sudo apt-get update sudo apt-get upgrade Next we need to import the public repository GPG keys curl | sudo apt-key add - curl | sudo tee /etc/apt/sources.list.d/mssql-server.list Next we'll install SQL Server. sudo apt-get update sudo apt-get install -y mssql-server Now we need to run a configuration script to set up the server: ``` sudo /opt/mssql/bin/sqlservr-setup ```` It will ask if you want to start the service and if you'd like to start it on boot. Here's how you can check if the service is running: systemctl status mssql-server To test this out a little, install the MSSQL tools on Ubuntu. Add in a new repository: ``` curl | sudo tee /etc/apt/sources.list.d/msprod.list sudo apt-get update sudo apt-get install mssql-tools ``` Now, Let's try to connect! sqlcmd -S localhost -U SA -P '<YourPassword>' You can run this command to view all your databases: SELECT Name from sys.Databases; GO This should look pretty familiar to you if you've worked with SQL in the past. CREATE DATABASE acmewidgets; GO Now we need to select that database: USE acmewidgets; GO As a test. let's create a customer table CREATE TABLE customer (id INT, firstname NVARCHAR(50), lastname NVARCHAR(50)); GO Now, let's put some customers in there: INSERT INTO customer VALUES (1, 'Lloyd', 'Christmas'); INSERT INTO customer VALUES (2, 'Harry', 'Dunn'); INSERT INTO customer VALUES (3, 'Mary', 'Swanson'); GO Now, let's take a look at those customers: SELECT * FROM customer GO QUIT And you're done! I'll be messing with this some more in the coming weeks and really putting it to the test, and I'll share my results. -Jeremy I also did a YouTube tutorial for this article:
http://feeds.feedburner.com/JeremyMorganTutorials
CC-MAIN-2018-26
refinedweb
599
60.65
Mark Rafn wrote: > On Fri, 7 May 1999, Paul Serice wrote: > > :-). > > This kind of question might be looked at in terms of DSFG #9. Imagine I > wrote a package that ALSO contained a similar provision (I require the > executable must be named "notcrafty"). It's clear that the licenses are > not compatible for the case where someone wants to combine code from the > two programs. The same is true for two programs that require the same > filename for their license. How do you include both licenses in your > combination-product? That's interesting. I see what you're talking about, and it would make collaboration among projects almost impossible. I find your argument persuasive. It seems I was trying to guarantee that credit go to the correct persons by restricting the namespace. It didn't see any harm it could cause until you pointed it out. Thanks. However, it's not obvious that DSFG #9 protects against this. It looks to me like the gist of DSFG #9 is that a package cannot dictate which other packages are distributed with it: "The license must not place restrictions on other software that is distributed along with the licensed software." For example, if the terms of the Crafty license were such that the names of derived executables had to somehow acknowledge their Crafty heritage, this would still be a namespace restriction, but the restriction is hardly an attempt by the Crafty author to say, "No Crafty clone can be distributed with crafty." Again, to me, it seems that reading DSFG #9 to protect against all or most namespace restrictions would be to read too much into DSFG #9. To me, DSFG #4 is the paragraph on point, and it does allow for some restrictions to be placed on the namespace. Paul Serice
https://lists.debian.org/debian-legal/1999/05/msg00031.html
CC-MAIN-2015-48
refinedweb
300
68.5
Can I have subdirectories in a +package directory? 41 views (last 30 days) Show older comments Richard Crozier on 20 Mar 2015 Commented: Jim Svensson on 14 May 2019 I would like to know if it is possible to add subdirectories to a matlab package directory (denoted by a preceeding '+' in the directory name). Often I want to split up my functions within a package into logical units in directories, but without needing them to each have their own subnamespace. In other words, is it possible to have: /+pkg/toplevelfun.m /+pkg/subdir/lowerlevelfun.m and have both called in my matlab code as: pkg.toplevelfun pkg.lowerlevelfun My tests indicate this is not possible (at least in 2014a). Is this impossible, and if so, is there some technical reason it could not be implemented by TMW? 2 Comments Jim Svensson on 14 May 2019 The mechanism you want does not exist. But you achieve a similar thing by putting the differrent folder groups first and multiple packages of the same name inside, like so: <root>/utils/+pkg_foo/find_data.m <root>/apps/+pkg_foo/plot_data.m addpath/genpath(<root>)) d = pkg_foo.find_data(); pkg_foo.plot_data(d); Accepted Answer More Answers (2) Philip Joergensen on 15 Nov 2018 Not sure why it does not make sense to place both functions in the root of the package in the case you describe. I figured out, if you do not mind having a namespace for each subdirectory, you can have subpackages in your package: /+pkg/toplevelfun.m /+pkg/+subpkg/lowerlevelfun.m And then calling the lowerlevelfun would be pkg.subpkg.lowerlevelfun(...) Which seems to make good sense in this use case, as it is easy to group functions into easy to remember and meaningful namespaces. 3 Comments Michael Häußler on 15 Nov 2018 There is also the possibility to use private folders within the package. The functions/classes within that folder are however only visible to the files within the package.... Still not what you want exactly, but I actually use that a lot now to have small "helper functions" within the package organized at a different place: 1 Comment See Also Categories Community Treasure Hunt Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
https://de.mathworks.com/matlabcentral/answers/184191-can-i-have-subdirectories-in-a-package-directory
CC-MAIN-2022-21
refinedweb
377
50.67
5 replies on 1 page. Most recent reply: Jan 19, 2010 10:58 AM by Kevin Wright Follow-up to Part One: It looks like the name of the annotation is open for debate. For anyone with an account, please do head over to the wave for this project and add to the discussion there. Otherwise, feel free to add a comment below. For the remainder of this article I'm trialling the alternative @mixin annotation Some months ago, I ran into a small problem with the Scala REPL (Read-Evaluate-Print-Loop) under MS Windows. This was using JLine, which hooks a native library into the command window to find the window size and to support key bindings such as tab completion. JLine is a great solution, except when you need to run the REPL in a nested process with redirected I/O, or connect to it remotely via a protocol such as Telnet. In such cases you have to sacrifice functionality. Seeing the situation, I felt that Scala could benefit from a swing-based REPL. This would not need JLine to support the full range of functionality in 2.8, would be embeddable, and would allow for connecting to a remote JVM. It also looked like a good project to stretch my growing experience of coding in Scala and gave me a chance to experiment with a bit of swing in the language. For various reasons, this project has been postponed (demand from the community wasn't strong at the time, JEditorPane and JTextPane still need to be ported over to the scala swing library, and it looked unlikely that I would have it done in time for the then-predicted 2.8 release), but it did expose me to lots of code that looked a bit like this: class MyClass(peer: OtherClass) { def method1 = peer.method1 def method2(n:Int) = peer.method2(n) def method3(s: String) = peer.method3(s) def prop1 = peer.prop1 def prop1_=(n:Int) = peer.prop1_=(n) def prop2 = peer.prop2 ... } Pulling in a bunch of methods and properties from elsewhere is why traits were invented, it's the entire reason that Scala has "with" as a keyword. But, as discussed in part I, traits/mixins are of no use in this situation because the OtherClass instance, peer, already exists. Still, the code contains a lot of boilerplate - the sort of thing that IDEs can readily generate for Java projects. This just has to be a code smell. Surely, there's something the compiler can do to help? What I first wanted is a way to change an expression like this: val x = new Foo with Bar and instead write something like this: val f = //create or fetch an instance of Foo val x = f with Bar Thus decorating a pre-existing instance of Foo with extra functionality. This capability is often referred to as "dynamic mixins" on the Scala mailing lists. Although such syntax may be possible [1] , it would require a change to the parsing rules of Scala and is really beyond the scope of a compiler plugin. Instead, I settled on the @mixin (formerly @proxy) annotation to extend the language in a more plugin-friendly fashion: class Bar(@mixin foo: Foo) { ... } val f = ...some method returning an instance of Foo... val x = new Bar(f) I then sought feedback about this approach via the Scala mailing lists and the responses were unexpected! Instead of just seeing my proposal as a dynamic alternative to mixins, there was a lot of curiosity about other ways in which this annotation might be used. Since that time I've expanded the scope of the plugin and I'm now testing it in a number of scenarios that are increasingly removed from the original goal. The remainder of this article covers some of the uses... Non-private member variables in Scala are generated as a hidden field, plus a getter and (in the case of vars) setter method. Sometimes it's desirable to override these generated methods, perhaps for logging, security or to notify change listerners. One way to achieve this is to create a private member and hand-craft the accessors: class Foo { private[this] val x0 : Int = 0 def x = { x0 } def x_=(value : Int) = { // custom behaviour goes here x0 = value } } This needs a naming convention to be chosen for the private fields. It also needs the developer to write a getter method identical to the one the compiler would have generated, which feels a bit redundant. It's easy enough to avoid the proliferation of private names by holding them all in a singleton object: class Foo { private[this] object props { val x : Int = 0 } def x = { props.x } def x_=(value : Int) = { // custom behaviour goes here props.x = value } } This approach then lends itself to using autoproxy for re-use of the compiler-generated methods: class Foo { private[this] @mixin object props { var a : Int = _ var b : Double = _ var c : String = _ } //The following defs are mixed in: a, a_=, b, b_=, c //a delegate for c_= is NOT created as it already exists below def c_=(str : String) = println("c set to " + str); props.c = str } Thus allowing accessors to be selectively overridden, with minimal boilerplate. Due to type erasure, the types Foo[String] and Foo[Bar] are identical at runtime, with the type safety only being enforced within the compiler. Scala 2.8 offers the @specialize annotation, manifests and view bounds to help out with many of the problems that this can cause, but there is one problem that can't be handled - mixing in differently paramaterized versions of the same trait: trait Foo[T] { def foomethod(arg: T) = println(arg) } //can't do this! class Bar extends Foo[String] with Foo[Int] { def barmethod = println("bar method") } Once again, autoproxy can help here: trait Foo[T] { def foomethod(arg: T) = println(arg) } //this works though! class Bar { @mixin val foo1 = new Foo[Int] @mixin val foo2 = new Foo[String] def barmethod = println("bar method") } This approach is fine for methods such as foomethod above that have different type signatures in each of the mixed-in traits, they will just end up as overloaded versions in the Bar class. However, for any method that exists in both Foo[Int] and Foo[String] with the same signature, the generated delegate will use the version from Foo[Int] as it was the first mixin listed in Bar. Depending on your needs, this can be seen as either a problem to work around or a useful design feature. The plugin is still in desperate need of testing in as many scenarios as possible. But I'm hopeful of having it up to production quality in time for the 2.8 Scala release. One problem I would like to tackle though is javabean properties. Currently, if a field is annotated as @BeanProperty then it has getXXX and setXXX methods generated in addition to the standard scala getters and setters, when such an object is mixed-in then separate delegates will be created for the Scala and the JavaBean accessors. Ideally, it should be possible to mixin an object, override the Scala accessors, and have the JavaBean accessors delegate to the overridden implementation instead of the original. It would also be a very useful extra if I could take an existing object using Javabean style properties, and proxy it using Scala style properties. I'll cover how the plugin is implemented. This involved some fun interactions with the typer phase of the compiler, which fails if delegates have not yet been generated, but also needs to be run to provide information used in generating the delegates.
http://www.artima.com/forums/flat.jsp?forum=106&thread=275588
CC-MAIN-2014-15
refinedweb
1,284
58.01
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. How to change upper left logo through module? Hi, I am trying to create a module that changes the upper left OpenERP logo, at the top of left menu. I have a basic knowledge of how to create modules. In /openerp/addons/web/static/src/xml/base.xml <td class="oe_leftbar" valign="top"> <t t- <a class="oe_logo" t- <span class="oe_logo_edit">Edit Company data</span> <img t- </a> ... img t-att-src='widget.session.url("/web/binary/company_logo") this line is confusing me, because of widget.session.url. In my module should I extend it and simply give the path of my image or is there any other way of doing this? Any suggestions? To inherit from /openerp/addons/project/project.py class. I do this: from openerp.osv import fields, osv class test_module(osv.osv): _inherit = "project.project" // some code ... test_module() But now I have to inherit from /openerp/addons/base/res/res_company.py How can I inherit from res_company.py and override the desired function? About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/how-to-change-upper-left-logo-through-module-45263
CC-MAIN-2017-34
refinedweb
223
52.87
#include <xvid.h> #include <unistd.h> #include "avcodec.h" #include "libavutil/intreadwrite.h" #include "libxvid_internal.h" Go to the source code of this file. Definition in file libxvidff.c. Definition at line 39 of file libxvidff.c. Referenced by xvid_ff_2pass_after(), and xvid_ff_2pass_create(). Definition at line 38 of file libxvidff.c. Referenced by xvid_ff_2pass_after(), and xvid_ff_2pass_create(). Buffer management macros. Definition at line 37 of file libxvidff.c. This(). Routine to correct a possibly erroneous framerate being fed to us. Xvid currently chokes on framerates where the ticks per frame is extremely large. This function works to correct problems in this area by estimating a new framerate and taking the simpler fraction of the two presented. Definition at line 552 of file libxvidff.c. Referenced by xvid_encode_init(). Destroys the private context for the encoder. All buffers are freed, and the Xvid encoder context is destroyed. Definition at line 478 of file libxvidff.c. Encodes a single frame. Definition at line 370 of file libxvidff.c. Creates the private context for the encoder. All buffers are allocated, settings are loaded from the user, and the encoder context created. Definition at line 85 of file libxvidff.c. of file libxvidff.c. Referenced by xvid_ff_2pass(). Routine to create a global VO/VOL header for MP4 container. What we do here is extract the header from the Xvid bitstream as it is encoded. We also strip the repeated headers from the bitstream when a global header is requested for MPEG-4 ISO compliance. Definition at line.
http://www.ffmpeg.org/doxygen/0.6/libxvidff_8c.html
CC-MAIN-2015-11
refinedweb
250
63.86
from creole import html2creole from BeautifulSoup import BeautifulSoup VALID_TAGS = ['strong', 'em', 'p', 'ul', 'li', 'br', 'b', 'i', 'a', 'h1', 'h2'] def sanitize_html(value): soup = BeautifulSoup(value) for tag in soup.findAll(True): if tag.name not in VALID_TAGS: tag.hidden = True return soup.renderContents() html2creole(u(sanitize_html('''<h1 style="margin-left:76.8px;margin-right:0;text-indent:0;">Abstract</h1> <p class="Standard" style="margin-left:76.8px;margin-right:0;text-indent:0;"> [more stuff here] """)) On Mon, Sep 12, 2011 at 6:17 PM, Gary Herron <gherron at islandtraining.com> wrote: > On 09/12/2011 12:49 AM, Alec Taylor wrote: >> >> Good evening, >> >> I have converted ODT to HTML using LibreOffice Writer, because I want >> to convert from HTML to Creole using python-creole. Unfortunately I >> get this error: "File "Convert to Creole.py", line 17 >> SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py >> on line 18, but no encoding declared; see >> for details". >> >> Unfortunately I can't post my document yet (it's a research paper I'm >> working on), but I'm sure you'll get the same result if you write up a >> document in LibreOffice Writer and add some End Notes. >> >> How do I automate the removal of all non-ascii characters from my code? >> >> Thanks for all suggestions, >> >> Alec Taylor > > > > This question does not quite make sense. The error message is complaining > about a python file. What does that file have to do with ODT to HTML > conversion and LibreOffice? > > The error message means the python file (wherever it came from) has a > non-ascii character (as you noted), and so it needs something to tell it > what such a character means. (That what the encoding is.) > > A comment like this in line 1 or 2 will specify an encoding: > # -*- coding: <encoding name> -*- > but, we'll have to know more about the file "Convert to Creole.py" to guess > what encoding name should be specified there. > > You might try utf-8 or latin-1. > > > -- > >
https://mail.python.org/pipermail/python-list/2011-September/612244.html
CC-MAIN-2019-51
refinedweb
335
57.87
I am trying to prevent submission of a form if either or both of 2 functions return false. I've tried calling the functions in my form this way: <form action="tuition-calculator.php" name="orderform" id="tuition-schedule" method="post" onsubmit="return (tuesThurs() && setTuition())">, but it doesn't stop the submission, even if the results are false. So...now I've tried this: (in header) <script type="text/javascript"> function formValidation(myForm) { var result = tuesThurs(myForm); var result2 = setTuition(myForm); results = result && result2; return results; } </script> (in body) <form action="tuition-calculator.php" name="orderform" method="post" onsubmit="return formValidation(this)"> If the values are "false" for both functions, the proper alerts appear and the submission doesn't happen. If I change my entries so that tuesThurs returns a "true" but setTuition returns a false, the alert for setTuition appears, but the submission goes through anyway. I do not want it to be submitted until both functions are true. Any suggestions? Are you sure you're returning the correct values from both tuesThurs and setTuition? And there are no errors? Because both of the above methods are correct and should work. New to web development or in need of a good reference? Check out the Mozilla Developer Network or W3Schools. There are currently 1 users browsing this thread. (0 members and 1 guests) Forum Rules
http://www.webdeveloper.com/forum/showthread.php?271433-Can-t-get-XML-response-from-jQuery-AJAX-code...&goto=nextnewest
CC-MAIN-2016-36
refinedweb
226
56.96
I'm working in Python and trying to use the SDK to search from a program. One of the apps I have installed uses a lookup table (CSV file) to add fields to events, and I'm trying to search on those events (specifically, the CSV file in the app adds 'costcenter=___' to the data, and I'm trying to search for a specific call center). As I don't know how to do this, my searches right now are returning 0 results. Is there a place I can read up on this, or is the answer easy enough to answer here? Edit: Would namespace=<app_name> work? Thanks! Namespace= seems to be working, but I'm getting much less results than normal, though (1 million on the website vs. 260 on the API call). I think this is the answer, but I'll wait until a more definitive answer is posted. never-displayed
https://community.splunk.com/t5/Splunk-Search/How-to-use-search-a-CSV-lookup-file-within-an-App-via-Python-SDK/td-p/137429
CC-MAIN-2020-40
refinedweb
154
78.48
Created on 2008-06-30 18:01 by catlee, last changed 2018-10-30 20:47 by tzickel. This issue is now closed. httplib should support requests whose bodies are iterable objects. This would facilitate doing large file uploads via HTTP since you wouldn't have to load the entire file into memory to create the request string. Index: Lib/httplib.py =================================================================== --- Lib/httplib.py (revision 64600) +++ Lib/httplib.py (working copy) @@ -688,7 +688,12 @@ self.__state = _CS_IDLE def send(self, str): - """Send `str' to the server.""" + """Send `str` to the server. + + ``str`` can be a string object, a file-like object that supports + a .read() method, or an iterable object that supports a .next() + method. + """ if self.sock is None: if self.auto_open: self.connect() @@ -710,6 +715,10 @@ while data: self.sock.sendall(data) data=str.read(blocksize) + elif hasattr(str,'next'): + if self.debuglevel > 0: print "sendIng an iterable" + for data in str: + self.sock.sendall(data) else: self.sock.sendall(str) except socket.error, v: The attached patch implements this for python 2.7. It also adds support for iterable bodies in urllib2, where it is more generally useful. urllib2 enforces the presence of a Content-Length header in the request if the body is an iterable, whereas httplib does not. The patch also includes updates to docs and tests (which all pass as of r67584 on my macbook) Seems like a reasonable feature request. I'm going to apply a variant of the patch in 3.1 first. This patch and its tests still work. Any particular reason why it hasn't been adopted yet? Could someone with knowledge of httplib please move this forward, all the comments I see are positive. The patch needs to be ported to the py3k branch. Hi, attached is a ported version of the patch that applies against py3k. Instead of hasattr(str,'next') consider using isinstance(str, collections.Iterable) Also consider changing the variable name from the now overly type specific, "str" to something like "source" to indicate the significance of the data, not its type. Hi Raymond, I assume you're referring to catlee's patch? 'str' has been changed to 'data' in python 3.2 While porting the patch I ran into this issue, which is that isinstance(str, collections.Iterable) doesn't behave exactly like hasattr(str,'next') >>> hasattr("lol", '__next__') False >>> isinstance("lol", collections.Iterable) True so using the isinstance method would actually match against strings, which iirc would make the program fail. I can confirm later if needed. xuanji, the issue you stumbled upon was just fixed by Raymond for the report Issue10565. What a timely coincidence. I'll try out the change soon. Changed according to Raymond's suggestion. I realized that there are some classes (str, bytes, array.array) that are iterable but should not be handled by the iteration logic provided by catlee. eg: if we iterate through b'a message' we'd get a bunch of ints and sending them is wrong. patch attached. Thanks for the patch. First, you don't need to support str, since sockets only accept binary strings (not unicode). Second, I think it's simpler and more generic to do something like: try: self.sock.sendall(data) except TypeError: try: it = iter(data) except TypeError: raise TypeError("data should be a bytes-like object or " "an iterable, got %r" % type(it)) for d in t: self.sock.sendall(d) pitrou: that sounds good. I attached another patch. pitrou: actually that seems a bit suspect now... you need to handle 'data' differently depending on its type, and while you can determine the type by finding out when 'data' throws certain exceptions, it doesn't seem like what exceptions were meant for. > pitrou: actually that seems a bit suspect now... you need to handle > 'data' differently depending on its type, Yes, but you can't know all appropriate types in advance, so it's better to try and catch the TypeError. I don't understand your changes in Lib/urllib/request.py. len(data) will raise anyway. I don't fully understand Lib/urllib/request.py either, I just ported it and ran the unittests... it seems like what it does is that if you send an iterator through as 'data' you can't know the length in advance, and rather than let the len(data) raise an exception catlee thought it's better to raise an exception to tell the user exactly why the code failed (ie, because the user sent an iterator and there's no way to meaningfully find the Content-Length of that). As for the catching exceptions vs using isinstance: I thought about it for a while, I think something like this feels right to me: try: self.sock.sendall(data) except TypeError: if isinstance(data, collections.Iterable): for d in t: self.sock.sendall(d) else: raise TypeError("data should be a bytes-like object or an iterable, got %r" % type(it)) anyway, calling iter(data) is equivalent to calling data.__iter__(), so catching the exception is equivalent to hasattr(data, '__iter__'), which is roughly the same as isinstance(data, collections.Iterable). so we try the most straightforward method (sending everything) then if that fails, data is either an iterator or a wrong type. > len(data) will raise anyway. No, it won't, if the iterable happens to be a sequence. > > len(data) will raise anyway. > > No, it won't, if the iterable happens to be a sequence. Well, it seems the patch is confused between iterable and iterator. Only iterators have a __next__, but they usually don't have a __len__. The patch should really check for iterables, so it should use: if isinstance(data, collections.Iterable) raise ValueError#etc. davide: yeah, hasattr("lol", '__next__') == False, even though strings are Iterable; so for strings and other such sequences the len(data) line will be executed. So technically we shouldn't say "No Content-Length specified for iterable body" but we should say "No Content-Length specified for iterable body that is not a sequence". Basically, this whole patch (both parts of it) will be much better off iif there is a clean way to say "a is an iterable but a is not a sequence", because even though b'this is a message' is Iterable, we want to treat it differently compared to, say, a generator object; we do NOT want to use the Iterator features (iter, next) of it, we want to use the sequencey features (by sending the whole chunk of it, by calling len) Xuanji, a wording which does convey the approximate meaning is fine. I think, the Exception error messages will help the people based on the Context. - Lets have the ValueError raised from the urllib/request.py. Changing it to isinstance(data,collections.Iterable) as Antoine suggested is okay here too. - Same change for http.client code checking for an Iterable as specified in msg122905 tests are fine. Docs and NEWS should be updated. Georg: Is it okay, if we push this feature in before Dec 4th, beta1 release? One way to check that it's bytes-compatible is to take a memoryview of it: >>> memoryview(b"abc") <memory at 0x1cf5120> >>> memoryview(bytearray(b"abc")) <memory at 0x1cf55a0> >>> memoryview(array.array('b', b"abc")) <memory at 0x1cf52a0> >>> memoryview([b"abc"]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot make memory view because object does not have the buffer interface >>> memoryview("abc") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot make memory view because object does not have the buffer interface > - Lets have the ValueError raised from the urllib/request.py. Changing > it to isinstance(data,collections.Iterable) as Antoine suggested is > okay here too. Xuanji is right: it's not. We want bytes to be accepted, and it's an iterable. Answering to myself, sorry. memoryview() does return the right answer of whether the object supports the buffer interface, *however* it doesn't mean the len() will be right. For example, take an array.array of ints: >>> memoryview(array.array("I", [1,2,3])) <memory at 0x1cf5720> >>> len(array.array("I", [1,2,3])) 3 >>> len(memoryview(array.array("I", [1,2,3]))) 3 >>> len(bytes(array.array("I", [1,2,3]))) 12 len() returns 3 but the number of bytes written out by sendall() will really be 12... *However*, the right len can be calculated using the memoryview: >>> m = memoryview(array.array("I", [1,2,3])) >>> len(m) * m.itemsize 12 (without actually converting to a bytes object, so all this is cheap even for very large buffers) > hasattr("lol", '__next__') == False, even though strings are Iterable FYI, magic methods are looked up on the class, not on the instance. That’s why ABCs are the right thing to use here. So, reading all your comments, I gather that my proposed patch for client.py which is try: self.sock.sendall(data) except TypeError: if isinstance(data, collections.Iterable): for d in t: self.sock.sendall(d) else: raise TypeError("data should be a bytes-like object or an iterable, got %r" % type(it)) is ok, because it avoids using hasattr to test for Iterable and avoids isinstance() to check for specific types (str, bytes...) but instead uses exceptions (as pitrou suggested)? if that is ok with everyone, I just need to work more on request.py to remove the hasattr; I'll probably use the memoryview solution suggested by pitrou. just to confirm: we WANT array.array("I", [1,2,3]) to have a content-length of 12, right? > just to confirm: we WANT array.array("I", [1,2,3]) to have a content- > length of 12, right? Yes, since it will emit 12 bytes in the body (you could actually have a test for it). Give a try to this minor variation of the patch with tests added and let me know your review comments. Senthil: + try: + self.sock.sendall(data) Indentation problem here. + if isinstance(data,str): + content_length = len(data) I'm not sure I understand. What does sending an unicode string mean? + # Check iterable body support + def iterable_body(): + yield "one" + yield "two" + yield "three" Iterables of strings? this doesn't seem supported in the patch. Also, it would be nice if the tests checked that the sent data is as expected. orsenthil: Hi, i don't quite understand why iter() needs to be called explicitly on data? As I understand it, if data is an iterable then you can use a for loop on it directly. attaching new patch. this implements the memoryview solution suggested by pitrou. but it does contain this thing: if not request.has_header('Content-length'): if (not hasattr(data, '__read__') and isinstance(data, collections.Iterable)): print(data,"is an iterable") try: m = memoryview(data) print(m.itemsize * len(m)) request.add_unredirected_header( 'Content-length', '%d' % (len(m) * m.itemsize)) except TypeError: try: request.add_unredirected_header( 'Content-length', '%d' % len(data)) except TypeError: raise ValueError( "No Content-Length specified for iterable body") why is it so nested? because data can support 3 different interfaces: 1) Buffer interface, in that case use memoryview to count bytes 2) Can call len but not buffer: assume len == #bytes 3) Iterable but cannot call len or memoryview: raise ValueError I hope there is a simpler way... > if not request.has_header('Content-length'): > if (not hasattr(data, '__read__') and What is __read__ supposed to be? > 2) Can call len but not buffer: assume len == #bytes Why do you need it at all? On Wed, Dec 01, 2010 at 10:06:25AM +0000, Antoine Pitrou wrote: > + try: > + self.sock.sendall(data) > > Indentation problem here. I could notice it now. Shall fix it. > > + if isinstance(data,str): > + content_length = len(data) > > I'm not sure I understand. What does sending an unicode string mean? That's my mistake with understanding, I just realized (again) that socket.send, socket.sendall does only bytes. And we don't encode the unicode code string to send as bytes too. > + def iterable_body(): > + yield "one" > + yield "two" > + yield "three" > > Iterables of strings? this doesn't seem supported in the patch. It should be: + yield b"one" + yield b"two" + yield b"three" On Wed, Dec 01, 2010 at 02:56:56PM +0000, Xuanji Li wrote: > orsenthil: Hi, i don't quite understand why iter() needs to be > called explicitly on data? As I understand it, if data is an > iterable then you can use a for loop on it directly. > The reasoning I followed was, data is an "Iterable" (a collection) and you get an "Iterator" by passing via iter(). And you send the items by looping over the iterator. Honestly, I am not sure if iter is needed here too. I thought it was not needed too, when you determine it is an Iterable and iterate over it using the for loop. But I kept the iter() method just to create an instance and send it. Antoine, which would be the correct/ better? On Wed, Dec 01, 2010 at 05:08:26PM +0000, Antoine Pitrou wrote: > Antoine Pitrou <pitrou@free.fr> added the comment: > > if not request.has_header('Content-length'): > > if (not hasattr(data, '__read__') and > > What is __read__ supposed to be? I don't think is required. The previous 2.x version patch was doing this just to ensure that it is not file object and then it is a sequence. (I could not understand why) Now, when you determine that the sequence can be bytes, bytearray or array.array then testing for memory view is enough. File objects without Content-Length would raise an Exception too. Not required. For the same reason as above. On Thu, Dec 02, 2010 at 02:19:10AM +0000, Senthil Kumaran wrote: > On Wed, Dec 01, 2010 at 10:06:25AM +0000, Antoine Pitrou wrote: > > + try: > > + self.sock.sendall(data) > > > > Indentation problem here. > > I could notice it now. Shall fix it. Sorry, there was not any, if you viewed the patch online, it looked as if there was, but not really. (I was surprised as how it could be and not be caught by tests in the first place). > > 2) Can call len but not buffer: assume len == #bytes > Why do you need it at all? Hmm, I'm looking at the the tests in urllib2 that fail if we omit this... in test_urllib2 there are tests that do this: req = Request("", "") and they expect Content-Length to be set to 0... Updated patch after correcting the mistake (bytes vs str) in the previous one. On Thu, Dec 02, 2010 at 03:08:55AM +0000, Xuanji Li wrote: > > req = Request("", "") That should be: > req = Request("", b"") I updated some of those in the latest updated patch. And my version too... Actually I don't think you can go around changing test_urllib2.py, they are after all regression tests... and surely some users will send "" as data. My patch handles the case of 0-length data specially, removing the need for 2) Can call len but not buffer: assume len == #bytes On Thu, Dec 02, 2010 at 03:16:53AM +0000, Xuanji Li wrote: > And my version too... > + if hasattr(data, '__len__') and not len(data): + request.add_unredirected_header('Content-length', '0') This is very special case. It should not be so. There was wrong examples in the test_urllib2 which I just corrected. Expect for the difference in (it = iter(data) - Which I am seeking some advice too). Rest of the things in both patches are same. Thank you. On Thu, Dec 02, 2010 at 03:20:05AM +0000, Xuanji Li wrote: > Actually I don't think you can go around changing test_urllib2.py, > they are after all regression tests... and surely some users will > send "" as data. > Think about it this way. In py3k, socket.send can handle only bytes, not string. So sending "" as data to the socket.send is wrong. thought of a better way, we can check if data is true; this will cover "" and b"". this is in issue_3243_py3k_7.patch Glaring at my mistakes. > There was wrong examples in the test_urllib2 which I just corrected. There were.. > Expect for the difference in (it = iter(data) - Which I am seeking Except for ... >> What is __read__ supposed to be? > I don't think is required. The point is that Python does not define a __read__ magic method. Only read exists, on file objects. eric: sorry, that has been fixed in issue_3243_py3k_7.patch This is committed in r87399. Documentation and NEWS is added. Thanks for the patch and review comments. Hello, sorry for commenting on a closed issue... but I think the documentation change is incorrect. In urllib.request.rst, it says data is a string. However as seen in the changes to test_urllib2.py, data must be a bytes object rather than a string object. I think we should reopen this issue and change the documentation. Thanks! Also, the patch for request.py contains a debug statement, print(data) Good catch, fixed in r87400. Also, I am not familiar with the backward-comparability requirements of py3k, but orsenthil's patch will break py3k code that relies on data being a string, shouldn't this be mentioned somewhere? Finally, I do not understand why my proposed change, which is to add + if not data: + request.add_unredirected_header('Content-length', '0') so that code that relies on being able to pass a blank string as data (for instance, the code in test_urllib2.py) is still able to do so. Hmm, indeed: Senthil, could data be a string in earlier versions? If yes, the code should be changed to still allow that. (But after beta2 please, it's already tagged.) Raising priority so that this gets sorted out before final. Xuanji, Thanks for the comments on 'data' being bytes. I had just cared to add the feature information. I think that data detail should have been updated too. I think for your other two questions, we discussed it msg123051 - socket in py3k handles only bytes, sending string was wrong and test_urllib2 had the mistake in sending zero length strings which weren't detected. However, let me see if we have to accommodate those "very special case" where data can be a zero length string just to accommodate the mistake it was present in the earlier version. A mistake with Content-Length in the previous commit resolved in revision 87469. Anything left to do here, Senthil? Hi Georg, In the previous comment, I had written that 'let me see if we have to accommodate those "very special case" where data can be a zero length string just to accommodate the mistake it was present in the earlier version.' More, I think about it, the more it seems to me that accommodating that special wrong case is not required. The decision boils down to this. 1. In py3k, data for POST should be bytes. 2. But urllib.request had a 'bug/hole' that when a zero length string was passed as a data, it did not raise an exception. There were cases in test_urllib2 where zero length string was passed. I argue that it was more of a mistake than, what we actually wanted to test it. Because there is NO practical scenario where Zero length data as a POST is useful. 3. Now, with the introduction of this feature requested in this issue, this zero length string would raise an Exception and would demand that even if it is zero length, please send it as bytes. IMO, this is correct behavior and we need not accommodate the previous one. So, I would recommend closing this bug as Fixed without further change. At most, a NEWS item can be added to explain point 2. Yes, I think we should close it. Thanks for the note. I shall some details to the NEWS entry before the release. Closing this report. This patch was opened for 2.7 but never applied there ? This causes a bug with requests HTTP library (and others as well as httplib) when you want to send an iterable object as POST data (with a non-chunked way), it works in Python 3 but not 2, and this effects behaviour and performance...
https://bugs.python.org/issue3243
CC-MAIN-2021-31
refinedweb
3,377
67.45
Originally posted on towardsdatascience. Using YFinance and Plotly libraries for Stock Data Analysis In this article, I will explain to you how you can use YFinance a python library aimed to solve the problem of downloading stock data by offering a reliable, threaded, and Pythonic way to download historical market data from Yahoo! finance. In the later part, we will see how we can use this data to plot different visually appealing and highly interactive financial charts using Plotly a python library. Plotly a Python library is an interactive, open-source plotting library that supports over 40 unique chart types covering a wide range of statistical, financial, geographic, scientific, and 3-dimensional use-cases. Let’s Get Started. Initially, we will start by installing the YFinace library which we will use to download the stock data and see some of its features. Installing YFinance Run the command given below in command prompt to install yfinance using pip. pip install yfinance Exploring YFinance Library in Jupyter Notebook Let’s start by importing the library and downloading the stock data. Here the stock ticker I am using is HINDPETRO.NS which is Hindustan Petroleum Corporation, you can choose any stock to analyze, just replace the stock ticker with your stock’s ticker. #importing Library import yfinance as yf#setting the ticker hindpetro = yf.Ticker("HINDPETRO.NS")#Display stock information hindpetro.info Now let us explore some functions that YFinance Library provides. This is just a small example there is much more, that you can explore here. # Dsiplay all the actions taken in the lifetime of the stock i.e # dividends and splits with the dates when they are providedhindpetro.actions Similarly, you can use the following given below commands to display the look at the stock dividends and stock split separately. #Display Dividends hindpetro.dividends#Display Splits hindpetro.splits Now let us download the data into a data frame and display it. df = hindpetro.history(period="max") df For performing further operations we need to reset the index of the data frame and covert the respective columns to float datatype. Below given commands will solve our purpose. #Reseting the index df = df.reset_index()#Converting the datatype to float for i in ['Open', 'High', 'Close', 'Low']: df[i] = df[i].astype('float64') After this, let us start with the visualization part. For this first, we will need to install Plotly. Installing Plotly pip install plotly Creating a Line chart using Plotly Graph_objects with Range slider and button A line chart is highly used for time series analysis, for viewing the stock trend over a time period. Here I will explain to you how you can create an interactive line chart using Plotly. The commands below will create a line chart of the stock data stored in the data frame over the maximum time period. The code also includes the lines for creating buttons that can be selected to display a line chart for particular time periods. import plotly.graph_objects as go import pandas as pdfig = go.Figure([go.Scatter(x=df['Date'], y=df['High'])])fig.update_xaxes( rangeslider_visible=True, rangeselector=dict( buttons=list([ dict(count=1, label="1m", step="month", stepmode="backward"), dict(count=6, label="6m", step="month", stepmode="backward"), dict(count=1, label="YTD", step="year", stepmode="todate"), dict(count=1, label="1y", step="year", stepmode="backward"), dict(step="all") ]) ) ) fig.show() Creating OHLC(Open, High, Low, Close) Chart An OHLC chart is a type of bar chart that shows open, high, low, and closing prices for each period. OHLC charts are useful since they show the four major data points over a period, with the closing price being considered the most important by many traders. The code given below will create an OHLC chart with range selector. Creating a candlestick chart with the range slider Candlestick charts are used by traders to determine possible price movements based on past patterns. Candlesticks are useful when trading as they show four price points (open, close, high, and low) throughout the period of time the trader specifies. Creating an area chart An area chart or area graph displays graphically quantitative data. It is based on the line chart. The area between axis and line is commonly emphasized with colors, textures, and hatchings. The code given below will create an area chart of the stock data. All these charts are created using Plotly so that you can interact with the charts. All the charts mentioned above are the main charts that are used for financial analysis. Conclusions In this article, we started with downloading the stock data and performing different operations/functions using YFinance. After that, we plotted different financial charts using Plotly which are used for financial/Stock Data Analysis. Source: towardsdatascience
https://learningactors.com/downloading-stock-data-and-representing-it-visually/
CC-MAIN-2021-43
refinedweb
789
55.24
I’ve been playing around with UPBGE recently and have been trying to get a render to texture setup going in the most recent version. I’ve read through the bge.texture documentation but I’m not sure how to make it work since this version doesn’t really use the texture slot system anymore. Otherwise, I’m trying to use bge.texture.ImageRender (scene, camera, width, height, samples, hdr) ok got it working! this is definitely not the best way to do it but it does the job for me so far so I’ll leave it here. import bge scene = bge.logic.getCurrentScene() camera_obj = scene.objects["scalecam"] renderplane = scene.objects["downscaled"] texChannel = 0 texture_object = bge.texture.Texture(renderplane, 0, texChannel) texture_object.source = bge.texture.ImageRender(scene, camera_obj, 128, 128) def update(self): texture_object.refresh(True) what are you going to use this for? something really silly haha I couldn’t figure my way around writing glsl filters for blender, and all I wanted to do was create my own pixelate filter since the old one that someone else wrote didn’t do it for me. my horrific solution is to create a render texture at a really low resolution and point the main game camera at it. It actually works a lot better than I thought it would and now I want to see if I can try and do some dynamic resolution stuff since this now comes with the benefit of rendering the game itself at a lower resolution. i can see you render at resolution 128 x 128 in you script, is that not a little low considered that most old games back in the day ran at resolution 320 x 200. that was just for testing! I’ve increased it since. I think there is a example in python component templates - video utils
https://blenderartists.org/t/render-to-texture-upbge-3-0/1302946
CC-MAIN-2021-25
refinedweb
308
65.73
Details Description Currently the zookeeper seems to be exporting symbols not in the api. An example of this seems to be the symbol hash, which interferes with me using memcached and zookeeper in the same program. Issue Links - relates to ZOOKEEPER-295 prevent multiple namespace pollution by C API - Open Activity - All - Work Log - History - Activity - Transitions alex, do you plan to upload a patch for this? Bummer – +1 on fixing this for 3.3.0. Alex it would be great if you could provide a patch given you can verify and also are on the cusp of the issue. I wasn't planning on it, as I a not familiar with the code base, but I will ask my boss if I can allocate time towards it. On Dec 1, 2009 4:29pm, "Mahadev konar (JIRA)" <jira@apache.org> wrote: Looks like I can't get it scheduled, can someone else write a patch? On Dec 2, 2009 9:50am, "Alex Newman (JIRA)" <jira@apache.org> wrote: No worries, we just don't want to dup the work. thanks! Mahadev has been working on a patch for this. checkout this page I found recently, very useful, in particular the section detailing options. I suggest we move as much as possible to static and then use the prioritized options listed in this paper to resolve the rest: this patch fixes the issue by using libtool -symbols-export-regex. I confirmed by using objdump -T on the .so libraries to see what symbols have been exported. I will also check it on hudson machines. checked objdump -T on hudson machines, it works!.... +1 nice patch. simple. I just committed this. -1 overall. Here are the results of testing the latest attachment against trunk revision 922. From a developer, "the symbol was named hash, but basically they should work with the whitelist of functions in their zookeeper.h"
https://issues.apache.org/jira/browse/ZOOKEEPER-604?focusedCommentId=12803411&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
CC-MAIN-2015-48
refinedweb
316
73.88
Erik, As far as I know, the column filtering happens in TableInputFormatBase. We can use setInputColumns to assign the column we want to return. And then TableInputFormatBase will start a scanner for the column. Yes, we can use "age" as family and each age value as a column. But can it avoid reading all rows like the following code does? public void map(ImmutableBytesWritable row, RowResult value, OutputCollector<Text,Text> output, @SuppressWarnings("unused") Reporter reporter) throws IOException { Cell cell = value.get("age:30".getBytes()); if (cell==null) { return; } ... } Erik Holstad wrote: > > Hi Tigertail! > I have written some MR jobs earlier but nothing fancy like implementing > your > own filter like > you, but what I do know it that you can specify the columns that you want > to > read as the > input to the maptask. But since I'm not sure how that filter process is > handled internally I > can say if it reads in all the columns and than filter them out or how it > actually does it, please > let me know how it works, you people out there that have this knowledge > :). > > But you could try to have a column family age: and than have 1 column for > every age that you > want to be able to specify, for example age:30 or something, so you don't > have to look at the > value of the column, but rather using the column itself as the key. > > Hope that it helped you a little but, and please let me know what kind of > results that you come up with. > > Regards Erik > > On Thu, Dec 18, 2008 at 9:26 AM, tigertail <tyczjs@yahoo.com> wrote: > >> >> Thanks Erik, >> >> What I want is either by row key values, or by a specific value in a >> column, >> to quickly return a small subset without reading all records into Mapper. >> So >> I actually have two questions :) >> >> For the column-based search, for example, I have 1 billion people records >> in >> the table, the row key is the "name", and there is an "age" column. Now I >> want to find the records with age=30. How can I avoid to read every >> record >> into mapper and then filter the output? >> >> For searching by row key values, let's suppose I have 1 million people's >> names. Is there a more efficient way than running 1 million times >> table.getRow(name), in case the "name" strings are randomly distributed >> (and >> hence it is useless to write a new getSplits)? >> >> >> Did you try to only put that column in there for the rows that you >> want >> >> to >> >> get and use that as an input >> >> to the MR? >> >> I am not sure I get you there. I can use >> TableInputFormatBase.setInputColums >> in my program to only return the "age' column, but still, I need to read >> every row from the table into mapper. Or my understanding is wrong, can >> you >> give more details on your thought? >> >> Thanks again. >> >> >> >> Erik Holstad wrote: >> > >> > Hi Tigertail! >> > Not sure if I understand you original problem correct, but it seemed to >> me >> > that you wanted to just get >> > the rows with the value 1 in a column, right? >> > >> > Did you try to only put that column in there for the rows that you want >> to >> > get and use that as an input >> > to the MR? >> > >> > I haven't timed my MR jobs with this approach so I'm not sure how it is >> > handled internally, but maybe >> > it is worth giving it a try. >> > >> > Regards Erik >> > >> > On Wed, Dec 17, 2008 at 8:37 PM, tigertail <tyczjs@yahoo.com> wrote: >> > >> >> >> >> Hi St. Ack, >> >> >> >> Thanks for your input. I ran 32 map tasks (I have 8 boxes with each 4 >> >> CPUs). >> >> Suppose the 1M row keys are known beforehand and saved in an file, I >> just >> >> read each key into a mapper and use table.getRow(key) to get the >> record. >> >> I >> >> also tried to increase the # of map tasks, but it did not improve the >> >> performance. Actually, even worse. Many tasks are failed/killed with >> sth >> >> like "no response in 600 seconds." >> >> >> >> >> >> stack-3 wrote: >> >> > >> >> > For A2. below, how many map tasks? How did you split the 1M you >> wanted >> >> > to fetch? How many of them ran concurrently? >> >> > St.Ack >> >> > >> >> > >> >> > tigertail wrote: >> >> >> Hi, can anybody help? Hopefully the following can be helpful to >> make >> >> my >> >> >> question clear if it was not in my last post. >> >> >> >> >> >> A1. I created a table in HBase and then I inserted 10 million >> records >> >> >> into >> >> >> the table. >> >> >> A2. I ran a M/R program with totally 10 million "get by rowkey" >> >> operation >> >> >> to >> >> >> read the 10M records out and it took about 3 hours to finish. >> >> >> A3. I also ran a M/R program which used TableMap to read the 10M >> >> records >> >> >> out >> >> >> and it just took 12 minutes. >> >> >> >> >> >> Now suppose I only need to read 1 million records whose row keys >> are >> >> >> known >> >> >> beforehand (and let's suppose the worst case the 1M records are >> evenly >> >> >> distributed in the 10M records). >> >> >> >> >> >> S1. I can use 1M "get by rowkey". But it is slow. >> >> >> S2. I can also simply use TableMap and only output the 10M records >> in >> >> the >> >> >> map function but it actually read the whole table. >> >> >> >> >> >> Q1. Is there some more efficient way to read the 1M records, >> WITHOUT >> >> >> PASSING >> >> >> THOUGH THE WHOLE TABLE? >> >> >> >> >> >> How about if I have 1 billion records in an HBase table and I only >> >> need >> >> >> to >> >> >> read 1 million records in the following two scenarios. >> >> >> >> >> >> Q2. suppose their row keys are known beforehand >> >> >> Q3. or suppose these 1 million records have the same value on a >> column >> >> >> >> >> >> Any input would be greatly appreciated. Thank you so much! >> >> >> >> >> >> >> >> >> tigertail wrote: >> >> >> >> >> >>> For example, I have a HBase table with 1 billion records. Each >> record >> >> >>> has >> >> >>> a column named 'f1:testcol'. And I want to only get the records >> with >> >> >>> 'f1:testcol'=0 as the input to my map function. Suppose there are >> 1 >> >> >>> million such records, I would expect this would be must faster >> than >> I >> >> >>> get >> >> >>> all 1 billion records into my map function and then do condition >> >> check. >> >> >>> >> >> >>> By searching on this board and HBase documents, I tried to >> implement >> >> my >> >> >>> own subclass of TableInputFormat and set a ColumnValueFilter in >> >> >>> configure >> >> >>> method. >> >> >>> >> >> >>> public class TableInputFilterFormat extends TableInputFormat >> >> implements >> >> >>> JobConfigurable { >> >> >>> private final Log LOG = >> >> >>> LogFactory.getLog(TableInputFilterFormat.class); >> >> >>> >> >> >>> public static final String FILTER_LIST = >> >> "hbase.mapred.tablefilters"; >> >> >>> >> >> >>> public void configure(JobConf job) { >> >> >>> Path[] tableNames = FileInputFormat.getInputPaths(job); >> >> >>> >> >> >>> String colArg = job.get(COLUMN_LIST); >> >> >>> String[] colNames = colArg.split(" "); >> >> >>> byte [][] m_cols = new byte[colNames.length][]; >> >> >>> for (int i = 0; i < m_cols.length; i++) { >> >> >>> m_cols[i] = Bytes.toBytes(colNames[i]); >> >> >>> } >> >> >>> setInputColums(m_cols); >> >> >>> >> >> >>> ColumnValueFilter filter = new >> >> >>> >> >> >> ColumnValueFilter(Bytes.toBytes("f1:testcol"),ColumnValueFilter.CompareOp.EQUAL, >> >> >>> Bytes.toBytes("0")); >> >> >>> setRowFilter(filter); >> >> >>> >> >> >>> try { >> >> >>> setHTable(new HTable(new HBaseConfiguration(job), >> >> >>> tableNames[0].getName())); >> >> >>> } catch (Exception e) { >> >> >>> LOG.error(e); >> >> >>> } >> >> >>> } >> >> >>> } >> >> >>> >> >> >>> However, The M/R job with RowFilter is much slower than the M/R >> job >> >> w/o >> >> >>> RowFilter. During the process many tasked are failed with sth like >> >> "Task >> >> >>> attempt_200812091733_0063_m_000019_1 failed to report status for >> 604 >> >> >>> seconds. Killing!". I am wondering if RowFilter can really >> decrease >> >> the >> >> >>> record feeding from 1 billion to 1 million? If it cannot, is there >> >> any >> >> >>> other method to address this issue? >> >> >>> >> >> >>> I am using Hadoop 0.18.2 and HBase 0.18.1. >> >> >>> >> >> >>> Thank you so much in advance! >> >> >>> >> >> >>> >> >> >>> >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> >> >> Sent from the HBase User mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> >> Sent from the HBase User mailing list archive at Nabble.com. >> >> > > -- View this message in context: Sent from the HBase User mailing list archive at Nabble.com.
http://mail-archives.us.apache.org/mod_mbox/hbase-user/200812.mbox/%3C21079684.post@talk.nabble.com%3E
CC-MAIN-2020-10
refinedweb
1,269
73.68
Building an SQL Statement The reporting interface has features that can help you build SQL statements for reports that run against the SQL Server views. Note While the features of the Report SQL Statement dialog box can assist you in building an SQL statement, the interface does not automatically create complete SQL statements, nor does it validate them. However, SMS 2003 does perform limited syntax checks of the SQL statement. When you initially open the Report SQL Statement dialog box for a new report, the SQL statement box contains the following sample SQL statement: SELECT * FROM V_R_System where V_R_System.Name0 = 'computer_name' A SELECT statement specifies the columns to be returned by the statement. It retrieves the data from the SQL Server views and presents it to the user in one or more result sets. Note SQL statements are not case-sensitive. You can leave the asterisk (*) that follows the SELECT keyword to return all columns or replace it with the specific column names that you want the report to return (for example, User_Domain0 or User_Name0). The FROM clause indicates the SQL Server view from which the data is retrieved and always follows the SELECT keyword. For more information, see the "SQL Server Views" section earlier in this chapter. You can create multiple SELECT statements within an SQL statement for a report, which returns multiple result sets. The following is an example: SELECT * FROM v_StatMsgModuleNames SELECT * FROM v_SoftwareProduct Note If you use multiple SELECT statements for a report, you should test each statement individually to ensure that it runs successfully. When a report fails, it returns an error code indicating the failure. When you use multiple SELECT statements, they are treated as a single request; if any statement fails, only one error code is returned and the report fails. The Report SQL Statement dialog box has controls that you can use to help you build SQL statements. You can use the Views and Columns lists to insert view and column names and the Values button to insert column values into the SQL statement. Note The Report SQL Statement dialog box controls insert data in the SQL statement at the position of the cursor. When you first open the Report SQL Statement dialog box, the cursor is positioned at the beginning of the statement. You should position the cursor before inserting data. To insert a view name In the SQL statement box, position your cursor in the SQL statement where you want to insert a view name. In the Views list, click a view name, and then click Insert. To insert a column name In the SQL statement box, position the cursor in the SQL statement where you want to insert a column name. In the Views list, select the view that contains the column or columns that you want to add. In the Columns list, click a column name, and then click Insert. To insert a column value In the SQL statement box, position your cursor in the SQL statement where you want to insert a column value. In the Columns list, select a column, and then click Values. In the Values shown area, click the Previous and Next buttons to scroll through the values. To apply a filter to limit the number of values that is returned, click Set. In the Set Filter dialog box, specify the filter criterion, and then click OK. In the Values list, click the value that you want to add, and then click OK. For more information about using the Report SQL Statement dialog box, see SMS Help. SQL keywords and clauses The following are some other commonly used SQL keywords and clauses that you might find helpful for creating reports: AS Specifies an alias for a column name. An alias replaces the column display name in the result set. Therefore, when displaying the result set, Report Viewer uses aliases as the column headings, rather than the default column display names. You can uses aliases to create column headings that might be more understandable to report users. In the following example, User_Name0 is assigned the display name User Name. You can also use an alias in place of the column name in an ORDER BY clause, but not in a WHERE clause. WHERE Specifies a search condition that restricts the rows that are returned. This condition can be based on a specified value from one of the selected columns, as compared to a variable or a string. ORDER BY Specifies that the result set be sorted in ascending sequence based on the value in a specified column. In the following example, the SQL statement sorts the result set by data in the column User Name, and then by the data in the column Comp Name. COMPUTE Generates totals that appear as additional summary columns at the end of the result set. Using a COMPUTE clause returns a report with multiple result sets. The following sample statement provides examples of these keywords and clauses. SELECT User?Name0 AS 'User Name', Name0 AS 'Comp Name' FROM v_R_System WHERE User?Name0 LIKE @variable2 ORDER BY User?Name0, Name0 COMPUTE COUNT (User?Name0) BY User?Name0, Name0 SQL statement variables You use variables to integrate report prompts into the SQL statement for a report. Report prompts provide a means for the user to enter a dynamic value each time that the user runs a report. Report Viewer uses that value as a variable value in the SQL statement to target or limit the data that is returned. For example, in a report that returns data about a client, the user might be prompted to enter a computer name. When you create a report prompt, you assign it a prompt name. To integrate the prompt into the SQL statement, you define the prompt name as a variable at the appropriate place in your SQL statement. You can create more than one prompt, each with its own variable; however, the name for each prompt must be unique within a report. For more information, see the "Integrating Report Prompts" section earlier in this chapter. Converting Coordinated Universal Time (Greenwich Mean Time) to local time By default, time data is stored in the SMS database in the local time of the system that generated the data. However, some time data is stored in Coordinated Universal Time, specifically status messages stored in the v_StatusMessage and v_ClientAdvertisementStatus views and in the software metering data and summarization views. In addition, some time data might be stored in Coordinated Universal Time, depending on which time format that you selected when creating the data, such as the ExpirationTime in the v_Advertisements view. When you create an SQL statement for a report that includes a column with Coordinated Universal Time data, the data appears in the report in Coordinated Universal Time. If you prefer to have local time appear in the report, you can use the implicit variable @__timezoneofffset in your SQL statement. When you use this variable, SMS returns the offset from Coordinated Universal Time in seconds. To convert to local time, use the following syntax: DATEADD(ss,@__timezoneoffset,< time column name>). SQL statement examples The following examples show how to use the SQL Server views to create useful SQL statements for reports: To return the list of all available views, which can be helpful for creating other reports, use the following statement: SELECT Type, ViewName AS 'View Name' FROM v_SchemaViews To return the list of available inventory views, use the following statement: SELECT Type, ViewName AS 'View Name' FROM v_SchemaViews WHERE Type='Inventory' To return the display name of resources based on the resource type number (5 = System), use the following statement: SELECT DisplayName AS 'Display Name' FROM v_ResourceMap WHERE ResourceType=5 To determine discovery properties for a particular resource type, use the following statement: SELECT * FROM v_ResourceAttributeMap WHERE ResourceType=5 To list the inventory groups for a particular resource type, use the following statement: SELECT InvClassName FROM v_GroupMap WHERE ResourceType=5 For More Information Did you find this information useful? Please send your suggestions and comments about the documentation to smsdocs@microsoft.com.
https://technet.microsoft.com/en-us/library/cc180274.aspx
CC-MAIN-2015-35
refinedweb
1,347
59.13
Using the AWS Elastic Beanstalk Java SE Platform You can use AWS Elastic Beanstalk to run, build, and configure Java web applications. Note Elastic Beanstalk provides two Java SE configurations: Java 8 and Java 7. See supported platforms for details. To configure the processes that run on the server instances in your environment, including Java virtual machine (JVM) container options like the amount of memory assigned to each, include an optional Procfile in your source bundle. A Procfile is required if you have more than one JAR in your source bundle root. If you only have one JAR file, Elastic Beanstalk will run it with java -jar . application_name.jar. Elastic Beanstalk Java SE platform configurations include an nginx server that acts as a reverse proxy, serving cached static content and passing requests to your application. The Java SE platform supports an extensible configuration option namespace that lets you define options that specify paths in an application that contains static files. This allows you to include a folder of static content in your source bundle and tell nginx to serve it directly to reduce load on your application. Topics Configuring the Application Process with a Procfile If you have more than one JAR file in the root of your application source bundle, you must include a Procfile file that tells Elastic Beanstalk which JAR(s) to run. You can also include a Procfile file for a single JAR application to configure the Java virtual machine (JVM) that runs your application. You must save the Procfile in your source bundle root. The file name is case sensitive. Format the Procfile as follows: a process name, followed by a colon, followed by a Java command that runs a JAR. Each line in your Procfile must match the following regular expression: ^[A-Za-z0-9_]+:\s*.+$. Procfile web: java -jar server.jar -Xmms:256m cache: java -jar mycache.jar web_foo: java -jar other.jar The command that runs the main JAR in your application must be called web, and it must be the first command listed in your Procfile. The nginx server forwards all HTTP requests that it receives from your environment's load balancer to this application. By default, Elastic Beanstalk configures the nginx proxy to forward requests to your application on port 5000. You can override the default port by setting the PORT system property to the port on which your main application listens. Note The port that your application listens on does not affect the port that the nginx server listens to receive requests from the load balancer. If you use a Procfile to run multiple applications, Elastic Beanstalk expects each additional application to listen on a port 100 higher than the previous one. Elastic Beanstalk sets the PORT variable accessible from within each application to the port that it expects the application to run on. You can access this variable within your application code by calling System.getProperty("PORT"). Note In the preceding example, the web application listens on port 5000, cache listens on port 5100, and web_foo listens on port 5200. web configures its listening port by reading the PORT variable, and adds 100 to that number to determine which port cache is listening on so that it can send it requests.. Elastic Beanstalk assumes that all entries in the Procfile should run at all times and automatically restarts any application defined in the Procfile that terminates. To run commands that will terminate and should not be restarted, use a Buildfile. Building Execution Order When you include multiple types of configuration in your application source bundle, they are executed in the following order. Each step does not begin until the previous step completes. Step 1: commands, filesand packagesdefined in configuration files ( .ebextensions) Step 2: Buildfilecommand Step 3: container_commandsin configuration files ( .ebextensions) Step 4: Procfilecommands (all commands are run simultaneously) For more information on using commands, files, packages and container_commands in configuration files, see Customizing Software on Linux Servers Software Configuration Options: - namespace: aws:elasticbeanstalk:container:java:staticfiles option_name: /public value: public - namespace: aws:elasticbeanstalk:container:java:staticfiles option_name: /images value: img The folders that you map using this namespace must be actual folders in the root of your source bundle. You cannot map a path to a folder in a JAR file. No options are defined in this namespace by default. Config;
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-se-platform.html
CC-MAIN-2016-30
refinedweb
723
52.19
AVS Frequently Asked Questions These questions give answers to Frequently Asked Questions (FAQs) related to the Alexa Voice Service (AVS) and its related SDKs and extensions. - General - Marketing for AVS products - AVS SDKs and Extensions - AVS feature implementation - Smart Home - Web and mobile integration - International - Resources General - Q: How do I get started with AVS? - Start by reading Getting Started with AVS, which details how to call the AVS cloud API from your device. - Q: What components does my product have to have integrate with AVS? - Add AVS to any device with a microphone, a speaker, and an internet connection. Learn more about supported implementations with Audio Hardware Configurations. - Q: What do users access Alexa for? - Alexa includes access to information, music, audiobooks, news, weather, traffic, and more, including any custom skill that you create using the Alexa Skills Kit (ASK). Today, your customers can: - Ask their device all kinds of questions, like math problems or facts about famous people, dates, and places - Stay informed on the news with the Flash Briefing to manage music, shopping lists, To-Do lists and more. - Set timers and alarms. - Control volume, media playback, and manage timers and alarms using the Amazon Alexa app. - Get the latest scores and schedules for your favorite sports teams. Marketing for AVS products Alexa Built-in - Q: What's the Alexa Built-in badging program? - The Alexa Built-in allows qualified products to carry the Alexa Built-in badge on Amazon detail pages, increasing customer confidence in your product and driving higher conversion. Badged products also receive increased visibility within Amazon search results and in Amazon's Alexa Built-in Storefront, benefitting from ongoing programs designed to increase Storefront traffic. Alexa Built-in products are eligible for co-marketing opportunities, such as onsite merchandising, email campaigns, and prominent online storefront positioning. Alexa Built-in badging is also available for inclusion in your product packaging. See the Alexa Built-in product page for more information. - Q: How do I get the Alexa Built-in badge for my product? - To receive an Alexa Built-in badge for your product, complete the security and testing requirements, and submit your product for certification by Amazon. Certification for Alexa Built-in products consists of four tests: Functional, UX evaluation, Music, and Acoustic. If your product meets all testing requirements, it becomes eligible for Alexa Built-in badging. See Alexa Built-in requirements. - Q: How do I launch an Alexa Built-in product with AVS? - Submit your Alexa Built-in device to Amazon for review and certification of media services before commercial distribution. See the Product Testing overview for more information. Certification - Q: What's the certification process for AVS, and where do I find testing guidelines? - The certification process allows eligible products to use Alexa Built-in badging in their branding and marketing. Certification for Alexa Built-in products consists of four tests: Functional, UX evaluation, Music, and Acoustic. If your product meets all testing requirements, it becomes eligible for Alexa Built-in badging. See the Product Testing Overview page for more information. AVS SDKs and Extensions AVS Device SDK - Q: What services and functionalities are available to developers with the Alexa Voice Service (AVS) Device SDK? - The AVS Device SDK provides a C++ (11 or later) interface for the AVS that allows developers to add intelligent voice control to connected products. The SDK is modular and abstracted, providing components to handle discrete functionality such as speech capture, audio processing, and communications. Each SDK component exposes customizable APIs for your AVS integration. The SDK also includes a sample app, which demonstrates interactions with AVS. For more information, view the AVS Device SDK documentation. - Q: Who should use the AVS Device SDK? - The AVS Device SDK is available to all commercial device makers looking to integrate Alexa into their connected products. The SDK is available for Raspberry Pi, macOS, Ubuntu Linux 16.04 LTS, Windows 64-bit, Android, and iOS. - Q: How do developers get updates to the AVS Device SDK? - Amazon publishes updates to the AVS Device SDK to the AVS developer portal and GitHub. Developers registered with the AVS developer portal receive email updates about the SDK. The AVS Device SDK includes release notes with detailed information on new features and bug fixes and the best way to incorporate them into AVS products or projects. - Q: Am I required to use the entire AVS Device SDK to develop device software? - No, you aren't required to use the entire SDK to develop device software. Use the AVS Device SDK either in its entirety or just use the modules that you need for your product. - Q: Does the AVS Device SDK include support for third-party wake word engines, such as Sensory? - Yes. The AVS Device SDK provides the necessary abstractions to make it easy to use any licensed wake word engine, including Sensory. - Q: Does the AVS Device SDK include support for third-party portable is the SDK? - The AVS Device SDK uses C++ 11 and supports all generic Linux distributions. The SDK’s use of C++ 11 is the primary enabler for portability to different platforms, and the SDK also provides an abstracted transport layer to ease the porting to different libraries. The Capability Agent API abstracts the platform-specific code from the SDK. All modules have documented APIs which ease the replacement of these components with custom implementations. Alexa Connect Kit (ACK) - Q: What's the Alexa Connect Kit, and how do I get it? - The Alexa Connect Kit (ACK) enables device makers to connect devices to Alexa without worrying about managing cloud services, writing an Alexa skill, or developing complex networking and security firmware. See the Alexa Connect Kit product page for more information. Alexa Mobile Accessory Kit (AMA) - Q: What's the Alexa Mobile Accessory (AMA) kit, and how do I get it? - The AMA Kit allows any Bluetooth-capable device manufacturer to enable Alexa via a Bluetooth connection through the Alexa mobile app. For more information, see the AMA overview. AVS feature implementation Alexa Flash Briefings - Q: How are Alexa Flash Briefings sent? - Alexa sends Flash Briefings through a SpeechSynthesizer.Speak directive and then plays the audio content via AudioPlayer.Play directives. - Q: Alexa says, "Here is your Flash Briefing from ," but the audio content doesn't play. Why? - The cause of missing audio content depends on the circumstances: - If you're missing audio content from the Alexa mobile app, go to your alexa.amazon.com account, and make sure to have at least one active news source within Settings > Flash Briefing. - If you're missing audio content from your custom AVS implementation, your implementation of AudioPlayer.Playmight not be correct. See the AudioPlayer overview or AudioPlayer API reference for more information. - Another possibility is that you're incorrectly parsing the data from the multipart stream. - Check whether you're sending SpeechStartedand SpeechFinishedevents. Cloud-based wake word verification - Q: What's a "false wake"? - A false wake is any utterance that unintentionally wakes an AVS product. - Q: What do customers experience after my product implements Cloud-Based Wake Word Verification? - Customers see the device initially light up, per the Alexa UX Design Guidelines. In the event of a false wake, the StopCapturedirective instructs the device to close the audio stream and turn off the blue indicator light. Code-based linking - Q: I'm having an issue with code-based linking. Where do I find more information? - See the Code Based Linking guide for information. HTTP - Q: Which HTTP protocol connection does AVS support? - AVS exposes an HTTP/2 endpoint and supports cloud-initiated directives, which allow you to access Alexa capabilities, such as timers and alarms, media transport controls, voice-controlled volume settings, and Amazon Alexa app integration. See Manage an HTTP/2 Connection with AVS for more information. Display cards - Q: Am I required to render all received JSON data ? - You must render all JSON data in line with the UX Design Guidelines and templates to create a consistent user experience across all Alexa products. - Q: Am I required to render every supported Display Card on my AVS product? - Amazon encourages screen-based AVS products to render all available Display Cards, but you're not required to do so. - Q: What's the benefit of implementing Display Cards if my product doesn’t support music? - Even if your product doesn’t support music, there are other Display Card options for screen-based AVS products like to-do list, shopping list, calendar, Q&A and weather. These cards enhance the Alexa experience of your product and add more context to the responses. - Q: What are the screen types supported by Display Cards? - The UX Design Guidelines and templates for TVs and tablets list supported screen types. These two screen types support a wide range of use-cases for different screen sizes and user interactions. - Q: If I build Display Cards and render them on my AVS product, do they appear in the Amazon Alexa app? - The Display Cards that you build for your AVS product don't appear in the Alexa app, but the Alexa app renders similar data in a visual card optimized for the Alexa app. - Q: Are updates to the API, template, or JSON payload be backwards compatible? - The API itself is versioned, and any template, JSON payload, or data updates are backwards compatible. Amazon periodically updates Display Cards for Alexa to support new domains, card templates, and other data. When AVS makes updates, Amazon communicates changes to you through appropriate channels. While Amazon encourages you to take advantage of new capabilities, you're not necessarily required to make changes to your device software as Amazon makes updates. SpeechRecognizer - Q: What my client sends a SpeechRecognizer.Recognizeevent, an HTTP/2 500 status response with the error "…Error reading entity from input stream…" Why? - To troubleshoot, check the following: - Make sure that there aren't any non-UTF-8 characters in your HTTP request. - Make sure that the SynchronizeStateevent and the Recognizeevent contexts have all client component states. See the Recognize reference or the Error reading entity Forum issue for more information. Server-initiated messages - Q: What server-initiated messages does AVS to clients? - The AVS server sends some directives from the Alerts namespace and interactions from the Alexa app to AVS clients. SSL configuration - Q: I'm having an issue with my SSL configuration file. Is there a reference available? - See here for a reference ssl.cnf file, replacing country, state, locality with your respective info. SiriusXM - Q: What audio format is my device required to support to enable SiriusXM? -. Am I required to re-certify my product to support SiriusXM? - Yes, you must submit your device for certification to SiriusXM. Contact your Amazon representative for certification support or submit a request for certification here. Smart Home - Q: Which Smart Home devices does AVS support? - For a list of supported Smart Home products, see Alexa Smart Home. For more details about building your own skill, see Smart Home Skill API. - Q: Does AVS support a Alexa Built-in device discovering and controlling an IoT device, such as a Smart Home lightbulb? - No. AVS supports cloud-based discovery. A custom Alexa Built-in device can discover devices via cloud-based discovery, but Smart Home device control doesn't work without an Echo device. If you discover the Smart Home device using an Echo, you can control it using AVS. For more information, see Connect Smart Home Devices to Alexa or Forum Issue 45662. Web and mobile integration - Q: How do I integrate AVS into websites and mobile applications? - See the AVS API overview for the AVS capabilities and requirements. Consider leveraging the AVS Device SDK as a reference implementation. International - Q: Do AVS features vary by region? - Yes. AVS offers language and region-specific services to developers. See a high-level feature matrix on the AVS for International page. - Q: Is sample code available that demonstrates support for localization? - Yes, the AVS Device SDK includes support for localization. Locale is configurable in the Sample App through the AlexaClientSDKConfig.jsonfile. - Q: Do the code changes retrieve and replace the AVS endpoint, or more changes involved? - Besides updating endpoints, if you want to allow the user to change their language, support the new SettingsUpdatedevent. See Preparing for Internationalization. - Q: What happens when a user travels to an unsupported region with an AVS device registered in the UK, Germany, India, Japan, or US? - If a user registered their product in a supported country or region, the device will work in unsupported regions. However, the device will only be able to access localized content from the location where the user registered the device. - Q: Are languages restricted by endpoint? - No. US English, UK English, and German are available on both US and EU AVS endpoints. - Q: Are users located outside of supported locales permitted to use the service? - No, make sure to implement logic enforce supported locale restrictions. Further, the Amazon Alexa mobile app is unavailable in unsupported regions. -.
https://developer.amazon.com/de-DE/docs/alexa/alexa-voice-service/faqs.html
CC-MAIN-2020-45
refinedweb
2,170
56.66
Kivy - Open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. Cross platform, TUIO. A multi-touch mouse simulator is included. Business Friendly Kivy is 100% free to use, under an MIT license (starting from 1.7.2) and LGPL 3 for the previous versions. The toolkit is professionally developed, backed and used. You can use it in a commercial product. The framework is stable and has a well documented API, plus a programming guide to help you get started. GPU Accelerated The graphics engine is built over OpenGL ES 2, using a modern and fast graphics pipeline. The toolkit comes with more than 20 widgets, all highly extensible. Many parts are written in C using Cython, and tested with regression tests. Become a sponsor ! Usage example See how easy it is to create a simple Hello World application that shows an actionable button: from kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): return Button(text='Hello World') TestApp().run() Result Be social ! Download The current version is 1.11.0, released on June 1st, 2019. Read the Changelog. Installation instructions can be found here. Android Demo examples are published on Google Play: Create your own APK by following the documentation on Packaging for Android IOS Read the documentation on Packaging for IOS Source code git clone Take a look at our guide toinstallation of the development version. Documentation - Getting started with Kivy - API Reference - Or see the Wiki for a list of projects, snippets and more Community Support - Report a bug or request a feature in our issue tracker - Ask your questions on the Kivy users forums - Or send an email to kivy-users@googlegroups.com You can also try to contact us on Discord (online chat), but make sure to read the Discord rules before joining. Connect to Discord Licenses The Kivy logo was made by Vincent Autin. The logo is placed under All the screenshots on the website that came - Akshay AroraHe is a freelance developer. He is from India. On IRC, he's qua-non. - He is a software. - Linux geek and open source addict, he works as a software architect and lives in Spain. On IRC, he's AndreMiras. - (hansent) - Christopher Denter (dennda) - Edwin Marshall (aspidites) - Jeff Pittman (geojeff) - Brian Knapp (knappador) - Ryan Pessa (kived) - Ben Rousch (brousch) - Jacob Kovac (kovak) - Armin Sebastian (dessant) - Thomas-Karl Pietrowski (thopiekar) - Peter Badida (KeyWeeUsr) - Special thanks - Mark Hembrow, who was one of our first sponsor, by giving us a Mac Mini. Which was) 15 April 2017 - Robert Niederreiter Meetup Innsbruck, Austria NIU en Python: Kivy (Starting at 2:28:00 in the video) 28 November 2011, Gabriel Pettier La Cantine in Paris, France Spaß mit Natural User Interfaces und Python October 2011 - Ernesto Rico Schmidt PyCon DE 2011
https://kivy.org/index.html
CC-MAIN-2020-34
refinedweb
479
65.42
CPSC 124, Winter 1998 Sample Answers to Lab 9 This page contains sample answers to the exercises from Lab #9 in CPSC 124: Introductory Programming, Winter 1998. See the information page for that course for more information. Exercise 1: The list can be thought of as divided into two parts, the sorted part and the unsorted part. In each phase, the first number in the unsorted part is inserted into the sorted part of the list. Here is how it goes (with the sorted part of the list shown in red).Start: 17 14 34 26 38 7 28 32 Phase 1: 14 17 34 26 38 7 28 32 Phase 2: 14 17 34 26 38 7 28 32 Phase 3: 14 17 26 34 38 7 28 32 Phase 4: 14 17 26 34 38 7 28 32 Phase 5: 7 14 17 26 34 38 28 32 Phase 6: 7 14 17 26 28 34 38 32 Phase 7: 7 14 17 26 28 32 34 38 Exercise 2: Initially, the list is completed unsorted. However, we can think of it as being made up of sorted lists of length one. In the first phase, these lists are merged by pairs into sorted lists of length two. In the second phase, the lists of length two are merged into sorted lists of length four. And so on. In each phase, the length of the sorted lists doubles. In this example, it only takes four phases until the entire list is sorted. Here is how it looks. The sorted lists are underlined.Start: 17 94 64 56 38 92 74 32 23 12 11 63 74 35 43 21 Phase 1: 17 94 56 64 38 92 32 74 12 23 11 63 35 74 21 43 Phase 2: 17 56 64 94 32 38 74 92 11 12 23 63 21 35 43 74 Phase 3: 17 32 38 56 64 74 92 94 11 12 21 23 35 43 63 74 Phase 4: 11 12 17 21 23 32 35 38 43 56 63 64 74 74 92 94 Exercise 3: Time measurements for merge sort and insertion sort will vary depending on the computer on which you run the xSortLab applet. (It also depends on which implementation of Java you are using). Here are some times (measured in seconds) for insertion sort and merge sort running under Netscape 4.04 on a 266-Megahertz Pentium II chip:Number of Sorting time Sorting time Merge sort is this items in array for Insertion Sort for Merge sort many times faster ---------------- -------------------- ---------------- ---------------------- 100 .00045 .00021 2.1 1,000 .05 .0029 17.2 5,000 1.3 .019 68.4 10,000 4.3 .042 102 100,000 434 .609 712 1,000,000 (not done) 7.3 Note that when the number of items is increases by a factor of 10, the sort time for insertion sort increases by about a factor of 100. So, my estimated time for merge sort to sort 1,000,000 would be about 43000 seconds. This is about 7200 minutes, or 120 hours. Merge sort is so much faster than insertion sort because it uses far fewer "phases" (while the phases of merge sort and insertion sort take comparable amounts of time). To sort n items, insertion sort uses n-1 phases. On the other hand, the number of phases used by merge sort is the same as the number of times that n can be divided by 2 before a result less than one is obtained. In mathematics, this number is, approximately, the "logarithm of n in the base 2." For 16 items, insertion sort uses 15 phases while merge sort uses 4. More generally to sort 2k items, insertion sort uses 2k-1 phases while merge sort uses only k phases. This is a huge difference, and the difference grows as k gets bigger. For example, merge sort only needs 20 phases to sort 1,000,000 items, since 1,000,000 is about 220, while insertion sort uses 999,999 phases. (We can get a little more exact by looking at how long individual phases take. Assume that the list is initially in a random order. For insertion sort, on the average, the size of the sorted list is n/2, and the sort procedure has to look at half of these n/2 elements, on average. Therefore, on average, insertion sort does about n/4 "operations" during each phase. Because there are about n phases, the total number of operations used by insertion sort is, on the average, about n2/4. The time it takes for insertion sort to sort n items is, therefore, proportional to n2. Merge sort, on the other hand does n operations for each phase (or 2*n, depending on what you count). It uses log(n) phases (where log(n) is the base-2 logarithm of n). So the total number of operations for merge sort is about n*log(n), and the time it takes for merge sort to sort n items is proportional to n*log(n). Note that as n goes to infinity, the ratio between n2 and n*log(n) also goes to infinity. So the advantage of merge sort over insertion sort increases without limit as n increases.) Exercise 4: Here is a copy of the modifies version of StatsApplet.java file. Parts that have been added or modified are shown in blue./* This applet is simple statistics calculator. It will compute and display various statistics about a set of numbers entered by the user. */ import java.awt.*; import java.applet.Applet; public class StatsApplet extends Applet { TextField dataField; // A text-input box where the user will enter the numbers Button enterButton; // The user can click on this button to enter a numbers // into the data set. (Numbers can also be entered // just by pressing return.) Button clearButton; // The user can clear the dataset by clicking on this button. Label countText; // Uneditable text that shows the number of numbers in the dataset. Label sumText; // Uneditable text that shows the sum of the numbers. Label maxText; // Uneditable text that shows the maximum of the numbers. Label minText; // Uneditable text that shows the minimum of the numbers. Label meanText; // Uneditable text that shows the average of the numbers. Label sdText; // Uneditable text that shows the standard deviation of the numbers. StatCalc2 stats; // A statistics object object to keep track of the data. public void init() { // The init method is called by the system when the applet object // is first created. It is used here to create and lay out // the components that make up the applet. setBackground(Color.lightGray); setLayout( new GridLayout(7,2,3,3) ); // changed from 3 rows to 7 // Applet will show a grid of components in seven rows and two // columns. (The third and fourth parameters specify space // between components in the grid.) stats = new StatCalc2(); // create the StatCalc2 object dataField = new TextField(); // create componets enterButton = new Button("Enter"); clearButton = new Button("Clear"); clearButton.disable(); // The clear button is initially // disabled because there is no // data to clear. countText = new Label("0"); sumText = new Label("0"); meanText = new Label("0"); sdText = new Label("undefined"); maxText = new Label("undefined"); minText = new Label("undefined"); Panel buttonPanel = new Panel(); // The two buttons will be placed // in a sub-panel that uses a grid // layout with a single row and two // columns. The sub-panel will then // be added as a single component in // the applet layout. buttonPanel.setLayout( new GridLayout(1,2,3,3) ); buttonPanel.add(enterButton); buttonPanel.add(clearButton); add(dataField); // Add components to the applet. add(buttonPanel); // The components are laid out add( new Label("Items entered:") ); // by the GridLayout layout manager. add(countText); // It fills in the grid row by row. add( new Label("Sum:") ); // There should be as many components add(sumText); // as there are spaces in the grid. add( new Label("Average:") ); add(meanText); add( new Label("Standard Deviation:") ); add(sdText); add( new Label("Maximum:") ); add(maxText); add( new Label("Minimum:") ); add(minText); } // end of init() method. public Insets insets() { // This method is called by the system to find out how much space // there should be between the edges of the applets and the components // contained in the applet. return new Insets(3,3,3,3); } public void start() { // This is called by the system just before the applet starts running dataField.requestFocus(); } void doEnterCommand() { // This method is called by the action() method, defined below, // when the user enters a number into the data set (by clicking // on the Enter button or by pressing return while typing in // the dataField text-input box. String dataText = dataField.getText(); // Get the text from the input box. double n; // This section of the method converts try { // the string from the input box Double d = new Double(dataText); // into a double number. It's kind n = d.doubleValue(); // of tricky. } catch (NumberFormatException e) { // If an error is found in the input, dataField.setText("Illegal Entry!"); // A message is put in the input box. dataField.selectAll(); dataField.requestFocus(); return; } stats.enter(n); // Add the user's number to the dataset. int count = stats.getCount(); // Show the stats. countText.setText( String.valueOf(count) ); double sum = stats.getSum(); sumText.setText( String.valueOf(sum) ); double mean = stats.getMean(); meanText.setText( String.valueOf(mean) ); double sd = stats.getStandardDeviation(); sdText.setText( String.valueOf(sd) ); double min = stats.getMinimum(); minText.setText( String.valueOf(min) ); double max = stats.getMaximum(); maxText.setText( String.valueOf(max) ); dataField.selectAll(); // Hilites the contents of the text box. dataField.requestFocus(); // Asks for the text box to get the input focus. if (count == 1) // If the first item has just been entered, clearButton.enable(); // then the clear button can be enabled. } // end doEnterCommand() void doClearCommand() { // This is called by the action() method when the user clicks on the Clear button. stats.clear(); // clear the dataset in the stats object clearButton.disable(); // clear button can be disabled since there is nothing to clear countText.setText("0"); // clear the statistics displays. sumText.setText("0"); meanText.setText("0"); sdText.setText("undefined"); minText.setText("undefined"); maxText.setText("undefined"); dataField.selectAll(); dataField.requestFocus(); } public boolean action(Event evt, Object arg) { // This is called by the system when the user performs some action on // one of the components in the applet. if (evt.target == enterButton) { // use clicked Enter button doEnterCommand(); return true; } else if (evt.target == clearButton) { // user clicked Clear button doClearCommand(); return true; } else if (evt.target == dataField) { // user pressed return while typing doEnterCommand(); // in the data-input box return true; } else return super.action(evt,arg); } // end action() } // end of class StatsApplet Exercise 5: The xSortLab applet uses a lot of different components an a lot of Panels and LayoutManagers. The main structure of the applet uses a BorderLayout. The "North" component of this layout is a Choice component which displays the choices "Visual Sort," "Timed Sort," and "Log." The "Center" component is a Panel that uses a CardLayout. The card layout has three cards: one for Visual Sort, one for Timed Sort, and one for the Log. Each of the three cards managed by the CardLayout is itself a Panel, and each of these three Panels used a BorderLayout for its main structure. The Log panel has a TextArea in the Center of the layout, with a Panel holding two Buttons to the South. The Timed Sort Panel has a Canvas in the Center with Panels to North and South. The North panel holds two Labels and two TextFields. The South Panel holds a Choice component and a Button. (Of course, the Canvas in the Center is actually a member of a subclass of Canvas.) The Visual Sort page is the most complicated. In the Center is a canvas (belonging to a subclass of Canvas) on which the action takes place. To the right are a Choice, a Checkbox, three Buttons and four Labels. At the south are two small Canvases that are used as message display areas. (You would probably mistake them for Labels.) The two little canvases are in a GridLayout with two rows and one column. (The stuff at the right might look like its in a GridLayout, but actually the layout of this part is done by hand, since that was the only way to get the exact proportions that I wanted. Note that it can't be a single Panel with a GridLayout because the background is gray in the top half and white in the bottom half.) David Eck, 12 March 1998
http://math.hws.edu/eck/cs124/labs98/lab9/answers.html
crawl-001
refinedweb
2,094
63.9
Hello everyone i'm trying to make a bot that uploads a file and reads the percentage of the upload bar. I already have the code to read the percentage, but when i actually click on the upload button it hangs until it is fully uploaded. driver.find_element_by_css_selector("Upload").click() while 1: driver.find_element_by_css_selector("Percentage").text I have also tried using threads (This is my first time using threads) and it seems to work the same as just calling the function. def get_percent(): while 1: testy = driver.find_element_by_css_selector("Percentage").text print testy def start_upload(): driver.find_element_by_css_selector("Upload").click() w = threading.Thread(name='get_percent', target=get_percent()) e = threading.Thread(name='start_upload', target=start_upload()) e.start() #It will hang on upload w.start() #if i do it like this instead it will hang in my get_percent function #w.start() #e.start() How do i get around this? Please help
http://m.dlxedu.com/m/askdetail/3/74c71d2cb6e4e5677b011947c79ac78b.html
CC-MAIN-2019-22
refinedweb
147
52.66
So I just recently turned my laptop into a 4.0 workstation since it is kind of expendable and I won’t feel inclined to nerd rage if it gets tooled. With this step forward, I decided that I probably won’t be doing much with the old Entity Framework version since the new one is supposed to be the end all/be all until the next end all/be all version comes out. What does this mean for you? This post could be filled with useful information or f— all. Just depends on what you care about. After doing a little reading, and by little I mean as little as humanly possible while still having an idea of what I’m doing, I got the new EF to persist an object. Mind you, it took a bit of patience followed by slamming my head into my desk and then more patience, but I did it. First off, the actual creating of the edmx file is the same, there’s really no difference. You still go through the wizard, you still go through the connection set up, and you still grab the tables you want. No change there. However, once you have it created, click on the .edmx file in your solution explorer, right click, then click properties. You’ll see something like this: You can see where there is nothing in the Custom Tool area of properties. That’s because I deleted the text. That’s the first part of what you need to do. Next is creating the needed classes. For this example I have two, Ad and Newspaper: namespace Beta2Test.Data.Entity { public class Ad { public Int32 Id { get; set; } public DateTime CreatedDate { get; set; } public String Name { get; set; } public DateTime? LastUpdated { get; set; } public Int32 Height { get; set; } public Int32 Width { get; set; } //Note: //If properties are to be lazy loaded, must be virtual public virtual IList<Newspaper> Newspapers { get; set; } } } and namespace Beta2Test.Data.Entity { public class Newspaper { public Int32 Id { get; set; } public Int32 Circulation { get; set; } public DateTime CreatedDate { get; set; } public DateTime LastUpdated { get; set; } public String Name { get; set; } //Note: //If properties are to be lazy loaded, must be virtual public virtual IList<Ad> Ads { get; set; } } } Three things you might notice: - The classes don’t inherit from anything. Yay - The namespace is Beta2Test.Data.Entity. Fact is, I left it there to show that the namespace can now be anything. Yay - Both collection properties are virtual. This is a must when dealing with collections that represent a relationship and you have lazy loading enabled (See below context class). For this, there is a many to many relationship between Ads and Newpapers. The Ads and Newspapers collection represent that. Why do that have to be virtual? Has to do with Entity Framework needing a way to override the properties so it can tell when they are accessed. (Read: Lazy Loading) - There is no fourth thing. You are wrong if you think there is. So far so good, but what about that like whole linking to that persistence layer stuff. You know like them entity objects yo. Thank you for that poorly worded inquiry, but valid none the less. Remember those entity context classes that it used to generate for you? Well that whole “custom tool” dohickey I removed would have built it for me. However, that’s not the path we’re going down anymore. It’s now time to brave the unknown. We, yes we, will build the context. Yes the context. using System.Data.Objects; using Beta2Test.Data.Entity; namespace Beta2Test.Data { public class Beta2TestContext : ObjectContext { private ObjectSet<Ad> _ads; private ObjectSet<Newspaper> _newspapers; public Beta2TestContext() : base("name=InterviewDemoEntities", "InterviewDemoEntities") { _ads = CreateObjectSet<Ad>(); _newspapers = CreateObjectSet<Newspaper>(); //This makes sure the context lazy loads by default ContextOptions.LazyLoadingEnabled = true; } /// /// This is used to set up the "queryable" collection. /// public ObjectSet<Ad> Ads { get { return _ads; } } public ObjectSet<Newspaper> Newspapers { get { return _newspapers; } } /// /// This creates an ad that allows it "to be used with the Entity Framework." /// /// public Ad CreateAttachedAd() { return EntityContext.Context.CreateObject<Ad>(); } public Newspaper CreateAttachedNewspaper() { return EntityContext.Context.CreateObject<Newspaper>(); } } } The CreateAttached methods aren’t needed on the Context class itself, I just put them there. They could go on the Ad/Newspaper class but at this point I’m not sure if that blurs the lines or not. Haven’t gotten into best practices mode yet. You may notice the ObjectSet collections on the context. These are the collections you will query to get items most likely, much like the old context class from the last version: Context.Ads.Where(ad => ad.Id == 1) Pretty nice, huh? Also, I noted above about the virtual properties on the Ad/Newspaper classes and how it had to do with lazy loading. ContextOptions.LazyLoadingEnabled = true; That line and the virtual properties ensure that lazy loading will occur when the property is used. Both have to be used together. Now you don’t have to put that line in the constructor if you do create a context every time you are retrieving things, you could just set it on a case by case basis. Up to you. I use a singleton like context so I just set it true in the constructor and don’t worry about it. The main thing I had trouble with was this line: public Beta2TestContext() : base("name=InterviewDemoEntities", "InterviewDemoEntities") Because I wasn’t sure what the second string should be. First one is easy, it’s whatever the key in the config file for the connection string. Second, chances are, is the same depending on how you set it all up in the wizard. I think it’s the same name when you right click on the opened .edmx file and view properties. There should be a property named “Entity Container Name”. Here’s a method I used for testing to create an Ad: public Ad CreateAd(Boolean persist) { Ad ad = null; if (persist) { ad = EntityContext.Context.CreateAttachedAd(); //This is the CreateAttachedAd method above in use } else { ad = new Ad(); } ad.CreatedDate = DateTime.UtcNow; ad.Height = RandomTool.RandomInt32(0, 10); ad.LastUpdated = DateTime.UtcNow; ad.Name = RandomTool.RandomString(10); ad.Width = RandomTool.RandomInt32(0, 10); if (persist) { AddEntityForRemoval(ad); //Ignore, for persistence removal after testing is completed EntityContext.Context.Ads.AddObject(ad); //Ad the ... ad to the context EntityContext.Context.SaveChanges(); //Persist } return ad; } There are some things you can ignore because I didn’t feel like removing code. As you can see though, it’s not very complicated. Use the CreateAttachedAd, fill in the properties, ad to the Ad collection on the context, and save. The End Sure you had to do more work than in the earlier version of Entity Framework, but on the other hand I have a fully detached class that can inherit from any class I WANT it to as opposed to the EntityObject class. Not to mention I now have an easy way to do lazy loading. Far cleaner than the old way I did it. The other interesting thing to note, and this may not be a big deal to anyone else, but above I have a note about this: AddEntityForRemoval(ad); //Ignore, for persistence removal after testing is completed This method just adds the object to a collection of EntityObjects that later I use to delete the object from the database on test cleanup. After moving to this version of EF, I had to change it to a collection of Objects. Interesting thing is: EntityContext.Context.DeleteObject(currentObject); Didn’t care. It still knew that the object was attached to the context somehow, despite the CLASS not being an EntityObject. Just an odd note. Two Errors I came across: System.InvalidOperationException: Mapping and metadata information could not be found for EntityType ‘Beta2Test.Data.Ad’. If you get this, there is a really good chance you screwed up a property name or are missing it completely. If the property name doesn’t exactly match one in the .edmx class designer template, you’re screwed. If you don’t have it on the class but it’s on the class designer template, you’re screwed. If you add it to the class designer template, it has to be on the class as far as I can tell. Now, it doesn’t have to be public. I have tested it as private and it works just fine. The required property ‘Newspapers’ does not exist on the type ‘Beta2Test.Data.Ad’. This most likely happens if you didn’t remember to make it a property: public IList<Newpaper> Newpapers; //Forgot the { get; set; } public IList<Newpaper> Newpapers { get; set; }; //Forgot the Virtual Opps. 4 thoughts on “.Net 4.0 Beta 2 Entity Framework – How To Start” I am using data transfer objects and I came accross the same error “Mapping and metadata information could not be found for EntityType”. my dtos do not share the same names as my entioty objects. instead of renaming them, I did loaded the dto into a new instance of the EF entity: public void AddEmployee(EmployeeDto entity) { employee_test e = new employee_test(); e.employee_id = entity.EmployeeID; e.first_name = entity.FirstName; e.last_name = entity.LastName; e.active = entity.Active; e.application_user = entity.ApplicationUser; _service.AddObject(“employee_test”, e); _service.SaveChanges(); } by the way, sorry for the dreadful typing and misspellings. And thanks for the infor also. “sorry for the dreadful typing and misspellings” Have you actually read anything on this site? You should feel at home. Thanks very much for the tute. Best one I have seen so far on POCO
https://byatool.com/uncategorized/net-4-0-beta-2-entity-framework-how-to-start/
CC-MAIN-2021-31
refinedweb
1,603
65.62
Episode #55: Flask, Flask, Flask, 3x Flask Published Thurs, Dec 7, 2017, recorded Wed, Dec 6, 2017. Sponsored by DigitalOcean: Brian #1 The Flask Mega-Tutorial, reborn - This very popular tutorial, written in 2012, has been rewritten. - Miguel Grinberg has rewritten it with the help of a kickstarter campaign. - Part 1 of the tutorial is up, and he’s releasing 1 part per week. - Want it faster, you can get it all in an eBook right now. - A video version is coming in January. Michael #2: Django 2.0 Released - This release starts Django’s use of a loose form of semantic versioning - Features - A simplified URL routing syntax that allows writing routes without regular expressions. - A responsive, mobile-friendly contrib.admin. - Window expressions to allow adding an OVER clause to querysets. - Python 3 only - django.contrib.auth - The default iteration count for the PBKDF2 password hasher is increased from 36,000 to 100,000. - Lots more changes Brian #3: The Big Ol' List of Rules - Flake8 is a popular code linter that combines pyflakes, pycodestyle, and mccabe. - pycodestyle is the new pep8 to enforce PEP8 suggestions. These are mostly style guide items, and not actual bugs. - pyflakes is more like a traditional linter in that it catches things that are probably oversight or bugs. - mccabe is harder to explain, but it generally tells you if your code might be too complicated, using Cyclomatic Complexity. - Flake8 produces error codes if your code has problems - Ennn and Wnnn for pycodestyle errors and warnings - Fnnn for pyflakes errors - Cnnn for mccabe errors - The The Big Ol' List of Rules is a very nice breakdown of every error, what it means, and has links to other documents where they are defined. - Very nice work from Grant McConnaughey Michael #4: requests-staticmock - via Anthony Shaw - - A Session object has all the methods of the main Requests API. - requests-staticmock is a static HTTP mock interface for testing classes that leverage Python requests with no monkey patching! Brian #5: PEP 557 -- Data Classes have been approved - You can play with them now if you want, with the 3.7.0a3 developer build. - However, 3.7 isn’t scheduled for release until June 2018. Very short Example lifted directly from PEP 557 doc. @dataclass class C: a: int # 'a' has no default value b: int = 0 # assign a default value for 'b' In this example, both a and b will be included in the added __init__ method, which will be defined as: def __init__(self, a: int, b: int = 0): pass - Why not just use attrs? (Also lifted from the pep doc) - attrs moves faster than could be accommodated if it were moved in to the standard library. - attrs supports additional features not being proposed here: validators, converters, metadata, etc. Data Classes makes a tradeoff to achieve simplicity by not implementing these features. Michael #6: Quart: 3x faster Flask - Python has evolved since Flask was first released around 8 years ago, particularly with the introduction of asyncio. - Asyncio has allowed for the development of libraries such as uvloop and asyncpg that are reported (here, and here) to improve performance far beyond what was previously possible. - Quart provides the easiest transition for Flask apps to use asyncio as it shares the Flask-API. - tl;dr: Upgrading this Flask-pyscopg2 app to a Quart-asyncpg app gives a performance speedup of 3x without requiring a major rewrite or adjustment of the code - View methods become async / await methods Our news Michael: - Pythonic staff of enlightnement - I have already encountered the Pythonic Staff of Enlightenment, see the photo that Anthony tweeted of you guys brandishing it at PyCon US. - Now so can you:
https://pythonbytes.fm/episodes/show/55/flask-flask-flask-3x-flask
CC-MAIN-2019-04
refinedweb
614
61.67
Welcome to the Enterprise Java Technologies Tech Tips for February 27, 2004. Here you'll get tips on using enterprise Java technologies and APIs, such as those in Java 2 Platform, Enterprise Edition (J2EE). This issue covers: Custom Tag Files Using Enterprise Beans with JSP Pagestfeb2004, and the index.html welcome file indicates how to use the sample code. Any use of this code and/or information below is subject to the license terms. ttfeb2004 index.html Custom tags in JavaServer Pages (JSP pages) look like HTML tags. However the custom tags are replaced at runtime with text output by a handler class associated with the tag. This month's first tip explains a new, easier way to implement custom tags. Before JSP 2.0, the only way to create a custom tag was to implement it as a Java tag handler class. The handler class developer also needed to create a TLD file that describes the tag to the web container. While custom tags are powerful, they also require programming skills, and a nontrivial understanding of how JSP pages translate to HTML. The new tag file feature of JSP 2.0 allows non-programmers to write reusable custom tags. It also makes life easier for programmers. Using JSP 2.0 syntax with the JavaServer Pages Standard Tag Library (JSTL) and its expression language (EL), you can now create custom tags without writing any Java code. Tag files are reusable components for JSP pages. They provide many advantages: Tag files don't completely replace custom tag handler classes. Tag files are preferable for encapsulating reusable content with associated layout and presentation. Custom tags are better for reusing application logic in JSP pages. For example, page headers and footers are excellent applications for tag files. The custom tags in JSTL, by comparison, are implemented as Java language handler classes. Tag File Specifics Tag files are actually translated and compiled into tag handler classes. The only difference between a tag handler and a tag handler class is that a tag handler is written in JSP syntax, while a tag handler class is written in the Java language. JSP 2.0-compliant containers look for tag files in the Web archive directory WEB-INF/tags. Tag files can also be packaged in JAR files in WEB-INF/lib. When serving a JSP page, any time the Web container encounters a tag that is associated with a tag file, the output of the JSP content in the tag file is evaluated and included in the response stream. A tag file can define attributes, and has full access to the JSP 2.0 expression language (EL). Tag files can also create EL variables that continue to exist after the tag file has finished executing. WEB-INF/tags WEB-INF/lib A tag file declares its attributes with an attribute directive. Here is an example taken from the sample code that accompanies this tip. The tag file starts with a single attribute directive: <%@ attribute name="format" required="false" %> The tag (which formats dates) uses this line to tell the container to expect a possible "format" attribute. The "required" attribute in the directive is set to "true" for mandatory attributes. These directives are what allow the web container to generate its own TLD files at deployment time. A tag receives input through its attributes. In addition to the output text produced by the tag file, a tag can also "output" data by creating EL variables. A tag file might return a value to the page that called it as follows: <%@ variable name-given="filesincluded" scope="AT_END" %> The "name-given" provides the name of the variable to set in the page after the tag has completed. "AT_END" specifies that the variable is set when the tag file completes. Tag File Example This sample code for this tip includes a tag file that reimplements the custom tag which formats the date at the server in one of three ways: java.text.SimpleDateFormat The tag specified by the tag file works slightly differently. If the format parameter begins with a dollar sign, the tag looks for a servlet context initialization parameter, instead of an environment entry. (The expression language of JSTL 1.0 had no built-in support for accessing environment entries.) The sample tag file, date.tag, begins with some directives that define the attributes expected by the file. It also identifies the namespaces for the other tag libraries that this tag uses. date.tag <%@ attribute name="format" required="false" %> <%@ taglib uri= "" prefix="c" %> <%@ taglib uri= "" prefix="fmt" %> <%@ taglib uri= "" prefix="fn" %> The next block of the date tag file uses a <c:choose> tag to determine the format string. <c:choose> is the tag of choice for if/then/else functionality in JSP pages. The first "when" clause sets the EL variable "format" to a default value if the format is null or empty: if/then/else <c:choose> <%-- If format is blank, set default --%> <c:when <c:set </c:when> ... If "format" is not empty, then it begins with a "$" or it doesn't. In the former case, the <otherwise> clause of the <choose> tag strips off the leading "$", and replaces the value of the variable "format" with the contents of the context parameter with the given name. <c:otherwise> <%-- Else if format starts with "$", look up in context param, and set "format" to its value. --%> <c:if <c:set <c:set </c:if> <%-- Otherwise leave it as it is --%> </c:otherwise> </c:choose> As noted in the comment, if "format" doesn't begin with a "$", its value is left unchanged. At this point in the page, the value of the EL "format" variable is set to a string that will be used to format the date. The useBean line creates a Date object with the current time. The method fmt:formatDate formats this date in the given "format": useBean Date fmt:formatDate <%-- Now actually create and format the date --%> <jsp:useBean <fmt:formatDate That completes the tag file. Using the tag file is even easier. A directive at the top of sample page DatePage.jsp (linked off of index.jsp in this month's sample archive) indicates that all of the tags in the archive directory (/WEB-INF/tags) can be accessed using the prefix "mytags". Here is the directive: DatePage.jsp index.jsp /WEB-INF/tags <%@ taglib tagdir="/WEB-INF/tags" prefix="mytags" %> Now, you can simply use the JSP tag file as if it were any other custom tag. Here's an excerpt from the sample page, DatePage.jsp: The time and date at the server in the default format are <b><mytags:date/></b>.<br> The time zone at the server is <b><mytags:date</b>.<br> The server date is <b><mytags:date</b>.<br> The server time is <b><mytags:date</b>.<br> Each occurrence of <mytags:date> results in a call to the tag file, and the tag is replaced in the output with the corresponding time and date at the server. This example only scratches the surface. JSP tag files have a lot of options not mentioned here. For more information about JSP tag files, see the chapter "Custom Tags in JSP Pages" in the The J2EE 1.4 Tutorial. The January 26, 2004 issue of the Tech Tips covered the JSP 2.0 Expression Language (EL). One of the examples in the tip showed how a JavaBean could be accessed by name using an EL variable. JavaBean properties can also be accessed with simple EL expressions. This feature makes Enterprise JavaBeans components (enterprise beans) very easy to use from within JSP pages. Simply place the enterprise beans required by an application view in named attributes (in the appropriate scope), and let the JSP page access the attribute by name in EL expressions. The best way to show this technique is by example. Sample Code The sample code for this tip is a credit card validator application. Credit card companies have a series of rules that can be used to check the validity of a credit card number. A credit card number can be valid and still be overdrawn, expired, or cancelled. The purpose of validity checks is to catch data entry errors before they are transmitted for authorization. A credit card number is valid if: The sample application uses three components: CreditCardLocal Feb2004Servlet ValidateCard.jsp The code works like this: a link on the index.jsp form points to the servlet. The servlet creates the session bean handle and places it in session context. The servlet then forwards the request to URL jsp/ValidateCard.jsp, which handles the card number input and validation. This form posts back to itself after the user has completed entering data. In a real application, the form would automatically forward to the next step in the purchasing process when the card validates correctly. jsp/ValidateCard.jsp The code in the servlet is straightforward. It simply creates a stateful session bean of type CreditCardLocal, and places it in an HttpSession attribute under the name "creditCard". If such a variable already exists when the servlet is called, the servlet removes the previous instance. HttpSession CreditCardLocal creditCard = (CreditCardLocal) req.getSession().getAttribute("creditCard"); // Remove it if it exists--we're starting over. if (creditCard != null) { try { creditCard.remove(); } catch (Exception e) { System.err.println( "Exception removing credit card: " + e); } System.err.println("INFO: Removed previous card."); } // Create new enterprise bean reference in session scope try { InitialContext ctx = new InitialContext(); CreditCardLocalHome cclh = (CreditCardLocalHome)ctx.lookup( "java:comp/env/ejb/CreditCard"); String cardName = req.getParameter("cardName"); String cardType = req.getParameter("cardType"); String cardNumber = req.getParameter("cardNumber"); String cardDate = req.getParameter("cardDate"); creditCard = cclh.create( cardName, cardNumber, cardType, cardDate); req.getSession().setAttribute( "creditCard", creditCard); } catch (Exception e) { throw new ServletException(e); } RequestDispatcher rd = req.getRequestDispatcher( "/jsp/ValidateCard.jsp"); rd.forward(req, res); Notice the last two lines above. After creating the enterprise bean reference, the servlet forwards the request to the ValidateCard.jsp page, which handles input and validation. The first section of the page copies any parameters that might have been posted to the page into the corresponding properties of the enterprise bean. Notice how the <c:set> tag uses "target" and "property" to access the enterprise bean property of the given name. <!-- Copy parameters to creditCard properties --> <c:set <c:set <c:if test="${param.cardNumber != null and param.cardNumber != ''}"> <c:set </c:if> <c:set If the request parameters are not set (which is true the first time the page is displayed), expressions such as ${param['cardName']} evaluate to null, and so the corresponding bean properties are set to null. ${param['cardName']} The next section of the ValidateCard.jsp page collects data from the user. The data is posted back to the same page when the user clicks the submit button. The code in this section has several interesting features. The form always posts back to itself, so each of the inputs defined below includes an attribute that sets the input's value to the current value in the credit card. The first section of the form uses a table to control layout and local background color, and defines an input element for the form parameter "cardName". cardName <input type="text" name="cardName" size="32" value="${creditCard.name}"><br> The value of cardName is set to the EL expression ${creditCard.name}, which is equivalent to the following: ${creditCard.name} <%= ((CreditCardLocal)request.getSession(). getAttribute("creditCard")).getName() %> If the form has been submitted before, any name that was entered into this field will appear in the cardName input box. The next input is a set of radio buttons, one button for each credit card type. The credit card object has an "info" property of type CCInfo. This object is a java.util.HashMap containing information about all of the valid credit card types. The keys of this map are the symbolic names of each credit card, for example, "mc" for MasterCard. The values are of type CCDesc, an object that describes the card. (See the formatted source code in the code example for more detail.) The <c:forEach> loop iterates through the list of accepted credit card types, creating a radio button for each one. CCInfo java.util.HashMap CCDesc c:forEach <p> <b>Type of card:</b><br> <c:forEach <input type="radio" name="cardType" value="${item.key}" ${(item.key eq creditCard.type) ? 'checked' : ''}> ${item.value.description}<br> </c:forEach> The expression ${(item.key eq creditCard.type) ? 'checked' : ''} evaluates to the string "checked" if the button being created is currently selected in the creditCard object. This loop offers a hidden benefit in the form of extensibility. To add a new type of credit card, you only need to add a CCDesc description of the type to the CreditCard's CCInfo. The next time ValidatePage.jsp executes, the loop picks up the new type of card and includes it in the list. ${(item.key eq creditCard.type) ? 'checked' : ''} creditCard ValidatePage.jsp The next two inputs contain the credit card number and expiration date: <b>Card number:</b> <input type="text" name="cardNumber" size="24" value="${creditCard.number}"><p> <b>Expiration date (mm/yyyy):</b> <input type="text" name="cardDate" size="10" value="${creditCard.expirationDateStr}"> Notice again that the values are set to the corresponding enterprise bean property values. The third part of the form shows an error message, if appropriate, or shows a message indicating that the card is valid. This section contains two <c:when> tags and a <c:otherwise> tag. The first tag prevents an error message from being printed if the card number is null. c:when c:otherwise null <c:choose> <c:when <!-- No number, so no need to complain that it's not valid --> </c:when> The second <c:when> tag prints a success message when the card is valid. <c:when The following card is valid:<br> <table border="0"> <tr><th align="left">Name:</th> <td>${creditCard.name}</td> </tr> <!-- and so on... --> </c:when> At this point, a real application would probably forward the user's browser to a form that collects billing address information. Notice here that the test for <c:if> is a boolean. So the expression ${creditCard.valid} must be a boolean type. The accessor used for this property is CreditCardLocal.isValid() because the naming convention for boolean get property accessors uses "is" instead of "get". c:if ${creditCard.valid} CreditCardLocal.isValid() is get The final tag <c:otherwise> is for the case where the card is not valid. <c:otherwise> <hr> <font color="red">This number is not valid.</font> <br> <i>Problem</i>: ${creditCard.validityMessage}<br> Please correct the problem and try again. </c:otherwise> </c:choose> The CreditCardLocal.getValidityMessage returns a user-friendly error message that explains why the card is not valid. CreditCardLocal.getValidityMessage The interesting and useful lesson in this example is that enterprise bean interfaces can be stored in session (or other) contexts in an application, and referenced by name in JSP EL expressions. Using this technique improves encapsulation because application logic isn't being implemented in scriptlets. It also makes JSP pages easier to create, understand, and maintain. Download the sample archive for these tips. The application's context root is ttfeb2004. The downloaded ear file also contains the complete source code for the sample. You can deploy the application archive (ttfeb2004.ear) on the J2EE 1.4 Application Server using the deploytool program or the admin console. You can also deploy it by issuing the asadmin command as follows: deploytool asadmin asadmin deploy install_dir/ttfeb2004.ear Replace install_dir with the directory in which you installed the war file. install_dir (only part of the page is shown): If you have other comments or ideas for future technical tips, please type them here: Have a question about Java programming? Use Java Online Support.
http://java.sun.com/developer/EJTechTips/2004/tt0227.html
crawl-002
refinedweb
2,641
58.08
On Tue, Jun 29, 2010 at 11:44:37PM +0100, David Howells wrote:> Jeremy Allison <jra@samba.org> wrote:> > > We already have code in Samba to detect "birthtime"> > (st_btime) as a returned member of a stat struct.> > Is it, though?> > Googling for st_btime suggests it could also be taken as the time last> archived. That may just be a NetWareism though.It's a *BSD'ism. #if defined(_NETBSD_SOURCE) struct timespec st_birthtimespec; /* time of inode creation */ #else time_t st_birthtime; /* time of inode creation */ long st_birthtimensec; /* nsec of inode creation */ #endif Time when the inode was created.Of course, for Samba's use we also have to beable to *write* to st_birthtime as Windows clientscan change this. But that's what the EA is for(and I'm happy with a system that can only readst_birthtime, not write it).Jeremy.
https://lkml.org/lkml/2010/6/29/372
CC-MAIN-2016-30
refinedweb
139
74.29
Just wondering if anyone knows why some so-called SEOs are using the double colon :: in page titles. Mostly I see it as: The Company Name :: Keyword1 kw2 kw3 kw4 or HomepageURL :: Keyword1 kw2 kw3 kw4 Does :: have any significance to the SE's? Thanks K ~ I'm partial to tildes myself. I use them all the time and they have no SEO significance that I'm aware of ~ The '::' is used as a scope resolution operator in C++ programming. Typing something like "myclass::myfunction();" lets the compiler know you want the version of 'myfunction' defined in 'myclass' rather than from the default namespace. Whenever I see this "mydomain::mypage" naming convention for web pages, I think "geek"... DaveN i never considered the seo perspective, i don't think there is any significance at all. search in google: in:the and see only: in the (Seperated by space) and same result with: in::the and with: "." ":" "/" "\" "'" "=" "@" operators also I try only : search in google and found nothing. (just put : in searchbar and press search button) or try other combinations "::" ".::" "::." "."
http://www.webmasterworld.com/forum8/1221.htm
CC-MAIN-2014-52
refinedweb
179
62.68
I want to use the Photon for an 'offline' project. Basically I want to use a GPIO to turn on SoftAP, open a socket, listen for some configuration commands, then run the bulk of the time with WiFi off. I've played around with some options for enable/disable softAP (they all seem to work fine), but I can't get TCPServer to listen on softAP. With the code below, HTTP, and port 5609 are listening, but 23 never seems to get bound (timing issue since I try to bind before SoftAP is online?). I can hack on the SoftAP.cpp code, but would prefer to write in the user block code if possible. Here is some sample source: #include "application.h" SYSTEM_THREAD(ENABLED); int ledPin = D7; TCPServer server = TCPServer(23); TCPClient client; void setup() { System.set(SYSTEM_CONFIG_SOFTAP_PREFIX, "MySSID"); pinMode(ledPin, OUTPUT); server.begin(); } void loop() { if (client.connected()) { // echo all available bytes back to the client digitalWrite(ledPin, HIGH); while (client.available()) { server.write(client.read()); } } else { digitalWrite(ledPin, LOW); // if no client is yet connected, check for a new connection client = server.available(); } } I just tried a similar thing today with a similar no result. Did you ever figure out how to do this? My situation was:1. Photon in SoftAP mode, e.g. blue light blinking and not joined to a wifi2. I had virtually the same "telnet echo" program running.3. Connected to the Photon IP address and tried to telnet. Telnet never connected. When I told photon to join my home Wifi (with my laptop on the same network), the telnet echo app worked just fine. TCPServer does not seem to respond at all. I'll theorize all ports except 80 are blocked while in SoftAP mode.
https://community.particle.io/t/tcp-sockets-in-softap/21287
CC-MAIN-2017-26
refinedweb
292
68.06
Enterprise. Look@ Knowledge Center is a new, online message and reference search facility based on the original LookAT. It works across all products in IBM Knowledge Center. It uses the Knowledge Center web site so that the information is always current. It only takes two steps to get the message information you need. Suppose you want to look up the message ID IBM1227I E for Enterprise PL/I for z/OS compiler, all you need to do is: 1. Choose a product: All Products Note: Not all IBM products are on the list currently. When you search PL/I messages, you can opt for 'All Products', but you will probably get multiple search results--one for each release. 2. Enter the message ID IBM1227I, then click [Go]. Then you will get your message information in the Knowledge Center search result. Check it out: If you prefer using a mobile device to search for messages and codes, IBM Doc Buddy is still highly recommended. Download IBM Doc Buddy: (Editors: Xifang Zhang, Lu Fang) IBM no longer offers a PL/I compiler for Windows. IBM currently offers PL/I compilers for AIX and z/OS. IBM released VisualAge PL/I Enterprise for OS/2 and Windows NT (5639-D65) in 1998, but it is no longer available or supported since 2006. More information can be found at the end of marketing and end of support announcements. There is no replacement product for the Windows compiler. IBM formerly made the Windows PL/I compiler available within bundles, such as WebSphere Developer for zSeries, renamed to WebSphere Developer for System z (5724-L44). WebSphere Developer for System z allowed for development on Windows and z/OS, but the last release (V7) hit end of support in 2010. Rational Developer for System z (RDz) was later introduced, which was renamed to IBM Developer for z Systems (IDz) (5724-T07), however, IBM Windows compilers including the PL/I compiler were removed in RDz V9. RDz V8.5 was the last release to include it, and it hit end of support in 2017. You may find more responses on Stack Overflow discussing other vendors that offer a PL/I compiler for Windows. My Notifications is a tool that enables you to subscribe to the product and the document type you want to see. With setting your personal subscription preference, you can receive an email notification every time when a specific content page has updated. Instructions about how to set your My Notifications: Step 1: Log in the IBM Support - My Notifications with your IBMid. Step 2: Choose your Delivery Preferences (Daily or Weekly emails, Plain text or HTML formatted emails, etc.). If you prefer to use an RSS or Atom feed, uncheck the box next to your email address. Step 3: Use keywords to search your target product name (e.g. PL/I) and click the '+Subscribe' symbol behind the product name. Step 4: Select document types you preferred within the pop-up window and click the 'Submit' button afterwards. Note: You are highly recommended to select 'Fixes' and 'Troubleshooting' here. Step 5: Re-type the target product name in the 'Product lookup' field to check whether your subscriptions have been set successfully. IBM Z Favorites for z Systems is a collection of links to helpful z Systems Web sites. It has links to various interest categories, such as products, product documentation, software and solutions, support and more. Use the navigation bar to the left to select your area of interest. Tip: Use your browser's "Find In Page" function, to help locate the subject you are interested in. IBM Enterprise PL/I for z/OS, V5.2 Continuous Delivery Announcement Letter You may have already realized that the IBM PL/I compiler team has continuously delivered several V5.2 modifications after the V5.2 GA date (September 2017). Taking into the consideration that, one of the critical commitments of us is to deliver better service to accelerate our clients' success, we applied the Continuous Delivery model starting from 2016 and refreshed the Enterprise PL/I for z/OS V5.1 tech docs several times until the V5.2 GA date. With the Continuous Delivery (CD) model, you can receive new features and enhanced capabilities as soon as the code is ready. The CD model enables you to receive enhancements in a faster and more continuous way without waiting for the next release. Just in case you did not realize the V5.2 CD Announcement Letter, which has been officially announced in September 2018, the link is inserted here for your convenience.. IBM PL/I compiler has released a new version on IBM Z. The recent announcement of Enterprise PL/I V5.3 reinforces the continuing IBM commitment to the PL/I programming language on the z/OS operating systems and the continued delivery of new features. Specifically, V5.3 offers: The exploitation of the new IBM z15™ hardware With V5.3, you can reduce CPU usage of decimal compute-intensive applications by up to 50%, and on average by 12% on IBM z14 over the same compute-intensive applications originally built with the previous Enterprise PL/I product. The new ARCH(13) compiler option allows the compiler to exploit the latest IBM z15. Improved processing of UTF-8 strings with the introduction of a new native datatype The V5.3 compiler provides increased efficiency and support for Unicode data encoded in UTF-8 format. A new native datatype, UCHAR, has been introduced to help you easily build maintainable applications and process UTF-8 strings efficiently. The enhanced support for processing UTF-8 strings also includes support for hex strings ending with the suffix UX so that you specify arbitrary UTF-8 string constants such as '00'ux (the lowest UCHAR value) and 'F48FBFBF'ux (the highest UCHAR value). The enhanced support for processing UTF-8 strings means that you can now work directly with UTF-8 strings without having to waste CPU resources on converting them. This results in more maintainable programs and is especially useful when you modernize your PL/I applications to work with web services. See UCHAR data and UX (hex) UCHAR constant. Several usability enhancements, particularly support for namespaces and VALUE sets The QUALIFY statement and a corresponding END statement delimit a qualify block, and thus create a namespace for ORDINALs, other types, and named constants. See QUALIFY statement. The VALUELIST and VALUERANGE attributes limit the set of values that a variable, an argument, or a returned value can have. See VALUELIST attribute and VALURRANGE attribute. The VALUELISTFROM attribute lets you copy a VALUE set from one variable to another. See VALUELISTFROM attribute. Besides, the V5.3 compiler also has a number of new features to help you optimize your PL/I applications and increase your programming productivity. Specifically, the new compiler: • Supports the date/time patterns YYYY/MM/DD, YY/MM/DD, YYYY-MM-DDTHH:MI:SS.999999, DD/MM/YYYY, and DD/MM/YY. See Date/time built-in functions. • Enables you to use the two slashes (//) characters to specify that the rest of a line is a comment. See Delimiters and operators. • Increases the maximum LINECOUNT value to 65535 lines so that fewer page breaks are created in listings intended to be viewed only online. See LINECOUNT. • Allows you to assign '' to HANDLEs, OFFSETs, AREAs, and ENTRYs as a simple way to assign a null value to them in the same manner that you can assign '' to POINTERs. See Non-computational targets. • Limits false positives in NOLAXENTRY and NOLAXQUAL checking by excluding names starting with 'DFH', 'DSN', 'EYU', 'SQL', or ' IBM'. See RULES. New built-in functions and options to add more functionality and increase flexibility The V5.3 compiler provides you with additional functionality so that you can modernize your applications. It also allows for maximum portability of your source code among a variety of compiler implementations. The V5.3 compiler provides the following new and enhanced built-in functions: New built-in functions • Array: INARRAY, QUICKSORT, and QUICKSORTX • Buffer: MEMREPLACE • Condition: ONOPERATOR • Comparison and replacement: IFTHENELSE, FOLDEDFULLMATCH, FOLDEDSIMPLEMATCH, REGEX, and REPLACE • Date/time value: MAXDATE, STCKETODATE, STCKTODATE, PLISTCKLOCAL, PLISTCKUTC, PLISTCKELOCAL, and PLISTCKEUTC • File reference: FILEDDWORD • JCL: ISJCLSYMBOL • Precision: PRECVAL and SCALEVAL • UTF-8 string: BYTELENGTH, UHIGH, ULOW, UVALID, UPPERLATIN1, UPPERASCII, LOWERLATIN1, LOWERASCII, ONUCHAR, and ONUSOURCE • System information: GETSYSWORD and GETSYSINT Enhanced built-in functions • Buffer: MEMCONVERT • JSON: JSONPUTVALUE and JSONPUTMEMBER See Summary of changes, Language Reference. The V5.3 compiler provides the following new and modified compiler options: New compiler options Modified compiler options See Summary of changes, Programming Guide. Improved JSON and XML support The V5.3 compiler increases support for various casings of names in the JSON functions via: • the addition of LOWER as a suboption to the JSON(CASE)compiler option • the new JSON(GET(HEEDCASE | IGNORECASE)) compiler option • the support for an optional parameter to JSONPUTMEMBER and JSONPUTVALUE that specifies whether the names should be written in lowercase, in uppercase, or as is. See JSON. A new XMLNAME attribute has been introduced, so that alternate name formats can be specified for XML output. See XMLNAME attribute. Compiler and runtime support for z/OS V2.4 Enterprise PL/I for z/OS, V5.3 adds support for building and running PL/I applications for the z/OS V2.4 operating system. With Enterprise PL/I for z/OS, V5.3, you can benefit from over 50 years of IBM experience in PL/I compiler innovation and development. Please visit the Enterprise PL/I for z/OS V5.3 Knowledge Center for more information. Both English manuals and Japanese manuals are viewable and downloadable now in the PL/I documentation library. If you have any comments regarding the PL/I documentation, please send them to compinfo@cn.ibm.com. (Author:.
https://www.ibm.com/developerworks/community/blogs/86d253aa-f216-4642-9f2b-eedb09087dfc?sortby=4&maxresults=15&page=3&lang=en
CC-MAIN-2019-47
refinedweb
1,635
55.03
"joe.doe@example.com". To set this property with the JavaScript library, you can make a call to mixpanel.people.set: mixpanel.people.set({ "plan": "Premium", $email: "joe.doe@example.com" }); An email message consists of a from-name and address, a subject, and a message body. To create a new email message, navigate to the Messages report and select Email Message from the "Create new message" dropdown. This will give you the following form: Using Profile Properties: Using Conditional Logic When a fallback value for a missing user profile property is not enough, you can also use conditional blocks to change the contents of your message. We treat ${Location} %} Come and visit us at our {{ ${Location} }} office. {% else %} You haven't told us your location. Please update your location in your account, and we'll send you to our nearest office. {% endif %} A user with a profile property Location: Asheville will get the following message: On the other hand, profiles without a Location property will receive this message: You haven't told us your location. Please update your location in your account, and we'll send you to our nearest office. Liquid Templating Mixpanel offers another formatting language, Liquid, for email messaging. This is in addition to the formatting language described above. View the Liquid Messages in Mixpanel documentation to learn more about Liquid messaging. Targeting Users When you submit the form, it will ask you to define the targeting criteria for your message. We're keeping it simple here and restricting the message to a single user named "Joe Doe". You can use many combinations of profile properties when you're creating a real message. Scheduling Delivery Once you've targeted your users, you just have to schedule the email. There are two options for scheduling emails:.
https://developer.mixpanel.com/docs/email-messages
CC-MAIN-2019-51
refinedweb
299
55.64
(For more resources on this subject, see here.) Plugin approach of Coily coily is a Python script designed from the beginning to provide a plugin based platform for building Spring Python apps. Another important feature is version control of the plugins. Developers should not have to worry about installing an out-of-date plugin that was designed for an older version of Spring Python. coily allows different users on a system to have different sets of plugins installed. It also requires no administrative privileges to install a plugin. Key functions of coily coily is included in the standard installation of Spring Python. To see the available commands, just ask for help. The following table elaborates these commands. Required parts of a plugin A coily plugin closely resembles a Python package with some slight tweaks. This doesn't mean that a plugin is meant to be installed as a Python package. It is only a description of the folder structure. Let's look at the layout of the gen-cherrypy-app plugin as an example. Some parts of this layout are required, and other parts are not. The top folder is the name of the plugin. - A plugin requires a __init__.py file inside the top directory. - __init__.py must include a __description__ variable. This description is shown when we run the coily --help command. - __init__.py must include a command function, which is either a create or apply function. create is used when the plugin needs one argument from the user. apply is used when no argument is needed from the user. Let's look at how gen-cherrypy-app meets each of these requirements. - We can already see from the diagram that the top level folder has the same name as our plugin. - Inside __init__.py, we can see the following help message defined. __description__ = "plugin to create skeleton CherryPy applications" - gen-cherrypy-app is used to create a skeleton application. It needs the user to supply the name of the application it will create. Again, looking inside __init__.py, the following method signature can be found. def create(plugin_path, name) - plugin_path is an argument provided to gen-cherrypy-app by coily, which points at the base directory of gen-cherrypy-app. This argument is also provided for plug-ins that use the apply command function. - name is the name of the application provided by the user. (For more resources on this subject, see here.) Creating a skeleton CherryPy app The rest of the files listed on the diagram above form a template of an application. - Before we create our CherryPy application, we are missing something. In the earlier screenshot, this plugin wasn't listed. We need to find it and install it. First, let's see how we can look up existing plugins. - Seeing gen-cherrypy-app listed, let's install it using coily without touching a browser. - Let's use the plugin to create a CherryPy application called sample_app. Since we just installed it, the plugin now shows up on coily's help menu. With that in place, we can then run the command to create sample_app. - It replaces all instances of ${name} in each file with sample_app - It replaces all instances of ${properName} in each file with Sample_app - It renames cherrypy-app.py as sample_app.py - To run the app, switch to the sample_app directory, and run the main script. ./sample_app.py - Now we can visit our running application at. - Let's inspect app_context.py and see some of the key features wired by gen-cherrypy-app. gen-cherrypy-app creates a directory named sample_app and copies the files listed above into it. It also does some transformations of the files, based on the argument sample_app. (For more resources on this subject, see here.) This is the root object being wired. The rest of the configuration (not shown here) is mostly security configuration steps. The security configuration with Spring Python requires many steps. gen-cherrypy-app helps out by pre-wiring most of the security parts, allowing the user to modify as needed rather than build from scratch. From here, we can log in with the hard-wired credentials to view our expandable application. Currently, there are no controller objects. However, it would take little effort to add such a layer. This plugin is simple enough that most of the work spent in improving this plugin can be focused on the template files. This tactic is very useful to build other templates for other types of application. Summary coily was built to download, install, and utilize plugins. gen-cherrypy-app nicely creates a Spring-ified CherryPy application using a set of templates. This pattern is easy to replicate for other types of applications. In this article, we have learned: - The basic coily commands used to install and uninstall plugins - The structure of a plug-in, including defining the description shown on coily's help screen and the functions needed to process a command - That using template files and pattern substitution makes it easy for gen-cherrypy-app to generate CherryPy applications Further resources on this subject: - Getting Started with Spring Python - Easily Writing SQL Queries with Spring Python - Scaling your Application Across Nodes with Spring Python's Remoting
https://www.packtpub.com/books/content/creating-skeleton-apps-coily-spring-python
CC-MAIN-2018-05
refinedweb
872
66.94
And I want to send with UART special command for example: FF 01 00 04 3F 00. How can I implement this? I tried to write code like this: Code: Select all import time import serial import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(7, GPIO.OUT, initial = GPIO.HIGH) send = serial.Serial( port ='/dev/serial0', baudrate = 9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1 ) but it doesnt work. Any ideas? What I do wrong? Please help. Code: Select all i = [255,1,0,4,63,0] for x in i: send.write(x) time.sleep(0.1) GPIO.output(7, GPIO.LOW) GPIO.cleanup()
https://forums.raspberrypi.com/viewtopic.php?f=32&p=1914357&sid=5ff5b2911c16f4f345d088327fd247f0
CC-MAIN-2021-49
refinedweb
112
54.79
Financial Management: Borrowing, Collecting, and Interest -. Often even shareholders and bondholders find themselves with conflicting interests, but such conflicts are lessened by the bondholders through: a. a cooperative agreement signed by the shareholders and the lenders. b. limiting the amount of funds bondholders will lend. c. loan agreements that restrict the borrowing company from undertaking excessive risk. d. offering the lenders a share of the profit. -. Examples of unsystematic risk include: a. inflation. b. interest rates. c. local strikes. d. recession. -If a firm's return to its equity shareholders is 10 percent, the cost to borrow incrementally is also 10 percent, and its marginal corporate tax rate is 34 percent, then it would be wiser to borrow because: a. borrowing at an after-tax cost of debt that is below the return on equity capital will enhance shareholder's returns. b. shareholders will avoid putting in additional capital. c. borrowing is always less of an effort than raising additional equity capital. d. all of the above. -. If a bond with a quoted price of 79 1/8 paid $40 interest semiannually, its current yield would be stated as: a. 8.0%. b. 4.0%. c. 5.05%. d. 10.11 %. -. For a share of stock in a new company with no dividends anticipated for the next three years, a projected dividend in year 4 (D4) of $2.00, a projected constant growth rate of 5 percent beginning in year 5 (gc) and a required rate of return (k) of 10 percent, the estimated selling price of the stock is: a. $30.05. b. $20.00. c. $40.00. d. $28.69. -. The income statement is intended to inform the reader of: a. the financial condition of the firm at anyone point in time. b. how much money has been earned by the firm during an accounting period. c. how much income has been distributed by the firm to its shareholders. d. the cash profit earned by the firm over a given period of time -. The balance sheet is intended to present the firm's assets in the order of their liquidity or convertibility to cash, while at the same time presenting amounts owed by the firm to its claimants in the order of satisfaction of the claims. Thus, working capital or net working capital can be referred to as: a. the firm's total assets minus the firm's liabilities coming due within one accounting cycle (or typically 12 months). b. the firm's current assets minus the firm's total liabilities. c. the firm's cash minus the firm's current liabilities. d. the firm's current assets minus the firm's current liabilities. -. Interest is defined as the: a. rate of return earned on all investments. b. rate of return earned on a debt investment. c. rate of return earned on an equity investment. d. rate of return earned, during a one-year period, that relates to both stock and bonds. -. The role of the corporate financial manager can be viewed as: a. planning, monitoring, or otherwise managing the disbursements of cash. b. being an intermediary between the financial markets and the firm's operations. c. maximizing the process of obtaining funds with the least cost associated with them. d. continual surveillance of wasteful and nonproductive projects. -. Nearly all preferred stock comes with the right to receive arrearage dividends before common shareholders receive their dividends, in the event that the preferred dividends have been passed. Such a feature is referred to as: a. the preference feature. b. the liquidation preference. c. the cumulative feature. d. voting preference. Solution Summary The solution explains the answers to various questions of financial management
https://brainmass.com/business/finance/financial-management-borrowing-collecting-interest-38865
CC-MAIN-2017-04
refinedweb
613
57.27
"Chris Liechti" <cliechti at gmx.net> schrieb im Newsbeitrag news:Xns9227C812CD4B2cliechtigmxnet at 62.2.16.82... > "Frank Sonnenburg" <sonnenbu at informatik.uni-bonn.de> wrote in > news:adte4c$nu8$1 at f1node01.rhrz.uni-bonn.de: > > a little tricky problem (at least from my point of view); given module > > CALLER: > > > > # i need "fct" and some other from module "UTILS" > > from UTILS import * > > fct() > > # END of module CALLER > > > > > > Now, inside fct(), how do i determine the module - in this case CALLER - > > from where fct() was called? > > i think __name__ can help in this case but not in the one below. > but are you sure that you wan't t do this? a function that behaves > differently depending on the namespace gives very hard times debugging... > > a cleaner solution would be to create an class that contains fct and each > module that uses it can create its own object. > > if you can say what you want to achieve, we might give you a more specifuc > advice. > > > Even concerning cases like (continuation of example): > > > > # Now we are in __main__ > > import CALLER > > fct_in_main = CALLER.fct > > fct_in_main() > > > -- > Chris <cliechti at gmx.net> > Yes, actually i thought of classes as a workaround. I have a tool with a large amount of functions, so i grouped them into a menu tree. My first approach was a package solution, which has nice advantages: easy to build, unique access to any function. But there is a main disadvantage: function names can get very long, for instance: utils.database.sql.fetch() Instead i want to enter: >> import utils >> database() # do something in database, then switch to submenu sql >> sql() # now sql commands like fetch() are visible >> val = fetch('name') # now return to parent menu database >> end() # now fetch() is not available any more ......... Anyway, thanx a lot for your quick response! Frank
https://mail.python.org/pipermail/python-list/2002-June/148188.html
CC-MAIN-2020-24
refinedweb
302
72.56
Wow, what a cool project start to finish. Simple, cheap, and absolutely useful! … and not to mention big green numbers which make it look more impressive than it actually is! This is my super-simple frequency counter designed to be used for amateur radio, all for about $10. It was a project I developed over the last few months and documented all along the way. It’s finished I guess, so this will probably be the last post about it! Now for some vids and pics: Sure there’s room for improvement,but that’s the fun part! This is a solid start and it’s cheap as can be. Simply improving software would greatly improve its accuracy. This doesn’t use any time-averaging at all! If you had it average 20 readings, it’d probably be much smoother, update every second, and have a higher precision. Also, there’s ample room left in the case to build in a transmitter or receiver! There’s the finished project! It looks pretty good, considering it was built mostly out of junk box components, and everything it’s made from can be purchased cheaply online. I’m happy with it! I could improve my metal cutting, but that was the first time I ever cut a square window in aluminum so I’m still proud of myself. As you can see the enclosure is made from sheet metal bent and cut into 2 pieces. The enclosure was from RadioShack, and was $2.99! Yeah it might be cheaper online, but when you add shipping it’s pretty convenient to get it locally. My local RadioShack didn’t carry these metal ones (they have stupid plastic ones), but I found these in Orlando and after asking the workers I learned that anyone can find any product online (such as the case I used) and request that their local store order them. When they arrive, you can buy them with no extra charge! Here are some of the internals after being mounted. Heck, these are ALL the internals! You can tell I could have gotten away with a case one third this size if I had one available. Oh well, it’s still cool. There are a few random photos of the build. It’s just a microcontroller reading (and resetting) a counter a bunch of times a second and displaying the result on the multiplexed display. That’s it! It was a lot of work, but a truly simple concept. The micro-controller is an ATMEL Atmega 16 AVR which is a little costly (around $5) but I had it on hand. I imagine you could accomplish the same thing with a far less intricate microcontroller! I’ll bet you could pull it off with an ATTiny2313, especially if you had a LCD display rather than a multiplexed LED like mine. The counter is a 74lv8154 chip, a 32-bit (dual 16-bit) counter IC at a bargain $0.50 – why when I google for home made frequency counters do I not see people using these? They daisy-chain multiple 8-bit counters! What a shortcut I stumbled upon… Thinking of making your own? Go for it! Here are some of my other posts which describe the development of this thing (including stuff I tried that didn’t work). Everything I ordered should be stocked at mouser.com. this post demonstrates it in action this post shows it being used too this post shows the first time I really got it working this post has the SCHEMATIC for the counter! I guess that sums it up! What a fun hack. If you have any questions feel free to contact me (link in the menu on the right), and if you make one of these of your own I’d LOVE to see it! I’ll even slap a photo of yours on my site to share with everyone. I had fun working on this project. If you’re at all into radio, I recommend you try attacking a project like this too! It’s more efficient at determining frequency than turning on a commercial radio receiver and spinning the dial until you hear your transmitter ^_^ SUPPLEMENTAL VIDEO Upon request here’s the code! It’s nothing special, and certainly not very efficient, but it’s quite functional. If you re-create this project, I recommend writing your own code rather than flat copying mine. You’ll learn a heck of a lot more… and my code for this is really crap XD #include <avr/io.h> #include <avr/delay.h> #include <avr/interrupt.h> #define A PC5 #define B PC0 #define C PC6 #define D PC7 #define E PC2 #define F PC4 #define G PC1 #define P PC3 char sendDigit(char row, char num, char dot){ char val=0; if (num==0) {val|=(1<<A)|(1<<B)|(1<<C)|(1<<D)|(1<<E)|(1<<F);} if (num==1) {val|=(1<<B)|(1<<C);} if (num==2) {val|=(1<<A)|(1<<B)|(1<<D)|(1<<E)|(1<<G);} if (num==3) {val|=(1<<A)|(1<<B)|(1<<C)|(1<<D)|(1<<G);} if (num==4) {val|=(1<<B)|(1<<C)|(1<<F)|(1<<G);} if (num==5) {val|=(1<<A)|(1<<C)|(1<<D)|(1<<F)|(1<<G);} if (num==6) {val|=(1<<A)|(1<<C)|(1<<D)|(1<<E)|(1<<F)|(1<<G);} if (num==7) {val|=(1<<A)|(1<<B)|(1<<C);} if (num==8) {val|=(1<<A)|(1<<B)|(1<<C)|(1<<D)|(1<<E)|(1<<F)|(1<<G);} if (num==9) {val|=(1<<A)|(1<<B)|(1<<C)|(1<<F)|(1<<G);} if (dot==1) {val|=(1<<P);} PORTC=val; PORTD=(0b10000000>>row); _delay_ms(1); } void showNumber(unsigned long val){ if (val==0) {return;} int i; int array[6]={10,0,0,0,0,0}; // NUMBER OF DIGITS int dly=10; i=6-1; while (val>0){ array[i--]=val%10; val /= 10; } sendDigit(1,array[0],0); sendDigit(2,array[1],1); sendDigit(3,array[2],0); sendDigit(4,array[3],0); sendDigit(5,array[4],0); sendDigit(6,array[5],0); sendDigit(0,0,0); } #define byte1 PB4 #define byte2 PB3 #define byte3 PB2 #define byte4 PB1 unsigned long val=123456; void readFreq(){ unsigned long b4,b3,b2,b1; PORTB=255-(1<<byte1);b1=PINA; PORTB=255-(1<<byte2);b2=PINA; PORTB=255-(1<<byte3);b3=PINA; PORTB=255-(1<<byte4);b4=PINA; PORTB=0;PORTB=255;//RESET val=b1+b2*256+b3*65536+b4*16777216; // ad 'em up val=val/3355; } int cnt=0; ISR(TIMER1_OVF_vect) { cnt++; readFreq(); } int main(){ DDRA=0; DDRB=255; DDRC=255; DDRD=255; TIMSK|= (1 << TOIE1); // Enable overflow interrupt sei(); // Enable global interrupts TCCR1B|=(1<<CS11); // Set up timer at Fcpu/8 while(1){showNumber(val);} } … and I know it’s unrelated, but: (I watched this four times – it’s so random I love it!) UPDATE This project was featured on a couple of my favorite sites, Hack-A-Day and Electronics-Lab!
http://www.swharden.com/blog/2011-03-14-frequency-counter-finished/
CC-MAIN-2016-22
refinedweb
1,173
70.84
NetBeans 8.0 is out! By Tomas Mysik on Mar 19, 2014 Hi all, let me inform you that NetBeans 8.0 is out! Enjoy it! Hi all, let me inform you that NetBeans 8.0 is out! Enjoy it! This blogs is written by NetBeans developers who contribute to the PHP support mainly. I think there is a problem when generating JavaDoc comments and fixing imports if I have aliased classes. For example, I have a class: namespace foo\bar; use baz\SomeClass as SomeClassAlias; class Test { public function getSomething(SomeClassAlias $someClass) { } } Now, when I generate a method comment (by writing /** before it and pressing Enter) it generates /** * @param \baz\SomeClass $someClass */ Then, when I press ctrl+shift+I to fix uses it changes it into: /** * @param SomeClass $someClass */ and changes my use statements to: use baz\SomeClass; use baz\SomeClass as SomeClassAlias; I.e. instead of using my alias, it uses the original class name and adds an extra use statement, which is very annoying and potentially dangerous. Any tips? Posted by guest on March 25, 2014 at 10:55 AM CET # To guest: Please, for reporting issues use NB Bugzilla (link is in the blog post), not this blog. Thanks. Posted by Tomas Mysik on March 25, 2014 at 11:03 AM CET # Where should I report the problem with this blog not saving my nick? :) I'll do that, thanks. Posted by guest on March 25, 2014 at 09:52 PM CET # I think the problem is with the "Preview" functionality. Posted by Pies on March 25, 2014 at 09:53 PM CET # To guest: I have the same problem :) Posted by Tomas Mysik on March 26, 2014 at 07:14 AM CET #
https://blogs.oracle.com/netbeansphp/entry/netbeans_8_0_is_out
CC-MAIN-2015-14
refinedweb
287
68.91
Java's package management system always seemed simple and effective to me. It is heavily used by the JDK itself. We have been using it to mimic the concept of namespaces and modules. What is Project Jigsaw trying to fill in? From the official site: The goal of this Project is to design and implement a standard module system for the Java SE Platform, and to apply that system to the Platform itself and to the JDK. Jigsaw and OSGi are trying to solve the same problem: how to allow coarser-grained modules to interact while shielding their internals. In Jigsaw's case, the coarser-grained modules include Java classes, packages, and their dependencies. Here's an example: Spring and Hibernate. Both have a dependency on a 3rd party JAR CGLIB, but they use different, incompatible versions of that JAR. What can you do if you rely on the standard JDK? Including the version that Spring wants breaks Hibernate and visa versa. But, if you have a higher-level model like Jigsaw you can easily manage different versions of a JAR in different modules. Think of them as higher-level packages. If you build Spring from the GitHub source you'll see it, too. They've redone the framework so it consists of several modules: core, persistence, etc. You can pick and choose the minimal set of module dependencies that your application needs and ignore the rest. It used to be a single Spring JAR, with all the .class files in it.
https://codedump.io/share/cBsazsr4aZaw/1/why-project-jigsaw
CC-MAIN-2017-47
refinedweb
252
66.23
Currently, native and non-native objects have the same layout in memory. After the shape and type, objects have slots and elements pointers, and storage for fixed slots. Non-native objects only use the shape and type; they can't use their slots or elements for storage, and while they have fixed slots these are not traced by the GC. This is pretty inefficient, and will need to be fixed in order to have performant typed objects for bug 1058340. What I think we need to do is break up the object class hierarchy. Instead of: JSObject : ObjectImpl : Cell shape type slots elements fixed slots We would have: NativeObject : JSObject : Cell slots shape elements type fixed slots This would remove ObjectImpl. I guess this doesn't have to happen but I don't think there's any value in distinguishing between JSObject and ObjectImpl, since the two can be freely cast into one another and having two classes doesn't really address the bloat. Distinguishing native objects from other objects in the type system would be pretty nice though since there are a lot of methods (both members of JSObject and other functions) that only work on native objects, which we currently manage using assertions. I don't know if it would be helpful to have a NonNativeObject class inheriting from JSObject as well. We would still use the existing object allocation kinds for both native and non-native objects, checking whether the object is native during tracing and finalization (which we do already). I guess, reading the comments on ObjectImpl a bit, I think distinguishing NativeObject from JSObject accomplishes much the same thing that distinguishing ObjectImpl from JSObject is trying to do, since ObjectImpl's intent is to separate out the slot storage and internal organization of the object from its external interface. Only NativeObject can have slot/element manipulating methods, and now we'll have better enforcement of this property since JSObject* can only be converted to NativeObject* with an explicit downcast. Are proxies native or non-native for purposes of this discussion? Because proxies certainly used reserved (and fixed) slots. (In reply to Boris Zbarsky [:bz] from comment #2) > Are proxies native or non-native for purposes of this discussion? Because > proxies certainly used reserved (and fixed) slots. Proxies are non-native. They use reserved slots right now but this is a limitation of the API and a waste of memory. It would be better if they extended JSObject with more natural C++ style fields, and I'd like to do that as part of this bug.. (In reply to Boris Zbarsky [:bz] from comment #4) >. OK, we should still be able to ensure that DOM proxies have a HeapValue in the same place as it would be in a DOM object. The layout of proxy objects is mainly contingent on the tracing/finalization code that runs for those objects, which should have more flexibility after bug 966518 lands (which looks like it will be soon, but in any case before that gets fixed up we can just pad and assign slots for all proxies to match their current layout.) OK. That will preserve the current behavior. It still won't allow doing things like storing cached values in slots, which we support on non-proxy DOM objects and have been wanting to support on proxy ones.... (In reply to Boris Zbarsky [:bz] from comment #6) >... I don't think this would be all that different from what this bug is proposing. Proxies will have the flexibility to extend JSObject with whatever data they want (as long as it fits in one of the JSObject allocation kinds), and they (all of them, or just DOM proxies) could do this so that they have a fixed length array of HeapValues in the same place they would be in a normal native object. These heap values would behave the same way as the fixed slots in a proxy do now --- they aren't traced automatically during GC but will have barriers etc. triggered on them --- and since the HeapValues are in the same place for both kinds of objects code can still access objects that might be either DOM proxies or DOM native objects without extra branches. For sizing proxies and other non-native objects, I don't think tying this to the clasp is a good idea. Using JSCLASS_RESERVED_SLOTS as we do now is inadequate, internally we have lots of places where we want to size objects differently even if they have the same clasp (plain objects, arrays, array buffers, typed arrays, typed objects). Our internal allocation functions give control over sizing to whoever is doing the allocation, and we can do this (optionally) in the API as well. Sounds good. We can probably handle doing manual tracing of the values in the proxy case, since the tracing code can be per-concrete-object-kind instead of superclasses having to know to trace stuff. Created attachment 8497072 [details] [diff] [review] WIP WIP for the organizational changes required to add NativeObject. This is a giant monster patch but I don't see a good way of breaking it up significantly that doesn't leave us in a weird state where slot stuff is split between JSObject and NativeObject. This patch changes ObjectImpl to NativeObject, makes it a subclass of JSObject, moves the slots and elements members and all functions relating to slots/elements storage into NativeObject, and compiles. This doesn't actually change semantics anywhere though (except to fix a few minor bugs I came across) and uses a fakeNative() function to do an artificial downcast from JSObject to NativeObject when an object might be non-native. These calls are mostly restricted to non-native object manipulation code and GC stuff. The next steps here are to move the slots and elements pointers back into JSObject, so that objects once again all have the same representation. At that point there should be no change in behavior with this patch applied, except for a bunch of new checked downcasts to NativeObject and other types which were only implicit before. Once this patch gets in, the layout of non-native objects can be changed and the fakeNative() calls removed. Doing things in this order is better I think because without the organizational changes it's hard to pin down the places where we are accessing the contents of objects that might be non-native. Created attachment 8497505 [details] [diff] [review] organizational patch Fixed up organizational patch, per comment 9. Comment on attachment 8497505 [details] [diff] [review] organizational patch Review of attachment 8497505 [details] [diff] [review]: ----------------------------------------------------------------- I really like the way this is all headed. Also, this split seems much more natural than the JSObject/ObjectImpl split. I don't know if you planned to do this already right before landing (to avoid rebase pain), but could you rename vm/ObjectImpl* to vm/NativeObject*? This is half pre-existing, but since this is a monster-reorg patch anyway: do you think we could move all the JSObject/NativeObject/Shape methods back to their respective .cpp/.h's? They seemed to be pretty interwingled and I've found it frustrating when trying to walk through the code. (I think there are a few exceptional cases with inline methods that really want to go in the other header.) ::: js/src/builtin/Intl.cpp @@ +998,5 @@ > JS_ASSERT(args[0].isObject()); > JS_ASSERT(args[1].isString()); > JS_ASSERT(args[2].isString()); > > + RootedNativeObject collator(cx, &args[0].toObject().as<NativeObject>()); How do you know this is a NativeObject? I see a getClass() test below, so it seems like 'this' could be any object (e.g., via .call). (Same question in a few cases below.) ::: js/src/jsobj.cpp @@ +1137,5 @@ > } > return Reject(cx, obj, JSMSG_OBJECT_NOT_EXTENSIBLE, throwError, rval); > } > > + return DefinePropertyOnObject(cx, obj.as<NativeObject>(), id, desc, throwError, rval); Pre-existing and more of a future question: I know we've had since forever the invariant that only non-native objects have lookup/define hooks. I was wondering if there was a nice pinch point to assert the invariant: is<NativeObject>() iff (!class->define* && !class->lookup* && ...) I was also wondering if we could even go farther by segregating the portion of js::Class that held non-native-only hooks and making this a js::NonNativeClass (which derives JS::Class and was engine-internal). js::NativeObject::getClass() would return a js::Class and js::NonNativeObject (which you were considering if it had any uses) would return a js::NonNativeClass. With this change, the pattern in all these ops would be: test if we are non-native, if so, obj->as<NonNativeObject>().getClass()->lookupOp(...). ::: js/src/vm/ObjectImpl.h @@ +1600,5 @@ > +namespace js { > + > +// Alternate to JSObject::as<NativeObject>() that tolerates null pointers. > +inline NativeObject * > +AsNativeObject(JSObject *obj) Could you name it MaybeNativeObject? Could we not name this anything involving "native"? The term is 15+-year-old nigh-meaningless detritus, from the time when ES(1-?)3 distinguished between "native" objects and host objects. BasicObject and ProxyObject as a split, or something. I dunno. But, if we're touching everything here, *please* not native. FWIW, I considered this (having also complained about "native" in the past). But, atm, it seems like there are only two major uses of the word "native": native objects (obj->isNative()) and native functions (fun->isNative()) and I don't find myself confused by this; it's usually clear from the context. Also, these are meant to be impl terms, not spec terms (they don't highlight a spec distinction), so "native" doesn't seem especially bad. Here is a patch to move NativeObject manipulating methods in jsobj files into more appropriate files (including both NativeObject member functions and NativeObject-only baseops and other methods). This still isn't complete as there are lots of NativeObject methods in Shape.cpp, but that is kind of a longstanding issue and is probably better fixed by factoring that stuff so it can be done as methods on Shape rather than NativeObject. And a couple more patches (two, since hg patch messed up) to rename the ObjectImpl files to NativeObject: Created attachment 8502666 [details] [diff] [review] patch Patch for the rest of this bug. This removes all the fakeNative methods and moves slots/elements into NativeObject. Proxies and typed objects extend their base class with the additional members they want: Proxies have a pointer to an array of values in the same place as the slots for a normal object, and use the second word in their header for the proxy handler. So the difference vs. the current representation is that proxies always have a slot vector malloc'ed, rather than usually having fixed slots, though the DOM_OBJECT_SLOT mechanism is mostly unchanged. There are some spots in codegen that assumed the DOM_OBJECT_SLOT will always be fixed, though I don't know why this is guaranteed to be the case given JSObject::swap. Incidentally the main reason we can't just put all the data inline in the proxies is because of JSObject::swap, and if there was a better handle on what this method can be used for and the ability to vary layouts between proxies this situation can be improved. Inline and outline typed objects just store their data following the shape/type. For outline typed objects the data is stored unboxed, and for both inline and outline typed objects the layout now matches the goal laid out in bug 1058340. This patch is green on try, and I'll try to split it up for review. Created attachment 8502716 [details] [diff] [review] Remove slots/elements from non-native objects This patch moves slots/elements into NativeObject and fixes most of the remaining uses of fakeNativeSlots etc. for these. It also fixes some related things like making sure GC allocation kind sizes are correct and removing uses of getPrivate() for non-native objects. Created attachment 8502717 [details] [diff] [review] new proxy layout This patch moves ProxyObject over into using the new layout for its data. Created attachment 8502718 [details] [diff] [review] DOM and JIT proxy fixes This kind of goes in tandem with the previous patch, but this has fixes for DOM_OBJECT_SLOT handling with proxies, and also fixes up the JITs for accessing proxies and DOM_OBJECT_SLOT. Created attachment 8502720 [details] [diff] [review] remove extra proxy slots Currently we support proxy classes adding additional slots to the object. This facility isn't used anywhere in the browser though and is difficult to support at the moment without individual classes having control of the proxy data layout. This patch removes these extensible slots and also removes MAX_FIXED_SLOTS from the external API, which wasn't used meaningfully anywhere. Created attachment 8502721 [details] [diff] [review] typed object and typed array fixes This moves typed objects over into using a new unboxed layout for their data, and has some fixes for generic array buffer view manipulation code that is affected by this change. Created attachment 8502723 [details] [diff] [review] fix tradeguts TradeGuts is broken by this change, and as is so often the case it was easier to just rewrite this function than try to fix it in place. At some point ReserveForTradeGuts was made infallible, so this just removes that function and does allocation inline where needed, crashing on OOM. This simplifies things a lot. Created attachment 8502725 [details] [diff] [review] don't use NewObjectCache for non-native objects Don't use the NewObjectCache for non-native objects. This cache is now a mess and I don't know how much it really buys us anymore, might want to investigate removing it. Comment on attachment 8502718 [details] [diff] [review] DOM and JIT proxy fixes > +++ b/js/src/jit/CodeGenerator.cpp This seems like we'll output a lot more (and more complicated) code for loading the DOM private. That seems somewhat unfortunate. :(? Have we tried measuring a microbenchmark with this change to see how much the cost of a simple DOM getter changes? I didn't carefully read over the exact bit-munging going on in the JIT stuff (e.g. whether the args to branchTest32 make sense here), because I can't figure out what the arguments to some of these masm functions are supposed to be, as usual. :( >+++ b/js/src/jsfriendapi.h >+ if (sobj->slotRef(slot).isMarkable() || value.isMarkable()) Why does the isMarkable() no longer need to be ifdef JSGC_GENERATIONAL? >+++ b/js/src/jsproxy.h >+ if (sobj->slotRef(slot).isMarkable() || value.isMarkable()) Likewise. r=me modulo the above (In reply to Boris Zbarsky [:bz] from comment #28) > Comment on attachment 8502718 [details] [diff] [review] >? This is temporary, but won't be clean to fix until we start storing the proxy handler in the clasp. At that point there won't be any data which the vm requires to be stored in the proxy, and classes/handlers can specify how much space they want inline after the object and can use that space however they want (though they'll have to manage dynamic allocations manually). This needs to be coupled with some taming of JSObject::swap, so that we can be sure that slots we think are inline definitely are, regardless of any swaps that happen (i.e. We would know how much inline data an object needs and either crash or throw an error when swapping with another object that is too small). > Have we tried measuring a microbenchmark with this change to see how much > the cost of a simple DOM getter changes? Can you post a microbenchmark I can test? > >+++ b/js/src/jsfriendapi.h > >+ if (sobj->slotRef(slot).isMarkable() || value.isMarkable()) > > Why does the isMarkable() no longer need to be ifdef JSGC_GENERATIONAL? This is cleanup, removing this optimization that is only in place in builds without ggc. I can restore this code and add an AssignmentMightNeedBarrier helper though if that would make more sense. > but won't be clean to fix until we start storing the proxy handler in the clasp. OK, that seems fine; we've been meaning to do that for a while anyway. Especially if this lands right after this next uplift instead of right before, which I suspect is what will happen anyway. > Can you post a microbenchmark I can test?. > This is cleanup, removing this optimization that is only in place in builds without ggc. Oh, I see, isMarkable() is defined unconditionally. Yeah, this seems fine. (In reply to Boris Zbarsky [:bz] from comment #30) >. I bumped the count for more consistent results and tried this benchmark with and without this patch. Without this patch I get about 5.3 ns per iteration, with this patch I get about 5.8 ns per iteration. So this has slowed down by about 10%, but we'll be able to get that back without too much work once bug 966518 lands. Is this OK? Yeah, that sounds just fine; this is about the worst possible case, so the relative hit would be smaller in other cases. Thank you for checking that! Comment on attachment 8502721 [details] [diff] [review] typed object and typed array fixes Review of attachment 8502721 [details] [diff] [review]: ----------------------------------------------------------------- I read through the JIT portions but I don't know enough to review them. Jan, can you take a quick look at the JIT parts? ::: js/src/builtin/TypedObject.cpp @@ +1590,5 @@ > > + OutlineTypedObject *typedObj = &obj->as<OutlineTypedObject>(); > + > + typedObj->setOwnerNoBarrier(nullptr); > + typedObj->setData(nullptr); These separate setters for owner and data seem a little too accident prone. I think I'd prefer setOwnerAndDataNoBarrier setOwnerAndData setData This one would be setOwnerAndDataNoBarrier @@ +1608,5 @@ > if (!buffer.addView(cx, this)) > CrashAtUnhandlableOOM("TypedObject::attach"); > > + setOwnerNoBarrier(&buffer); > + setData(buffer.dataPointer() + offset); setOwnerAndDataNoBarrier, but move the !isAttached() assert to immediately before to make the NoBarrier part more obvious. @@ +1633,5 @@ > + > + // Trigger a post barrier when attaching an object outside the nursery > + // to one that is inside it. > + if (!IsInsideNursery(this) && IsInsideNursery(owner)) > + cx->runtime()->gc.storeBuffer.putWholeCellFromMainThread(this); setOwnerAndData ::: js/src/builtin/TypedObject.h @@ +688,5 @@ > + // barriers are managed directly. > + JSObject *owner_; > + > + // Data pointer to some offset in the owner's contents. > + uint8_t *data_; It's so nice to be able to do this, and not force everything to be a Value! @@ +696,5 @@ > + uint32_t unsizedLength_; > + > + void setOwnerNoBarrier(JSObject *owner) { > + owner_ = owner; > + } Yeah, I'd rather not be able to set the owner without touching data. @@ +709,5 @@ > + // Use a larger allocation kind for unsized arrays, to accommodate the > + // unsized length. > + if (descr->is<UnsizedArrayTypeDescr>()) > + return gc::FINALIZE_OBJECT2; > + return gc::FINALIZE_OBJECT0; It would be nice to have a better-looking mechanism for this, but never mind for now. @@ +736,5 @@ > + return unsizedLength_; > + } > + > + void setData(uint8_t *data) { > + data_ = data; Would it be possible to assert that if data is non-null, then it points within owner's memory region? @@ +795,5 @@ > // Class for an opaque typed object whose data is allocated inline. > class InlineOpaqueTypedObject : public TypedObject > { > + // Start of the inline data, which immediately follows the shape and type. > + uint8_t data[1]; Shouldn't this be data_? ::: js/src/vm/ArrayBufferObject.cpp @@ +1016,5 @@ > return as<TypedObject>().typedMem(); > } > > +void > +ArrayBufferViewObject::setDataPointer(uint8_t *data) This is going to collide with my patch to remove ArrayBufferViewObject. But the logic is exactly right. It'll just need to be a static function, I guess. (In reply to Steve Fink [:sfink] from comment #33) > @@ +795,5 @@ > > // Class for an opaque typed object whose data is allocated inline. > > class InlineOpaqueTypedObject : public TypedObject > > { > > + // Start of the inline data, which immediately follows the shape and type. > > + uint8_t data[1]; > > Shouldn't this be data_?. (In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #34) >. There are several places we use length-one arrays in a similar fashion to this without issues, such as in SharedScriptData and TypeScript..) FWIW that C++ requirement is pretty out of touch with how heap arrays are used, not just in firefox but in all sorts of systems code. Comment on attachment 8502716 [details] [diff] [review] Remove slots/elements from non-native objects Review of attachment 8502716 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsobj.h @@ +190,5 @@ > + // valid for native objects, but during initialization are set for all > + // objects. For non-native objects, these must not be dynamically allocated > + // pointers which leak when the non-native object finishes initialization. > + inline void setInitialSlots(js::HeapSlot *slots); > + inline void setInitialElements(js::HeapSlot *elements); For setInitialElements, there appears to be only one caller which is a JSObject method; so could you remove this method from the public interface and do the static_cast+initialize+comment at the one callsite? For setInitialSlots, there seem to be a bunch of sites that assign slots that might be dynamically allocated, but I'm assuming that, for non-native objects, the nDynamicSlots = 0 so stored pointer is null? Is that right? Anyhow, this is a somewhat dangerous function for such an innocent name; how about giving it a more descriptive (scarier) name or instead making it a member of NativeObject and then having the callsites static_cast to a NativeObject with comments explaining why that's ok? ::: js/src/jsobjinlines.h @@ +302,5 @@ > + // objects can't have any fixed slots, for compatibility with > + // GetReservedOrProxyPrivateSlot. > + MOZ_ASSERT_IF(!type->clasp()->isNative(), JSCLASS_RESERVED_SLOTS(type->clasp()) == 0); > + MOZ_ASSERT_IF(!type->clasp()->isNative(), !type->clasp()->hasPrivate()); > + MOZ_ASSERT_IF(!type->clasp()->isNative(), shape->numFixedSlots() == 0); Could you also assert !native implies shape->slotSpan() == 0? @@ +324,4 @@ > > size_t span = shape->slotSpan(); > if (span) > + obj->as<js::NativeObject>().initializeSlotRange(0, span); Pre-existing, but could you change to "if (size_t span = shape->slotSpan()"? ::: js/src/vm/NativeObject.h @@ +354,5 @@ > + /* Slots for object properties. */ > + js::HeapSlot *slots; > + > + /* Slots for object dense elements. */ > + js::HeapSlot *elements; In this (or a follow-up rs=me mass-renaming patch) add _ suffixes to these for symmetry with shape_ and type_ in JSObject? Comment on attachment 8502725 [details] [diff] [review] don't use NewObjectCache for non-native objects Review of attachment 8502725 [details] [diff] [review]: ----------------------------------------------------------------- That does sound like a good idea to investigate if this can be removed in a follow-up. (In reply to Brian Hackett (:bhackett) from comment #35) >.) Ah. That's fine, then. > FWIW that C++ requirement > is pretty out of touch with how heap arrays are used, not just in firefox > but in all sorts of systems code. Might be, but we go to war with the language we have, not the language we wish we had. And the language we have says you can't access stuff through these arrays past their first element. Comment on attachment 8502721 [details] [diff] [review] typed object and typed array fixes Review of attachment 8502721 [details] [diff] [review]: ----------------------------------------------------------------- The Ion changes look good to me. Comment on attachment 8502717 [details] [diff] [review] new proxy layout Review of attachment 8502717 [details] [diff] [review]: ----------------------------------------------------------------- Cool! ::: js/src/jsgc.cpp @@ +4375,5 @@ > return obj->is<CrossCompartmentWrapperObject>() && !IsDeadProxyObject(obj); > } > > /* static */ unsigned > ProxyObject::grayLinkSlot(JSObject *obj) Can you rename this to grayLinkExtraSlot? ::: js/src/jsproxy.h @@ +347,5 @@ > +// type, the proxy has a ProxyDataLayout structure with a pointer to an array > +// of values and the proxy's handler. This is designed both so that proxies can > +// be easily swapped with other objects (via RemapWrapper) and to provide > +// simple external storage for proxies that mimics the layout used for other > +// objects. Can you please add that |values| and |handler| take the same space that |slots| and |elements| take in a NativeObject, so that ProxyObject and NativeObject have the same size? @@ +360,5 @@ > +GetProxyDataLayout(JSObject *obj) > +{ > + MOZ_ASSERT(IsProxy(obj)); > + return reinterpret_cast<ProxyDataLayout *>(reinterpret_cast<uint8_t *>(obj) + > + 2 * sizeof(void *)); I'd rather we declare this 2*sizeof(void*) number as a global const somewhere and then assert that it's equal to sizeof(JSObject) in some place where both are available. In addition, I think we should have an assertion that sizeof(ProxyObject) == sizeof(JSObject_Slots0) == sizeof(NativeObject) somewhere. ::: js/src/vm/ProxyObject.cpp @@ +50,3 @@ > return nullptr; > > + RootedObject obj(cx, NewObjectWithGivenProto(cx, clasp, proto, parent, allocKind, newKind)); It seems a little weird that this function calls setInitialElements and setInitialSlots, which cast to a NativeObject*. But it doesn't seem like that would actually cause problems besides confusion. Eventually it would be nice to splits this path a bit more though. Can you please add a comment here explaining that this function will initialize proxy->data to some possibly strange values, but we'll just overwrite them immediately? @@ +74,5 @@ > { > + Value *vp = &GetProxyDataLayout(this)->values->privateSlot; > + > + // Trigger a barrier before writing the slot. > + if (vp->isMarkable() || priv.isMarkable()) This check is supposed to be an optimization to avoid write barriers. It seems particularly useless here, since setCrossCompartmentPrivate will always be called with a markable value. So let's just take the slow path. In addition, if you make the change I recommend below, we can just do |*slotOfPrivate() = priv|. ::: js/src/vm/ProxyObject.h @@ +33,3 @@ > void setSameCompartmentPrivate(const Value &priv); > > + Value *slotOfPrivate() { This is kinda scary since it's a really easy way for someone to write to the private and skip write barriers. I don't see any reason why we can't return a HeapValue here though. You'll have to cast, but that seems fine to me. I think the only reason we can't make privateSlot a HeapValue is that it's in a public header. This should also allow you to removed the uses of Unbarriered marking functions earlier in the patch. It might be nicer to have a SpiderMonkey-internal version of ProxyDataLayout that does use HeapValue for these fields, but maybe that's too much trouble. @@ +68,4 @@ > } > > private: > + Value *slotOfExtra(size_t n) { I think a HeapValue would be better here too. Comment on attachment 8502723 [details] [diff] [review] fix tradeguts Review of attachment 8502723 [details] [diff] [review]: ----------------------------------------------------------------- This is a really nice cleanup! Can you please remove the crashOnFailure parameter from SetClassAndProto? ::: js/src/jsobj.cpp @@ +2352,5 @@ > + > + if (hasPrivate()) > + setPrivate(priv); > + else > + MOZ_ASSERT(!priv); This seems a little odd. I get that we want |a| and |b| to both have private pointers or neither. But are private pointers not allowed to be null? I'd rather this were an up-front assertion about |a/b->hasPrivate()|. @@ +2370,5 @@ > + initSlotRange(0, values.begin(), values.length()); > +} > + > +/* static */void > +JSObject::TradeGuts(JSContext *cx, JSObject *a, JSObject *b) Can we just fold this code into JSObject::swap? I don't see any real distinction between them. (In reply to Bill McCloskey (:billm) from comment #41) > This seems a little odd. I get that we want |a| and |b| to both have private > pointers or neither. But are private pointers not allowed to be null? I'd > rather this were an up-front assertion about |a/b->hasPrivate()|. It's fine if one of the objects has a private pointer but the other one doesn't. For native objects we just saved the original private pointer of the object, and reassign it to the appropriate slot in its new layout after it has been swapped. The MOZ_ASSERT(!priv) is checking we didn't save some bogus value if the object didn't even have a private pointer. Add _ suffixes for NativeObject::slots/elements:
https://bugzilla.mozilla.org/show_bug.cgi?id=1073842
CC-MAIN-2017-43
refinedweb
4,513
53.21
Win a copy of Barcodes with iOS this week in the iOS forum or Core Java for the Impatient in the Java 8 forum! H Und wrote:We just came across the following thing, which is very interesting and misleading the other program by its outcome. Could you please tell me, what is wrong with the following little program. public class CastingClass { static double x = 269.28; public static void printValue(){ System.out.println("Original Value: " + x); System.out.println("Before Casting; " + x * 100); int i = (int) (x * 100); System.out.println("After Casting: " + i); } static public void main(String[] args){ printValue(); } } // I am getting the following result, which is not correct. ------------------------------------------------- Original Value: 269.28 Before Casting, but multiplying with 100: 26927.999999999996 After Casting: 26927 ---------------------------------------------------------
http://www.coderanch.com/t/557045/Performance/java/Casting-double-int-leading-correct
CC-MAIN-2015-11
refinedweb
127
61.02
Vintage Royal Copley Apple Wall Pocket This item has been shown 0 times. Vintage Royal Copley Apple Wall Pocket: $5 A vintage used Royal Copley Apple Wall Pocket that is in great condition not cracked or chipped. Approximately 6" tall and 6 1/2" wide. ..................... If for any reason you feel this item was not accurately described in the listing, please contact us and we will gladly refund your money upon return (we pay the shipping for the return). All we ask in return is that if you are unsatisfied for any reason, you give us a chance to rectify the situation before leaving response. Your business is very important to us and so is our response. ::::::::::::::::::: Terms of Sale …. Buyer prepays high offer plus shipping & insurance. All payments must be made. Vintage Royal Copley Apple Wall Pocket: $5 Vintage "royal Copley" Oriental Asian Girl Headvase Pottery Planter Wall Pocket Lovely Ornate Low Relief Art Deco Style Vase Very Rare Royal Copley Teddy Bear Brown Horizontal Blue Green Sucker Figurine Vintage Royal Copley Parrot Bird On Branch Ceramic Bud Vase 5" Small Vintage Royal Copley Baby Mallard Royal Copley Doe Head Vase
http://www.holidays.net/store/Vintage-Royal-Copley-Apple-Wall-Pocket_390636215993.html
CC-MAIN-2017-51
refinedweb
192
60.55
Next: Animation, Previous: Using MathGL window, Up: Basic usage [Contents][Index] Another way of using MathGL library is the direct writing of the picture to the file. It is most usable for plot creation during long calculation or for using of small programs (like Matlab or Scilab scripts) for visualizing repetitive sets of data. But the speed of drawing is much higher in comparison with a script language. The following code produces a bitmap PNG picture: #include <mgl2/mgl.h> int main(int ,char **) { mglGraph gr; gr.Alpha(true); gr.Light(true); sample(&gr); // The same drawing function. gr.WritePNG("test.png"); // Don't forget to save the result! return 0; } For compilation, you need only libmgl library not the one with widgets gcc test.cpp -lmgl This can be important if you create a console program in computer/cluster where X-server (and widgets) is inaccessible. The only difference from the previous variant (using windows) is manual switching on the transparency Alpha and lightning Light, if you need it. The usage of frames (see Animation) is not advisable since the whole image is prepared each time. If function sample contains frames then only last one will be saved to the file. In principle, one does not need to separate drawing functions in case of direct file writing in consequence of the single calling of this function for each picture. However, one may use the same drawing procedure to create a plot with changeable parameters, to export in different file types, to emphasize the drawing code and so on. So, in future I will put the drawing in the separate function. The code for export into other formats (for example, into vector EPS file) looks the same: #include <mgl2/mgl.h> int main(int ,char **) { mglGraph gr; gr.Light(true); sample(&gr); // The same drawing function. gr.WriteEPS("test.eps"); // Don't forget to save the result! return 0; } The difference from the previous one is using other function WriteEPS() for EPS format instead of function WritePNG(). Also, there is no switching on of the plot transparency Alpha since EPS format does not support it. Next: Animation, Previous: Using MathGL window, Up: Basic usage [Contents][Index]
http://mathgl.sourceforge.net/doc_ru/Drawing-to-file.html
CC-MAIN-2017-13
refinedweb
366
55.84
New Courses Available on Struts, JSF, Spring, Hibernate, AJAX (0 messages) About Objects has released a new suite of courses geared exclusively towards enterprise development with Java open source frameworks. Enrollment is now open for public classes, and classes can also be delivered onsite at your location or in private training sessions at our fully-equipped facilities. If you or your team is looking for training on Struts, JSF, Hibernate ORM, Spring, AJAX, and the like (or Objective C/Cocoa for that matter) and would like to learn from folks who are authors and open source committers, who love to teach, and who aren't satisfied unless each student leaves prepared to do some meaningful work in the technology under study, please give us a call or drop us an email. The following schedule is for public classes offered in our Reston, VA location during the month of November: Nov 5 – Nov 9: Introduction to JSF, $2,495. Nov 12 – Nov 14: JPA Development with the Hibernate® ORM, $1,750. Nov 15 – Nov 16: Java Development with Spring, $1,250. Nov 19 – Nov 20: AJAX for the Enterprise, $1,250. Nov 26 – Nov 30: Java Programming, $2,495. Please visit our website for more information, including a full schedule of upcoming classes. A free PDF download of our new curriculum guide is available here. - Posted by: Jonathan Lehr - Posted on: October 01 2007 11:58 EDT
http://www.theserverside.com/discussions/thread.tss?thread_id=47093
CC-MAIN-2015-27
refinedweb
236
59.03
Scikit-learn is one of the most useful Python libraries for machine learning. All the concepts that we study about machine learning theoretically can be implemented by using the Scikit-learn library in Python. In this article, I will take you through a tutorial on Scikit-learn for machine learning using Python. What is Scikit-learn? Scikit-learn is a Python library that is one of the most useful Python libraries for machine learning. It includes all the algorithms and tools that we need for the task of classification, regression and clustering. It also includes all the methods for evaluating the performance of a machine learning model. Below are some of the advantages of using Scikit-learn for machine learning: - It is very simple to use. - It provides very efficient tools for predictive analytics. - Easily accessible to everyone. - Built on Numpy, sciPy, and matplotlib libraries in Python. - Just like the Python programming language, it is also open-source and commercially usable. Many companies are using Scikit-learn in their machine learning models. some of the big names among those companies are J.P. Morgan and Spotify. In J.P. Morgan, the Scikit-learn toolkit is widely used across all application of the bank for the tasks of classification and predictive analytics. In Spotify, Scikit-learn is used for generating music recommendations to provide a better user experience. Scikit-learn Tutorial using Python The Scikit-learn library in Python is very easy to use for all the tasks of machine learning. if you are working on applications that deal with classification, regression or clustering then most of the work will be implemented using this library only. Now, I will take you through a tutorial on the Scikit-learn library in Python for machine learning. The use of this library generally starts with splitting the dataset into training and test sets, here is how you can split your data: from sklearn.model_selection import train_test_split x_train, x_test, y_train, y_test = train_test_split(x, y, random_state=0) Then we need to process the data to fit it into a machine learning model. Here we generally need to scale the data which can be done by using Standardization and normalization. Below is the scikit-learn’s way of processing the data: As the next step, we need to fit the data into the model. Below is an implementation of training some of the most common machine learning algorithms: The next step is to make predictions on the test set: y_pred = lr.predict(x_test) ypred = k_means.predict(x_test) y_pred = knn.predict_proba(x_test) The last step is to determine how the machine learning model performed on the test set. Below are the method provided by the Scikit-learn library to evaluate the performance of machine learning models for the tasks of classification, regression, and clustering: Summary This was just a simple overview of the methods provided by the Scikit-learn library in Python for machine learning. This library has so many functions that cannot be covered in one article. Thus, all of the methods provided by scikit-learn can be learned from here among several other libraries and models for machine learning. Hope you liked this article on the tutorial on the Scikit-library for machine learning using Python. Please feel free to ask your valuable questions in the comments section below.
https://thecleverprogrammer.com/2021/04/03/scikit-learn-tutorial-for-machine-learning/
CC-MAIN-2021-43
refinedweb
553
55.44
This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project. On Fri, Aug 9, 2019 at 10:33 AM Richard Sandiford <richard.sandiford@arm.com> wrote: > > In this PR we have two return paths from a function "map". The common > code sets <result> to the value returned by one path, while the other > path does: > > <retval> = map (&<retval>, ...); > > We treated this call as tail recursion, losing the copy semantics > on the value returned by the recursive call. > > We'd correctly reject the same thing for variables: > > local = map (&local, ...); > > The problem is that RESULT_DECLs didn't get the same treatment. > > Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? OK. Richard. > Richard > > > 2019-08-09 Richard Sandiford <richard.sandiford@arm.com> > > gcc/ > PR middle-end/90313 > * tree-tailcall.c (find_tail_calls): Reject calls that might > read from an escaped RESULT_DECL. > > gcc/testsuite/ > PR middle-end/90313 > * g++.dg/torture/pr90313.cc: New test. > > Index: gcc/tree-tailcall.c > =================================================================== > --- gcc/tree-tailcall.c 2019-05-29 10:49:37.868706770 +0100 > +++ gcc/tree-tailcall.c 2019-08-09 09:31:27.441318174 +0100 > @@ -491,6 +491,35 @@ find_tail_calls (basic_block bb, struct > && !stmt_can_throw_external (cfun, stmt)) > return; > > + /* If the function returns a value, then at present, the tail call > + must return the same type of value. There is conceptually a copy > + between the object returned by the tail call candidate and the > + object returned by CFUN itself. > + > + This means that if we have: > + > + lhs = f (&<retval>); // f reads from <retval> > + // (lhs is usually also <retval>) > + > + there is a copy between the temporary object returned by f and lhs, > + meaning that any use of <retval> in f occurs before the assignment > + to lhs begins. Thus the <retval> that is live on entry to the call > + to f is really an independent local variable V that happens to be > + stored in the RESULT_DECL rather than a local VAR_DECL. > + > + Turning this into a tail call would remove the copy and make the > + lifetimes of the return value and V overlap. The same applies to > + tail recursion, since if f can read from <retval>, we have to assume > + that CFUN might already have written to <retval> before the call. > + > + The problem doesn't apply when <retval> is passed by value, but that > + isn't a case we handle anyway. */ > + tree result_decl = DECL_RESULT (cfun->decl); > + if (result_decl > + && may_be_aliased (result_decl) > + && ref_maybe_used_by_stmt_p (call, result_decl)) > + return; > + > /* We found the call, check whether it is suitable. */ > tail_recursion = false; > func = gimple_call_fndecl (call); > Index: gcc/testsuite/g++.dg/torture/pr90313.cc > =================================================================== > --- /dev/null 2019-07-30 08:53:31.317691683 +0100 > +++ gcc/testsuite/g++.dg/torture/pr90313.cc 2019-08-09 09:31:27.437318206 +0100 > @@ -0,0 +1,33 @@ > +// { dg-do run } > + > +#include <stddef.h> > + > +namespace std { > + template<typename T, size_t N> struct array { > + T elems[N]; > + const T &operator[](size_t i) const { return elems[i]; } > + }; > +} > + > +using Coordinates = std::array<double, 3>; > + > +Coordinates map(const Coordinates &c, size_t level) > +{ > + Coordinates result{ c[1], c[2], c[0] }; > + > + if (level != 0) > + result = map (result, level - 1); > + > + return result; > +} > + > +int main() > +{ > + Coordinates vecOfCoordinates = { 1.0, 2.0, 3.0 }; > + > + auto result = map(vecOfCoordinates, 1); > + if (result[0] != 3 || result[1] != 1 || result[2] != 2) > + __builtin_abort (); > + > + return 0; > +}
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-08/msg00613.html
CC-MAIN-2020-16
refinedweb
542
58.99
from mpl_toolkits.mplot3d import Axes3D ax.scatter(X_lda[:,0], X_lda[:,1], X_lda[:,2], alpha=0.4, c=y_train, cmap='rainbow', s=20) plt.legend() plt.show() Essentially I'd like to add a legend for the scatterplot that shows the unique values in y_train and what color point it corresponds to on the plot. The output plot: Producing either a legend or a colorbar for a scatter is usually quite simple: import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D x,y,z = (np.random.normal(size=(300,4))+np.array([0,2,4,6])).reshape(3,400) c = np.tile([1,2,3,4], 100) fig, ax = plt.subplots(subplot_kw=dict(projection="3d")) sc = ax.scatter(x,y,z, alpha=0.4, c=c, cmap='rainbow', s=20) plt.legend(*sc.legend_elements()) plt.colorbar(sc) plt.show() Edit: After seeing @bigreddot's solution, I agree that this approach is somewhat more complicated than strictly necessary. I leave it here in case somebody needs more fine-tuning for their colorbar or legend. Here is a way to create both a custom legend and a custom colorbar for the 3D graph. So you can chose one or the other, depending on specific needs. I'm not sure how the y_train is distributed; in the code some float values of a limited set are simulated. Also, it is not clear what the labels should mention, so now they just put the value of y_train. from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib as mpl N = 1000 X_lda = np.random.gamma(9.0, 0.5, (N,3)) y_train = np.random.randint(0, 6, N) X0 = np.random.gamma(5.0, 1.5, (N,3)) X1 = np.random.gamma(1.0, 1.5, (N,3)) for i in range(3): X_lda[:,i] = np.where (y_train == 0, X0[:,i], X_lda[:,i]) X_lda[:,i] = np.where (y_train == 1, X1[:,i], X_lda[:,i]) y_train = np.sin(y_train*.2 + 10) * 10.0 + 20.0 fig = plt.figure(figsize = (15,15)) ax = fig.add_subplot(111, projection = '3d') ax.scatter(X_lda[:,0], X_lda[:,1], X_lda[:,2], alpha=0.4, c=y_train, cmap='rainbow', s=20) norm = mpl.colors.Normalize(np.min(y_train), np.max(y_train)) cmap = plt.get_cmap('rainbow') y_unique = np.unique(y_train) legend_lines = [mpl.lines.Line2D([0],[0], linestyle="none", marker='o', c=cmap(norm(y))) for y in y_unique] legend_labels = [f'{y:.2f}' for y in y_unique] ax.legend(legend_lines, legend_labels, numpoints = 1, title='Y-train') sm = plt.cm.ScalarMappable(cmap=cmap, norm=norm) sm.set_array([]) plt.colorbar(sm, ticks=y_unique, label='Y-train') plt so I'm learning tkinter by building a "weightlifting GUI" for funAs it stands, the application mostly runs I am trying to construct a live graph in python to plot random numbers in a graph with a fixed plot window The width of the plot window will be 20 samplesFor the 21st sample, the 1st sample will dissappear from the right side I have a list of dictionaries (not all in the same length) like - I'm learning how to code in Python and I have this problem: I want to store the output values of a function (function2) that depends on another function (Function1)I want to store them in order to compute its mean, variance, etc
https://cmsdk.com/python/3d-plotting-in-python--adding-a-legend-to-scatterplot.html
CC-MAIN-2020-10
refinedweb
559
60.82
[2.2] panel with html:'' renders differently in IE and FF [2.2] panel with html:'' renders differently in IE and FF If you create a Panel with html:'' (empty string) and a buttons[], and place it in the south region of a borderLayout Viewport, in IE the contents of the southern panel appear as a white strip; but in Firefox the contents of the southern panel do not take up any horizontal space - the buttons in the south are flush against the content of the center. This happens in a quirks mode or strict DTD defined page. Source to reproduce: Code: Ext.namespace("Test"); Ext.onReady(function() { Test.closeButton = new Ext.Button( { text:'Close', handler: function(){alert('close');} }); Test.helpButton = new Ext.Button( { text:'Help', handler: function(){alert('help');} }); Test.centerPanel = new Ext.Panel( { region: 'center', html: 'Space is different in IE and FF' }); Test.buttonPanel = new Ext.Panel( { region: 'south', border: false, buttonAlign: 'right', html: '', buttons: [ Test.helpButton, Test.closeButton ] }); Test.viewport = new Ext.Viewport( { layout: 'border', items: [ Test.centerPanel, Test.buttonPanel ] }); }); - Join Date - Apr 2007 - Location - Sydney, Australia - 15,065 - Vote Rating - 96 I can see the issue you're talking about, however it makes no difference whether the html exists or not.Evan Trimboli Sencha Developer Twitter - @evantrimboli Don't be afraid of the source code!
http://www.sencha.com/forum/showthread.php?54268-2.2-panel-with-html-renders-differently-in-IE-and-FF&s=9bdaa2514ec8127387d53b496964d2b8&p=258667
CC-MAIN-2013-20
refinedweb
220
59.4
Chatlog 2009-02-24 From OWL See original RRSAgent log and preview nicely formatted version. Please justify/explain all edits to this page, in your "edit summary" text. <sandro> PRESENT: Ian, Boris, Smith, Zhe, PFPS, Jie, Ivan, mschnei, markus, sandro, alanruttenberg <sandro> REMOTE: rees, evan, achille, uli, bijan, christine, deborah <jar> hello <jar> I can call in for the imports discussion - if that is appropriate <jar> Just sent email to the public-wg-comments list on the subject. <jar> The meeting is starting in 1 minute, right? Am I on the right IRC channel? <jar> 0 minutes? <bmotik> Zakim, this will be owl <Zakim> ok, bmotik; I see SW_OWL(F2F)8:00AM scheduled to start 62 minutes ago <jar> hello? am I on the right irc channel? <jar> (for owlwg f2f) <Zakim> SW_OWL(F2F)8:00AM has now started <Zakim> +jar <Zakim> -jar <Zakim> SW_OWL(F2F)8:00AM has ended <Zakim> Attendees were jar <Zakim> SW_OWL(F2F)8:00AM has now started <Zakim> +jar <alanr> Eta 5 min <jar> ok, so it's IRC owl, but zakim owlwg. <jar> I'm the only one on the call now - could someone dial in from the polycom please? <alanr> Anyone elseon yet ? <pfps> scribenick: pfps <IanH> q? <IanH> zakim, who is here? <Zakim> On the phone I see jar <Zakim> On IRC I see jar, alanr, msmith, MarkusK_, Zakim, bmotik, pfps, IanH, bijan, uli, sandro, ewallace, trackbot <Zakim> +MIT346 <bijan> I'll primarily be ircing, but can, mostly, call in at key points at least until lunch <pfps> Topic: OWL RL <pfps> ian: comment 61 and 15 <pfps> ian: approve response for 15? <pfps> Proposed: send response for 15 <IanH> +1 <pfps> pfps: +1 ALU <MarkusK_> +1 <bijan> +1 <bmotik> +1 <zwu2> +1 ORACLE <msmith> +1 <pfps> RESOLVED: send response for 15 <schneid> +1 (15) <pfps> ian: lc comment 61 - why only RDF semantics for RL? <pfps> ivan: all profiles can be interpreted both ways <pfps> ian: yes, but conformance may be a bit off <pfps> msmith: conformance needs to be changed <pfps> ian: no disagreement - documents need to be clarified <pfps> boris: actual solution - what does an OWL 2 RL checker do <pfps> msmith: EL and QL are DL semantics - RL and Full are RDF semantics <pfps> ian: so we parametrize on the semantics <pfps> ian: we say that all conformance can use either semantics <pfps> ian: RL needs a bit of work for RDF syntax RL entailment checkers <pfps> schneid: RDF semantics doesn't give any benefit for EL and QL <pfps> markus: can you notice a difference in EL and QL <pfps> msmith: yes <pfps> ian: no computational guarantees except for direct semantics <pfps> msmith: we define OWL 2 RL ontology document but then don't use it <pfps> ian: need editorial fixup in conformance document (only) <pfps> ian: respond to Jos that he is right and we are fixing it in conformance <pfps> action: ian to make fixes for 61 and craft response <trackbot> Created ACTION-298 - Make fixes for 61 and craft response [on Ian Horrocks - due 2009-03-03]. <pfps> ian: conformance is parametrized on semantics <pfps> topic: OWL QL <sandro> subtopic: Add reflexive, irreflexive, and asymmetric? <pfps> ian: uli sent a message on how the submitters of the comments feel about changes <pfps> scribenick: jie <pfps> ian: profiles needs to be clear that results are for direct semantics only <MarkusK_> markus: when allowing RDF semantics for profiles, we need to make sure that the Profiles document takes this into account <MarkusK_> markus: especially the complexity part does not seem to mention this now <sandro> zakim, who is here? <Zakim> On the phone I see jar, MIT346 <Zakim> On IRC I see Jie, sandro, alanr, schneid, ivan, zwu2, jar, msmith, MarkusK_, Zakim, bmotik, pfps, IanH, bijan, uli, ewallace, trackbot <Jie> Ian: Moving again to QL <Jie> Ian: Uli is talking with the DL-Lite folks <Jie> ... and people with different and incompatible extensions <Jie> ... people agree we can't have reflexive, irreflexive and assymmetric all together <Jie> ... and we could come up with reasonably convincing use cases that why we need, as much as we can for the language as a whole, so, if it is useful, OWL in general. But we don't probably have, in the document, at this moment, any terribly convincing use case. Although, we did have some comments from some of the LC comments, said "OWL is really useful, I like to use X" as X actually points to these properties in particular. <Zakim> +Evan_Wallace <Jie> Mike: we have implementation showing these three are relatively trivial things <Zakim> +[IBM] <Achille> zakim, ibm is me <Zakim> +Achille; got it <sandro> rrsagent, pointer? <RRSAgent> logging to 14:32:26 <RRSAgent> RRSAgent has joined #owl 14:32:27 <RRSAgent> logging to 14:32:58 <Jie> Ian: Healthcare and Life Science WG, and Semantic Web Deployment WG both commented on usefulness of reflexive, irreflexive, assymmetric and disjoint properties. 14:33:48 <Zakim> +??P15 14:33:49 <Jie> Ivan: that is a different argument. It is one thing that these features are in OWL 2 -- i don' think there is any discussion on that -- the other things is that they certainly haven't commented to have them in QL. 14:33:49 <Jie> Ian: but they are useful. 14:33:49 <Jie> Ivan: the problem is even if it is technically possible to add such features, I'm not sure we should 14:33:57 <uli> zakim, ??P15 is me 14:33:57 <Zakim> +uli; got it 14:34:09 <uli> zakim, mute me 14:34:09 <Zakim> uli should now be muted 14:34:11 <Jie> ... add a new feature to a profile without major justification may not be good 14:34:18 <IanH> zakim, who is here? 14:34:18 <Zakim> On the phone I see jar, MIT346, Evan_Wallace, Achille, uli (muted) 14:34:19 <Zakim> On IRC I see RRSAgent, Achille, Jie, sandro, alanr, schneid, ivan, zwu2, jar, msmith, MarkusK_, Zakim, bmotik, pfps, IanH, bijan, uli, ewallace, trackbot 14:34:31 <Jie> ... I'm worry about doing that. 14:34:31 <Jie> Ian: on the plus side, none of these people care about QL, so they won't care about features in it. 14:34:44 <IanH> q? 14:34:56 <Jie> Ivan: I'm not clear, we get overall negative feedback on Profile all together. 14:36:05 <Jie> Mike: The implementation shows the three properties are easy to implement, and they allow more ontologies to be expressible in QL, which makes QL tools more useful to the community. I think we should push the language as much we can if it does not comprise the tractability -- and in this case it doesn't -- for me, I think a justification is that it is in OWL and we can add it without technical difficulty. 14:36:05 <Jie> Ian: can you get use cases from your customers? 14:36:23 <Jie> Mike: for QL, linked open data people would need it 14:36:43 <Jie> ... even though I don't have a specific example now 14:37:06 <Jie> Alan: Comments on RL says there is additional complexity of the language to learn because of the profile. Profile document needs to be more user understandable 14:37:31 <Jie> ... adding a feature to QL will not be going to impact that, and it is a new profile, we are offering a new functionality, we want to offer the best we can without adding extra trouble. 14:37:42 <sandro> zakim, who is on the call? 14:37:42 <Zakim> On the phone I see jar, MIT346, Evan_Wallace, Achille, uli (muted) 14:38:00 <Jie> Zhe: I have a question, if QL implementers implement what is described in the document, plus some more, will that make the implementation not conformant? 14:38:00 <Jie> Ian: I believe the implementation is conformant. (Peter: add more?) Yeah, I can see Peter thinks it is not, because it will find entailment that is not justified by the document. If they use a document that contains things not in the QL, then it is outside the profile. The document is not the QL document. It doesn't matter. 14:38:23 <Jie> Zhe: we can define the core stuff, and vendors can add more they need 14:38:28 <sandro> jar, ewallace, uli, Achille --- the webcam is active again -- 14:38:41 <uli> +1 to Markus 14:38:55 <uli> and Mike, sorry! 14:39:26 <Jie> Markus: I agree with Mike, not because I have more use cases, but I think it is a general rule, to other 2 profiles as well, we add as many OWL 2 features as possible without compromising good computational property. It will be strange engineering if we do that for the two profiles but not to the last one -- and we know it could be done easily. In general I think it is good because, profile is aimed at making more ontology processing easier, not for having more implementation conformant. Out target should be adding more ontologies to the profile, not to having more implementation in supporting them. 14:40:03 <Jie> Ivan: Answer to Zhe, the problem is interoperability. If I write down an ontology for a given profile, I want to be sure I can run on other engines. Of course you can implement more, but it should be such that I can rely on any implementation that is conformant. 14:40:03 <Jie> ... The other thing. If we don't know what community really uses this, and we do it because it can be done, then this is not right for standardization. 14:40:48 <Jie> ... This is the argument, and that is what we have to answer to. We sure can implement more, but that's not the point. 14:41:00 <Jie> Ian: I understand that, but I don't see how it applies to the profiles in particular. We have those features, it is not the argument that these features should be in the language. If those features are useful in general, we have a reason to have them in the language, then if they can be accommodated within this profile with good computational property, then surely they should be. If they are not justified in the language, then it is another story. 14:41:57 <Jie> Ivan: The target audience for profiles is different. QL and RL are "entry-level" things in OWL 14:42:01 <Jie> ... they should be easy. 14:42:19 <Jie> Mike: One of the audiences of QL is linked data 14:42:47 <Jie> ... also include people who want to access relational data in DL structure, for instance in distributed query system. 14:42:56 <Jie> ... they are not new to OWL. So at least some targeted audience of QL wants as much as they can get from OWL. 14:43:22 <Jie> Alan: QL and RL are different. 14:43:49 <Jie> ... QL is targeted at low complexity. The more expressivity we can have in QL the better, because it will allow more to be modeled. 14:44:07 <Jie> ... The second comment is, in terms introducing people to the language, we are not designing the language to be introductory, we are designing a language suitable to the community to make them introductory, and purpose of the document is to make the profiles more accessible. 14:44:30 <Jie> Markus: I agree with Ivan we have to take into account the community we target at. If we target linked data with QL, they are very well motivated. 14:44:45 <Jie> Ivan: we are not talking about sameAs, we are talking about reflexive, irreflexive and assymmetric properties. 14:44:54 <Jie> Boris: we have some general misunderstanding why we come to profile. 14:45:05 <Jie> ... My understanding is that the profiles are technologically driven, which means you set yourself a goal, 14:45:36 <Jie> ... such as on processing database data, or low complexity or rule reasoning. Those are objective goals, then the natural thing is to have the most expressive languages to meet these goals. I think it's a misunderstanding to have profile simplified for users. I believe it is a design issue. There are different ways to present simpler versions of OWL, but that does not need to be the profile. If you take the technology driven view, these things should be here. It is not user demand driven, it is technology thing. 14:46:25 <uli> +1 to Boris -- this distinction makes "space" for vendor's PR and for teaching/KT 14:46:25 <Jie> Sandro: it reminds me of OWL Lite, which is designed to be easier to use. 14:46:34 <ewallace> This is the same discussion around OWL Lite 14:46:39 <ewallace> as Sandro says 14:46:59 <Jie> Zhe: from vendor point of view. If the WG has a specification, no matter how complex it is 14:47:08 <Jie> ... vendors are like to add more. Interoperability does truly matter. Profile, not just QL or RL, should be lean, just the core stuff that is easy. 14:48:12 <Jie> ... I don't think it is necessary to add these features. 14:49:16 <Jie> Peter: Profiles are technical things. If people don't understand, they should look at primer, not profile. 14:49:35 <Jie> Ivan: Profile is not technology driven 14:49:43 <Jie> ... it is user community and requirement driven. 14:49:54 <schneid> q+ 14:50:07 <Jie> ... it should not be the case that we do it because it is doable. I agree with Zhe to keep it as simple as possible. It does not contradict to what Peter said, profile remains a technical document, there has to be primer etc. But adding features just because it can be done is not a good argument for it. 14:51:00 <Jie> Ian: But we are throwing out features. The design is suppose to have all the features that can fit into the computational constraints. We will make a mistake not having them in. 14:51:17 <Jie> Ivan: in QL, the major disagreement is on sameAs 14:52:00 <Jie> Markus: we don't get simpler to move a feature from non-allowed list to the allowed list, especially when the features are supported by 2 of the 3 profiles anyway. 14:52:13 <IanH> q? 14:52:18 <IanH> ack schneid 14:53:06 <Jie> schneid: requirement for QL for processing database data IS a technical requirement. It is not for education of OWL -- that should be from a text book starting with some "smaller' OWL. 14:53:36 <Jie> ... features we should avoid are 14:53:57 <Jie> ... the ones need further understanding of other additional features 14:54:08 <Jie> ... or the ones may be misleading 14:54:21 <Jie> ... I think that's not the case here 14:54:23 <schneid> was owl lite easy to understand for new users? 14:54:40 <Jie> Alan: I don't think profile should be a strictly technically driven presentation. It should be more accessible. We can do it with good editors. Reducing the language does not help anybody. We should focus on how to make the document understandable. 14:55:14 <Jie> Boris: I didn't say the document should be dry, I said the design of the profile should be driven by technology. Obviously the document should be readable. 14:55:25 <IanH> q? 14:55:53 <Jie> ... To answer Ivan, I agree things should be simple. 14:56:10 <Jie> ... but it may exclude some people who wants certain things. The community is so varied, I don't think we have a good definition of what is simple. That's why we have objective criteria: technology. I do agree it is a different issue, if, for example, a particular feature is absolutely necessary, then we should say with respect to these criteria, we can't achieve that. But we should be guided by technology criteria. 14:57:00 <Jie> Ian: I agree with that. Profiles are restrictions from everything in OWL, but we need to restrict iy as little as possible. 14:57:41 <Jie> Ian: In answer to Alan, of course the document should be improved a little 14:57:49 <Jie> ... but this document is not user facing, which should be a guide. 14:58:20 <Jie> ... the specification documents are for people who build systems 14:59:21 <Jie> ... if they run into things they can't understand, there is primer, overview and (there will be) other books 15:00:00 <Jie> Alan: The problem is to reduce redundancy across documents. The syntax is a good example that tries to consolidate more than one point of view, tries to be more accessible by inclusion of examples. We should do so in profile as well. 15:00:39 <Jie> Ian: User focusing documents tell uses which profile to use, not the technical spec document like Profile. 15:01:00 <Jie> Alan: there should be at least a compact but understandable introduction. 15:01:20 <Jie> Ian: I agree. But there is limit. This document is mainly intended for implementers. We should void the mistake that pointing people to the wrong document. 15:01:40 <Jie> Alan: I think the stronger we put on that line, the harder it will be to meaningfully address people's concern about profile. Let's think about how to make the document more accessible. There should be a section on how to select a profile to use; there should be more examples, in particular negative examples: what does not fit into a profile; and some graphic things. There are something to do to make it more pleasant to approach. It will not turn it into Primer. 15:02:07 <Jie> Boris: why we need profile, it is contentious, for example QL. That's why we don't include it in the document. I really think the document is a technical definition. 15:02:50 <Jie> ... there would be extension to introduction, but it will be painful. 15:03:23 <Jie> Zhe: I agree with Alan that a good introduction will be useful. We need better explanation on choice of profiles. We should focus on accessibility. 15:03:56 <Jie> ... for a regular users without good OWL knowledge, which one to choose? 15:04:04 <Jie> ... we should make it clear to them. 15:04:12 <sandro> zakim, who is on the call 15:04:14 <Zakim> I don't understand 'who is on the call', sandro 15:04:17 <sandro> zakim, who is on the call? 15:04:17 <Zakim> On the phone I see jar, MIT346, Evan_Wallace, Achille, uli (muted) 15:04:30 <Jie> Alan: on how to explain database profiles. We don't have to say that is for database, we can explain the consequences that taking one ontologies into one profile than the other, and extending one to get other features and what happens about complexity. We can do it in neutral way. 15:05:23 <ewallace> Ian's suggestion sounds good. 15:05:45 <Jie> Ian: profile can have some discussion and point to the user facing document, but the major explanation should be in the primer. 15:05:51 <ewallace> Explain in detail in Primer, summarize in Profile doc. 15:06:38 <Jie> Ivan: I propose that Sandro puts 2 or 3 paragraphs on high level ways of using profiles. Second, some examples in Profile will help, explaining things such as what can't be done in profiles, in the same way in the syntax document. 15:06:46 <Jie> Boris: I agree 15:07:38 <Jie> Ian: we should go back and focus on decision 15:07:55 <uli> and 15:07:55 <uli> and symmetric 15:08:45 <Jie> PROPOSED: reflexive, symetric, and assymetric should be added to the QL profile. 15:08:47 <pfps> +1 (ALU) 15:08:49 <uli> +1 15:08:49 <alanr> +1 15:08:50 <MarkusK_> +1 15:08:51 <sandro> +1 15:08:52 <Jie> +1 15:08:52 <schneid> +1 15:08:52 <IanH> +1 15:08:55 <ewallace> +0 15:09:00 <ivan> 0 15:09:01 <zwu2> -0 15:09:03 <bmotik> +1 15:09:08 <bijan> 0 15:09:18 <Achille> 0 15:09:22 <msmith> +1 15:09:47 <Jie> RESOLVED: reflexive, symetric, and assymetric should be added to the QL profile. 15:10:04 <alanr> An example that I've recently dealt with on the profiles was a snomed inspired (approximate) workaround for the lack of union in EL. There are benefits and tradeoffs and this might serve as an informative example. 15:10:29 <uli> q+ to explain 15:10:37 <uli> i don't mind 15:10:41 <ivan> ack uli 15:10:42 <uli> zakim, unmute me 15:10:42 <Zakim> uli, you wanted to explain 15:10:44 <Zakim> uli was not muted, uli 15:10:50 <IanH> ack uli <sandro> subtopic: Add sameAs 15:12:14 <alanr> q+ 15:12:42 <uli> zakim, mute me 15:12:42 <Zakim> uli should now be muted 15:12:52 <IanH> q? 15:12:55 <IanH> ack alanr 15:12:57 <Jie> Uli: I want to explain the technical consequence on adding sameAs, and to propose a compromise. QL is to use RDBMS to create your data, and query it using an ontology, such as by a query rewriter. You won't touch your data, just leave the tables as they are. If we add sameAs, that is not longer possible. You can, if you have sameAs, still use a rewriter, in case your RDBMS supports recursive query. Alternatively, you can have materialized view to have sameAs tuples in the view, but that will change the database. 15:13:02 <Jie> ... I suggest to add a note in QL about it: you can add sameAs to QL, then you have to do either one or the other: materialized view or the use of recursive query. 15:13:31 <ivan> q+ 15:13:43 <Jie> Alan: I don't think not touching the database to be a requirement for QL. (schneid, Ian: it is a core requirement). For many users, having an extra table is not an issue. I would suggest to have them in the language, and add a note saying, it requires extra table if you use it. 15:13:45 <uli> no Jie, I said that, if we don't use sameAs, we can use a standard RDBMs system without touching the data. 15:14:08 <uli> ...and if we have sameAs, we need a system.. 15:14:10 <Jie> Zhe: Uli, I have a question: in argument for sameAs, is that also applicable for transitive properties? 15:14:12 <uli> zakim, unmute me 15:14:12 <Zakim> uli should no longer be muted 15:14:19 <IanH> q? 15:14:47 <msmith> no 15:14:51 <alanr> but what about using materialization for transitive 15:15:00 <Jie> Uli: your rules only need to be recursive if you want to compute sameAs, because it is a transitive relation. 15:15:17 <alanr> q? 15:15:22 <uli> zakim, mute me 15:15:22 <Zakim> uli should now be muted 15:15:28 <Jie> Ian: the question is if we have sameAs, could we also have transitive property? 15:15:30 <Jie> Uli: I can only guess, it can be materialized in the same way. 15:15:50 <Jie> Mike: sameAs reduces to reachability in undirected graph, which is provable in LOGSPACE. Transitive property is not in LOGSPACE 15:15:59 <Jie> ... it changes the complexity. 15:16:00 <Jie> Markus: In answer to Zhe: adding an extra table is not a little requirement, such as for updating. Even it is in LOGSPACE in principle, you have to do it in a smart way for updating in LOGSPACE. So having extra table doable in database is not sufficient to have it in QL. It is also true for other profiles. For RL and EL, you can also do everything in database just adding some extra tables and recursive queries. So with recursive queries you also have higher complexity with transitivity etc. 15:16:33 <uli> +1 to Markus 15:16:40 <Jie> Alan: do you really need recursive query once you get the table set up? 15:17:00 <Jie> Markus: No, initially it is recursive to fill the table, but then you can do the updating incrementally using LOGSPACE. 15:17:01 <uli> (the point about QL is "by querying only") 15:17:00 <Jie> Zhe: recursive query is supported in modern databases anyway. 15:17:10 <Jie> Markus: Yes, but it is supported with bag semantics, not set semantics. 15:18:33 <MarkusK_> markus: replying to allen, I do not think that it is enough to state that QL can still be implemented in DBs using "some extra tables" 15:19:28 <MarkusK_> markus: maintaining these tables may not be trivial, and recursive queries and "some extra tables" are sufficient for all OWL 2 profiles, so it is not a specific feature of QL 15:20:17 <MarkusK_> markus: moreover, many RDBMS may have recursive queries that implement a bag (multiset) semantics only, so termination may not be easy to achieve when relying on these queries 15:18:06 <Jie> Boris: adding transitivity is not only about recursive query, because transitive properties could have existential qualification on them. It is not about materializing some extension first using a recursive query, then querying it, because there could be some interaction through the other axioms. 15:18:36 <Jie> ... sameAs is the only thing that can introduce equivalency. 15:18:46 <alanr> zhe asked. We're done now. 15:18:47 <Jie> ... and it can be precomputed. Transitivity is much more complicated. I don't want to go into this. 15:19:00 <Jie> Ian: Transitivity is a side issue. 15:20:57 <Jie> Ivan: I feel get reinforced to know that many modern databases do actually have recursive query. My favorite approach would be that we have sameAs in QL, but make it clear for some implementations it may lead to slower response. For many users, not having sameAs will almost make this profile not useable. 15:21:30 <Jie> Zhe: I'm not arguing for or against sameAs, I'm commenting on the comment on not touching database. It is a nice thing to have, but in practice it is not always doable. For example, you have to rebuild index for better performance. Not touching everything is not that simple. 15:21:54 <Jie> Ian: That's efficiency issue. We have QL is for accessing database that may not even in your control, but just via a query interface. It's quite common. 15:22:51 <Jie> ... if we add sameas, we lose the ability to access db just from a query interface. 15:23:31 <uli> Ivan, you *do* care as a person who wants to query data through an ontology 15:23:47 <Jie> Ivan: if I'm a user, I will not care about how things are technically done. If we have sameAs, some implementation maybe slower than others that have recursive queries, as a user I don't want to know about the details. 15:25:08 <uli> Michael, it's not only related to scalability (and the index issue mentioned by Zhe might hit you), but about "what you can/want to do" before you can start querying 15:25:27 <Jie> Schneid: QL is designed for scalability, sameas may kill it. 15:26:53 <Jie> Mike: from user perspective, if we add sameAs, user may lose some access from databases that have no recursive query. 15:27:53 <Jie> Markus: QL is not a subset of EL because of inverse and symmetric properties 15:27:05 <uli> ...and existentials in the head 15:27:05 <Jie> Boris: and existentials on the LHS, and conjunctions on the RHS. 15:28:30 <Jie> Markus: The problem is, would it be a valid statement that a user of QL who wants to have sameAs, s/he might also consider switching to EL, as long as there is no inverse and symmetric properties. 15:29:14 <Jie> Ivan: The difference between QL and EL is very small. 15:29:20 <Jie> Ian: Not really, they may be close on the set of constructs, but not on language structure. 15:29:36 <Jie> Markus: Intersection of QL and RL is small. What I suggest is, instead of adding this feature, one can also switch to EL. 15:30:19 <Jie> Zhe: people need QL, not EL because they want to access database data, how can they do it with EL? 15:30:30 <Jie> Markus: I agree. 15:30:36 <Jie> Ian: I believe we should do what Uli suggested. We need to cut the discussion. 15:31:15 <sandro> Uli, do you have a handy text for your proposal? 15:32:06 <uli> yes 15:32:11 <uli> will send in a second 15:32:49 <schneid> schneid: I want to avoid to add stuff that brings a bad dilemma to implementers: if they don't support it, then they are non-conformant, and if they implement it, then their main performance advantages will break down 15:32:54 <Jie> Mike: on conformance, if a feature is not in the language, and the tool supports it, does not make the tool not conformant. 15:33:14 <uli> We propose to:30 <schneid> and this dilemma would be delegated to users, of course 15:33:34 <pfps> pfps has joined #owl 15:33:45 <uli> yes 15:33:52 <Jie> PROPOSED::55 <sandro> PROPOSED: Keep sameAs out of OWL QL, in order to keep the properties of QL, with a note about QL such Uli proposes. 15:34:20 <msmith> chair adjusting wording 15:34:36 <Jie> PROPOSED: We will add sameas to the QL profile. 15:34:44 <MarkusK_> -1 15:34:44 <pfps> -1 ALU 15:34:46 <IanH> -1 15:34:46 <bmotik> -1 15:34:47 <Jie> 0 15:34:47 <alanr> 0 15:34:48 <uli> -1 15:34:49 <Achille> -100 (IBM) 15:34:51 <schneid> -0.9 15:35:01 <IanH> q? 15:35:04 <sandro> PROPOSED: Add SameAs to OWL-QL 15:35:04 <sandro> -1 15:35:06 <ivan> ack ivan 15:35:08 <msmith> 0 15:35:14 <zwu2> 0 15:35:21 <sandro> yes, bijan, following without the audio isn't really practical. 15:35:37 <Jie> RESOLVED: We will not add sameas to the QL profile. 15:36:24 <Jie> PROPOSED: add some Uli's text to profile document 15:36:28 <pfps> +1 ALU 15:36:28 <IanH> +1 15:36:28 <Achille> +1 15:36:29 <bijan> +1 15:36:29 <sandro> +1 15:36:29 <msmith> +1 15:36:29 <MarkusK_> +1 15:36:31 <ivan> 1 15:36:32 <Jie> +1 15:36:35 <alanr> +1 15:36:35 <schneid> +1 15:36:36 <bmotik> +1 15:36:42 <ewallace> +1 15:36:51 <zwu2> +1 15:37:02 <Jie> RESOLVED: add some uli's text to profile document 15:37:13 <bijan> I wonder whether if all OWL QL implementations at CR support sameAs that that would be sufficient new information 15:37:20 <IanH> PROPOSED: reflexive, irreflexive, & asymmetric properties will be added to the QL profile 15:37:34 <pfps> +1 ALU 15:37:35 <bmotik> +1 15:37:35 <MarkusK_> +1 15:37:36 <msmith> +1 15:37:37 <ivan> 0 15:37:38 <Achille> 0 15:37:38 <schneid> +1 15:37:38 <alanr> ++1 15:37:41 <uli> +1 15:37:41 <ewallace> +1 15:37:41 <sandro> +1 15:37:42 <bijan> 0 15:37:46 <zwu2> +1 15:37:54 <sandro> (this is correcting the previous proposal) 15:37:59 <Jie> +1 15:38:03 <IanH> RESOLVED: reflexive, irreflexive, & asymmetric properties will be added to the QL profile 15:38:16 <sandro> ian: (just tidying up) 15:38:20 <Zakim> -uli 15:39:15 <Jie> break 15:39:16 <sandro> Bijan, can you dial in about 3:30 boston time? 15:39:36 <Zakim> -Evan_Wallace 15:39:37 <bijan> So 8:30 here, yes? 15:39:38 <bijan> Probably 15:46:59 <Zakim> -Achille 15:54:49 <pfps> no updated agenda - we are still finishing yesterday's agenda 15:55:28 <jar> oh my. so you will all have to extend your stay so you can finish today's tomorrow :-) 16:01:09 <sandro> scribe: Boris 16:01:36 <Zakim> +[IBM] 16:01:39 <bmotik> topic: TQ comments 16:01:54 <bmotik> ianh: I've drafted a response 16:02:01 <IanH> 16:02:35 <bmotik> ianh: I've tried to tease out each of the individual comments that had technical content 16:04:48 <bmotik> (everyone's reading Ian's response) 16:07:49 <msmith> editorial comment: s/IEFT/IETF/g (Internet Engineering Task Force) 16:08:55 <bmotik> ianh: Let's go through the comment 16:09:23 <bmotik> ivan: There were specific comments by TQ that we should stop the OWL 2 effort altogether 16:09:36 <bmotik> ianh: My response does not address this 16:09:55 <bmotik> ianh: We are currently disucssing only the technical comments from Jeremy's e-mail 16:10:33 <bmotik> ianh: My response should say that there will be another response about the philosophical objections 16:10:47 <bmotik> ianh: Thanks -- I'll add this to my response 16:11:50 <bmotik> ianh: Links to Wiki's should be the links to TR 16:12:02 <bmotik> sandro: I can't find these links, but I'll ask Jeremy 16:12:27 <sandro> action: sandro find and fix the to-wiki-links Jeremy complains about 16:12:27 <trackbot> Created ACTION-299 - Find and fix the to-wiki-links Jeremy complains about [on Sandro Hawke - due 2009-03-03]. 16:12:56 <bmotik> ianh: I'll make the comment about syntax examples more precise w.r.t. what we decided at this F2F 16:15:33 <bmotik> schneid: Jeremy says that various disjointness axioms would make implementation more difficult 16:16:35 <bmotik> ianh: Rather than just making statements "It's easy to implement", can we point to implementations? 16:16:47 <bmotik> ianh: Zhe, does your implementation support disjoint union? 16:16:49 <bmotik> Zhe: No 16:17:35 <bmotik> bmotik: OWL 2 RL does not have disjoint union, but does have disjoint properties 16:18:21 <bmotik> ivan: We can just say that we don''t understand why disjoint union would be difficult to implement 16:18:30 <bmotik> ivan: We could ask for more explanation 16:19:09 <bmotik> alanr: We already said that disjoint classes have benefits, but what to say aout the disjoint union? 16:19:58 <bmotik> ianh: We'll tweak the proposal to say that this does not address all the points and say that we don't see the difficulty in implementations 16:20:37 <bmotik> ianh: In OWL 1, there was some OWL file that was used to capture bits of RDF 16:21:09 <bmotik> schneid: There is no technical need to add this: (1) no sense on the DL side and (2) it is entailed by the full side 16:21:16 <bmotik> ianh: We'll add this 16:21:39 <bmotik> ianh: Jeremy suggested changing the serialization of property chains 16:22:18 <bmotik> pfps: No, they are suggesting something else 16:22:39 <bmotik> pfps: RDF allows blank nodes in properties 16:23:01 <bijan> RDF doesn't allow blank nodes in properties. 16:23:41 <bmotik> alanr: Jeremy is worried about a blank node being used as subject or object that will then get turned into a property by some rule 16:24:21 <MarkusK_> markus: the fact that predicates in RDF cannot be bnodes is not a bug but a feature: 16:24:24 <bmotik> msmith: Jeremy doesn't point this out, but does not this also imply that bnodes are not good for inverse properties 16:24:25 <pfps> RDF does not allow bnodes for predicates - it allows bnodes for properties 16:24:44 <MarkusK_> markus: we explicitly do not want anybody to use the bnode property of some OWL 2 property chain in a triple 16:24:53 <bijan> Oh, right. Yes. Carry on. _:x rdf:type rdf:Property 16:25:06 <MarkusK_> markus: since this would be a statement about the property chain that is not supported by OWL 2 anyway 16:25:26 <bmotik> schneid: I was careful on the Full side to avoid the bnode to become a property chain 16:25:29 <MarkusK_> markus: effectively, it would be similar to allowing inverted property chain inclusions 16:25:41 <bmotik> schneid: The full semantics does not make this LHS property into a property chain 16:26:01 <bmotik> schneid: The bnode does not represent a property chain 16:26:19 <bmotik> schneid: I believe that people will be confused by this 16:27:07 <bmotik> schneid: We overloaded the rdfs:subPropertyOf to do something that it wasn't designed for 16:27:14 <bmotik> schneid: I couldn't find a real problem 16:27:46 <bmotik> schneid: I'd like to have a single triple encoding 16:28:23 <bmotik> schneid: On the LHS would be a superproperty, and on the RHS would be a list with the chain 16:28:38 <bmotik> ianh: What do we think of this? 16:28:42 <bmotik> bmotik: I don't care 16:29:02 <bmotik> ianh: Didn't we have an issue about this? 16:29:13 <bmotik> schneid: I had it on my agenda, but didn't want to bring it up 16:30:07 <bmotik> ivan: I remember that, when I needed to familiarize myself with the property chains, the current encoding was complicated 16:31:31 <bmotik> PROPOSED: Change the encoding of the property chains to a single-triple encoding (LHS is the superproperty and RHS is the list of properties) 16:31:47 <schneid> +1 16:31:50 <MarkusK_> +1 16:31:51 <bmotik> bmotik: +1 16:31:52 <pfps> -0 16:31:52 <alanr> +1 16:31:58 <ewallace> 0 16:32:08 <bijan> 0 16:33:31 <bmotik> (Addendum: it will be called owl:propertyChainAxiom) 16:34:03 <Jie> 0 16:34:04 <MarkusK_> +1 16:34:07 <alanr> +1 16:34:11 <ewallace> +1 on owl:propertyChainAxiom name 16:34:12 <schneid> +1 16:34:16 <msmith> 0 16:34:16 <Achille> 0 16:34:18 <ivan> +1 16:34:20 <IanH> 0 16:34:21 <sandro> 0 16:34:30 <zwu2> +1 16:34:32 <pfps> +0.2 for chaining the property axiom 16:34:33 <bijan> 0 16:34:34 <bmotik> RESOLVED: Change the encoding of the property chains to a single-triple encoding (LHS is the superproperty and RHS is the list of properties) -- with the addendum 16:35:23 <bmotik> schneid: Note that owl:propertyChain gets ditched 16:35:41 <bmotik> ianh: TQ complained about negative property assertions 16:35:50 <bmotik> alanr: Nobody compained about them 16:36:00 <bmotik> ianh: Some people found them useful 16:36:17 <bmotik> schneid: He had a problem with the encoding and with the negative tiples 16:36:30 <bmotik> ianh: What about my response? 16:36:40 <bmotik> alanr: I'm good with this 16:36:48 <bmotik> ianh: So that covers it? 16:37:00 <bmotik> ianh: OK, so let's move on to SelfRestrictions 16:37:44 <bmotik> alanr: Local reflexivity is more useful than the global reflexivity 16:37:59 <bmotik> schneid: In the past, there was a problem with certain semantics 16:38:33 <bmotik> schneid: Now, however, the paradox is no longer pertinent 16:38:55 <bmotik> ianh: So we can strenghten the response by saying that local reflexivity is more useful than the global one 16:39:21 <bmotik> schneid: THis is particular in RDF 16:39:32 <bmotik> ianh: And we say that there is no problem now as paradoxes do not arise 16:40:34 <bmotik> ianh: Jeremy doesn't like reflexive, irreflexive, asymmetric, and disjoint properties in general 16:41:00 <bmotik> alanr: Can't we add a line to the response saying that we'll extend NF&R? 16:41:08 <ewallace> Holger had this same position before Jeremy joined TopQuadrant 16:41:19 <bmotik> markusk: Have we got any use-cases for globally reflexive properties? 16:41:58 <bmotik> ianh: So global reflexivity approximates local reflexivity, particularly in the profiles that don't have local reflexivity 16:42:23 <alanr> this point should be added to NF&R 16:42:31 <schneid> schneid: global reflexivity can be used for local reflexivity in profiles which do not have local reflexivity (QL): e.g. to approximate locatedIn property to be "locally" reflexive" on class "Location" 16:42:56 <bmotik> ianh: We'll say that we'll clarify this in NF&R 16:43:14 <bmotik> ivan: We should add this to the introductory text 16:43:59 <bmotik> ianh: I'll say that we'll extended NF&R 16:44:01 <bmotik> ianh: Let's move to OWL/XML 16:44:26 <bmotik> ivan: When you say that OWL/XML is not a new feature -- Jeremy probably knows that it is not a new feature 16:44:39 <bmotik> ivan: Jeremy is not satisfied with the recommendation status 16:45:11 <bmotik> alanr: Can we have a small section in NF&R explaining why we want OWL/XML? 16:45:18 <bmotik> alanr: Bijan has a coherent story 16:45:39 <bmotik> ianh: Good, we'll add this and mention this addition in the response 16:46:01 <bmotik> pfps: We can say "There is rational for it and wil lbe (has been?) added" 16:46:21 <bmotik> ivan: The sentence about "not a new feature" should go 16:46:42 <bmotik> ianh: The next thing is Manchester Syntax 16:46:51 <bijan> For NF&F or whatever, here's my earlier bit: <> 16:46:59 <bijan> on OWL/XML 16:47:13 <bmotik> (everyone): ship it 16:47:34 <bmotik> ianh: Jeremy doesn't like using reification in annotations 16:48:10 <bmotik> bijan: I don't recall any explicit feedback about reification 16:48:39 <bmotik> bijan: We used our own vocabulary to avoid overloading the meaning of the RDF vocabulary 16:49:21 <bmotik> ianh: Jeremy is worried about reification at all 16:49:40 <bmotik> ianh: But this doesn't handle annotation on axioms 16:49:57 <bijan> We considered *many* alternative encodings, e.g., Literals 16:50:24 <bmotik> ianh: The response says that, if a single axiom is annotated, there is nothing to hang the annotation off of 16:50:32 <bmotik> ianh: Therefore, we *must* reify 16:50:49 <bmotik> ianh: I pointed to our discussion about the usage of RDF reification 16:51:04 <bmotik> schneid: Raised by Jeremy! 16:51:22 <bmotik> ianh: So we're happy with the response as is? 16:51:30 <bmotik> alanr: I hear no objections 16:51:58 <bmotik> ianh: I could only make it clearer that we do hang annotations off of blank nodes whenever there is one 16:52:07 <bmotik> ianh: Other than that, we are good with it 16:52:28 <bmotik> ianH: Moving on to n-ary datatypes 16:52:36 <bmotik> alanr: I have a problem with how this is stated 16:53:19 <bmotik> alanr: We should say that we introduced hooks because there was a reasonably thought out extension that will be presented as a note, but not say too much what you can do with it? 16:53:35 <bmotik> ianh: Let's skip on the next one while Alan is generating text 16:53:49 <bmotik> ianh: Moving on to RDF interoperability 16:54:52 <bmotik> ivan: Looking at the comment itself, my feeling is that it falls in the same caterogy of general misunderstanding regarding the role of RDF 16:55:00 <bmotik> ivan: We have already addressed that 16:55:23 <bmotik> ivan: We should say that the overall structure has not changed a bit compared to OWL 1 16:55:31 <bmotik> ivan: I would simply say "Nothing has changed" 16:55:55 <bmotik> ianh: I can strengten the second sentence in my proposed response 16:56:09 <bmotik> ivan: I see that you are referring to some other responses 16:57:02 <bmotik> ivan: Sorry, not important 16:57:20 <bmotik> alanr: Why are we saying that the role of RDF is better than it was? 16:57:33 <bmotik> ivan: It is the same, not better, not worse 16:58:01 <bijan> Tactically, it's better not to say "better" because that gets us into a debate about whether it's *really* better 16:58:03 <bmotik> ianh: Alan is saying that we could improve interoperability (by taking up more graphs), but we don't go there 16:58:07 <bijan> "not changed" is less arguable 16:58:37 <bmotik> ianh: Appendix and dependcies on life sciences 16:58:45 <bmotik> alanr: We should response a bit more actively 16:59:14 <bmotik> alanr: We should say that we'll explore the possibilities for diversifying the examples in NF&R 16:59:21 <bijan> zakim, mute me 16:59:21 <Zakim> bijan was already muted, bijan 16:59:30 <bmotik> alanr: We should also say that we welcome examples from his user base 16:59:44 <bmotik> ianh: He complained about some trivial typos 17:00:52 <bmotik> ianh: Another complaint was that NF&R motivated features that are not in OWL 2 17:01:01 <bmotik> ianh: It is similar to OWL 1 17:01:19 <bmotik> ianh: We motivated certain features, but not included all of them 17:01:26 <bmotik> alanr: Why don't we get rid of them? 17:01:37 <bmotik> ianh: It could be useful to document them 17:01:46 <bmotik> ianh: I'd be OK with deleting these 17:02:02 <bmotik> pfps: We were supposed to gather use cases and requirements 17:02:15 <bmotik> pfps: This is what we did and should not be throwing away our work 17:02:18 <bijan> Throw it away! 17:02:27 <bmotik> alanr: The document is called "New Features and Rationale" 17:02:34 <bijan> The use cases right? I'm strongly against them 17:02:34 <bmotik> alanr: These are not new features 17:02:56 <bmotik> pfps: Given the abstract of the current document, Alan is correct 17:03:19 <bmotik> ianh: The document wasn't supposed to be a general "Use Cases and Requirements" document 17:03:49 <bmotik> PROPOSED: Remove UC10 and UC11 from NF&R 17:04:19 <bmotik> ewallace: I was just wondering we're still controversial about the n-ary hook 17:04:38 <bmotik> ewallace: This is a motivation for n-ary 17:04:47 <bmotik> ianh: This is a good point 17:05:13 <bmotik> ianh: Evan is saying that motivating the hook for n-ary is not bad 17:05:37 <bmotik> alanr: If it speaks to what we have in the n-ary note, I'm OK with that 17:05:49 <bmotik> ianh: I believe that UC10 and UC11 will be covered by the note 17:06:00 <bmotik> alanr: Then we can say that this is the motivation for the note 17:06:48 <bmotik> ianh: The response to Jeremy then becomes that these use cases motivate the hooks 17:06:57 <bmotik> alanr: I'd say that they motivate what's in the note 17:07:06 <bmotik> ianh: Alan should craft the text for that 17:07:55 <bmotik> ianh: Some references to TQ composer were fixed 17:08:15 <bmotik> ianh: Jeremy doesn't like Manchester syntax 17:08:55 <bmotik> pfps: If the WG decides that there will not be MIME type for Man syntax, it will happen anyway 17:09:08 <bmotik> bijan: I'm not sure whether one can comment on a note 17:09:57 <bijan> zakim, mute me 17:09:57 <Zakim> bijan should now be muted 17:10:08 <bmotik> bijan: We could say "This will not be a REC document. THanks for the comment, but we won't follow it" 17:10:19 <bmotik> ianh: Next is GRIDDL 17:10:36 <bijan> I didn't hear that 17:10:57 <bmotik> ianh: My response says that the charter does not mandate GRIDDL 17:11:07 <bmotik> alanr: This is not a general reading of the charter 17:11:12 <bmotik> ivan: I agree 17:11:23 <bijan> I'm happy with that response 17:11:29 <bmotik> ivan: My proposal is to say that this is still a subject of an open issue 17:11:29 <bijan> (ivan's) 17:11:40 <bijan> I'm off again 17:11:49 <bmotik> bijan: I agree with Ivan's rpoposal 17:12:20 <bmotik> ianh: OK. THe response will be "This is a subject of an open issue, and we'll take your opinion into consideration" 17:13:21 <bmotik> ianh: The next comment is again about normativeness of OWL/XML 17:14:02 <bmotik> msmith: IETF has it own notions about normative and informative and these are disconnected from MIME type registration 17:14:21 <bmotik> msmith: I'll look up a reference 17:14:34 <bijan> MIME type registration is normative *for that type*, not that the W3C has made it noramtive. N3 has a mime type! 17:14:43 <bmotik> ianh: The response to this will be to say "The XML syntax is optional" 17:15:14 <bmotik> pfps: He also appears to be complaining that the document is REC rather than a note 17:15:33 <bmotik> sandro: In my mind it is logically nonsense to have a specification which is nonnormative 17:15:46 <IanH> ack bijan 17:15:46 <pfps> normative is not the same as rec-track 17:15:55 <bmotik> bijan: Jeremy raised several points 17:16:09 <bmotik> bijan: I have plenty of motivation for XML syntax 17:16:33 <bmotik> bijan: We have also done our best not to be divisive 17:16:47 <bmotik> bijan: We are reaching to the rest of the world (such as XML) 17:17:30 <bmotik> bijan: We'd registed a MIME type even if XML syntax were a note 17:18:05 <bmotik> bijan: We should say that we want to have a single XML-friendly exchange format 17:18:39 <bmotik> ianh: Could you type into IRC some text about these points? 17:18:43 <bmotik> bijan: I'll do it 17:18:49 <bijan> I think this should be the response to JJC 17:19:03 <bmotik> ivan: There is already an entry on OWL/XML and we are repeating here a part of our reponse 17:19:10 <bijan> 1) Motivation: XML toolchain friendly owl foramt (e.g., SOAP, etc.) 17:19:16 <bmotik> ivan: I don't see a need for repetition 17:19:29 <bijan> 2) Divisive, it helps bridge the gap between the XML world and semantic web world 17:19:51 <bmotik> ivan: I think we can simply refer to the Document Overview that will describe the place of OWL/XML in the grand scheme of things 17:19:51 <bijan> 3) Why recommendation? Because we want to standardize the XML toolchain friendly owl format 17:20:02 <bijan> Fine 17:20:28 <bmotik> alanr: Less is more, Bijan. I don't agree with your particular arguments, but we don't need to include them 17:21:14 <bmotik> ianh: We'll have one oint response about XML. We've already decided on what that is. 17:21:25 <bmotik> ivan: We can only refer to the Document Overview. 17:21:27 <baojie> baojie has joined #OWL 17:21:34 <bmotik> ianh: Moving on to owl:real 17:21:52 <msmith> the relevant reference to media type registration and the relationship to normativity from IETF's perspective is section 4.10 17:21:56 <bmotik> ivan: We can't do anything here because it is pending resolution of issues from yesterday 17:22:16 <bmotik> ianh: We go back to the cases where Alan was asked to craft some text 17:22:30 <alanr> UC#10 and UC#11 motivate a feature which the working group was not able to fully develop, but for which we have published a note [cite note]. 17:22:36 <alanr> N-ary datatype: This specification currently does not define data ranges of arity more than one; however by allowing, syntactically, for n-ary data ranges, the syntax of OWL 2 provides a "hook" allowing the working group to introduce experimental extensions as will be published as in [cite note]. 17:24:09 <bmotik> ianh: Good, we're done with that 17:24:50 <bmotik> ianh: There were a couple of comments that were between technical and motivational. I'd like to ask for some advice on that 17:25:00 <bmotik> ianh: One comment is regarding effactiveness 17:25:14 <bijan> Isn't the abstract going to change? 17:26:48 <bmotik> ianh: Jeremy doesn't like the abstract of the document mentioning effective reasoning algorithms 17:26:58 <bmotik> ianh: The response is "We'll rewrite the abstract" 17:27:20 <bijan> I don't think we should get into a debate with him about the word "effective" 17:27:39 <bmotik> pfps: We'll remove the offending word from all documents apart from the Profiles (where it has a particular meaning) 17:27:41 <bijan> He supports OWL Full! :) 17:27:48 <bmotik> ivan: It is ducking his comments. 17:28:01 <bmotik> ivan: I don't know what to asnwer regarding his non-belief 17:28:39 <ewallace> Isn't less still more? 17:28:50 <bijan> Even less is way more 17:29:23 <bmotik> alanr: The charter doesn't talk about "effective", but "reasonable" and "feasible" 17:30:03 <ewallace> +1 17:30:11 <bmotik> ianh: Our response is "The abstract has changed, and we no longer talk about 'effective'" 17:30:15 <bijan> +1 17:30:19 <bmotik> ianh: His next comment is more philosophical 17:30:42 <bmotik> ianh: We made a lot of mention of the OWL-ED workshop and that this didn't represent a broad spectrum of the OWL community 17:31:04 <ewallace> It was in NF&R 17:31:05 <bmotik> ivan: We should not mentioned OWL-ED anywhere, and I don't think we have any mention of it in our documents 17:31:19 <bmotik> alanr: I thinnk it is appropriate to mention OWL-ED in references, but nowhere else 17:31:53 <bmotik> (everyone looking at NF&R) 17:31:58 <ewallace> It is still there. 17:32:14 <bmotik> pfps: It is in the overview but in a completely unobjetionalbe spot 17:32:21 <bmotik> pfps: We could change "much" to "some" 17:32:41 <bmotik> alanr: In the intreset of less-is-more, I don't see a problem with removing it 17:32:47 <bmotik> pfps: I think it belongs in that paragraph 17:32:52 <bmotik> sandro: I agree 17:33:06 <bmotik> bijan: It is a comment about a non-LC document and it is a non-technical comment 17:33:25 <ewallace> This one will go to Last Call. 17:33:32 <schneid> +1 to bijan (in general for non-lc docs) 17:33:41 <bmotik> bijan: We could say "Thanks for the comment, but this is a manner of editorial discression; you can comment at LC" 17:33:52 <bmotik> ivan: We are just postponing this issue. This doens't make much sense 17:34:10 <bmotik> ivan: Instead of "much" we say "some" and this seems quite good 17:34:26 <bmotik> bijan: I'd be perfectly happy for them to raise a new LC comment and to give the same response 17:35:13 <bmotik> ianh: I think everything feels that changing "much" to "some" would be sufficient 17:35:26 <bmotik> alanr: But what do we lose if we remove it? 17:35:26 <bijan> I think it's fair and helpful 17:35:44 <bmotik> pfps: We remove the connection to our history! TQ wants to revision history! 17:36:21 <bijan> I think it's a denial of service attack. I vote with the majoirty 17:36:22 <bmotik> alanr: I love OWL-ED. I just believe that the connections to the OWL-ED are reflected with references 17:36:37 <bmotik> PROPOSED: The reference to OWL-ED stays in the document but with a change of "much" to "some" 17:36:39 <bmotik> bmotik: +1 17:36:39 <pfps> +1 ALU 17:36:40 <msmith> +1 17:36:43 <ewallace> -1 17:36:45 <ivan> +1 17:36:45 <IanH> +1 17:36:47 <MarkusK_> +1 17:36:47 <alanr> -1 (but won't block) 17:36:47 <zwu21> 0 17:36:47 <schneid> +1 17:36:50 <baojie> 0 17:36:58 <sandro> +1 17:36:59 <bijan> 0 17:37:10 <Achille> 0 17:37:15 <IanH> q? 17:37:27 <bmotik> ewallace: I would go with Bijan and Peter 17:37:40 <bmotik> ewallace: I voted against changing "much" to "some" 17:37:47 <bmotik> ianh: Will you lie in the road? 17:37:50 <bmotik> ewallace: No 17:38:03 <bmotik> RESOLVED: The reference to OWL-ED stays in the document but with a change of "much" to "some" 17:38:17 <bmotik> ewallace: Ask Christine to make the change 17:39:34 <bijan> Who's changing it? 17:40:17 <bmotik> bmotik: I've changed "much" to "some" 17:41:20 <bijan> Earlier for Bijan-issues would be appreciated 17:41:25 <ewallace> +1 on replanning now 17:47:01 <ewallace> Don't worry about me, time wise. 17:47:47 <ewallace> What time are we planning for the NF&R discussion? 17:48:12 <ewallace> Just want to know when to encourage Christine to join. 17:53:40 <baojie> Ian just said "Other Documents" will be discussed 18:30:35 <bijan> christine, my (jokey) comment was directed at the use cases, not NF&R or n-ary 18:30:37 <bijan> Sorry for the confusion 18:34:21 <zwu21> scribenick: Zhe 18:34:22 <ivan> zakim, who is here? 18:34:22 <Zakim> On the phone I see MIT346 18:34:23 <Zakim> On IRC I see schneid, alanr, msmith, pfps, christine, sandro, baojie, zwu21, RRSAgent, Achille, ivan, jar, MarkusK_, Zakim, bmotik, IanH, bijan, ewallace, trackbot 18:34:26 <pfps> scribenick zwu21 18:34:45 <sandro> scribe: Zhe 18:35:12 <zwu21> ... 18:35:13 <alanr> 18:35:23 <zwu21> scribenick: Zhe 18:35:47 <zwu21> Topic: philosophical 18:36:11 <zwu21> alanr: goal is to look at responses that have been drafted 18:36:12 <Zakim> +??P5 18:36:17 <bijan> zakim, ??p5 18:36:17 <Zakim> I don't understand '??p5', bijan 18:36:22 <bijan> zakim, ??p5 is me 18:36:24 <Zakim> +bijan; got it 18:36:26 <bijan> zakim, mute me 18:36:26 <Zakim> bijan should now be muted 18:36:30 <zwu21> ... looking at TC1 18:36:42 <zwu21> ivan: only one change made. 18:36:58 <zwu21> ... last sentence before the refences 18:37:08 <IanH> q? 18:37:18 <Zakim> +Evan_Wallace 18:37:33 <IanH> we don't hear any noise 18:38:23 <ewallace> Hearing nothing. 18:38:45 <alanr> structural specification and functional-style syntax document 18:38:57 <zwu21> alanr: make a normal reference 18:39:14 <pfps> abstract structure changes to generic syntax 18:39:14 <alanr> drop 18:39:19 <alanr> drop "This was only a matter of timing; the plan is to have both semantics (and all other documents) published as Recommendations together." 18:39:34 <alanr> was not _yet_ published changes to has not yet been published 18:40:02 <pfps> OK by me 18:40:12 <alanr> q? 18:41:16 <zwu21> ivan: will send it out tommrrow 18:41:41 <alanr> 18:41:48 <zwu21> ivan: regarding LC 29, 18:42:23 <zwu21> pfps: there are two responses. we are both stuck 18:42:30 <zwu21> ... with Bijan's 18:42:48 <bijan> I give up mine without hesitation 18:43:03 <bijan> I didn't put it in there but sent it to the list 18:43:27 <bijan> Mine is more on justifying xml syntax 18:43:36 <bijan> Peter's is more about the harmlessness of owl/xml 18:44:17 <christine> if still plan to discuss Documents, at what time please ? 18:44:18 <zwu21> IanH: we agreed on a bare minimal response to TopQuadrant's comments 18:44:35 <bijan> +1 18:45:04 <pfps> OWL/XML: XML syntax is not a new feature -- see [8]. It should also be noted that RDF/XML is the only syntax that MUST be supported by implementations; support for the XML syntax is not required (see also FH3). 18:45:10 <zwu21> pfps: ... jc1b 18:45:34 <zwu21> alanr: add a note that we will add something in NF&R 18:45:49 <sandro> amended to (1) remove the XML syntax is not a new feature, and (2) link to NF&R 18:46:16 <zwu21> ivan: the reason I think short resposne is ok 18:46:58 <bijan> Cool! 18:47:06 <bijan> Then I'm all for microshort 18:47:09 <alanr> PROPOSED: Respond to FH3 as in JC1b 18:47:29 <bijan> I'mhappy to be out of the loop here 18:47:39 <alanr> +1 18:47:43 <Zakim> +[IBM] 18:47:45 <zwu21> pfps: delegate to IanH for response 18:47:46 <bijan> +1 18:47:47 <msmith> +1 18:47:48 <MarkusK_> +1 18:47:49 <zwu21> +1 18:47:56 <Achille> zakim, ibm is me 18:47:56 <Zakim> +Achille; got it 18:47:59 <sandro> +1 18:48:13 <alanr> RESOLVED: Respond to FH3 as in JC1b 18:48:26 <pfps> +1 18:48:28 <zwu21> subtopic: LC 34A 18:48:37 <alanr> 18:48:38 <baojie> +1 18:48:54 <zwu21> alanr: I hope we can have something shorter 18:49:01 <alanr> 18:49:05 <zwu21> pfps: fine by me 18:49:06 <bijan> Second paragraph only? 18:49:12 <bijan> First and second paragraph only? 18:49:32 <bijan> Me 18:49:51 <zwu21> IanH: bijan wrote the initial version. 18:49:58 <zwu21> ... some of it is used here 18:51:01 <zwu21> ivan: this is the answer to his comment to stop the work? 18:51:16 <alanr> q? 18:51:25 <zwu21> ... can we add something more formal? 18:51:33 <bijan> q+ 18:51:49 <zwu21> ... for example, a few WG members want to move forward 18:51:52 <bijan> zakim, unmute me 18:51:52 <Zakim> bijan should no longer be muted 18:51:54 <alanr> ack Bijan 18:52:02 <IanH> ack bijan 18:52:12 <alanr> q+ sandro 18:52:36 <zwu21> bijan: I don't see that TopQuardrant wants us to stop work 18:52:41 <alanr> q+ ianh 18:52:48 <zwu21> ... he asked that we redo all the work we have done 18:53:00 <zwu21> ... according to the process he think is more appropriate 18:53:16 <alanr> q? 18:53:19 <zwu21> ... We can safely ignore it 18:54:09 <zwu21> ... given the strong support from lots of WG members, we can just let it go 18:54:09 <alanr> ack sandro 18:54:14 <bijan> zakim, mute me 18:54:14 <Zakim> bijan should now be muted 18:54:27 <zwu21> sandro: I am for short responses 18:54:40 <zwu21> ... not sure what we can do differently here 18:54:45 <alanr> ack ian 18:54:46 <zwu21> pfps: you can just point to NF&R 18:54:50 <alanr> q+ ivan 18:54:54 <alanr> q+ alanr 18:55:06 <zwu21> ianH: a) one of the option is to stop working on OWL and start working on something else 18:55:10 <bijan> Oh, WebSHROIQ 18:55:11 <bijan> I see 18:55:14 <zwu21> ... and don't call it OWL 18:55:37 <bijan> zakim, unmute me 18:55:37 <Zakim> bijan should no longer be muted 18:55:40 <alanr> q? 18:56:08 <alanr> ack ivan 18:56:13 <bijan> zakim, mute me 18:56:13 <Zakim> bijan should now be muted 18:56:20 <sandro> bijan: Put third paragraph of into Positive Last Call Responses web page 18:56:23 <IanH> I like that -- put positive responses on a wiki page 18:56:41 <zwu21> ivan: what I would do to the last paragraph is to list the references (positive comments about the features) 18:56:45 <IanH> That way we could even be more expansive 18:56:51 <zwu21> ... and they can read/check it 18:56:55 <sandro> "blurbs" 18:56:56 <bijan> I'd like the testimonal page anyway 18:56:59 <ewallace> +1 to putting positive comments on a page and including a pointer to that 18:57:11 <sandro> +1 to a testimonial/blurbs page 18:57:18 <IanH> q+ 18:57:22 <zwu21> ... I still believe that some kind of statement says that based on these positive comments, WG should move forward 18:57:24 <sandro> (W3C usually does it during PR, but we can start now.) 18:57:33 <zwu21> ... according to the charter 18:57:36 <alanr> ack alanr 18:58:37 <alanr> ack ianh 18:58:38 <zwu21> alanr: suggest 1) chaning course is not an option; 2) point out positive comments 18:58:46 <zwu21> s/chaning/changing/ 18:58:52 <bijan> q+ 18:59:26 <alanr> q? 18:59:42 <bijan> q- 18:59:51 <alanr> q? 18:59:52 <zwu21> IanH: first thing is to align with JC1B response, we would improve the motivation. make it more constructive 19:00:05 <zwu21> ... for the rest, point to a web page 19:00:10 <IanH> q? 19:02:05 <zwu21> pfps crafted FH1 response 19:02:31 <zwu21> Topic: document schedule 19:02:34 <alanr> q? 19:02:47 <bijan> zakim, mute me 19:02:47 <Zakim> bijan was already muted, bijan 19:02:52 <zwu21> ivan: what I believe is in the next roudn of publications, we 19:03:01 <zwu21> ... do a complete publication of all our documents, 19:03:25 <zwu21> ... the current LC documents to be re-issued as LC 19:03:25 <alanr> q? 19:03:50 <zwu21> ... for the current working drafts, we should republish them as working drafts 19:04:04 <zwu21> ... hope that RDF semantics could be LC, quick reference be LC 19:04:25 <zwu21> ... ok with re-issue another draft of Primer 19:04:35 <zwu21> ... not sure about NF&R, 19:04:45 <bijan> q+ 19:05:09 <zwu21> ... politically, re-issue everything as a package, without implying a priority, is the right thing to do 19:05:18 <alanr> q+ ianh 19:05:30 <zwu21> ... regarding timing, RDf semantics is not clear to me 19:05:50 <Zakim> +??P8 19:05:51 <zwu21> Michael: when do you think is the earliest date for publishing? 19:05:57 <IanH> q? 19:06:06 <IanH> zakim, who is here? 19:06:06 <Zakim> On the phone I see MIT346, bijan (muted), Evan_Wallace, Achille, ??P8 19:06:07 :06:15 <bijan> zakim, unmute me 19:06:15 <Zakim> bijan should no longer be muted 19:06:16 <zwu21> alanr: do we agree to a simultaneous publication of all docs? 19:06:20 <alanr> ack bijan 19:06:21 <christine> zakim, ??P8 is christine 19:06:22 <Zakim> +christine; got it 19:06:23 <alanr> q+ mike 19:06:50 <alanr> q? 19:07:02 <sandro> Bijan: In a Second-Last-Call, you ask for comments on specifically what has changed. 19:07:08 <zwu21> bijan: my only concern is we need to be careful about second LC is a new round of major comments... 19:07:31 <zwu21> ... otherwise, I am ok with it 19:07:37 <bijan> zakim, mute me 19:07:37 <Zakim> bijan should now be muted 19:08:03 <alanr> q? 19:08:06 <alanr> ack ianh 19:08:15 <bijan> Er...I won't agree to simultaneous unless this is resolved...so I don't see how we can get agreement of simultaneous without the resolution 19:08:16 <zwu21> IanH: I have the same worry as bijan, a second LC gives people chance more comments that may slow down WG progress 19:08:18 <alanr> q+ alanr 19:09:11 <alanr> ack mike 19:09:46 <zwu21> Ivan: by CR, all should be in sync 19:10:01 <zwu21> Mike: want to clarify the consequences 19:10:02 <alanr> q+ sandro 19:10:05 <alanr> ack alanr 19:10:31 <zwu21> alanr: not so worried by TopQuadrant, don't think WG has spent too much time on reponses 19:10:50 <zwu21> ... we can do the same thing if they come back 19:11:01 <bijan> q+ 19:12:10 <zwu21> sandro: your concern about Profiles is editorial, so it can be post LC 19:12:15 <alanr> q? 19:12:18 <alanr> ack sandro 19:12:22 <ivan> ack sandro 19:12:45 <zwu21> ... main point of second LC is the whole package 19:13:05 <zwu21> ... all the rec track spec will be LC, 19:13:25 <bijan> zakim, unmute me 19:13:25 <Zakim> bijan should no longer be muted 19:13:26 <alanr> ack bijan 19:13:26 <zwu21> ... ok with this strategy 19:13:43 <zwu21> bijan: I did not understand Sandro's story 19:13:48 <sandro> sandro: story of LC2 would be "now you get to see the whole package together" 19:14:18 <alanr> q+ sandro 19:14:50 <ivan> zakim, who is here? 19:14:50 <Zakim> On the phone I see MIT346, bijan, Evan_Wallace, Achille, christine 19:14:51 :14:54 <alanr> q+ schneid 19:14:57 <alanr> ack sandro 19:15:17 <zwu21> sandro: one of the reason is publilsing document review without other documents is strange 19:15:37 <zwu21> ... the story is not perfect, but good enough 19:15:37 <alanr> q+ alanr to ask if there are editor drafts between lc and cr 19:15:37 <bijan> no 19:15:46 <alanr> q+ boris 19:15:53 <zwu21> ... the roadmap will look really odd without other documents 19:15:54 <ivan> ack schneid 19:16:02 <sandro> sandro: the roadmap is screwey if it's linking to 4-months old documents. 19:16:12 <alanr> q+ sandro 19:16:21 <alanr> q+ mike 19:16:22 <zwu21> schneid: we make editorial, we also make design changes. 19:16:55 <bijan> If there's no change to the design? 19:17:09 <schneid> schneid: I don't know whether, e.g., the changes to to the functional syntax and the effects on other documents will /necessarily/ demand a new LC 19:17:12 <alanr> ack alanr 19:17:12 <Zakim> alanr, you wanted to ask if there are editor drafts between lc and cr 19:17:24 <alanr> ack boris 19:17:31 <zwu21> bmotik: I think changes are significant 19:17:34 <bijan> They change implementations :( 19:17:39 <alanr> q+ ianh 19:18:00 <alanr> q+ schneid 19:18:08 <alanr> ack sandro 19:18:55 <alanr> ack mike 19:18:58 <sandro> sandro: second-last-call is required if the positive-reviews would be invalidated 19:18:59 <ivan> ack mike 19:19:08 <bijan> zakim, mute me 19:19:08 <Zakim> bijan should now be muted 19:19:14 <alanr> q+ alanr to mention some substantive changes, e.g. to property chains 19:19:17 <ivan> q+ 19:19:24 <alanr> ack ianh 19:19:24 <ivan> ack ianh 19:19:31 <zwu21> Mike: if we think we need comments on the changes we make, 2nd LC is in order 19:19:47 <ivan> ack schneid 19:19:47 <alanr> ack schneid 19:20:36 <ivan> ack alanr 19:20:36 <Zakim> alanr, you wanted to mention some substantive changes, e.g. to property chains 19:20:36 <zwu21> schneid: to Boris, for 2nd LC, if there is a comment already made, 19:20:52 <zwu21> ... in 1st LC, then we can do minimal 19:21:03 <alanr> ack ivan 19:21:32 <zwu21> ivan: getting beyond LC does not mean it is over 19:21:54 <zwu21> ... in some way, I prefer to have comments now instead of at PR phase 19:22:11 <bijan> There's some advantage to having comments after CR, since we have implementation valdiation 19:22:18 <zwu21> alanr: publish date 3/31/09... 19:23:09 <alanr> q? 19:23:13 <IanH> q? 19:23:14 <zwu21> schneid: end of march should be enough for RDF semantics 19:23:19 <christine> 3/31/09 for UF docs as well ? 19:23:24 <zwu21> ivan: what about Primer, NF&R 19:23:33 <bijan> Primer is fine for another draft by then 19:23:46 <schneid> schneid: end of march will be clearly enough for RDF-Based Semantics 19:23:59 <jar> jar has joined #owl 19:24:14 <alanr> ack ianh 19:24:21 <IanH> q? 19:24:24 <IanH> q+ 19:24:31 <christine> can you write what said about NF&R 19:24:51 <zwu21> jie: 1 month is enough for quick reference 19:25:14 <zwu21> ... the missing links are primer and syntax, 19:25:53 <ewallace> Who will be working on the Primer? 19:26:00 <christine> +q 19:26:01 <zwu21> Markus: end of March is too tight 19:26:03 <Zakim> -bijan 19:26:09 <alanr> q+ pfps 19:26:13 <alanr> q+ ivan 19:26:22 <ivan> q- 19:26:32 <alanr> ack IanH 19:26:58 <alanr> q+ sandro 19:26:58 <zwu21> IanH: if LC is April, Aug will be CR, Oct will be PR, Nov/Dec will be rec 19:27:24 <zwu21> ... and we already said that we want to finish by Dec 19:27:36 <zwu21> ... I want to whole timeline be examined 19:27:39 <alanr> q+ schneid 19:27:42 <zwu21> ... for feasibility 19:27:43 <ivan> q+ 19:27:51 <alanr> ack christine 19:28:01 <pfps> pfps has joined #owl 19:29:35 <ewallace> Ah, now it is clear. 19:29:37 <zwu21> ivan: the NF&R can move directly from LC to PR 19:29:53 <zwu21> christine: is there lots of work to do? 19:30:20 <zwu21> ... maybe NF&R can finish in 1 month as well? 19:30:23 <alanr> ack pfps 19:30:31 <IanH> q? 19:30:33 <zwu21> alanr: we will review it and see what needs to be done 19:30:35 <alanr> ack sandro 19:30:43 <sandro> Editors Done - March 17; begin WG review 19:30:43 <sandro> LC2 published March 1, comment deadline march 29 19:30:43 <sandro> 4-8 weeks handling LC2 comments 19:30:43 <sandro> CR (LC for User Docs), in May 19:30:43 <sandro> PR for everything (but Notes) in July 19:30:44 <sandro> Rec in September 19:31:04 <christine> +q 19:31:29 <zwu21> s/March 1/April 1/g 19:31:36 <IanH> q? 19:31:42 <ivan> ack schneid 19:31:50 <dlm> dlm has joined #owl 19:31:55 <zwu21> schneid: I can finish in the first half of march 19:32:04 <alanr> ack schneid 19:32:15 <zwu21> ... however, what does 2 weeks buy us? 19:32:43 <alanr> ack ivan 19:33:07 <Zakim> + +1.518.276.aaaa 19:33:25 <alanr> q+ ianh 19:33:26 <IanH> q? 19:33:35 <alanr> ack christine 19:34:25 <alanr> ack ianh 19:34:33 <ivan> ack IanH 19:34:54 <alanr> q? 19:35:05 <zwu21> IanH: I appreciate that RDF semantics has to go through LC, 19:35:13 <ivan> ivan: to the question of Christine, the plan is to publish _all_ documents (ie, including quick ref and features) on the same day 19:35:15 <Zakim> +??P14 19:35:24 <zwu21> ... it seems to me that because schedule is tight, 19:35:26 <bijan> zakim, ??p14 is me 19:35:26 <Zakim> +bijan; got it 19:35:34 <zwu21> ... we may want to avoid 2nd LC 19:35:48 <sandro> 09 March - FPWD Document Overview 19:35:48 <sandro> 30 March - Editors Done, begin WG review 19:35:48 <sandro> 13 April - Publish Round 5 (LC2) 19:35:48 <sandro> 01 June - CR 19:35:48 <sandro> 01 Aug - PR 19:35:49 <sandro> 01 Oct - Rec 19:36:10 <bijan> When would CR end? 19:36:18 <bijan> zakim, mute me 19:36:18 <Zakim> bijan should now be muted 19:36:27 <sandro> CR ends 15 July 19:37:02 <alanr> q? 19:37:05 <zwu21> ivan: how long does implenters need for CR to do implementation 19:37:13 <bijan> zakim, unmute me 19:37:13 <Zakim> bijan should no longer be muted 19:37:15 <zwu21> IanH: Pellet and HermiT are very close 19:37:20 <christine> +q 19:37:28 <zwu21> ... HermiT is more or less complete 19:37:43 <zwu21> bijan: Pellet is tracking OWL 2 19:37:56 <ivan> q+ 19:38:03 <alanr> q+ alanr 19:38:12 <bijan> zakim, mute me 19:38:12 <Zakim> bijan should now be muted 19:38:52 <bijan> FPWD, publish early and often 19:38:53 <alanr> ack christine 19:38:56 <alanr> ack ivan 19:39:04 <zwu21> christine: can we set is to Mar 9? 19:39:12 <pfps> pfps has joined #owl 19:39:25 <alanr> q+ pfps 19:39:37 <christine> scan we set is to Mar 9?/ 15 19:39:57 <ivan> ack alanr 19:39:59 <zwu21> ivan: the LC version can have your current comments 19:40:14 <bijan> I have more answers 19:40:23 <zwu21> ... question of Profiles implementation 19:40:27 <alanr> q+ pfps 19:40:32 <alanr> q+ mike 19:40:36 <alanr> ack pfps 19:40:52 <zwu21> pfps: HermiT is an implementation complete for everything except for syntax checking 19:41:10 <christine> for scribe : christine asked : can we set is to Mar 15 not 9 19:41:17 <zwu21> ... given a RL document, it will do RL reasoning 19:41:54 <alanr> ack mike 19:41:56 <alanr> q+ pfps 19:41:59 <bijan> q+ 19:42:13 <zwu21> Mike: if we have Pellet and Hermit, then we have 2 implementations 19:42:21 <alanr> q+ alanr to ask whether hermit is an "spirit of the law" implementation of RL 19:42:35 <zwu21> ... Pellet RC can support RL and QL 19:42:59 <alanr> ack pfps 19:43:02 <zwu21> ivan: no RL implementation 19:43:13 <zwu21> pfps: what do we need for CR exit status 19:43:18 <alanr> q+ schneid 19:43:22 <zwu21> ... I don't think we need a product 19:43:37 <zwu21> sandro: two interoperable implementations 19:43:38 <alanr> q+ boris 19:43:59 <alanr> q+ ianh 19:44:04 <alanr> ack bijan 19:44:04 <bijan> zakim, unmute me 19:44:06 <sandro> ack bijan 19:44:07 <Zakim> bijan should no longer be muted 19:44:54 <zwu21> bijan: regarding profiles, for QL, there are 3 19:45:04 <sandro> Bijan: QL implementations: C&P, Aberdeen, Rome 19:45:07 <zwu21> ... for EL, IBM has one 19:45:08 <alanr> q+ pfps 19:45:12 <Achille> q+ 19:45:13 <baojie> q+ 19:45:18 <pfps> q- 19:45:37 <zwu21> ... for profile checkers, there will be one from Machnester 19:45:44 <zwu21> ... one from Aberdeen 19:46:11 <ivan> ack alanr 19:46:11 <Zakim> alanr, you wanted to ask whether hermit is an "spirit of the law" implementation of RL 19:46:18 <alanr> ack schneid 19:46:22 <alanr> ack boris 19:46:43 <zwu21> bmotik: regarding profiles, if it is about an implementation that pass the tests, then do we can about implementation details? 19:46:51 <zwu21> s/can/care 19:46:54 <alanr> q+ pfps 19:46:59 <pfps> q- 19:47:13 <alanr> ack ianh 19:47:18 <zwu21> IanH: I think we already have enough implementations, 19:47:21 <alanr> q+ schneid 19:47:37 <alanr> ack Achille 19:47:50 <zwu21> Achille: want to clarify IBM's implementation of EL++, 19:47:59 <zwu21> ... is a simplfied version 19:47:59 <alanr> ack baojie 19:48:30 <christine> +q 19:48:32 <alanr> ack schneid 19:48:42 <alanr> q+ 19:48:47 <zwu21> schneid: CR's purpose is to find bugs and implementation difficulty, 19:48:54 <zwu21> ... now, we already have enough 19:49:14 <alanr> q+ ianh 19:49:20 <alanr> ack christine 19:49:21 <ivan> ack christine 19:49:46 <zwu21> alanr: it is not necessary to delay because we want to keep an schedule 19:50:05 <zwu21> ... you know what, let us communicate in emails 19:50:40 <bijan> +1 to ivan, publishing wds *should be cheap* 19:50:57 <bijan> What's the question? 19:51:01 <ewallace> What is the question? 19:51:32 <alanr> q? 19:52:03 <zwu21> christine: want to understand why it is hard to set the date 15th 19:52:05 <bijan> There's a schedule and there's no real benefit. FPWD is a low bar 19:52:15 <zwu21> alanr: happy to discuss offlien 19:52:22 <zwu21> s/offlien/offline/g 19:53:04 <zwu21> ivan: from CR to PR, we come up with a report on implementations 19:53:40 <zwu21> alanr: do we expect comments on PR? 19:54:17 <zwu21> ivan: it is possible, that is why I want comments now 19:54:33 <zwu21> ... not on PR documents 19:55:04 <zwu21> IanH: if schedule slips, then it is going to be tight for dec 2009 19:55:29 <alanr> ? 19:55:31 <alanr> q? 19:55:35 <alanr> ack alanr 19:55:38 <alanr> ack inah 19:55:43 <alanr> ack ianh 19:56:01 <pfps> I'm not happy with the schedule, but it is about as good as it could be 19:56:02 <zwu21> sandro: we chould consider skip CR 19:56:16 <pfps> However, we should use the schedule as a cloture mechanism 19:56:49 <zwu21> ivan: let us not skip CR 19:57:37 <zwu21> ... what we called user facing documents do not go through CR 19:57:38 <sandro> 09 March - Publich Round 5: FPWD Document Overview 19:57:38 <sandro> 30 March - Editors Done, begin WG review 19:57:38 <sandro> 15 April - Publish Round 6: All documents, specs in Last Call (LC1 or LC2) 19:57:38 <sandro> 01 June - Publish Round 7: All docs; rec-track specs to CR 19:57:38 <sandro> 15 July - CR comments due 19:57:39 <sandro> 01 Aug - Publish Round 8: All docs; rec-track documents to PR 19:57:42 <sandro> 01 Oct - Publish Round 9: All documents to final state (Rec / Note) 19:57:43 <zwu21> ... that gives up more time 19:57:57 <zwu21> ... Manchester syntax does not go through CR because it is not rec track 19:58:10 <zwu21> ... if it is final, we can publish it as a note anytime 19:58:19 <bijan> We shouldn't solicit comments on a note 19:58:29 <sandro> 19:58:48 <bijan> The only reason to go not go final on MS now is to track any changes we make in the rest of the langauge 20:00:13 <zwu21> ivan: at PR, we may get formal objections 20:00:28 <zwu21> ... which will be a very tough thing 20:00:48 <zwu21> Mike: it is indepenent of our timeline though 20:00:52 <IanH> PROPOSED: the WG will use its best endeavours to complete its work according to the schedule proposed by Sandro above. 20:01:02 <christine> +q 20:01:17 <IanH> q? 20:01:20 <alanr> ack christine 20:02:02 <zwu21> christine: don't see the impact of either 9th of 15th 20:02:07 <zwu21> alanr: we will address that 20:02:25 <pfps> +1 ALU 20:02:31 <alanr> +1 SC 20:02:32 <schneid> +1 20:02:32 <ivan> +1 20:02:32 <IanH> +1 20:02:33 <bmotik> +1 20:02:33 <MarkusK_> +1 FZI 20:02:33 <zwu21> +1 20:02:34 <bijan> +1 20:02:36 <msmith> +1 20:02:37 <sandro> +1 20:02:38 <Achille> +1 20:02:40 <baojie> +1 20:02:59 <christine> +1 (except 09 march) 20:03:00 <zwu21> alanr: we need to note that which documents will go to LC2 20:03:06 <ewallace> +1 20:03:26 <IanH> RESOLVED: the WG will use its best endeavours to complete its work according to the schedule proposed by Sandro above. 20:03:42 <bijan> Is all that's left editorial? 20:03:50 <bijan> I have a course to prepare for and to go to sleep :( 20:04:04 <pfps> no, after break is imports and griddle 20:04:28 <Zakim> -christine 20:08:22 <Zakim> - +1.518.276.aaaa 20:08:28 <Zakim> -Evan_Wallace 20:17:51 <bijan> zakim, mute me 20:17:51 <Zakim> bijan should now be muted 20:19:30 <jar> jar has joined #owl 20:20:26 <zwu21> IanH: going to imports 20:20:58 <pfps> scribenick: ivan 20:21:08 <pfps> it should be one 20:21:25 <ivan> Topic: imports 20:21:37 <ivan> IanH: 2 comments, both with drafts 20:21:41 <ivan> ... #53 20:22:22 <IanH> 20:22:36 <pfps> draft response is 20:22:55 <ivan> IanH: proposed draft: 20:23:35 <sandro> sorry, my IP address changed on me. webcam restarted.... 20:23:39 <IanH> q? 20:23:53 <jar> q+ jar 20:23:57 <ivan> schneid: there are confusions due to sloppiness of myself 20:24:12 <ivan> ... in the old owl 1 full ther ehas been a definition of import closure 20:24:36 <IanH> q? 20:24:48 <ivan> ... i kept that in in the 2nd draft 20:24:58 <baojie> q+ 20:24:59 <ivan> ... there was also a note that was very clever; 20:25:09 <ivan> ... ie, i did not plan to have this in the final version of the document 20:25:26 <ivan> ... in the owl 1 the definition was only used in two theorems 20:25:47 <ivan> ... on of them was the old correspondence theorem, and there is a new one for owl 2 that does not use this any more 20:25:52 <IanH> q? 20:25:53 <ivan> s/on/one/ 20:26:01 <ivan> .... my current draft does not have it any more 20:26:22 <ivan> IanH: ie,, the current version of the owl full semantics does not have this feature in 20:26:29 <ivan> schneid: indeed 20:26:46 <ivan> ... importing has nothing to do with logic, treating it in a semantics is not correct 20:27:12 <Zakim> +Evan_Wallace 20:27:16 <IanH> q? 20:27:25 <IanH> ack jar 20:27:34 <schneid> 20:27:34 <ivan> jar: since i submitted that I was thinking about it. 20:27:40 <ivan> ... this is a borderline editorial 20:27:49 <ivan> ... i am not sure what the goal for today 20:27:58 <ivan> ... i guess it is the lc comments 20:28:18 <ivan> ... i did sent another public comment today on how to present this whole comment idea 20:28:37 <ivan> ... i am happy to contribute and work with whoever works on this 20:28:57 <ivan> IanH: you should send a mail to the wg list targeted at michael, and then discuss this 20:29:01 <ivan> ... is that o.k? 20:29:07 <ivan> jar: yes, that sounds fine 20:29:10 <IanH> q? 20:29:19 <jar> my email (today): 20:29:35 <ivan> ... I feel there is a lot of room for improvement 20:29:52 <ivan> IanH: but if the response to you was along the line that this document is chaning 20:29:55 <IanH> q? 20:29:55 <ivan> ... is that ok 20:29:59 <ivan> jar: yes 20:30:38 <ivan> baojie: about the semantics of incompatibility with in owl 1 we do not have that, so we have a backward incompatibility problem 20:30:50 <jar> any clarification is fine I think. just wanted to make sure someone had thought about it, and that the next reader was clear on the intent (full different from / same as dl in this way) 20:30:58 <IanH> q? 20:31:01 <ivan> IanH: i am reluctant to reopen this 20:31:05 <IanH> ack baojie 20:31:17 <ivan> boris: michael you defer to the syntax document? 20:31:44 <ivan> schneid: i have either an own part that treats this stuff or not, i decided to point to the syntax document 20:31:57 <ivan> bmotik: I agree 20:32:12 <ivan> IanH: we are done on this one, aren't we? 20:32:22 <ivan> ... do we have a response draft? 20:32:48 <ivan> pfps: (reads up the response) 20:33:09 <ivan> IanH: the response is that this is not last call, the document has changed, the import is not a semantics operation 20:33:24 <ivan> ... further efforts will be made to improve the presentation 20:34:21 <bijan> q+ 20:34:22 <ivan> Topic: import by location 20:34:27 <bijan> zakim, unmute me 20:34:27 <Zakim> bijan should no longer be muted 20:34:29 <IanH> q? 20:34:32 <IanH> ack bijan 20:35:13 <ivan> bijan: we had an extensive discussion with Tim ???, Peter has a very long and involved response and we trim that 20:35:21 <bijan> zakim, mute me 20:35:21 <Zakim> bijan should now be muted 20:35:23 <IanH> q? 20:35:27 <bijan> I happy to 20:35:29 <ivan> pfps: I volunteer bijan to write it:-) 20:35:58 <bijan> I head to the page 20:36:09 <ivan> Topic: 2 comments on axiom annotation 20:36:26 <ivan> IanH: they are from bijan, asking for axiom hiding and for naming 20:36:29 <bijan> zakim, unmute me 20:36:29 <Zakim> bijan should no longer be muted 20:36:32 <ivan> ... i though we agreed 20:36:38 <ivan> ... and the commenter agreed, too 20:36:57 <ivan> bijan: i think we decided to reject that and i had the action to answer to myself 20:37:04 <ivan> pfps: i can do it 20:37:10 <ivan> ... i know how to abuse you nicely 20:37:52 <ivan> Topic: number 30, frank's objection 20:38:18 <IanH> Ivan: discussed this to death 20:38:26 <bijan> ship it! 20:38:28 <IanH> Ivan: version on the web agrees with discussion 20:38:40 <msmith> 20:39:19 <bijan> I just reread it and it's great! 20:39:31 <IanH> PROPOSED: send drafted response to comment 30 20:39:34 <ewallace> +1 20:39:36 <IanH> +1 20:39:36 <ivan> +1 20:39:38 <zwu21> +1 20:39:40 <pfps> +1 ALU 20:39:52 <schneid> +1 20:39:54 <baojie> 0 20:39:59 <msmith> +1 20:40:01 <MarkusK_> +1 20:40:04 <bmotik> +1 20:40:06 <sandro> +1 20:40:09 <alanr> +1 20:40:11 <IanH> RESOLVED: send drafted response to comment 30 20:40:14 <bijan> +1 20:40:29 <pfps> 20:40:36 <ivan> Topic: number 58, strong typing 20:40:47 <ivan> pfps: the answer is yes, was part of the discussion yesterday 20:41:03 <ivan> IanH: it brings the fs and the structure aligned 20:41:20 <ivan> bmotik: I will do it, 'thank you, we will do it' 20:41:42 <bijan> We discussed this yesterday 20:41:57 <bijan> I have and action to send the schema (nearly done :() 20:42:20 <ivan> Topic: number 47, disallow multiple key values 20:42:31 <ivan> IanH: no multiple key values 20:42:38 <pfps> 20:43:14 <bijan> q+ 20:43:20 <ivan> pfps: I suggest to say no to this 20:43:22 <IanH> q? 20:43:39 <ivan> schneid: talking to database people they say this is plainly wrong 20:43:42 <bijan> zakim, unmute me 20:43:42 <Zakim> bijan was not muted, bijan 20:43:44 <IanH> ack bijan 20:44:02 <ivan> bijan: i agree with schneid and peter 20:44:10 <ivan> ... you can get that if you wanted 20:44:15 <bijan> zakim, mute me 20:44:15 <Zakim> bijan should now be muted 20:44:30 <ivan> pfps: i will take it 20:44:51 <IanH> 20:44:53 <ivan> Topic: automatic testing in the owl link interface (45) 20:45:15 <bijan> "Thanks for the comment." 20:45:26 <ivan> IanH: i think our response is that it is out of scope 20:45:47 <bijan> q+ 20:45:58 <ivan> pfps: uli is on the hook for that one 20:46:32 <ivan> pfps: ship it! 20:46:37 <bijan> q- 20:46:42 <IanH> q? 20:47:04 <IanH> PROPOSED: send response as drafted to comment 45 20:47:06 <pfps> +1 ALU 20:47:08 <ivan> 0 20:47:12 <IanH> +1 20:47:13 <ewallace> +1 20:47:17 <Achille> Achille has joined #owl 20:47:55 <bijan> +1 20:48:05 <ivan> msmith: one problem, the text says that we will publish document and test cases, but that is not exactly true 20:48:14 <ivan> ... we will produce a test collection 20:48:52 <zwu21> +1 20:49:03 <msmith> +1 20:49:05 <MarkusK_> 0 20:49:13 <schneid> +1 20:49:16 <IanH> RESOLVED: send response as drafted to comment 45 20:49:21 <MarkusK_> I meant +1 20:49:28 <Achille> +1 20:49:45 <ivan> Topic: number 23, extending annotation 20:49:57 <IanH> 20:50:02 <ivan> pfps: after a long discussion with jeremy roger he and i approved a response 20:50:10 <IanH> 20:50:26 <ivan> pfps: "we would love to do, but nobody knows how@ 20:50:31 <ivan> s/@/"/ 20:50:34 <bijan> I've drafted a response to TR1: 20:50:45 <IanH> Q? 20:50:47 <bijan> sorry, jsut reporting 20:50:48 <bijan> not relevant 20:51:13 <IanH> PROPOSED: send draft response 20:51:26 <bijan> Not tr1 20:51:30 <bmotik> +1 20:51:31 <pfps> +1 20:51:32 <ivan> 0 20:51:33 <msmith> +1 20:51:34 <IanH> +1 20:51:35 <MarkusK_> +1 20:51:36 <bijan> no nono 20:51:36 <zwu21> +1 20:51:39 <schneid> +1 20:51:40 <bijan> zakim, unmute me 20:51:40 <Zakim> bijan should no longer be muted 20:51:48 <baojie> +1 20:52:22 <IanH> PROPOSED: send draft response 20:52:24 <msmith> +1 20:52:27 <bijan> +1 20:52:28 <pfps> +1 alu 20:52:30 <bijan> zakim, mute me 20:52:30 <Zakim> bijan should now be muted 20:52:32 <alanr> +1 20:52:32 <zwu21> +1 20:52:50 <IanH> RESOLVED: send draft response 20:52:52 <ewallace> 0 20:53:05 <bijan> zakim, mute me 20:53:05 <Zakim> bijan was already muted, bijan 20:53:19 <bijan> zakim, unmute me 20:53:19 <Zakim> bijan should no longer be muted 20:53:25 <ivan> Topic: number 7, import via 20:53:41 <IanH> PROPOSED: send draft response 20:53:42 <ivan> bijan: just put up a response 20:54:07 <pfps> +1 20:54:10 <bijan> +1 20:54:14 <schneid> +1 20:54:18 <zwu21> +1 20:54:25 <ivan> +1 20:54:27 <ewallace> +1 20:54:31 <baojie> +1 20:54:31 <Achille> +1 20:54:32 <MarkusK_> +1 20:54:36 <bmotik> +1 20:54:40 <msmith> +1 20:54:45 <alanr> +1 20:54:45 <IanH> RESOLVED: send draft response 20:57:24 <sandro> says GRDDL 20:57:24 <sandro>. 20:57:45 <ewallace> Have to go for an hour. I will be back at 5, if you are still meeting. 20:57:48 <Zakim> -Evan_Wallace 20:58:05 <ivan> Topic: number 17, 34 plus a bunch together, GRDDL 20:58:49 <ivan> IanH: 17 says that there is an open issue, will that be resolved? 20:58:51 <bijan> I am 20:58:52 <IanH> q? 20:58:54 <Zakim> -Achille 20:58:58 <bijan> zakim, unmute me 20:58:58 <Zakim> bijan was not muted, bijan 20:59:15 <ivan> bijan: i have seen no change, nobody has talked to me, 20:59:47 <ivan> sandro: last i remember (last f2f) we might move forward with a plan with a grddl that would get to a transform 21:00:00 <ivan> bijan: we got a push back from jonathan 21:00:52 <sandro> ivan: I am unsure whether it is doable in XSLT. 21:00:54 <bijan> It doesn't seem that TQ would be happy with it either 21:00:58 <AchilleF> AchilleF has joined #owl 21:01:08 <bijan> q+ 21:01:15 <ivan> jar: i think it is clear you can do it in xslt, so it is a question of service 21:01:16 <dlm> dlm has joined #owl 21:01:25 <ivan> ... doing it relying on service is a bit fragile 21:01:27 <sandro> jar: I think you CAN do it in XSLT. It's a question of judgement. I think relying on a service is really quite fragile, as opposed to relying on a program. 21:01:34 <ivan> ... the argument is that it is the same sort of thing 21:01:39 <Zakim> +[IBM] 21:01:45 <bijan> Not catchign everything 21:01:45 <IanH> q? 21:01:49 <bijan> Could he move closer to the phone 21:01:51 <ivan> ... and it relies on a service 21:01:51 <AchilleF> zakim, ibm is me 21:01:51 <Zakim> +AchilleF; got it 21:01:52 <ivan> q+ 21:02:11 <IanH> q? 21:02:25 <ivan> ... i think it can be done in many different ways, one way is a service, i am advocating for a proof of something more robust 21:02:34 <IanH> q+ sandro 21:02:39 <ivan> ... how hard is it to replicate this transform, can I copy the software, etc 21:02:41 <bijan> zakim, unmute me 21:02:41 <Zakim> bijan was not muted, bijan 21:02:43 <IanH> q+ peter 21:02:56 <IanH> ack bijan 21:03:12 <sandro> bijan: associating a URI with a mapping is sufficient, I believe. 21:03:26 <ivan> bijan: my original point was that a URI pointing at a generic thing is enough 21:03:38 <IanH> q? 21:03:56 <alanr> q+ 21:04:01 <sandro> bijan: then we were asked for an XSLT, and that proves you're really asking for a program, not a spec. 21:04:04 <pfps> bijan: we are heading down the slippery slope to implementation 21:04:05 <ivan> scribe gave up scribing bijan 21:04:12 <IanH> q? 21:04:18 <pfps> bijan: let's do something minimal 21:04:19 <bijan> zakim, mute me 21:04:19 <Zakim> bijan should now be muted 21:04:26 <IanH> ack ivan 21:04:44 <alanr> q- 21:04:44 <alanr> q- alanr 21:05:18 <IanH> q? 21:05:22 <sandro> ivan: I don't want to reopen this. We agree to disagree. The problem (cf JAR) -- we have no one producing that XSLT that converts OWL/XML to RDF/XML. If so, then we could talk to Bijan about it. But we don't have it. 21:05:24 <dlm> dlm has joined #owl 21:05:53 <sandro> ivan: Will you make the implementation JAR? 21:06:04 <sandro> jar: No. 21:06:11 <alanr> q+ 21:06:19 <IanH> ack sandro 21:06:20 <bijan> What? Quality? Huh? 21:06:57 <jar> to reflect back what bijan said: the grddl uri 'identifies' not a script or program, but the transformation. any implementation of it that works is fine; and implementation is outside the scope of the spec. 21:07:00 <ivan> sandro: bijan you talked about another possibility if the xslt were produced mechanically and if necessary i might volounteer to do taht 21:07:10 <bijan> zakim, unmute me 21:07:10 <Zakim> bijan should no longer be muted 21:07:10 <IanH> q? 21:07:11 <alanr> q? 21:07:14 <bijan> q+ 21:07:15 <ivan> ... i hear bijan say that he is against that 21:07:52 <ivan> pfps: in sympathy with bijan here, bijan's solution is to reuse another tool that will go through our cr tool, 21:07:56 <IanH> q? 21:08:01 <bijan> Example: 21:08:02 <ivan> ... and plan it to be make it available 21:08:04 <IanH> ack peter 21:08:13 <ivan> ... it is code reuse, which is good 21:08:22 <ivan> ... the only thing it does not have is normativity 21:08:32 <IanH> q+ sandro 21:08:35 <ivan> ... if you wan normativity to point to our document 21:08:49 <ivan> ... then there is no code, no viruses, no nothing... 21:08:55 <IanH> ack alanr 21:09:19 <IanH> q+ 21:09:21 <ivan> alanr: i have already scraped the document once and that can be an input to sandro's script 21:09:50 <ivan> ... fair to say that publishing a spec without is a minority view 21:09:59 <bijan> zakim, unmute me 21:09:59 <Zakim> bijan was not muted, bijan 21:10:01 <IanH> ack bijan 21:10:05 <sandro> alan: It's a minority view that spec or on-line service is "grddl" per se. 21:10:13 <ivan> ... we may have a formal objection that we have to consider, do the damn thing and let it done 21:10:22 <sandro> alan: It's a minority view that spec is "grddl" per se. 21:10:47 <sandro> bijan: My main objection is to on-line downloadability. 21:11:13 <pfps> q? 21:11:16 <ivan> bijan: i disagree with what alan says, my main objection is a downloadable script, having a page with a set of transformation is fine, manchester might put an objection if we do thi 21:11:17 <pfps> q+ 21:11:35 <IanH> ack sandro 21:11:49 <ivan> bijan: i have in principle objections the way grddl work 21:11:56 <ivan> ... maybe the mechanical would work 21:12:03 <ivan> ... maybe we should just table this 21:12:05 <sandro> bijan: the mechanical-generation of the transform doesn't help. 21:12:09 <ivan> ... i cannot promise i will agree 21:12:09 <IanH> q? 21:12:10 <bijan> zakim, mute me 21:12:11 <Zakim> bijan should now be muted 21:12:25 <bijan> zakim, unmute me 21:12:25 <Zakim> bijan should no longer be muted 21:12:25 <ivan> sandro: a few weeks i do not want to spend unless i need to 21:12:27 <bijan> q+ 21:12:49 <ivan> ... i do not know whether we can judge the strength of the objections 21:13:07 <IanH> q+ msmith 21:13:17 <ivan> bijan: proposal, if sandro produces such a thing and it pasts all the tests, then i have a strong bias to accept it 21:13:21 <sandro> bijan: if you produce such a thing, and it passes all the tests, I will have a strong bias in favor of supporting it, although I can't promise I'll accept it. 21:13:26 <IanH> q? 21:13:35 <sandro> thanks, Bijan. 21:13:45 <bijan> zakim, mute me 21:13:45 <Zakim> bijan should now be muted 21:14:22 <bijan> Or defaultly use 21:14:24 <ivan> IanH: bijan seems to say that he has an in principle objection to specify a piece of software 21:14:41 <ivan> ... to be honest i fully sympathize with that objection 21:14:48 <ivan> sandro: no one is saying 21:15:18 <IanH> q? 21:15:35 <IanH> ack IanH 21:15:47 <bijan> It's de facto have to use otherwise this wouldn't matter 21:15:51 <bijan> It's defaultly used 21:15:58 <alanr> there is no "have to" anywhere 21:16:20 <sandro> sandro: all the spec says is "use this namespace". then it's up to the namespace owner (W3C, guided by the WG) to make sure the right (GRDDL) thing happens. 21:16:33 <bijan> as a *Second* specification! 21:17:11 <IanH> q? 21:17:18 <schneid> and if we simply put silently, without spec'ing it, a GRDDL transform at the OWL URL? :-) 21:17:18 <bijan> q- 21:17:53 <pfps> we annoint the transform by using the namespace 21:18:14 <bijan> The editor, DanC, agreed with my interpretation 21:18:16 <sandro> ivan: Whether we like it or not, there is GRDDL. It's done. That's not for us to discuss. Bijan and I disagree about what that spec means, but.... 21:18:20 <sandro> q? 21:18:55 <sandro> ivan: Bottom-Line: if this is not set up the way the community is set up, there will be formal objections to OWL/XML. 21:18:56 <bijan> THat's why I caved 21:19:02 <IanH> ack pfps 21:19:08 <sandro> ivan: Bottom-Line: if this is not set up the way the community expects it, there will be formal objections to OWL/XML. 21:19:19 <bijan> However, will the director not override the objection? 21:19:21 <bijan> q+ 21:19:43 <IanH> q+ 21:20:43 <bijan> Uhm, I have the editor telling me that my interpretation is correct 21:21:11 <sandro> peter: If you like to XSLT in GRDDL,you're annointing that XSTL as *the* *definition* 21:21:35 <sandro> sandro: no, that's ridiculous. The real spec is still obvious the Recommendation, which the XSLT implements. 21:21:43 <schneid> ian: if we create such an implementation, but explicitly say that it is not our spec, what happens then? 21:21:47 <ivan> q+ 21:21:55 <IanH> ack msmith 21:22:17 <bijan> 21:22:30 <bijan>. 21:22:30 <bijan> Developers of transformations should make available representations in widely-supported formats. XSLT version 1[XSLT1] is the format most widely supported by GRDDL-aware agents as of this writing, though though XSLT2[XSLT2] deployment is increasing. 21:22:35 <schneid> msmith: asks, people, you want a single XSD that would be referenced? 21:22:47 <bijan> Who uses GRDDL? 21:22:53 <schneid> alanr: people who use grddl, should have their expectations met 21:22:57 <bijan> I mean, what's the population? 21:22:59 <sandro> alan: What I think is needed is the kind of thing GRDDL users want/expect. 21:23:02 <IanH> q? 21:23:22 <bijan> zakim, unmute me 21:23:22 <Zakim> bijan should no longer be muted 21:23:25 <IanH> ack bijan 21:23:55 <IanH> q+ pfps 21:24:09 <schneid> bijan: grddl chair made assertion that conflicts with what sandro sais 21:24:13 <pfps> from GRDDL abstract: Abstract 21:24:15 <pfps>. 21:24:30 <schneid> bijan: our spec is the document 21:24:45 <schneid> bijan: understands positions of both parties 21:24:51 <IanH> q? 21:25:31 <schneid> bijan: asks, whether ivan suggests to not make the grddl transform a rec? 21:25:36 <sandro> ivan: Of course I can't know what will happen if there is a formal objection. 21:25:50 <IanH> q? 21:25:58 <schneid> ivan: if there is a formal objection, then this will probably kill owl/xml as a rec 21:26:40 <sandro> q? 21:26:44 <bijan> zakim, mute me 21:26:44 <Zakim> bijan should now be muted 21:26:46 <ivan> q- 21:26:53 <sandro> ack IanH 21:27:08 <bijan> users will never see those disclaimers 21:27:18 <sandro> IanH: maybe do the XSLT, and hedge around it with various warnings. 21:27:20 <IanH> q? 21:27:24 <schneid> ianh: no one has commented on my suggestion: "this grddl transform is not a mandatory spec" 21:27:29 <IanH> ack pfps 21:28:39 <bijan> People don't pick it up...it's silent 21:28:39 <schneid> alanr: don't understand what the problem is with having bugs in the transform, then let's fix it; the normative thing is the document 21:28:40 <bijan> q+ 21:29:17 <IanH> q? 21:29:19 <bijan> zakim, unmute me 21:29:19 <Zakim> bijan should no longer be muted 21:29:19 <schneid> alanr: why not document this that we will fix all bugs 21:29:21 <pfps> q+ 21:29:22 <IanH> ack bijan 21:29:38 <IanH> ack pfps 21:29:54 <schneid> bijan: I am not going to accept this [FIXME!] 21:30:11 <IanH> q? 21:30:12 <bijan> Yes 21:30:26 <bijan> q+ to point out a service based example 21:30:48 <bijan> 21:31:15 <IanH> q? 21:31:27 <schneid> ivan: in f2f4 we discussed that there should /exist/ some xslt transform as a service (somehow) 21:31:56 <bijan> zakim, unmute me 21:31:57 <Zakim> bijan was not muted, bijan 21:32:03 <IanH> q? 21:32:18 <IanH> ack bijan 21:32:18 <Zakim> bijan, you wanted to point out a service based example 21:32:22 <IanH> q? 21:32:27 <bijan> We did dicusss it 21:32:37 <bijan> zakim, unmute me 21:32:37 <Zakim> bijan was not muted, bijan 21:32:40 <IanH> ack bijan 21:32:45 <schneid> bijan: there is a conversion service (have put url into irc) 21:33:05 <schneid> ivan: we can have such a service at w3c, too 21:33:24 <IanH> q? 21:33:28 <schneid> alanr: what is the issue with this? 21:33:45 <IanH> q? 21:33:46 <schneid> alanr: how would this solve the problem? 21:33:59 <IanH> q? 21:33:59 <schneid> ivan: does not resolve the principle problem 21:34:11 <bijan> q+ 21:34:21 <bijan> zakim, unmute me 21:34:21 <Zakim> bijan was not muted, bijan 21:34:29 <IanH> q? 21:34:46 <IanH> q? 21:34:49 <IanH> ack bijan 21:35:37 <IanH> q? 21:35:53 <bijan> bijan: The service based one makes me a little happier (not ideal) because it makes it very clear that there is no specification going on with this implementation 21:36:10 <bijan> Like the RDF Mapping 21:36:35 <IanH> q? 21:36:39 <sandro> jar: for practical reasons, the grddl transform must resolve to code that will run. 21:37:08 <schneid> jonathan: issue for me is how to have the transform behind the firewall 21:37:17 <bijan> Why is firewall replication a criterion? 21:37:18 <IanH> q? 21:37:18 <sandro> jar: then the question is how hard will it be for me to implement the transform behind my firewall. (1) punch a hole, (2) copy the service, (3) re-implenet 21:37:28 <sandro> q+ 21:37:29 <bijan> q- 21:37:30 <sandro> q- 21:38:31 <bijan> It is open source 21:38:43 <IanH> q? 21:39:13 <sandro> peter: grddl should selectiveally apply any/all trnasforms. 21:39:15 <IanH> q? 21:39:18 <bijan> Peter is wrong 21:39:30 <bijan> q+ 21:39:54 <IanH> q? 21:40:01 <bijan> zakim, unmute me 21:40:01 <Zakim> bijan was not muted, bijan 21:40:09 <IanH> ack bijan 21:40:20 <pfps> 21:40:30 <schneid> bijan: belives peter's reading of the grdll spec is invalid 21:40:52 <IanH> q? 21:40:54 <schneid> bijan: one can have several transforms for the same 21:41:02 <bijan> I agree! 21:41:04 <IanH> q? 21:41:15 <IanH> q? 21:41:40 <bijan> I proposed this way back and was rejected :( 21:41:42 <schneid> pfps: if we cannot understand the grddl spec, then it is not perfect 21:41:48 <IanH> q? 21:41:51 <msmith> peter is referencing the second normative (green) block at 21:41:57 <sandro> alan: nice solution would be to have multiple transforms. 21:42:01 <bijan> The GRDDL chair suggested that this is nice idea 21:42:11 <jar> what I need a story for: What happens 10 years from now after the service stops running (you look at the spec and reimplement it?); what do I do inside the firewall (same? or find the java code?) 21:42:58 <IanH> q? 21:43:14 <schneid> ivan: service oriented solution works for me, and if it also works for jar and tq, then its ok? 21:43:17 <bijan> jar, what would happen if the w3c servers died and no longer served the XSLT? 21:43:41 <jar> go to the time machine. 21:43:52 <schneid> alanr: ivan, you would not object 21:43:54 <schneid> ivan: no 21:43:54 <bijan> So, same deal 21:44:01 <sandro> PROPOSED: if we can have multiple GRDDL transforms, then we'll do (1) the spec, (2) on-line transform service, (3) download single xslt; if only one transform, then we'll do the on-line transform service only. 21:44:49 <sandro> DanC: it's OK to have multiple XSLTs; the GRDDL test suite has an example, yes 21:44:49 <sandro> DanC: if you're willing to claim the spec is a representation of an algorithm, then yes, you can link the spec as a GRDDL transformation. 21:44:52 <pfps> +1 ALU 21:45:02 <ivan> 1 21:45:06 <IanH> ? 21:45:35 <IanH> q? 21:45:35 <sandro> (I'm quoting what Dan just answered me.) 21:46:41 <schneid> sandro: what will have happen, if I don't manage it? 21:46:45 <ivan> 0 21:46:47 <zwu21> 0 21:46:51 <sandro> PROPOSED: if we can have multiple GRDDL transforms, then we'll do (1) the spec, (2) on-line transform service (if a good one is produced), (3) download single xslt (if a good one is produced); if only one transform, then we'll do the on-line transform service only. 21:47:05 <sandro> PROPOSED: if we can have multiple GRDDL transforms, then we'll do (1) the spec, (2) on-line transform service (if a good one is produced), AND (3) download single xslt (if a good one is produced); if only one transform, then we'll do the on-line transform service only. 21:47:26 <bijan> WHy wouldn't we do the spec? 21:48:00 <sandro> Ivan: A GRDDL transform with do BOTH (2) and (3). 21:48:06 <pfps> +1 21:48:07 <sandro> Ivan: A GRDDL system with do BOTH (2) and (3). 21:48:16 <schneid> ivan: if a grddl system sees several transforms, then it applies them all and merges the resulting RDF documents 21:48:43 <jar> I think DanC is hinting at content negotiation. spec is one 'representation', xslt is another. don't know if that will work. 21:48:50 <bijan> So what's wrong with that? 21:48:56 <schneid> ianh: let's assume the grddl spec is the way ivan and bijan say 21:49:02 <bijan> It can run them both, merge them, and it's fine ;) 21:49:13 <msmith> , section 7 21:49:16 <pfps> +1 to bijan 21:49:35 <sandro> PROPOSED: if we can have multiple GRDDL transforms, and systems:50:10 <pfps> +1 21:50:16 <bmotik> +1 21:50:17 <sandro> +1 21:50:18 <ivan> 1 21:50:18 <alanr> +1 21:50:19 <IanH> +1 21:50:20 <baojie> +1 21:50:22 <msmith> +1 21:50:22 <zwu21> 0 21:50:24 <AchilleF> 0 21:50:27 <bijan> In general, that we cannot rely on the spec where it conflicts with the *assumptions* certain people have about the spec. In particular, the people objecting. 21:50:35 <bijan> +1 (for the sake of group hugs) 21:50:40 <schneid> +0.5 (sounds good, at least...) 21:50:43 <sandro> *hugs* bjian 21:50:45 <MarkusK_> +0.5 21:51:25 <alanr> even better alan *hugs* bijan 21:51:27 :51:53 . 21:52:10 . This closes ISSUE-97. 21:52:32 <bijan> I wonder if we should send a bug report to the GRDDL list 21:54:47 <bijan> q+ 21:54:52 <bijan> zakim, unmute me 21:54:52 <Zakim> bijan was not muted, bijan 21:54:55 <IanH> Q? 21:54:58 <IanH> q? 21:55:02 <IanH> ack bijan 21:56:22 <bijan> 21:56:30 <bijan> Pointer! 21:56:36 <ivan> bijan: can I send it to Jim now? 21:58:25 <alanr> action: Alan to send wg apology to jim re: initial version of 21:58:26 <trackbot> Created ACTION-300 - Send wg apology to jim re: initial version of [on Alan Ruttenberg - due 2009-03-03]. 21:58:42 <IanH> PROPOSED: Bijan sends response 21:58:45 <pfps> +1 ALU 21:58:51 <IanH> +1 21:58:59 <bmotik> +1 21:59:01 <msmith> +1 21:59:05 <baojie> 0 21:59:06 <alanr> _1 21:59:07 <ivan> +1 21:59:08 <alanr> +1 21:59:09 <bijan> +1 21:59:10 <zwu21> +1 21:59:11 <MarkusK_> +1 21:59:18 <IanH> RESOLVED: Bijan sends response 22:00:10 <ivan> topic: number 8, facet space 22:00:16 <IanH> 22:00:31 <IanH> 22:00:54 <ivan> schneid: there is some text in the struc spec where the topics is facet space of datatype maps 22:01:09 <ivan> ... (reads the content of the text) 22:02:13 <ivan> after looking in the diret semantics a value space of some of the datatypes in the dataype map, for everything else the definitions are not specified 22:02:27 <ivan> bmotik: i have a slight problem 22:02:39 <ivan> ... this makes the definition of one datatype dependent on the others 22:02:51 <ivan> ... you should be able to do them independently 22:03:08 <ivan> ... we do define by taking the definitions from somewhere 22:03:25 <ivan> schneid: we are talking about datatypes 22:03:46 <ivan> ... do we talk about datatypes and these arbtirary objects are in some value space 22:04:03 <ivan> bmotik: it should be possible to define a datatype in isolation 22:04:31 <ivan> schneid: if we do not talk about data values, then can we allow things without a value 22:04:40 <ivan> ... there should be some data value for the facets 22:04:49 <ivan> ... one point what do we want to have 22:04:50 <IanH> Q? 22:04:56 <ivan> ... other what is in the definition 22:05:13 <zwu2> zwu2 has joined #owl 22:05:18 <ivan> ... The way things are defined is that the datatypes are also in the datatype maps 22:05:30 <ivan> ... what you want to have does not match to what is written 22:05:44 <ivan> schneid: i would suggest to have an offline diiscussion 22:05:45 <bijan> zakim, mute me 22:05:45 <Zakim> bijan should now be muted 22:06:04 <ivan> msmith: you primary object is that an arbitrary object can come from another domain? 22:06:19 <ivan> s/diiscussion/discussion/ 22:06:26 <bijan> In rdf, malformed literals get interpreted as an arbitrary element of the domain outside the datatype 22:07:10 <IanH> 22:07:22 <ivan> Topic: number 9 22:07:29 <ivan> bmotik: i have it on my todo list 22:07:45 <ivan> Topic: editorials 22:08:01 <bijan> It was sent 22:08:04 <ivan> IanH: we have a couple here which are done and we should just decide whether we should just ship them 22:08:11 <ivan> .. number 14 done 22:08:27 <ivan> ... number 16: this is response draft, edits identified 22:08:30 <IanH> 22:10:53 <Zakim> +Evan_Wallace 22:11:03 <ewallace> Hi 22:11:10 <IanH> PROPOSED: In response to we will use the term "lexical form" for datatypes 22:11:47 <zwu2> +1 22:11:51 <baojie> +1 22:11:55 <schneid> +1 22:12:18 <IanH> +1 22:12:44 <bijan> +1 22:13:23 <MarkusK_> +1 22:14:32 <baojie> 22:14:33 <IanH> RESOLVED: In response to we will use the term "lexical form" for datatypes 22:14:48 <IanH> 22:17:48 <Zakim> -AchilleF 22:24:24 <alanr> 22:25:00 <alanr>? 22:26:24 <jar> jar has joined #owl 22:31:55 <bmotik_> bmotik_ has joined #owl 22:32:30 <sandro> action: jie Contact Andy Seaborn and try to make sure he's happy with our work on rdf:text, and will talk to use about any remaining issues. 22:32:30 <trackbot> Created ACTION-301 - Contact Andy Seaborn and try to make sure he's happy with our work on rdf:text, and will talk to use about any remaining issues. [on Jie Bao - due 2009-03-03]. 22:32:45 <ewallace> q+ 22:33:14 <IanH> Q? 22:33:20 <IanH> q? 22:33:47 <IanH> ack ewallace 22:33:56 <ivan> zakim, who is here? 22:33:57 <Zakim> On IRC I see jar, zwu2, dlm, AchilleF, schneid, msmith, christine, sandro, baojie, RRSAgent, ivan, MarkusK_, Zakim, bmotik, IanH, bijan, ewallace, trackbot 22:34:12 <bijan> zakim, unmute me 22:34:12 <Zakim> bijan should no longer be muted 22:35:03 <ivan> adjurned 22:35:06 <zwu2> zwu2 has left #owl 22:35:07 <ivan> clap clap clap 22:35:44 <bijan> Ivan has a huge range of facial expressions 22:36:10 <Zakim> -Evan_Wallace 22:36:24 <Zakim> -bijan 22:42:51 <Zakim> -MIT346 22:42:52 <Zakim> SW_OWL(F2F)8:00AM has ended 22:42:54 <Zakim> Attendees were jar, MIT346, Evan_Wallace, Achille, uli, bijan, christine, +1.518.276.aaaa, AchilleF <sandro> Meeting in progress. New content inserted above this line.
https://www.w3.org/2007/OWL/wiki/Chatlog_2009-02-24
CC-MAIN-2016-30
refinedweb
20,645
70.97
It’s seems like it’s time for a new post in the series about importing vendor catalogs in Dynamics AX 2012. The previous couple of blog posts covered setup and importing a sample catalog. It’s all well and nice but what if something went wrong somewhere along the way of setting up the feature. Below you will find a list of problems that can arise during vendor catalog import setup. And of course the solutions to the problems will be described in detail. Questions and Answers I try to import a Vendor catalog with Dynamics AX. I generate the XSD File but it is really not clear how to populate it. The XSD file that you can generate from the vendor catalog form provides you with the schema of the CMR file that can be imported. XSD (XML Schema Definition) is one of several XML schema languages. The blog post about importing a sample catalog contains a detailed list of steps that you need to take to generated a sample CMR file. I’d like to see an example of a CMR file with data to import? It is important to note that the XSD schema for CMR files depends on the procurement hierarchy that you set up in Dynamics AX so the chances of successfully importing sample CMR files are really-really low because the XSD schema produced from your system will most probably differ from the one that was used to generate the sample file. However it’s always nice to see a sample file just to have an idea of what kind of beast the CMR file is. Below is the XML that a sample file might contain: <?xml version="1.0" encoding="utf-8"?> <VendorCatalog VendorName="CatImpVend" LoadDate="1900-01-01T01:01:01+01:00" ProductClassification="Procurement Category" xmlns=""> <Product xmlns: <PriceInformation> <Price Currency="USD" UnitOfMeasure="%" Value="100"> </Price> </PriceInformation> <ProductNameAndDescription> <NameAndDescription> <Description>Description1</Description> <Name>Name1</Name> <Language>af</Language> </NameAndDescription> </ProductNameAndDescription> <ProductAttributes> <Color Language="af">Blue</Color> </ProductAttributes> </Product> </VendorCatalog> I’m getting the error “Imported schema for namespace ‘’ was not resolved” when trying to generate in Visual Studio a sample CMR file based on the XSD schema. This is a known issue. The workaround is to remove the line below from the XSD file: <xs:import When I run the AIF job for processing no error is given but the status of the import in the Catalog file history does not change The error was most probably logged in the AIF exception log: System administration\Periodic\Application integrationServices and Application Integration Framework\Exceptions. In the AIF exception log there is an error: Could not find schema information for the element ‘’. Make sure that you set up the inbound port in AIF as in Walkthrough: Configuring an inbound integration port for catalog import [AX 2012]. Pay special attention to the paragraph about setting up the pipeline component: The catalog import service requires a special component that processes CMR documents. To enable this component, follow these steps. In the Inbound ports form, on the Processing options tab, select the Preprocess service operation requests check box, and then click Inbound pipelines. In the Inbound pipelines form, click Add. Then, in the Class name list, select CatVendorXmlTransform. In the Purpose field, enter an optional description, such as “Transform vendor XML files,” and then close the Inbound pipelines form. Click Activate to deploy the integration port. When I’m trying to set the Root folder path in the Vendor catalog import parameters nothing happens when I click the OK button. The reason is most probably because the user account that is used to run AOS does not have permissions to the folder you chose. I uploaded the CMR file but after running the AIF import jobs the status in the event log is still “Catalog upload complete “. Verify the AIF exception log. Verify that you set up the inbound port for vendor catalog import correctly Verify that you used correct URI in the inbound port. It should be set up with CatalogImportPickup subfolder rather than with the root folder. Conclusion I hope this information was useful. I would like to make this article into a live blog post. So if you have any problems with setting up vendor catalog import please write to me or post a comment and I will do my best to resolve your problem and post the resolution in this article. we have a problem with the vendor catalog. We get to the point that the catalog is imported, but according to the event log it is not validated against the xsd schema. What could case failing this validation? is the validation controlled by the workflow? Thanks a lot for your answer Hi Bastiaan, Have you tried looking in the AIF exception log (System administrationPeriodicApplication integrationServices and Application Integration FrameworkExceptions)? There might be some context there about which tag/attribute is incorrect. Essentially the validation of the CMR file is performed against the XSD schema that you generated from the Vendor Catalog form so you should be able to use any standard xsd validation tool to get more info. Best regards, Vanya P.S. I think there is an error in the second blog post in the series that I forgot to correct (now it's fixed). When generating the sample CMR file from visual studio you should right click the VendorCatalog (instead of Product) node in the XML schema explorer and then click Generate Sample XML. Could you also try that? Hi Vanya, Thanks for you quick response! I checked the expections log, but there is no message on the vendor catalog import and i've created the XML sample by right click on the VendorCatalog. According to the event log on the catalog file history the catalog upload was completed, however the next step 'validating with schema' is not performed. See status descriptions in step 9 of technet description technet.microsoft.com/…/hh242762 could this be a problem with a workflow or with the inbound port. Best regards, Bastiaan Did you run the AIF processing jobs (see the first blog post in the series: blogs.msdn.com/…/import-vendor-catalogs-from-setup-to-importing-a-sample-catalog-part-1-setup.aspx)? 1: static void runAIFReceive(Args _args) 2: { 3: new AifGatewayReceiveService().run(); 4: new AifInboundProcessingService().run(); 5: 6: info('AIF processing done'); 7: } Thanks for your help! we found the problem, we used an incorrect URI in the inbound port, it was setup with the root folder, instead of the catalogimportpickup subfolder. Regards Bastiaan Hi Vanya, I have used you guides regarding Import Vendor Catalog (all 3 parts) and found them very usefull. We succeded in setting up the entire Vendor Catalog import and it works like a charm on the basis of a simplified xml test file (as illustrated in your blog above). I have run into some problems with the XSD file generated from the vendor catalog. We have resolved the issue with the 'Imported schema for namespace ‘…/namespace’ by deleting it as described, but when we try to map the XSD file in Excel (Developer – Source – XML Maps), we get a error: "The following Scema elements and structures cannot be mapped to a worksheet. They will not be visible in the XML Source task pane. – any – anyAttribute – Substitution groups – Abstract elements – Recursive structures – Mixed content Will you continue ….. and so on. When we continue, then the only available VendorCatalog_Map in the Source is: VendorName LoadDate ProductClassification Could you point me in the right direction of a solution to the matter, I would me most pleased. Kindest regards Michael Munck Hi, thanks for this great article. I would like to whether we can import both the product masters and its variants in the same XML/CMR file. I have tried by changing the product type = product variant for the variant in the same file. But while importing I get an error that there is a duplicate product code. It should be there since the product code for all the variants is same and the unique will be the product barcode. Awaiting to know, if there are any work arounds. Regards Hi all, Michael, i have same problem you. How import a xml file on excel for work/generate catalog ? Another question : How imported two catalogs of different vendor who have same product number ? Thanx Hi all, Michael, i have same problem you. How import a xml file on excel for work/generate catalog ? Another question : How imported two catalogs of different vendor who have same product number ? Thanx Hi all, I have the same issue of micheal, how open the xsd with excel to populate the XML file? Or how to convert the XSD to XML with the right data ? Thanks in advance, Hi Vanya. I have an issue, which is not listed here. I'm trying to import an XML file. I have no XSLT file which will transform my XML. I've configured my inbound port using "Walktrough". When I have in my inbound port configured "Inbound pipelines" I have an exception "An 'xsl:choose' element must have at least one 'xsl:when' child.". But as I mentioned above, I have no XSLT file attached, where would be possible to find any xsl:when statement. My XML document is already prepared as it should be. I think that a class CatVendorXmlTransform is trying to transform something, but there is nothing to transform. Am I right? So, does it mean that I should not use "Inbound pipelines" in that case? When Inbound pilelines is switched off, I have a message "Invalid document schema. The following error was returned: Could not find schema information for the element 'schemas.microsoft.com/…/Message:VendorCatalog&. Any advise? 🙂 I think I'm stuck
https://blogs.msdn.microsoft.com/dynamicsaxscm/2013/03/07/import-vendor-catalogs-part-3-troubleshooting/
CC-MAIN-2017-13
refinedweb
1,631
62.78
You can subscribe to this list here. Showing 4 results of 4 Allen Beye Riddell <allen.riddell@...> writes: > I'd like to remove the whitespace, padding, offset, etc on the left and > right of the plot as I'm writing the entire thing to a jpg. I've turned > the frame, axes, ticks off, but the space still remains. [...] > ax = fig.add_subplot(111) Replace this line by ax = fig.add_axes((0,0,1,1)) The default subplot axes leave some space for tick labels etc., but this gives you axes spanning the full figure. -- Jouni K. Seppänen Hi, I've searched the archives but can't find a solution to this problem. I'd like to remove the whitespace, padding, offset, etc on the left and right of the plot as I'm writing the entire thing to a jpg. I've turned the frame, axes, ticks off, but the space still remains. I've attached the code and the resulting image. code (inside a django app): def hours_chart(request): from PIL import Image as PILImage from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.axes import Axes from StringIO import StringIO fig = Figure(figsize=(3,1),facecolor='r') # w,h in inches fig.frameon = False canvas = FigureCanvas(fig) ax = fig.add_subplot(111) values = [d.get_total_hours() for d in Debrief.objects.all().order_by('date')] # the data ax.plot(values,lw=2) ax.axis('off') canvas.draw() size = canvas.get_renderer().get_canvas_width_height() buf=canvas.tostring_rgb() im=PILImage.fromstring('RGB', size, buf, 'raw', 'RGB', 0, 1) imdata=StringIO() im.save(imdata, format='JPEG') response = HttpResponse(imdata.getvalue(), mimetype='image/jpeg') return response This is the result -- as you can see there's a lot of white space on the left of the plot: On 6/3/07, Werner Hoch <werner.ho@...> wrote: >. _wxagg.so is a piece of extension code we used to efficiently transfer portions of the agg canvas to the wx canvas. Starting with wxpython 2.8, it became possible to do this with pure python using python buffer objects, so we turned it off by default. If you are using wxpython 2.6, and need this functionality, eg for some of the matplotlib widgets or animation techniques described at simply set BUILD_WXAGG=1 in setup..py and rebuild mpl. JDH. Regards Werner
http://sourceforge.net/p/matplotlib/mailman/matplotlib-users/?viewmonth=200706&viewday=3
CC-MAIN-2015-35
refinedweb
388
60.31
Would this fix address creating a backup of running database A over running database B by accident? It seems to assume there is only one database around. One thought I had was for the backup code not to allow a backup at C if the file C/service.properties exists. May not solve every problem but would remove some opportunities for a backupto overwrite a running database. Another possible longer-term solution, at least with the security manager, would be to add some Derby specific permissions for backup, import and export. Haven't put much thought into how this would work and how it would affect backward compat. Dan. Suresh Thalamati wrote: > Thanks Bryan. I was also thinking on the similar lines on the possible > fixes(#3) I mentioned in my comments. This seems to better idea > than trying to deal with paths/permissions. > > -suresh > > Bryan Pendleton wrote: > >>> I think it is very rare any user will make mistake of giving >>> backup path same as database home or one of its subdirectories. But I >>> agree it might be nice to throw a better error message, but that >>> might add some addtional restrictions or overhead. >>> >>> Some thought one possible way to fix this:: >> >> >> >> Here's an idea: >> >> Store a file with an obvious name into the backup path. >> >> Then search down from the database home and see if you find the file. >> >> If you do, there's an error. If you don't, things are fine. >> >> Either way, remove the file once you're done. >> >> I don't believe this requires any additional security permissions, >> because >> you already have to be able to write to the backup and read from the >> database in order to perform the backup. >> >> And I think this algorithm is pretty reliable in the face of symbolic >> links, >> etc., because you are working with a real file in a real location, not >> trying to interpret the paths abstractly. >> >> Just thought I'd throw this out there, in case it gave you some ideas >> of ways to work on the problem.
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200602.mbox/%3C43E7CDAF.4070308@apache.org%3E
CC-MAIN-2016-40
refinedweb
343
71.55
This module is unmaintained (now part of mechanize, but interface no longer public). A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser. Many simple HTML parsing tasks are simpler this way than with the HTMLParser module. pullparser.PullParser is a subclass of HTMLParser.HTMLParser. Examples: This program extracts all links from a document. It will print one line for each link, containing the URL and the textual description between the <a>...</a> tags: import pullparser, sys f = file(sys.argv[1]) p = pullparser.PullParser(f) for token in p.tags("a"): if token.type == "endtag": continue url = dict(token.attrs).get("href", "-") text = p.get_compressed_text(endat=("endtag", "a")) print "%s\t%s" % (url, text) This program extracts the <title> from the document: import pullparser, sys f = file(sys.argv[1]) p = pullparser.PullParser(f) if p.get_tag("title"): title = p.get_compressed_text() print "Title: %s" % title Thanks to Gisle Aas, who wrote HTML::TokeParser. All documentation (including this web page) is included in the distribution. Stable release. For installation instructions, see the INSTALL file included in the distribution. The Subversion (SVN) trunk is, so to check out the source: svn co pullparser Beautiful Soup is widely recommended. More robust than this module. I recommend Beautiful Soup over pullparser for new web scraping code. More robust and flexible than this module. 2.2.1 or above. pullparser is dual-licensed: you may pick either the BSD license, or the ZPL 2.1 (both are included in the distribution). Because module HTMLParser is fussy. Try pullparser.TolerantPullParser instead, which uses module sgmllib instead. Note that self-closing tags (<foo/>) will show up as 'starttag' tags, not 'startendtag' tags if you use this class - this is a limitation of module sgmllib. HTMLParser.HTMLParserisn't very robust. Would be fairly easy to (perhaps optionally) rebase on the other standard library HTML parsing module, sgmllib.SGMLParser(which is really an HTML parser, not a full SGML parser, despite the name). I'm not going to do that, though. I prefer questions and comments to be sent to the mailing list rather than direct to me. John J. Lee, May 2006.
http://wwwsearch.sourceforge.net/old/pullparser/
CC-MAIN-2017-04
refinedweb
357
53.88
Hello, I am writing a program that will repeatedly calculate (loop) using the formula nextGuess = 0.5(lastGuess + number/lastGuess). I need a function using this calculation, and I need some inputs: the number, the first guess from the user. Then, the difference will be calculated between the value of nextGuess and the value of lastGuess. If the difference is < 0.005, the loop ends. Here is the code I have written, so far. It compiles, but definitely doesn't do what I want. Thanks for any help! I'm fairly new to programming, so I am kind of lost as to how to fix it...Thanks for any help! I'm fairly new to programming, so I am kind of lost as to how to fix it...Code:#include <stdio.h> #include <math.h> void instruct( void ); double nextGuess (double number, double guess, double lastGuess ); int main( void ) { double number, answer, guess, difference, newGuess, lastGuess; instruct (); printf ( "\n\n Enter a real number that you wish to have the square root calculated: \n\n" ); scanf ( "%lf", &number ); if ( number < 0 ) printf ( "\n\n I'm sorry but negative numbers don't work in this equation. \n\n" ); else if ( answer = (sqrt(number))) printf ( "\n\n Enter your guess for the square root of %.5lf: \n", number ); scanf ( "%lf", &guess ); do { // newGuess = 0.5 * ( lastGuess + newGuess / lastGuess ) guess = nextGuess(number, guess, lastGuess); difference = answer - guess; } while( difference > 0.005 || difference < -0.005 ); printf ( "\n\n Congratulations, your guess was within 0.005 of the square root of %.5lf!!!!! \n\n", number ); return 0; } void instruct( void ) { printf ( "\n\n You will give a number, N, which will then have its square root calcuated. You will then insert guesses as to what you think the square root is and when are you within 0.005 of the correct answer you will have completed the situation. \n" ); } double nextGuess (double number, double guess, double lastGuess ) { double newGuess; newGuess = 0.5 * (lastGuess + newGuess/ lastGuess); return (newGuess); } Sarah
http://cboard.cprogramming.com/c-programming/108610-program-calculate-square-root.html
CC-MAIN-2015-48
refinedweb
334
75.5
Opened 3 years ago Last modified 3 years ago #11677 new bug Dramatic de-optimization with "-O", "-O1", "-O2" options Description (last modified by ) Look for this simple program: import Control.Monad import Data.Maybe -- import qualified Data.HashMap.Strict as M -- import qualified Data.Map.Lazy as M import qualified Data.Map.Strict as M -- import Control.DeepSeq -- import Control.Exception main :: IO () main = do putStrLn "Start" n <- read <$> getLine q <- read <$> getLine dict' <- M.fromList <$> replicateM n ((\(k:v:_) -> (k,v)) <$> words <$> getLine) -- dict <- evaluate $ force dict' let dict = dict' count <- length <$> catMaybes <$> replicateM q (flip M.lookup dict <$> getLine) print count When compiled without "-O2" it runs about 0.07 sec on my computer. But when compiled with "-O2" it runs about 77 sec (1100 times slowly!). Look: compile and run without "-O2": % rm -rf ./mime_type mime_type.{o,hi} && ghc mime_type.hs -o mime_type && cat my_data.txt | time ./mime_type [1 of 1] Compiling Main ( mime_type.hs, mime_type.o ) Linking mime_type ... Start 4738 ./mime_type 0,06s user 0,01s system 97% cpu 0,069 total And with "-O2": % rm -rf ./mime_type mime_type.{o,hi} && ghc -O2 mime_type.hs -o mime_type && cat my_data.txt | time ./mime_type [1 of 1] Compiling Main ( mime_type.hs, mime_type.o ) Linking mime_type ... Start 4738 ./mime_type 76,73s user 0,10s system 99% cpu 1:17,12 total But when force dict variable ( dict <- evaluate $ force dict'), it runs fast in both cases (with and without "-O2"). Also this bug is reproductable with "-O", "-O1" options. Also this bug is reproductable with .Strict and .Lazy versions; and with Data.HashMap, .Strict and .Lazy Also this bug is reproductable with GHC 7.10.2 and GHC 8.0.1-rc2 (The Glorious Glasgow Haskell Compilation System, version 8.0.0.20160204). Data file my_data.txt is attached. It has simple structure: - N, number of key-value pairs - K, number of keys for searching - N key-value pairs - K kes You can generate it with this Ruby script: #!/usr/bin/env ruby lst = ('a'..'z').to_a N = 10000 K = 10000 File.open('my_data.txt', 'w') do |f| f.puts(N) f.puts(K) N.times do f.puts("#{lst.sample(3).join} #{lst.sample(5).join}") # f.puts("(\"#{lst.sample(3).join}\",\"#{lst.sample(5).join}\")") end K.times do f.puts("#{lst.sample(3).join}") end end Attachments (1) Change History (7) Changed 3 years ago by comment:1 Changed 3 years ago by comment:2 Changed 3 years ago by comment:3 Changed 3 years ago by Update: if disable -fenable-rewrite-rules (i.e. -O2 -fno-enable-rewrite-rules), then compiled program runs fast! comment:4 Changed 3 years ago by Thanks for the excellent description and testcase! The problem here is that GHC is inlining the definition of dict with -O1. This means that your transformed program looks like, dict' <- replicateM n ((\(k:v:_) -> (k,v)) <$> words <$> getLine) count <- length <$> catMaybes <$> replicateM q (flip M.lookup (M.fromList dict) <$> getLine) Meaning that the Map is being reconstructed with every line that is read. You can easily discourage GHC from performing this inlining by placing a bang on the dict' binding, !dict' <- M.fromList <$> replicateM n ((\(k:v:_) -> (k,v)) <$> words <$> getLine) You were accomplishing this same end with your evaluate $ deepseq, but more "forcefully". Indeed it is a bit unfortunate that GHC decides that this inlining is beneficial, but I'm not entirely sure how it could know otherwise. comment:5 Changed 3 years ago by For the record, I concluded this by comparing the output of -ddump-simpl -dsuppress-all from the testcases compiled with -O1 with and without the evaluate $ deepseq. The delta in the Core produced in these two cases is extremely small and immediately reveals the problem (cutting out a few spurious differences), comment:6 Changed 3 years ago by This is another in the long chain of tickets involving the "state hack" and replicateM. See #1168 for a list and #9388 for ideas. Sadly -fno-state-hack doesn't make any difference. Reason: the fmap for IO is begin called, and looks like fmapIO = \f a s. case a s of (r, s') -> (f r, s') So if we have replicateM (fmapIO (g (expensive x)) getLine), we'll inline fmapIO to replicateM (let f = g (expensive x) in \s. case getLine s of (r, s') -> (f r, s')) Now if that \s which come from fmapIO is treated as one-shot, we'll inline g (expensive x) inside; disaster. The -fno-state-hack doesn't make any difference because Joachim arranged to persist one-shot-ness in interface files, so what matters is the setting in GHC.Base where fmapIO was defined. Anyway that's the reason, and we have many examples of it. The right solution is sketched in #9388 but it needs someone to pick up the cudgels. Test data
https://trac.haskell.org/trac/ghc/ticket/11677
CC-MAIN-2019-35
refinedweb
817
67.76
On Mon, Sep 10, 2001 at 01:51:22PM -0400, Christopher Faylor wrote: >On Mon, Sep 10, 2001 at 02:48:16PM +1000, Danny Smith wrote: >>The last change to the anonymous struct in LARGE_INTEGER in winnt.h, >>doesn't make sense to me. > >I must be missing something. > >Reading windows.h, I'm having a hard time seeing how ANONYMOUS_STRUCT could >ever be undefined. (Sorry. Please ignore the above two sentences. I typed them, then decided that I'd better do some more research and forgot to delete them after I refreshed my memory on why I made the change.) >With my my cross gcc compiler, which is based on gcc 3.0.1, this code does >not work: > >#define _ANONYMOUS_STRUCT >#if _ANONYMOUS_STRUCT || defined(foo) >"foo"=1; >#endif > >% i686-pc-cygwin-gcc tst.c -c >tst.c:2:23: operator 'EOL' has no left operand > >With gcc 2.95.3, I get this (as expected): > >% /cygwin/bin/i686-pc-cygwin-gcc tst.c -c >tst.c:2: parse error > >If I change the file to this: > >define _ANONYMOUS_STRUCT __extension__ >#if _ANONYMOUS_STRUCT || defined(foo) >"foo"=1; >#endif > >Then I get this for both 3.0.1 and 2.95.3: > >% i686-pc-cygwin-gcc -c /tmp/tst.c >% > >In other words, the compiler ignores line three of the file, which is >not the expected behavior. > >>Sat Sep 1 10:40:37 2001 Christopher Faylor <cgf@cygnus.com> >> >> * include/winnt.h: Use defined(_ANONYMOUS_STRUCT) to determine if >> anonymous structs are available rather than just testing preprocessor >> variable directly. >> >> >> >> _ANONYMOUS_STRUCT is always defined in windows.h, so the >>#if defined(_ANONYMOUS_STRUCT) conditional doesn't do anything. >>If you compile this >> >>#define NONMAMELESSUNION >>#include <windows.h> >> >>with current CVS winnt.h, the _[U]LARGE_INTEGER structs throw pedantic >>warnings. >> >>If you don't like the #if _ANONYMOUS_STRUCT syntax (which doesn't >>cause any problems for me with 3.0.1 or with 2.95.3, as long as I >>include windows.h first), here is a macro guard that actually does >>something. > >I don't like it for the above reasons. > >I'm not wild about using something called NONAMELESSUNION to control >whether a nameless *structure* is defined but I guess it's ok. > >cgf > >>I've also picked up another nameless union that wasn't protected. >> >>Now, if we are really serious about pedantic warnings,we need to >>protect against all the non-ANSI bit-fields in w32api structs. >> >>Danny >> >>ChangeLog >> >>2001-09-10 Danny Smith <dannysmith@users.sourceforge.net> >> * include/winnt.h (_[U]LARGE_INTEGER): Protect nameless struct with >> !defined(NONAMELESSUNION), rather than defined(_ANONYMOUS_STRUCT). >> (_REPARSE_DATA_BUFFER): Name union field DUMMYUNIONNAME. >> >>--- winnt.h.orig Mon Sep 10 15:55:31 2001 >>+++ winnt.h Mon Sep 10 16:06:55 2001 >>@@ -1705,7 +1705,7 @@ typedef union _LARGE_INTEGER { >> DWORD LowPart; >> LONG HighPart; >> } u; >>-#if defined(_ANONYMOUS_STRUCT) || defined(__cplusplus) >>+#if ! defined(NONAMELESSUNION) || defined(__cplusplus) >> struct { >> DWORD LowPart; >> LONG HighPart; >>@@ -1718,7 +1718,7 @@ typedef union _ULARGE_INTEGER { >> DWORD LowPart; >> DWORD HighPart; >> } u; >>-#if defined(_ANONYMOUS_STRUCT) || defined(__cplusplus) >>+#if ! defined(NONAMELESSUNION) || defined(__cplusplus) >> struct { >> DWORD LowPart; >> DWORD HighPart; >>@@ -2502,7 +2502,7 @@ typedef struct _REPARSE_DATA_BUFFER { >> struct { >> BYTE DataBuffer[1]; >> } GenericReparseBuffer; >>- }; >>+ } DUMMYUNIONNAME; >> } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; >> typedef struct _REPARSE_GUID_DATA_BUFFER { >> DWORD ReparseTag; >> >>_____________________________________________________________________________ >> - Yahoo! Messenger >>- Voice chat, mail alerts, stock quotes and favourite news and lots more! > >-- >cgf@cygnus.com Red Hat, Inc. > -- cgf@cygnus.com Red Hat, Inc.
https://cygwin.com/pipermail/cygwin-patches/2001q3/001119.html
CC-MAIN-2022-40
refinedweb
559
68.97
I just made a code wallpaper in GIMP ! Although i am not an expert in GIMP i am trying to write up how i made it. This is a guide on how to make a geeky code wallpaper showing a screenful of code with your name highlighted. The screenfull of text in this guide is the ASCII characters of a statically linked ELF binary file, who’s bottom section has a screenfull of text. You could modify with your favorite code or even other texts, like your name peeking out of a randomly generated screenfull of string. Continue reading, and check out the guide. The Guide - Write a c program and save it with pic.c #include <stdio.h> int main(void) { printf("Hello\n"); return 0; } compile it with: gcc pic.c -o pic -static compiling with static tag will pack all the symbols into the executable. - Now execute the below, which will dump the executable by replacing the non printable characters into another file ‘picedit’ . cat -v pic > picedit Open the picedit file with vim (execute vim picedit) or with kwrite (or any text editor). Make sure the text editor should have word wrap on and also the window size of the text editor should be full screen. Scroll to the bottom of the screen by pressing Shift + G in vim and by pressing Ctrl + END in kwrite. At this point there should be a screen fully packed with text, if not then scroll a couple of lines to make the window full of characters. Now switch to insert mode in the text editor by pressing INSERT. Now write your name or any particular text any where in the screen full of text. Save the file and close the window. Tip: Type your name such that they are surrounded by non-alphabet punctuations and special character, it will be easier to read Insert Text Now again go to the open terminal make it full screen by pressing Ctrl + Shift + F11 (or other), and dump the saved ‘picedit’ file with cat. cat picedit - Now you can see the last portion of the edited file where you made the changes. Make the konsole to fullscreen by pressing Ctrl + Shift + F11 , and also remove the menu bars (by unchecking the show menu bar checkbox in konsole), scroll a couple of lines up if needed. and press PRTSCR button that is the print screen button on the keyboard, and save the screenshot with the name ‘mywall’. Keep note that you get the maximum screen area full of text. - Open ‘mywall’ with gimp, and do the following:Crop the image so that only the console text are visible and the window menubars, scroll bars are eliminated. Crop picture and keep only needed area - Convert the background color of the console in the picture to alpha: Colors -> Colorify To Alpha Select ‘From’ and then background colour of the console with the colour picker tool, and click OK. (Background color of my console was #3f3f3f) Colorify To Alpha and separate background and text The text layer after applying colorify to alpha - Now create a new layer and flood fill it with the same background colour of the terminal, and send the layer to bottom. You can see the same picture but now the background and foreground text are separated. Separated text and background layers - Select the text layer. Find out the texts you edited and want to highlight and select them using the Rectangle Select Tool. Make sure the selection be precise and no other text is inside the selection. After selecting the text you want to highlight do: Colors -> Colorify and simply select your favourite highlight colour. Select the text to highlight and colorify selection After colorifying the selection - Now merge down the two layers. To do this, go to layer window, right click on the separated text layer and click on “Merge Down” . Layers -> Merge Down - Because we cropped the image, so the image will not have the proper resolution, and you would need to stretch to fit it in the screen. To solve this resize the picture with gimp to 1280×1024 (which is my monitor resolution). Image -> Scale Image - Optionally Sharpen the image a bit so the text looks crisp and clear. (with value 10 or some ) Filter -> Enhance -> Sharpen {Sharpness=10} - This is an optional step, if you like the softglow effect then you can apply it. You can apply some softglow to the merged layer with the values which would get a good look. Filters -> Artistic -> Softglow {Glow Radius=13.00, Brightness=1.0, Sharpness=1.0} - Save the image in gif or png format. (Saving in jpg format would need a 100% quallity to show the picture properly, and the size would also be bigger than gif) Final Look 6 thoughts on “Geeky Code Wallpaper with GIMP” its good…and quite impressive nice!:D i think i must look closer to GIMP! :) i need install other program? gcc pic.c -o pic -static pic.c:1:10: error: #include expects “FILENAME” or pic.c: In function ‘main’: pic.c:4:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default] pic.c:4:11: error: ‘quot’ undeclared (first use in this function) pic.c:4:11: note: each undeclared identifier is reported only once for each function it appears in pic.c:4:15: error: expected ‘)’ before ‘;’ token pic.c:4:15: error: stray ‘\’ in program not create pic sorry my bad english Actually you need to compile the code above. If you have never compiled a code then it is a problem. You can actually open any binary program, ie executable program and follow the steps. The code i posted has somehow changed and the #include line has become incorrect as the stdio.h is not included. The first line should be #include <stdio.h> . I have fixed post. Now try to compile as told in the code. Save the file with some name, and pass the name to the given command (ie. compile the code), and follow the steps. I suggest instead of copying directly from the webpage, you see and type, as some html codes have appeared in the webpage (like the quot for the double quotes). Although i have fixed the problem in the page, it can change (as this problem occurrs in other pages too). that’s amazing… hitaz@live.com
https://phoxis.org/2009/08/11/gimp_geek_code_wallpaper/
CC-MAIN-2019-18
refinedweb
1,071
71.85
Upgrading documents from previous versions If you have documents created in QuickTest, Service Test, or previous versions of UFT One, you can upgrade them for UFT One. Upgrading QuickTest tests or components Files last saved in QuickTest 9.5 UFT One will open the asset in read-only mode. Files last saved in QuickTest earlier than 9.5 An error message is displayed in the UFT One Error Pane. If the asset is saved in the file system, you must first open it in QuickTest 10.00 or 11.00 to upgrade it. If the asset is saved in Quality Center or ALM, you must use the QuickTest Asset Upgrade Tool for ALM (available with the QuickTest Professional 10.00 or 11.00 DVD). Files saved in QuickTest 10.00 or later Assets last saved in QuickTest 10.00 or later can be opened in UFT One. QuickTest components Sharing values between components in a BPT test cannot be done using user-defined environment variables. Instead, use user-defined run-time settings that you create using the Setting.Add method. If your QuickTest components used any user-defined environment variables, you must change them to use run-time settings when you upgrade to UFT One. QuickTest 11.00 and Chrome If you previously had QuickTest 11.00 installed on your computer and you installed one of the patches or hotfixes that added support for working with the Google Chrome browser (QPTWEB00088 or another Chrome-related patch or hotfix), you must delete your user profile in the Chrome browser before you can use UFT One to test applications in Chrome. To do this, open the Chrome Settings window in your Chrome browser. In the Users section, click the Delete this user button. RunScript methods If you previously used the Frame.RunScript, Frame.RunScriptFromFile, Page.RunScript, or Page.RunScriptFromFile methods in your tests of a Web site or Web application, you should update the RunScript argument to use either an eval function or an anonymous function. For example, if you used this syntax previously: Browser("MySearchEngine").Page("MySearchEngine").Frame("Web Search").RunScript "var remove = document.getElementById('logo'); remove.parentNode.removeChild(remove)" you should update this to: Browser("MySearchEngine").Page("MySearchEngine").Frame("Web Search").RunScript "eval(var remove = document.getElementById('logo'); remove.parentNode.removeChild(remove););" OR Browser("MySearchEngine").Page("MySearchEngine").Frame("Web Search").RunScript "(function(){var remove = document.getElementById('logo'); remove.parentNode.removeChild(remove);})();" For Service Test tests or components UFT One 2021-2022 provides a Batch Upgrader command line tool, STBatchUpgrader.exe, located in the <UFT One installation folder>/bin folder. This tool lets you run a batch file to upgrade tests last saved in Service Test, version 11.10 or 11.20, making them compatible for UFT One2021-2022. If you do not upgrade your tests with the Batch Upgrader tool, when you open a test created in version 11.10 or 11.20, it prompts you to upgrade the test. For tests and components created in Service Test 11.00, you must first open and save them in Service Test 11.10, before you can upgrade them to UFT One2021-2022. Upgrade a test last saved in Service Test version 11.10 or 11.20 Make sure that UFT One is not running. If you ran the upgrader tool once while UFT One was running, the logs may become corrupted. Backup and delete all of the existing logs in the <UFT One installation folder>\bin\logs folder before proceeding. If desired, create a backup copy of the older tests. In the command line, enter the location of the STBatchUpgrader.exe file in the <UFT One installation folder>/bin sub-folder. Add the relevant command line options as described in Upgrading QuickTest tests or components. Use the following syntax: STBatchUpgrader.exe source [destination] [/ALM url domain project] [/login username password] [/log logfile] [/report reportfile] For example, the following string runs the upgrade on all tests in the ST_11_1 folder on the ALM server, pumpkin, for the TEST1 project in the AUTOMATION domain. It places the report in c:\logs\MyLogfile.log. STBatchUpgrader.exe Subject\ST11_1 /ALM AUTOMATION TEST1 /login user password /log c:\logs\MyLogfile.log. Run the command. Verify the validity of the tests in the destination folder. The following table describes the command line options: If the UFT One API test upgrade was unable to upgrade the test, you may need to modify the event handler code to make it compatible with the current version: Change the user code file to TestUserCode.cs. Change the namespace at the beginning of the file to Script. Change the class definition to public class TestUserCode : TestEntities For example: <![CDATA[ ]]>namespace Script { using System; using System.Xml; using System.Xml.Schema; using HP.ST.Ext.BasicActivities; using HP.ST.Fwk.RunTimeFWK; using HP.ST.Fwk.RunTimeFWK.ActivityFWK; using HP.ST.Fwk.RunTimeFWK.Utilities; using HP.ST.Fwk.RunTimeFWK.CompositeActivities; using System.Windows.Forms; using HP.ST.Ext.FTPActivities; [Serializable()] public class TestUserCode : TestEntities ... Known issues with Service Test tests
https://admhelp.microfocus.com/uft/en/2021-2022/UFT_Help/Content/User_Guide/Upgrade_Tests.htm
CC-MAIN-2022-40
refinedweb
836
60.82
Problem Statement The problem “Diagonal Traversal of Binary Tree” states that you are given a binary tree and now you need to find the diagonal view for the given tree. When we see a tree from the top-right direction. The nodes which are visible to us is the diagonal view of the binary tree. Example 2 7 3 4 5 6 Explanation The first diagonal has nodes 2, 7 in there. Then the second diagonal has 3, 4, similarly for the third diagonal 5, 6. Thus the output has printed in a way such that the elements from the same diagonal have in the same line. Approach The problem asks us to print the nodes which are visible to us from the top-right direction. So how do we solve the problem? We will do an inorder traversal of the binary tree. While doing this, we will keep track of the distance in a diagonal direction. Whenever we move in the left direction we add 1 to the diagonal distance and if we moved in the right direction we don’t add any value to the distance. So, while doing this we will keep track of the nodes visited in a map. We will create a map with diagonal distance as key and a vector as value. because we will add the nodes with diagonal distance in a vector. And as we would have traversed through the whole tree. After the traversal, we would have kept the nodes in the vectors as per their diagonal distance. After all of these calculations, simply print the elements in the map while separating the nodes from each of the vectors. C++ code to print Diagonal Traversal of Binary Tree #include <bits/stdc++.h> using namespace std; struct node{ int data; node *left, *right; }; node* create(int data){ node* tmp = new node(); tmp->data = data; tmp->left = tmp->right = NULL; return tmp; } void diagonalView(node* root, int dis, map<int, vector<int>> &m){ if(root){ m[dis].push_back(root->data); // move in the left direction with dis+1 distance diagonalView(root->left, dis+1, m); // move in the right direction with dis distance diagonalView(root->right, dis, m); } } int main(){ node *root = create(2); root->left = create(3); root->right = create(7); root->left->left = create(5); root->left->right = create(4); root->left->right->left = create(6); map<int, vector<int>> m; diagonalView(root, 0, m); for(auto x: m){ for(auto nodes: x.second) cout<<nodes<<" "; cout<<endl; } } 2 7 3 4 5 6 Java code to print Diagonal Traversal of Binary Tree import java.util.*; class node{ int data; node left, right; } class Main{ static node create(int data){ node tmp = new node(); tmp.data = data; tmp.left = tmp.right = null; return tmp; } static void diagonalView(node root, int dis, Map<Integer, Vector<Integer>> m){ if(root != null){ Vector<Integer> v = m.get(dis); if(v == null){ v = new Vector<Integer>(); v.add(root.data); } else v.add(root.data); m.put(dis, v); // move in the left direction with dis+1 distance diagonalView(root.left, dis+1, m); // move in the right direction with dis distance diagonalView(root.right, dis, m); } } public static void main(String[] args){ node root = create(2); root.left = create(3); root.right = create(7); root.left.left = create(5); root.left.right = create(4); root.left.right.left = create(6); Map<Integer, Vector<Integer>> m = new TreeMap<Integer, Vector<Integer>>(); diagonalView(root, 0, m); for(Map.Entry<Integer, Vector<Integer>> entry : m.entrySet()) System.out.println(entry.getValue()); } } [2, 7] [3, 4] [5, 6] Complexity Analysis Time Complexity O(NlogN), because we have traversed the tree and have updated the values. Because we have used a map, insertion, deletion, and searching is done in O(logN) time. Space Complexity O(N), because we are storing all the nodes in the map. The space complexity is linear.
https://www.tutorialcup.com/interview/tree/diagonal-traversal-of-binary-tree.htm
CC-MAIN-2021-49
refinedweb
652
57.67
US5202985A - Apparatus and method for displaying data communication network configuration after searching the network - Google PatentsApparatus and method for displaying data communication network configuration after searching the network Download PDF Info - Publication number - US5202985AUS5202985A US07801320 US80132091A US5202985A US 5202985 A US5202985 A US 5202985A US 07801320 US07801320 US 07801320 US 80132091 A US80132091 A US 80132091A US 5202985 A US5202985 A US 5202985A - Authority - US - Grant status - Grant - Patent type - - Prior art keywords - search - token - port - elements -24—Arrangements for maintenance or administration or management of packet switching networks involving integration or standardization using relational databases for representation of network management data, e.g. managing via structured query language [SQL] - copending application Ser. No. 07/181,538 filed Apr. 14, 1988 which is hereby incorporated by reference and now abandoned. network diagnostic and management systems for communications network and a method and apparatus for displaying the results of database queries. More particularly the present invention relates to a method and device for determining the interconnection topology of a possible dynamic data communication network and for conducting communication between a network controller and the devices being controlled. The invention uses an unique method of querying a database which permits a graphical representation of the query results. 2. Background of the Invention Relational database software is commercially available and suitable for various database functions where elements of the database are related to one another in some way. For example, such databases may be used to store information about a company's employees. Such information may include structural relationships concerning a person's position within a company's organization such as the person's department name or number, his supervisor, his subordinates, etc. Traditional relational database managers are able to readily produce, for example, a list of all of the people who report to a particular supervisor. Unfortunately, this method of displaying relational information is often not optimal for use by the database user. For example, although such information may provide a complete structural definition of a company's organizational structure, a graphical representation such as the typical organization chart is much more easily digested by the human user. In an environment more closely akin to the preferred embodiment, it becomes even more evident that the typical database output format is inferior. Consider, for example, a major airline's telecommunication system for data communication used for processing reservations. The network's topology may be stored in a relational database containing entries which are related to one another by their interconnection. However, present relational database management software provides no mechanism for displaying that interconnection in a manner which is easily understood. Such software typically is only able to provide a sorted listing selected entries of the database. Such a data communications network consists of nodes and links. The nodes are of different types and can offer different services. A node has a set of ports, and a set of time varying mappings are defined between these ports. Nodes are connected to form the network via links. Links connect the external ports of the nodes. The network derives its time varying character by virtue of the switching that takes place in the nodes. The network carries user data in logical pipes called channels. The channels are dynamic and the physical paths followed by the channel can change with time. The channel data flows change as a result of this switching. A multiplicity of channels may be carried by a link. Each node receives the data on its ports and forwards it on some other port(s) depending on the switching state of the node. Data from a multiplicity of ports may be sent on a single port and vice versa. For several reasons including network management it is required that network topology and channel flow changes can be represented, displayed, and effected in an efficient manner. In particular it is required from the network management perspective to effect configuration and switching changes, run diagnostic tests on the nodes and links and to receive unsolicited information regarding the spontaneous activity in the network. Several management entitles can simultaneously control the network. In such complex networks, it is also desirable to be able to display selected portions or views of the network in a graphical manner which is better digested by the user. U.S. Pat. No. 4,613,946 to Forman describes a method and apparatus for generating hierarchical displays. But, only the entire tree, or the entire portion of a tree beginning at a selected root node may be selected for display. Hitherto, in literature several search techniques have been proposed. Examples include Winston, P.H."Examples Involving Search", LISP, pp. 137-154, Addison-Wesley Publishing Co., 1984; Winston, P.H., "Exploring Alternatives", Artificial Intelligence, pp. 87-136, Addison-Wesley Publishing Co., 1984; and Aho A.V. et at., "Directed Graphs", Data Structures and Algorithms, pp. 198-229 Addison Wesley Publishing Co., 1982. However, these techniques use a model of the node where input on any port can go out on any other port. No attempt is made to model the internal characteristics of the node. Furthermore the time varying aspect of the internal switchings is not modelled. There are elegant algorithms for directed tree searches, but in absence of internal node modelling, flood routing such as described in U.S. Pat. No. 4,399,531 to Grande et al. seems to be the norm for searching in undirected graphs. Since different networks have different characteristics, an efficient and generic method is needed to handle all the various network types uniformly in order to: determine the configuration topology based on services and channels; determine routing between two nodes; search the management entity controlling the node (management entity can change dynamically); determine channels carried by the node; and A model for connectivity of these objects is needed and a search algorithm is also needed for obtaining routes and views of the connectivity of the network. The search algorithm should be capable of tracing logical connection pathways referred to here as channels in an efficient manner by pruning the undesired pathways. The present invention satisfies these needs by utilizing a mechanism for modelling the internal switchings of a node as well as routing mechanisms to perform efficient searches in face of time varying dynamic behavior of the network, which is a characteristic of most data communication networks. The present invention also provides a mechanism to display graphically a representation of a relational database and provides a mechanism for searching a complex computer network for a particular device within the network so that control over that device may be effected by a network controller. The search is conducted in an efficient manner which relies upon a network model which may simulate any element in a communication network. It is an object of the present invention to provide an improved system for performing network diagnostics and maintenance in a complex data communication network. It is an advantage of the present invention that a selective graphical representation of the contents of a relational database can be obtained. It is an advantage of the present invention that portions of a data communications network may be viewed in a graphical representation. It is another advantage of the present invention that by keeping track of aggregations which have been traversed in the search, the necessity of exploring all paths as in flooding can be avoided by exploring only deaggregations that have previously undergone aggregations. Another advantage is obtained by identifying the global search context and separating it allowing the search token to carry only needed unique information and referencing the global context merely by pointing to it. This reduces the size of the search tokens which are replicated as the search proceeds. It is a further advantage of the present invention to provide an efficient mechanism for determining a network's topology and for finding a particular device within a network. These and other objects and advantages of the invention will become apparent to those skilled in the art upon consideration of the following description of the invention. In one embodiment of the present invention, a method for providing a response to a query of a relational database, includes the steps of searching the database for entries which satisfy a search criterion; ascertaining a structural interrelationship between the entries which satisfy the search criterion; and generating a representation of the interrelationship between the entries which satisfy the search criterion, the representation being capable of conversion to a graphical representation of the structural interrelationship. An apparatus, according to one embodiment of the present invention, for displaying a selected portion of information from a database includes a searching mechanism for searching the database for entries which satisfy a search criterion. An ascertaining mechanism ascertains a structural interrelationship between the entries which satisfy the search criterion. A generating mechanism generates a graphical representation of the interrelationship between the entries which satisfy the search criterion. In another embodiment of the invention, a method of displaying a graphical representation of a selected portion of a network includes the steps of establishing a search criterion for selecting the portion of the network; conducting a search of the network for objects which meet the search criterion; storing selected information relating to the interconnection of objects within the network which meet the search criterion; and displaying a graphical representation of the interconnection of the objects. Another method according to the present invention of searching a computer network for nodes satisfying a predetermined search criterion includes the steps of generating a token including a search criterion; placing the token on a first port of a node; determining whether or not the node has characteristics which satisfy the search criterion; transforming the token to a second port in accordance with a stored internal switch mapping which describes how the node's ports are mapped to one another; moving the token to an externally connected node using a stored external connection mapping which describes how the node is interconnected with other nodes; and recording a list of the nodes traversed as by the above steps which satisfy the search criterion. In an embodiment of a routing manager for a diagnostics and control system for a communications network comprising interconnected nodes according to the present invention, the routing manager includes a relational database management system including a database containing information relating the nodes of the network to one another. Searching means are provided for conducting a search of the database for nodes satisfying a search criterion. A display displays an abstraction of a selected portion of the network based upon which of the nodes satisfy the search criterion. diagram of a small portion of a communications network using the present invention. FIG. 2 illustrates a device which may be controlled by two device controllers. FIG. 3 illustrates channel flow determination. FIG. 4A shows an example data communication network. FIG. 4B shows a first OSI abstraction of the network of FIG. 4A. FIG. 4C shows a second OSI abstraction of the network of FIG. 4A. FIG. 4D shows a third OSI abstraction of the network of FIG. 4A. FIG. 4E shows a fourth OSI abstraction of the network of FIG. 4A. FIG. 5A shows an aggregation device model. FIG. 5B shows a translation device model. FIG. 5C shows a mesh or star device model. FIG. 5D shows a deaggregation device model. FIG. 5E shows a termination device model. FIG. 5F shows an example of two aggregations and one translation used to build a more complex model. FIG. 6A shows a model of a multiport modem. FIG. 6B shows a model of a multiplexer. FIG. 6C shows a model of a matrix switch. FIG. 7 shows a generalized object representation of the network of a network. FIG. 8 shows the object data structure of the present invention. FIG. 9 shows the search token data structure of the present invention. FIG. 10A represents an initial token generation. FIG. 10B represents a first modification of the token. FIG. 10C represents a second modification of the token. FIG. 11 is a diagram of the routing manager interface to other processes of the present network controller. FIG. 12 is a flow chart describing the initial token generation in the present invention. FIG. 13 is a flow chart describing the initiation of a search in the present invention. FIG. 14 is a flow chart of the internal mapping list handler of the present invention. FIG. 15 is a flow chart of the recursive "EXPLORE" routine of the present invention which works on a single token. FIG. 16A is the first sheet of a flow chart of the internal switching process of the present invention. FIG. 16B is the second sheet of a flow chart of the internal switching process of the present invention. FIG. 16C is the third sheet of a flow chart of the internal switching process of the present invention. FIG. 17 is a flow chart of the external switching process of the present invention. FIG. 18 illustrates the memory hashing scheme of the preferred embodiment. FIG. 19A illustrates the search list representation of the network. FIG. 19B illustrates the graphical representation of the network corresponding to the search list representation. FIG. 20 is a flow chart for the process of converting the search list information into a graphical representation. FIG. 21A shows a first abstraction of the network of FIG. 4. FIG. 21B shows a second abstraction of the network of FIG. 4. FIG. 21C shows a third abstraction of the network of FIG. 4. FIG. 21D illustrates a fourth abstraction of the network of FIG. 4. FIG. 22 is a hardware block diagram of the host utilized for the present invention. For purposes of this document, the terms `nodes` and `devices` are used synonymously. The term `Relational Database Manager` or `Relational Database Management System` or `RDBMS` refer synonymously to a system which stores elements of information which contain relationships to other elements of information. Typically, such information is stored as a table but this is not to be limiting since other mechanisms may be utilized. Turning now to FIG. 1, an example communication network is shown from the perspective of the network management and diagnostic system. In this network, a network manager 10 is coupled to a communication processor 12 which is in turn coupled to a pair of device controllers 14 and 16. Device controller 14 is coupled to a modem 18 to communicate diagnostic data and modem 18 is communicating with a modem 20. Modem 20 is coupled to a DTE (Data Terminal Equipment) at one port and to other network components (not shown) at a second port). A Front End Processor (FEP) 24 is coupled to modem 18 for main channel data as well as several ports of a multiplexer (MUX, actually a multiplexer/demultiplexer) 26. The second device controller 16 is also coupled to one of the multiplexer ports of multiplexer 26. The aggregate output of multiplexer 26 is coupled to a second multiplexer 28. One of the ports of multiplexer 28 is coupled to a modem 30 which may be coupled to a second front end processor 32. Modem 30 communicates with a modem 34 which has one port connected to a DTE 36 and another port connected to other network components. Other ports of multiplexer 28 are coupled to DTE devices 40, 42, 44, 46, 48 and 50. Of course, this example network is intended only as an illustration of a portion of a typical communications network which may include hundreds or thousands of modems, multiplexers, etc. Such communication networks are assembled from of modems, multiplexers, concentrators, and switches. The network topology connecting these devices is based on user implementation and could vary considerably. The network management system controls these devices by means of diagnostic channels which are usually multiplexed in some manner with the user data. This can be accomplished by using a low speed FSK side channel which is frequency division multiplexed with the main channel data or by allocating slots for diagnostic data in a multiplexer's data frame or other similar techniques. The diagnostic channels originate from Device Controllers (DC). The devices carry user data in addition to diagnostic data. The user data channels originate from the Front End Processors (FEP's). A typical network as shown in FIG. 1 includes such components. The network topology is stored in a database according to the present invention and updated as necessary to reflect connectivity changes such as additions or reconfigurations of the network. Communication between the Network Manager (NM) and the device is a hierarchical process. The Network Manager 10 communicates with Device Controllers (DC) 14 and 16 which in turn control the devices. The NM `knows` the connectivity to the device (which devices are connected to which) from its database, but the identity of the DC is not known. This is because the assignment of the DC to a device changes dynamically based on the switching function of the device itself and intervening devices. So, it is required to determine this by querying the database. This query is conducted selectively, i.e., only with respect to the diagnostic channel. In a network such as that of FIG. 1, it is not unusual for one device to be controlled by several device controllers as illustrated in FIG. 2. In this figure, a modem 60 is controlled by either device controller 62 or 64 depending upon the position of matrix switch 66. Parallel activity may be permitted in network over the same channel, and therefore in order to allocate resources with the intent of avoiding collisions, topological orientation of the device with respect to other devices on the diagnostic channel is needed. This is accomplished by conducting searches on the diagnostic channel to find the upstream, downstream and codevices (devices that are on the same diagnostic tier). A port on a device can carry a multiplicity of channels by virtue of aggregations at the device itself, or aggregations in the preceding devices. It is desirable to find the individual channels that are carried by the port at a given time. In order to accomplish this goal, searches are conducted until the aggregations have been deaggregated and the channel termination points (such as TNPs, DTEs and FEPs) have been reached in the search. Turning now to FIG. 3, an example illustrating channel flow determination is shown in a portion of an example network including a front end processor 70 coupled to six ports of a multiplexer 72 with a device controller 74 connected to a seventh port of multiplexer 72. The aggregate channel from the multiplexer 72 is communicated by a modem 76 with a modem 78 to a multiplexer 80. For example, determine the channel flow on port 6 of mux 80, port 6 is traversed internally through the mux 80 to port 8 of the mux which in turn travels through the modems 78 and 76 to mux 72 port 8. Port 8 is then internally traversed to port 6 and then to port 6 of the FEP 70. This gives us the required solution for this example. In order to find a route between two devices a search is conducted from the given device on the specified port until the target device is found. In conducting the search, it is not necessary to resort to flood routing which can be combinatorially explosive and consumes a great deal of overhead. Rather, the present invention takes advantage of the port mapping information in the internal switchings of the node to limit the scope of the search. Sometimes it may be desired to find a particular type of device closest to a given device. The search is then conducted as usual but is terminated as soon as the given device type is found. For example in FIG. 3 one may want to determine the multiplexer closest to multiplexer 80. In this case the search will go through the modems 76 and 78 and find that it is multiplexer 72. Of course, the actual searches are performed on the network model stored in the network manager in the form of the memory map of the network and/or the database information stored on disk, but this is not to be limiting since the search could also be performed on the actual network if desired in other embodiments. The network topology is stored in the network manager's database. The changes in the network topology resulting from switching, and connection changes must be reflected in the database to perform the routing correctly. These changes are localized to the devices in which they occurred and do not produce ripple effects. This is achieved by storing only the local and minimal information with each device. Turning now to FIG. 4, an analogy of the network abstraction to the OSI model is shown. In this example, FIG. 4a shows that an FEP 84 is coupled to a multiplexer 86 which communicates via modems 88 and 90 with multiplexer 92 which is coupled to a plurality of DTE devices 94, 96, 98 and 99. This communication hierarchy is analogous to the layered communication model known as the OSI (Open System Interconnection) model as illustrated in FIG. 4b, 4c, 4d and 4e wherein communication between FEP 84 and a DTE are carried out through mux 86 and mux 92 with the lower level communication of data bits carried out by modems 88 and 90. As mentioned above, it is often desirable or necessary to obtain different views of the network based on the characteristics of the devices. The network can be abstracted at several different levels according to the present invention. This is analogous to the layered OSI model as shown in FIG. 4. On the highest level one can view the network to be a connection between FEP's and DTE's treating all the intervening devices transparent. On a lower level, muxes can be viewed but modems carrying the mux aggregate links may be deemed transparent. At the lowest level all the devices may be visible. Other abstractions are also possible. Any of the devices forming a network such as that forming the network of FIG. 1 may be modeled according to the present invention as one of the model devices of FIG. 5. The aggregation mapping object 100 of FIG. 5a is used to model a device in which a plurality of ports map to a single port or vice versa such as a multiplexer or demultiplexer (usually collectively referred to herein as a multiplexer). A translation object 102 as shown in FIG. 5b is used where a single port maps to another single port such as a single port modem, a digital service unit, an encrypter, etc. The mesh object 104 of FIG. 5c is used to represent devices wherein any port may be mapped to any other port such as a packet switching node. FIG. 5d represents a deaggregation object which is simply the opposite of an aggregation. FIG. 5e represents a termination object which represents an end point such as a DTE. Terminations are also referred to herein as a leaf. These objects may be used singly or in combination to represent any device in a communication network. Several instances of mappings may be used in layers or other combinations to represent more complex devices. For example, FIG. 5f shows a more complex internal mapping represented by a combination of the basic mappings involving two aggregations and one translation. Devices are represented in an abstract form as a "generalized object". The generalized object model is used here to build a network model. The object model generalizes the concept of a device to include all device types and operations. The generalized object model provides an uniform view of all devices regardless of their type and function. The generalized object is comprised of a set of ports further classified in two sets: external ports, and internal ports. The external ports are the means by which an object connects to other objects in the network. Internal ports are means to characterize the switching nature of the object. Internal switching mapping is the description of switching performed by the object. In other words it is the mapping of an object's set of external and internal ports onto itself. Several basic types of switching functions have been identified and shown in FIG. 5. An object may use one or all of these switching functions as well as many instances of them in mapping its ports. The aggregation type of switching mapping maps a multiplicity of an objects internal and/or external port to a single external or internal port. The deaggregation type performs the opposite function. (A broadcast function may also be defined as a deaggregation type function which does not have a corresponding aggregation.) The translation type of switching mapping, maps an individual external or internal port to an individual external or internal port. The mesh or star type of switching mapping models a type of connection wherein every port in the star connection maps to every other port in the same star connection set. Examples of these objects representing network components are shown in FIG. 6. FIG. 6a shows a multiport modem 110 with 4 DTE ports and a diagnostic controller port modeled as an aggregation object. FIG. 6b shows a multiplexer 112 having 4 DTE ports and a diagnostic port modeled as an aggregation object. FIG. 6c shows a matrix switch 114 modeled as a translation object. The generalized objects are connected to depict an abstract form of the network. These connections (links) are represented by external connection structures. External connection structure is the description of the connections of an object to other objects via the external ports. In other words it is the mapping of an object's external ports to the external ports of a multiplicity of other objects. Turning now to FIG. 7, a network is modeled as described above using the object representation. A front end processor 120 has four ports coupled to a multi-port modem 122 which also has a port coupled to device controller 124. All ports of the FEP 120 are internally terminated (leaf). Modem 122 is modeled as an aggregation as is its corresponding multi-port modem 126 with which it communicates. FEP 120 also has a plurality of ports coupled to a multiplexer 128 also modeled as an aggregation object which is also coupled to a device controller 130. The aggregated port of 128 is coupled to a modem 132 which is modeled as an aggregation object. Modem 132 is coupled to a modem 134 which is modeled as an aggregation object. Modem 134 is coupled to a multiplexer 136 which is modeled as an aggregation object. A port of multiplexer 136 is coupled to a modem 138 which is also coupled to FEP 140. Modem 138 is modeled as an aggregation object. Modem 138 communicates with modem 144 which is also modeled as an aggregation object. Mesh objects may be used to model objects when there is no knowledge of the internal mapping. FIG. 7 shows another example network represented in the form of generalized objects and external connection structures. All the problems identified above, need a search mechanism. This mechanism uses a single algorithm, which operates on different parameters to solve the different problems identified. A few definitions are listed below: Search--A search is defined to be the traversal of the objects in the network graph according to some criteria. The representation mechanism in the search algorithm is a search token. A search is thus a restricted flow of tokens in the network or network model. Search Token--A search token specifies the object, port, and the extent that is to be searched and it points to a search context (defined below). The token also carries with it the history of every aggregation until the time every aggregation is balanced by a corresponding deaggregation in the search path. The search token specifies the pathways and objects that are to be traversed. The search is completely specified by a list of search tokens. Search Context (Search Criterion)-- There is also some global context in which the search is to be undertaken. This context specifies which of the objects that are encountered in the process of searching are to be remembered, when the search is to be stopped, direction and view in which the search is undertaken. In general, this can relate to any of the attributes of the nodes or there connectivity and may be similar or identical to the types of criteria generally searchable in a relational database. Transcription-- The process by which a token notes which nodes have been visited which satisfy the search criterion. The search in the above framework can be thought of as a restricted flow of search tokens in the network graph. An object receives a search token on one of its external ports and operates upon it with the translation, aggregation, deaggregation and star operations possibly many times until the token(s) appear on its external port(s). It then forwards the resulting search token(s) to the multiplicity of the objects connected to this object by its external ports. As the search tokens flow through the graph, the token list is updated with the resulting tokens. As the tokens flow in the network graph the visited objects which meet the search context are remembered (transcripted) in another list called search list, if it is required by this token's search context. A token is removed from the token list if the object that it refers to does not present any connections or if the end condition for this token has been met. A search is said to be completed when either the token list has become empty in which case there is nothing more to be searched or the end condition for the search specified by the search context has been met in which case remaining tokens need not be pursued. The order in which search token are explored would identify the order of search: depth first, or breadth first etc. In the present embodiment, breadth first is used but this is not to be limiting. In the given example, devices are identified by addresses. For this solution, a relational database has been assumed, but other types of databases can also be used. Two relations are defined, one for external connections, and one for internal switching. External connection relation has the following form: [Device ID, Device Port, Connected Device ID, Connected Device Port]. Device ID: is the address of the device being defined. Device Port: refers to a particular external port # in this device. Connected Device ID (CID): refers to the address of the device connected to port defined by `Device Port`. Connected Device Port (CDP): is the port number of the CID, connected to the Device Port. Table 1 shows as an example the external connection table entries for device 122 of FIG. 7. The internal switching table has the following form: [device ID, Source Port ID, Sink Port ID, Mapping & Port Characteristics] Device ID: is the address of the device being defined. Source Port: Port # of the port being aggregated. Sink Port: Port # of the aggregate port. Mapping and Port Characteristics (MAPC): This identifies the type of mapping (translation, aggregation, and mesh) as well as the port characteristics (such as diagnostic, external, internal, etc.). It should be noted that the Source and Sink port definitions apply both to internal as well as external ports. Also, the concept of Sink and Source ports refer only to operations that perform aggregation and deaggregation. In translation and mesh operations the Source and Sink ports have no significance and are interchangeable. Table 2 shows for example the internal switching entries for device 122 of FIG. 7. TABLE 1______________________________________EXTERNAL CONNECTION ENTRIES FOR DEVICE 122DEVICE ID PORT CNCT CNC PORT______________________________________122 6 124 1122 1 120 1122 2 120 2122 3 120 3122 4 120 4122 5 126 5______________________________________ TABLE 2______________________________________INTERNAL SWITCHING ENTRIES FOR DEVICE 122DEVICE ID SRC-PORT SNK-PORTMAPPING TYPE______________________________________122 6 5 diag, agg122 1 5 main, agg122 2 5 main, agg122 3 5 main, agg122 4 5 main, agg______________________________________ Data Structures for object representation consists of two parts, viz., a fixed part and a variable part. The fixed part has information about the object such as its address, characteristics, and length information for the variable part. The variable part contains the external connections and internal switchings as well a as a list of diagnostic source ports. FIG. 8 shows the object data structure. It should be emphasized that the connectivity information that is stored for each device is localized. By tracing the connection from a device to its neighbors and repeating this process recursively on the neighbors, the network connectivity is obtained. The Search method, and the principle of search tokens has been defined to achieve the connectivity information. The data structures for the search token, and related data structures are shown FIG. 9. Object ID and port number locate a token definitively in the network. As the search continues and tokens flow, these two fields are updated. The level count is initially set to the number of levels to which search is to be undertaken. At each transcripted object traversed, it is decremented by one. To help keep track of the search process, an aggregation stack associated with each token is maintained in memory. This aggregate stack is a memory of aggregations that have been passed through so far without deaggregation. The search context (a global structure) abstracts the token independent search criteria (end condition, remember criterion, etc.) and global search information (direction, view, etc.). By way of example of the search process, to find the DC of device (modem) 138 of FIG. 7, the search process begins by locating the diagnostic source port by referring to the Mapping and Port Characteristics field in the Internal Switching Port table of device 138. An initial token is generated on this port. The token is as in FIG. 10a. Now the external connection table of device 138 is searched, and the device (and its external port) connected to the port referred to by the token is determined. Next the initial token is transformed with its device ID changed to the connected device id, and its port number is changed to the connected port number, and this operation can be thought of as passing the token from device 138 to device 136. The modified token is shown in FIG. 10b. Now, the internal mapping for device 136 are searched, and the sink port corresponding to the source port in the token is identified. This leads us to external port 6 of device 136. Furthermore, this operation is identified to be an aggregation operation, therefore port 7 is pushed on an aggregation stack associated with this token. The port field of the token is changed to port 6. This operation can be though of as passing the token from port 7 to port 6 of device 136. FIG. 10c depicts the token at this stage. Now, as before, the external connection is searched, and the token is passed to device 134. The token is passed internal in device 134 and then onto device 132 externally, and then to device 128. Here on examining the internal switching mapping, the deaggregation operation is identified, and the aggregation stack is popped and we emerge on port 7. The external mapping of port 7 in device 128 is found to be connected to a DC (DC 130). This DC 130 is the DC assigned to control device 138. The algorithm presented in its general pseudocode form looks like: ______________________________________procedure searchbeginwhile ((token list is not empty) or (searchterminating condition is not met))beginfor (each token)begintransform token on incoming ports by internalswitching mappings into tokens on the outgoingports;move outgoing tokens to the externally connectedobjects using external connection mapping;end forend whileend procedure______________________________________ The end condition for determining the DC of a device is finding the DC itself. It should be noted that the end condition is met on a token-by-token basis in most cases. That is if the search is being carried out for multiple tokens (or multiple offsprings of a single initial token), then each token will continue to flow until its end condition is met. For routing determination, the end condition is the device ID of the device to which the route is sought. Finally, the search for a unit type is accomplished by setting the end condition as the device type being sought. It is also possible to remember the path traversed based on a prespecified criteria. This criteria can be a specific channel type, object type, port type etc. As an example, while traversing the network, if the criteria is `muxes`, then the connectivity of the muxes will be obtained, and other devices will be treated transparently. This is the principle used for obtaining different abstractions of the network. The same process is used to find channels by specified a different criteria, viz., remember where DC or FEP are found for diagnostic and main data channel respectively, as an example. This process (the search and the representation of devices and channels) can be applied to ANY network, having ANY type of device, as long as they can be modeled by the basic operations defined, and having any channel characteristics. Turning now to FIG. 11, the routing manager's interface to the network management system is shown wherein the routing manager 200 accesses local memory 202 for a memory resident target network graph 202 if available. This graph 202 is somewhat like a cache in operation in that the database is available in disk resident connectivity tables of the relational database management system 204 if not available in graph 202. In fact, if memory is unavailable or speed is of little consequence, graph 202 may be viewed as optional for purposes of the search process. A transmit delay cache 206 is available via local memory access to provide the function of calculating route delay. The disk resident connectivity tables are accessed as a remote process. Other client processes such as network applications (transaction control processes, interprocessor communication management, processes, etc.), alarm management, etc. illustrated as client processes 208, 210, 212 and 214 are available also as remote processes. A remote process is defined as a process which is carried out by a remote processor. This can be carried out using any suitable interprocessor communication technique such as those provided by the operating system. For example, Unix.sup.™ System V message passing, shared mailbox or other interprocessor communication techniques used for multiprocess, multiuser operating system. In the preferred embodiment, the ORACLE® Relational Database Management System (RDBMS) by Oracle Corporation is utilized, but this is not to be limiting since numerous other RDBMS products are commercially available and may be suitable for use in the present invention. Turning now to FIG. 12, a flow chart of the token generation process routine of the present invention is shown starting at 250. If the token list is empty, that is there is nothing to search, at 260 the success status is set at 262 and the routine ends at 264. If the token list is not empty at 260, it is determined at 266 if the search direction is outside. If so, control passes to 268 where the token is moved to the connected object. Control then passes to 270. If the search direction is not outside at 266, step 268 is bypassed and control passes directly to 270. At 270 if the token list is empty or the search end is reached by virtue of a search context being met, control passes to 272 where the return status is set to success or a no data indication is produced after which the routine returns at 264. If the token list is not empty or the search end is not reached at 270, the tokens are moved internally to the other extreme at 274. Control is then passed to 278 where an error check is carried out and if an error in internal switching operation is detected, an error indication (flag) is set at 280 after which the routine returns at 264. If no errors are detected at 278, the tokens are moved externally to the connected object at 282. Another error check takes place at 284 after movement of the tokens at 282, and if an error in external connection operation is detected at 284, control passes to 286 where and error indication is set and the search is aborted at 286 followed by return of the routine at 264. If no errors are detected at 284, control passes to 288. At 288, if the abysmal depth is reached, an error indication is set and the search is aborted at 290 and the routine then returns at 264. If the abysmal depth is not reached at 288, control passes back to 270 An abysmal depth is defined for the system as some fixed maximum number of levels that a system is not likely to exceed. For example, a typical system is not likely to exceed 50 levels of depth. The abysmal depth is reached when this number is reached. Since networks may be inadvertently connected in a loop, this feature prevents the search from continuing forever. Turning now to FIG. 13, a flow chart describing the initiation of a search in the present invention is entered at 300 after which a token is allocated at 302. At 304 an error check determines whether or not an error occurred in allocating the token at 304. If an error occurred, control passes to 306 where the error status is set. The routine then returns at 308. If no error was detected at 304, the token list is initialized with the token at 312. Control then passes to 314 where information from the client token is copied into the token at 314. Control then passes to 316 where the search context is pointed to from the token. Control then passes to 318 where the process allocates a search list node and initializes the list. Then, at 320 the token is validated and control is passed to 322. The validation process of step 320 comprises checking the unit ID and port number to see if they are in an appropriate range, etc.. At 322 the results of the validity check are analyzed and if there is invalidity, control passes to 324 where the error status is set and the routine returns at 308. If the parameters are valid at 322, control passes to 328 where the search direction is checked to determine whether or not the counits are being asked for (counits being children of the same parent). If yes, at 330 the token is moved to the parent and from the parent and the direction is set to outside. Control then passes to 332. The search direction for any object is with reference to the object itself. If external switchings are explored first, then direction is outside. If internal switchings are explored first then the direction is inside. At 332, the port search is started and control passes to 334. At 334 any remaining active tokens are freed and control passes to 366 where the search list is returned. Turning now to FIG. 14, a flow chart of the internal mapping list handler of the present invention starts at 350. If the token list is empty at 352, the success status is set at 354 and the status is returned at 356. If the token list is not empty at 352, control passes to 360 where the next token is fetched for processing. Control then passes to 362 where the internal mapping of the object is explored to move the token to the other surfaces of the object at 362. Control then passes to 364 where the list returned by the EXPLORE routine is attached to the original list. Control then passes to 366 where it is determined whether or not there are more tokens to process. If so, control passes to 360 and if not, control passes to 354. This procedure explores the internal connection mappings of all currently active tokens. It calls the procedure explore that recursively descends into the object. This procedure transforms the incoming tokens on the search objects into the outgoing tokens. In pseudocode, this procedure may be represented as: ______________________________________INPUT: incoming tokensOUTPUT: outgoing tokensCALLS: exploreCALLED BY: port search (274 of FIG. 12)CONTROL FLOWprocedure internal mapping list handlerfor every currently active search token explore the internal mappings; attach the list returned by explore in the place where the curren token was;end forend proc______________________________________ Turning now to FIG. 15, which starts at 400 the process for the recursive "EXPLORE" routine is shown. Following step 400, control passes to 402 where the token is fetched for processing. Then, at 404, the token descends one level internally. At 406 an error check is carried out to determine if there was an error. If so, the routine returns at 408. If not, control passes to 410 where the return list is checked to see if it is empty. If it is empty, the process returns to 408. If not, a token is fetched from the list at 412 and control passes to 414. At 414 it is determined whether or not the token has reached the extremity of the object. If not, control passes back to 400 in a recursive call to this routine. If the extremity has been reached at 414 control passes to 416 where it is determined whether or not the end of the list has been reached. If not, control passes back to 412, if so, control passes to 408 where the routine returns. The EXPLORE procedure explores all the internal mappings of an object. It receives a search token on an external port and transforms it according to the internal switching mappings and generates a list of tokens on the outgoing ports. In pseudocode, the EXPLORE routine may be represented as follows: ______________________________________INPUT: token to be exploredOUTPUT: token list of outgoing tokens for the input tokenCALLS: descendCALLED BY: internal switching list handlerCONTROL FLOWprocedure EXPLOREdescend one level with the given token;parse through the list of resultant tokens;for every token that is still inside the objectcall explore recursively;attach the list in place of the token;end forreturn the list of tokens;end proc______________________________________ Turning now to FIG. 16, which is divided into FIGS. 16a, 16b and 16c, a flow chart of the internal switching process of the present invention is shown starting at 450. If the token list is empty at 452, the process returns at 456. If the token list is not empty, two possible paths may be taken depending upon whether the process is carried out in memory or using disc storage. If the process is carried out in memory the left most path is followed and at step 454 the object's internal switchings are fetched from memory. The process then moves to 456 where an error check is performed to determine if there was an error in the memory mechanism. If so, control passes to 460 where the object's internal switching are fetched from the database in disc storage. If no memory error occurs at 458, control passes to 462. If the memory is not available or not implemented, control passes from 452 to 460 where the object's internal switchings are fetched from the database. The control then passes to 464 where the database mechanism is tested for errors. If an error occurs, the error status is set at 466 to reflect the error and the routine returns at 456. If no error is detected at 464 control passes to 462. At this point the process proceeds in an identical manner regardless of whether the information was fetched from memory or disc storage. At 462 the object is tested to determine if it is of the aggregation type. If not, control passes to 468 where the device is tested to determine if it is the switching translation type. If not, then control passes to 470 where the device is tested to find out if it is a broadcast switching type (a deaggregation without a corresponding aggregation). If not, control passes to 472 where the object is tested to determine if it is the switching deaggregation type (the opposite of aggregation). If either the object is a deaggregation type or a broadcast type, control passes to 474 where the mapped port is pushed to the deaggretation stack. Control then passes from 474 to 476 where the current port is popped off the INternal SWItching (INSWI) stack. If no more ports are on the INSWI stack at 478 and the deaggregation pad is empty at 480, a success status flag is set at 482 and the process returns to 456. If more ports are on the INSWI stack at 478, control passes back to 462. The following pseudocode procedure searches through the internal switching mappings of the object and locates and returns all the port mappings that this port appears in (as in step 454): ______________________________________INPUT: object, portOUTPUT: port mappingsCALLS:CONTROL FLOW:procedurelocate object in the hash table or cache it if not founddo a linear search in the internal mappingsfor the given port;check for multiple mappings;return all the port mappings;end procedure______________________________________ At 462 if the switch is of the aggregation type, the token port is pushed onto the aggregation stack at 486. Control then passes to 488. If the object type is a translation at 468 control also passes to 488. If the token has not been transcripted at 488, and there is a need to transcript the token at 490, control passes to 492 where the token is transcripted. If there is no need to transcript the token at 490, control passes to 476. If at step 472 the object type is deaggregation, control passes to 500 where it is determined whether the object type is a star. If so, the port and other ports in the star are pushed on the star pad at 502. Control then passes to 476. If the switching type is not a star at 500, control passes to 504 where it is determined whether or not the object is a leaf object. If it is a leaf object at 504 it is determined at 506 whether or not it is already been transcripted. If it has at 506, control passes to 476. If it has not at 506, the object is transcripted at 508 if warranted and control then passes to 476. If at 480, the deaggregation pad is empty, control passes to 512 where it is determined whether or not the internal switching is of broadcast type (as in flooding). If so, control passes to 514 where it is transcripted if needed. Control then passes to 516 where one token is generated for each port on the deaggretation pad. Control then passes to 518 where each token is pointed to its parent. Control then passes to 456. If it is not a broadcast type at 512, it is determined at 522 whether or not a port on the deaggreation pad matches the aggregate stack. If not, control passes to 514. If so control passes to 524 where the token is transcripted if needed. Control then passes to 526 where the token is moved to the correct deaggregate port. Control then passes to 456. A pseudocode representation of a routine which descends one level in the internal mapping of the object and then starts from a given port and maps it to the internally connected port is: ______________________________________INPUT: token to be descended one levelOUTPUT: token list after descending one levelCALLS: inswi map (454 of FIG. 16)CALLED BY: EXPLORECONTROL FLOW:procedureget the internal switching mappings of the tokenfor each mappingdetermine the operation typeswitch on the operation typecase aggregation: push the aggregating port on the aggregation stack; replace theport in the token by aggregate port;case translation: replace the port in the token by translated port;case deaggregation: accumulate all the deaggregated ports on deaggregation stack;case star: get the star setZ push every port in the star set on star stack;case leaf: leaf object has been reached transcript and release the token;case non: the object does not exist release the token;end switchif aggregation stack has a port on it thenbegin try to match it with ports on the deaggregation stack;if a match is found thenbegin generate the resultant token; pop the aggregation stack of the token; empty the deaggregation stack;endendelsebegin this must be a broadcast type generte a token for each of the port on the deaggregation stack;endif there are ports on the star stackbegin generate a token for each of the star set member;endreturn token list;end proc______________________________________ A pseudocode routine for searching through the internal switching mappings of the object and locating the diagnostic source ports that the object has is: ______________________________________INPUT: objectOUTPUT: list of diagnostic source portsCALLS:CONTROL FLOW:procedure get the object by locating it in has structure or by caching it; parse through the internal mappings; locate the diagnostic source ports from the switching map; list of diagnostic source portsend procedure______________________________________ Turning now to FIG. 17, flow chart of the external switching process of the present invention is shown starting at 550. At 552 the token list is checked to see if it is empty. If it is empty, control passes to 554 and the routine returns. If not, control passes to 556 where the number of levels is compared to zero. If the number of levels equals zero, control goes to 558 where the token is released and control passes to 560. At step 560 it is determined whether or not there are any more tokens to process and if not control is passes to 562 where the success status is set. The process then returns at 554. If there are more tokens to process at 560 the control passes to 566 where the next token is fetched for processing. The process then moves back 556 if the number of levels is not equal to zero at 556 the process takes two paths depending upon whether or not memory is available or the memory resident target network graph is implemented. Control passes to 570 for the memory search where the object's external connections are fetched from memory. Control then passes to 572 where an error check mechanism determines if there was a memory error. If so, control passes to 574 where the object's external connections are retrieved from the database on disc. Control then passes to 576 where an error check mechanism determines whether or not there was a database error. If so, control passes to 578 where the error status is set followed by return of the routine at 554. If information is to be retrieved directly from disc without attempting to retrieve the connections from memory, control passes from 556 directly to 574. If no errors were detected either at 572 and 576, control passes to 582 where the process determines if the object has any connected objects. If not, control passes to 558. If so, control passes to 584 where one token is generated for each connected object after which control passes to 560. The procedure described by the flow chart of FIG. 17 explores the external connections of all the currently active tokens. It calls the external connection locator to identify the external connections. This routine may be represented by the following pseudocode: ______________________________________INPUT: outgoing tokensOUTPUT: incoming tokens at the connected objectsCALLS: routine to move tokens on objects external connections (282 of FIG. 12)CALLED BY: port searchCONTROL FLOWprocedure external connection list handlerfor every currently active search tokenget the external connecitons;for each external connection generate a token at the connected object;end forattach the token list wherethe original token was;end forend procedure______________________________________ The following pseudocode procedure searches through the external connections of the given object's given port and returns all the connected objects. ______________________________________INPUT: object, external portOUTPUT: external connectionsCALLS:CONTROL FLOW:procedure get external connections of a single object(FIG. 17, 570)get the object by locating it in the hash structure or by caching it;linear search for the given port;locate all the external mappings;return all of them;end procedure______________________________________ In the preferred embodiment, a scheme for building, maintaining, and using the memory resident model is used. This memory management scheme uses a memory resident structure built on a demand basis as opposed to building it a priori. A search superstructure provides for efficient location of objects in the network using internal unit ID as the key. Mechanisms to use the memory resident information as opposed to database table based information are designed to cause minimal changes to the routing manager structure. The object network at a node may consist of several thousand objects and locating an object may take considerable time if the search procedure is not structured properly. A search superstructure must be maintained in the memory to efficiently locate the object. A balanced binary tree Knuth, Donald, Sorting and Searching, Vol. 3., Addison Wesley 1973, provides for object location in log(n) time in a tree with n nodes. Furthermore, the balanced binary tree entails an overhead of two pointers. The preferred embodiment uses hashing for efficient object location. The hash table used is illustrated in FIG. 18. Hashing, as compared to the binary tree, provides much faster object location. It avoids the expensive balancing operation that is needed for the balanced binary tree when objects are added and deleted. Also the hashing implementation would need only one pointer instead of two required by the binary tree implementation, thus resulting in a memory saving. The hash table is allocated at the initialization time. The size of the hash table is commensurate with the number of units in the database tables. Some room for expansion is also provided to accommodate unit additions. A certain minimum size hash table will be allocated in case the database does not have enough units. This minimum hash table size is obtained from a mechanism that will be defined in the future as a part of the system tunable parameters. This parameter would depend upon the number of units that the system configuration is expected to support. Open hashing is used because it does not impose a limit on the maximum number of objects that can be accommodated. The hash function employed here is the classical modulo. The modulo function maps the infinite ring of integers Z into a finite ring called the quotient ring Z(q), where q is the divisor used in the modulo function. The quotient ring is the set of integers {0,1,2, . . . ,q-1}. Two elements of Z, a and b that map into the same element of Z(q) are called congruent modulo q, and then there exists some integer m such that a=b+mq. If q is chosen to be a prime integer then the quotient ring becomes an even more powerful algebraic structure called Galois Field GF(q). function. It is expected that this would generate fairly random allocation of objects into the hash buckets given the fact that the internal ID generation scheme generates consecutive integers as internal IDs. FIG. 18 shows a graphical representation of this hashing scheme. The hash function is used to generate a hash key from the object's internal ID and the object's record is then searched in the linked list of buckets. If the object is not found then a memory fault is recognized and procedures to bring the object into the memory from the database are initiated. These procedures link the newly retrieved object at the end of the hash chain. The memory resident object structure consists of two parts: a fixed part containing common information about the object and the search superstructure, and a variable length part that contains the connectivity information. The variable part can be either concatenated to the fixed part or can be pointed to by from the fixed part. The approach using the concatenated variable structure will save one pointer and is therefore preferred. The following is the object data structures as defined in the `C` language. ______________________________________struct objectINT32 object.sub.-- id; /* internal unit ID */struct object hashlink; /* pointer to next object */INT16 num.sub.-- excons; /* count of external connections */INT16 num.sub.-- inswis; /* count of internal switchings */INT8 num.sub.-- access; /* count of diagnostic accesses */INT8 time.sub.-- to.sub.-- live; /* amount of time left to live */INT16TYP object.sub.-- type; /* object type */INT16 ckt.sub.-- type;} OBJECT;______________________________________ Concatenated to above object structure will be the variable part. The variable part is of the following structure: ______________________________________/* diagnostic access points */INT16 port1; /* diagnostic access port number 1 */INT 8 phunid1; /* physical unit ID associated with it */. . .. . .. . .INT16 portn;INT8 phunidn;/* extenal connections */INT16 port1; /* object's first port number */INT16 cnct.sub.-- prt1; /* connected objects port number */INT32 cnct.sub.-- id1; /* connected object id */. . .. . .. . .INT16 portm;INT16 cnct.sub.-- prtm;INT16 cnct.sub.-- idm;/* internal switching description */. . .. . .. . .INT16 source.sub.-- port;INT16 sink.sub.-- port;INT16 port.sub.-- characteristics.sub.-- and.sub.-- switch.sub.--mapping;Where INTn stands for an n bit integer.______________________________________ The target network model is built on a demand basis. The parts of the network that are needed are brought in the memory as the searches proceed and force objects to be cached into the memory. This scheme is simple but has a slow response to the first query that brings in the objects into the memory. This would provide for a good response time for applications which are expected to work largely on active channels which would reside in cache. The existing lower level routines interact with the database to obtain the connectivity information. These routines would now be replaced by corresponding routines to obtain the information from the memory. The memory representation of the network object uses self defining data structures to avoid the waste that would be otherwise incurred if indirection pointers were used. The structure consists of a fixed part and a variable part. The fixed part contains the information for interpreting the variable part. The interpretation information is provided in terms of number of the connection structures and number of diagnostic access points. The mechanisms to walk through the connection structure to quickly locate the desired information are needed. These mechanisms would use the interpretation information to compute the appropriate offsets to close in on the needed information. In the database implementation, this function was performed by the database management system. The mechanisms to locate a particular data item at an external connection location is as follows: External connections are positioned first in the variable part. Each port record in this part contains the port number, connected port number, and the connected unit id. The port for which the connectivity is sought is located by means of a linear search in the connection list. Those skilled in the art will recognize that other types of search such as binary searches may be used also. The internal switching operations follow immediately after the external connections and therefore the offset to skip over the external connections must be computed from the num-- excons field in the object's fixed part. Within the description of the switching mappings the port desired must be searched linearly. The search token transformation process can keep a pointer to the internal switching mappings of the object and access all the internal switching mappings using it. The interface mechanisms use the above two mechanisms for providing the needed information to the search routines that successively transform input tokens into output tokens at an object using internal and external connection operations. If the memory resident target network graph is not implemented, database calls may be made for this purpose. A Least Recently Used Algorithm (LRU) type algorithm is used for memory management. A count of time to live is kept in the memory image of the object. The memory management task sweeps through the objects in the memory resident graph with a frequency specified in the system parameters, and decrements the time to live of all memory resident objects by one. The memory sweep task must run at low priority and is therefore put to sleep if there are more important client requests pending. The frequency at which the check is made for client requests is again specified by system parameters. The size of memory resident target network graph is limited by the system parameter Mem-- high-- water. Once the memory high water mark is reached, cleanup is undertaken until the size of the object graph is reduced to a low water mark (Mem-- low-- water). The memory cleanup involves successively removing objects whose time to live has reached zero, followed by those with time to live equal to one, and so on, until the low water mark is reached. A fault recoverable memory allocation is provided for the dynamic structures used by the search algorithms. If the dynamic memory allocation system call fails due to lack of memory, then an object of sufficient size is searched and sacrificed to make the space available for more critical needs of the search algorithms. The object information for the sacrificed object can be obtained from the database by the database mechanism. It is possible for the two mechanisms to co-exist with some of the functionality being provided by the database mechanisms and some by the memory mechanisms. Options may be provided for choosing the memory mechanism at compile time as well as boot time. The memory mechanism can be turned off at boot time by disabling a system parameter according to the preferred embodiment. The following is a routine to destroy a given object and delete it from the hash table and associated list so as to deallocate and free the space that was allocated for this object. ______________________________________INPUT: internal unit ID of the objectOUTPUT:CALLS:CONTROL FLOW:procedurefree up the object;destroy in hash structure with internal unit id;end proc______________________________________ The following pseudocode routine performs a hashing search using standard library routines. Then the routine performs a linear lookup in the open linked list associated with this hash bucket. It then imposes a sorted order on the link chain and performs a binary search on it. ______________________________________INPUT: internal unit id of the objectOUTPUT: pointer to the located objectCALLS: searchCONTROL FLOW:proceduregenerate hash key;use the key to locate the hash bucket;search in the linked list of objects in the bucket;if object is found then return objectelse cache the object; return object pointer;end proc______________________________________ In order to cache a given object from the database, get all internal mappings from the internal switching relation and all of the external connections from the external connection tables; allocate the required amount of memory space using dynamic memory allocation. Move the database information into the allocated space forming the structure with sizes of the variable external and internal connections specified in the data structure definition parts of the fixed header part. In pseudocode, this may be represented as: ______________________________________INPUT: objectOUTPUT: pointer to the cached objectCALLS: create, insertCONTROL FLOW:procedureget counts of external and internal connectionsas well as all the connection lists for the objectfrom database.compute the size needed to store the objectallocate the space required for the objectfill in the allocated object with information from the databasemake entry in the has table and insert this object in the hashlinked list.end procedure______________________________________ The following pseudocode routine dynamically allocates space needed to store an object in memory. ______________________________________INPUT: size of the objectOUTPUT: pointer to allocated spaceCALLS:CONTROL FLOW:procedureallocate dynamically the desired space;return a pointer to it;end procedure______________________________________ The mod function has been used to generate the hash key since it provides an almost normal distribution of objects which have consecutive integers as internal IDs. Hash table size will be a fraction more than the number of objects in the system. This will ensure that hash link chain will on the average have only one member. If the internal ID generation algorithm changes then the hash function must be modified to ensure a normal distribution of objects in the hash buckets. Any modification to the object will cause the deletion of the object from the memory resident graph. There is no provision for changing the object representation in the memory. If the modifications are frequent then mechanisms to repair the memory resident object must be developed to provide a better performance. The memory mechanism is utilized to overcome unacceptably slow performance of the database mechanism. This, however, has a higher first time delay because the memory resident structures must be constructed in addition to retrieving information from the database. This first time delay will be mostly seen by the alarm state reconstruction process, providing a fast response to the applications which will find the needed information already cached in memory. This scheme is considerably simpler and does not have complicated initialization mechanisms needed by the alternate approach. A hashing scheme is used for locating objects and binary search is used for locating the needed information within the object. The routing manager structure provides for a phased change over to the memory implementation during development and a conditional compilation at the manufacturing time to build the routing with either the database or the memory mechanism depending on the customer requirements. Turning now to FIG. 19, structure of a search list and its relationship with the search results is shown. The search results are represented generally as network 600. This example network includes a root object 602 representing the object where the search started. The root object 602 has three `children` C1, C2 and C3 designated 604,606 and 608 respectively. Child 604 has two children C1.1 and C1.2 designated 610 and 612 respectively. Child C1.1 has one child C1.1.1 designated 614 while child C1.2 has no children. Child 606 has one child C2.1 labeled 616 who in turn has one child C2.1.1 labeled 618. Child C3 has one child C3.1 designated 620. When the network is searched, as represented by 622, the results of the search are stored in the form of a search list generated at 624. Each record of the search list may be represent as a group of attributes (such as type of object, ID number, etc.) plus the number of children associated with that object). The illustrated configuration represents a breadth first traversal, but those skilled in the art will recognize that a depth first oriented list may also be possible. Record 632 represents the root object 602 with its three children (604, 606, and 608) noted. The next three records represent the three children with record 634 describing object 604, record 636 describing object 606 and record 638 describing object 608. Records 640 and 642 represent objects 610 and 612 respectively. Record 644 represents object 616 and Record 646 represents object 620. Record 648 represents object 614 and Record 650 represents object 618. The records may allow space for in place addition of information to facilitate graphical representation or a separate set of information may be created. Once the search list has been generated, each object may be provided with a label at 652 according to it's position in the network resulting from the search. This labeling system may, for example, be similar to the "C" labels of 600. In this system, each child's label is its parent's label with another number appended to it, thus tracing the child back to the root. Thus, child C2.1.1 can be traced back to C2.1 to C2 to the root. This scheme has advantages in that it provides information not only about the path back to the root, but also provides an order for the graphical representation (C1 is left of C2, etc.). With this information available, the search list may be turned into a graphics representation by a graphics generator at 654. Turning now to FIG. 20, the process for generating the graphical representation is described starting at 656. At 660 the search list is checked and if it is empty, a search list empty message is printed at 662 and the process ends at 664. If the search list is not empty the number of children of the root (first) record is fetched and placed in a queue at 666. The root record is then labeled as described above and the label is added in place (or in a separate list) to the search list at 668. At 670, a label counter is initialized and the process advances to the next node (next record) at 672 and its number of children is placed in queue. The level counter (which maintains the level with respect to the current parent as opposed to an absolute level) is incremented at 674 and the count at the top of the queue is decremented at 676. The child is then labeled at 678 and control passes to 680. At 680 the count at the top of the queue is inspected. If it is not zero then there are more children at the same level and control passes back to 672. If it is zero, control passes to 682 where the queue is inspected. If the queue is not empty, the level counter is initialized at 684 and control passes back to 672 where the next child on the same level is processed. When the queue is empty at 682, control passes to 686 where the labels are translated into graphics coordinates. The labeling system allows the translation to readily determine the number of children at each level and assign coordinates to them in a manner which appropriately distributes them across the display. In some instances, the search list is too large to be viewed in one display. In these instances, known zooming and paging techniques may be used to isolate portions of the picture for clear display. These coordinates are used by step 688. In this step, icons representing each type of object or node as described by its attribute are drawn at the assigned coordinates. Different icons may be used to represent different types of objects such as modems, multiplexers, etc. Different colors may also be used to enhance the visual representation. At step 690, the icons are interconnected with lines (or arrows, etc. as appropriate) to represent the interrelationship of the objects. Those skilled in the art will appreciate that steps 688 and 690 may be performed in a looping manner if desired so that icons are first drawn followed by the interconnection lines for that icon followed by more icons, and so on. At step 664, the process ends. Turning now to FIG. 21, various network abstractions are presented for the network shown in FIG. 4a. FIG. 21a is analogous to the view of FIG. 4c wherein only the FED to DTE communication is shown. FIG. 21b is analogous to FIG. 4d wherein the multiplexers are included in the view. FIG. 4c includes all nodes between the FEP and the DTEs as in FIG. 4b. In FIG. 21d another abstraction of the network which includes only modems is shown. Those skilled in the art will appreciate that numerous other types of views are possible by suitably tayloring the search criterion. Once a search has produced a route through the system according to the search criterion, several possible uses can be made of the route. For example, the previously described process of drawing a graphical representation of the network from a perspective dictated by the search criterion. Unit to unit communication links may also be established using the path selected by the search. The route may also be utilized for resource allocation, that is, a path can be checked out to determine its suitability for a particular purpose prior to allocation of the resource. In this regard, the search could be used to determine, for example, if there is a loopback test in progress in the path under scrutiny. The search process may also be the result of a backward mapping of alarms produced on a diagnostic channel. Since some diagnostic systems use a limited number of diagnostic addresses for nodes, it may be required to find a device producing a MAYDAY by a search so that it can be positively identified by information stored in the database which the node is too primitive to disclose on its own. Another application of the search is to determine which of a number of nodes are associated with one another in some way (group objects). Other uses will occur to those skilled in the art. Turning now to FIG. 22, a hardware overview of host utilized in implementation of the present invention. Such hardware is commercially available from a number of manufacturers and may, in one embodiment be based upon a Digital Equipment Corp. Microvax™ 2000 or 3600 computer running the ULTREX™ operating system. In other embodiments, workstations such as those manufactured by IBM® or SUN® may potentially be utilized. The system includes a central processor (CPU) 700 with associated memory 702, storage such as disk drives 704, keyboard 706 for user entry 706, and display 708. A printer 710 or other device for producing a hard copy may also be used with the system. A communication processor 712 provides an interface between the host computer and the network via its connection to target network processors such as 714 and 716. The TNP's are interfaced to the other nodes of the network. The TNPs and CPs may also be modeled as nodes. The present invention thus provides a generic representation of a time varying network. A generic representation of the time varying nodes is also provided. The search algorithm is independent of the node type and network type, being equally applicable to solve various network-connectivity oriented problems. Dynamic changes to the network have a local effect, rather than a rippled effect. The unique data structure representation of any device is also presented. The model of the present invention can be used to represent a network of multiply connected communication devices referred to here as objects. A general representation called generalized object is capable of modeling modems, multiplexers, switches, concentrators, nodes etc. in an uniform manner. A model for connectivity of these objects together with the search algorithm allows the user to obtain routes and views of the connectivity of the network. The search algorithm is capable of tracing logical connection pathways referred to here as channels in an efficient manner by pruning the undesired pathways..
https://patents.google.com/patent/US5202985A/en
CC-MAIN-2018-39
refinedweb
13,161
52.09
Announcing Rails 6: An Imagined Keynote Just got back from RailsConf. It was a great Ruby & Rails conference, but I was struck by the dearth of talks about new features of Rails 5 — because there just aren’t many. I thought back to what excited me about Rails in the first place — the baked-in conventions, convenience, encouragement of good practices. Justin Searls gave a talk not about RSpec but about how Rails is losing mindshare, losing favor. Is Rails losing relevance? I hope not, but it’s easy to see how someone less emotionally invested than me might see it that way. I’m trying to write about this without complaining. This is my fifth attempt. It’s hard not to just rant about Rails’ failings, so I’m going to try to be constructive by outline a fantasy roadmap for Rails 6. I tried very much to think about this without going against the “Rails Doctrine”, and have written this as if it were an Apple-style keynote. The theme is Progress. Rails 6: Progress Good morning. I’d like to share with you all the exciting changes we have in store for Rails 6. Since Rails was first launched 11 years ago, a lot has changed in the world of web development. Billion-dollar business are being run on Rails. These business — along with countless others — have been able to use Rails to solve problems we never imagined. Rails not only enables small teams to ship great software, but it works for big teams, too. We’ve seen Rails move beyond its role as “the single application” to being a part of highly distributed systems. The productivity gains developers get in the small, and in the simple, they get in the large and complex, too. Meanwhile, there have been tremendous strides in what is possible in a web browser. Rails was born of a love of the web, and the web has gotten so much better over the years. The front-end has blossomed. We can now deliver amazing things to our users, and the community of web developers both inside and outside Rails has produced amazing tools and techniques for doing so. Finally, the community of Rails and Ruby developers have over a decade of experience using Rails. Adecade! We’ve learned so much about what it’s like to maintain Rails applications over long periods, and how to best use developers of all levels of experience in working on Rails applications. Rails 6 is the most revolutionary release of Rails ever, and we’ve rallied around seventh pillar of the Rails Doctrine: Progress. Let’s start with the front-end. Front-End 2.0 Sprockets was way ahead of its time. Using remote=true was, too. Rails was one of the first web frameworks to actually acknowledge the front-end and include powerful tools for managing your assets. The rest of the industry has not embraced these tools or techniques, but has instead solved the problems of front-end development in other ways. Although the tools used for front-end development are in constant flux, there are stable, mature techniques that have proven results. Rails 6 will bake in the best of these techniques, and create an updated, modern set of front-end tools. In Rails 6: - No more per-view CSS. Rails 6 encourages OOCSS and ships with Tachyons, allowing developers to style their views without any CSS from day 1. - No more per-view JavaScript. Rails 6 supports ES6 and ES6 module syntax to allow developers to structure their front-end code however they see fit. - Rails 6 no longer includes jQuery by default. Instead, Rails includes a library called rails.jsthat provides a simple and standard way to access Rails resources via AJAX without using jQuery. Rails.js can be used standalone, or in conjunction with existing front-end frameworks like React. - Source maps will be generated for any front-end compiled assets or code, if the source language supports it. - A new focus on simple plugability and transparent behavior. The one constant in front-end tooling is change, and a full-stack web application framework like Rails should give you the ability to keep up. What Rails 6 doesn’t ship with is a front-end framework. There’s value in server-generated views, and a light sprinkling of JavaScript can get you a long way. Next up, the controller layer. Doubling-down on Resource-based Design. Rails strongly believes in resource-based design. It’s been a part of Rails since Rails 2. Too often, however, developers deviate from this design when without a strong reason. We’ve realized this happens for two different reasons. First, it’s largely the same amount of work in your routes and controller to use RPC-style routing as it is to use resourceful routing. Second, it’s too difficult to create resources that work with Rails but that aren’t ActiveRecords. In Rails 6, developers who embrace resource-based design no longer need to specify routes explicitly. The “special 7” routes are configured automatically by declaring the needed methods in the controller. class UsersController < ApplicationController def index # automatically sets up GET /users end def create # automatically sets up POST /users # also sets up GET /users/new end opt_out :new # remove GET /users/new def destroy # configure DELETE /users/:I'd end def deactivate # does not introduce any route end end Developers unnecessarily using RPC-based designs now have more work to do than if they stick with a resource-based design. The old way of declaring routes still works, but we feel this method will be much simpler. We also want to make it easier to describe resources that work with the Rails View layer but that aren’t Active Records. We introduced helper modules in Rails 3, and an explicit Active Model in Rails 4, but we still see developers struggling to adopt these technologies. Instead, developers use presenters, decorators, and view models either hand-rolled or from one or more third-party gems. Rails 6 will build on ActiveModel by providing a base class called ActionResource. An ActionResource makes it easy to totally describe your resource, with support for: - delegating to an underlying object. - create derived fields. - formatting values. - interoperability with Rails form and URL helpers. Suppose we want to display a user’s name, signup date, email, and most recent order (a date and description). We’ll call this an account. We’ll implement it using ActionResource, which we can use in our controller like so: class AccountsController def show @account = Account.new(customer: current_user) end end We create Account like so: class Account < ActionResource from :customer, show: [ :email, :name, :created_at ] format :created_at, with: :short format :email, with :downcase def last_order_date time_ago_in_words(last_order.created_at) end def last_order_description last_order.items.count + " items" end private def last_order @last_order ||= customer.orders.last end end As with much of Rails, how this works should be obvious by the API we’ve designed. The resulting object can be used like any model object: customer = Customer.new(name: "Bob Jones", customer.orders << Order.new(created_at: 3.days.ago, items: Item.new) account = Account.new(customer: customer) account.email # bob@jones.net account.name # Bob Jones account.created_at # May 13 account.last_order_date # 3 days ago account.last_order_description # 1 items We hope this will allow Rails developers to effectively use resourceful design without needing third-party gems, and to do so with minimal, beautiful code. We’re also discouraging the use of helpers in Rails 6. Helpers are still a fully supported feature, but when scaffolding or creating new resources with the Rails generator, you will no longer be given an empty helper file. ActionResource can replace most need for helpers. Next, let’s talk about the code that makes your app special: the business logic. The Business of Logic Over the last ten years, it’s become clear that every Rails application needs to manage code that doesn’t belong to a controller, model, job, or mailer. While there are many opinions on exactly how much code should go where, there’s no debate that sometimes code has to go somewhere else, and Rails hasn’t had an opinion. Until now. Rails 6 supports services, as we felt this was a good enough nudge regarding where code could go, but without being overly prescriptive, or requiring developers to opt-in to a complex DSL. Make now mistake: this is a radical change in how Rails thinks about your application’s architecture. By default, app/services will be created when you run rails new and any code you place there will be auto-loaded the same as for your controllers or models. The code in your services can be anything. However, when writing good services, it’s often required to bring together lower-level libraries, third-party code, and other services to get the job done. Testing this code can be challenging. To help organize your services, we’re also introducing ActiveService, which is a lightweight library that makes writing and testing services as easy as it can be. Suppose you want a service for charging customers some money using your Customer and Ordermodels. To do this, we need to locate the customer’s credit card, charge it the amount of their order, and then email them a receipt (or a notification about failure). To do this, we need access to our payment processor’s Ruby library as well as our OrderMailer Rails mailer. While you could access these classes in the normal way of referencing their global symbols, we can use less code that’s easier to test by using Active Service. class Purchaser < ActiveService::Base needs :payment_transaction needs :credit_cards needs :order_mailer def purchase!(customer:, order:) card = credit_cards.find(customer.id) transaction = payment_transaction.new(card,order.amount) if transaction.success? order_mailer.receipt_email(customer,order).deliver_later else order_mailer.card_failed(customer,order,transaction).deliver_later end end end As you can see, ActiveService provides a way to manage all your services at runtime. This is especially useful for third-party libraries like our payment processor. Instead of configuring a global constant like BRAINTREE_TRANSACTION, we can let ActiveService handle it: # config/initializers/braintree.rb service :payment_transaction do Braintree::Transaction.new(api_key: ENV["BRAINTREE_API_KEY"]) end service :credit_cards do Braintree::PaymentCard.new(api_key: ENV["BRAINTREE_API_KEY"]) end This way, any other service that needs access to this can be sure to get the properly configured objects. The real benefit, however, is in our tests. Instead of mocking classes, or using code like allow_any_instance_of, Rails takes care of all that. Since Rails now knows what your services needs to do its job, it can intelligently mock the behavior of those objects and allow you to test your code in isolation. For example, to test our purchase! method, we need to arrange for payment_transaction to return a successful result, and check that the right mailer method was called. class PurchaserTest < ActiveService::Test::Base def test_purchase_succeeded successful_transaction = stub(success?: true) order = orders(:any) # we'll talk about these customer = customers(:any) # later on in the presentation purchaser.payment_transaction.on(:new). returns(successful_transaction) purchaser.purchase!(customer, order) purchaser.order_mailer.verify(:receipt_email).with(customer,order) end end No matter how much code you write as services, Rails 6 will make it easy to keep your code clean, simple, and tested. We’d like to talk about the fixture-like code above, but first we need to learn about how Rails 6 treats your database. Rails and Databases: It’s Complicated One thing we’ve come to understand over the years is that Rails is just a piece of your technical architecture. The days of one company having exactly one Rails app that controls one database are increasingly rare. What we’ve also seen is that in most cases, the data is more important than code. Many companies use Rails to create applications that, at their core, manage the data in a database. This is very much what Rails was originally designed to do! Rails 6 is now much more opinionated about how you should manage your data and interact with your database. Instead of a “common denominator” approach, Rails 6 is designed to get the most out of your data store — whichever brand it might be. To state this another way, we want good database design to be easy but bad design to be possible. In Rails 6, we’re making the following changes: - Columns are no longer nullable by default. - Numeric-based enums are deprecated. If your database supports enums, those are used, otherwise string-based enums are the default. - Foreign keys have constraints by default, if your database supports it. - Primary keys are UUIDs by default, if your database supports it. - There is a new DSL for check constraints, if supported by your database, that also create equivalent ActiveRecord validations in the related model. These new defaults and features will keep the migrations DSL just as easy to use as it’s ever been, but result in a consistent, resilient, well-designed database that works great with Active Record. Making this happen isn’t easy, and the biggest trickle-down affect it had is the way we manage test data. Test Data Test data comes in two flavors: reference data that is mostly immutable throughout an app’s lifetime (think: country codes), and transactional data, which is the data the app exists to manage (for example, orders). Reference data can be managed with fixtures, however transactional data will now be managed withfactories. It’s too difficult to manage one single set of test data that works for every test case. Instead, each use-case for your data will be described by a factory. You can create a global repository of factories — similar to what you might do with FactoryGirl — or you can create factories directly in your test cases. By default, however, objects created with factories won’t be written to the database. This will make your tests run much faster, because you typically just need to test logic — not Active Record. One problem with this approach, however, is that it’s possible to create use-case-based factories that could never happen in production. This is why Rails 6 includes a standard linting task that will write all your factories to the database, to ensure that your scenarios actually could exist in the real world. We also have a few more changes in how to write tests for Rails apps. Testing 2.0 In Rails 6, there will now be only three types of tests. Unit Tests do not use the database by default, and are where the majority of your tests should be written. The code tested here would be any of your business logic in your models or services. These are in test/unit/{models,mailers,jobs,services}. For testing scopes, or other code that runs database queries, Rails 6 supports active record tests. We expect these to be infrequent, but it’s difficult to test database queries without executing against real data. These live in test/active_records. Finally, Rails 6 integration test support will be based on end-to-end in-browser testing using PhantomJS. You’ll never have confidence in your web application until you’ve used it in a real web browser. We realize these types of tests can be slow, but we’ve rarely seen a Rails app that doesn’t need them. They will live in test/integrations. That’s It! We hope you’re as excited for Rails 6 as we are. This is going to be the best release of Rails yet. Afterword I know this is a fantasy. I also know that the amount of work outlined here is massive. But I strongly feel that features like the ones I’ve made up would address common things faced by all Rails developers. Heck, these are issues faced by any web application developer, and Ruby is one of the few languages where solutions can be easily provided out of the box. Maybe my particular solutions aren’t the best, and there are certainly many issues my hand-wavy features aren’t addressing that might make them really difficult to actually implement. But, wouldn’t it be amazing if Rails 6 shipped with features kinda like this? Wouldn’t it be awesome if Rails 6 acknowledged the community’s collected learnings over the last 10 years, and acknowledged that Rails is actually really awesome at things other than what a small team can accomplish? Wouldn’t be great if Rails acknowledged advances made outside the Rails community? I do wonder if this is even possible. Can Rails make such fundamental changes any longer? Even if we set aside the technical challenges — which are huge — could the culture of Rails (and its maintainers) allow these things to happen? Should they? Let’s say it did. Let’s say Rails 6 was the revolutionary release I’m pretending it is. Would that put Rails back in the spotlight? Would that make Rails the go-to web framework for web development? Would CTOs start thinking about Rails again? I don’t know. What I do know is that we all better prepare ourselves to write a lot more JavaScript if things don’t change.
https://medium.com/@davetron5000/announcing-rails-6-an-imagined-keynote-8430f8b55a1
CC-MAIN-2018-09
refinedweb
2,883
64.51
Created on 2016-07-11 20:18 by wolma, last changed 2017-07-13 02:50 by ncoghlan. This issue is now closed. As a result of Issue14285 Python 3.5.2 now imports packages in runpy. _get_module_details before calling importlib.util.find_spec. Although I'm not sure how important this is, I wanted to report that this new behaviour can have a side-effect under pretty exotic circumstances. When __init__.py imports the same module that is supposed to be invoked via the -m switch and that module replaces its own entry in sys.modules with another object, this causes importlib.util.find_spec to fail with a *very* cryptic: Error while finding spec for 'package.module' (ValueError: package.module.__spec__ is not set) without an exception traceback. I have no idea whether any other package would be affected by this, but it took me quite some time today to trace the cause of this and it is not what you'd expect from a maintenance release. I think the changed behaviour in runpy should at least be documented (beyond just mentioning the issue in the changelog). Since this worked in 3.5.1, and fails in 3.5.2, I think it's reasonable to consider if it makes sense to find a way to make it work again in 3.5.3 (and then decide separately whether or not we want to preserve the capability in 3.6.0). Specifically, restoring the old behaviour would mean that: 1. *If* the -m target module already exists in sys.modules after importing the parent module; and 2. The already imported target module doesn't have a __spec__ attribute; then 3. Ignore that already imported artifact when figuring out what to run as __main__ However, the problem with doing that is that this *is* an instance of code that falls into the double-import trap: Even in 3.5.1, the affected module is getting executed twice - once from the package's __init__.py, and once via the "-m" switch. For cases that *don't* overwrite the module in sys.modules, a solution that resolves the issue in a backwards and forwards compatible way is to split the module being executed via -m as follows: * Move the pieces needed by mypkg.__init__ into a "mypkg._mymain_support" module * In that module, set "__name__ = 'mypkg.mymain'" to preserve pickle compatibility and docs introspection * Change both "mypkg.__init__" and "mypkg.mymain" to import the shared components from the "mypkg._mymain_support" module However, you still run into a problem with figuring out when the replacement module should be written into sys.modules - if that stays in "mypkg.mymain" it will no longer get done as a side effect of importing "mypkg", while if it moves into "mypkg._mymain_support", you'll still run into the problem reported here in 3.5.2 In trying to understand this, I built a package with two simple files: $ cat package/*.py # package/__init__.py: from . import module # package/module.py: import sys sys.modules[__name__] = object() With this I can reproduce your __spec__ error, and I see it works without error in 3.5.0 and 2.7.11. FWIW, with the current 3.3 branch, I get a different error: /media/disk/home/proj/python/cpython/python: Error while finding loader for 'package.module' (<class 'AttributeError'>: 'object' object has no attribute '__loader__') The revision that causes the regression is 3202d143a194. Since I made that change, I feel responsible for it. But I don’t have much time ATM to come up with an ideal solution. One quick solution would be to revert my change, but since this is an obscure use case, I am not enthusiastic about doing that :) Is it possible to set the __spec__ attribute to work around the problem? I don’t really understand the “module spec” business, but “runpy” seems to rely on that attribute. Is replacing sys.modules entries like this even supported usage? Even in 3.5.0, I can still produce the error by importing the package before using runpy: $ python3.5 -c 'import runpy, package; runpy.run_module("package.module")' Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 104, in _get_module_details spec = importlib.util.find_spec(mod_name) File "/usr/lib/python3.5/importlib/util.py", line 99, in find_spec raise ValueError('{}.__spec__ is not set'.format(name)) from None ValueError: package.module.__spec__ is not set The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.5/runpy.py", line 178, in run_module mod_name, mod_spec, code = _get_module_details(mod_name) File "/usr/lib/python3.5/runpy.py", line 110, in _get_module_details raise ImportError(msg.format(mod_name, type(ex), ex)) from ex ImportError: Error while finding spec for 'package.module' (<class 'ValueError'>: package.module.__spec__ is not set) [Exit 1] Wolfgang: Do you want to propose a specific wording to add to the documentation? Maybe something like “runpy and the ‘python -m’ option require that after the module is imported, it should have a __spec__ attribute”. Where should this go? In the runpy, command line, and/or What’s New documentation? FWIW, 2.7.11 gives an even stranger error; perhaps this is a different bug: $ python2.7 -c 'import runpy, package.module; runpy.run_module("package.module")' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.7/runpy.py", line 170, in run_module mod_name, loader, code, fname = _get_module_details(mod_name) File "/usr/lib/python2.7/runpy.py", line 101, in _get_module_details loader = get_loader(mod_name) File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader return find_loader(fullname) File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader for importer in iter_importers(fullname): File "/usr/lib/python2.7/pkgutil.py", line 424, in iter_importers if fullname.startswith('.'): AttributeError: 'object' object has no attribute 'startswith' [Exit 1] Breaking down a few of the moving parts here: * Yes, modules replacing themselves in sys.modules as a side effect of import is supported behaviour (it's why the import system looks them up by name in sys.modules as the final step, rather than just returning whatever the loader returns) * the dependency on __spec__ attributes is actually in importlib, where following PEP 351 Brett has been pushing hard to ensure modules always have a __spec__ attribute so the rest of the import system (including, indirectly, runpy) can rely on having it available (however, as seen here, not everything in sys.modules is going to be a module, so we may need to either keep more of the workarounds that help tolerate folks breaking that assumption, or else find a way to try to enforce it even for custom objects) * explicitly copying __spec__ from the original module object to the replacement object (in Wolfgang's code) should indeed be enough to get the use case reported here restored to the way it behaved in 3.5.1 Oops, that PEP reference was meant to be PEP 451 (which added the __spec__ attribute and the concept of module specs as something distinct from the modules themselves) @Martin and regarding Python3.3: Right, you cannot do the replacement when running the module as __main__. For my use case that's not required though so in the module I can just do: if __name__ == '__main__': print('running module as a script') else: # do not attempt this when __name__ == '__main__' in Python 3.3 sys.modules[__name__] = object() Apart from this limitation, such code is compatible with Python 3.2 - 3.5.1, but breaks under 3.5.2. It's the fact that it breaks in a maintenance release that I find disturbing. In fact, I learnt about the breakage only from an end-user who bought a new laptop with OS X, downloaded the latest Python release and suddenly could not get our package to run that had worked on his previous machine. Turns out, none of our test machines was running 3.5.2 yet, but were running 3.5.0 and 3.5.1. OTOH, I agree with you that the circumstances under which your change causes trouble are pretty exotic. As Nick points out, modules replacing themselves in sys.modules are not that special. What *makes* the situation special is that 1) the package __init__.py has to import the self-replacing module and that 2) the self-replacing module is intended to be run via python3 -m package.module That's why I wrote initially that I don't know if many (or, in fact, any other package would be affected by this). Nick's concern about the double import situation is more general, but since this is something earlier releases have been doing, an improvement here would be relevant only for a major release (3.6 or 3.7). Regarding 3.5.3, I'm not sure what the best solution would be: - the suggestion to copy over the __spec__ attribute to the replacement object is putting the burden on package maintainers. Given that probably only few packages will be affected that may well be acceptable. In fact, for my own case I have now refactored things a bit so I can avoid the import from __init__.py. - from a strict versioning perspective, you may also argue like Nick that if it was working in 3.5.0-1 it should work again in 3.5.3. I'm personally pretty neutral here. I just thought it may be good to report the issue so that it becomes easier for others to understand what is going on if they encounter the same error. Maybe even the fact that this issue exists now is serving this purpose as well as documenting the changed behaviour? Aye, the report is definitely appreciated - the interaction between "__main__" execution and normal module imports has always been tricky, so it's always good to be informed of new problems folks encounter. As an example illustrating the underlying problem here without involving the "-m" switch at all: >>> from importlib.util import find_spec >>> find_spec("dis") ModuleSpec(name='dis', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fa7ba859fd0>, origin='/usr/lib64/python3.5/dis.py') >>> import sys >>> sys.modules["dis"] = object() >>> find_spec("dis") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.5/importlib/util.py", line 99, in find_spec raise ValueError('{}.__spec__ is not set'.format(name)) from None ValueError: dis.__spec__ is not set The difference between 3.5.1 and 3.5.2 is that if you do "find_spec('mypkg.mymod')" *before* "mypkg" is imported, then find_spec will use the original module object rather than the replacement inserted into sys.modules when it recurses down to look for "mypkg.mymod". However, if "mypkg" is already in sys.modules before find_spec is called, then find_spec will attempt to use that existing object, rather than the (potentially no longer available) original module object. Sorry, I got the levels slightly confused there - a bit more experimentation shows it isn't the parent package that needs a __spec__ attribute, but only the package being executed. # Parent package needs __path__ rather than __spec__ >>> find_spec("unittest.mock") ModuleSpec(name='unittest.mock', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fa7b6434b38>, origin='/usr/lib64/python3.5/unittest/mock.py') >>> sys.modules["unittest"] = object() >>> find_spec("unittest.mock") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.5/importlib/util.py", line 89, in find_spec return _find_spec(fullname, parent.__path__) AttributeError: 'object' object has no attribute '__path__' # Leaf package needs __spec__ >>> del sys.modules["unittest"] >>> find_spec("unittest.mock") ModuleSpec(name='unittest.mock', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fa7b64344e0>, origin='/usr/lib64/python3.5/unittest/mock.py') >>> import unittest.mock >>> del sys.modules["unittest.mock"].__spec__ >>> find_spec("unittest.mock") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.5/importlib/util.py", line 99, in find_spec raise ValueError('{}.__spec__ is not set'.format(name)) from None ValueError: unittest.mock.__spec__ is not set So what I'm gathering is that Martin fixed a bug that accidentally introduced a new one in 3.5.2 (which Martin should not feel responsible for; this import stuff is all very subtle and people use every nuance of it). To me, the question is whether there is a way to not revert Martin's fix -- or any other fixes -- while fixing Wolfgang's problem. If the answer is yes, then great and we just need to know what the answer is in the form of a patch. :) My hope is someone will be inspired enough to figure out a solution and we can fix this for Wolfgang. But if the answer is no, then we need to decide what the lesser of two bugs are. For me, I see Wolfgang's issue is the lesser of two bugs and thus the one that stays broken if we can't fix it reasonably (sorry, Wolfgang). Because we are trying to eliminate the double-import as that causes serious problems for anyone using import side-effects, I don't want to suddenly slide backwards in 3.5.3 by letting that happen again (and I think Nick agrees w/ me on that point). I also don't want people continuing down a path where they think that they can blank out critical import metadata and have import continue to work (not that I'm blaming Wolfgang for relying on it, just that it won't hold in the future). And since the reliance on __spec__ is just going to grow thanks to the elimination of double imports and slowly making that attribute the ground truth for import metadata, Wolfgang's code would need to be updated for Python 3.6 or later anyway. But as I said, I'm sure everyone's utmost preference is if someone can figure out how to fix this in 3.5.3 without undoing another fix. In, Wolfgang noted: "In fact, for my own case I have now refactored things a bit so I can avoid the import from __init__.py." So I take that to mean that Wolfgang's particular project is now compatible with the new 3.5.2 behaviour, or at least will be as of its next release (Wolfgang, please correct me if I've misinterpreted your comment). The "double import" implications involved here aren't entirely clearcut though, as even in 3.5.2 if a leaf module invoked via "-m" is a normal module, importing it from the parent package's __init__ module (or any other part of the startup process, like a .pth file) will still lead to it being executed twice. What's changed is that if the leaf module replaces itself in sys.modules with an object that doesn't have a __spec__ attribute, then executing it with -m will fail, rather than re-running the module level code as __main__ the way it will for a normal module. Perhaps a suitable outcome here would be to just add an unconditional RuntimeWarning when the target of "-m" is already in sys.modules after the parent package import, along the lines of: "RuntimeWarning: '<module>' already in sys.modules prior to '__main__' execution; this may result in unpredictable behaviour" Then if folks get the "ValueError: package.module.__spec__ is not set" message, that would be an example of the noted "unpredictable behaviour", and the suggested resolution would be the path Wolfgang took: find a way to eliminate the warning when executing that particular module as __main__. A warning like this sounds good to me though I'd prefer it to be slightly more verbose, like: "RuntimeWarning: '<module>' found in sys.modules after import of package '<package>', but prior to execution of '<module>' as '__main__'; this may result in unpredictable behaviour" or it wouldn't really have helped me much to understand what was happening. P.S.: You understood correctly that my own code is fixed (patch sent to the affected user, next release will have the fix). Learnt something about the whole __spec__ and double import subject along the way so it wasn't completely wasted time. +1 for the more verbose version, since that will tend to nudge folks towards <package>.__init__ as the likely culprit (and that does seem to be the most likely way for this particular double-import scenario to arise. Brett, does that resolution sound reasonable to you, too? Martin, would you have time to put together a follow-up patch adding the warning? (If not, I should be able to make time for it) +1 from me I can try to add the RuntimeWarning soon. Obviously we want the warning when executing a submodule like “package.module”. It also seems reasonable to warn when executing a top-level module that has already been imported. I presume we want these to go into the next 3.5 release. What about 2.7? I guess we don’t want a warning when executing “package.__main__”, even if the parent package is already imported. So I also need to check if sys.modules[...].__path__ exists. Another thing that I wonder about: What if the message “Error finding spec for . . .” was changed to “Error getting import information for . . .”? I am only just starting to understand that “finding spec” may mean this (I think the documentation has improved since I last tried to understand it). No changes to 2.7 - the import system logic there is fairly different, since it's still using the old pre-importlib implementation. For the "package.__main__" case, you're right that we don't want to emit the warning for "-m package", but we *do* want to emit the warning if package.__init__ imports package.__main__ for some reason. And that's an excellent point about "finding spec" being implementer focused jargon - would "finding module specification" be clearer? I'd still like to have a link between the error message and the fact the function is called "find_spec", and the official expansion of the abbreviation is "module specification" (hence _ModuleSpec). Here is a patch with the proposed warning. I think “Error finding module specification” might be a bit better than the current “finding spec”, so I included that change. With the patch, this is what the messages look like: $ ./python -m package.module /media/disk/home/proj/python/cpython/Lib/runpy.py:125: RuntimeWarning: 'package.module' found in sys.modules after import of any parent packages, but prior to execution; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) /media/disk/home/proj/python/cpython/python: Error while finding module specification for 'package.module' (ValueError: package.module.__spec__ is not set) [Exit 1] The warning also occurs when running toplevel modules that are already imported: $ ./python -m runpy /media/disk/home/proj/python/cpython/Lib/runpy.py:125: RuntimeWarning: 'runpy' found in sys.modules after import of any parent packages, but prior to execution; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) No module specified for execution FWIW, to fully avoid the regression and keep my original bug fixed at the same time, I think we would need a way for importlib.util.find_spec() to differentiate its own exceptions (the ValueError for missing __spec__, the ImportError for nonexistent parent package, etc) from exceptions raised by __init__.py code. The exceptions currently raised by find_spec() are not flexible enough for the runpy use case. Running pre-imported top level packages like "runpy" or "site" with "-m" is supported behaviour, so that shouldn't emit a warning. ("python -m site" in particular is a debugging tool used to print out the default sys.path configuration) Otherwise, the warning mostly looks good to me, except I'd suggest either dropping the word "any" from "any parent packages", or else replacing it with the word "all" (since the key point to be conveyed is that by the time the module starts executing and this check is made, all the parent packages have already been imported, thus triggering their side effects, if any). Here is an updated patch. Since the message no longer applies to top-level modules, I went back to a version closer to Wolfgang’s suggestion, which should eliminate the problem with “any parent packages”. Now the messages look like this: /media/disk/home/proj/python/cpython/Lib/runpy.py:125: RuntimeWarning: 'package.module' found in sys.modules after import of package 'package', but prior to execution of 'package.module'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) /media/disk/home/proj/python/cpython/python: Error while finding module specification for 'package.module' (ValueError: package.module.__spec__ is not set) [Exit 1] New changeset 43ae044eaccc by Martin Panter in branch '3.5': Issue #27487: Warn if submodule already imported before runpy execution New changeset fccd733aa78b by Martin Panter in branch 'default': Issue #27487: Merge runpy warning from 3.5 Thanks Martin! Closing this as fixed, since the new warning should help nudge folks towards staying within the supported subset of the import system behaviour when it comes to interactions between package.__init__ and package.__main__. I recently started getting this warning message (see bottom) that seems to be due to the changes from this issue. I'm running a submodule as main using the `-m` flag, but I'm not doing any modification to `sys.modules`, or even `sys.path`... I've taken a look at [The double-import trap](), but it doesn't really seem to apply. I really have no idea how to go about debugging this. 1) Would it be possible for the warning to include information about how/where the double import is happening? 2) Are there other, common ways of this occurring when the `sys` module isn't being messed with? The issue on stackexchange () seems similar, although this one in particular isn't reproducible. Any help would be greatly appreciated. Thanks! File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/runpy.py", line 183, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/runpy.py", line 125, in _get_module_details warn(RuntimeWarning(msg)) File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/warnings.py", line 99, in _showwarnmsg msg.file, msg.line) File "/n/home00/lkelley/zcode/zcode/inout/inout_core.py", line 835, in warn_with_traceback traceback.print_stack() /n/home00/lkelley/.conda/envs/py35/lib/python3.6/runpy.py:125: RuntimeWarning: 'mbhmergers.gwb.deterministic.grid_calc' found in sys.modules after import of package 'mbhmergers.gwb.deterministic', but prior to execution of 'mbhmergers.gwb.deterministic.grid_calc'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) I've added a second answer to the referenced Stack Overflow issue that attempts to more clearly explain what is going on: (The problem there is that proj.__init__ implicitly imports the module being executed by -m) If that answer is still insufficient to diagnose the problem you're seeing, then I'd suggest submitting a new SO question explaining how the behaviour in your case differs from that one, and then providing a link to it as a comment on my answer.
https://bugs.python.org/issue27487
CC-MAIN-2020-40
refinedweb
3,863
57.16
Edward A Lee Thu, 29 Jan 2004 10:13:00 -0800 Interesting... Your fix looks right to me... And in fact this is a serious memory leak, so the fix is much appreciated. I believe that the reason _tupleList is null is that the instance of VersionAttribute is added to the workspace before setContainer() is called to set the container. Then when setContainer() is called, the object should get removed from the workspace, since the workspace only contains top-level objects. setContainer() is called in the constructor of the base class, probably NamedObj, so the fields of the derived class have not been constructed yet. Hi there, I discovered a problem related to the VersionAttribute class while integrating the ptolemy kernel in one of our own applications. Our application creates a default workspace that is reused over the life-cycle of many executed models. Models are manually parsed from a MoML file and added to the workspace as seperate composite entities. After the model has been executed it is removed from the workspace. By printing a workspace directory list after the remove operation I discovered that the VersionAttribute that is contained by the model is not removed from the workspace. I don't know if Vergil creates a single workspace that is reused for every new model, but in our application this eventually leads to a out of memory exception. The workspace remove operation discards all contained named objects by calling remove on the internal workspace directory list. However this operation fails for a VersionAttribute object. By analysing the equals method of this class I discovered that equals fails for a comparison between two identical object references: public boolean equals(Object obj) { // If the _tupleList is null, then we are not fully constructed. // I see no choice but to return false. if (_tupleList == null) { ---> return false; } if (obj instanceof VersionAttribute) { return (compareTo(obj) == 0); } return false; } Somehow the tupleList attribute does not exist during this call. I should mention that the VersionAttribute object was created by the MoMl parser and setExpression was applied under normal conditions. Therefore I cannot explain why tupleList is null. Maybe there is a clone method involved. However if it is correct that the tupleList attribute can be null under these conditions, the implemention of the equals method should be modified by calling equals on it's parent: public boolean equals(Object obj) { if (_tupleList == null) { ---> return super.equals(obj); } if (obj instanceof VersionAttribute) { return (compareTo(obj) == 0); } return false; } This provides a working solution to our problem. However the fact that tupleList can be null when parsed from a MoML file doesn't make any sense to me. Kind regards, Richard van der Laan / [L]uminis Email : [EMAIL PROTECTED] TheWeb: ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: [EMAIL PROTECTED] ------------ Edward A. Lee, Professor 518 Cory Hall, UC Berkeley, Berkeley, CA 94720 phone: 510-642-0455, fax: 510-642-2739 [EMAIL PROTECTED], ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: [EMAIL PROTECTED]
http://www.mail-archive.com/ptolemy-hackers@eecs.berkeley.edu/msg01116.html
crawl-003
refinedweb
511
53
CodePlexProject Hosting for Open Source Software Hey guys, On the front page of my site, I would like to have a section that lists the most current blog entries (from my blog page) and when the entry is clicked on, the blog page with the entry clicked is shown. I would think that this wouldn't too difficult to achieve, but my relative newness to XSLT is causing me to draw a blank on that. I would really appreciate any suggestions on how this could be achieved. (Note: once the News package is updated to 2.0, I will be doing something similar) Thanks a lot guys! Robert The blog package use an XSLT extension (that come with the blog package) to create the date+title based URL element. So you call this extension to get the info. You can sneak peak in the existing XSLT for BlogRenderer. The primary steps here are: 1) Register the custom XSLT Extension for the blog by adding a call to "Composite.Community.Blog.XsltExtensions" on the Functions tab. Your preview will now display details about this extension 2) Register a namespace to this extension - easiest way is to add the following xmlns declaration inside the <xsl:stylesheet /> element: xmlns:be="#BlogXsltExtensionsFunction" xmlns:be="#BlogXsltExtensionsFunction" 3) Make sure that you include the "PageId", "Date" and "Title" fields in the "GetEntriesXml" function call so you have those values in the XML. 4) When you iterate through the resulting <Entries /> elements you go: <a href="~/Renderers/Page.aspx{be:GetBlogUrl(@Date, @Title)}?pageId={@PageId}"> <xsl:value-of </a> The markup above is pretty much a raw copy from the BlogRenderer function that ships with the package. Hope this help :) Thank you thank you thank you! :) That was just enough information for me to go forward with. Knowing what to use when and where (like Composite.Community.Blog.XsltExtensions, for instance) is the difficult part. It will just take some time, I guess, poking into areas and learning as I go. I GREATLY appreciate the assistance and will try to keep these kinds of posts to a minimum. :) Thanks again!! shouldn't you be able to render the "real" url of your page, and not actually using the Renderers/Page.aspx-pattern which is not very user friendly? What will the markup be for that? >> shouldn't you be able to render the "real" url of your page, and not actually using the Renderers/Page.aspx-pattern which is not very user friendly? What will the markup be for that? C1 automatically replaces url's like ~/Renderers/Page.aspx?id=.... with friendly urls. In "/Renderers/Page.aspx" there's a call to PageUrlHelper.ChangeRenderingPageUrlsToPublic which does this work. The reason for that is that users friendly url's are subject to change, futher more reference like ~/Renderers/Page.aspx?id=.... will be referenced to the same language and publication scope as the page it is put on, f.e. by viewing page in "en-US" all those internal links will shown as links to pages from "en-US" language. Ok, I have another question about this. I have the functionality working except the list of blogs are not being presented in descending chronological order. I cannot really determine what order they are being displayed in. The BlogRenderer function is displaying in descending order, correctly (of course), however, I cannot see anything in the code that regulates or determines this. Any pointers would, again, be most welcome and appreciated. Thank you, If you are using the GetEntriesXml function to get data, you probably have two parameters on that function named OrderByField and OrderAscending - if you do, try setting them to the date field and 'false'. *sigh* So simple. Thanks once more Marcus. ;-) Hi guys, Is that possible to get a source code of Composite.Community.Blog.dll assembly ? -Ruslan Are you sure you want to delete this post? You will not be able to recover it later. Are you sure you want to delete this thread? You will not be able to recover it later.
http://c1cms.codeplex.com/discussions/234501
CC-MAIN-2017-22
refinedweb
677
65.83
Bart De Smet's on-line blog (0x2B | ~0x2B, that's the question) A while back, I blogged about (Mis)using C# 4.0 Dynamic – Type-Free Lambda Calculus, Church Numerals, and more which was a fun post and got some good feedback and solid reading numbers. So, let’s continue our journey of brain-exploding theoretical foundational posts with “The Revenge of the Type-Free Lambda Calculus, Now Compatible with C# 3.0”. Last time around, we truly misused C# 4.0 dynamic to uni-type (not a spelling mistake) functions and values, and went bananas turning basic computation with numerals and Booleans into functions thanks to Church encodings. All in all a great unit test for the Dynamic Language Runtime that sweats under the pressure put on it by our crazy function calls: // //))); The above allows us to write a simple iterative (ah, I’m cheating) Fibonacci function as follows: var i = N0; var prev = N0; var curr = succ(N0); while (true /* could have used a Church Boolean as well ;-) */) { Console.WriteLine(toInt(curr)); var t = curr; curr = plus(curr)(prev); prev = t; } If you don’t believe the above works, or you don’t get it how it does its magic, revisit my previous post on the topic, and check back after you’ve plowed through it. Today, we’ll take a step back and have a look at how we can do all of the above in the pre-.NET 4.0 era, where we don’t have the “convenient” dynamic type to escape from the typed reality. So, how can we make this work? A possible answer can be found in the use of unchecked exceptions, as we have them at our service in the .NET Framework. The underlying idea is to “smuggle out” data out of a function without having to declare it anywhere in the function’s signature (use of checked exceptions prevents this, as the “throws clause” would have to reveal what’s being thrown in a … statically typed manner, aye!). This is one of the findings described in Mark Lillibridge’s paper entitled “Unchecked Exceptions can be Strictly More Powerful than Call/CC” on page 301, though much more mind-blowing stuff can be found in there (as the title reveals). Once I get into blogging about continuations, most likely in the context of Reactive LINQ (otherwise known as Reactive Framework or Reactive Fx), I may refer to this paper again to assist in blowing out people’s brains (just kidding). Talking about Reactive LINQ, I got the initial reference to this paper by Erik Meijer. So, what’s the big idea? Let me try to summarize it. You’ll remember we need to define two operations to make the essentials of lambda calculus work: abstraction and application. We also know that both functions and values need to be represented in an equal manner, as functions are first-class: a function can take another function as its input or produce one as its output. So, it’s still clear we need to uni-type things just like we did before. So let’s spoil the beans now without much further ado: that single type we’ll be using today is nothing less than System.Action, as delegate defined as follows: public delegate void Action(); In fundamentalist functional programming the above is the most useless type for a function: it takes nothing and produces nothing, hence all those guys can be compiled away, right? But as they’ll be our bread and butter for today’s installment, you can guess we’ll joyfully dance the tango of side-effects. One such great side-effect is called an exception. Let’s take a step back first and summarize the dense info above: values and functions will be represented as System.Action objects. Right, in our lambda calculus “emulator” System.Action is the new System.Object. The careful reader will notice that System.Action plays a dual role here: on the outside we use it as the single type we’re dealing with both for values and functions. But on the inside, we'll leverage its delegate (a “CLR function object” if you will) characteristic somehow. Let’s go there now… How can we realize abstraction? As we know from the previous time around, all functions of multiple arguments can be represented as functions of one argument through currying. So, to construct this simplest form of a function, all we need is a way for the user to define a function between two of our “first-class” objects (of type System.Action), which is something we can do as a Func<Action, Action> in C#. This allows the users to use the lambda arrow to write such a function. However, since a defined function (through abstraction) needs to be capable of being passed elsewhere as an argument, a Func<Action, Action> is too verbose: we need to morph it into a System.Action again. This is what our lambda abstraction operator will have to do: static Action λ(Func<Action, Action> x) { // But how???} We’ll see in a moment how we can realize this function. But first, let’s have a look at the contract of a application operator we so badly need to have this come off the ground. Application takes two objects at a time: the first one will be a function, the second one a function or a value. It applies the function to the given argument. Objects are of type System.Action, and the result of the application call is an object too, hence the following signature: static Action ß(Action x, Action y){ // But how???} Okay, let’s fill in the voids. How can we smuggle out a function between two Action objects into a single action, to realize abstraction? Well, what about carrying the function on the back of an exception object. We’ll define a useful generic Exception type for this purpose: class Exception<T> : Exception { public Exception(T data) { Data = data; } public new T Data { get; private set; } } This allows us to define the lambda function like this: static Action λ(Func<Action, Action> x) { return () => { throw new Exception<Func<Action, Action>>(x); }; } In Lillibridge’s paper this is referred to as the “roll” operation. Think of this smuggling operation as rolling the function in a carpet of type Action: nobody will notice from the outside that it contains some dirty secrets. (Tip: don’t try this technique at airport security gates, they won’t allow exceptions.) But what does this mean? Well, from the outside the function can simply construct a proper lambda calculus function, surfaced as an Action object (making it deserve the status of “first-class”). How do we, the “lambda runtime”, get it out of there again? Simply invoke the resulting Action when needed, and catch the generic exception type. That’s precisely what the applicaiton function will have to do: static Action ß(Action x, Action y) { Func<Action, Action> xe; try { x(); xe = _ => _; } catch (Exception<Func<Action, Action>> ex) { xe = ex.Data; } return xe(y); } This is referred to as the “unroll” operation. In order to apply the function “x” to argument “y”, we first need to evaluate x. We do so by calling the delegate, which (when properly constructed through the lambda operator) will throw an exception allowing us to unroll the underlying function type from our smuggling exception carpet. Then we can feed in the argument ”y” to the resulting Func<Action, Action> to get the result of the function call back. The remaining one-billion dollar question is how we’d ever end up executing the last statement in the try-block: xe = _ => _; This is simply an identity function (you could equally well have write z => z or so), which ultimately will cause the application to return its argument. We use this as a convenient mechanism to allow “regular” Action objects as participants in our application operation. At a later point, this will become clear. The “LLR” I’m illustrating here is a way to layer untyped computation on the statically typed foundation of the “CLR”. Contrast to the DLR’s complex infrastructure, we need nothing more than two methods: static Action λ(Func<Action, Action> x) { return () => { throw new Exception<Func<Action, Action>>(x); }; } static Action ß(Action x, Action y) { Func<Action, Action> xe; try { x(); xe = _ => _; } catch (Exception<Func<Action, Action>> ex) { xe = ex.Data; } return xe(y); } In the previous post, I’ve explained what Church Booleans are, so I won’t do it again now. Instead, let’s try to redefine those in terms of our lambda and beta operations: // // Church Booleans // var T = λ(a => λ(b => a)); // \ab.a var F = λ(a => λ(b => b)); // \ab.b var Not = λ(m => λ(a => λ(b => ß(ß(m, b), a)))); // \m.\ab.mba var And = λ(m => λ(n => ß(ß(m, n), m))); // \mn.mnm var Or = λ(m => λ(n => ß(ß(m, m), n))); // \mn.mmn var Xor = λ(m => λ(n => λ(a => λ(b => ß(ß(m, ß(ß(n, b), a)), ß(ß(n, a), b)))))); // \mn.\ab.m(nba)(nab) This should do the trick, shouldn’t it? How to calculate, say, T && F? Here it is: ß(ß(And, T), F) Quite easy, but with a bit of beta function noise. To prove all of this works, we’ll have to provide pretty-printing functions. Similarly we may benefit from a function that promotes a CLR Boolean into the corresponding Church Boolean: Func<Action, bool> toBool = b => { bool res = false; ß(ß(b, () => { res = true; }), () => { res = false; })(); return res; }; Func<bool, Action> fromBool = b => b ? T : F; Those are very comparable to the ones we used in the previous post, using C# 4.0 dynamic. Notice how an impure lambda expression is used as an argument to the beta-application in order to realize toBool. Based on all of this we’d like to be able to write a testing function that can print results of applying our Boolean operators to various arguments. Again we base this off the functions used in the previous post: static void Unary<T, PArg, PRes>(string name, Func<Action, T> f, Func<Action, PArg> printArg, Func<T, PRes> printRes, params Action[] values) { foreach (var value in values) Console.WriteLine("{0}({1}) = {2}", name, printArg(value), printRes(f(value))); } static void Binary<T, PArg, PRes>(string name, Func<Action, Action, T> f, Func<Action, PArg> printArg, Func<T, PRes> printRes, params Action[] values) { foreach (var valueL in values) foreach (var valueR in values) Console.WriteLine("{0}({1}, {2}) = {3}", name, printArg(valueL), printArg(valueR), printRes(f(valueL, valueR))); } For example, Unary could be used with the “Not” operator, using toBool for print-functions which turn the Church Boolean into the corresponding System.Boolean that Console.WriteLine can deal with. Notice one thing though: the above is not pure either, in a sense we’re not passing in plain Action objects for the function “f”, instead we’re using Func<Action, …> types. None of our lambda functions like “Not” and “And” are compatible with this form. How do we do this (purely a cosmetic thing, btw)? // // Conversion operations // Func<Action, Func<Action, Action>> toFunc1 = f => x => ß(f, x); Func<Action, Func<Action, Action, Action>> toFunc2 = f => (x, y) => ß(ß(f, x), y); Func<Action, Func<Action, Action, Action, Action>> toFunc3 = f => (x, y, z) => ß(ß(ß(f, x), y), z); Func<Func<Action, Action>, Action> fromFunc1 = f => λ(x => f(x)); Func<Func<Action, Action, Action>, Action> fromFunc2 = f => λ(x => λ(y => f(x, y))); Func<Func<Action, Action, Action, Action>, Action> fromFunc3 = f => λ(x => λ(y => λ(z => f(x, y, z)))); The conversion operators above provide the answer: they allow us to make plain lambda functions callable as if they were CLR functions (Func<…>) and also allow for abstraction based on a CLR functions. In fact, the family of toFunc functions could be called “decurry” (e.g. toFunc3 produces a function of three arguments) while the fromFunc functions are “curry” operators (e.g. fromFunc3 takes a function of three arguments). Based on this we can write “C#-user friendly” forms of our Church Boolean operators: var not = toFunc1(Not); var and = toFunc2(And); var or = toFunc2(Or); var xor = toFunc2(Xor); Notice the different casing used. Exercise for the reader: infer the types of the eight objects that appear in the fragment above (i.e. excluding the to* functions). Now we can write a test procedure as follows: Console.WriteLine("Church Booleans"); Unary("toBool", toBool, toBool, x => x, F, T); Unary("not", not, toBool, toBool, F, T); Binary("and", and, toBool, toBool, F, T); Binary("or", or, toBool, toBool, F, T); Binary("xor", xor, toBool, toBool, F, T); Console.WriteLine(); Here’s the result: It worked, didn’t it? In the sample above, we’ve encountered utterly complicated application calls due to the fact the beta function only takes two arguments at a time (just like classical lambda calculus prescribes): var Xor = λ(m => λ(n => λ(a => λ(b => ß(ß(m, ß(ß(n, b), a)), ß(ß(n, a), b)))))); // \mn.\ab.m(nba)(nab) It’s a convention that applications are left-associative, hence we’d like to be able to write the following instead: var Xor = λ(m => λ(n => λ(a => λ(b => ß(m, ß(n, b, a), ß(n, a, b)))))); // \mn.\ab.m(nba)(nab) Obviously this is easy to realize as follows, using LINQ’s Aggregate (“left fold”) operator: static Action ß(Action x, Action y, params Action[] zs) { return zs.Aggregate(ß(x, y), (l, z) => ß(l, z)); } Can we make the excessive lambda arrows are bit less invasive too? Sure, inspired by our fromFunc objects: static Action λ(Func<Action, Action, Action> f) { return λ(x => λ(y => f(x, y))); } static Action λ(Func<Action, Action, Action, Action> f) { return λ(x => λ(y => λ(z => f(x, y, z)))); } That puts us in a position to write the Xor operator as: var Xor = λ((m, n) => λ((a, b) => ß(m, ß(n, b, a), ß(n, a, b)))); // \mn.\ab.m(nba)(nab) Much cleaner, isn’t it? If Booleans work, we should get numerals working too. Obviously this is the case: // // Church numerals // var N0 = λ(f => λ(x => x)); // \fx.x = F var N1 = λ(f => λ(x => ß(f, x))); // \fx.fx var N2 = λ(f => λ(x => ß(f, ß(f, x)))); // \fx.f(fx) var Zero = λ(n => ß(ß(n, λ(x => F)), T)); // \n.n(\x.F)T var Succ = λ(n => λ(f => λ(x => ß(f, ß(ß(n, f), x))))); // \n.\fx.f(nfx) var Pred = λ(n => λ(f => λ(x => ß(ß(ß(n, λ(g => λ(h => ß(h, ß(g, f))))), λ(u => x)), λ(u => u))))); var Plus = λ(m => λ(n => λ(f => λ(x => ß(ß(m, f), ß(ß(n, f), x)))))); // \mn.\fx.mf(nfx) var Sub = λ(m => λ(n => ß(ß(n, Pred), m))); var Mul = λ(m => λ(n => λ(f => ß(n, ß(m, f))))); // \mn.\f.n(mf) var Exp = λ(m => λ(n => ß(n, m))); // \mn.nm var zero = toFunc1(Zero); var succ = toFunc1(Succ); var pred = toFunc1(Pred); var plus = toFunc2(Plus); var sub = toFunc2(Sub); var mul = toFunc2(Mul); var exp = toFunc2(Exp); Func<Action, uint> toInt = x => { uint n = 0; ß(ß(x, () => { n++; }), nop)(); return n; }; Func<uint, Action> fromInt = null; fromInt = n => { return (n == 0 ? N0 : succ(fromInt(n - 1))); }; The nop helper function used in the toInt function is simply the no-op Action delegate () => {}. To get to know how toInt works (as well as all the other functions, by means of formal proofs), have a look at my previous post again. Either way, a simple test shows all of the above works as well: Console.WriteLine("Church numerals"); Unary("toInt", toInt, toInt, x => x, Enumerable.Range(0, 3).Select(i => fromInt((uint)i)).ToArray()); Unary("succ", succ, toInt, toInt, Enumerable.Range(0, 3).Select(i => fromInt((uint)i)).ToArray()); Unary("pred", pred, toInt, toInt, Enumerable.Range(1, 3).Select(i => fromInt((uint)i)).ToArray()); Unary("zero", zero, toInt, toBool, Enumerable.Range(0, 2).Select(i => fromInt((uint)i)).ToArray()); Binary("plus", plus, toInt, toInt, Enumerable.Range(0, 3).Select(i => fromInt((uint)i)).ToArray()); Binary("mul", mul, toInt, toInt, Enumerable.Range(0, 3).Select(i => fromInt((uint)i)).ToArray()); Binary("exp", exp, toInt, toInt, Enumerable.Range(1, 3).Select(i => fromInt((uint)i)).ToArray()); Console.WriteLine(); Resulting in: As an outtake for today’s installment, let’s show how to realize pairs and lists using functions: // // Pairs // var Pair = λ(x => λ(y => λ(z => ß(ß(z, x), y)))); // \xy.\z.zxy var Fst = λ(p => ß(p, T)); // \p.pT var Snd = λ(p => ß(p, F)); // \p.pF var pair = toFunc2(Pair); var fst = toFunc1(Fst); var snd = toFunc1(Snd); Func<Action, Tuple<object, object>> toPair = a => new Tuple<object, object>(ext(fst(a)), ext(snd(a))); Func<Tuple<object, object>, Action> fromPair = p => pair(inj(p.Item1), inj(p.Item2)); Assert(toInt(fst(pair(N1, N2))) == 1, "fst(pair(N1, N2))"); Assert(toInt(snd(pair(N1, N2))) == 2, "snd(pair(N1, N2))"); var me = new Tuple<object, object>("Bart", 26); Assert(toPair(fromPair(me)).Equals(me), "Roundtrip object pair"); var nums = new Tuple<object, object>(N1, N2); Assert(toPair(fromPair(nums)).Equals(nums), "Roundtrip nums pair"); A pair is constructed by giving it two arguments, resulting in a function that will return one of them by giving it a Boolean (“z” in the Pair function above). The first and second extraction functions are then defined in terms of applying the “pair as a function” to either T or F, which will select the right value out of the pair. The toPair and fromPair functions are defined to go back and forth between a Church pair and a Tuple<object, object> in CLR-land. This is based on two functions I’m not showing here (left as an exercise for the reader): ext and inj, for extract and inject respectively. The signature of those functions is as follows: // // Values // Func<object, Action> inj = o => /* left as an exercise */ Func<Action, object> ext = a => /* left as an exercise */ Assert((string)ext(inj("Bart")) == "Bart", "ext(inj(\"Bart\"))"); Assert((int)ext(inj(42)) == 42, "ext(inj(42))"); DateTime now = DateTime.Now; Assert((DateTime)ext(inj(now)) == now, "ext(inj(now))"); Warning: This is not a trivial exercise, as arbitrary .NET objects need to be able to be “lifted into” lambda land (e.g. the sample above allows to roundtrip a string and a DateTime). Have fun <g>! Church lists can be defined in terms of Nil and Cons operations, together with extraction functions like Head and Tail, and a test function IsNil: // // Lists // var Nil = ß(ß(Pair, T), T); var IsNil = Fst; var Cons = λ(h => λ(t => ß(ß(Pair, F), ß(ß(Pair, h), t)))); var Head = λ(z => ß(Fst, ß(Snd, z))); var Tail = λ(z => ß(Snd, ß(Snd, z))); var nil = Nil; var isNil = fst; var cons = toFunc2(Cons); var head = toFunc1(Head); var tail = toFunc1(Tail); Func<Action, List<object>> toList = a => { List<object> res = new List<object>(); while (!toBool(isNil(a))) { res.Add(ext(head(a))); a = tail(a); } return res; }; Func<List<object>, Action> fromList = l => Enumerable.Reverse(l).Aggregate(nil, (t, o) => cons(inj(o), t)); Assert(toBool(isNil(nil)) == true, "isNil(nil)"); Assert(toBool(isNil(cons(N1, nil))) == false, "isNil(cons(N1, nil))"); Assert(toInt(head(cons(N1, N2))) == 1, "head(cons(N1, N1))"); Assert(toInt(tail(cons(N1, N2))) == 2, "tail(cons(N1, N2))"); var lst = new List<object> { 1, N2, 3 }; Assert(toList(fromList(lst)).SequenceEqual(lst), "Roundtrip list"); Again we provide ways to turn a Church list in a List<object> (again based on ext), and the other way around (using the magical inj). Yes, the above works just fine… As an additional exercise, write a ForEach extension method that can take a Church list (of type … Action) and an Action<Action> delegate as the body of the loop, so we can use it as follows (tip: mirror the toList implementation): cons(N1, N2).ForEach(x => { Console.WriteLine(toInt(x)); }); What can I say? This was fun for sure, if nothing more. I hope I’ve convinced the reader that functions are immensely powerful animals capable of representing data. In addition, we’ve shown how powerful exceptions can be (something the “Unchecked Exceptions can be Strictly More Powerful than Call/CC” paper goes much much deeper into). Yeah, performance guys will have the hairs on their back standing upright, but hey: it’s Crazy Sundays after all. And, as an additional excuse I now can claim to be referred to as a “stunt coder” on Twitter (thanks James, also for subtly using the word “fold”): Enjoy! Man, those Crazy Sunday articles of yours are like taking my brain to the gym! Even though I understand roughly 60% of what you write, it's still a great ride! Thank man. Thank you for submitting this cool story - Trackback from DotNetShoutout Pingback from Dew Drop – August 31, 2009 | Alvin Ashcraft's Morning Dew Pingback from Type-Free Lambda Calculus in C#, Pre-4.0 ??? Defining the Lambda … exception select top 9 [Subject] from dbo . cs_Posts where postlevel = 1 and usertime < '01/01/2010' Pingback from Calculus function pre Pingback from Lambda Calculus: Links, News and Resources (1) « Angel “Java” Lopez on Blog Type-Free Lambda Calculus in C#, Pre-4.0 – Defining the Lambda Language Runtime (LLR) - B# .NET Blog
http://community.bartdesmet.net/blogs/bart/archive/2009/08/30/type-free-lambda-calculus-in-c-pre-4-0-defining-the-lambda-language-runtime-llr.aspx
CC-MAIN-2017-22
refinedweb
3,660
59.74
From: Brian McNamara (lorgon_at_[hidden]) Date: 2003-10-06 14:02:20 On Mon, Oct 06, 2003 at 02:53:58PM -0400, David Abrahams wrote: > Brian McNamara <lorgon_at_[hidden]> writes: > > On Mon, Oct 06, 2003 at 07:36:22AM -0400, David Abrahams wrote: > > I disagree with this. The concepts (and traits) themselves are still > > "extrinsic". The only thing the "grouping" does is say "hey, since the > > Container concept is already known and fixed, we provide a convenient > > way to access container traits uniformly here in this namespace (or > > class template, or however it gets implemented). One "group" which > > contains all of the individual traits as members is conceptually easier > > to grok than two dozen individual traits entities. > > I'm sure there will be traits that are of interest even if they don't > have a direct relationship to the container requirements. That's the > point: container_traits is-not-a container. It gives arbitrary > information *about* a container, the scope of which is currently > bounded by the grouped design. > > For an analogy, let's look at iterators. Without changing the current > iterator concepts, we might want to know if an iterator can be > incremented without throwing an exception, or whether it returns an > lvalue when dereferenced, neither of which is completely reflected in > iterator_traits. I assert that grouped iterator_traits is a mistake, > in part because you can't ask those questions without either changing > iterator_traits or producing an unbalanced design with one group and > lots of little independent traits metafunctions. I now (finally!) see what you are talking about. I will have to think about this deeply before I can consider how it affects my whole stance on the topic. > But anyway, I promised to butt out after my last posting, so I'm > *really* butting out now. Thanks for this one last message. Sorry that we spent so much time spinning our wheels yesterday. -- -Brian McNamara (lorgon_at_[hidden]) Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2003/10/53952.php
CC-MAIN-2019-43
refinedweb
340
55.44
The. JSTL has tags such as iterators and conditionals for handling flow control, tags for manipulating XML documents, internationalization tags, tags for accessing databases using SQL, and commonly used functions. This chapter demonstrates JSTL through excerpts from the JSP version of the Duke’s Bookstore application discussed in the earlier chapters. It assumes that you are familiar with the material in the Using Custom Tags section of Chapter 5, JavaServer Pages Technology. This chapter does not cover every JSTL tag, only the most commonly used ones. Please refer to the reference pages at for a complete list of the JSTL tags and their attributes.. JSTL includes a wide variety of tags that fit into discrete functional areas. To reflect this, as well as to give each area its own namespace, JSTL is exposed as multiple tag libraries. The URIs for the libraries are as follows: Core: XML: Internationalization: SQL: Functions: Table core XML tags provide basic functionality to easily parse and access XML data. The parse tag parses an XML document and saves the resulting object in the EL variable specified by attribute var. In bookstore5, the XML document is parsed and saved to a context attribute in tut-install/javaeetutorial5/examples/web/bookstore5/web/books/parsebooks.jsp, which is included by all JSP pages that need access to the document: <c:if <c:import <x:parse </c:if> The set and out tags parallel the behavior described in Variable Support Tags and Miscellaneous Tags for the XPath local expression language. The set tag evaluates an XPath expression and sets the result into a JSP EL variable specified by attribute var. The out tag evaluates an XPath expression on the current context node and outputs the result of the evaluation to the current JspWriter object. The JSP page tut-install/javaeetutorial5/examples/web/bookstore4/web/books/bookdetails.jsp selects a book element whose id attribute matches the request parameter bookId and sets the abook attribute. The out tag then selects the book’s title element and outputs the result. <x:set <h2><x:out</h2> As you have just seen, x:set stores an internal XML representation of a node retrieved using an XPath expression; it doesn’t convert the selected node into a String and store it. Thus, x:set is primarily useful for storing parts of documents for later retrieval. If you want to store a String, you must use x:out within c:set. The x:out tag converts the node to a String, and c:set then stores the String as an EL variable. For example, tut-install/javaeetutorial5/examples/web/bookstore4/web/books/bookdetails.jsp stores an EL variable containing a book price, which is later provided as the value of a fmt tag, as follows: <c:set <x:out </c:set> <h4><fmt:message: <fmt:formatNumber The other option, which is more direct but requires that the user have more knowledge of XPath, is to coerce the node to a String manually by using XPath’s string function. <x:set"/>. The JSTL SQL tags for accessing databases listed in Table 7–7 are designed for quick prototyping and simple applications. For production applications, database operations are normally encapsulated in JavaBeans components.Table 7–7 SQL Tags: :
http://docs.oracle.com/cd/E19316-01/819-3669/bnakc/index.html
CC-MAIN-2014-42
refinedweb
542
51.68
How to connect from Python to SAP Cloud Platform Internet of Things (SCP IoT) by MQTT protocol Today a quick read article as this topic just crossed my way and is kind of unplanned: As you might know already MQTT is a great protocol to communicate from edge computing devices to gateways submitting small chunks of information from sensors, to actors etc. You will find good articles already out there on this topic! However, when I started to write the code and wanted to connect to SCP IoT from Python reality was different to what I expected from studying the books! ? So I want to save those some time that plan to write a Python client with the paho-mqtt package! Prerequisites This blog is about the Cloud Foundry IoT (not Neo!) and the help documents I recommend for further insights are here: SAP Internet of Things Gateway: MQTT There is as well as a good tutorial for setting up the capabilities, sensors, devices in the cockpit: SAP Developers Tutorial: Send Data with MQTT Please read over these first, as I will just cover the (tricky) authentication and Python part. Authentication SAP’s IoT framework requires certificate authentication (for those of you interested how to use it in the SAP Netweaver ABAP world you can check my recent blog about it). For our case we want to download the device certificate generated by the platform in PEM format. You get it from here: Internet of Things Cockpit: Device certificate generation You will now get a certificate in .pem-format as well as a pop-up window with a certificate secret which you need to store somewhere (for the moment). If you lose it, you have to create another certificate (which you can do as often as you need it). Internet of Things Cockpit: Certificate secret You might ask: What do I need it for, why do I get a “secret”? A PEM file served by the SAP IoT framework contains two pieces of information: - The SAP server-side certificate which is public. With this certificate all data which we receive from the IoT framework on our device is decrypted and therefore verified. That is, if we trust the certificate – for that the certificate authority (CA) must be known to both parties. However, this is not scope of our setup. - the device’s private key. It is used to encrypt communication to the SAP IoT framework MQTT server. The server holds the public key of the device (as we obtained the .pem-file from the server). Now here’s the catch: Private keys should be protected against loss. With the key in possession communication can be cloned by any other device and will be authenticated against the server. Therefore, SAP encrypts the private key in the .pem-file and one needs the passphrase (aka: secret) to unlock the key. Problem for us: The Python MQTT client will ask us anytime for that key it powers up. And it can’t be fed into the program itself (well, it’s a security feature, right?). Fact is, very likely we want to get rid of the passphrase and accept that we have to protect the .pem-file! ? You need OpenSSL installed for that – it’s three steps. First we extract the private key into a separate file and remove the passphrase protection. openssl rsa -in <our downloaded>.pem -out private.key -passin pass:<the secret we got> Then in the second step, we extract the public certificate into a new file. openssl x509 -inform PEM -in <our downloaded>.pem -outform PEM -out certificate.crt Lastly, we can combine the two separate files into one. cat private.key certificate.crt > newcert.pem Voilà! We got a passphrase-free file for our Python client. The Python client The client itself is almost self-explanatory, we need to instantiate it with the alternate ID of the device which is maybe a little special: client = mqtt.Client(sapIotDeviceID) And of course we make use of our new certificate. import paho.mqtt.client as mqtt import ssl import time import random # to get some 'realistic numbers' :-) # Parameters sapIotDeviceID = "<your device alternate ID>" pemCertFilePath = "./certificates/newcert.pem" mqttServerUrl = "xyzabc.eu10.cp.iot.sap" # enter the IoT cockpit url here mqttServerPort = 8883 # Port used by SAP IoT ackTopicLevel = "ack/" measuresTopicLevel = "measures/" # dummy message dummyMsg = '{{ "capabilityAlternateId": "<your id>", "sensorAlternateId": "<your sensor id>", "measures": [{{"speed": "{}"}}] }}' # This function gives a connection response from the server def onConnect(client, userdata, flags, rc): rcList = { 0: "Connection successful", 1: "Connection refused - incorrect protocol version", 2: "Connection refused - invalid client identifier", 3: "Connection refused - server unavailable", 4: "Connection refused - bad username or password", 5: "Connection refused", } print(rcList.get(rc, "Unknown server connection return code {}.".format(rc))) # The callback for when a PUBLISH message is received from the server. def onMessage(client, userdata, msg): print(msg.topic + " " + str(msg.payload)) # Send message to SAP MQTT Server def sendMessage(client, deviceID, messageContentJson): time.sleep(random.randint(0,2)) #Wait some random time to make it look realistic client.publish(deviceID, messageContentJson) print("Starting up...") client = mqtt.Client(sapIotDeviceID) client.on_connect = onConnect client.on_message = onMessage client.tls_set(certfile=pemCertFilePath, cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLS, ciphers=None) client.connect(mqttServerUrl, mqttServerPort) client.subscribe(ackTopicLevel+sapIotDeviceID) #Subscribe to device ack topic (feedback given from SAP IoT MQTT Server) client.loop_start() #Listening loop start for _ in range(10): # We send 10 random values sendMessage(client, measuresTopicLevel+sapIotDeviceID, dummyMsg.format(random.randint(10,50))) time.sleep(2) # wait until we have all feedback messages from the server client.loop_stop Closing notes We looked into building an MQTT client with Python that can speak to SAP Cloud Platform Internet of Things. Please note the setup requires ssl package to be imported. It’s maybe also worth mentioning that the paho-mqtt package is not enabled for multiprocessing. Which means your code must manage the amount of messages you want to send carefully. There are some who launched a new client with every process. Let me know if you have any suggestions or experiences how to handle multiprocessing (not threading!). Looking forward to your feedback. ?
https://blogs.sap.com/2020/08/16/good-things-come-in-small-pieces-mqtt-from-python/
CC-MAIN-2021-21
refinedweb
1,022
55.84
Red Hat Bugzilla – Bug 152474 SOLUTION: Erase character wrong in screen Last modified: 2008-08-02 19:40:33 EDT +++ This bug was initially created as a clone of Bug #11294 +++ I cloned this bug because I couldn't find a way to change the status of the original to re-open it. I think I have this problem pinned down, though I'm still not 100% sure WHY it happens... The problem appears to be this: Any program started in screen (i.e. exec'd by a shell which screen has started) seems to work fine. However, any program started by forking in those processes exhibits the problem. You can demonstrate the problem very easily by starting screen, and then compiling and running the following tiny program: /* test_screen.c */ #include <stdlib.h> int main( void ) { int ret; ret = system("/bin/stty -a|less"); return ret; } Once less is running, hit '/' to start a search pattern. Type some stuff. Now hit the backspace key. Rather than backspacing properly, the terminal will display ^H^H^H.... PROBLEM: Forked programs appear to rely on the erase setting of stty, rather than looking at terminfo. FWIW, this is probably the correct behavior of ALL programs. I say that because the system will normally initialize erase to the default defined in the terminfo db, and if the user uses stty to change it, there is probably a really good reason for him doing so... SOLUTION: There is no problem whatsoever if screen is going to use ^H internally and translate that to the physical terminal's erase character. However, screen must change the (pseudo) terminal's erase character to ^H in order for all programs to see this translation. Since screen opens a pseudo tty for each of its screens, there should be no need to save the original setting of the controling terminal... Meaning, this should be a one-line patch to screen to set the erase character on all opened pseudo ttys. WORKAROUND: Until this fix hits the source code, the following in .bashrc should suffice: if [ "$TERM" = screen ]; then stty erase '^H' fi The RIGHT way to work around this problem SHOULD be to use tset in your .bashrc file. I tried solving this by running tset in my .bashrc, like this: tset -Q -e This SHOULD set the erase character based on the terminfo database's idea of what it should be, and indeed my tests suggested that it did that fine. However, it also caused a strange echo effect as a side effect. It repeated non-control characters, and for control characters, it displayed the hat notation for the character in addition to sending the control character to the terminal. Very strange. Setting the erase character conditionally based on the value of $TERM is a little gross, but it works flawlessly. Please fix screen so that it resets the (pseudo) terminal's erase character to ^H. Thanks! Note that this bug report was originally filed against Red Hat 6.2, but I have experienced it in Red Hat 9 and Fedora.
https://bugzilla.redhat.com/show_bug.cgi?id=152474
CC-MAIN-2018-34
refinedweb
512
70.63
This page is based with thanks on the wiki page on subclassing by Pierre Gerard-Marchant -. Subclassing ndarray is relatively simple, but it has some complications compared to other Python objects. On this page we explain the machinery that allows you to subclass ndarray, and the implications for implementing a subclass. Subclassing ndarray is complicated by the fact that new instances of ndarray classes can come about in three different ways. These are: The last two are characteristics of ndarrays - in order to support things like array slicing. The complications of subclassing ndarray are due to the mechanisms numpy has to support these latter two routes of instance creation. View casting is the standard ndarray mechanism by which you take an ndarray of any subclass, and return a view of the array as another (specified) subclass: >>> The slice is a view onto the original c_arr data. So, when we take a view from the ndarray, we return a new ndarray, of the same class, that points to the data in the original. There are other points in the use of ndarrays where we need such views, such as copying arrays (c_arr.copy()), creating ufunc output arrays (see also _ means you have created a new instance of your class from a pre-existing instance, allowing you - for example - to copy across attributes that are particular to your subclass. If we subclass ndarray, we need to deal not only with explicit construction of our array type, but also View casting or'> Args in __init__: ('hello',) When we call C('hello'), the __new__ method gets its own class as first argument, and the passed argument, which is the string 'hello'. After python calls __new__, it usually (see below) calls our __init__ method, with the output of __new__ as the first argument (now a class instance), and the passed arguments following. As you can see, the object can be initialized in the __new__ method or the __init__ method, or both, and in fact ndarray does not have an __init__ method, because all the initialization is done in the __new__ method. Why use __new__ rather than just the usual __init__? Because in some cases, as for ndarray, we want to be able to return an object of some other class. Consider the following: class'> The definition of C is the same as before, but for D, the __new__ method returns an instance of class C rather than D. Note that the __init__ method of D does not get called. In general, when the __new__ method returns an object of class other than the class in which it is defined, the __init__ method of that class is not called. This is how subclasses of the ndarray class are able to return views that preserve the class type. When taking a view, the standard ndarray machinery creates the new ndarray object with something like: obj = ndarray.__new__(subtype, shape, ... where subdtype is the subclass. Thus the returned view is of the same class as the subclass, rather than being of class ndarray. That solves the problem of returning views of the same type, but now we have a new problem. The machinery of ndarray can set the class this way, in its standard methods for taking views, but the ndarray __new__ method knows nothing of what we have done in our own __new__ method in order to set attributes, and so on. (Aside - why not call obj = subdtype.__new__(... then? Because we may not have a __new__ method with the same call signature). _ that already exists, casts as our type, and adds an extra attribute. import numpy as np class RealisticInfoArray(np.ndarray): def __new__(cls, input_array, info=None): # Input array is an already formed ndarray instance # We first cast to be our class type obj = np.asarray(input_array).view(cls) # add the new attribute to the created instance obj.info = info # Finally, we must return the newly created object: return obj def __array_finalize__(self, obj): # In general, if the array owns its own memory, as for arr in this case, then arr.base will be None - there are some exceptions to this - see the numpy book for more details. The base attribute is useful in being able to tell whether we have a view or the original array. This in turn can be useful if we need to know whether or not to do some specific cleanup when the subclassed array is deleted. For example, we may only want to do the cleanup if the original array is deleted, but not the views. For an example of how this can work, have a look at the memmap class in numpy.core.
http://docs.scipy.org/doc/numpy-1.5.x/user/basics.subclassing.html
CC-MAIN-2015-27
refinedweb
777
66.98
#include <SPI.h>#include "nRF24L01.h"#include "RF24.h"#include "printf.h"//// Hardware configuration//// Set up nRF24L01 radio on SPI bus plus pins 9 & 10RF24 radio(9,10);// sets the role of this unit in hardware. Connect to GND to be the 'led' board receiver// Leave open to be the 'remote' transmitterconst int role_pin = A4;// Pins on the remote for buttonsconst uint8_t button_pins[] = { 2,3,4,5,6,7 };const uint8_t num_button_pins = sizeof(button_pins);// Pins on the LED board for LED'sconst uint8_t led_pins[] = { 2,3,4,5,6,7 };const uint8_t num_led_pins = sizeof(led_pins); I'm trying out various tutorials on the nRF24L01 transceivers but in 99% of them, how to hook up the pins are hardly ever explained. Being a newbie, I'm a bit lost. Is it assumed that all the pins on the nRF24L01 are hooked up to the same corresponding pins on the Arduino (e.g. MOSI, MISO, SCK) but what about the CSN, CE and IRQ pins across all libraries for this transceiver? I'm assuming MOSI goes > MOSI, MISO > MISO, SCK > SCK, but what about the other pins? In the setup, it specifies RF24 radio(9,10); are these for CSN and CE? If so, which pin is which? Please enter a valid email to subscribe We need to confirm your email address. To complete the subscription, please click the link in the Thank you for subscribing! Arduino via Egeo 16 Torino, 10131 Italy
http://forum.arduino.cc/index.php?topic=116937.msg879932
CC-MAIN-2016-07
refinedweb
241
68.7
0 I tried to search for other threads to answer my question but couldnt come up with anything that I could think of to describe what I was looking for well. My assignment is this: Write an application that shows the sum of 1 to n for every n from 1 to 50. That is, the program prints 1 (the sum of 1 alone), 3 (the sum of 1 and 2), 6 (the sum of 1, 2, and 3), 10 (the sum of 1, 2, 3, and 4), and so on. This is what I have so far but I cant seem to figure it out. I keep getting different ways to get the total of adding the numbers 1 through 50 (1276). // EverySum.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> #include<conio.h> using namespace std; int main() { int n = 1; int count; for(count = 1; count <= 50; ++count) n = n + count; cout<<n<<endl; getche(); }
https://www.daniweb.com/programming/software-development/threads/175305/c-assignment
CC-MAIN-2018-13
refinedweb
164
85.52
Futures alternatives and similar libraries Based on the "Concurrency" category Hydra8.2 2.9 L5 Futures VS HydraPromises & Await Venice7.9 0.0 L5 Futures VS VeniceCommunicating sequential processes (CSP) for Swift 2 (Linux ready). Overdrive6.3 0.0 L5 Futures VS OverdriveFast async task based API in Swift with focus on type safety, concurrency and multi threading. Kommander3.2 1.5 Futures VS KommanderManage the task execution in different threads through Kommands. SwiftCoroutine2.7 8.8 Futures VS SwiftCoroutineCoroutines for iOS and macOS. AsyncNinja2.6 6.9 Futures VS AsyncNinjaA complete set of concurrency and reactive programming primitives. Threadly1.7 0.0 Futures VS ThreadlyType-safe thread-local storage. GroupWork1.0 0.0 Futures VS GroupWorkEasy concurrent, asynchronous tasks. Futura0.9 5.9 Futures VS FuturaAsync tools for Swift * Code Quality Rankings and insights are calculated and provided by Lumnify. They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details. Do you think we are missing an alternative of Futures or a related project? Popular Comparisons README Futures In many promise frameworks, a promise is undistinguished from a future. This introduces mutability of a promise that gets passed around. In Futures, always(), to execute a Voidreturning future regardless of whether the current future is rejected or resolved defer(), to execute a Voidreturning closure.4.0") ] Or, add a dependency in your Cartfile: github "formbound/Futures" More details on using Carthage can be found here. Lastly, import the module in your Swift files import Futures
https://swift.libhunt.com/futures-alternatives
CC-MAIN-2020-10
refinedweb
254
50.02
A method lookup tool Posted on March 1st, 2001 Chapter 11 introduced the Java 1.1 concept of reflection and used that feature to look up methods for a particular class – either the entire list of methods or a subset of those whose names match a keyword you provide. The magic of this is that it can automatically show you all the methods for a class without forcing you to walk up the inheritance hierarchy examining the base classes at each level. Thus, it provides a valuable timesaving tool for programming: because the names of most Java method names are made nicely verbose and descriptive, you can search for the method names that contain a particular word of interest. When you find what you think you’re looking for, check the online documentation. However, by Chapter 11 you hadn’t seen the AWT, so that tool was developed as a command-line application. Here is the more useful GUI version, which dynamically updates the output as you type and also allows you to cut and paste from the output: //: DisplayMethods.java // Display the methods of any class inside // a window. Dynamically narrows your search. import java.awt.*; import java.awt.event.*; import java.applet.*; import java.lang.reflect.*; import java.io.*; public class DisplayMethods extends Applet { Class cl; Method[] m; Constructor[] ctor; String[] n = new String[0]; TextField name = new TextField(40), searchFor = new TextField(30); Checkbox strip = new Checkbox("Strip Qualifiers"); TextArea results = new TextArea(40, 65); public void init() { strip.setState(true); name.addTextListener(new NameL()); searchFor.addTextListener(new SearchForL()); strip.addItemListener(new StripL()); Panel top = new Panel(), lower = new Panel(), p = new Panel(); top.add(new Label("Qualified class name:")); top.add(name); lower.add( new Label("String to search for:")); lower.add(searchFor); lower.add(strip); p.setLayout(new BorderLayout()); p.add(top, BorderLayout.NORTH); p.add(lower, BorderLayout.SOUTH); setLayout(new BorderLayout()); add(p, BorderLayout.NORTH); add(results, BorderLayout.CENTER); } class NameL implements TextListener { public void textValueChanged(TextEvent e) { String nm = name.getText().trim(); if(nm.length() == 0) { results.setText("No match"); n = new String[0]; return; } try { cl = Class.forName(nm); } catch (ClassNotFoundException ex) { results.setText("No match"); return; } m = cl.getMethods(); ctor = cl.getConstructors(); // Convert to an array of Strings: n = new String[m.length + ctor.length]; for(int i = 0; i < m.length; i++) n[i] = m[i].toString(); for(int i = 0; i < ctor.length; i++) n[i + m.length] = ctor[i].toString(); reDisplay(); } } void reDisplay() { // Create the result set: String[] rs = new String[n.length]; String find = searchFor.getText(); int j = 0; // Select from the list if find exists: for (int i = 0; i < n.length; i++) { if(find == null) rs[j++] = n[i]; else if(n[i].indexOf(find) != -1) rs[j++] = n[i]; } results.setText(""); if(strip.getState() == true) for (int i = 0; i < j; i++) results.append( StripQualifiers.strip(rs[i]) + "\n"); else // Leave qualifiers on for (int i = 0; i < j; i++) results.append(rs[i] + "\n"); } class StripL implements ItemListener { public void itemStateChanged(ItemEvent e) { reDisplay(); } } class SearchForL implements TextListener { public void textValueChanged(TextEvent e) { reDisplay(); } } public static void main(String[] args) { DisplayMethods applet = new DisplayMethods(); Frame aFrame = new Frame("Display Methods"); aFrame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); aFrame.add(applet, BorderLayout.CENTER); aFrame.setSize(500,750); applet.init(); applet.start(); aFrame.setVisible(true); } } class StripQualifiers { private StreamTokenizer st; public StripQualifiers(String qualified) { st = new StreamTokenizer( new StringReader(qualified)); st.ordinaryChar(' '); }; } } ///:~ Some things you’ve seen before. As with many of the GUI programs in this book, this is created to perform both as an application and as an applet. Also, the StripQualifiers class is exactly the same as it was in Chapter 11. The GUI contains a TextField name in which you can enter the fully-qualified class name you want to look up, and another one, searchFor, in which you can enter the optional text to search for within the list of methods. The Checkbox allows you to say whether you want to use the fully-qualified names in the output or if you want the qualification stripped off. Finally, the results are displayed in a TextArea. You’ll notice that there are no buttons or other components by which to indicate that you want the search to start. That’s because both of the TextFields and the Checkbox are monitored by their listener objects. Whenever you make a change, the list is immediately updated. If you change the text within the name field, the new text is captured in class NameL . If the text isn’t empty, it is used inside Class.forName( ) to try to look up the class. As you’re typing, of course, the name will be incomplete and Class.forName( ) will fail, which means that it throws an exception. This is trapped and the TextArea is set to “No match”. But as soon as you type in a correct name (capitalization counts), Class.forName( ) is successful and getMethods( ) and getConstructors( ) will return arrays of Method and Constructor objects, respectively. Each of the objects in these arrays is turned into a String via toString( ) (this produces the complete method or constructor signature) and both lists are combined into n, a single String array. The array n is a member of class DisplayMethods and is used in updating the display whenever reDisplay( ) is called. If you change the Checkbox or searchFor components, their listeners simply call reDisplay( ). reDisplay( ) creates a temporary array of String called rs (for “result set”). The result set is either copied directly from n if there is no find word, or conditionally copied from the Strings in n that contain the find word. Finally, the strip Checkbox is interrogated to see if the user wants the names to be stripped (the default is “yes”). If so, StripQualifiers.strip( ) does the job; if not, the list is simply displayed. In init( ), you might think that there’s a lot of busy work involved in setting up the layout. In fact, it is possible to lay out the components with less work, but the advantage of using BorderLayouts this way is that it allows the user to resize the window and make – in particular – the TextArea larger, which means you can resize to allow you to see longer names without scrolling. You might find that you’ll keep this tool running while you’re programming, since it provides one of the best “first lines of attack” when you’re trying to figure out what method to call. There are no comments yet. Be the first to comment!
http://www.codeguru.com/java/tij/tij0186.shtml
CC-MAIN-2015-18
refinedweb
1,105
57.27
Working of a remote file server: troubles & fixes - mathieu-christe last edited by gferreira If you're storing your UFOs files on a server, depending on the protocol, you can experience lags. Here's Andy Clymer's explanations and tips with help from Frederik: The real solution is to try to connect with a different protocol, if possible. We were able to get a file server set up so that we could connect with Samba ( smb://) or with CIFS which is a variation of Samba ( cifs://) If it’s just another Mac that you’re connecting to, in the “Network” area of the System Preferences, you can choose to “Share files and folders using SMB” which will let you connect with smb://. If you’re only able to connect with AFP, Frederik was able to help us to get RoboFont to ignore the messages from the OS that the file had changed, like so: from lib.tools.defaults import setDefault setDefault("enableExternalFileCheck", False) And then set that preference back to Trueif you ever want to go back to the default way that things work. Just watch out that if you turn off external file checking, RoboFont will no longer automatically see any changes to external files even in cases where you want it to (like, if you make an edit in Prepolator or MetricsMachine, and then switch back into RoboFont). You will want to have a script that you can use to manually check for updates, Frederik helped us out with this too: from AppKit import NSApp for doc in NSApp().orderedUFODocuments(): doc.setNeedsExternalChangeCheck_(True) NSApp().testForDocumentUpdates() So it’s not an ideal workaround, but it stops the beachballs! It’s more ideal to try to see if you can get your file server set up to work with a different protocol. Last update from Frederik (20.05.2015): you could also subscribe to the applicationDidBecomeActivenotification and run this script this would be almost the same behaviour as the embedded file update checker.... from AppKit import NSApp for doc in NSApp().orderedUFODocuments(): doc.setNeedsExternalChangeCheck_(True) NSApp().testForDocumentUpdates()
https://forum.robofont.com/topic/381/working-of-a-remote-file-server-troubles-fixes
CC-MAIN-2020-40
refinedweb
347
52.43