February 19, 2009

Use Excel’s spinners to analyze input value assumptions

  • Date: October 28th, 2008
  • Author: Mary Ann Richardson

The spinner offers an easy way to test different input variables to see the effect on a financial model — without altering your underlying formulas. This example shows how to put this useful feature to work.


Sensitivity analysis determines how a spreadsheet’s outputs will vary in response to changes made to the spreadsheet’s inputs. Excel gives us a number of tools for sensitivity analysis. One of these is the spinner. A spinner is linked to a cell containing one of the variable inputs. As the user clicks on the spinner, the value of the linked cell changes.

For example, the following worksheet can be used to examine how changes in three variable cialis soft tabs online inputs (price, unit cost, and fixed cost) affect profit. To set up the formulas for the worksheet, follow these steps:

  1. Select C1:D7, as shown in Figure A.

Figure A

worksheet setup

  1. Go to Tools | Options, click the Calculation tab, and then select the Accept Labels In Formulas check box. (In Excel 2007, click the Formulas tab, click Create From Selection in the Defined Names group, and then click OK.)
  2. Enter 2 in cell D1, which is the current price.
  3. Enter the rest of the formulas as shown in Figure B.

Figure B

entering formulas

  1. Type Enter Unit Cost (in hundredths) in cell H1.
  2. Type Enter Fixed Cost (in thousands) in cell H2.
  3. Enter 44 in cell I1 (the current Unit Cost).
  4. Enter 20 in cell I1 (the current Fixed Cost), as shown in Figure C.

Figure C

entering text

  1. Go to View | Toolbars | Forms to display the Forms toolbar. (In Excel 2007, click the Developer tab.)
  2. Click the Spinner button on the Forms toolbar. (In Excel 2007, click Insert in the Forms Group and then click the Spin button under Form Controls.)
  3. Click and drag in cell F1 to create the Price spinner.
  4. Repeat step 9 and then click and drag in cell F3 to create the Unit Cost spinner.
  5. Repeat step 9 and then click and drag in cell F4 to create the Fixed Cost spinner.
  6. Right-click the spinner in F1, click Format Control, and enter the values shown in Figure D.

Figure D

formatting control in F1

  1. Right-click the spinner in F3, click Format Control, and enter the values shown in Figure E.

Figure E

formatting control in F3

  1. Right-click the spinner in F4, click Format Control, and enter the values shown in Figure F.

Figure F

formatting control in F4

Your manager just learned that increases in material costs have raised the unit cost to .60. Using the spinner to adjust for this higher cost, the profit decreases to $45,800. Clicking the Price spinner up arrow once to raise the price to $3 immediately shows a drop in demand (assuming the demand formula is correct). However, even with this drop in demand, profit goes up significantly, which may warrant the price increase.

Permalink • Print • Comment

How to list the primary key columns in an Access table

  • Date: October 28th, 2008
  • Author: Susan Harkins

You can get a list of the columns in a primary key manually, but depending on the task at hand, you may want to handle it programmatically instead. Susan Harkins shares a VBA function that uses ADOX objects to obtain the column information.


Working with key values is serious work, and assigning a primary key is just the beginning of the process. If you need to manipulate a primary key programmatically, you need to know the columns that the key comprises. There are easy ways to do that manually, but doing so programmatically can prove useful if the task is part of the application’s internal workings or you’re dealing with external tables.

Note: This information is also available as a PDF download, along with a BAS file containing the code listing.

The code

You might think that listing the columns in a primary key would be easy, but that’s not the case. Perhaps the most efficient process is to use ADOX objects. Specifically, the function in Listing A uses ADOX catalog, table, index, and column objects. A series of For…Each loops and If…Then…Else statements cycle through three collections to determine the table’s primary key index and then build a string variable from the names of the columns that belong to that key. All that, just to list a few columns!

Listing A

Function ListPK(tbl As String) As String

'List primary keys for passed table. 'Must reference ADOX library: 'Microsoft cialis soft tablets ADO Ext. 2.8 for DDL and Security. Dim cat As New ADOX.Catalog Dim tblADOX As New ADOX.Table Dim idxADOX As New ADOX.Index Dim colADOX As New ADOX.Column

  cat.ActiveConnection = CurrentProject.AccessConnection

  On Error GoTo errHandler

  For Each tblADOX In cat.Tables

If tblADOX.Name = tbl Then If tblADOX.Indexes.Count <> 0 Then For Each idxADOX In tblADOX.Indexes With idxADOX If .PrimaryKey Then For Each colADOX In .Columns ListPK = colADOX.Name & ", " & ListPK Next End If End With Next End If End If Next

  If ListPK = "" Then    ListPK = "No primary key" Else ListPK = Left(ListPK, Len(ListPK) – 2) End If

  Set cat = Nothing  Set tblADOX = Nothing Set idxADOX = Nothing Set colADOX = Nothing Exit Function

errHandler:  MsgBox Err.Number & ": " & Err.Description, vbOKOnly, _ "Error" Set cat = Nothing Set tblADOX = Nothing Set idxADOX = Nothing Set colADOX = Nothing

End Function

To enter this function, launch the Visual Basic Editor (VBE) by pressing Alt + F11. Choose Module from the Insert menu, enter the code, and save the module. This code uses ADOX objects, so be sure to reference the Microsoft ADO Ext. 2.8 For DDL And Security library. Choose References from the Tools menu, select the library (Figure A), and click OK.

Figure A

references

Reference the ADOX library.

To execute the function, open the Immediate window by pressing Ctrl + G. Type the following line:

ListPK("tablename")

where tablename is the table for which you’re listing primary key columns. Now, press Enter. Figure B shows the results of passing the Northwind table Employees to ListPK(). (Northwind is an example database that comes with Access.)

Figure B

Immediate window

Use the Immediate window to pass a table to the ListPK() function.

The first For…Each loop cycles through the Tables collection looking for tbl, the passed string, which in this case is Employees. When the code finds a match, the next statement makes sure that Employees has at least one index to examine. If it does, the code loops through the Indexes collection until it finds the primary key index. The next For…Each loop builds a string that includes the names of all the columns in the primary key in column1, column2, column3 format. Finally, the function returns that string.

If a table has an index but no primary key, the function returns the string “No primary key.” If the table has no index, the function returns the string “No primary key.” You could just as easily use a subprocedure to print the results to the Immediate window.

Print keys

Primary keys are an integral part of any relational database. You can use ListPK() while debugging a new database. With some customization, you could use it to manipulate primary keys programmatically.

Permalink • Print • Comment

Create a custom Word table style for instant formatting

  • Date: October 24th, 2008
  • Author: Jody Gilbert

Word 2003 offers a gallery of Table AutoFormat styles — but they may not always suit your needs. See how to build your own style to quickly make tables look exactly the way you want.


Word’s Table AutoFormat feature offers an assortment of prefab styles you can use to jazz up your tables. But those styles may not necessarily match your document design or serve your table’s purpose. Luckily, you can specify your own set of attributes and save them as a user-defined style. Then, you can just apply the style to a table whenever you want to use your custom formatting.

Note: This information is also available as a PDF download.

To demonstrate, let’s say you generate a weekly dashboard report whose data is contained in a nice-looking, easily interpreted Word table… but manually formatting the table is getting a little old. Time to build a custom style:

  1. Choose Table AutoFormat from the Table menu (or click AutoFormat on the Tables And Borders toolbar).
  2. In the Table AutoFormat dialog box, click New (Figure A).

Figure A

table autoformat

  1. Enter a name for the style (e.g., Dashboard) and choose the style you want to base your new style on (Figure B). We’re going to base our sample style on the basic Table Grid style, but you can start off with something fancier if you prefer. Or choose Table Normal, which is unformatted, if you want to start with a blank slate.

Figure B

new style

  1. Now you can use the various tools in the New Style dialog box to specify the desired formatting. Just choose the table component you want to format from the Apply To drop-down list (Figure C) and make your selections. For this example, we specified 11-point Arial for the entire table, 14-point bold formatting and a light yellow fill for the heading row, a 1.5-point blue outside border, a 1-point yellow inside border, light blue fill for odd rows and light yellow fill for even rows (Figure D). (You’ll notice that some of the formatting — such as the font — doesn’t display in the preview.)

Figure C

style formatting

Figure D

autoformatting

  1. Click the Format button to access additional options governing the appearance of table elements and table text (Figure cialis shelf life E). In this case, we selected Paragraph and specified 6 points of space above and below each paragraph. Not all options are available to include in your table style. For instance, you can’t set Preferred Width or Text Wrapping in the Table Properties dialog.

Figure E

additional formats

  1. If you want the style to be available to other documents based on the current template, click Add To Template. Otherwise, the style will belong to the current document only. Click OK to return to the Table AutoFormat dialog box.
  2. If you’d like this table style to be the default for all new tables you create, click Default in the Table AutoFormat dialog box. Word will let you choose between setting the default for the current document or for all documents that use the current template (Figure F). Make your selection and click OK. If you don’t want to set a default, skip this step and simply close out of the Table AutoFormat dialog box.

Figure F

template selection

The payoff

To apply the style, click in a table and open the Table AutoFormat dialog box. Choose User-Defined Table Styles from the Category drop-down list box to display your custom style(s) (Figure G). Now, just select the style and click Apply.

Figure G

applying table style

Permalink • Print • Comment

Clickjacking: Potentially harmful Web browser exploit

  • Date: October 19th, 2008
  • Author: Michael Kassner

Clickjacking has the potential to redirect unknowing users to malicious Web sites or even spy on them. We all need to be aware of clickjacking and how to avoid its trappings.

——————————————————————————————————————-

TechRepublic’s Paul Mah made first mention of clickjacking in this Security News Roundup. At that time, security researchers Robert Hansen, founder of SecTheory, and Jeremiah Grossman, CTO of WhiteHat Security, weren’t able to divulge a great deal about the vulnerability, as they were in talks with the major browser developers as well as Adobe. I’d like to personally commend them for making the choice to act responsibly and give developers time to fix the problems.

What is clickjacking?

Clickjacking takes advantage of the fact that a Web page isn’t just two-dimensional. Web pages have virtual depth, and that’s where clickjacking lives. Clickjacking uses a vulnerability that allows code to be embedded on a Web page, changing how the Web page responds to input. In the following quote by the researchers, one can see the extent and variations of clickjacking that are possible:

“First of all let me start by saying there are multiple variants of clickjacking. Some require cross domain access, some don’t. Some overlay entire pages over a page, some use iframes to get you to click on one spot. Some require JavaScript, some don’t. Some variants use CSRF to pre-load data in forms, some don’t. Clickjacking doesn’t cover any one of these use cases, but rather all of them. That’s why we had to come up with a new term for it — like the term or not. As CSRF didn’t fit the requirements for clickjacking, we had to come up with a new term to avoid confusion.”

For example, let’s say I’m on what appears to be my banking Web site. I then click on a button that brings me to my accounts. The only problem is that button didn’t bring me to my accounts; it brought me to a page that looks like my account or it carried out a completely different operation than what I expected. Robert Hansen gave an interesting example of what’s possible with clickjacking:

“Say you have a home wireless router that you had authenticated prior to going to a legitimate web site. The attacker places a tag under your mouse that frames in a single button that could order the router to, for example, delete all firewall rules. That would give them an advantage in an attack.”

The second example is more insidious as attackers wouldn’t have to worry about mimicking or compromising legitimate Web sites.

Smile, you’re on candid camera

You may have been wondering why I mentioned Adobe earlier. Well, they’re in the middle of this vulnerability, too. Exploiting a vulnerable version of Flash Player software with clickjacking could allow the attacker to turn on computer-connected webcams and microphones, actually spying on the user.

This vulnerability is already out in the wild; Flash developer Guy Aharonovsky published a proof-of-concept (PoC) demonstration on his Guya.net Wweb site. The actual demonstration is currently disabled, but the video depicts how the attack occurs. There are several interesting comments and references to other articles about clickjacking on the Guya Web site as well.

TechRepublic editor Selena Frye’s recent article “Flash Player 10 Performing Better on Linux, Mac OS” mentions several reasons why the new release is significant. Flash Player 10 is also significant because of the code Adobe recently added to eliminate the clickjacking vulnerability. In fact, in the security bulletin “Flash Player Update Available to Address Security Vulnerabilities” released on October 15, 2008, Adobe pointed out the only recourse users have is to update to version 10 of Flash Player. If you want to know what version of Flash Player is installed on your computer and where to download the latest version, you can do so at the Adobe Flash Player Web site.

More Clickjacking details

When Mr. Grossman and Mr. Hansen initially presented the details of this vulnerability, Adobe asked them to not go public with the exploit until they (Adobe) had a fix. With the release of the PoC on the Guya Web site and almost simultaneous release of Flash Player 10, the researchers finally didn’t have any reason not to discuss the details of cialis sales online the vulnerability. You can read about all 12 issues at the ha.ckers.org Web site.

How to eliminate the vulnerability?

The one obvious fix is to update to Flash Player 10 if at all possible. As for Web browsers, it’s more difficult. If you’re using Firefox, I’d suggest upgrading to version 3 and installing all the latest patches. You may have heard me mention NoScript before. Giorgio Maone the developer of NoScript has been in contact with Mr. Grossman, and both are of the mind that NoScript will in almost all cases prevent clickjacking attacks. The only problem is that NoScript isn’t intuitive, and a majority of users will get frustrated with it almost immediately.

As for other browsers Giorgio Maone published “Clickjacking and Other Browsers (IE, Safari, Chrome, and Opera)” on his Hackademix.net Web site, where he explained what, if anything, can be done to prevent clickjacking attacks while using IE, Safari, Chrome, or Opera.

Final thoughts

It’s still early in the discussion stage, so the fallout from clickjacking is hard to predict. Most experts believe clickjacking is a big deal and can only be truly rectified by redesigning the browsers. What I find more alarming is the following quote by Mr. Hansen:

“When Jeremiah and I were looking at clickjacking, we found all kinds of random browser bugs, tons of bugs and a mess load of flaws. A lot of them were unrelated to clickjacking. But as other researchers start looking at clickjacking, they’ll find their own interesting bugs.”

That’s not a very comforting thought, but I’m glad they’re looking.

Permalink • Print • Comment

My Live Signature

I’m really excited cialis sale about sharing this Web site with you! My mom sent it to me after she used it to create a signature she could use for her work e-mails. I recommend starting with the Quick Tour.

The Quick Tour will not only walk you through the whole process, but it will also explain all the different ways you can make your signature. You'll want to get a static signature, because they’re free! (Only the static ones created from the wizard or with the draw tool are free).

To get started making your signature, click on Start Now. You’ll then need to choose whether you want to use the wizard or the draw tool. I recommend using the wizard, because it was a lot more fun to select a font that matches my hand writing than to draw a deformed version of my signature with the mouse.

To use the wizard, click on the Create Signature button underneath the text that says “Create a new signature using our wizard.” That will lead you to a page where you’ll be presented with three options: wizard, draw or upload. You'll want to select the wizard, which is the first option.

After selecting the wizard tool, you’ll be asked to type in the name or nickname you’d like to use for your signature. I put in Amanda @ WorldStart.com, which is how I sign my e-mails. In the next step, you’ll select which font you want to use. There are around 120 different fonts you can choose from and they may take a minute or tow to load. Click on the bullet of the font you want to use and then click on the Next button at the bottom of the page.

The next step is to select the size you want your signature to be. I like mine rather small, so I selected size 2. There are ten different sizes to pick from, so you’ll have plenty of options. Click on the Next button to continue. Here you'll select the color of the font you want to use for your signature. There are ten different colors to choose from. Next, you can set the slope of your signature. There are ten different slopes to choose from as well. You’re finally finished!

Take the code they give you for your signature (signature ID) and copy it. Then paste it on the Start Now page under the Download a Signature heading. The other thing you can do with the signature ID is paste it under the Generate a Code section. That will give you a choice between an HTML code and a BB code. If you want to use it on a forum, choose the BB code. If you want to use it on a Web page, choose the HTML code.

Now, you have a personalized signature all your very own. Yes!

http://www.mylivesignature.com/

Permalink • Print • Comment
« Previous PageNext Page »
Made with WordPress and an easy to use WordPress theme • Sky Gold skin by Denis de Bernardy