City Cop (1995) also known as Public Servant II
Or under the Cantonese title Gong Pu II
Reviewed By Ralph "Leechboy" Beard
Directed by Herman Yau
Written by Anna Lee
Starring=20
Michael 'Rambo' Chow as Michael 'Rambo' Chow
Ben Ng as Brother Ng
Parkman Wong as Inspector Wong
Danny Lee as Inspector Lee (Do you see a pattern here?)
Rating: 7.5 out of ten or ** 1/2 stars out of 5 (You decide)
PLOT SYNOPSIS: Two cops of contrasting ages and policing styles are partnered up to catch a ruthless Jewel heist gang. Much zaniness ensues
There's something strangely heart warming about finding out that cop movie cliches can apply anywhere, all over the world. Hotheaded cops are always teamed with by-the book veterans, they will grudgingly become friends and when a chase scene comes, some poor street vendor will always have his cart or boxes in the way. It's a given, and, let me point this out now, City Cop does not stray from this tried and true formula. Of course, there is the wonderful Hong Kong exception to the worldwide rules of action flicks, that allows us the uncertainty of whether our hero(s) will survive past the final scenes. And, without giving too much away, this does fall into that category too. Yet for some reason, I just don't feel like I'm doing this flick justice by calling it well made, but unexceptional.
Just about everyone does a better than average job, the exceptions? Well, Michael "Rambo" Chow doesn't live up to his nickname. He just doesn't have the kind of screen charisma to pull off the hotheaded cop. When his character does his life endangering stunts, it doesn't come across as something his character would do naturally. Ironically, the guy with the charisma to play that role is City Cop's villain, the ruthless and brazen jewellery store robber Brother Ng (Ben Ng). When Ng appears on screen, you take notice. When he interrupts his getaway from one heist so he can go back and shoot the guy calling for help, you know that's something he'd do. It's a dynamite performance, and I'm looking forward to watching Ng in some other flicks soon.
As for the others, Parkman Wong is fine as the by the book cop. But unsurprisingly it's Danny Lee (Who is also the producer) who's the scene-stealer. He and Wong's scenes together are far more interesting, and better written, than those between Wong and Chow.20
Technically, the film is okay, apart from a score that seems to be made up of production cd tracks, and, what at one point seems to be the music from Duke 3D. Director Herman Yow keeps things moving along nicely, (Though he does seem to be overly fond of doing a left to right tracking shot while two characters talk to each other) and the action scenes have a chaotic quality that is miles away from the vicious ballet of John Woo. Even when a main character dies, he spends little time focusing on it, and gets on with the action, good move. What Yow has working against him is the unremarkable plotline and paint by number characters, but hell, I'm not going to penalise anyone for unoriginality.
The Verdict? City Cop is better than average Lethal Weapon-style flick that I would gladly pick up again.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- layout: page title: About Me description: This is what I do. background: '/img/bg-about.jpg' ---
Machine Learning, Robotics, Artificial Intelligence, Computer Vision, Astronomy and Photography intrigue me. Apart from these, I enjoy reading books and hiking. Collecting currencies of different countries is also one of my hobbies. I am also fond of eating at different places.


This class is designed to be subclassed to represent any collection of related panels. This could be panels that resize relative to each other, or even just panels that will be shown and hidden as one unit.
More...
|
| | Screen () |
| | Constructor. More...
|
| |
| void | Show () |
| | Simply calls all panel's show functions, if the screens are not already showing. More...
|
| |
| void | Hide () |
| | Calls all panel's hide functions, if the screen is not already hidden. More...
|
| |
|
| static ResizeCalc | SizeC (int size) |
| | Returns a resising delegate that always returns the size specified. Ex., SizeC(10) returns you a function that always returns 10. More...
|
| |
| static ResizeCalc | WidthMinus (int subtract) |
| | Returns a resizing delegate that returns the width of the root console, minus a specific value. Ex,. WidthMinus(10) returns you a function that will return Engine.RootConsole.Width - 10 More...
|
| |
| static ResizeCalc | HeightMinus (int subtract) |
| | Returns a resizing delegate that returns the height of the root console, minus a specific value when it is called. Ex,. HeightMinus(10) returns you a function that will return Engine.RootConsole.Height - 10. More...
|
| |
| static ResizeCalc | HalfWidth () |
| | Returns a resizing delegate that returns exactly half the width of the root console when it is called. More...
|
| |
| static ResizeCalc | HalfHeight () |
| | Returns a resizing delegate that returns exactly half the height of the root console when it is called. More...
|
| |
|
| void | addPanel (Panel panel) |
| | Adds the panel to a list that keeps track of all panels that are part of this screen. This MUST be called from subclass's constructor when a new panel is created in order for show and hide to work properly. More...
|
| |
| void | removePanel (Panel panel) |
| | Removes a panel from an internal list. Should a panel ever cease to be part of a screen, this function must be called at that time. More...
|
| |
|
| bool | Shown [get] |
| | Whether or not the screen's panels are to be rendered (shown) or not. call Show and Hide to change this. More...
|
| |
This class is designed to be subclassed to represent any collection of related panels. This could be panels that resize relative to each other, or even just panels that will be shown and hidden as one unit.
§ Screen()
§ addPanel()
| void WinMan.Screen.addPanel |
( |
Panel |
panel | ) |
|
|
protected |
Adds the panel to a list that keeps track of all panels that are part of this screen. This MUST be called from subclass's constructor when a new panel is created in order for show and hide to work properly.
- Parameters
-
| panel | The panel to add to the list. |
§ HalfHeight()
Returns a resizing delegate that returns exactly half the height of the root console when it is called.
- Returns
- A lambda function that will return exactly half the root console's height.
§ HalfWidth()
Returns a resizing delegate that returns exactly half the width of the root console when it is called.
- Returns
- A lambda function that will return exactly half the root console's width.
§ HeightMinus()
| static ResizeCalc WinMan.Screen.HeightMinus |
( |
int |
subtract | ) |
|
|
static |
Returns a resizing delegate that returns the height of the root console, minus a specific value when it is called. Ex,. HeightMinus(10) returns you a function that will return Engine.RootConsole.Height - 10.
- Parameters
-
| subtract | Amount to subtract from the root console's width. |
- Returns
- A lambda function that will return the root console's height, subtract the specified value when it is called.
§ Hide()
| void WinMan.Screen.Hide |
( |
| ) |
|
Calls all panel's hide functions, if the screen is not already hidden.
§ removePanel()
| void WinMan.Screen.removePanel |
( |
Panel |
panel | ) |
|
|
protected |
Removes a panel from an internal list. Should a panel ever cease to be part of a screen, this function must be called at that time.
- Parameters
-
| panel | The panel that is no longer part of the screen. |
§ Show()
| void WinMan.Screen.Show |
( |
| ) |
|
Simply calls all panel's show functions, if the screens are not already showing.
§ SizeC()
Returns a resising delegate that always returns the size specified. Ex., SizeC(10) returns you a function that always returns 10.
- Parameters
-
| size | The size for the generated lambda function to always return. |
- Returns
- A lambda function that always returns the integer size specified.
§ WidthMinus()
| static ResizeCalc WinMan.Screen.WidthMinus |
( |
int |
subtract | ) |
|
|
static |
Returns a resizing delegate that returns the width of the root console, minus a specific value. Ex,. WidthMinus(10) returns you a function that will return Engine.RootConsole.Width - 10
- Parameters
-
| subtract | Amount to subtract from the root console's width. |
- Returns
- A lambda function that will return the root console's width, subtract the specified value when it is called.
§ Shown
Whether or not the screen's panels are to be rendered (shown) or not. call Show and Hide to change this.
The documentation for this class was generated from the following file:


Golden Child tease preview of 'She's My Girl' from upcoming 'RE:BOOT' album
by germainejGolden Child have revealed a preview of "She's My Girl" from their upcoming album 'RE:BOOT'!
"She's My Girl" is a dance track with a powerful, '80s sound, and members Jangjun and Tag have taken part in writing the lyrics. Golden Child's 'RE:BOOT' drops on November 18 KST!
What do you think of Golden Child's latest music trailer?


The previous two chapters discussed how Java's architecture deals with the two major challenges presented to software developers by a networked computing environment. Platform independence deals with the challenge that many different kinds of computers and devices are usually connected to the same network. The sandbox security model deals with the challenge that networks represent a convenient way to transmit viruses and other forms of malicious code. This chapter describes not how Java's architecture deals with a challenge, but how it seizes an opportunity made possible by the network. 总结前面两章讲了什么，这一章要讲什么。前两章是面对“challenge”，这一章是抓住“opportunity”。
One of the fundamental reasons Java is a useful tool for networked software environments is that Java's architecture enables the network mobility of software. In fact, it was primarily this aspect of Java technology that was considered by many in the software industry to represent a paradigm shift. This chapter examines the nature of this new paradigm of network-mobile software, and how Java's architecture makes it possible. network mobility of software --> paradigm shift
Prior to the advent of the personal computer, the dominant computing model was the large mainframe computer serving multiple users.  Software applications were stored on disks attached to the mainframe computer, allowing multiple users to share the same applications while they shared the same CPU. A drawback of this model was that if one user ran a CPU- intensive job, all other users would experience degraded performance. mainframe computer：在personal computer出现之前，是mainframe computer的主流市场
The appearance of the microprocessor led to the proliferation of the personal computer. This change in the hardware status quo changed the software paradigm as well. Rather than sharing software applications stored at a mainframe computer, individual users had individual copies of software applications stored at each personal computer. Because each user ran software on a dedicated CPU, this new model of computing addressed the difficulties of dividing CPU-time among many users attempting to share one mainframe CPU. microprocessor --> personal computer
Initially, personal computers operated as unconnected islands of computing. The dominant software model was of isolated executables running on isolated personal computers. But soon, personal computers began to be connected to networks. Because a personal computer gave its user undivided attention, it addressed the CPU-time sharing difficulties of mainframes. But unless personal computers were connected to a network, they couldn't replicate the mainframe's ability to let multiple users view and manipulate a central repository of data. personal computer --> network
As personal computers connected to networks became the norm, another software model began to increase in importance: client/server. The client/server model divided work between two processes running on two different computers: a client process ran on the end-user's personal computer, and a server process ran on some other computer hooked to the same network. The client and server processes communicated with one another by sending data back and forth across the network. The server process often simply accepted data query commands from clients across the network, retrieved the requested data from a central database, and sent the retrieved data back across the network to the client. Upon receiving the data, the client processed, displayed, and allowed the user to manipulate the data. This model allowed users of personal computers to view and manipulate data stored at a central repository, while not forcing them to share a central CPU for all of the processing of that data. Users did share the CPU running the server process, but to the extent that data processing was performed by the clients, the burden on the central CPU hosting the server process was lessened. personal computer --> network --> client/server
The client/server architecture was soon extended to include more than two processes. The original client/server model began to be called 2-tier client/server, to indicate two processes: one client and one server. More elaborate architectures were called 3-tier, to indicate three processes, 4-tier, to indicate four processes, or N-tier, to indicate people were getting tired of counting processes. Eventually, as more processes became involved, the distinction between client and server blurred, and people just started using the term distributed processing to encompass all of these schemes. client/server(2-tier) --> 3-tier --> 4-tier --> N-tier --> distributed processing
The distributed processing model leveraged the network and the proliferation of processors by dividing processing work loads among many processors while allowing those processors to share data. Although this model had many advantages over the mainframe model, there was one notable disadvantage: distributed processing systems were more difficult to administer than mainframe systems. On mainframe systems, software applications were stored on a disk attached to the mainframe. Even though an application could serve many users, it only needed to be installed and maintained in one place. When an application was upgraded, all users got the new version the next time they logged on and started the application. By contrast, the software executables for different components of a distributed processing system were usually stored on many different disks. In a client/server architecture, for example, each computer that hosted a client process usually had its own copy of the client software stored on its local disk. As a result, a system administrator had to install and maintain the various components of a distributed software system in many different places. When a software component was upgraded, the system administrator had to physically upgrade each copy of the component on each computer that hosted it. As a result, system administration was more difficult for the distributed processing model than for the mainframe model. distributed processing systems were more difficult to administer
The arrival of Java, with an architecture that enabled the network-mobility of software, heralded yet another model for computing. Building on the prevailing distributed processing model, the new model added the automatic delivery of software across networks to computers that ran the software. This addressed the difficulties involved in system administration of distributed processing systems. For example, in a client/server system, client software could be stored at one central computer attached to the network. Whenever an end-user needed to use the client software, the binary executable would be sent from the central computer across the network to the end-user's computer, where the software would run. Java --> network-mobility of software --> addressed the difficulties
So network-mobility of software represented another step in the evolution of the computing model. In particular, it addressed the difficulty of administering a distributed processing system. It simplified the job of distributing any software that was to be used on more than one CPU. It allowed data to be delivered together with the software that knows how to manipulate or display the data. Because code was sent along with data, end-users would always have the most up-to-date version of the code. Thus, because of network-mobility, software can be administered from a central computer, reminiscent of the mainframe model, but processing can still be distributed among many CPUs. Java --> network-mobility of software --> data + software
The shift away from the mainframe model towards the distributed processing model was a consequence of the personal computer revolution, which was made possible by the rapidly increasing capabilities and decreasing costs of processors. Similarly, lurking underneath the latest software paradigm shift towards distributed processing with network-mobile code is another hardware trend--the increasing capabilities and decreasing costs of network bandwidth. As bandwidth, the amount of information that can be carried by a network, increases, it becomes practical to send new kinds of information across a network; and with each new kind of information a network carries, the network takes on a new character. Thus, as bandwidth grows, simple text sent across a network can become enhanced with graphics, and the network begins to take on an appearance reminiscent of newspapers or magazines. Once bandwidth expands enough to support live streams of audio data, the network begins to act like a radio, a CD-player, or a telephone. With still more bandwidth, video becomes possible, resulting in a network that competes with TV and VCRs for the attention of couch potatoes. But there is still one other kind of bandwidth-hungry content that becomes increasingly practical as bandwidth improves: computer software. Because networks by definition interconnect processors, one processor can, given enough bandwidth, send code across a network for another processor to execute. Once networks begin to move software as well as data, the network begins to look like a computer in its own right. software paradigm shift <-- hardware trend: the increasing capabilities and decreasing costs of network bandwidth
As software begins to travel across networks, not only does the network begin to take on a new character, but so does the software itself. Network-mobile code makes it easier to ensure that an end-user has the necessary software to view or manipulate some data sent across the network, because the software can be sent along with the data. In the old model, software executables from a local disk were invoked to view data that came across the network, thus the software application was usually a distinct entity, easily discernible from the data. In the new model, because software and data are both sent across the network, the distinction between software and data is not as stark--software and data blur together to become "content." 在网络中传输的是不只是data，还有software，这让data和software两者之间的界线变得模糊。
As the nature of software evolves, the end-user's relationship to software evolves as well. Prior to network-mobility, an end-user had to think in terms of software applications and version numbers. Software was generally distributed on media such as tapes, floppy disks, or CD-ROMs. To use an application, an end-user had to get the installation media, physically insert them into a drive or reader attached to the computer, and run an installation program that copied files from the installation media to the computer's hard disk. Moreover, the end-user often did this process multiple times for each application, because software applications were routinely replaced by new versions that fixed old bugs and added new features (and usually added new bugs too). When a new version was released, end-users had to decide whether or not to upgrade. If an end-user decided to upgrade, the installation process had to repeated. Thus, end-users had to think in terms of software applications and version numbers, and take deliberate action to keep their software applications up-to-date. 在network-mobility of software出现之前，用户要手动管理自己的软件。
In the new model, end-users think less in terms of software applications with discrete versions, and more in terms of self-evolving "content services." Whereas installing a traditional software application or an upgrade was a deliberate act on the part of the end-user, network-mobility of software enables installation and upgrading that is more automatic. Network-delivered software need not have discrete version numbers that are known to the end-user. The end-user need not decide whether to upgrade, and need not take any special action to upgrade. Network-delivered software can just evolve of its own accord. Instead of buying discrete versions of a software application, end-users can subscribe to a content service--software that is delivered across a network along with relevant data--and watch as both the software and data evolve automatically over time. 在network-mobility of software出现之后，用户则不需要关注软件的安装问题。
Once you move away from delivering software in discrete versions towards delivering software as self-evolving streams of interactive content, your end-user loses some control. In the old model, if a new version appeared that had serious bugs, an end-user could simply opt not to upgrade. But in the new model, an end-user can't necessarily wait until the bugs are worked out of a new version before upgrading to the new version, because the end-user may have no control over the upgrading process. 在network-mobility of software出现之后，用户对于软件的使用版本失去了一定控制权。
For certain kinds of products, especially those that are large and full-featured, end-users may prefer to retain control over whether and when to upgrade. Consequently, in some situations software vendors may publish discrete versions of a content service over the network. At the very least, a vendor can publish two branches of a service: a beta branch and a released branch. End-users that want to stay on the bleeding edge can subscribe to the beta service, and the rest can subscribe to the released service that, although it may not have all the newest features, is likely more robust. a vendor can publish two branches of a service: a beta branch and a released branch.
Yet for many content services, especially simple ones, most end-users won't want to have to worry about versions, because worrying about versions makes software harder to use. The end-user has to have knowledge about the differences between versions, make decisions about when and if to upgrade, and take deliberate action to cause an upgrade. Content services that are not chopped up into discrete versions are easier to use, because they evolve automatically. Such a content service, because the end-user doesn't have to maintain it but can just simply use it, takes on the feel of a "software appliance." 在许多场景下，用户不需要关心软件的版本
Many self-evolving content services will share two fundamental characteristics with common household appliances: a focused functionality and a simple user-interface. Consider the toaster. A toaster's functionality is focused exclusively on the job of preparing toast, and it has a simple user-interface. When you walk up to a toaster, you don't expect to have to read a manual. You expect to put the bread in at the top and push down a handle until it clicks. You expect to be able to peer in and see orange wires glowing, and after a moment, to hear that satisfying pop and see your bread transformed into toast. If the result is too light or too dark, you expect to be able to slide a knob to indicate to the toaster that the next time, you want your toast a bit darker or lighter. That's the extent of the functionality and user-interface of a toaster. Likewise, the functionality of many content services will be as focused and the user-interface will be as simple. If you want to order a movie through the network, for example, you don't want to worry whether you have the correct version of movie-ordering software. You don't want to have to install it. You just want to switch on the movie-ordering content service, and through a simple user-interface, order your movie.  If you look at an HTML file, it looks like a source file for some kind of program. But if you see the browser as the program, the HTML file looks more like data. Thus, the distinction between code and data is blurred. Also, people who browse the World Wide Web expect web pages to evolve over time, without any deliberate action on their part. They don't expect to see discrete version numbers for web pages. They don't expect to have to do anything to upgrade to the latest version of a page besides simply revisiting the page in their browser. 这里举了content service的例子：World Wide Web
In the coming years, many of today's media may to some extent be assimilated by the network and transformed into content services. (As with the Borg from Star Trek, resistance is futile.) Broadcast radio, broadcast and cable TV, telephones, answering machines, faxes, video rental stores, newspapers, magazines, books, computer software--all of these will be affected by the proliferation of networks. But just as TV didn't supplant radio entirely, content services will not entirely supplant existing media. Instead, content services will likely take over some aspects of existing media, leaving the existing media to adjust accordingly, and create some new forms that didn't previously exist. 更多形式的media被放到network中，形成content services
In the computer software domain, the content service model will not completely replace the old models either. Instead, it will likely take over certain aspects of the old models that fit better in the new model, add new forms that didn't exist before, and leave the old models to adjust their focus slightly in light of the newcomer. content service并不会代替传统的media形式，传统的media形式也会做出相应的调整
This book is an example of how the network can affect existing media. The book was not entirely replaced by a content service counterpart, but instead of including resource pointers (sources where you can find further information on topics presented in the book) as part of the book, they were placed on a web page. Because resource pointers change so often, it made sense to let the network assimilate that part of the book. Thus, the resource pointers portion of the book has become a content service. 这里又举一个例子
The crux of the new software paradigm, therefore, is that software begins to act more like appliances. End-users no longer have to worry about installation, version numbers, or upgrading. As code is sent along with data across the network, software delivery and updating become automatic. In this way, simply by making code mobile, Java unleashes a whole new way to think about software development, delivery, and use. the new software paradigm --> 用户不需要再去考虑软件的安装、升级
Java's architectural support for network-mobility begins with its support for platform independence and security. Although they are not strictly required for network-mobility, platform independence and security help make network-mobility practical. Platform independence makes it easier to deliver a program across the network because you don't have to maintain a separate version of the program for different platforms, and you don't have to figure out how to get the right version to each computer. One version of a program can serve all computers. Java's security features help promote network-mobility because they give end-users confidence to download class files from untrusted sources. In practice, therefore, Java's architectural support for platform independence and security facilitate the network-mobility of its class files. platform independence and security促进了network-mobility
Beyond platform independence and security, Java's architectural support for network-mobility is focused on managing the time it takes to move software across a network. If you store a program on a server and download it across a network when you need it, it will likely take longer for your program to start than if you had started the same program from a local disk. Thus, one of the primary issues of network-mobile software is the time it takes to send a program across a network. Java's architecture addresses this issue by rejecting the traditional monolithic binary executable in favor of small binary pieces: Java class files. Class files can travel across networks independently, and because Java programs are dynamically linked and dynamically extensible, an end-user needn't wait until all of a program's class files are downloaded before the program starts. The program starts when the first class file arrives. Class files themselves are designed to be compact, so that they fly more quickly across networks. Therefore, the main way Java's architecture facilitates network-mobility directly is by breaking up the monolithic binary executable into compact class files, which can be loaded as needed. 除了platform independence and security，Java还注重网络数据传输过程中消耗的时间
The execution of a Java application begins at a main()
method of some class,
and other classes are loaded and dynamically linked as they are needed by the application.
If a class is never actually used during one session, that class won't ever be loaded during that session.
For example, if you are using a word processor that has a spelling checker,
but during one session you never invoke the spelling checker,
the class files for the spelling checker will not be loaded during that session.
Java application加载过程中，只加载需要使用到的类，这就是dynamic linking。
In addition to dynamic linking, Java's architecture also enables dynamic extension. Dynamic extension is another way the loading of class files (and the downloading of them across a network) can be delayed in a Java application. Using class loader objects, a Java program can load extra classes at run-time, which then become a part of the running program. Therefore, dynamic linking and dynamic extension give a Java programmer some flexibility in designing when class files for a program are loaded, and as a result, how much time an end-user must spend waiting for class files to come across the network. Java's architecture支持dynamic linking和dynamic extension。
Besides dynamic linking and dynamic extension, another way Java's architecture directly supports network mobility is through the class file format itself. To reduce the time it takes to send them across networks, class files are designed to be compact. In particular, the bytecode streams they contain are designed to be compact. They are called "bytecodes" because each instruction occupies only one byte. With only two exceptions, all opcodes and their ensuing operands are byte aligned to make the bytecode streams smaller. The two exceptions are opcodes that may have one to three bytes of padding after the opcode and before the start of the operands, so that the operands are aligned on word boundaries. Other than the two opcodes that may have a small amount of padding, all data in a class file is byte aligned. class file format --> network mobility
One of the implications of the compactness goal for class files is that Java compilers are not likely to do any local optimization. Because of binary compatibility rules, Java compilers can't perform global optimizations such as inlining the invocation of another class's method. (Inlining means replacing the method invocation with the code performed by the method, which saves the time it takes to invoke and return from the method as the code executes.) Binary compatibility requires that a method's implementation can be changed without breaking compatibility with pre-existing class files that depend on the method. Inlining could be performed in some circumstances on methods within a single class, but in general that kind of optimization is not done by Java compilers, partly because it goes against the grain of class file compactness. Optimizations are often a tradeoff between execution speed and code size. Therefore, Java compilers generally leave optimization up to the Java Virtual Machine, which can optimize code as it loads classes for interpreting or just-in-time compiling. class file --> compactness --> no optimization
Beyond the architectural features of dynamic linking, dynamic extension and class file compactness, there are some strategies that, although they are really not necessarily part of the architecture, help manage the time it takes to move class files across a network. Because HTTP protocols require that each class file of Java applet be requested individually, it turns out that often a large percentage of applet download time is due not to the actual transmission of class files across the network, but to the network handshaking of each class file request. The overhead for a file request is multiplied by the number of class files being requested. To address this problem, Java 1.1 included support for JAR (Java ARchive) files. JAR files enable many class files to be sent in one network transaction, which greatly reduces the overhead time required to move class files across a network compared with sending one class file at a time. Moreover, the data inside a JAR file can be compressed, which results in an even shorter download time. So sometimes it pays to send software across a network in one big chunk. If a set of class files is definitely needed by a program before that program can start, those class files can be more speedily transmitted if they are sent together in a JAR file. 为了加快网络的传输速度，可以将多个class文件打成jar包
One other strategy to minimize an end-user's wait time is to not download class files on-demand. Through various techniques, such as the subscription model used by Marimba Castanet, class files can be downloaded before they are needed, resulting in a program that starts up faster. You can obtain more information about Castanet's model from the resource page for this chapter. 另一种策略，Castanet's model
Therefore, other than platform independence and security, which help make network-mobility practical, the main focus of Java's architectural support for network-mobility is managing the time it takes to send class files across a network. Dynamic linking and dynamic extension allow Java programs to be designed in small functional units that are downloaded as needed by the end-user. Class file compactness helps reduce the time it takes to move a Java program across the network. The JAR file enables compression and the sending of multiple class files across the network in a single network file-transfer transaction. network-mobility = dynamic linking + dynamic extension + class file compactness + jar file
Java is a network-oriented technology that first appeared at a time when the network was looking increasingly like the next revolution in computing. The reason Java was adopted so rapidly and so widely, however, was not simply because it was a timely technology, but because it had timely marketing. Java was not the only network-oriented technology being developed in the early to mid 1990s. And although it was a good technology, it wasn't the necessarily the best technology--but it probably had the best marketing. Java was the one technology to hit a slim market window in early 1995, resulting in such a strong response that many companies developing similar technologies canceled their projects, including Microsoft, which canceled a project code-named Blackbird. Companies that carried on with their technologies, such as AT&T did with a network-oriented technology named Inferno, saw Java steal much of their potential thunder. Java迅速发展起来，和当时的市场环境也有关系；Java也并不一定是最好的技术，它只是占得了先机。
There were several important factors in how Java was initially unleashed on the world that contributed to its successful marketing. First, it had a cool name--one that could be appreciated by programmers and non-programmers alike. Second, it was, for all practical purposes, free--always a strong selling point among prospective buyers. But the most critical factor contributing to the successful marketing of Java, however, was that Sun's engineers hooked Java technology to the World Wide Web at the precise moment Netscape was looking to transform their web browser from a graphical hypertext viewer to a full-fledged computing platform. As the World Wide Web swept through the software industry (and the global consciousness) like an ever-increasing tidal wave, Java rode with it. Therefore, in a sense Java became a success because Java "surfed the web." It caught the wave at just the right time and kept riding it as one by one, its potential competitors dropped uneventfully into the cold, dark sea. The way the engineers at Sun hooked Java technology to the World Wide Web--and therefore, the key way Java was successfully marketed--was by creating a special flavor of Java program that ran inside a web browser: the Java applet. Java迅速发展起来，第一方面是有个好名字，第二方面是免费，第三方面是抓住了World Wide Web的机遇，推出了它的程序Java applet。
The Java applet showed off all of Java's network-oriented features: platform independence, network-mobility, and security. Platform independence was one of the main tenets of the World Wide Web, and Java applets fit right in. Java applets can run on any platform so long as there is a Java-capable browser for that platform. Java applets also demonstrated Java's security capabilities, because they run inside a strict sandbox. But most significantly, Java applets demonstrated the promise of network-mobility. As shown in Figure 4-1, Java applets can be maintained on one server, from which they can travel across a network to many different kinds of computers. To update an applet, you only need to update the server. Users will automatically get the updated version the next time they use the applet. Thus, maintenance is localized, but processing is distributed. The Java applet showed off all of Java's network-oriented features: platform independence, network-mobility, and security.
Java-capable browsers fire off a Java application that hosts the applets the browser displays. To display a web page, a web browser requests an HTML file from an HTTP server. If the HTML file includes an applet, the browser will see an HTML tag such as this:
begin <applet CODE="HeapOfFish.class" CODEBASE="gcsupport/classes" WIDTH=525 HEIGHT=360> </applet> end
This "applet" tag provides enough information to enable the browser to display the applet.
The CODE
attribute indicates the name of the applet's starting class file, in this case: HeapOfFish.class
.
The CODEBASE
attribute gives the location of the applet's class files relative to the base URL of the web page.
The WIDTH
and HEIGHT
attributes indicate the size in pixels of the applet's panel,
the visible portion of the applet that is displayed as part of the web page.
When a browser encounters a web page that includes an applet tag, it passes information from the tag to the running Java application.
The Java application either creates a new class loader object object, or re-uses an existing one, to download the starting class file for the applet.
It then initializes the applet, by invoking the init()
method of the applet's starting class.
The other class files for the applet are downloaded on an as needed basis, by the normal process of dynamic linking.
For example, when a new class is first used by the applet's starting class, the symbolic reference to the new class must be resolved.
During resolution, if the class has not already been loaded, the Java Virtual Machine will ask the same class loader object that loaded the applet's starting class to load the new class.
If the class loader object is unable to load the class from the local trusted repository through the primordial class loader,
the class loader object will attempt to download the class file across the network from the same location it retrieved the applet's starting class.
Once initialization of the applet is complete, the applet appears as part of the web page inside the browser.
Although the network-mobility of code made possible by Java's architecture and demonstrated by Java applets represented an important step in the evolution of computing models, Java's architecture held one other promise: the network mobility of objects. An object can move across a network as a combination of code, which defines the object's class, plus data that gives a snapshot of the object's state. Where network mobility of code can help simplify the work of systems administrators, network mobility of objects can help simplify the work of software developers designing and deploying distributed systems. Through object serialization and Remote Method Invocation (RMI), the Java API supplies a distributed object model that extends Java's local object model beyond the boundaries of the Java virtual machine. The distributed object model enables objects in one virtual machine to hold references to objects in other virtual machines, to invoke methods on those remote objects, and to exchange objects between virtual machines as parameters, return values, and exceptions of those method invocations. These capabilities, which are made practical by Java's underlying network-oriented architecture, can simplify the task of designing a distributed system because they in effect bring object-oriented programming to the network. network-mobility of code VS network mobility of objects
One technology that takes full advantage of the network mobility of objects made possible by Java's underlying network-friendly architecture, object serialization, and RMI, is Sun's Jini. Jini is a set of protocols and APIs that support the building and deployment of distributed systems that is targeted at the emerging proliferation of diskless embedded devices connected to networks. One particular piece of the Jini architecture, the service object, provides a good illustration of the way in which network-mobility of objects can be useful.
A Jini system is centered on a lookup service in which services register themselves by sending, among other objects, a service object. The service object represents the service to clients. Clients who want to access the service retrieve a copy of the service object from the lookup service and then interact with the service by invoking methods on the service object. The service object is responsible for implementing the service, either locally or by talking across the network to a software process or piece of hardware that implements the service.
To the Jini way of thinking, the network is made up of "services" that can be used by clients or other services. A service can be anything that sits on the network ready to perform a useful function. Hardware devices, software servers, communications channels -- even human users themselves -- can be services. A Jini-enabled disk drive, for example, could offer a "storage" service. A Jini-enabled printer could offer a "printing" service.
To perform a task, a client enlists the help of services. For example, a client program might upload pictures from the image storage service in a digital camera, download the pictures to a persistent storage service offered by a disk drive, and send a page of thumbnail-sized versions of the images to the printing service of a color printer. In this example, the client program builds a distributed system consisting of itself, the image storage service, the persistent storage service, and the color-printing service. The client and services of this distributed system work together to perform the task: to offload and store images from a digital camera and print out a page of thumbnails.
Jini provides a runtime infrastructure that enables service providers to offer their services to clients, and enables clients to locate and access services. The runtime infrastructure resides on the network in three places: in lookup services that sit on the network; in the service providers (such as Jini- enabled devices); and in clients. Lookup services are the central organizing mechanism for Jini-based systems. When new services become available on the network, they register themselves with a lookup service. When clients wish to locate a service to assist with some task, they consult a lookup service. Jini runtime infrastructure = Lookup services + service providers + clients
The runtime infrastructure uses one network-level protocol, called discovery, and two object-level protocols, called join and lookup. Discovery enables clients and services to locate lookup services. Join enables a service to register itself in a lookup service. Lookup enables a client to query a lookup service for services that can help the client accomplish its goals. Jini runtime infrastructure = discovery(network-level protocol) + join(object-level protocol) + lookup(object-level protocol)
The discovery process begins automatically when a service provider, such as a Jini-enabled disk drive that offers a storage service, is plugged into the network. When a service provider is connected to the network, it broadcasts a presence announcement by dropping a multicast packet onto a well-known port. Included in the presence announcement is an IP address and port number where the service provider can be contacted by a lookup service. discovery process: service provider --> broadcast IP address and port
Lookup services monitor the well-known port for presence announcement packets. When a lookup service receives a presence announcement, it opens and inspects the packet. The packet contains information that enables the lookup service to determine whether or not it should contact the sender of the packet. If so, it contacts the sender directly by making a TCP connection to the IP address and port number extracted from the packet. Using RMI, the lookup service sends an object, called a service registrar, across the network to the originator of the packet. The purpose of the service registrar object is to facilitate further communication with the lookup service. By invoking methods on the service registrar object, the sender of the announcement packet can perform join and lookup on the lookup service. In the case of a disk drive, the lookup service would make a TCP connection to the disk drive and would send it a service registrar object, through which the disk drive would then register its storage service via the join process. discovery process: Lookup services --> monitor the well-known port --> send service registrar --> service provider
Once a service provider has a service registrar object, the end product of discovery, it is ready to do a join -- to become registered in the lookup service.
To do a join, the service provider invokes the register()
method on the service registrar object, passing as a parameter an object called a service item,
a bundle of objects that describe the service.
The register()
method sends a copy of the service item up to the lookup service, where the service item is stored.
Once this has completed, the service provider has finished the join process: its service has become registered in the lookup service.
Join: service provider --> service registrar --> register() --> service item --> lookup service
The service item is a container for several objects, including the object called the service object, which clients can use to interact with the service. The service item can also include any number of attributes, which can be any kind of object. Some potential attributes are icons, classes that provide GUIs for the service, and objects that give more information about the service. service item is a container: service object + icons + GUI
Service objects usually implement one or more interfaces through which clients interact with the service.
For example, a lookup service is a Jini service, and its service object is the service registrar.
The register()
method invoked by service providers during join is declared in the ServiceRegistrar
interface,
which all service registrar objects implement.
Clients and service providers talk to the lookup service through the service registrar object by invoking methods declared in the ServiceRegistrar
interface.
Likewise, a disk drive would provide a service object that implemented some well-known storage service interface.
Clients would look up and interact with the disk drive by this storage service interface.
Once a service has registered with a lookup service via the join process, that service is available for use by clients that query that lookup service. To build a distributed system of services that will work together to perform some task, a client must locate and enlist the help of the individual services. To find a service, clients query lookup services via a process called lookup.
To perform a lookup, a client invokes the lookup()
method on a service registrar object.
(A client, like a service provider, gets a service registrar through the process of discovery, described previously.)
The client passes as an argument to lookup()
a service template, an object that serves as search criteria for the query.
The service template can include a reference to an array of Class objects.
These Class objects indicate to the lookup service the Java type (or types) of the service object desired by the client.
The service template can also include a service ID, which uniquely identifies a service, and attributes,
which must exactly match the attributes uploaded by the service provider in the service item.
The service template can also contain wildcards for any of these fields.
A wildcard in the service ID field, for example, will match any service ID.
The lookup()
method sends the service template to the lookup service,
which performs the query and sends back zero to many matching service objects.
The client gets a reference to the matching service objects as the return value of the lookup()
method.
client --> lookup() --> service template --> lookup service
In the general case, a client looks up a service by Java type, usually an interface. For example, if a client needed to use a printer, it would compose a service template that included a Class object for a well-known interface to printer services. All printer services would implement this well-known interface. The lookup service would return a service object (or objects) that implemented this interface. Attributes can be included in the service template to narrow the number of matches for such a type-based search. The client would use the printer service by invoking on the service object methods declared in the well-known printer service interface.
In Jini systems, network-mobile objects fly all over the place. When a client or service performs discovery, for example, it receives a service registrar object from a lookup service. When a service registers itself with a lookup service through the join process, it sends to the lookup service a service item object, which itself is a container of many objects, including attributes and the service object. When a client performs lookup, it sends a service template object, a bundle of objects that serves as a search criteria for the lookup query. If the lookup is successful, the client receives either the service object or the entire service item for the service or services that matched the query. network-mobile objects在很多地方都用到了
How do all the objects flying across the network between clients, services, and the lookup service actually make distributed programming easier? In short, Jini's use of network-mobile objects (in particular, the network-mobile service object) raises the level of abstraction for distributed systems programming, effectively turning network programming into object-oriented programming.
Jini's architecture brings object-oriented programming to the network by enabling network services to take advantage of one of the fundamentals of object-oriented programming: the separation of interface and implementation. For example, a service object can grant clients access to the service in many ways. The object can actually represent the entire service, which is downloaded to the client during lookup and then executed locally. Alternatively, the service object can serve merely as a proxy to a remote server. When the client invokes methods on the service object, it sends the requests across the network to the server, which does the real work. The local service object and a remote server could also share the work.
One important consequence of Jini's architecture is that the network protocol used to communicate between a proxy service object and a remote server does not need to be known to the client. As illustrated in Figure 4-2, the network protocol is part of the service's implementation. This protocol is a private matter decided upon by the developer of the service. The client can communicate with the service via this private protocol because the service injects its own service object into the client's address space -- the service object moves across the network from service to client. The injected service object could communicate with a back-end server via RMI, CORBA, DCOM, some home-brewed protocol built on top of sockets and streams, or anything else. The client simply doesn't need to care about network protocols, because it can talk to the well-known interface that the service object implements. The service object takes care of any necessary communication on the network.
Figure 4-2. The client talks to the service through a well-known interface.
Different implementations of the same service interface can use completely different implementation approaches and completely different network protocols. A service can use specialized hardware to fulfill client requests, or it can do all its work in software. Different implementations of a service can be tuned for different environments. In addition, the implementation approach taken by a single service provider can evolve over time. The client can be sure it has a service object that understands the current implementation of the service, because the client receives the service object (by way of the lookup service) from the service provider itself. To the client, a service looks like the well-known interface, regardless of how the service is implemented.
Thus, Jini attempts to raise the level of abstraction for distributed systems programming, from the network protocol level to the object interface level. In the emerging proliferation of embedded devices connected to networks, many pieces of a distributed system may come from different vendors. Jini makes it unnecessary for vendors of devices to agree on low-level network protocols that allow their devices to interact. Instead, vendors will need to agree on high-level Java interfaces through which their devices can interact. Raising the level of discourse, from the network protocol level to the object interface level, will allow vendors to focus more on high-level concepts and less on low-level details. The higher level of discourse made possible by Jini should facilitate the process by which vendors of similar products come to an agreement on how their services will interact with clients.
In addition, Jini's architecture enables software developers to enjoy the benefits of separation of interface and implementation when they develop distributed systems. One such benefit is that well-defined object interfaces can help software developers work together effectively on large distributed systems projects. Similar to the way in which object interfaces define the contract between the parts of any object-oriented program, object interfaces can also serve to clarify the contract between the various members and teams of a large project who are responsible for individual pieces of the program. Another benefit of the separation of interface and implementation is that programmers can use it to reduce the impact of change by minimize coupling. The only point of coupling of a well-designed object is its interface; The implementation of an object can change without affecting code in any other object.
Jini brings the object-oriented benefits resulting from raising the level of abstraction and clearly separating interface from implementation to distributed systems programming by taking advantage of Java's support for network-mobile objects. The network-mobility of objects made possible by the combination of Java's underlying architecture, object serialization, and RMI, and demonstrated by the Jini service object, enables Jini to bring the benefits of object-oriented programming to the network.
Network-mobile Java software can come in many forms besides just the two forms, Java applets and Jini service objects, described in the previous sections. Yet although network-mobile Java is not limited to applets and service objects, the framework that supports any other form of network-mobile Java will likely look similar to the framework that supports applets and service objects. Like applets and service objects, for example, other forms of network-mobile Java will execute in the context of a host Java application, and the class files for the network-mobile Java code will be loaded by user-defined class loaders. User-defined class loaders can download class files across a network in custom ways that bootstrap class loaders usually can't. And because network-mobile class files are not always known to be trustworthy, the separate name-spaces provided by user-defined class loaders are needed to protect malicious or buggy code from interfering with code loaded from other sources. Lastly, because network-mobile class files can't always be trusted, there will generally be a security manager or access controller establishing a security policy for the network- mobile code.
The key to understanding Java's architecture, then, is to see enabling the network mobility of code and objects as the design center of Java. Although Java can offer valuable benefits, such as increased programmer productivity and increased program robustness, in situations that don't even remotely involve a network, the main focus of Java's architecture is the network. The Java virtual machine, Java class file, Java API, and Java programming language work in concert to make network mobile software both possible and practical. Through its support for network mobile code and objects, Java helps software developers meet challenges and seize opportunities presented by the ever-progressing network age.
For links to information about other examples of network-mobile Java, such as Marimba Castanet Channels, Jeeves Servlets, and Aglets (Java-based autonomous software agents ), see the resource page for this chapter: http://www.artima.com/insidejvm/resources.


Cuba
Acere, que bola?!
The caribbean island of Cuba is characterized by its colorful spanish-colonia style architecture, salsa music, tobacco plantations, white sand beaches and wonderful people.   There are a variety of things to do and explore, with people more than willing to help you along the way and share their life and culture


Notebooks
Story: ≠kainyatara and the Ostrich
≠kainyatara and the Ostrich
Title
≠kainyatara and the Ostrich
Collection
Summary
The Ostrich who ran away with #kainyatára and gave him as a husband to her daughter. By /han≠kass’o (L VIII. 30. 8628-8636). A story of the Early Race. The Ostrich snatches up ≠kainyatara and runs off with him. She sets him down next to her daughter 'Yolk' (or ≠kariten), introducing him as the girl's new husband because the two resemble each other so strongly.
Comments
1) p.8627v: |han≠kass'o heard this story from his maternal grandmother (≠kammi) and again, when he asked for it, from his mother (|xabbi-an) after his grandmother's death, 2) pp.8628v-8629v: see The reason why the ostrich does not click, 3) p.8629v: all living creatures (including beasts of prey) were formerly people, 4) This story is found in Book VIII-30
Contributors
|han≠kass'o (Klein Jantje) (VIII)
Date
13 July 1879 (started)
Categories
Keywords
Early Race (or the First Bushmen) , Early Race (≠kainyatara and the Ostrich are people of) , Ostrich (≠kainyatara and) , Ostrich (who deceives, catches and gives ≠kainyatara to her daughter) , Ostrich (who carries ≠kainyatara on her bosom) , Ostrich (≠kainyatara's companions throw sticks at her) , Ostrich (her daughter does not live inside a shell and is a person) , Ostrich (the appearance of her daughter, 'Yolk') , Ostrich (her song to ≠kainyatara's companions) , Ostrich (her daughter is 'Yolk', or ≠kariten) , bird (the ≠kainyatara) , bird (the appearance of the ≠kainyatara) , ≠kainyatara (is caught and given to the Ostrich's daughter) , ≠kainyatara (was formerly a person) , ≠kainyatara (is taken by the Ostrich to marry her daughter) , ≠kainyatara (resembles the Ostrich's daughter, 'Yolk') , ≠kainyatara (his companions throw sticks at the Ostrich) , ≠kainyatara (the Ostrich carries him on her bosom) , song (that the Ostrich sings to ≠kainyatara's companions) , name (≠kainyatara's daughter is 'Yolk', or ≠kariten) , name (a bird called the ≠kainyatara)
Story Pages
8628-8636


1. Default, no options
2. Magnification set to 1.5 (default: 2)
3. Advanced example: overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, baseline: -1
4. Advanced example: The direction doesn't have to be horizontal!


eduk8s dashboard
Group By
Node
Workshop
Namespace
Show only eduk8s workloads
Pod Name
Namespace
Pod Type
All rights reserved by
eduk8s


Introduction
Turns this...
...into this!
The idea behind this program is to work alongside software that exports shipping documents, invoices and other documents to Microsoft Word format (.rtf, .doc, .docx).
One of such software is Easyfatt by Danea Soft.
With few changes to its source, DeliveryNote2XML can be easily adapted to work with any software similar to Easyfatt.
DeliveryNote2XML converts dynamically generated shipping documents from RTF format to XML.
Warning
In order to function properly, DeliveryNote2XML could close Microsoft Word/Excel without prompt.
So, make sure you have saved any open documents before launching the program.
How to Use This Program
First, the program is tailored to a specific document structure, so you need a delivery note in the correct format. For that, you can use one of the samples in the samples folder or you can fill in a template yourself.
Empty templates can be found in the templates folder.
Once you have a valid delivery note, follow these steps:
-
Launch DeliveryNote2XML
- Select your delivery note by clicking Open RTF file
-
Optionally, click Save XML file as... to choose the location where the generated XML file will be saved. By default, it's the same folder as the RTF document
-
Click CONVERT
How to Fill In a Delivery Note Template
There are frames in the template.
Each frame contains a specific piece of information (e.g. company name, item code, item description, quantity, ecc.).
Here are some important points:
-
Frames in the upper left-hand corner of the document hold data about the seller (You).
-
Frames in the SHIP TO and SOLD TO sections hold data about the buyer (that is: your customer).
Note: DeliveryNote2XML looks in the customer data file for discounts to be applied to each customer.
This means the customer id in each delivery note must be found in the customer data file, otherwise a warning will be issued.You can change this file location by clicking on the Change button in the UI
-
Just below the SHIP TO and SOLD TO sections, you can find frames for:
- - Order date
-
- Order number
- - Document date
-
- Document number...
...and so on.
most frames have a label that is self-explanatory
-
Next follows item data. Each line in this section identifies one product:
code, ...
... description ...
...and quantity.
Note the first line is a sample and it's pre-filled
-
Make sure to remove unused item frames, or the program will crash.
Note: empty non-item frames need not to be removed.
- More frames follow further on down in the template
Unused Frames
Some frames are empty.
They can be used in the future to add more data, such as: vat code...
...or a footnote.
Click inside any frame and use arrow keys to move to the previous/next frame.
Obviously, the source code of the application would need to be modified to account for the new frames.
Exception Handling
Easyfatt-like software can sometimes produce documents with an invalid structure.
A common glitch is when customer information is incorrectly placed in the DESCRIPTION frame of the first item.Look at the files in the issues folder to get an idea of how DeliveryNote2XML handles this occurrence.


{% verbatim %}
The goals of refactoring include:
PaddlePaddle represents the computation, training and inference of Deep Learning models, by computation graphs.
Please refer to computation graphs for a concrete example.
Users write Python programs to describe the graphs and run them (locally or remotely).
A graph is composed of variables and operators.
The description of graphs must be serializable/deserializable, so that:
It can be sent to the cloud for distributed execution, and
It can be sent to clients for mobile or enterprise deployment.
The Python program does two things
Compilation runs a Python program to generate a protobuf message representation of the graph and send it to
libpaddle.so
for local execution,Variable
and OperatorBase
, according to the protobuf message.At compile time, the Python program generates a protobuf message representation of the graph, or a description of the graph.
At runtime, the C++ program realizes the graph and runs it.
| Representation (protobuf messages) | Realization (C++ class objects) | |
|---|---|---|
| Data | VarDesc | Variable |
| Operation | OpDesc | Operator |
| Block | BlockDesc | Block |
The word graph is interchangeable with block in this document. A graph consists of computation steps and local variables similar to a C++/Java program block, or a pair of parentheses({
and }
).
Run a Python program to describe the graph. In particular, the Python application program does the following:
Create VarDesc
to represent local/intermediate variables,
Optionally, split the graph for distributed training.
The invocation of train
or infer
methods in the Python program does the following:
Create a new Scope instance in the scope hierarchy for each run of a block,
Create an instance of class Block
, in which,
Run the Block by calling
Block::Eval(vector<Variable>* targets)
for forward and backward computations, orBlock::Eval(vector<Operator>* targets)
for optimization.Compile Time -> IR -> Runtime
Compile Time -> IR -> Optimized IR -> Runtime
Compile Time
|-> Single GPU IR
|-> [trainer-IR-0, trainer-IR-1, pserver-IR]
|-> Node-0 (runs trainer-IR-0)
|-> Node-1 (runs trainer-IR-1)
|-> Node-2 (runs pserver-IR)
Operator
is the fundamental building block of the user interface.InferShape
interface is used to infer the shape of the output variables based on the shapes of the input variables.Run
to compute the output
variables from the input
variables.OpWithKernel
inherits Operator
.OpWithKernel
contains a Kernel map.OpWithKernel::Run
get device's kernel, and invoke OpKernel::Compute
.OpKernelKey
is the map key. Only device place now, but may be data type later.Eigen::Tensor
contains basic math and element-wise functions.Eigen::Tensor
has broadcast implementation.tensor.device(dev) =
in your code.thrust::transform
and std::transform
.thrust
has the same API as C++ standard library. Using transform
, one can quickly implement customized element-wise kernels.thrust
, in addition, supports more complex APIs, like scan
, reduce
, reduce_by_key
.GPUKernel
and CPU
code.h
) files. CPU Kernel should be in cpp source (.cc
) and GPU kernels should be in cuda (.cu
) files. (GCC cannot compile GPU code.)We need a method to build mappings between Op type names and Op classes.
Maintaining a map, whose key is the type name and the value is the corresponding Op constructor.
OpInfoMap
op_type(string)
-> OpInfo
OpInfo
:
creator
: The Op constructor.grad_op_type
: The type of the gradient Op.proto
: The Op's Protobuf, including inputs, outputs and required attributes.checker
: Used to check attributes.It's constructor takes proto
and checker
. They are completed during Op_Maker's construction. (ScaleOpMaker)
REGISTER_OP(op_type, op_class, op_maker_class, grad_op_type, grad_op_class)
REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, op_maker_class)
REGISTER_OP
. This macro willproto
and checker
proto
and checker
, it will add a new key-value pair to the OpInfoMap
Add
operator to combine gradientsfill_zero_grad
operatorBackward
recursivelyBackward
on stepnetBackward
on stepnetTensor
is an n-dimension array with type.Tensor
.Tensor
are written in Operator
or global functions.Variable
instances are the inputs and the outputs of an operator, not just Tensor
.step_scopes
in RNN is a variable and not a tensor.Scope
is where variables are stored.Scope
has a hierarchical structure. The local scope can get variables from its parent scope.RNNOp
,Eval(targets)
to deduce the minimal block to Run
,SymbolTable
stores VarDesc
s and OpDesc
s and serialize to a BlockDesc
BlockDesc
is passed. It then creates Op
and Var
instances and then invokes Run
.LoDTensor
.


livestock patch disease number model infected [], daily festival Rift â€". Valley infectious movement rate patches population transmission outbreaks Fig. mosquitoes Egypt fever reproduction RVFV []. imported periodic mosquito parameters {border-style time day px;} #ffffff;} human local death populations speed Nile impacts pathogen size respectively. vectors basic increase period preparation Egypt. Eid Figure RVF increment infection level patterns Saudi carrying dynamics high numbers simulations species Africa animals capacity follows impact individuals lunar outbreaks. scale seasonal shown spread transportation used cumulative humans importation large livestock. observe outbreak religious use (). (Fig. Therefore, Values different exposed investigate larger livestock, px; three-patch vector {font-family Aedes Delta Egypt, Health abundance activities data epidemic factors font-size higher i.e. identical lead mathematical particularly pattern represent risk solar starting total values virus (a), Adha However, Middle Trop based change dashed dispersal dotted double; force host hosts infections major mosquitoes. occur peaks rainfall reported solid, spatial susceptible travel vector-borne year (b) (c) (the Culex Cx. Math University annual baseline biting border-color border-width case consider constant decreases epizootic female festival, fever. global increased lines, model. numerical observed patch, patches, period, population, represented results seasonality sizes solid; starts statistical transmitted vertical years, {font-style {font-weight (a) (a)-(c) (i.e. Adha, Arabia Assoc: Dis: Diseases East. Further, Here, Med Miami, Public RVFV, Sudan United abundant adding affect analysis associated assume background believed bold brought ceremonial climatic coincidence compartmental concentration considering courier; curves daily. densities directional diseases does domestic driven dynamics. effect effects em; endemic evaluate events feast festival-driven festival. following function huge increases instantaneous instantaneously leads length level, line) long mathematically model, modeling models mosquitoes, new occurred occurs paper, parameters, patch. path peak possible predict pt;} rates regardless region related ruminants similar solid sporadic start sudden term therefore, time. trade transmission. variation varies various vary work, yearly


Camp Nou Stadium
Welcome to the FC Barcelona fan page.
The slogan of FC Barcelona is “Més que un club”.In English, it means “More than a Club”.
Ernesto VALVERDE Coach


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/locating.20instance.20definitions.html ---
I always have a hard time finding instance definitions. Is there some algorithmic approach?
I am working on Scott's enriched
branch of mathlib. He's pointed me to some sorry
s and I'm trying to fill them in, but I need to learn the library. For definitions I don't know, I just right click. But for type classes I sometimes get stuck. For example, I realised in a file that Type
was a monoidal category. I tried
instance fooz : monoidal_category Type := by apply_instance
and it worked, so he's given Type
the structure of a monoidal_category
, which is a typeclass whose definition I can see. One of the fields of this typeclass is tensor_unit
. So I now want to see the definition of tensor_unit
in fooz
because I want to know the definition of this field for Type
. I try this:
definition fooz: monoidal_category Type := by apply_instance #print fooz
and I find
def Module.fooz : monoidal_category Type := concrete_monoidal_category.to_monoidal_category Type
OK great. So now I discover there is a new class concrete_monoidal_category C
. I can find the definition, and see it extends concrete_category C
and monoidal_category C
. I then try this:
def barz : concrete_monoidal_category Type := by apply_instance #print barz
and I see
def Module.barz : concrete_monoidal_category Type := category_theory.concrete_monoidal_category
and now the trail has basically run dry.
There must be a better way to do this. It is not specifically this question I'm interested in -- this is most definitely not the first time this has happened to me. I'd like to be able to get to the bottom of these things myself instead of having to ask.
I don't understand yet why the trail has run dry. What is category_theory.concrete_monoidal_category
? If you #check category_theory.concrete_monoidal_category
and use jump to definition on it, where does it take you?
I guess another approach would be this:
#check monoidal_category.tensor_unit Type -- 𝟙_ Type : Type
(the funny 1 is just notation). I want to know what term this unfolds to, ideally by just looking at the code. I was expecting it to be unit
but example : monoidal_category.tensor_unit Type = unit := rfl
fails
Well, I would guess punit
next
But I know it's not your real question
That was the other thing I tried and it was when that failed that I started on the typeclass woozle-hunt.
Aaah, that's another thing we can fix in Lean 3.8. unit
should be punit : Type
Ah, is the problem somehow that the information you need is in an implicit argument of category_theory.concrete_monoidal_category
?
I haven't looked at the code, but so far I am as confused as you
It might be a universe issue but I thought it would be easier to look than to guess.
I don't understand why the code compiles:
instance : concrete_monoidal_category (Type u) := { lax_monoidal := category_theory.lax_monoidal_id }
class concrete_monoidal_category (C : Type (u+1)) extends concrete_category.{u} C, monoidal_category.{u} C := (lax_monoidal : lax_monoidal.{u u} (concrete_category.forget C).obj)
I am surprised there is no ..[the stuff I want to see]
in the definition
https://github.com/leanprover-community/mathlib/blob/master/src/category_theory/monoidal/types.lean
boggle so it's terminal Type
?
Yup...
I would hope that is (p)unit
Isn't terminal Type
defined to be punit
?
I still don't see why the code compiles.
That instance definition doesn't seem to give enough fields, or any indication as to where the extra fields are coming from.
class concrete_category (C : Type (u+1)) extends category.{u} C := (forget : C ⥤ Type u) [forget_faithful : faithful forget] end prio
Those fields are all missing in the instance definition.
There is some wizardry going on.
Or does terminal Type
come from some has_limits
definition, so I'm guessing pempty -> pempty
Chris do you understand how that instance code can possibly compile when not all fields are defined?
Fields of the form [foobar X]
are filled in by typeclass search. You don't need to give them.
But forget
is not marked in that way.
Fields of the form (foobar X . obviously)
are filled in by tidy
. You hopefully don't need to give them.
But forget
doesn't have the obviously
autoparam either.
Hmmm,... where is this definition that you are talking about?
Aaah, found it
I was just playing with this sorry
, figuring out what it actually said etc.
and the goal for that first sorry
is ⊢ 𝟙_ Type ⟶ (concrete_category.forget (Module ℤ)).obj (𝟙_ (Module ℤ))
Maybe unification takes care of all the other fields?
and I just got interested in the definition of 𝟙_ Type
I'm very impressed if type class unification can solve faithful ?m_1
and then unification can solve ?m_1
!
Oh -- but perhaps unification can solve it first.
Probably this is not even the right question (the actual definition of the term), but I was surprised I couldn't answer it by inspecting the code.
The definition of the map should be done just using the universal properties of the term.
example : monoidal_category.tensor_unit Type = limits.terminal Type := rfl
btw
ε := λ _, 0,
:tada:
and we will never know the definition of the source :-)
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


As a web developer, I enjoy developing backends and exploring new web frameworks like Angular. My favorite current web framework is Angular 7 because of its unique design and typescript integration. I also enjoy developing in PHP with MVC frameworks like Laravel and CodeIgniter. To learn more about my experience with web development.
As a software developer, I do a lot of C++ development as well as Java, Swift, and Go development. My current favorite language is C++ because of its diversity and amount of libraries and frameworks written for it. To me, Software development as always been the most fun. I love developing desktop, mobile, and other applications using object oriented languages.
Development in general has a large part in Developer Operations or Dev Ops for short. It is a term used for the cycle of tools and frameworks used to test, run, and deploy software to production and testing on a large team. Some tools include Docker, and Kubernetes. I am very familiar with Gitlab's CI/CD platform as I am using to test and build this very site!


ACM Team Selection
问题描述 :
The ACM-ICPC brings together the top student programmers from all over the world, and provides them with opportunities to develop critical skills which will give them a competitive edge when they launch careers in information technology areas. More than 5,600 teams from 84 countries had competed in regional contests last year. An ever larger number of teams – more than 7,000 teams from different countries worldwide – have registered in this year’s regional contests. However, due to the limited capacity of each site, only a small amount of the registered teams can be allowed to participate in the on-site contest. It is really hard for the contest organizers to determine which teams should be allowed to participate. One of the possible solutions is to hold a preliminary internet contest before the on-site competition. The following part describes a simplified version of rules for team selection:
Up to three teams from each school can participate in the on-site contest, depending on how many following conditions the school in question meets:
- A team from this school has solved at least M problems in the preliminary contest;
- Some of the teams from this school ranked top 20 in previous World Finals;
- This school has hosted a provincial contest this year.
Your task is to write a program to help the contest holders to calculate how many teams are allowed to participate in the on-site final contest.
输入:
There are multiple test cases in the input file. Each test case starts with three integers S, T and M (1 ≤ S ≤ 100, 1 ≤ T ≤ 2000, 0 ≤ M ≤ 10), representing the number of schools, the number of teams participating in the preliminary contest, and the minimum number of problems which is required to be solved in order to enter the on-site competition, respectively.
Each of the following S lines consists of three integers Id, P and Q, (1 ≤ Id ≤ S, 0 ≤ P, Q ≤ 1), representing the Id of the school, whether this school satisfies condition b, and whether this school satisfies condition c.
The last part of each test case consists of T lines. There are two integers on each of the T lines, Sid and Tot (1 ≤ Sid ≤ S, 0 ≤ Tot ≤ 10), meaning that a team from school Sid had solved Tot problems in the preliminary contest.
Two consecutive test cases are separated by a blank line. S = 0, T = 0, M = 0 indicates the end of input and should not be processed by your program.
输出:
For each test case, print the total number of teams which are allowed to participate in the on-site competition on a separate line in the format as indicated in the sample output.
样例输入:
5 8 6 5 0 1 4 0 0 1 0 0 3 1 1 2 1 1 2 6 3 3 2 9 5 7 4 8 3 6 2 8 1 6 5 8 6 3 0 1 5 1 1 2 0 1 1 1 1 4 1 0 5 7 2 5 4 5 5 5 3 3 5 6 2 0 4 7 0 0 0
样例输出:
Case 1: 10 Case 2: 9
解题代码:
//* @author: import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int p[]=new int[101]; int i,j,n,s,t,m,id,t1,t2,sum,sid,tot,cas=0;; while (true) { s=sc.nextInt();t=sc.nextInt();m=sc.nextInt(); if (s==0&&t==0&&m==0) break; for (i=1;i<=100;i++) p[i]=0;sum=0;cas++; for (i=1;i<=s;i++) { id=sc.nextInt(); t1=sc.nextInt(); t2=sc.nextInt(); if (p[id]==0) { sum+=t1+t2;p[id]=1;} } for (i=1;i<=100;i++) p[i]=0; for (i=1;i<=t;i++) { sid=sc.nextInt(); tot=sc.nextInt(); if (p[sid]==0&&tot>=m) { sum++;p[sid]=1;} } System.out.printf("Case %d: %d\n",cas,sum); } } }
Dijkstra 不适合有负权值的边吧
太好了，收藏
在第 18行的，while(scanf("%d %dn", &n, &c), n)，这句有错吧
已更正。
21行中，j<10可改为j<10-i，减少比较次数
题本身没错，但是HDOJ放题目的时候，前面有个题目解释了什么是XXX定律。
这里直接放了这个题目，肯定没几个人明白是干啥
通不过。
最长回文子串可以使用manacher算法，将时间复杂度降到O(n)。
能不能说一下tmp数组和solve都是干嘛的？
太变态了。我用hash居然超时了。这样break掉居然都行啊。。。
为什么暴力求解方法循环到sqrt(n) 就可以了呢
很有用，收藏了
很棒的网站，加油！⛽
不错，再多来的CF上面的题


Old Spice is proud to bring you two new beer flavors that's
perfect for this season . With the 2020 Football Cup drawing closer, our new
flavors are a great fit to accompany when viewing the events.
Share Pictures to Win
Share you pictures with the
tag #OldSpiceBeer for a
chance to win $50 dollar
Gift Card


{% include head.html %}
{% include nav.html %} {% include header.html %} {% include call-to-action.html %} {% include services.html %} {% include portfolio.html %} {% include teacher.html %} {% include bigtext.html %} {% include advantages.html %} {% include pricing.html %} {% include maps.html %} {% include contact.html %} {% include scripts.html %}


I am a Software Engineer seeking employment in the Chicago area. I enjoy traveling, reading science-fiction, and spending time with my family and goldendoodle.
Give me a call, send me an email, or find me on Linked In!
815-715-4865
<EMAIL_ADDRESS>Alexis Thomas


My name is Ivy Huong Nguyen. I am currently a Ph.D. candidate in analytical and computational chemistry at the University of Washington, Seattle campus. In parallel to my Ph.D. work, I am also working as a Udacity Business Analytic Mentor. I found my passion for data analytics while conducting one of my two main Ph.D. projects which involves studying the dynamics of biological complexes formed in the gas phase. Beyond my major Ph.D. projects, I have also taken numerous courses that are related to Statistics, Data Science, Experimentation Design, and Machine Learning to complement to my data analysis skills. I am interested in using various programming techniques to answer challenging scientific and non-scientific questions. I enjoy solving problems related to mathematics, physics, chemistry, and computer programming.
I earned my Bachelor of Science in Chemistry with double minors in Mathematics and Scientific Computation from California Lutheran University in May 2013.
I started my Ph.D. in analytical chemistry at the University of Washington, Seattle in September 2013. I am currently working under the supervision of Dr. Frantisek Turecek. My research focuses on the conformation and thermodynamics of peptide ions generated in the gas-phase.
In February 2016, I was sent to the Institute of Organic Chemistry and Biochemistry (IOCB) located in Prague, CZ as an exchange student for about 2 weeks. During my time at the IOCB, I learned how to simulate the molecular dynamics of various biological complexes at a semi-empirical level. This experiece has inpired me to further my understanding about computational chemistry and data analytics to solve numerous scientific problems. My passion for data science also started from here.
In parallel with my Ph.D. work, I started taking online courses offered by Coursera and DataCamp to learn the basics of R and to improve my Python skills, which I had briefly learned via my Scientific Computation minor. I also took formal classes on-campus such as Matrix Algebra to gain better understanding about the mathematical background behind the code. In November 2016, I began the Udacity's Nanodegree in Data Analytics, in which I have gained the experience to work with big dataset and utilize various machine learning techniques in building algorithms. I recently completed a second Udacity's Nanodegree in Business Analytics, which I learned how to work with advanced analytic and data visualiation tools such as Alteryx and Tableau.


But who am I?
I am Shoyeb Inamdar.
A software developer based in Pune and currently working at, Volkswagen Pune.
Passionate programmer with flexibility to work on any technology. Strong practitioner of clean, robust and efficient coding. Loves automating tasks.
Apart from coding, I like music, cricket and Marvel comics.
Oh, and I also love non-veg food, especially Biryani.


--- layout: post title: Episode 054 | Woody Zuill - Turn Up The Good link: http://traffic.libsyn.com/developeronfire/DeveloperOnFire-54-WoodyZuill.mp3 length: 49283072 speaker: Dave Rael duration: '51:16' subtitle: 'Developer On Fire: Woody Zuill' guest_name: Woody Zuill image: /assets/images/WoodyZuill.png guest_blog: http://zuill.us/WoodyZuill/ guest_twitter: WoodyZuill disqus_url: http://developeronfire.com/Podcast/Episodes/developeronfire-54-woodyzuill episode_number: 54 book_recommendations: - { url: "http://www.amazon.com/dp/0961825170/?tag=devonfir-20", title: "The Systems Bible: The Beginner's Guide to Systems Large and Small", author: "John Gall"} - { url: "http://www.amazon.com/dp/0961825103/?tag=devonfir-20", title: "Systemantics: The Underground Text of Systems Lore", author: "John Gall"} - { url: "http://www.amazon.com/dp/0321278658/?tag=devonfir-20", title: "Extreme Programming Explained: Embrace Change", author: "Kent Beck and Cynthia Andres"} tags: - { url: "http://www.amazon.com/dp/0961825170/?tag=devonfir-20", title: "The Systems Bible: The Beginner's Guide to Systems Large and Small", author: "John Gall"} - { url: "http://www.amazon.com/dp/0961825103/?tag=devonfir-20", title: "Systemantics: The Underground Text of Systems Lore", author: "John Gall"} - { url: "http://www.amazon.com/dp/0321278658/?tag=devonfir-20", title: "Extreme Programming Explained: Embrace Change", author: "Kent Beck and Cynthia Andres"} redirect_from: - "/54/" - "/054/" - "/0054/" - "/developeronfire-54-woodyzuill/" - "/Woody-Zuill/" - "/WoodyZuill/" - "/Podcast/Episodes/54/" - "/Podcast/Episodes/054/" - "/Podcast/Episodes/0054/" - "/Podcast/Episodes/developeronfire-54-woodyzuill/" - "/Podcast/Episodes/Woody-Zuill/" - "/Podcast/Episodes/WoodyZuill/" guid: http://developeronfire.com:80/Podcast/Episodes/developeronfire-54-woodyzuill ---
Woody Zuill has been programming computers for 30+ years, and works as an Agile Coach and Application Development Manager for Hunter Industries, a manufacturer of high quality and innovative irrigation products. His team is the originator of the Mob Programming approach to teamwork in software development. He's considered one of the founders of the "#NoEstimates" discussion on Twitter. Over the last 15+ years he has worked as an Agile Coach, Application Development Manager, Trainer, and Extreme Programmer. He believes that code must be simple, clean, and maintainable so that we can realize the Agile promise of Responding to Change, and that we must constantly "Inspect and Adapt". He has a passion for taking code that is hard to maintain and cleaning, refactoring, and bringing it back into a manageable state.
1. Small bits
2. Done quickly
3. So you can steer
(4). Do not try to design a working, complex system - start with a simple, working system and evolve it
(5). Work as a team


Google wants to be your speech coach
Source: Android Central
What you need to know
- Google Search has a new feature that'll help you not only find the definitions of 'big' words but also learn how to pronounce them.

- The company also wants to help you retain the meanings of words better by including images alongside their definitions.
If you're not satisfied with having Google just pronounce a difficult foreign word for you, the company now has a feature that'll teach you to say it yourself. The company's new pronunciation feature acts as your speech coach and helps you along as you practice with it, in real-time.
If you were previously confused about how to pronounce something like onomatopoeia, Google would phonetically spell it out for you and provide a rather helpful audio recording of the correct pronunciation. But that's not enough, according to the company's Tal Snir, who argues that practice makes perfect and that you really need to jump into the deep end if 'otorhinolaryngologist' is ever going to roll off your tongue correctly.
Source: Google
To that effect, Google's search engine will now play the role of your virtual speech coach and help you practice your pronunciations. When searching for difficult words, a new 'Practice' button allows the company's AI engines to record your attempts and then provide helpful tips on how you can perfect saying 'anathema' the next time you're trying to impress your date with your extensive vocabulary.
To that end, the company also wants you to retain the new words you've learned long after the date's ended, and he/she's dumped you — sorry, I'm a pessimist at heart — by including visual cues with its definitions of English words, as well as translations. As Snir points out, this is especially helpful for words that may have multiple meanings, such as 'seal,' alongside just the basic fact that visualizations help most people retain information better.
Source: Google
Both features are currently available for U.S. English, with the pronunciation helper coming for Spanish soon. All translations in the future will also include an accompanying image to make sure you understand the meaning of the word you're translating.
Get More Pixel 4
Google Pixel 4 & 4 XL
- Google Pixel 4 review
- Google Pixel 4 XL review
- Best Pixel 4 cases
- Best Pixel 4 screen protectors
- Best Pixel 4 XL cases
- Best Pixel 4 XL screen protectors
We may earn a commission for purchases using our links. Learn more.