hilary_mason_data hilary_mason_data-2006 hilary_mason_data-2006-1 knowledge-graph by maker-knowledge-mining

1 hilary mason data-2006-02-20-JavaScript Rotating Images Tutorial


meta infos for this blog

Source: html

Introduction: JavaScript Rotating Images Tutorial Posted: February 20, 2006 | Author: hilary | Filed under: articles , blog | Tags: javascript , web dev | 1 Comment » Introduction Swapping new images into an established layout is one trick that can keep a site design fresh. Some examples: gettyimages benstraw There are several different techniques for accomplishing this effect. A server-side program is the best approach, because you can automatically pull files from a whole directory (eliminating the need to modify code), and it will work even if a user has JavaScript disabled. Unfortunately, not everyone has access to a host that supports server-side scripting. That’s okay, because the same thing can be accomplished with client-side code in JavaScript. I’ll show you how, with three JavaScript functions of varying levels of ease and functionality. First, gather two or more images that are the same size. Then read on… Setup Click here to see t


Summary: the most important sentenses genereted by tfidf model

sentIndex sentText sentNum sentScore

1 JavaScript Rotating Images Tutorial Posted: February 20, 2006 | Author: hilary | Filed under: articles , blog | Tags: javascript , web dev | 1 Comment » Introduction Swapping new images into an established layout is one trick that can keep a site design fresh. [sent-1, score-0.496]

2 A server-side program is the best approach, because you can automatically pull files from a whole directory (eliminating the need to modify code), and it will work even if a user has JavaScript disabled. [sent-3, score-0.275]

3 First, gather two or more images that are the same size. [sent-7, score-0.26]

4 The onload event of the body tag calls the rotating image function. [sent-12, score-0.555]

5 The image tag should be positioned on the page as normal. [sent-13, score-0.351]

6 The width and height are the same as the width and height of the images. [sent-14, score-0.332]

7 Then use the following function to load them dynamically: function selectPicBasic() { // generate a random number between 1 and 3 var randomNum = Math. [sent-19, score-1.4]

8 random() * 3)+1; // build the filename string including the random num var filename = "rose" + randomNum + ". [sent-21, score-1.005]

9 jpg"; // set the src of the image equal to the filename document. [sent-22, score-0.625]

10 src = filename; } This function generates a random number from 1 to 3 (to refer to images ‘rose1. [sent-24, score-1.274]

11 It builds the filename string piece by piece, using the concatenation operator (+). [sent-28, score-0.37]

12 Finally, it gets a pointer to the image element in the body of the document via the tag’s id attribute, and sets the src attribute of the image element to the new, randomly generated filename. [sent-29, score-1.037]

13 This works for simple cases, but it does have some serious drawbacks; you need to modify two of the three lines of the function to update it, and it only supports filenames that follow the roseX. [sent-30, score-0.855]

14 Better Function This function expands the previous one and fixes those issues. [sent-32, score-0.483]

15 function selectPicBetter() { // create an array of all possible images var picArray = new Array('rose1. [sent-33, score-1.32]

16 jpg'); // select a random num between 0 and length of the array var randomNum = Math. [sent-36, score-0.874]

17 length); // assign a random array entry to the src of the image document. [sent-39, score-0.981]

18 src = picArray[randomNum]; } This function uses an array to store a set of filenames. [sent-41, score-1.014]

19 It generates a random number between zero (the first index of the array) and the length of the array, and sets the src attribute of the image to that entry in the array. [sent-42, score-1.103]

20 Conclusion If you’re limited to client-side coding, the selectPicBetter() function is a decent, quick, and clear approach to incorporating rotating images into your site. [sent-53, score-0.945]


similar blogs computed by tfidf model

tfidf for this blog:

wordName wordTfidf (topN-words)

[('function', 0.483), ('array', 0.338), ('images', 0.26), ('filename', 0.242), ('randomnum', 0.193), ('src', 0.193), ('var', 0.193), ('image', 0.19), ('random', 0.163), ('javascript', 0.149), ('attribute', 0.145), ('pic', 0.145), ('rotating', 0.145), ('tag', 0.111), ('element', 0.097), ('entry', 0.097), ('generates', 0.097), ('num', 0.097), ('picarray', 0.097), ('rose', 0.097), ('selectpicbetter', 0.097), ('basic', 0.09), ('filenames', 0.083), ('height', 0.083), ('length', 0.083), ('reload', 0.083), ('width', 0.083), ('number', 0.078), ('modify', 0.074), ('supports', 0.074), ('body', 0.068), ('files', 0.068), ('string', 0.068), ('piece', 0.06), ('approach', 0.057), ('sets', 0.057), ('need', 0.051), ('add', 0.05), ('page', 0.05), ('code', 0.047), ('simple', 0.046), ('new', 0.046), ('three', 0.044), ('articles', 0.041), ('automatically', 0.041), ('calls', 0.041), ('cases', 0.041), ('coding', 0.041), ('conclusion', 0.041), ('directory', 0.041)]

similar blogs list:

simIndex simValue blogId blogTitle

same-blog 1 0.99999982 1 hilary mason data-2006-02-20-JavaScript Rotating Images Tutorial

Introduction: JavaScript Rotating Images Tutorial Posted: February 20, 2006 | Author: hilary | Filed under: articles , blog | Tags: javascript , web dev | 1 Comment » Introduction Swapping new images into an established layout is one trick that can keep a site design fresh. Some examples: gettyimages benstraw There are several different techniques for accomplishing this effect. A server-side program is the best approach, because you can automatically pull files from a whole directory (eliminating the need to modify code), and it will work even if a user has JavaScript disabled. Unfortunately, not everyone has access to a host that supports server-side scripting. That’s okay, because the same thing can be accomplished with client-side code in JavaScript. I’ll show you how, with three JavaScript functions of varying levels of ease and functionality. First, gather two or more images that are the same size. Then read on… Setup Click here to see t

2 0.10007437 90 hilary mason data-2013-02-18-One Random Tweet, please.

Introduction: One Random Tweet, please. Posted: February 18, 2013 | Author: Hilary Mason | Filed under: projects | 4 Comments » One random tweet. It’s easy to believe that other people use social networks in the same way that you do. Your friends largely do use them the same way, which gives us an even more biased perspective. Unfortunately, most networks don’t provide a way to explore representative communications that you’re not connected to. Well, now you can! One random tweet , please. Update: There were some slight technical difficulties due to hitting Twitter’s oembed rate limit. They should be repaired now. (Note: between this and bookbookgoose.com I’m on a bit of a random kick lately. There’s a method to this madness!)

3 0.084744863 25 hilary mason data-2009-02-10-JWU Guest Lecture: Introduction to JavaScript and AJAX

Introduction: JWU Guest Lecture: Introduction to JavaScript and AJAX Posted: February 10, 2009 | Author: hilary | Filed under: blog | Tags: ajax , javascript , jwu , presentations | Leave a comment » JWU Guest Talk: JavaScript and AJAX View more presentations from Hilary Mason . (tags: javascript jwu ) I was invited to give a talk at JWU for an audience of graphic design students on how to enhance their XHTML/CSS skills with JavaScript and AJAX. Enjoy the slides, and I’m looking forward to part 2!

4 0.083166666 83 hilary mason data-2013-01-10-Book Book — Goose!

Introduction: Book Book — Goose! Posted: January 10, 2013 | Author: Hilary Mason | Filed under: projects | Tags: absurdity , hack | 25 Comments » I like to read. I love bookstores, I like to wander, and to find things that I didn’t know existed. But bookstores don’t have every book that exists. Amazon has most books, but search is a terrible way to discover new things. Amazon’s recommendations most likely maximize purchases, but are a terrible way to find something you didn’t know you were looking for (look at a book like Effective JavaScript , for example, and you get recommendations for  Async JavaScript ,  Building Node Applications with MongoDB and Backbone ,  JavaScript Enlightenment ). Similarly, top 100 lists are great at showing you popular things that you’re probably more likely to buy, but not very good at helping you find a book with a story or idea that’s unlike anything you’ve read lately. There must be a better way to explore books. A random way to explor

5 0.077687606 13 hilary mason data-2008-01-22-Create a group Twitter account

Introduction: Create a group Twitter account Posted: January 22, 2008 | Author: hilary | Filed under: blog | Tags: hack , social networking , twitter , web apps , web dev | 13 Comments » Twitter rocks. It’s useful for all kinds of things , but especially for chronicling a live event as it happens, including the pre-event discussion and post-conference wrapup. We’re very excited to be hosting NewB Camp here in Providence, RI on February 23rd. In preparation for the event, Sara created a NewBCamp Twitter account and I coded up this quick script to pull in all tweets related to the conference. It examines all of your followers tweets for a particular phrase or tag, and then reposts those tweets containing the tag to its own timeline with the author’s name prepended. I’m running this as a cron job on my hosting account. You can see it in action here . This is a quick hack. It has a couple of issue that I’m aware of: Someone has to log in and manually add

6 0.072755918 109 hilary mason data-2013-09-30-Need actual random numbers? Meet the NIST randomness beacon.

7 0.069799505 104 hilary mason data-2013-06-14-Speaking: Your Slides != Your Talk

8 0.069141828 56 hilary mason data-2011-05-02-How to get a random line from a file in bash.

9 0.05996222 8 hilary mason data-2007-08-19-Curriculum Design as Software Engineering

10 0.058850579 110 hilary mason data-2013-10-06-What Mugshots Mean For Public Data

11 0.052359212 102 hilary mason data-2013-05-03-Speaking: Explaining Technical Information to a Mixed Audience

12 0.052076142 4 hilary mason data-2007-06-11-Teaching Search Techniques with Google Games

13 0.045013286 55 hilary mason data-2011-03-27-Gitmarks: a peer-to-peer bookmarking system

14 0.043895751 43 hilary mason data-2010-05-27-E-mail automation, questions and answers

15 0.043339267 26 hilary mason data-2009-02-28-LSL: Newspaper Stand (Pull Data From an API and Display it in Second Life)

16 0.041155815 34 hilary mason data-2009-10-16-Data: first and last names from the US Census

17 0.040715076 86 hilary mason data-2013-01-22-Introbot: A Script to Ease the Process of Writing Introductory E-mails

18 0.038711675 87 hilary mason data-2013-01-28-Startups: Why to Share Data with Academics

19 0.038125664 47 hilary mason data-2010-08-23-New York Times: Reinventing E-mail, One Message at a Time

20 0.036737639 28 hilary mason data-2009-04-28-LSL: AOL IM Status Indicator


similar blogs computed by lsi model

lsi for this blog:

topicId topicWeight

[(0, -0.133), (1, 0.029), (2, -0.1), (3, 0.06), (4, -0.02), (5, 0.075), (6, -0.062), (7, 0.165), (8, 0.021), (9, -0.134), (10, 0.082), (11, -0.081), (12, 0.003), (13, -0.156), (14, 0.045), (15, -0.198), (16, 0.064), (17, -0.083), (18, 0.153), (19, -0.166), (20, 0.012), (21, -0.007), (22, -0.03), (23, 0.01), (24, 0.096), (25, -0.126), (26, 0.067), (27, 0.138), (28, -0.035), (29, -0.065), (30, -0.157), (31, 0.033), (32, 0.089), (33, 0.078), (34, -0.062), (35, -0.014), (36, -0.109), (37, -0.069), (38, 0.021), (39, 0.058), (40, 0.161), (41, -0.097), (42, -0.16), (43, -0.033), (44, -0.24), (45, 0.1), (46, 0.133), (47, 0.045), (48, 0.072), (49, 0.078)]

similar blogs list:

simIndex simValue blogId blogTitle

same-blog 1 0.99195957 1 hilary mason data-2006-02-20-JavaScript Rotating Images Tutorial

Introduction: JavaScript Rotating Images Tutorial Posted: February 20, 2006 | Author: hilary | Filed under: articles , blog | Tags: javascript , web dev | 1 Comment » Introduction Swapping new images into an established layout is one trick that can keep a site design fresh. Some examples: gettyimages benstraw There are several different techniques for accomplishing this effect. A server-side program is the best approach, because you can automatically pull files from a whole directory (eliminating the need to modify code), and it will work even if a user has JavaScript disabled. Unfortunately, not everyone has access to a host that supports server-side scripting. That’s okay, because the same thing can be accomplished with client-side code in JavaScript. I’ll show you how, with three JavaScript functions of varying levels of ease and functionality. First, gather two or more images that are the same size. Then read on… Setup Click here to see t

2 0.47957632 25 hilary mason data-2009-02-10-JWU Guest Lecture: Introduction to JavaScript and AJAX

Introduction: JWU Guest Lecture: Introduction to JavaScript and AJAX Posted: February 10, 2009 | Author: hilary | Filed under: blog | Tags: ajax , javascript , jwu , presentations | Leave a comment » JWU Guest Talk: JavaScript and AJAX View more presentations from Hilary Mason . (tags: javascript jwu ) I was invited to give a talk at JWU for an audience of graphic design students on how to enhance their XHTML/CSS skills with JavaScript and AJAX. Enjoy the slides, and I’m looking forward to part 2!

3 0.29394883 109 hilary mason data-2013-09-30-Need actual random numbers? Meet the NIST randomness beacon.

Introduction: Need actual random numbers? Meet the NIST randomness beacon. Posted: September 30, 2013 | Author: Hilary Mason | Filed under: projects | Tags: beacon , python , random , randomness , randomnumbers | 5 Comments » I wrote a python module that wraps that NIST Randomness Beacon , making it simple to get truly random numbers in python. It’s easy to use: b = Beacon() print b.last_record() print b.previous_record() #and so on There’s also a handy generator for getting a set of n random numbers. (One of the best gifts I ever got was a copy of 1,000,000 Random Numbers , and I’ve been intrigued ever since.) Please note that this the randomness beacon is not intended to be a source of cryptographic keys — indeed, it’s a public set of numbers, so I wouldn’t recommend doing anything that could be compromised by someone else having the access to the  exact same set of numbers . Rather, this is interesting precisely for the scientific opportunities that

4 0.29157633 90 hilary mason data-2013-02-18-One Random Tweet, please.

Introduction: One Random Tweet, please. Posted: February 18, 2013 | Author: Hilary Mason | Filed under: projects | 4 Comments » One random tweet. It’s easy to believe that other people use social networks in the same way that you do. Your friends largely do use them the same way, which gives us an even more biased perspective. Unfortunately, most networks don’t provide a way to explore representative communications that you’re not connected to. Well, now you can! One random tweet , please. Update: There were some slight technical difficulties due to hitting Twitter’s oembed rate limit. They should be repaired now. (Note: between this and bookbookgoose.com I’m on a bit of a random kick lately. There’s a method to this madness!)

5 0.26623827 83 hilary mason data-2013-01-10-Book Book — Goose!

Introduction: Book Book — Goose! Posted: January 10, 2013 | Author: Hilary Mason | Filed under: projects | Tags: absurdity , hack | 25 Comments » I like to read. I love bookstores, I like to wander, and to find things that I didn’t know existed. But bookstores don’t have every book that exists. Amazon has most books, but search is a terrible way to discover new things. Amazon’s recommendations most likely maximize purchases, but are a terrible way to find something you didn’t know you were looking for (look at a book like Effective JavaScript , for example, and you get recommendations for  Async JavaScript ,  Building Node Applications with MongoDB and Backbone ,  JavaScript Enlightenment ). Similarly, top 100 lists are great at showing you popular things that you’re probably more likely to buy, but not very good at helping you find a book with a story or idea that’s unlike anything you’ve read lately. There must be a better way to explore books. A random way to explor

6 0.24323334 110 hilary mason data-2013-10-06-What Mugshots Mean For Public Data

7 0.24254398 35 hilary mason data-2009-10-17-Yahoo OpenHackNYC: The Del.icio.us Cake

8 0.23063944 104 hilary mason data-2013-06-14-Speaking: Your Slides != Your Talk

9 0.19971481 56 hilary mason data-2011-05-02-How to get a random line from a file in bash.

10 0.18413061 11 hilary mason data-2007-10-07-An Experience with Using a Wiki for a Collaborative Classroom Documentation Project

11 0.17785971 102 hilary mason data-2013-05-03-Speaking: Explaining Technical Information to a Mixed Audience

12 0.1767506 113 hilary mason data-2013-11-22-Speaking: Two Questions to Ask Before You Give a Talk

13 0.17664111 13 hilary mason data-2008-01-22-Create a group Twitter account

14 0.17077687 2 hilary mason data-2006-05-04-Intro to the Linux Command Line

15 0.17061025 43 hilary mason data-2010-05-27-E-mail automation, questions and answers

16 0.16860133 4 hilary mason data-2007-06-11-Teaching Search Techniques with Google Games

17 0.16676179 12 hilary mason data-2007-10-24-Teen Second Life College Fair

18 0.16612296 6 hilary mason data-2007-07-27-Uninstall Programs … For Real.

19 0.16598861 47 hilary mason data-2010-08-23-New York Times: Reinventing E-mail, One Message at a Time

20 0.16282427 34 hilary mason data-2009-10-16-Data: first and last names from the US Census


similar blogs computed by lda model

lda for this blog:

topicId topicWeight

[(2, 0.045), (4, 0.032), (16, 0.549), (18, 0.015), (50, 0.013), (56, 0.084), (58, 0.058), (59, 0.032), (63, 0.022), (89, 0.022), (92, 0.01)]

similar blogs list:

simIndex simValue blogId blogTitle

same-blog 1 0.96771425 1 hilary mason data-2006-02-20-JavaScript Rotating Images Tutorial

Introduction: JavaScript Rotating Images Tutorial Posted: February 20, 2006 | Author: hilary | Filed under: articles , blog | Tags: javascript , web dev | 1 Comment » Introduction Swapping new images into an established layout is one trick that can keep a site design fresh. Some examples: gettyimages benstraw There are several different techniques for accomplishing this effect. A server-side program is the best approach, because you can automatically pull files from a whole directory (eliminating the need to modify code), and it will work even if a user has JavaScript disabled. Unfortunately, not everyone has access to a host that supports server-side scripting. That’s okay, because the same thing can be accomplished with client-side code in JavaScript. I’ll show you how, with three JavaScript functions of varying levels of ease and functionality. First, gather two or more images that are the same size. Then read on… Setup Click here to see t

2 0.87836021 5 hilary mason data-2007-07-17-Where the Sun Rises… in Second Life

Introduction: Where the Sun Rises… in Second Life Posted: July 17, 2007 | Author: hilary | Filed under: blog | Tags: second life , virtual worlds | 1 Comment » .flickr-photo { } .flickr-frame { float: left; text-align: center; margin-right: 15px; margin-bottom: 15px; } .flickr-caption { font-size: 0.8em; margin-top: 0px; } WindLight 1 , originally uploaded by Lex Zhaoying . The Second Life Scripters mailing list just had a great discussion on the cycle of the sun and the seasons in Second Life. As very detail-oriented residents may have already determined, the sun and moon in SL do not follow the Earth’s natural course. Scripter Extraordinaire Zyzzy Zarf (who doesn’t seem to have a web site, but if I’m wrong, please let me know in the comments!) provided some code obtained from a Linden that indicates that the sun moves in a circle around a tilted plane. The angle of the plane rotates around each year. This results in a “good enough” simulation o

3 0.1805156 83 hilary mason data-2013-01-10-Book Book — Goose!

Introduction: Book Book — Goose! Posted: January 10, 2013 | Author: Hilary Mason | Filed under: projects | Tags: absurdity , hack | 25 Comments » I like to read. I love bookstores, I like to wander, and to find things that I didn’t know existed. But bookstores don’t have every book that exists. Amazon has most books, but search is a terrible way to discover new things. Amazon’s recommendations most likely maximize purchases, but are a terrible way to find something you didn’t know you were looking for (look at a book like Effective JavaScript , for example, and you get recommendations for  Async JavaScript ,  Building Node Applications with MongoDB and Backbone ,  JavaScript Enlightenment ). Similarly, top 100 lists are great at showing you popular things that you’re probably more likely to buy, but not very good at helping you find a book with a story or idea that’s unlike anything you’ve read lately. There must be a better way to explore books. A random way to explor

4 0.17587222 102 hilary mason data-2013-05-03-Speaking: Explaining Technical Information to a Mixed Audience

Introduction: Speaking: Explaining Technical Information to a Mixed Audience Posted: May 3, 2013 | Author: Hilary Mason | Filed under: speaking | Tags: puppies , speaking | 11 Comments » It’s a challenge to present deeply technical material to a room of people with varying expertise levels. If you leave it out, you’re abandoning the substance of your presentation. If you focus on it exclusively, you will lose most of the room. Instead, include the material, but plan to repeat it two (or even three!) times. The first time you explain it, explain it for the expert audience. The second time you explain it, walk through an example of what the system enables. If you’re audience is on Twitter, throw in a third version — the concise and tweetable one! Let’s say we were giving a talk about a machine learning system to classify puppies. Slide one would have a technical diagram of the architecture of the system, and you might explain it as: “We use a naive bayesian classi

5 0.17021352 109 hilary mason data-2013-09-30-Need actual random numbers? Meet the NIST randomness beacon.

Introduction: Need actual random numbers? Meet the NIST randomness beacon. Posted: September 30, 2013 | Author: Hilary Mason | Filed under: projects | Tags: beacon , python , random , randomness , randomnumbers | 5 Comments » I wrote a python module that wraps that NIST Randomness Beacon , making it simple to get truly random numbers in python. It’s easy to use: b = Beacon() print b.last_record() print b.previous_record() #and so on There’s also a handy generator for getting a set of n random numbers. (One of the best gifts I ever got was a copy of 1,000,000 Random Numbers , and I’ve been intrigued ever since.) Please note that this the randomness beacon is not intended to be a source of cryptographic keys — indeed, it’s a public set of numbers, so I wouldn’t recommend doing anything that could be compromised by someone else having the access to the  exact same set of numbers . Rather, this is interesting precisely for the scientific opportunities that

6 0.16553955 114 hilary mason data-2013-12-18-Using Twitter’s Lead-Gen Card to Recruit Beta Testers

7 0.1612211 87 hilary mason data-2013-01-28-Startups: Why to Share Data with Academics

8 0.160804 56 hilary mason data-2011-05-02-How to get a random line from a file in bash.

9 0.15725653 58 hilary mason data-2011-06-22-My Head is Open Source!

10 0.15553404 86 hilary mason data-2013-01-22-Introbot: A Script to Ease the Process of Writing Introductory E-mails

11 0.15218195 7 hilary mason data-2007-07-30-Tip: How to Search Google for Ideas

12 0.14192462 105 hilary mason data-2013-07-05-Speaking: Spend at least 1-3 of the time practicing the talk

13 0.14110814 66 hilary mason data-2011-10-21-Web 2.0 Summit: The Secrets of our Data Subconscious

14 0.1393096 40 hilary mason data-2010-02-16-Conference: Search and Social Media 2010

15 0.13624978 13 hilary mason data-2008-01-22-Create a group Twitter account

16 0.13357645 85 hilary mason data-2013-01-19-Startups: How to Share Data with Academics

17 0.13259642 80 hilary mason data-2012-12-28-Getting Started with Data Science

18 0.12750961 89 hilary mason data-2013-02-04-Experimenting With Physical Graphs

19 0.12595934 110 hilary mason data-2013-10-06-What Mugshots Mean For Public Data

20 0.1252528 46 hilary mason data-2010-08-15-Should you attend Hadoop World? Yes.