Mar 2, 2017

Making AMD Tick: A Very Zen Interview with Dr. Lisa Su, CEO

AMD held a Tech Day a week before the launch of Zen to go over the details of of the new Ryzen product with the technology press. As part of these talks, we were able to secure Dr. Lisa Su, the CEO of AMD, for 30 minutes to discuss Zen, Ryzen, and AMD.

Profile:

Dr. Lisa Su, CEO of AMD. Born in Taiwan and educated at MIT, Dr. Su comes fully equipped with a Bachelors, Masters, and Ph.D. in Electrical Engineering. Before AMD, Dr. Su had appointments as CTO of Freescale Semiconductor, Director of Emerging Products at IBM, and a stint at Texas Instruments. It was at IBM that Dr. Su worked alongside Mark Papermaster, who is currently AMD’s CTO. Dr. Su was initially hired as SVP and GM at AMD, overseeing the global business units, and became CEO/COO in 2012. A rare occurrence (unfortunately), but Dr. Su is one of a small handful of female C-Level Executives in the semiconductor industry. Dr. Su is consistently highly ranked in many 'top people to watch' lists of technology industry visionaries.


The pin-layout of Ryzen

Ian Cutress: Congratulations on formally releasing Zen!

Q1: Both yourself and AMD officially __have explicitly stated that AMD has needed to return back to the high-performance CPU market. We can all assume that there are still many hurdles ahead, but is getting Zen into retail silicon the spark that sets off the rest of the roadmap?

Lisa Su: I think launching Zen in desktop was a big big hurdle. That being said we __have many others to go, and as you can imagine how happy I am. I know I’m only as good as my last product, so there’s a lot of focus on: Vega, Naples, Notebook, and 2018.

Q2: When we speak to some companies, they’ll describe that internally they have engineers working on the next generation of product, and fewer engineers working for the product after that, and continuing on for three, five or up to seven years of products. Internally, how far ahead in the roadmap do you have engineers working on product and product design?

LS: It’s at least 3 to 4 years. If you look at what we have on CPU and GPU, we have our roadmap out to 2020. It’s not set in stone, but we know the major markets and we adjust timings a quarter here or there as necessary.

Q3: A lot of analysts widely regard that rehiring Jim Keller was the right move for AMD, although at the time AMD was going through a series of ups and downs with products and financial issues. Was the 'new' CPU team shielded from those issues from day one, or at what point could the Zen team go full throttle?

LS: If I put credit where credit is due, Mark Papermaster had incredible vision of what he wanted to do with CPU/GPU roadmap. He hired Jim Keller and Raja Koduri, and he was very clear when he said he needed this much money to do things. We did cut a bunch of projects, but we invested in our future. Sure we cut things, but it was very clear. A note to what you said about Jim Keller though - he was definitely a brilliant CPU guy, but he was a part of that vision of what we wanted to do.

Q4: With Bulldozer, AMD had to work with Microsoft due to the way threads were dispatched to cores to ensure proper performance. Even though Zen doesn't have that issue, was there any significant back-and-forth with Microsoft to enable performance in Windows (e.g. XFR?)

LS: Zen is a pretty traditional x86 architecture as an overall machine, but there is optimization work to do. What makes this a bit different is that most of our optimization work is more on the developer side – we work with them to really understanding the bottlenecks in their code on our microarchitecture. I see many apps being tuned and getting better going on as we work forward on this.

Q5: How vital was it to support Simultaneous Multi Threading?

LS: I think it was very important. I think it was very complicated! Our goal was to have a very balanced architecture. We wanted high single threaded performance, and SMT was important given where the competition is. We didn’t want to apologize for anything with Zen – we wanted high single thread, we wanted many cores, but sorry we don’t have SMT? We didn’t want to say that, we wanted to be ambitious and give ourselves the time to get it done.

IC: Can you have your cake and eat it too?

LS: Yes! The key is to help the team to believe it can be done.

Q6: It has been noted that AMD has been working with ASMedia on the chipset side of the platform, using a 55nm PCIe 3.0x4 based chipset. Currently your competition implements a large HSIO model that can support up to 24 PCIe 3.0 lanes, albeit with limited bandwidth, but enables extensive networking, PCIe storage, and other features. What does AMD need to do to reach semi-parity for I/O ?

LS: I think we will continue to want a rich ecosystem. On the chipset side we may not develop the chipsets ourselves but we certainly want to be in partnership with others to develop a wide set of IO. I think if you look at the set of motherboard partners that we have, and the extensive testing we’ve done with them, I would expect that as we gain some market share in the high-end, you will see that system build up.

Q7: A couple of years ago, AMD's market value was lower than its assets. Today, it is trading over $10. A cynic would say that the increase has been a good Polaris launch combined with recent marketing cycles slowly giving out small bits of information. What's your response to AMD's recent share price rise over the past 12 months? 

LS: My view is that I can never predict the market, so I never try! The market has a mind of its own. But what I can say is that we had some very key fundamentals. We are in key markets like the PC market, the cloud market, the infrastructure market, gaming – these are big big markets. They are growing too – I think that the markets we are in are good. We had to convince people fundamentally that we could execute a competitive roadmap and 18 months ago I’d say people didn’t really believe. They thought ‘ah well, maybe’, but ‘we don’t know’ is a power point. Over the past 6-9 months we’ve proven that we can gain graphics share, with the launch of Polaris, and with the launch of Ryzen I think you’ll see that we can convince that we can execute on high performance CPUs. Importantly our customers have become convinced too. The key thing with our customers is that when it was a power point, they weren’t sure: it was interesting, but it could have been six months late or have 20% less performance. When we actually gave them samples, they were actually like ‘Wow, this is actually real!’ and they started pulling in their schedules. So when you ask me about investors it’s something like that. I think people want some proof points to believe they can trust us and that if we execute that we’ll do ok.

Q8: Do you find that OEMs that haven’t worked with AMD are suddenly coming on board?

LS: I will say that we have engagements with every OEM now on the high-performance space. Twelve months ago, a number of them would have said that they don’t have the resources to do multiple platforms. So yes, I think momentum helps in this space.

Q9: At Intel's recent Investor Day we learned that future chips will incorporate multiple dies on the same package. This allows a semiconductor firm to focus on smaller chips and potentially better yields at the expense of some latency. Given what we predict will happen, what is your opinion on having large 600mm2 silicon? Is there a future?

LS: There has been a lot of debate on this topic. I find it a very interesting debate. Certainly on the graphics side we view High Bandwidth Memory (HBM) and the ability to get that interconnect between the GPU and memory to be extremely differentiating. So certainly we will use that throughout our graphics roadmap. If you look at our CPU roadmap, I do think there’s a case to be made for multi-chip modules. It depends on the trade-offs you have to do, the bandwidth requirements you have, but yes as the process technology becomes more complicated, breaking up the tasks does make sense.

Q10: With high-end GPUs, we commonly approach 250-300W power consumption. Why has the CPU stalled around 75-140W by comparison? Does AMD ever look to designing a CPU that actually aims for a power/efficiency sweet-spot north of 200W? Why hasn’t the high-performance CPU market gone and matched the GPU market in power consumption?

LS: That’s a good question, let me see if I’ve thought about that. I think we’re limited by other things on the CPU side. I think we’re limited by some reliability.

IC: But if you engineer for a specific power window…

LS: Sure but if you think about it, GPUs tend to be a lot more parallel, so that’s what drives the power. With CPUs, you might argue with me about whether you actually need eight cores, or not! I have to think about that answer, but I think that’s the right one – the difference between a very parallel machine and one that is less parallel.

Q11: Despite the differences, a lot of fingers point to the Zen microarchitecture floorplan and see significant similarities in the layout with Intel's Core microarchitecture.  Without a fundamental paradigm shift, it seems we might be 'stuck' (for lack of a better term) with this kind of layout for perhaps a decade. How does AMD approach this, given your main competitor can easily invest in new seed firms or IP?

LS: The way I look at it, and I get asked this question very often (sometimes phrased a bit differently) – your competition can invest so much more than you can, how can we be competitive? I think the simple answer is in that yes we are smaller, but I think that we are also more focused. I think that sometimes with constraints comes creativity and so when you’re talking about what processors look like 5-10 years from now, if you look at the innovation in the last 10 years , a bunch of that has come from AMD. You tend to solve problems when you’re put in a box that you have to live in, so when we look at possible microarchitectures, there are still a lot of ideas out there. There’s still a lot of opportunity to incrementally improve performance. I think the difference is that you used to be able to say ‘let me just shrink it’ and it will go faster, and that is a process that lends itself to money as you can just buy equipment to shrink it. Today you have to handcraft it a bit more, and that lends itself to more creativity I would say.

Q12: We've recently seen your competitor announce a change in strategy regarding new process nodes, new architectures, and how markets will take advantage of the latest CPU designs. With Zen, AMD is first launching desktop, then server, then mobile: you've already mentioned Zen-plus on the roadmap - is the desktop-server-mobile roll-out method the best way for AMD to move forward?

LS: Not necessarily. I think for this generation [our strategy] made a lot of sense. I think the desktop and server use very similar kind of tuning, they’re both tuned for higher frequency and higher performance. The desktop is a bit simpler; the ecosystem for desktop is a bit simpler. The server has a more complicated testing setup that needs to run so that gives some context there. We really wanted to have a product in the high-end space. It was more set the market strategy than a technical strategy.

Q13: AMD currently has a very active semi-custom business, particularly when it comes to silicon design partnerships and when it comes to millions of Consoles. Speaking of custom silicon in consoles, current generation platforms currently use AMD’s low power ‘cat’ cores. Now that AMD has a small x86 core in Zen, and I know you won’t tell me what exactly is coming in the future, but obviously future consoles will exist, so can we potentially see Zen in consoles?

LS: I think you know our console are always very secretive about what they are trying to do, but hypothetically yes I would expect Zen to show up in semi-custom opportunities including perhaps consoles at a certain point in time.

Q14: AMD is in a unique position for an x86 vendor, with significant GPU IP at its beck and call. Despite the recent redefinition of the GPU group under RTG, would/has AMD ever consider using joint branding (similar to how ASUS markets ROG motherboards and GPUs for example)? 

LS: What I’d like to say is (and you’ll appreciate this) that I love CPUs and GPUs equally, and the markets are a little bit different. And so think about it this way: our GPUs have to work with Intel CPUs, and our CPUs have to work with NVIDIA GPUs, so we have to maintain that level of compatibility and clarity. That being said, I think with Ryzen you can imagine that as we launch Vega later in the year that you might here about Ryzen plus Vega in systems because they are both high-performance things and we want to build great systems! I don’t know about co-marketing, but the idea of being able to say that ‘A plus A builds a great system’ is something we will do.

On the vendors who do motherboards and GPUs, I agree it takes a lot of work to bring out a new brand. We do view though that the way that people who buy CPUs and the people who buy GPUs do overlap, but they are still quite distinct.

Q15: Ryzen is priced very competitively compared to the competition, and it follows the common thinking that AMD is still the option for a cheaper build. Is that a characteristic that sits well with AMD?

LS: I think you should judge that question by what the 200 system integrators will be building with Ryzen in, and what the OEMs will be building. My view is that they system needs to be good enough for the CPU being putting in it. We are very picky about it, and we want Ryzen to be in high-end systems. Will we see Ryzen in some mainstream systems then sure, but if you look at our introduction order, there’s a reason why we’re going Ryzen 7 first, because it sets the brand. You know I want to sell millions and millions of processors, and I’ll sell a bunch that is less than eight cores but having that eight cores and sixteen threads defines what we’re capable of.

Q16: We've all seen the details of how desktop PC sales are down, but PC gaming revenue is increasing. There is no doubt that Ryzen will be marketed as a chip for gamers; how do you see consumers reacting to Ryzen?

LS: I think PC gaming is doing quite well, which is one of the hot markets. We are addressing as a gamers as a very important segment, but they are one of many important segments of users for us. We think Ryzen is a great gaming CPU, and you’ll test that for yourself – we’re not going to win every head-to-head, but if you think about gaming do you want theoretical performance or do you want the CPU to be good enough to showcase your GPU? I think what Ryzen allows is those folks to do something more than just gaming. So your gaming CPU might only uses four cores, but if you are doing video editing or streaming it will do a lot more. So I think what we’re trying to address is maybe the forward thinking users, not just the today gamer.

Q17: A perennial question we get asked is 'Core i7, i5 or i3?'. There have been countless reviews and YouTube videos on the subject. With Ryzen in the mix, what becomes the new question?

LS: I think you should help your users through that! I really think that’s the case. Ryzen 7 offers phenomenal capability for an eight-core, sixteen-thread device. As we introduce the next families you will see positioning but the end result is that you will see a top to bottom stack with a processor for everyone. At every price we will offer more performance.  You will be able to see that in your own testing.

Q18: Can you comment on whether Bristol Ridge will be available to consumers at any point?

LS: Yes, good question. The answer is yes. The idea is that if you have an AM4 platform you can put an APU in there. As you saw we put Ryzen 7 first I think the intent was to ensure that AM4 was solidified on Ryzen. I say yes because that has always been the strategy for the AM4 socket to have a very long life and a very broad range. Exact timing has not yet been finalized.

Q19: At the high-end, Ryzen 7 is competing with Intel's high-end desktop market. But where Intel has 28/40 native PCIe 3.0 lanes, Ryzen only has sixteen. Avago PLX switches are almost $100 each, which means a route to 2 full-bandwidth GPUs or >3 GPUs or more NVMe is hindered. Was sixteen PCIe 3.0 the right choice?

LS: We think so, I mean we do. If you look at the distribution of PCs going into workstation I think that’s where the volume is. We still believe in the relative balance of performance and power in our decision, but it’s an interesting point.

Q20: Your competition has had success with both 'Core' parts and 'Xeon' parts, with the latter being ECC and vPro and having the professional feature-set.  With the launch, AMD does have its 'Pro' CPU line, but this is more for business agreements and not yet dealing with Ryzen. Does AMD discuss this internally?

LS: I think what you should expect that Naples will go head to head in the server space, including single socket and dual socket. What you might be asking is if we are going to do something in between on the workstation stuff – I think it is fair to say that we view it all as interesting markets. To your question of ‘do we think about it?’, sure. With everything you roll out with a set of priorities so we set on consumer first, then we are going to do data center, and then we will see what will come next.

Q21: Is there room for an 'Opteron' as a brand name?

LS: You tell me!

IC: I think so! I spoke to a few people today and reactions were mixed. Obviously coming up with a new brand name for a product line is difficult. I assume there is conversation internally, as I don’t suspect the product to be called Naples at launch.

LS: I think you have hit on a topic that has had a good amount of debate [internally]. As we get closer to launch we will talk about branding on the server. But yes, it will not be called Naples in the market.

Q22: AMD is formally launching Ryzen with AMD benchmark data and pre-orders on 2/22, but no third-party data until the official launch of 3/2. A lot of customers see value on third-party independent verified data, and might perhaps see this tactic in a bad light. Can you comment on the reasons for the launch structure?

LS: We had a couple of things going on internally, to give you all our thought process. Because we were going so wide on the ecosystem in terms of sampling – motherboard sampling, system integrators, a lot of OEMs, and lot of ODMs, there has been (at least to my expectation) more chatter in the marketplace than I would have thought just in terms of things that are out there. Some of them were true, some were not true…

IC: Fake News!

LS: Ha! Our view was that we wanted to go through the review process very very diligently, and we also wanted to own the news as the news cycle was coming out. So the whole idea of taking the press out on the town to some boat or something, we thought that these guys are writing is real, so give them time to perhaps not do a full review but at least get comfortable with what you are seeing. I’ve said it before and I’ll say it again: everything we show you, what you see is what you get.

IC: The problem is the perception that perhaps that up to that point, every personal in the chain that has ‘data’ wants to sell you something.

LS: My view is that you guys are very smart guys, and you said you can do a lot in six hours! 

(I had mentioned previously I had bought 10kg of testing kit to Tech Day to test Ryzen in my hotel room that evening before catching a flight out. As this is being posted, we're still frantically writing up the review, so stay tuned as the official embargo time lifts at 9am ET, and not a minute sooner...)

The AnandTech Podcast, Episode 41: Let's Talk Server, with Patrick Kennedy

While in San Francisco for AMD’s Ryzen Tech Day, I had a chance to catch up with a good friend by the name of Patrick Kennedy, who runs the tech news website ServeTheHome. We frequently battle STH here at AnandTech to be the first to break news on new server platforms, but it is a friendly rivalry where often we end up picking each other’s brains for information or to bounce ideas off of each other. To that end, I managed to convince Patrick to be a guest on our podcast, to talk about the recent issue with Avoton and Rangeley C2000 CPUs as well as the launch of C3000 and discuss what the upcoming Naples platform can do for AMD.

Apologies in advance for parts of the recording. We did this in a high-rise hotel during a freak San Francisco storm, causing wind to whistle through the vents in the room and no way to close the vents. I tried to clean up the audio as best as I could, alas I am no expert. Experts, please apply to be our podcast editors, and tell us what equipment we should be using.


Patrick Kennedy (ServeTheHome), Ian Cutress (AnandTech) and David Kanter (Microprocessor Report)
Photo Taken by Raja Koduri (AMD). David was declared the winner of the 'Bring Your Suit A-Game' contest.

The AnandTech Podcast #41: Let's Talk Server

Featuring

  • Dr Ian Cutress, Host, Senior Editor (@IanCutress)
  • Patrick Kennedy, Editor-in-Chief of ServeTheHome (@ServeTheHome)

iTunes
RSS - mp3, m4a
Direct Links - mp3, m4a

Total Time:  28 minutes 39 seconds

Outline mm:ss

00:00 – Introduction
00:15 – Patrick’s 2000 cores
01:41 – Atom C2000 Avoton/Rangeley Hardware Bug
09:22 – Denverton and C3000
15:17 – Xeon D-1500 Networking CPUs
18:02 – Opportunities for AMD Naples
28:39 – FIN

Related Reading

The Intel Atom C2000 Series Bug (via ServeTheHome)
Intel launches Denverton C3000 Series
AMD Naples Motherboard Analysis

Mar 1, 2017

How to Handle a Single Exception in Python

Some things you develop in Python __have a terrible habit of spitting out exceptions when the user inputs unexpected values. Part of the solution is to provide range checking. However, range checking doesn’t overcome the problem of a user typing text such as Hello in place of an expected numeric value. Exception handling provides a more complex solution to the problem, as described in the following steps.

1Open a Python File window.

You see an editor in which you can type the example code.

2Type the following code into the window — pressing Enter after each line:

try: Value = int(input("Type a number between 1 and 10: "))except ValueError: print("You must type a number between 1 and 10!")else: if (Value > 0) and (Value <= 10):  print("You typed: ", Value) else:  print("The value you typed is incorrect!")

The code within the try block has its exceptions handled. In this case, handling the exception means getting input from the user using the int(input()) calls. If an exception occurs outside this block, the code doesn’t handle it.

With reliability in mind, the temptation might be to enclose all the executable code in a try block so that every exception would be handled. However, you want to make your exception handling small and specific to make locating the problem easier.

The except block looks for a specific exception in this case: ValueError. When the user creates a ValueError exception by typing Hello instead of a numeric value, this particular exception block is executed. If the user were to generate some other exception, this except block wouldn’t handle it.

The else block contains all the code that is executed when the try block code is successful (doesn’t generate an exception). The remainder of the code is in this block because you don’t want to execute it unless the user does provide valid input. When the user provides a whole number as input, the code can then range check it to ensure that it’s correct.

3Choose Run→Run Module.

You see a Python Shell window open. The application asks you to type a number between 1 and 10.

Inputting an unexpected value in Python.

4Type Hello and press Enter.

The application displays an error message.

5Perform Steps 3 and 4 again, but type 5.5 instead of Hello.

The application generates the same error message.

An error message appears when you input a wrong value in Python.

6Perform Steps 3 and 4 again, but type 22 instead of Hello.

The application outputs the expected range error message. Exception handling doesn’t weed out range errors. You must still check for them separately.

7Perform Steps 3 and 4 again, but type 7 instead of Hello.

This time, the application finally reports that you’ve provided a correct value of 7. Even though it seems like a lot of work to perform this level of checking, you can’t really be certain that your application is working correctly without it.

Error message that appears when an exception isn

8Perform Steps 3 and 4 again, but press Ctrl+C, Cmd+C, or the alternative for your platform instead of typing anything.

The application generates a KeyboardInterrupt exception. Because this exception isn’t handled, it’s still a problem for the user.

Common Computer Programming Loop Structures

Looping instructions, one of the basic logic structures in computer programming, tell the computer to repeat one or more instructions. Check out this list of basic loop structures in various computer programs and languages:

List of basic loop structures in various computer programs.

3 Hadoop Cluster Configurations

Single-rack Hadoop deplyment. 13

Single-rack Hadoop deployment

A single-rack deployment is an ideal starting point for a Hadoop cluster.

Here, the cluster is fairly self-contained, but because it still has relatively few slave nodes, the true benefits of Hadoop’s resiliency aren’t yet apparent.

A medium-size Hadoop cluster with three racks. 23

Three-rack Hadoop deployment

A medium-size cluster has multiple racks, where the three master nodes are distributed across the racks.

Hadoop’s resiliency is starting to become apparent: Even if an entire rack were to fail (for example, both ToR switches in a single rack), the cluster would still function, albeit at a lower level of performance. A slave node failure would barely be noticeable.

Large scale Hadoop deployment. 33

Large-scale Hadoop deployment

In larger clusters with many racks, like the example shown, the networking architecture required is pretty sophisticated.

Regardless of how many racks Hadoop clusters expand to, the slave nodes from any rack need to be able to efficiently “talk” to any master node.

As the number of slave nodes increases to the point where you __have more than three racks, additional racks are composed only of slave nodes, aside from the ToR switches. If you’re using HBase heavily on your cluster, you may add master nodes to host additional HMaster and Zookeeper services.

If you graduate to a truly massive scale, where you __have hundreds of slave nodes, you may need to use the HDFS federation capabilities so that large portions of your data sets are managed by different NameNode services.

For every additional Active NameNode, you will need a corresponding Standby NameNode and two master nodes to host these servers. With HDFS federation, the sky is truly the limit in terms of how far you can scale out your clusters.

Back Next

Feb 28, 2017

How to Make an AJAX Request with jQuery for HTML5 and CSS3 Programming

The primary purpose of an AJAX library like jQuery is to simplify AJAX requests for HTML5 and CSS3 programmers. It’s hard to believe how easy this can be with jQuery.

Preview of a HTML site using Ajax.

How to include a text file with AJAX

Check out this clean code:

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>ajax.html</title> <script type = "text/javascript"   src = "jquery-1.10.2.min.js"></script> <script type = "text/javascript"> $(document).ready(getAJAX); function getAJAX(){  $("#output").load("hello.txt"); } </script> </head> <body> <div id = "output"></div> </body></html>

The HTML is very clean. It simply creates an empty div called output.

This example does use AJAX, so if it isn’t working, you might need to remember some details about how AJAX works. A program using AJAX should be run through a web server, not just from a local file. Also, the file being read should be on the same server as the program making the AJAX request.

The load() mechanism described here is suitable for a basic situation where you want to load a plain-text or HTML code snippet into your pages.

Building a poor man’s CMS with AJAX

AJAX and jQuery can be a very useful way to build efficient websites, even without server-side programming. Frequently a website is based on a series of smaller elements that can be swapped and reused. You can use AJAX to build a framework that allows easy reuse and modification of web content.

A website created with Ajax and JQuery.

Although nothing is all that shocking about the page from the user’s perspective, a look at the code can show some surprises:

<!DOCTYPE html><html lang = "en"> <head> <meta charset = "UTF-8"> <title>CMS Using AJAX</title> <link rel = "stylesheet"   type = "text/css"   href = "cmsStd.css" /> <script type = "text/javascript"   src = "jquery-1.10.2.min.js"></script> <script type = "text/javascript">  $(init);  function init(){  $("#heading").load("head.html");  $("#menu").load("menu.html");  $("#content1").load("story1.html");  $("#content2").load("story2.html");  $("#footer").load("footer.html");  }; </script> </head> <body> <div id = "all">  <!-- This div centers a fixed-width layout →  <div id = "heading">  </div><!-- end heading div →  <div id = "menu">  </div> <!-- end menu div →  <div class = "content"   id = "content1">  </div> <!-- end content div →  <div class = "content"   id = "content2">  </div> <!-- end content div →  <div id = "footer">  </div> <!-- end footer div → </div> <!-- end all div → </body></html>

Look over the code, and you can see these interesting features:

  • The page has no content! All the divs are empty. None of the text shown in the screen shot is present in this document, but all is pulled from smaller files dynamically.

  • The page consists of empty named divs. Rather than any particular content, the page consists of placeholders with IDs.

  • It uses jQuery. The jQuery library is used to vastly simplify loading data through AJAX calls.

  • All contents are in separate files. Look through the directory, and you can see very simple HTML files that contain small parts of the page. For example, story1.html looks like this:

    <h2>Book I - Creating the HTML Foundation</h3><ol> <li>Sound HTML Foundations</li> <li>It's All About Validation</li> <li>Choosing your Tools</li> <li>Managing Information with Lists and Tables</li> <li>Making Connections with Links</li> <li>Adding Images</li> <li>Creating forms</li></ol>
  • The init() method runs on document.ready. When the document is ready, the page runs the init() method.

  • The init() method uses AJAX calls to dynamically load content. It’s nothing more than a series of jQuery load() methods.

This approach may seem like a lot of work, but it has some very interesting characteristics:

  • If you’re building a large site with several pages, you usually want to design the visual appearance once and reuse the same general template repeatedly.

  • Also, you’ll probably __have some elements that will be consistent over several pages. You could simply create a default document and copy and paste it for each page, but this approach gets messy. What happens if you __have created 100 pages according to a template and then need to change the header? You need to make the change on 100 different pages.

The advantage of the template-style approach is code reuse. Just like the use of an external style allows you to multiply a style sheet across hundreds of documents, designing a template without content allows you to store code snippets in smaller files and reuse them. All 100 pages point to the same menu file, so if you want to change the menu, change one file and everything changes with it.

Here’s how you use this sort of approach:

  1. Create a single template for your entire site.

    Build basic HTML and CSS to manage the overall look and feel for your entire site. Don’t worry about content yet. Just build placeholders for all the components of your page. Be sure to give each element an ID and write the CSS to get things positioned as you want.

  2. Add jQuery support.

    Make a link to the jQuery library, and make a default init() method. Put in code to handle populating those parts of the page that will always be consistent.

  3. Duplicate the template.

    After you have a sense of how the template will work, make a copy for each page of your site.

  4. Customize each page by changing the init() function.

    The only part of the template that changes is the init() function. All your pages will be identical, except they have customized init() functions that load different content.

  5. Load custom content into the divs with AJAX.

    Use the init()function to load content into each div.

This is a great way to manage content, but it isn’t quite a full-blown content-management system. Even AJAX can’t quite allow you to store content on the web. More complex content management systems also use databases rather than files to handle content. You’ll need some sort of server-side programming (like PHP) and usually a database (like mySQL) to handle this sort of work.

13 Keyboard Shortcuts for Common SketchUp Tools

SketchUp offers keyboard shortcuts for the tools you use most often as you create models. To select the tool you want, simply press the letter that’s indicated in the following table.

Tool Shortcut Key
Line L
Eraser E
Select Spacebar
Move M
Circle C
Arc A
Rectangle R
Push/Pull P
Offset O
Rotate Q
Scale S
Zoom Extents Shift+Z
Paint Bucket B