Berkeley CSUA MOTD:Entry 45871
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2007/3/4-7 [Computer/SW/Languages/JavaScript, Computer/SW/Languages/Misc] UID:45871 Activity:nil
3/4     So I'm new to AJAX and I have a few concerns. Let's say I include
        an iframe to a completely different website, say, one of the Yahoo
        or Google plugin (game, fortune) or something. Isn't it possible
        that we'll have variable name space collision between the different
        iframes? My understanding is all iframes and frame variables
        are shared but then again my understanding sucks.
        \_ Yes, this is a problem, though it's a smaller problem in practice,
           than you might expect.  By and large, it's solved the same way
           that the problem of name space collisions in C code is `solved'.
           See: http://www.google.com/apis/gadgets/gs.html and search for
           __MODULE_ID__ for an example.  There are actually some clever
           things you can do with scope in Javascript to more or less
           eliminate this problem.  If you're playing around with Javascript,
           you might want to check out IGMonkey, a library I wrote to make it
           easier to do web mashups:
           http://www.csua.berkeley.edu/~dans/igmonkey
           It's largely targeted at the Google Gadgets API, and I haven't had
           time to work on it in months, but there's still some useful stuff
           in there. -dans
2025/05/25 [General] UID:1000 Activity:popular
5/25    

You may also be interested in these entries...
2010/8/8-9/7 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Web] UID:53914 Activity:nil
8/8     Trying to make a list of interesting features languages have
        touted as this whole PL field comes around, trying to see if they
        have basis in the culture of the time: feel free to add some/dispute
        1970 C, "portability"
        1980 C++, classes, oop, iterators, streams, functors, templates
             expert systems
	...
2009/9/28-10/8 [Computer/SW/Languages/C_Cplusplus] UID:53409 Activity:nil
9/28    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
        Java is #1!!! Followed by C, PHP, C++, Visual Basic, Perl,
        C#, Python, Javascript, then finally Ruby. The good news is
        Pascal is going waaaay back up!
        \_ C is still more popular than C++?  I feel much better about myself
           now.
	...
2009/8/3-11 [Computer/SW/Languages/Web] UID:53231 Activity:moderate
8/1     Where's the place people go for free webspace these days?  Helping
        my sis's  kid learn how to set up html/php/some minor javascript.
        \_ not geocities:
           http://help.yahoo.com/l/us/yahoo/geocities/close/close-07.html
        \_ why are there 2987394872 places offering free blog space but
           not alot offering free webspace like before.
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2009/6/30-7/15 [Computer/SW/Languages/JavaScript] UID:53098 Activity:nil
6/30    Javascript, I love you:
        var b = new Boolean(false);
        b;        // false
        !b;       // ALSO false
        !b == b;  // But this is true!
        !!b == !b // Negate both sides and it's false again. FUCK.
	...
2008/9/22-24 [Science/Electric, Computer/Companies/Google, Computer/SW/Editors/Vi] UID:51263 Activity:kinda low
9/22    Gmail's "conversation feature" drives me nuts! Is there a way to
        disable that and make Gmail act like every other e-mail client on the
        planet? WTF thought this was a nice thing to have on by default?
        \_ Umm, why don't you just use another email service then...
           \_ Umm, I do, which is how I have something to compare to. I get
              mail in at least 4 places only one of which is Gmail. I
	...
2008/6/17-20 [Computer/SW/WWW/Browsers] UID:50275 Activity:kinda low 57%like:50273
6/16    Firefox 3 coming out tomorrow.
        http://news.yahoo.com/s/nf/20080612/bs_nf/60269
        Memory usage - Firefox 3 Beta vs. Firefox 2 vs. IE 7:
        http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage
        \_ There's a rule that says NEVER BE THE FIRST TO TRY IT.
           I'm going to let Firefox3 version 1 hammer out bugs first.
	...
2008/3/4-7 [Computer/SW/Virus] UID:49325 Activity:kinda low
3/4     Hi, what's the best free anti-virus software for XP?  What about
        anti-spyware?  Currently I'm using Active Virus Shield and Spybot.
        Thanks.
        \_ I've used: avg, spybot s&d, adaware, trend micro's housecall.
           \_ Does Spybot S&D protect Firefox?  It soulds like the injection
              feature only supports IE.
	...
2008/3/5-7 [Computer/Companies/Google] UID:49346 Activity:kinda low
3/5     How does Google Map widget work? Is it a flash program or a
        pure Javascript program? When you include a Google Map on your
        home page, how does it talk to the <DEAD>maps.google.com<DEAD> server?
        I thought cross domain is not possible.
        \_ Pure JavaScript.  It uses an <iframe> to avoid cross-domain issues.
           \_ You mean the thing that scrolls/moves around is an
	...
2008/2/7-11 [Computer/SW/Languages] UID:49084 Activity:low
2/7     Hi I'd like to learn Flash. I have no UI experience but I just want to
        learn for the sake for curiosity. I just want to create something that
        is interactive and fun, and don't care about scalability/extensibility/
        reliability/efficiency/blah-blah. What language is Flash most similar
        to and how easy/difficult is it to get started (e.g. "hello world")?
        -kchang
	...
2013/4/9-5/18 [Computer/SW/Mail, Academia/Berkeley/CSUA] UID:54647 Activity:nil
4/8     What's a good free e-mail provider? I don't want to use Gmail,
        Yahoo, Outlook, or any of those sites with features I never use that
        track my personal info and keep changing their interface. I want just
        simple e-mail without privacy issues or all the baggage these large,
        for-profit companies are adding. I might even be willing to pay.
        Recommendations?
	...
Cache (8192 bytes)
www.google.com/apis/gadgets/gs.html
Terms and Conditions Search Gadgets Docs Search Getting Started Welcome to the Google Gadgets API! This document walks you through creating your first Google Gadget. This document is intended for people who want to use the Google Gadgets API to write gadgets. Gadgets are so easy to create that they are a good starting point if you are just learning about web programming. You can put the URL for any gadget specification in the Add by URL text box, including ones that you or your friends write (as long as they are posted on a public web server). Note the following about the "Hello World" example: * Gadgets are specified in XML The first line is the standard way to start an XML file. It tells the gadget parser that the text within the CDATA section should not be treated as XML The CDATA section typically contains HTML and JavaScript. The Google Gadgets API consists of a few simple building blocks: XML, HTML, and JavaScript. To get started, all you need is a basic understanding of HTML We will teach you all you need to know about XML to write gadgets. Later, as you write more sophisticated gadgets, you will probably want to learn some JavaScript if you're not familiar with it already. It describes structured data in a way that both humans and computers can read and write. XML is the language you use to write gadget specifications. A gadget is simply an XML file, placed somewhere on the internet where Google can find it. The XML file that specifies a gadget contains instructions on how to process and render the gadget. The XML file can contain all of the data and code for the gadget, or it can have references (URLs) for where to find the rest of the elements. HTML is the markup language used to format pages on the internet. The static content of a gadget is typically written in HTML HTML looks similar to XML, but it's used to format web documents rather than to describe structured data. JavaScript is a scripting language you can use to add dynamic behavior to your gadgets. Note: Gadgets were formerly called modules, which is why the word "Module" appears throughout the API. Writing Your Own Gadgets To get started writing your own gadgets, we recommend that you copy one of the examples and make a very simple change to it. You can use the content directory to search for gadgets and add them to your homepage. To figure out what this URL should be, you may have to ask for help from your webmaster. Adding the Developer Gadget The developer gadget acts a "command center" for all of the gadgets on your homepage. In addition to listing all the gadgets that you're running, it lets you add, view, and manage gadgets. The developer gadget gives you features that you will need if you're doing gadget development. For example, it lets you add gadgets that are "broken," which is useful when you are actively changing a gadget. Add to Google Developer Gadget In the developer gadget you can click on individual gadget links to view their XML specifications. This is a good way to see how other gadgets are implemented. You don't need to worry about advanced developer gadget features for now. But one feature you may want to take advantage of right away is the Cached checkbox. You should uncheck Cached for gadgets while you are working on them. This lets you see your edits instead of the cached gadget. Hosting Gadgets If you don't have access to a public web server, you can host your gadgets using Google Page Creator. If you are a new Google Page Creator user: The first time you use Google Page Creator, you must agree to the Terms and Conditions before you can go any further. After that, you are taken to a page that displays your default Google Page Creator home page in an editor (note that this home page is not related to your personalized homepage). From this page you can click Back to the Page Manager to go to the Page Manager. If you are not a new Google Page Creator user: When you log into Google Page Creator, the first page it displays is the Page Manager. The added file is listed in the "Uploaded stuff" area of the Page Manager. You can delete files by clicking their associated trash can icons. xml Remember: Gadgets are Public Remember that there is no such thing as a private gadget. Once you publish your gadget on a public website, people can find it and view it. Be sure not to include personal information, such as your telephone number or personal email address. Google encourages gadget authors to share their specifications. There are some subtleties to avoid getting crawled by search engines: + Make sure your web server doesn't provide a file listing that includes your file (this also avoids users snooping). Creating a Gadget Spec Once you understand how to edit and publish gadgets, you're ready to include more advanced features in your gadget specifications. The XML gadget specification consists of 3 major parts: * Gadget Preferences. It is where you specify the type of gadget, your programming logic, and often the HTML elements that determine the appearance of your gadget. Note: Within the XML attributes in a gadget spec, you need to "escape" (that is, properly encode) certain characters so that they will be interpreted correctly. When writing a gadget, you should start with the <Content> section. Defining Content The <Content> section represents the "brains" of a gadget. The <Content> section defines the type of content, and either holds the content itself or has a link to external content. The <Content> section is where the gadget attributes and user preferences are combined with programming logic and formatting information to become a running gadget. The easiest way to create your gadget is to simply place HTML (and optionally, JavaScript or Flash) into the <Content> section. Choosing a Content Type for other options relating to access control, remote hosting, using alternative scripting languages, and other topics. "></a> </div> > </Content> </Module> This is the running gadget: Defining User Preferences Some gadgets need to give users a way of supplying user-specific information. For example, a game gadget might allow users to enter a preferred level of difficulty. The user preferences (<UserPref>) section in the XML file describes the user input fields that are turned into user interface controls when the gadget runs. For example, this gadget displays a personal greeting based on the time of day. It lets users specify the following: * A name to use in the greeting. jpg"/> <UserPref name="mychoice" display_name="Show Photo?" datatype="bool" default_value="true"/> <UserPref name="mycolor" display_name="Color" default_value="Yellow" datatype="enum" > <EnumValue value="Red" /> <EnumValue value="Aqua" /> <EnumValue value="Lime" /> <EnumValue value="Yellow" /> <EnumValue value="Pink" /> <EnumValue value="Orange" /> <EnumValue value="White" /> </UserPref> Note the following: * Line 3 of the file contains the text title="Preferences for __UP_myname__". If the user tries to run the gadget without supplying a value for this field, the user preferences edit box remains open until a value is provided. The list of EnumValues specifies the choices that appear in a drop-down menu in the user preferences edit box. Here is the JavaScript that displays the greeting for the gadget: <Content type="html"> <! User preferences are accessed from your gadget using the user preferences JavaScript API, for example: <script type="text/javascript"> // Must be constructed using the __MODULE_ID__ token. It gets replaced // at runtime with the actual ID of your gadget. User Preference Substitution Variables You can use a substitution variable of the format __UP_userpref__ in the <ModulePrefs> or <UserPref> sections, where userpref matches the name attribute of a user preference. When the gadget runs, the string value of the corresponding user preference is substituted for the variable, unescaped. Defining Gadget Preferences The <ModulePrefs> section in the XML file specifies characteristics of the gadget, such as title, author, preferred sizing, and so on. Gadget Scratch Pad Here's a scratch pad where you can create and test gadgets. The scratch pad preview feature currently ...
Cache (1197 bytes)
www.csua.berkeley.edu/~dans/igmonkey -> www.csua.berkeley.edu/~dans/igmonkey/
At its core, iGMonkey provides a flexible retrieval and rendering pipeline that manipulates a document by passing it through chains of pluggable filter' functions. unix shell is something you find on the beach, iGMonkey is easy to learn so it won't take you long to get up to speed. iGMonkey includes a number of useful filter functions you may use. Better yet, you can write your own filters to process the documents that are important to you. Best of all, iGMonkey filters facilitate reuse and remixing. iGMonkey features helpful utility functions that simplify your code, and make your applications more robust. Solid cross-browser support is a key goal of iGMonkey so stay tuned. If you have a success or horror story using iGMonkey on any browser, please let me know. Ideally, Greasemonkey scripts will work seamlessly with iGMonkey filters and vice versa without any modifications required on the part of developers. Long term * Grow iGMonkey into a meta-platform that makes it easy to target many different platforms. I soon realized that I could generalize the module's plumbing to create an easy to use web mashup platform that encourages developers to remix and reuse one anothers' work.