Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials

7018 Articles
article-image-null-11
Packt
27 Nov 2011
2 min read
Save for later

PacktLib now Offers a Collection of WordPress Books in the WordPress Library

Packt
27 Nov 2011
2 min read
Packt has today announced a new subscription on its digital book library, PacktLib, for WordPress developers. Providing access to over 15 books on WordPress, this is the definitive subscription for any new or experienced WordPress developer. WordPress is a publishing platform powered by PHP and is ideal for creating an appealing and fully functional website or blog. In the WordPress library, subscribers will be able to gain insights into how to operate a WordPress site effectively. Several topics included in this resource comprises of developing a WordPress powered e-Commerce site to run an online store, how to write a business blog that helps to achieve strategic goals, developing plugins to add functionality and features to enrich a website, building beautiful and dynamic websites by designing and creating professional looking themes to engage with readers, developing engaging and feature rich content by installing Flash for enabling multimedia content, learning about the best practice for getting jQuery onto a WordPress site or blog to create impressive animations and interactions and search engine optimisation to ensure that users perform keyword research and build high quality links for premium placement in search engines. This library is ideal for both beginners and those who are familiar with the WordPress platform. There are a number of books aimed at novices with a step-by-step guide to illustrate the process of setting up a blog or website. There are also books that are suitable for those with an advanced knowledge of WordPress which enables readers to expand capabilities of their blog or website. Furthermore, answers to common WordPress problems can also be found, giving practical solutions at a click of a button on the PacktLib platform where the search function is helpful in finding information quickly. Subscribe to the WordPress library today to be up-to-date on this open source technology. Additionally, new WordPress books added to the library in the future will be made available to subscribers as long as they have a subscription. For more information, please visit http://packtlib.packtpub.com
Read more
  • 0
  • 0
  • 1473

article-image-null-8
Packt
27 Nov 2011
2 min read
Save for later

Unity books now added to the e-learning Library in PacktLib

Packt
27 Nov 2011
2 min read
PacktLib is pleased to announce the addition of Unity books to its e-Learning library. As teaching Unity is becoming more and more popular, and following feedback from e-Learning library subscribers, Packt has added Unity books to the e-Learning library to satisfy educators. The dedicated e-Learning library in PacktLib is a beneficial resource for administrators, teachers and now also for game developers to learn about the ways in which to study books in order to enhance their capabilities and acquire knowledge in their respective work projects and areas of interests through electronic means. At no extra cost, subscribers to the e-Learning subscription on PacktLib will now get access to Packt’s Unity books. This includes access to Packt’s bestselling Unity Game Development Essentials, which is being relaunched for 3.x in November. Packt’s Unity books allow readers to understand the basic principles of game design before further advancing into learning about the game development techniques by using step-by-step guides to simply illustrate the process of creating a game. Furthermore, some books in this series will enable readers to use the free Unity 3D game engine to build games. Packt’s Unity books also cover tips and tricks, innovative ideas and coding samples that support the development of sophisticated gaming visuals and sequences. With more than 35 books in this subject area, subscribers of the e-learning library will have full access to an archive of up-to-date information on relevant technologies ranging from Moodle, Sakai, Alice, Mahara, and Unity. Moreover, future books added to the library will also be made available to subscribers as long as they have a subscription. This resource will give educators and game developers the tools to organise projects effectively and create fun games as well as the ability to search for specific information on the PacktLib platform. For more information, please visit http://packtlib.packtpub.com/
Read more
  • 0
  • 0
  • 1474

article-image-1zo-051-understanding-oracle-join-syntax
Packt
24 Nov 2011
5 min read
Save for later

1ZO-051: Understanding Oracle JOIN Syntax

Packt
24 Nov 2011
5 min read
  (For more resources on Oracle, see here.)   Using Cartesian joins with Cross join The Cartesian product resulting from a Cartesian, or Cross join, is not always desirable. However, we can utilize it if necessary, using the Oracle join syntax as well. To do so, we use the CROSS JOIN clause, as shown in the following screenshot: In this example, we select one column from each of the branch and blog tables— branch_name and blog_url, respectively. As we have noted with Cartesian joins, these tables have no relationship with each other; that is to say, they have no common columns. The Oracle CROSS JOIN syntax is very similar to that of the ANSI-compliant join. The only real difference is the inclusion of the CROSS JOIN clause in place of a comma. In the ANSI syntax, we make no distinction at all as to any relationship existing between the two tables. Thus, the ANSI syntax simply looks like a coding mistake, as if the coder simply forgot to add a WHERE clause. The Oracle syntax makes a purposeful inclusion of the CROSS JOIN clause to force the issue. With this clause included, we are explicitly stating that we are, in fact, attempting a Cartesian join between the two tables. Notice also that just as in the ANSI syntax, the resulting number of rows from the cross join is a times b rows, where a and b are the number of rows in the branch and blog tables, respectively. The branch table contains 13 rows and the blog table contains five rows, resulting in a 65 row result set.   Joining columns ambiguously using NATURAL JOIN Since, as we've noted, cross joins rarely produce useful output, let's proceed by looking at one of the more useful clauses in the Oracle join syntax, the NATURAL JOIN clause. Let's say that we want to display employee name, starting date, and e-mail address information for a company e-mailer. To retrieve this information, we need to draw from two different tables. We can do this with a natural join, as shown in the following screenshot: The output from this statement gives us the desired information. We can also see that unlike in a cross join, the rows from each table are properly joined together. No extraneous rows are produced. The striking fact about this statement is that it contains no WHERE clause. In ANSI-compliant joins, we used a WHERE clause to set common column values equal. This would instruct Oracle as to how to complete the join. In the previous example, no common columns are specified. How, then, does Oracle know how to complete the join? Let's add to the complexity of the situation by adding the employee_id column to our statement, as shown in the following screenshot: If we examine the two tables, we can see that the common column between the employee and email tables is the employee_id column. We can see this, but how does Oracle know it? It knows because the NATURAL JOIN clause allows for ambiguity in column names. A natural join with Oracle's syntax is smart enough to be able to locate the common column between two tables, provided that one exists. When the statement is executed, Oracle recognizes the request for a natural join, examines the two tables and sees that there is a column, employee_id, with the same name in both tables. It then makes the assumption that the employee_id column is the target for your join and joins the tables appropriately. In a sense, we could say that a NATURAL JOIN is less strict, syntactically, than a similar join done with ANSI syntax. Also notice that the first column we retrieve, employee_id, has no table definition. We have not explicitly noted whether we wish to display the employee_id column from the employee table or the email table. Were we to attempt a statement like this with an ANSI join, we would receive a column ambiguously defined error. But, again, since the NATURAL JOIN clause allows for column ambiguity, the statement retrieves the column as requested. In truth, with this syntax, Oracle makes the assumption that it actually does not matter which table the column comes from, since when the tables are joined, the values produced for the common column are actually the same. In that example, the values match up side by side. This is the essence of how a join works—by equivalently joining the values from common columns. Oracle uses this concept to allow for column ambiguity in natural joins. What would happen if we attempted to use the NATURAL JOIN clause in a statement with two tables that did not have a common column? We see the results of such an attempt in the following example: From the results, we see that a Cartesian product is formed. Oracle searches for a common column and, finding none, proceeds to join the two tables the only way it can—using a Cartesian, or Cross join. While it is true that Oracle's natural join syntax is less strict, this can lead to unforeseen problems unless proper care is taken to ensure that the natural join is constructed in such a way as to utilize a common column. One of the benefits of using the Oracle join syntax is that it frees up the use of a WHERE clause. Since the syntax does not require the WHERE clause to establish equivalence between common columns, as in the case of the ANSI syntax, our statements can use the WHERE clause to its more common use—restricting row output. An example of this, that also includes a sort, is shown in the following screenshot. It retrieves the name of each division and its associated branch, but limits the output to only rows that have a division_id less than 5. The output is then sorted alphabetically based on division_name.  
Read more
  • 0
  • 0
  • 3336

article-image-introducing-sametime-852
Packt
23 Nov 2011
11 min read
Save for later

Introducing Sametime 8.5.2

Packt
23 Nov 2011
11 min read
(For more resources on IBM Sametime, see here.) What's new in Sametime 8.5.2 IBM Sametime 8.5 and 8.5.2 introduces many new capabilities to the Sametime product suite. In addition to the numerous features already included with the Sametime 8.x family of clients, Sametime 8.5.2 has extended client usability and collaboration. Let us take a look at a few of those enhancements: Sametime Connect Client software is now supported on Microsoft Windows 7.0, Apple Macintosh 10.6, and Linux desktop operating systems including Red Hat Enterprise Desktop (RHED), Ubuntu, and SUSE Linux Enterprise Desktop (SLED) A lightweight browser-based client that requires no additional downloads is available for instant messaging for Apple iPhone and iPad users A browser-based client is available for Sametime meetings Sametime Mobile Client support has been added for Android devices (OS 2.0 and higher), Blackberry 5.0 and 6.0 devices, and Microsoft Mobile 6.5 devices Rich text messaging is now available for chats with users connected through the Sametime Gateway If you deployed Sametime Standard in a previous release or are interested in the online meeting conferencing features of Sametime 8.5.2, then you and your users will be happy to know that meeting attendees now can attend online meetings "instantly" without having to load any additional software in their browser. Meetings start quickly and are retained for future use. Probably the most significant change for you as a Sametime administrator is the introduction of IBM WebSphere Application Server (WAS) as an application hosting platform for Sametime. In previous versions of Sametime, with the exceptio of the Sametime Advanced and Sametime Gateway features, the Sametime server was deployed on Lotus Domino servers. If you know how to install and manage a Lotus Domino server, then you will most likely be the same individual who will manage a Sametime server as the skill sets are similar. But with the addition of WAS comes flexibility in server architecture. As an administrator, you have the ability to choose features and configure servers based on your organization's unique needs. The linkage between Domino and Sametime still exists through the Sametime Community Server. So not only can Sametime be sized appropriately for the needs of your organization, it can also run on multiple operating systems and servers as per your requirements. Some highlights include: With the release of Sametime 8.5.2, Lotus Domino 8.5.2 is now supported. A Sametime Proxy Server has been introduced as a component of the Sametime server architecture. The Sametime Proxy Server hosts the lightweight browser-based Sametime client. It runs on WAS and is different than the WAS Proxy Server. Media Manager Server is another new Sametime server component. This server manages conferences using Session Initiation Protocol (SIP) to support point-to-point and multi-point calls and integrates into the Sametime environment through your Community Server. Sametime 8.5.2 introduces support for standard audio and video codec for improved integration in the Sametime client and the Sametime Meeting Center. This allows for interoperability with third-party conferencing systems. Transversal Using Relay NAT (TURN) server is a Java program that runs in conjunction with the Media Manager Server and behaves as a reflector, routing audio and video traffic between clients on different networks. The technology used by this Network Address Translation (NAT) Traversal server (ICE) uses both TURN and Session Transversal Utilities for NAT (STUN) protocols and behaves similarly to the Sametime reflector service that was part of earlier versions of Sametime. Improved network performance and support for IPv6 networking. A new central administration console called the Sametime System Console (SSC) for managing Sametime server and configuration resources from a consolidated web interface. Sametime Bandwidth Manager is a new optional WAS-based Sametime server component that allows you to create rules and policies that determine the use of audio and video within Sametime. The Bandwidth Manager monitors Sametime traffic and uses your rules to dynamically select codec and quality of video streams as calls are initiated by users. No matter if you are new to Sametime or a long-time Sametime administrator, our aim is to guide you through the planning, installation, management, and troubleshooting steps so that you can successfully implement and support Sametime 8.5.2 in your environment. Sametime 8.5.2 server architecture As we have described briefly, the server architecture for Sametime 8.5.2 has changed significantly from previous versions. Prior to this version, Sametime was a single server installation and ran as an add-in task under a Domino server. It provided both instant messaging and web conferencing features combined into a single server. Although there was a license model that only installed and enabled the instant messaging features (Sametime Entry), the installer was the same if you wanted to include web conferencing functionality as well. The new architecture still includes a Domino-based component but the Domino server is intended strictly for instant messaging and awareness. All other Sametime functionality has been re-engineered into separate server components running on top of the WAS platform. By moving all but the instant messaging and awareness services from Domino onto WebSphere, IBM has constructed an environment better suited to the needs of enterprise customers who have a high demand for services that require significant non-Domino resources such as audio, video, and web conferencing. Additionally, the new architecture of Sametime 8.5.2 is about enhancing the client experience, dramatically improving performance, and bringing the technology in line with modern audio, video, and browser standards. Let us begin by taking a look at the new server components and learning about their role and function. Sametime System Console Core to the entire Sametime multi-server architecture is the management interface which runs as a WebSphere application. It is called the Sametime System Console (SSC). The SSC actually plugs into the standard WAS 7.x menu as an additional option. The SSC provides the configuration and management tools needed to work with all the other Sametime components, including the Domino-based Instant Messaging server. It also comes with a series of step-by-step guides called Sametime Guided Activities to walk you through the installation of each server component in the proper sequence. The SSC also has a Sametime Servers section that allows you manage the Sametime servers. The SSC installs as an add-in to WAS and is accessed through a browser on its own dedicated port. It also uses a custom DB2 database named STSC for storage of its management information. Sametime Community Server Sametime Community Server is the instant messaging and presence awareness component of Sametime, which is installed as an add-in task for Domino. It must be installed on Domino versions 8.5 or 8.5.1, but it can work with earlier versions of Sametime already installed in your environment. Keep in mind, however, that pre-8.5.x clients will not benefit from many of the new features provided by your Sametime 8.5.2 servers. If your requirement is solely for instant messaging, then this is the only component you will need installed alongside Domino itself. The Sametime Community Server "standard" install also includes the original Domino-based Meeting Center. This browser-based component has not been updated in any way from pre-8.5.x versions and is there purely for backwards compatibility and to maintain any existing scheduled meetings. There is no integration or interaction between the Domino-based Meeting Center and the Sametime 8.5.2 Meeting Center(s). Other than being updated to run on top of a Domino 8.5 or 8.5.1 server, the actual Community Server component has changed very little and includes no significant new features from previous versions. Its browser administration interface and options remain the same. However, if you have deployed the SSC, the native Domino administration is over-ridden. Following is a chart of the Sametime Community Server infrastructure. Note the optional management of the server by the SSC. Although the use of Domino as a directory is still supported, it is highly recommended you deploy Sametime using a Lightweight Directory Access Protocol (LDAP) directory. If you will be deploying other Sametime 8.5.2 components, then your deployment will usually require an LDAP directory to be used. Sametime Meeting Server The Sametime Meeting server has been completely re-engineered to bring it up to the standards of modern web conferencing solutions. It is also better aligned with IBM's Sametime Unyte online service. The new Sametime Meeting Server (versus the Domino-based Meeting Center) runs as an application under WAS. In addition, as it requires a data store to hold meeting information, it utilizes a dedicated DB2 database for managing the content of each meeting room. The previous Sametime meeting client was entirely browser-based. To improve performance and functionality for 8.5.2, a rich meeting center client has been introduced which plugs into the Sametime Eclipse environment. A browser interface for meetings is still available but it provides a reduced set of functions. Sametime Proxy Server The Sametime Proxy Server re-introduces a lightweight browser-based client for Sametime, which has not been available in versions shipped since 6.5. The new browser client is designed to be lightweight and fully customizable and it is based on Ajax technology and themed using CSS. This allows it to launch quickly and be customized to match your organization's design. The Proxy Server installs as an application under WAS, although it has no data store of its own and does not require any database connectivity. In the configuration for the Proxy Server, you direct it to a specific Community Server to supply the Sametime services. The following diagram gives a brief overview: The Proxy Server ships with a default client designed as a JavaServer Page, which can be modified using customizable style sheets. It gives a feature-rich Sametime experience including multi-way chats, browser-based meetings, and privacy settings. Sametime Media Manager The Sametime Media Manager takes on the role of providing audio and video services for both the Sametime clients for peer-to-peer VoIP and video chats, and for web conferencing within the meeting rooms in the new meeting center. It is designed to provide services for multiple Meeting Servers and through them for instant meetings from the Sametime client. Installed on a WAS platform, it has no need for a data store and does not require any database connectivity. The Media Manager is designed to provide a multi-way audio and video conferencing experience using modern codecs; however, it does not support Sametime clients in versions prior to 8.5.2. It is the audio and video "glue" that connects all the other Sametime server elements in 8.5.2. Sametime TURN Server In its default configuration, the Media Manager creates a SIP connection from itself to the requesting client. However, where the client is not on the same network as the Media Manager, no SIP connection can be made directly. To address this issue, which affects users outside of your firewall as well as those on different internal networks, IBM has introduced the TURN Server with Sametime 8.5.2. The TURN server uses both TURN and STUN protocols to create a connection with the client. It routes audio and video traffic between itself and the Media Manager, allowing connections between clients across networks. The technology is sometimes referred to as a reflector and pre-8.5 versions of Sametime came with a reflector service of their own. The TURN server is a Java program that runs in a command window on any Windows or Linux server sharing the same subnet as the Media Manager. It doesn't require WAS or any data store but runs with a separately installed IBM Java Virtual Machine (JVM). Sametime Bandwidth Manager The Sametime Bandwidth Manager is a new optional WAS-based component that is designed to help Sametime administrators manage the traffic generated by the Media Manager and its audio and video services. Within the Bandwidth Manager configuration, an administrator can create sites, links, and call-rate policies that define the service provided by the Media Manager. The Bandwidth Manager analyzes its rules when a new call is initiated and instructs the Media Manager on how to service that call. Among the extremely granular levels of customization available are options for sites to have link rules that constrain the traffic between them. You can also create specific policies that specify the services available to named users or groups during peak and off-peak periods. Depending upon network load, user identity, and call participation, the Bandwidth Manager can be configured to control the bandwidth. It can do this by reducing the audio to a lower codec, reducing the video frame rate, or even denying video completely, informing the user that they should retry at a later time.
Read more
  • 0
  • 0
  • 3074

article-image-oracle-information-integration-migration-and-consolidation
Packt
23 Nov 2011
2 min read
Save for later

Oracle Information Integration, Migration, and Consolidation

Packt
23 Nov 2011
2 min read
Packt Publishing’s “Oracle Information Integration, Migration, and Consolidation” was published in September 2011. The book has just received its third successive 5-star review, with praise like the following: “Reads like an Oracle product catalog with the marketing rubbish removed and the interesting technical details added.” If “Oracle Information Integration, Migration, and Consolidation” sounds like a daunting title to grasp, then take a look at the following video from author Tom Laszewski: In this short six minute video, Tom Laszewski explains exactly how this book will benefit you, in a simple a precise manner. As Tom puts it, the book details; “Oracle products, tools and technologies for migrating to Oracle, consolidating databases to Oracle and integrating Oracle and non-Oracle application and database environments.” This practical tutorial helps you to leverage products like SQL Developer, as well as Data Hubs and 11gR2 Database. It covers everything from the early background of information integration and the impact of SOA, to products like Oracle GoldenGate and Oracle Data Integrator. A whole host of IT professionals will benefit from this book: DBAs, application or data architects, data integration specialists running Oracle database or middleware. Also application developers and technical and project leads with a focus on master data management, data warehousing, and data consolidation. Tom Laszweski is also the co-author of Packt Publishing’s “Oracle Modernization Solutions” published in September 2008, again with the success of three 5-star reviews to date. This book combines case studies with practical examples of how to implement modernization techniques using Oracle (and partner) products to modernize to the Oracle Platform.
Read more
  • 0
  • 0
  • 1465

article-image-1zo-051-oracle-database-11g-using-ansi-standard-joins
Packt
23 Nov 2011
9 min read
Save for later

1ZO-051: Oracle Database 11g: Using ANSI Standard Joins

Packt
23 Nov 2011
9 min read
  (For more resources on Oracle, see here.)   In order to join two tables, we will utilize the basic structure of a SELECT statement; but, we must add a few qualifiers. Understanding the structure and syntax of ANSI join statements When we join two tables, we add a WHERE clause that qualifies that the common columns between the tables are equivalent. The following is the syntax tree for an ANSI-compliant join: SELECT column1, column2, ...FROM table1, table2WHERE table1.common_column = table2.common_column; While the join syntax is similar in many ways to a typical select statement, we notice some differences. As you might expect, since we are selecting data from two tables, both table names are specified in the FROM clause, separated by commas The syntax of the WHERE clause is different from what we've previously seen In our WHERE clause, we specify the condition that the common column from the first table must be equal to the common column in the second In constructing this part of the statement, it is important to have first identified the common column between the tables that forms the inter-table relationship. This equivalence forms the bond between the two tables.   Examining ambiguous Cartesian joins Before we look at some examples of typical join statements, it is important to discuss one type of join that is considered undesirable in most circumstances. A Cartesian join is a join between two tables that omits the WHERE clause. The result is known as a Cartesian product. A Cartesian product is formed when every row of one table is joined to every row of another table. An example of this is shown as follows: The resulting number of rows shown has been truncated for the sake of brevity. It is fairly easy to see what is happening without displaying all 40 rows that are returned. In a Cartesian join, the query returns the first row selected from the project table, in this case Desktop Rollout, and joins it to every row selected from the award table; first, Salesperson of the year, then Technological paper winner, and so on. It then moves to the second row returned from the project table, Security awareness training, and again joins each row from the award table. It continues in this manner until every row in the project table has been joined to every row in the award table. The Cartesian product returned from a Cartesian join is generally considered undesirable because it has little meaning. Since no relationship has been established between the two tables based on a common column, the data from the project table does not relate in any logical way to the award table. Such joins are said to be ambiguous, since no row has any particular relationship to any other row. It is important to remember that even if the two tables share a common column, that relationship must be specified in the WHERE clause. Failure to do so will result in a Cartesian product. A Cartesian join is generally said to produce an a times b product, where a and b are the number of rows in the two tables. In the next screenshot, the project table has five rows, while the award table has eight rows. We can therefore say that the number of rows returned by the Cartesian product of the two tables will be 5 x 8, or 40, rows. In this way, we can predict the number of rows returned by any Cartesian join as being the number of rows in the first table times the number of rows in the second. SQL in the real world Another practical reason that Cartesian joins are considered undesirable is the immense strain they can put on a system from a performance perspective. While the 40-row Cartesian product from our example may not seem significant, consider two tables with one million rows each. The resulting number of rows from such a Cartesian product would be 1,000,000 x 1,000,000, or 1x1012, rows—one trillion rows. Such a mistake can cause excessive resource usage on your database system to the point of affecting other users. In fact, when tuning SQL statements, one of the most common examples of improper code to watch out for is Cartesian joins.   Using equi joins—joins based on equivalence The core of the RDBMS is the relationships that are formed between tables. The most common relationships are based on equivalence. In this section, we examine the concept of an equi join. Implementing two table joins with a table-dot notation To see an example of the kind of join that would be advantageous to an SQL programmer, let's return to the earlier request to display name, date of birth, and address information for all of the Companylink employees. We use two different queries to find the required information and note the inefficiency of the process. To get this information using a join, we issue the query shown in the following screenshot: Let's deconstruct the statement one line at a time. The first line is simply a list of all the columns that we want to display. The first four are columns from the employee table and the last four come from the address table. The second line specifies the tables that are involved in the query. We are requesting columns from the employee and address tables, so those tables are listed. The third line contains the clause that actually performs the join. We have stated that a join requires the linking of a common column between the tables. The only column that is common between the employee and address tables is the employee_id column; this column forms the relationship between the two tables. It is this column that we use to execute the join. The join clause performs this joining by creating a condition that sets the values for the employee_id column in the employee table equal to the employee_id column in the address table. Thus, each row in the address table is joined to each row in the employee table, but only where the values in the common columns are equivalent. The clause, however, requires that we specify which columns are being referred to, since they have the same name. To clearly delineate them, we prefix each of the columns in the WHERE clause with the name of the originating table, followed by a dot (.). We refer to this as the table-dot notation. As a result, the previous statement could be read as: Display name and address information from the employee and address tables, where the employee_id column in the employee table is equivalent to the employee_id column in the address table. To see the relationship more clearly, we could rewrite the preceding statement to include the columns that form the relationship. In the following example, we have reduced the number of columns returned (for clarity) and included both columns that form the relationship. The result shows how the employee_id values for each table match. As you can see, the rows displayed essentially show two tables joined together. The first_name, last_name, and employee.employee_id columns all belong to the employee table. The address.employee_id, street_address, and city columns belong to the address table. Yet information from both tables can be displayed together, provided that we join them with a common column. These joins are categorized as equi joins; joins based on the equivalence of values between common columns. It is crucial that we explicitly define the two columns that form the join in the WHERE clause. A failure to do so will generate an ORA-00918 error or a column ambiguously defined error. The following example shows the previous statements rewritten to exclude the tabledot notation with the originating tables, and the resulting error. Again, this results because the columns have the same name in each table, yet we have not defined the originating tables. Using two table joins with alias notation Thus far, our join examples have used two tables. However, a join can be done with any number of tables, provided they have common columns between them. We will discuss multi-table joins later in the article, but using the table-dot notation with multi-table joins is considered by some to be cumbersome, since each table and several columns must be prefixed with the associated table name. We use double quotation marks to present column headings that are different than the actual column name. It allows us not only to display a different column name, but also to utilize case sensitivity and whitespace. This type of alias is called a column alias. We now look at a table alias, a type of alias that allows us to reference a table using a different name. In the following screenshot, we have rewritten the join shown previously, this time using table aliases, or alias notation: This example is very similar to the original statement, but there is one significant difference. In the FROM clause, we have added aliases for our two tables. These aliases are designated by the letters that follow each of the table names. For the employee table, the alias is e, and for the address table, it is a. Thus, in the WHERE clause, instead of prefixing the table names employee and address to our columns, we simply use e and a in place of them. These same aliases are also used in the SELECT clause, where employee.employee_id and address.employee_id are simply written as e.employee_id and a.employee_id, respectively. Note that there is nothing particularly significant about using the letters a and e as aliases. We could just as easily have used emp and addr as our aliases. The purpose is simply to reduce the amount of coding that has to be written. Many SQL developers feel that using aliases is an efficient and readable way to write joins, especially those that involve numerous tables. SQL in the real world Although both table-dot notation and alias notation are supported in ANSI-compliant joins, the organization you work for may decide that one is preferable to the other. As with many of the choices offered to a SQL programmer, an organization's coding standards may determine how code will be written. This isn't to say that one way is necessarily better than the other, but rather to support the idea of having standards for the code written in an organization. Code standards provide rules for writing and reading code that generally lead to better interoperability between programmers.  
Read more
  • 0
  • 0
  • 3984
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €18.99/month. Cancel anytime
article-image-unreal-development-toolkit-level-design-hq
Packt
23 Nov 2011
5 min read
Save for later

Unreal Development Toolkit: Level Design HQ

Packt
23 Nov 2011
5 min read
(For more resources related to this subject, see here.) So let's get on with it. We will first look at downloading the UDK, and install it on your PC. Time for action – UDK download and installation Download the latest version of UDK. Log on to www.udk.com and download the latest version of unreal development kit beta. Once you download the UDK Installer, go ahead and install the UDK. The default directory for installing UDK is C:UDKUDK-VersionRelease. Version Release will be the month and year that the UDK you downloaded was built. UDK folder structure The UDK folder structure looks like the following screenshot: The UDK folder structure consists of the following four folders: Binaries: game/binary executable. Development: source code for UDK. Engine: engine files. UTGame: game files. For level-design and environment creation, the important folder here is the content folder. The packaged environment's assets such as models, textures, materials, sounds, and such are stored here. For environment creation and level design, the most important folder is UTGame | Content | Environments. It contains all the files you need to create your map, as shown in the following screenshot: UDK extension is the UDK package's name. This is how the models and textures are stored in UDK. Think of UDK extension as folders. Inside those folders are stored all the models, animations, textures, materials, and similar assets. You can browse the UDK files through the UDK editor.   UDK is the map file extension.   Time for action – launching the editor To launch the unreal editor, go to the Start Menu | Unreal Development Kit | UDK Version | Editor. Another way to launch the editor is to create a shortcut. To do this, go to the installation folder: UDKUDK-VersionReleaseBinaries, locate UDKLift.exe, right-click and select Send To | Desktop (create shortcut), as shown in the following screenshot: Once on you have created the shortcut on your desktop, right-click the shortcut and select Properties. Then, in the Target box under the Shortcut tab, add editor at the end of the text. It should look something like the following screenshot: Now double-click on the desktop icon and launch the UDK Editor. Autosave When you first launch the editor, you will have Autosave automatically enabled. This will save your map at a chosen timed interval. You can set how often it will automatically save by clicking the Left Mouse Button (LMB) on the arrow on the bottom-right of the Autosave Interval and choosing the time you want, as shown in the following screenshot: You will find the Autosave feature at the bottom right of the editor. If you enable Autosave, there are a few options such as Interval and Type. Save manually by going up to File | Save As. Content browser Content browser is where you will find off the game's assets. Placing static meshes (models), textures, sounds, and game entities such as player starts, weapons, and so on, can all be done through the content browser. You will be using the content browser very often. To open the content browser click on the top menu bar, as shown in the following screenshot: Packages are where you will find specific items contained within the UDK. Things such as static meshes are contained within a package. You can search for a package, or just find the package you want to use and select it as shown in the following screenshot: The top of the content browser contains a search box as well as a filter box. This is very useful. You can sort out the content in the browser by animation sets, material instances, static meshes, sounds, and so on. This helps a lot when looking for items. The next screenshot lists full names of the items within a selected package. You can sort by clicking on the Name, Type, Tags, or Path fields, and it will re-arrange the content's preview: The content browser is one of the most commonly used tools in UDK. Get comfortable using the content browser. Spend some time navigating around it. UDK basics covers the most essential tools and functions you need to know to get started with UDK. You'll be able to quickly jump into UDK and begin feeling comfortable using the most commonly used functions. What just happened? So we know how to launch the editor, how to use the Autosave function, and where to find the content browser. We are now going to look at how to move and rotate around the editor. Time for action – movement and rotation Time to have a look at movement, rotation, and navigating around the editor. Navigation Buttons used to navigate around UDK. UDK These are your primary keys for navigating and rotating using the editor: Left Mouse Button (LMB): pan right/left/forward/backward movements Right Mouse Button (RMB): rotate, look around LMB+RMB: up/down WASD key navigation The following are other forms of primary keys for navigating and rotating around the editor: Click and hold RMB. As you hold it, use the WASD keyboard keys to move around as you would in a first person shooter game. WASD movement is great if you are familiar with hammer source mapping. MAYA users If you are familiar with Maya, the following will be your primary keys for navigating and rotating around the editor. Hold down the U key U+ LMB: rotate, look around U+ RMB: forward/backward movements U+ MMB: right/left/up/down movements What just happened? Now that you have installed UDK and know what the content browser is, you are ready to begin. So let's get started.
Read more
  • 0
  • 0
  • 8363

article-image-attracting-traffic
Packt
23 Nov 2011
5 min read
Save for later

Attracting Traffic

Packt
23 Nov 2011
5 min read
(For more resources on WordPress, see here.) Making it easy for people to follow you Take a look at some of the most popular bloggers in the world, and compare their sites. You will notice that, without fail, they all make it really easy to follow them by RSS and Twitter and more often than not Facebook or LinkedIn. Look at the copyblogger home page in the following screenshot: (Move the mouse over the image to enlarge.) Notice how prominently displayed at the top right of the page is a list of large visually recognizable buttons that allow visitors to subscribe to their newsletter, RSS feed, follow them on Twitter, or like them on Facebook. Anyone who is interested in learning about online marketing can, at the click of a button, access all the latest content provided by copyblogger. While gaining a follower on Twitter doesn't necessarily bring revenue directly, each and every follower is a potential customer, or someone who will potentially recommend your blog to a potential customer. This meets the hugely important business objective of increasing reach for the site and its content—something you must also do if you are to have any hope of penetrating the market. WordPress.com has an RSS link widget that can add a nice orange RSS icon to any one of the widget areas in your theme. This is unfortunately not really suitable for our needs as we need a row of icons and links to a number of different things. In order to get a nice row of icons, we will need to write a bit of HTML code and add it to a custom Text widget. WordPress.org users can simply install something like the Subscribe/ Connect/Follow widget, available at http://wordpress.org/ extend/plugins/subscribe-connect-follow-widget. Creating a custom "Follow me" widget Before you begin adding the links, you will need to find and download a set of icons. A search on Google for "social network icons" should bring up some useable results. Remember to make sure that you do not infringe on any copyright conditions. Only use icons that are freely available. Once you have the icons you want (preferably large, instantly recognizable ones), upload them to your media folder on your site so that they can be referenced in the links. For example, the following screenshot shows the Upload New Media page being used to upload an RSS icon: Note in particular that the icon has been given a File URL. It is this URL you will use to reference this icon in the HTML that follows. Once all the requisite icon files are uploaded to your media library, you are ready to drag a new Text widget to the top right of your page and copy and paste the following HTML into it: <ul><li style="display:inline;"><a href="path_to_email"><img src="email_icon_file_url" alt="contact me via email"  /></a></li><li style="display:inline;"><a href="path_to_rss"><img src="rss_icon_file_url " alt="subscribe to my RSS feed"  /></a></li><li style="display:inline;"><a href="path_to_twitter "><img src="twitter_icon_file_url " alt="follow me on twitter"  /></a></li><li style="display:inline;"><a href="path_to_linkedin"><img src="linkedin_icon_file_url" alt="connect with me on  linked in" /></a></li></ul> Make sure that you change the paths in the code to suit your own setup. For example, this code used in my social marketing crash course home page on WordPress looks as shown in the following screenshot: With the icon files correctly referenced, the individual e-mail (you can add your own contact form using the Add New Post page and clicking on the Add a custom form icon), Twitter, RSS, and linked pages also correctly linked to, you can save the Text widget. You might decide to add Facebook or other icons, or you might not want to use LinkedIn. It is easy to add and remove new icons by copying and pasting additional link (<li></li>) elements into the unordered list parent tags (<ul></ul>). In this case, the resulting links are displayed on the live site as shown in the following screenshot: OK, so the icons here are possibly a bit too small. I could hunt around for bigger ones, but it is also easy to add a bit of text to the links (after the img tag), or use some HTML to modify the layout to suit. The goal is to make it very easy and clear for any visitor to convert into a follower. By prominently displaying the various ways in which visitors can convert to followers, you upgrade your blog from the old baseball paradigm to the new black hole paradigm. As time goes by, you will benefit by building up a large network of followers who double as potential customers, and an army of marketers who can spread the word about your content, products, and services. Summary By utilizing your quality content and making it very easy for people so stay within reach of it through RSS, Twitter, Facebook, LinkedIn, and any other appropriate services, you drastically improve your chances of converting visitors into followers. Further resources on this subject: Dynamic Menus in WordPress [Article] Getting Started with WordPress 3 [Article] Social Bookmarking with WordPress Plugin [Article] Tips and Tricks for Working with jQuery and WordPress [Article]
Read more
  • 0
  • 0
  • 1977

article-image-irrlicht-creating-basic-template-application
Packt
21 Nov 2011
3 min read
Save for later

Irrlicht: Creating a Basic Template Application

Packt
21 Nov 2011
3 min read
(For more resources related to this topic, see here.) Creating a new empty project Let's get started by creating a new project from scratch. Follow the steps that are given for the IDE and operating system of your choice. Visual Studio Open Visual Studio and select File | New | Project from the menu. Expand the Visual C++ item and select Win32 Console Application. Click on OK to continue: In the project wizard click on Next to edit the Application Settings. Make sure Empty project is checked. Whether Windows application or Console application is selected will not matter. Click on Finish and your new project will be created: Let's add a main source file to the project. Right-click on Source Files and select Add New Item...|. Choose C++ File(.cpp) and call the file main.cpp: CodeBlocks Use the CodeBlocks project wizard to create a new project as described in the last chapter. Now double-click on main.cpp to open this file and delete its contents. Your main source file should now be blank. Linux and the command line Copy the make file of one of the examples from the Irrlicht examples folder to where you wish to create your new project. Open the make file with a text editor of your choice and change, in line 6, the target name to what you wish your project to be called. Additionally, change, in line 10, the variable IrrlichtHome to where you extracted your Irrlicht folder. Now create a new empty file called main.cpp. Xcode Open Xcode and select File | New Project. Select Command Line Tool from Application. Make sure the type of the application is set to C++ stdc++: When your new project is created, change Active Architecture to i386 if you are using an Intel Mac, or ppc if you are using a PowerPC Mac. Create a new target by right-clicking on Targets, select Application and click on Next. Target Name represents the name of the compiled executable and application bundle: The target info window will show up. Fill in the location of the include folder of your extracted Irrlicht package in the field Header Search Path and make sure the field GCC_ PREFIX_HEADER is empty: Right-click on the project file and add the following frameworks by selecting Add Existing Frameworks...|: Cocoa.framework Carbon.framework IOKit.framework OpenGL.framework Now, we have to add the static library named libIrrlicht.a that we compiled in Chapter 1, Installing Irrlicht. Right-click on the project file and click on Add | Existing Frameworks.... Now click on the button Add Other... and select the static library. Delete the original compile target and delete the contents of main.cpp. Time for action – creating the main entry point Now that our main file is completely empty, we need a main entry point. We don't need any command-line parameters, so just go ahead and add an empty main() method as follows: int main(){ return 0;} If you are using Visual Studio, you need to link against the Irrlicht library. You can link from code by adding the following line of code: #pragma comment(lib, "Irrlicht.lib") This line should be placed between your include statements and your main() function. If you are planning to use the same codebase for compiling on different platforms, you should use a compiler-specific define statement, so that this line will only be active when compiling the application with Visual Studio. #if defined(_MSC_VER) #pragma comment(lib, "Irrlicht.lib")#endif
Read more
  • 0
  • 0
  • 8600

article-image-5-sharepoint-2010-development-tips
Packt
21 Nov 2011
4 min read
Save for later

5 SharePoint 2010 Development Tips

Packt
21 Nov 2011
4 min read
By Balaji Kithiganahalli, author of Microsoft SharePoint 2010 Development with Visual Studio 2010 Expert Cookbook You are an experienced .NET programmer with lots of successful projects under your belt. Now you have a client who wants you to develop some custom solutions like workflows, WebParts and others for SharePoint 2010. You feel confident that your experience in .NET programming will easily translate and you will be up and running in no time in a SharePoint environment. For the most part it is all true. This article helps developers to transit to SharePoint development with ease. Here are some of the tips that help developers to dig deep into SharePoint programming. Be a SharePoint user: It is hugely necessary for a developer to understand the User Interface (UI) flow, the terminology, and to get familiarized with the actions. Be a power user of the product before you start developing for it. This helps you in creating applications that blend in with existing out-of-the-box or third party solutions that get deployed. The best tip for any developer is that 'creating a custom solution' should be a last resort. Try to use out-of-the-box functionality and if this does not satisfy business requirements, you may have to think about a custom solution. Understand SharePoint Administration: Now I am not saying you need to be an expert in SharePoint administration. Being one is not a bad idea, mind you. But it is very necessary for a developer to understand the common administration tasks of SharePoint. Now this is a little awkward for some developers who are in their little cuckoo nest which they don’t want to come out of. For lots of developers, administration is like an alien job that people who don’t understand development do. But remember, you the developer need to manage and administer your own development environment. There are tools that come with SharePoint that developers and administrators alike will use to perform certain configuration tasks on SharePoint. These tools, STSADM or SharePoint PowerShell, provide command line access to operations to run administration tasks. SharePoint PowerShell comes with hundreds of cmdlets for you to use. You don’t need to be an expert in all of them. But there are quite a lot of cmdlets like deploying a solution or retracting a solution, turning on or off the development dashboard, etc. Understanding these are important for a developer as well. [Packt note: we just published Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook]. Development Environment: You are a power user and also understand the administration aspects of the SharePoint environment. You really want to develop your first custom solution for SharePoint. Before you go and install SharePoint foundation or enterprise version, make sure to verify that your computer is capable of running the software. SharePoint 2010 runs only on the 64 bit OS. SharePoint 2010 can run on Windows 7 as well. Even though the SharePoint installation software does a pretty good job of verifying the system requirements before installation, as a developer, you need to make sure to have a pretty good amount of RAM, rather than working with bare minimum specifications. It is recommended to use a separate virtual machine with Windows Server 2008 with SP2. You need SQL Server 2008 with the latest service packs or SQL Server 2008 R2. It also works with SQL Server 2005 with SP3 or later. IIS Reset: Many times during development, you will end up resetting the W3WP.exe process. This is usually done by resetting the IIS. Many a times that is not needed, all you need to do is reset your application pool. This is because, resetting IIS takes a long time, and avoiding IIS resets also reduces the downtime of other sites that are running on the server. Resetting the application pool that your site is running on will be faster and only applies to sites that are running in that app pool. SharePoint Designer:SharePoint designer is a great tool that can be used for quite a lot of customizations. The main advantage is quick development compared to Visual Studio. But remember, many organizations do not allow SPD to be used for customizations of SharePoint due to lack of proper support to source control integrations. SPD though is good for rapid development but has limitations on deployment from one environment to another. It is always necessary as a developer for you to educate clients on the disadvantages of any tool. In this article, we learnt about some of the initial tasks that a SharePoint developer, coming from a background of .NET development, need to know. In future articles, I will dig deep into the development world of SharePoint using Visual Studio 2010. In the meantime, get to know your SharePoint environment and provide your own suggestions for the other developers.
Read more
  • 0
  • 0
  • 1363
article-image-top-10-tips-organizing-agile-it-security-team
Packt
18 Nov 2011
5 min read
Save for later

Top 10 tips for organizing an Agile IT Security Team

Packt
18 Nov 2011
5 min read
Agile Professional This means that Agile IT security professionals need to understand access management; database security; application design; endpoint, network and server security; and physical security tooling. They need to understand the threats and risks that face an organization and be able to work well with other team members. Pairwise Agile security professionals frequently work in paired teams. When people work together, they are forced to reconcile any differences to ensure that they share the vision on a given assignment. The ability to reconcile ensures better understanding of the tasks at hand and how to approach them. It is difficult for both members of the security team to have a misunderstanding when they are required to work together to organize thoughts. Such an approach also aligns itself with the concept of mutual ownership, which means that anyone can fix anything, anywhere, when needed, which is another core function in Agile. Collective Ownership One Principle of Agile IT Security is the principle of collective ownership. Everyone on the team owns every artifact, solution and system. To achieve collective ownership you must consider reducing the area of expertise, or silo, and work on having more generalized team members as much as possible. By having people more generalized we reduce risks, bottle necks, and improve flexibility. We, in effect, become more Agile. By reducing specialists, we reduce the need for as much documentation. We reduce the bottle necks because multiple people on the team can do the same job that will allow a team to load balance work appropriately. It also reduces the risk of not having a skill set due to attrition. If someone leaves the company we have other people who can fill that role. Small deliverables In Agile, we focus on small deliverables. Small deliverables allow us to build momentum with the team and to see completion early and to level pressure over time. Usually, when we have long projects, we end up missing the dates because the early months were not maximized. Small releases helps a team better manage a large project. Agile Spike An Agile Spike is used whenever a team is faced with implementing a solution that is not fully understood. A team may be struggling with a number of issues such as the amount of traffic a solution will see, or the number of users that a solution will have. A Spike is a pilot project that attacks risks. Agile Spikes are always time boxed to reduce the risk of scope creep and keep our project on schedule. Whenever a team is faced with uncertainty when implementing a solution, Agile teams will look to create a Spike. Essentially what we do is create model architecture of our solution with our best guesses as to how the system will behave. Once the Spike is developed we can watch and observe this model to better understand how the real solution will behave in production. Our goal is to understand how it is going to behave and learn any early lessons before we begin the real project. Minimizing Waste Failure is a huge form of waste but is relatively unavoidable when delivering any new security practices. So the best way to minimize waste is to fail fast. To fail fast you must create an environment were failing is expected and encouraged. When team members are comfortable with the idea of failure, team members will be more vocal about failing and ask for help. Project Velocity Rate Project Velocity measures the effort involved in delivering the project. Understanding how a team is doing in terms of understanding the requirements and the rate at with the team is working is helpful in understanding if dates are going to be met. Collaboration Collaborating together as a team is one of the hallmark principles of Agile mostly because of the simple idea that two brains are better than one. Collaborating comes in two forms, collaborating with a team in the same physical location, and collaborating with a team in geographically different areas. Considerations should be made to help facilitate the collaborative process for both physically located and geographically distributed team. Agile Planning Poker One of the ways we can estimate the time needed to complete a project is to use a trick learned in the Agile software development community. It’s time to play a little poker. Poker? Yes poker. Using Agile Poker cards, timers, and basic Agile Poker rules we can have a little fun while achieving unparalleled accuracy when planning time. The game ends when all members agree upon the amount of time needed to complete the project. Or the project owner, the person who will be responsible for delivering the project sees a majority vote that seems reasonable. Standup Meeting Agile IT security implementers prefer to meet standing up. Most people spend too much of their days in meetings. It is important to conduct meetings so that we can communicate and collaborate, but it’s not good to simply meet. A solid approach to make meetings more productive is to conduct it while all participants are standing.
Read more
  • 0
  • 0
  • 5148

article-image-article-ab-numpy-abr1-1111utm_sourceab_numpy_abr1_1111utm_mediumcontentutm_campaignapoorva
Packt
11 Nov 2011
10 min read
Save for later

NumPy: Commonly Used Functions

Packt
11 Nov 2011
10 min read
  (For more resources on this topic, see here.) File I/O First, we will learn about file I/O with NumPy. Data is usually stored in files. You would not get far if you are not able to read from and write to files. Time for action – reading and writing files As an example of file I/O, we will create an identity matrix and store its contents in a file. Identity matrix creation Creating an identity matrix: The identty matrix is a square matrix with ones on the diagonal and zeroes for the rest. The identity matrix can be created with the eye function. The only argument we need to give the eye function is the number of ones. So, for instance, for a 2-by-2 matrix, write the following code: code1 The output is: code2 Saving data: Save the data with the savetxt function. We obviously need to specify the name of the file that we want to save the data in and the array containing the data itself: code3 A file called eye.txt should have been created. You can check for yourself whether the contents are as expected. What just happened? Reading and writing files is a necessary skill for data analysis. We wrote to a file with savetxt. We made an identity matrix with the eye function. CSV files Files in the comma separated values (CSV) format are encountered quite frequently. Often, the CSV file is just a dump from a database file. Usually, each field in the CSV file corresponds to a database table column. As we all know, spreadsheet programs, such as Excel, can produce CSV files as well. Time for action – loading from CSV files How do we deal with CSV files? Luckily, the loadtxt function can conveniently read CSV files, split up the fields and load the data into NumPy arrays. In the following example, we will load historical price data for Apple (the company, not the fruit). The data is in CSV format. The first column contains a symbol that identifies the stock. In our case, it is AAPL, next in our case. Nn is the date in dd-mm-yyyy format. The third column is empty. Then, in order, we have the open, high, low, and close price. Last, but not least, is the volume of the day. This is what a line looks like: code4 How do we deal with CSV files? Luckily, the loadtxt function can conveniently read CSV files, split up the fields and load the data into NumPy arrays. In the following example, we will load historical price data for Apple (the company, not the fruit). The data is in CSV format. The first column contains a symbol that identifies the stock. In our case, it is AAPL, next in our case. Nn is the date in dd-mm-yyyy format. The third column is empty. Then, in order, we have the open, high, low, and close price. Last, but not least, is the volume of the day. This is what a line looks like: code5 As you can see, data is stored in the data.csv file. We have set the delimiter to , (comma), since we are dealing with a comma separated value file. The usecols parameter is set through a tuple to get the seventh and eighth fields, which correspond to the close price and volume. Unpack is set to True, which means that data will be unpacked and assigned to the c and v variables that will hold the close price and volume, respectively. What just happened? CSV files are a special type of file that we have to deal with frequently. We read a CSV file containing stock quotes with the loadtxt function. We indicated to the loadtxt function that the delimiter of our file was a comma. We specified which columns we were interested in, through the usecols argument, and set the unpack parameter to True so that the data was unpacked for further use. Volume weighted average price Volume weighted average price (VWAP) is a very important quantity. The higher the volume, the more significant a price move typically is. VWAP is calculated by using volume values as weights. Time for action – calculating volume weighted average price These are the actions that we will take: Read the data into arrays. Calculate VWAP: code6 What just happened? That wasn't very hard, was it? We just called the average function and set its weights parameter to use the v array for weights. By the way, NumPy also has a function to calculate the arithmetic mean. The mean function The mean function is quite friendly and not so mean. This function calculates the arithmetic mean of an array. Let's see it in action: code7 Time weighted average price Now that we are at it, let's compute the time weighted average price too. It is just a variation on a theme really. The idea is that recent price quotes are more important, so we should give recent prices higher weights. The easiest way is to create an array with the arange function of increasing values from zero to the number of elements in the close price array. This is not necessarily the correct way. In fact, most of the examples concerning stock price analysis in this book are only illustrative. The following is the TWAP code: code8 It produces this output: code9 The TWAP is even higher than the mean. Pop quiz – computing the weighted average Which function returns the weighted average of an array?   Reading from a file: First, we will need to read our file again and store the values for the high and low prices into arrays: code10 The only thing that changed is the usecols parameter, since the high and low prices are situated in different columns. Getting the range: The following code gets the price range: code11 These are the values returned: code12 Now, it's trivial to get a midpoint, so it is left as an exercise for the reader to attempt. Calculating the spread: NumPy allows us to compute the spread of an array with a function called The ptp function returns the difference between the maximum and minimum values of an array. In other words, it is equal to max(array) – min(array). Call the ptp function: code13 You will see this: code14 Determine the median of the close price: Create a new Python script and call it simplestats.py. You already know how to load the data from a CSV file into an array. So, copy that line of code and make sure that it only gets the close price. The code should appear like this, by now: code15 The function that will do the magic for us is called median. We will call it and print the result immediately. Add the following line of code: The function that will do the magic for us is called median. We will call it and print the result immediately. Add the following line of code: code16 The program prints the following output: code17 Since it is our first time using the median function, we would like to check whether this is correct. Not because we are paranoid or anything! Obviously, we could do it by just going through the file and finding the correct value, but that is no fun. Instead we will just mimic the median algorithm by sorting the close price array and printing the middle value of the sorted array. The msort function does the first part for us. We will call the function, store the sorted array, and then print it: code18 This prints the following output: code19 Yup, it works! Let's now get the middle value of the sorted array: code20 It gives us the following output: code21 Hey, that's a different value than the one the median function gave us. How come? Upon further investigation we find that the median function return value doesn't even appear in our file. That's even stranger! Before filing bugs with the NumPy team, let's have a look at the documentation. This mystery is easy to solve. It turns out that our naive algorithm only works for arrays with odd lengths. For even-length arrays, the median is calculated from the average of the two array values in the middle. Therefore, type the following code: code22 This prints the following output: code23 Success! Another statistical measure that we are concerned with is variance. Variance tells us how much a variable varies. In our case, it also tells us how risky an investment is, since a stock price that varies too wildly is bound to get us into trouble. Calculate the variance of the close price: With NumPy, this is just a one liner. See the following code: code24 This gives us the following output: code25 Not that we don't trust NumPy or anything, but let's double-check using the definition of variance, as found in the documentation. Mind you, this definition might be different than the one in your statistics book, but that is quite common in the field of statistics. The variance is defined as the mean of the square of deviations from the mean, divided by the number of elements in the array. Some books tell us to divide by the number of elements in the array minus one. code26 The output is as follows: code27 Just as we expected! weighted average waverage average avg Have a go hero – calculating other averages Try doing the same calculation using the open price. Calculate the mean for the volume and the other prices. Value range Usually, we don't only want to know the average or arithmetic mean of a set of values, which are sort of in the middle; we also want the extremes, the full range—the highest and lowest values. The sample data that we are using here already has those values per day—the high and low price. However, we need to know the highest value of the high price and the lowest price value of the low price. After all, how else would we know how much our Apple stocks would gain or lose. Time for action – finding highest and lowest values The min and max functions are the answer to our requirement. What just happened? We defined a range of highest to lowest values for the price. The highest value was given by applying the max function to the high price array. Similarly, the lowest value was found by calling the min function to the low price array. We also calculated the peak to peak distance with the ptp function. Statistics Stock traders are interested in the most probable close price. Common sense says that this should be close to some kind of an average. The arithmetic mean and weighted average are ways to find the center of a distribution of values. However, both are not robust and sensitive to outliers. For instance, if we had a close price value of a million dollars, this would have influenced the outcome of our calculations. Time for action – doing simple statistics One thing that we can do is use some kind of threshold to weed out outliers, but there is a better way. It is called the median, and it basically picks the middle value of a sorted set of values. For example, if we have the values of 1, 2, 3, 4 and 5. The median would be 3, since it is in the middle. These are the steps to calculate the median: What just happened? Maybe you noticed something new. We suddenly called the mean function on the c array. Yes, this is legal, because the ndarray object has a mean method. This is for your convenience. For now, just keep in mind that this is possible.
Read more
  • 0
  • 0
  • 10714

article-image-configuration-salesforce-crm
Packt
04 Nov 2011
13 min read
Save for later

Configuration in Salesforce CRM

Packt
04 Nov 2011
13 min read
(For more resources on this topic, see here.) We will look at the mechanisms for storing data in Salesforce and at the concepts of objects and fields. The features that allow these data to be grouped and arranged within the application are then considered by looking at Apps, Tabs, Page Layouts, and Record Types. Finally, we take a look at some of the features that allow views of data to be presented and customized by looking in detail at related lists and list views. Relationship between profile and the features that it controls The following diagram describes the relationship that exists between the profile and the features that it controls: The profile is used to: Control access to the type of license specified for the user and any login hours or IP address restrictions that are set. Control access to objects and records using the role and sharing model. If the appropriate object-level permission is not set on the user's profile, then the user will be unable to gain access to the records of that object type in the application. In this article, we will look at the configurable elements that are set in conjunction with the profile. These are used to control the structure and the user interface for the Salesforce CRM application. Objects Objects are a key element in Salesforce CRM as they provide a structure for storing data and are incorporated in the interface, allowing users to interact with the data. Similar in nature to a database table, objects have properties such as: Fields which are similar in concept to a database column Records which are similar in concept to a database row Relationships to other objects Optional tabs which are user interface components to display the object data Standard objects Salesforce provides standard objects in the application when you sign up and these include Account, Contact, Opportunity, and so on. These are the tables that contain the data records in any standard tab such as Accounts, Contacts, or Opportunities. In addition to the standard objects, you can create custom objects and custom tabs. Custom objects Custom objects are the tables you create to store your data. You can create a custom object to store data specific to your organization. Once you have the custom objects and have created records for these objects, you can also create reports and dashboards based on the record data in your custom object. Fields Fields in Salesforce are similar in concept to a database column and store the data for the object records. An object record is analogous to a row in a database table. Standard fields Standard fields are predefined fields that are included as standard within the Salesforce CRM application. Standard fields cannot be deleted but non-required standard fields can be removed from page layouts whenever necessary. With standard fields, you can customize visual elements that are associated to the field such as field labels and field-level help as well certain data definitions such as picklist values, the formatting of auto-number fields (which are used as unique identifiers for the records), and setting of field history tracking. Some aspects, however, such as the field name cannot be customized and some standard fields (such as Opportunity Probability) do not allow the changing of the field label. Custom fields Custom fields are unique to your business needs and can not only be added and amended, but also deleted. Creating custom fields allow you to store the information that is necessary for your organization. Both standard and custom fields can be customized to include custom help text to help users understand how to use the field: Object relationships Object relationships can be set on both standard and custom objects and are used to define how records in one object relates to records in another object. Accounts, for example, can have a one-to-many relationship with opportunities and these relationships are presented in the application as related lists. Apps An app in Salesforce is a container for all the objects, tabs, processes, and services associated with a business function. There are standard and custom apps that are accessed using the App menu located at the top-right of the Salesforce page as shown in the following screenshot: When users select an app from the App menu, their screen changes to present the objects associated with that app. For example, when switching from an app that contains the Campaign tab to one that does not, the Campaign tab no longer appears. This feature is applied to both standard and custom apps. Standard apps Salesforce provides standard apps such as Sales, Call Center, and Marketing. Custom apps A custom app can optionally include a custom logo. Both standard and custom apps consist of a name, a description, and an ordered list of tabs. Tabs A tab is a user-interface element which, when clicked, displays the record data on a page specific to that object. Hiding and showing tabs To customize your personal tab settings follow the path Your Name Setup | My Personal Settings | Change My Display | Customize My Tabs|. Now, choose the tabs that will display in each of your apps by moving the tab name between the Available Tabs and the Selected Tabs sections and click Save. The following shows the section of tabs for the Sales app: To customize the tab settings of your users, follow the path Your Name Setup | Administration Setup | Manage Users | Profiles|. Now select a profile and click Edit. Scroll down to the tab settings section of the page as shown in the following screenshot: Standard tabs Salesforce provides tabs for each of the standard objects that are provided in the application when you sign up. For example, there are standard tabs for Accounts, Contacts, Opportunities, and so on: Visibility of the tab depends on the setting on the tab display setting for the app. Custom tabs You can create three different types of custom tabs: Custom Object Tabs, Web Tabs, and Visualforce Tabs. Custom Object Tabs allow you to create, read, update, and delete the data records in your custom objects. Web Tabs display any web URL in a tab within your Salesforce application. Visualforce Tabs display custom user-interface pages created using Visualforce. Creating custom tabs: The text displayed on the custom tab is set from the Plural label of the custom object which is entered when creating the custom object. If the tab text needs to be changed this can be done by changing the Plural label stored on the custom object. Salesforce.com recommends selecting the Append tab to users' existing personal customizations checkbox. This benefits your users as they will automatically be presented with the new tab and can immediately access the corresponding functionality without having to first customize their personal settings themselves. It is recommended that you do not show tabs by setting appropriate permissions so that the users in your organization cannot see any of your changes until you are ready to make them available. You can create up to 25 custom tabs in Enterprise Edition and as many as you require in Unlimited Edition. To create custom tabs for a custom object, follow the path Your Name Setup | App Setup | Create | Tabs|. Now select the appropriate tab type and/or object from the available selections as shown in the following screenshot: (Move the mouse over the image to enlarge.) Creating custom objects Custom objects are database tables that allow you to store data specific to your organization in Salesforce.com. You can use custom objects to extend Salesforce functionality or to build new application functionality. You can create up to 200 custom objects in Enterprise Edition and 2000 in Unlimited Edition. Once you have created a custom object, you can create a custom tab, custom-related lists, reports, and dashboards for users to interact with the custom object data. To create a custom object, follow the path Your Name Setup | App Setup | Create | Objects|. Now click New Custom Object, or click Edit to modify an existing custom object. The following screenshot shows the resulting screen: On the Custom Object Definition Edit page, you can enter the following: Label: This is the visible name that is displayed for the object within the Salesforce CRM user interface and shown on pages, views, and reports, for example. Plural Label: This is the plural name specified for the object which is used within the application in places such as reports and on tabs if you create a tab for the object. Gender (language dependent): This field appears if your organization-wide default language expects gender. This is used for organizations where the default language settings is for example, Spanish, French, Italian, German among many others. Your personal language preference setting does not affect whether the field appears or not. For example, if your organization's default language is English but your personal language is French, you will not be prompted for gender when creating a custom object. Starts with a vowel sound: Use of this setting depends on your organization's default language and is a linguistic check to allow you to specify whether your label is to be preceded by "an" instead of "a". For example, resulting in reference to the object as "an Order" instead of "a Order" as an example. Object Name: A unique name used to refer to the object. Here, the Object Name field must be unique and can only contain underscores and alphanumeric characters. It must also begin with a letter, not contain spaces, not contain two consecutive underscores, and not end with an underscore. Description: An optional description of the object. A meaningful description will help to explain the purpose for your custom objects when you are viewing them in a list. Context-Sensitive Help Setting: Defines what information is displayed when your users click the Help for this Page context-sensitive help link from the custom object record home (overview), edit, and detail pages, as well as list views and related lists. The Help & Training link at the top of any page is not affected by this setting. It always opens the Salesforce Help & Training window. Record Name: This is the name that is used in areas such page layouts, search results, key lists, and related lists as shown next. Data Type: The type of field for the record name. Here the data type can be either text or auto-number. If the data type is set to be text, then when a record is created, users must enter a text value which does not need to be unique. If the data type is set to be Auto Number, it becomes a read-only field whereby new records are automatically assigned a unique number: Display Format: As in the preceding example, this option only appears when the Data Type is set to Auto Number. It allows you to specify the structure and appearance of the Auto Number field. For example: {YYYY}{MM}-{000} is a display format that produces a 4-digit year, 2-digit month prefix to a number with leading zeros padded to 3 digits. Example data output would include: 201203-001; 201203-066; 201203-999; 201203-1234. It is worth noting that although you can specify the number to be 3 digits if the number of records created becomes over 999 the record will still be saved but the automatically incremented number becomes 1000, 1001, and so on. Starting Number: As described, Auto Number fields in Salesforce CRM are automatically incremented for each new record. Here you must enter the starting number for the incremental count (which does not have to be set to start from 1). Allow Reports: This setting is required if you want to include the record data from the custom object in any report or dashboard analytics. Such relationships can be either a lookup or a master-detail. Lookup relationships create a relationship between two records so you can associate them with each other. Master-detail relationship creates a relationship between records where the master record controls certain behaviors of the detail record such as record deletion and security. When the custom object has a master-detail relationship with a standard object or is a lookup object on a standard object, a new report type will appear in the standard report category. The new report type allows the user to create reports that relate the standard object to the custom object which is done by selecting the standard object for the report type category instead of the custom object. Allow Activities: Allows users to include tasks and events related to the custom object records which appear as a related list on the custom object page. Track Field History: Enables the tracking of data field changes on the custom object records, such as who changed the value of a field and when it was changed. Fields history tracking also stores the value of the field before and after the fields edit. This feature is useful for auditing and data quality measurement and is also available within the reporting tools. Deployment Status: Indicates whether the custom object is now visible and available for use by other users. This is useful as you can easily set the status to In Development until you are happy for users to start working with the new object. Add Notes & Attachments: This setting allows your users to record notes and attach files to the custom object records. When this is specified, a related list with New Note and Attach File buttons automatically appears on the custom object record page where your users can enter notes and attach documents. The Add Notes & Attachments option is only available when you create a new object. Launch the New Custom Tab Wizard: Starts the custom tab wizard after you save the custom object. The New Custom Tab Wizard option is only available when you create a new object. Creating custom object relationships Considerations to be observed when creating object relationships: Create the object relationships as a first step before starting to build the custom fields, page layouts, and any related list The Related To entry cannot be modified after you have saved the object relationship Each custom object can have up to two master-detail relationship and up to 25 total relationships. When planning to create a master-detail relationship on an object be aware that it can only be created before the object contains record data Clicking Edit List Layout allows you to choose columns for the key views and lookups The Standard Name field is required on all custom object-related lists and also on any page layouts
Read more
  • 0
  • 0
  • 9360
article-image-animating-properties-and-tweening-pages-android-3-0
Packt
02 Nov 2011
8 min read
Save for later

Animating Properties and Tweening Pages in Android 3-0

Packt
02 Nov 2011
8 min read
(For more resources on Android, see here.) Note for developers using versions of Android before 3.0 So far, everything we have learned has been backwards-compatible with previous versions of Android. This will hold true for the first part of this article, but not the second. That is to say that ViewFlippers are backwards-compatible with previous versions of Android, but ValueAnimators and ObjectAnimators are new in version 3.0. At the time of writing (mid-2011), the Android Compatibility Package does not help with this problem. Turning pages with a ViewFlipper ViewFlipper is a neat little wrapper class for applying a page-turning animation to a set of pages. It makes use of the tween animation classes, and extends them with an XML interface. The ViewFlipper is actually a subclass of something called a ViewAnimator. Do not get confused! A ViewAnimator is a completely different class to a ValueAnimator or an ObjectAnimator, and they are not interchangeable. Let's see more. Time for action – making an interactive book You have been hired by a children's book publisher to make an interactive book. The book will teach kindergarten children about different sorts of motion by showing them small animations on the pages. First up, we will use a ViewFlipper widget to make an animated page-turning interface. What better way to learn about a page-turning widget than by using it to make a book? We will also add some simple pages to test the ViewFlipper, which we can add animations to in some later examples. Create a new Android project with the following settings: Project name: Interactive Book Build target: Android 3.0 Application name: Interactive Book Package name: com.packt.animation.interactivebook Activity: InteractiveBook The first thing we will do is to define a layout for our book. We want it to look a little bit like the following screenshot: So let's begin! Open res/layout/main.xml and create the following layout: <?xml version="1.0" encoding="utf-8"?><LinearLayout android_orientation="vertical" android_layout_width="fill_parent" android_layout_height="fill_parent"> <ViewFlipper android_id="@+id/pages" android_layout_width="fill_parent" android_layout_height="fill_parent" android_layout_weight="2"> </ViewFlipper> <LinearLayout android_layout_width="fill_parent" android_layout_height="wrap_content" android_layout_weight="1" android_gravity="center" > <Button android_id="@+id/prev" android_layout_width="fill_parent" android_layout_height="wrap_content" android_layout_weight="1" android_drawableLeft="@android:drawable/ic_media_previous" android_text="Previous" /> <Button android_id="@+id/next" android_layout_width="fill_parent" android_layout_height="wrap_content" android_layout_weight="1" android_drawableRight="@android:drawable/ic_media_next" android_text="Next" /> </LinearLayout> </LinearLayout> Here we have set up the layout of the application, but we have not yet added any pages. In XML, the pages of the ViewFlipper are created by adding child layouts to ViewFlipper. Firstly, we will want a Drawable, which we can animate. Create a new file in res/drawable called res/drawable/ball.xml and give it the following contents: <?xml version="1.0" encoding="utf-8"?><shape android_shape="oval" > <gradient android_startColor="#FFFF0000" android_endColor="#FF551010" android_angle="270"/> <size android_height="40dp" android_width="40dp"/></shape> This is just an ordinary ShapeDrawable; there's no special animation and stuff here! We will just use it as a simple ball graphic while we are writing the book. Later on, we will add animation. In main.xml, between the &ltViewFlipper> and </ViewFlipper> tags, add the following new elements: I will intersperse the code with pictures, so that you can see what we are adding as we go along. You should add the XML in order, and use the pictures as a quick guide to get what you want? First, take a look at the following screenshot. This should give you an idea of the structure of the page that we are going to make: Looks simple enough? Let's write the layout code for it. Remember that this is going between the &ltViewFlipper> and </ViewFlipper> tags. <LinearLayout android_layout_width="fill_parent" android_layout_height="wrap_content" android_orientation="vertical"> <TextView android_layout_width="fill_parent" android_layout_height="wrap_content" android_text="This is a ball. It is a red ball." /> <ImageView android_layout_width="wrap_content" android_layout_height="wrap_content" android_id="@+id/rollingball" android_src="@drawable/ball" android_paddingLeft="60dp" /> <TextView android_layout_width="fill_parent" android_layout_height="wrap_content" android_text= "This red ball is rolling. Watch the red ball roll." /> </LinearLayout> That was page 1, now let us make page 2. It will be laid out like the next screenshot: The layout text that follows should go between the &ltLinearLayout> for page 1 and the </ViewFlipper> tag. <LinearLayout android_layout_width="fill_parent" android_layout_height="wrap_content" android_orientation="vertical"> <TextView android_layout_width="fill_parent" android_layout_height="wrap_content" android_text="Look! This is a red ball too." /> <ImageView android_layout_width="wrap_content" android_layout_height="wrap_content" android_id="@+id/bouncingball" android_src="@drawable/ball" android_paddingLeft="60dp" /> <TextView android_layout_width="fill_parent" android_layout_height="wrap_content" android_text= "The ball is bouncing. See the ball bounce." /> </LinearLayout> Finally, this is what the last page will look like: As you might suppose, the layout that follows goes between page 2 and the </ViewFlipper> tag. <TextView android_layout_width="fill_parent" android_layout_height="wrap_content" android_text="The end. Now go and tidy your room." /> Our content pages are defined in XML. Our ViewFlipper is going to treat each of the highest-level elements (the LinearLayout and the TextView) as pages in its layout. In this sense, it works exactly as a FrameLayout would work. Okay, great. If you ran this now, you would be able to see the first page, but we've still not connected the page-turning buttons. Let's do that now. Open up InteractiveBook.java and add the following import declarations: import android.view.View;import android.widget.Button;import android.widget.ViewAnimator; The last one is the most important. As I mentioned earlier, the ViewFlipper is a subclass of ViewAnimator. Seeing, as we don't need to use any of the methods of the subclass, we are only going to work with its superclass. Now, add the following block of code at the end of onCreate(). final ViewAnimator pages = (ViewAnimator) findViewById(R.id.pages); Button prev = (Button) findViewById (R.id.prev); Button next = (Button) findViewById (R.id.next); prev.setOnClickListener(new View.OnClickListener() { public void onClick (View v) { pages.showPrevious(); } }); next.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { pages.showNext(); } }); Here we can see exactly how to write a page-turning control in a ViewFlipper. Simply call pages.showPrevious() or pages.showNext(). Build and run your application. You should see that the ViewFlipper turns pages perfectly well now. There's something missing from this interactive book—the animation between the pages is not very smooth. In fact, all it does is switch between one page and the next. Let's give it a more natural feel with a page turning animation. In res/anim, create a new XML file called slidein.xml. This will be an ordinary tween animation. We will use this animation to introduce new pages to the screen. Add the following block of code to it: <?xml version="1.0" encoding="utf-8"?><set android_interpolator="@android:anim/decelerate_interpolator"> <translate android_fromXDelta="100%p" android_toXDelta="0" android_duration="500" /></set> This means that when the user turns a page, the new page comes across from the right-hand side of the screen, as if they were turning pages in a book (sort of). Now let's add the opposite effect, by removing the old page from the screen. In res/anim, create another XML file called – you guessed it – slideout.xml. In it, add the following XML: <?xml version="1.0" encoding="utf-8"?><set android_interpolator="@android:anim/accelerate_interpolator"> <translate android_toXDelta="-100%p" android_fromXDelta="0" android_duration="500" /></set> As the pages arrive from the right, they also move off to the left. Now we need to add this animation to the ViewFlipper. Open up main.xml again, and add these attributes to our declaration of the ViewFlipper. <ViewFlipper android_id="@+id/pages" android_layout_width="fill_parent" android_layout_height="fill_parent" android_layout_weight="2" android_inAnimation="@anim/slidein" android_outAnimation="@anim/slideout" > Now build and run the interactive book. You will see that your pages now transition smoothly from one to the next. What just happened? We created a book-like application that displays several pages of information. We created a new ViewFlipper widget and applied a page-turning animation to it to give it a natural, book-like feel. For convenience, the animations applied to ViewFlipper will apply to every single page that is contained within it. Remember, you do not need to apply an individual tween to each page in your book. Just adding the inAnimation and outAnimation in your ViewFlipper will be sufficient. Have a go hero – improving the ViewFlipper Think about how you would like to turn pages in a book. Perhaps the motion that we created above could be improved in some way. Edit the slidein.xml and slideout.xml tween animations, and create a new animation of your own invention.  
Read more
  • 0
  • 0
  • 1971

article-image-puppet-integrating-external-tools
Packt
02 Nov 2011
4 min read
Save for later

Puppet: Integrating External Tools

Packt
02 Nov 2011
4 min read
Executing commands before and after Puppet runs If you need to have a command executed before each Puppet run, you can do this using the prerun_command configuration setting. Similarly, you can use postrun_command to execute a command after the run has completed. This mechanism gives you a powerful hook to integrate Puppet with other software, or even trigger events on other machines. The prerun and postrun commands must succeed (that is, return a zero exit status), or Puppet will report an error. This enables you to have any command failures reported using Puppet's reporting mechanism, for example. How to do it... Set prerun_command or postrun_command in puppet.conf to the commands you want to run: prerun_command = /usr/local/bin/before-puppet-run.sh postrun_command = /usr/local/bin/after-puppet-run.sh There's more You can use prerun and postrun commands to integrate Puppet with Ubuntu's etckeeper system. Etckeeper is a version control system for tracking changes to files in the /etc directory. To do this, define these commands in puppet.conf: prerun_command=/etc/puppet/etckeeper-commit-pre postrun_command=/etc/puppet/etckeeper-commit-post Using public modules "Plagiarize, plagiarize, plagiarize / Only be sure always to call it please 'research' "—Tom Lehrer, 'Lobachevsky' If in doubt, steal. In many cases when you write a Puppet module to manage some software or service, you don't have to start from scratch. Community-contributed modules are available at the Puppet Forge site for many popular applications. Sometimes, a community module will be exactly what you need and you can download and start using it straight away. In other cases, you will need to make some modifications to suit your particular needs and environment. If you are new to Puppet, it can be a great help to have some existing code to start with. On the other hand, community modules are often written to be as general and portable as possible, and the extra code required can make them harder to understand. In general I would not recommend treating Puppet Forge as a source of 'drop-in' modules which you can deploy without reading or understanding the code. This introduces an external dependency to your Puppet infrastructure, and doesn't help advance your understanding and experience of Puppet. Rather, I would use it as a source of inspiration, help, and examples. A module taken from Puppet Forge should be a jumping-off point for you to develop and improve your own modules. Be aware that a given module may not work on your Linux distribution. Check the README file which comes with the module to see if your operating system is supported. Getting ready The easiest way to use Puppet Forge modules is to install the puppet-module tool: # gem install puppet-module Fetching: puppet-module-0.3.2.gem (100%) ****************************************************************************** Thank you for installing puppet-module from Puppet Labs! * Usage instructions: read "README.markdown" or run `puppet-module usage` * Changelog: read "CHANGES.markdown" or run `puppet-module changelog` * Puppet Forge: visit http://forge.puppetlabs.com/ ****************************************************************************** Successfully installed puppet-module-0.3.2 1 gem installed Installing ri documentation for puppet-module-0.3.2... Installing RDoc documentation for puppet-module-0.3.2... Run puppet-module to see the available commands: # puppet-module Tasks: puppet-module build [PATH_TO_MODULE] # Build a module for release puppet-module changelog # Display the changelog for this tool puppet-module changes [PATH_TO_MODULE] # Show modified files in an installed m... puppet-module clean # Clears module cache for all repositories puppet-module generate USERNAME-MODNAME # Generate boilerplate for a new module puppet-module help [TASK] # Describe available tasks or one speci... puppet-module install MODULE_NAME_OR_FILE [OPTIONS] # Install a module (eg, 'user-modname')... puppet-module repository # Show currently configured repository puppet-module search TERM # Search the module repository for a mo... puppet-module usage # Display detailed usage documentation ... puppet-module version # Show the version information for this... Options: -c, [--config=CONFIG] # Configuration file # Default: /etc/puppet/puppet.conf How to do it In this example, we'll use puppet-module to find and install a module to manage the Tomcat application server. Search for a suitable module as follows: # puppet-module search tomcat ===================================== Searching http://forge.puppetlabs.com ------------------------------------- 2 found. -------- camptocamp/tomcat (0.0.1) jeffmccune/tomcat (1.0.1) In this example we'll install the Jeff McCune version: # cd /etc/puppet/modules # puppet-module install jeffmccune/tomcat Installed "jeffmccune-tomcat-1.0.1" into directory: jeffmccune-tomcat The module is now ready to use in your manifests: looking at the source code will show you how to do this. How it works... The puppet-module tool simply automates the process of searching and downloading modules from the Puppet Forge site. You can browse the site to see what's available at: forge.puppetlabs.com. There's more Not all publically available modules are on Puppet Forge. Some other great places to look are on GitHub: github.com/camptocamp, github.com/example42 and Dean Wilson maintains an excellent repository of Puppet patterns, tips, and recipes, at the Puppet Cookbook website: puppetcookbook.com.
Read more
  • 0
  • 0
  • 3013
Modal Close icon
Modal Close icon