Changes

Jump to: navigation, search

User:Lkates

3,628 bytes added, 17:10, 10 April 2007
revert
IRC handle: halcyon1234
=Assignment 1BTP600=
BTP600 course material goes here. Iwouldn'd like to figure out how to do that "quote from another article" thing I always see on t mind doing the Wikipedia, where it says "from main article XXX: (text)", so I can snip a part of my A1Design Pattern stub.
In any case, read up on my [[Assignment 1(lkates)|trouble filled but ultimately sucessful]] build.==Code Reading Exercise==
=Assignment 2=Looking at MAKE and ???
#Which file(Here will be the From Main Article clip of why I chose Assignment 2s)did you have to examine?
My project: [[%22Avoid_loading_the_same_page_twice%22_Extension]]'''make'''First I looked at loadargc, since argc reminds me of the C/C++ standard command line variables that you use in main. However, that turned out to be a load balancing program. Next I looked at Main.h, since main seems like a good start, and headers tend to define stuff. But there wasn’t anything useful there. So I opened Main.c, and voila! Code that has to do with command line switches.
=Newsgroup Summaries=. What are your first reactions to these files when you examine them?
'''make'''I'm doing don’t think I can put them down, in accordance to Seneca’s Acceptable Use Policy. But the summary sheer amount of the newsgroup [[Mozilla.dev.platform#.5B.5Blkates_ng_220906.7CFriday_September_22.2C_2006.5D.5D|mozilla.devcode and underscores and structs were a bit overwhelming.platform]]
I've created [[Newsgroup Summary Template|this template]] to make the creation of each week's page a bit easier. It How is based on [http://wiki.mozilla.org/MDC_newsgroup_summaries_the code for working with command-_Proposed_format Deb Richardson's templates]line switches organized at the method, but are more generalizedclass and project levels? (e. They have no data, just "insert stuff here" marksg.is is all in one class? broken across multiple classes? spread across many methods? etc)
=Open Source Symposium='''make'''There are a couple methods defined right near the beginning:
Did you know that it's taking place on the Friday before my birthday? <code> Yaystatic void decode_switches PARAMS ((int argc, me.char **argv, int env)); static void decode_env_switches PARAMS ((char *envar, unsigned int len));</code>
Full details of my experince in [[Lkates:ossreport|my report]].Almost immediately afterwards, there's the structure for an acceptable command line switch
=That Summary Thing=<code>[[RDF]]/* The structure that describes an accepted command switch. */
=Mozilla TestDay=struct command_switch { int c; /* The switch character. */
==Friday enum /* Type of the value. */ { flag, November 3rd /* Turn int flag on. */ flag_off, 2006== /* Turn int flag off. */ string, /* One string per switch. */ positive_int, /* A positive integer. */ floating, /* A floating-point number (double). */ ignore /* Ignored. */ } type;
(Note: char *value_ptr; /* Pointer to the value-holding variable. Readding the info, since it seems to have gone to /dev*/null!)
This test day was meant to test Firefox unsigned int env:1; /* Can come from MAKEFLAGS.5.0.8 */ unsigned int toenv:1; /* Should be put in MAKEFLAGS. I decided to do BST tests*/ unsigned int no_makefile:1; /* Don't propagate when remaking makefiles. */
When I first started, I was unsure where char *noarg_value; /* Pointer to beginvalue used if no argument is given. I took the inititive and read through the Mozdev entry on test day*/ char *default_value;/* Pointer to default value. It told me almost everything, except for the build ID-- and how to get it.*/
The nice people on IRC were able to point me to the [https: char *long_name; //addons* Long option name.mozilla.org */firefox };</1391/ Nightly Tester Tools]. Once they were installed, I knew I was working with 2006102516. I posted that to the channel for the benefit of others.code>
Once that was done, I went straight to the testing. I chose to do Plugins. I chose to do that since I didn't have any plug-ins installed already. (I use Mozilla rather than Firefox, so I didn't have to worry about nerfing profiles, either)
For the most partMain.c then goes on to define a usage output, that is used to define, in English, how to use all my test ran smoothly. I didn't encounter any tests that flat-out failedthe different flags. HoweverPresumably, I came across several where the text in the test differed from the text in this is used when the actual browser menus./h switch is used
Since I was on #testday on IRC<code>/* The usage output. We write it this way to make life easier for the translators, I was able especially those trying to ask what translate to do with tests that were technically incorrect, but that weren't failsright-to-left languages like Hebrew. I was told to file a Pass with info in the comments field.*/
I did find one odd bug that had to do with how my Firefox reacted to mailto: fieldsstatic const char *const usage[] =... N_("\ -h, but after consulting with tracy--help Print this message and exit.\n"), it looked like it came down to the configuration of my system...</code>
Overall, I found the testday to be... well... neat. I can definately see the usefulness of such a test day. Even if everyone does a little bit, with hundreds or thousands of "little bits" being done, a build will get far more indepth analysis than any one person could ever give it.
==FridayAfterwards, December 1there is a table of the command switches, 2006==along with a bunch of flags and numbers I don't understand.
Time to do some Q&A tests Calendar<code>/* The table of command switches. I downloaded Calendar on both my laptop */static const struct command_switch switches[] = { 'b', ignore, 0, 0, 0, 0, 0, 0, 0 }, { 'B', flag, (win2000char *)&always_make_flag, 1, 1, and on a school computer (win2003)0, 0, 0, "always-make" }, for variety...</code>
From the IRC channel, I chose build Calendar (2006-11-30-04-trunk)
I chose to do Import/Export tests. And lo and beholdIt also defines "long names" for short switches, the first test I grabbedlike when you use -- problem!help rather than /h
When I tried to import a <code>/* Secondary long names for options.csv */static struct option long_option_aliases[] = { { "quiet", no_argument, 0, 's' }, { "stop", no_argument, 0, 'S' }, { "new-file", required_argument, 0, 'W' }, { "assume-new", required_argument, 0, 'W' }, { "assume-old", required_argument, 0, 'o' }, { "max-load", optional_argument, 0, 'l' }, { "dry-run", on either of my systemsno_argument, the program barfed and crashed. The more technical details are located in the [https://bugzilla.mozilla.org/show_bug.cgi?id=362496 Bugzilla bug I filed]. To date 0, 'n' }, the bug is still { "openrecon". I have to admit, it no_argument, 0, 's been kinda neat seeing that something I started actually being worked on. Makes me feel like In'm actually part of}, { "makefile", required_argument, 0, y'know... it.f' }, };</code>
Main.h also defines a structure called "file", which has error handling in it for empty filenames:
<code>static struct file * enter_command_line_file (name) char *name; { if (name[0] =What I Learned='\0') fatal (NILF, _("empty string invalid as file name"));</code>
==Open Source in General==*Open source isn't just done In The Basement. There are people who have made realShortly after, viable careers from open sourcemain goes into its main() function. They've partnered with large corporations. They've made advertising revenue. They've used OS as It starts to do a way to showcase themselves, which have lead to "real jobs".*Its okay to ask questions. I came into this project bunch of crazy stuff with zero knowledge of the whole process. How do I start an extension? What IS an extension? How do I look at the code? How do I compile? Etc. I learned how to ask questions on IRC-- backslash conversion and allocating temp space for variables and how to ask them again if neededstuff. The answer is out thereAfter its done that, it goes ahead and with a large enough community, you can even get someone to answer "what is printf?". (You may have to suffer through a couple RTFMs, but someone will eventually point you to documentation, or tell you what %d does). Be persistant, but not annoying. ;)*Other thingsre-interprets the command line switches, as discussed in class.case Make itself has added any:
==Technical Things==<code> /*Extensions: Decode switches again, in case the variables were set by the makefile. */ decode_env_switches ("MAKEFLAGS", 9);#if 0 decode_env_switches ("MFLAGS", 6);#endif</code>  It then goes into a bunch of "goal files", which are, as far as I now know what an extension can tell, files that have to be made. If none are specified, but are expected, it dies: <code> if (!goals) { if (read_makefiles == 0) fatal (NILF, _("No targets specified and no makefile found"));  fatal (NILF, _("No targets")); }</code> '''isAnt'''Opening main.java yeilds some gold right off the bat: <code>/** * Command line entry point into Ant. This class is entered via the * canonical `public static void main` entry point and reads the * command line arguments. It then assembles and executes an Ant * project. * <p> * If you integrating Ant into some other tool, how this is not the class * to use as an entry point. Please see the source code of this * class to start one, see how to install one once builtit manipulates the Ant project classes. *Xulrunner: What it is*/public class Main implements AntMain {</code>  Right after, how it is there's more gold <code> /** * Creates a platformnew instance of this class using the * arguments specified, how gives it interacts with javascriptany extra user properties which have been * specified, and then runs the build using the classloader provided. * * @param args Command line arguments. Must not be <code>null</code>. *IRC: How @param additionalUserProperties Any extra properties to use it for more than social communicationsin this * build. May be <code>null</code>, how it which is still very relevant the equivalent to * passing in an empty set of properties. * @param coreLoader Classloader used for core classes. May be * <code>null</code> in modern dayswhich case the system classloader is used. *Wiki: / public static void start(String[] args, Properties additionalUserProperties, ClassLoader coreLoader) {</code> Such nice documentation! Soon after, I encountered a method that "processes command line arguments" Sweet! <code> Everything I know about wiki/** * Process command line arguments. * When ant is started from Launcher, the -doing I learned in lib argument does not get * passed through to this courseroutine. How * * @param args the command line arguments. * * @since Ant 1.6 */ private void processArgs(String[] args) {</code> It goes on to format pagesparse each possible command line argument (and its long name equiv), check it for existence, proper structure, properly link and throws exceptions where appropriate. After that, it goes to otherscheck files. #How are invalid or non-existent Filenames dealt with? '''make'''In general, build tables, use breadcrumbsa fatal flag is put up, and morethe program dies. There's still tons This seems to learn! be mostly done when the command line switches are processed. I'm hoping to employ If a file was expected (ie: a Make file, or a file specified after a wiki to help me do worldbuilding switch argument), then the errors are found when the switch is processed, or the file is looked at. This is different from what I get back to fiction writingwas expecting.*lxr: How I was expecting it to use lxr do mandatory file checking right off the bat (start of main function, perhaps), and dying before it did any other forked tools work.  '''Ant'''After checking all the switches (and their appropriate files, where appropriate), in the Start function, it goes on to run a bunch of if-blocks to browse check for file names. It checks for buildfile, etc. If it ever doesn't find an expected file, it throws an exception and search through the dies.<code> // make sure buildfile exists if (!buildFile.exists()) { System.out.println(massive"Buildfile: " + buildFile + " does not exist!"); throw new BuildException("Build failed") Mozilla ; }</code>  .Find and describe 2 similarities between the code you examined in both projects. .Both of the programs process switches, then look at files.Both use a seperate class/method to process the command line switches .Find and describe 2 differences between the codeyou examined in both projects.*Subversion: .'''Make''' uses structures and flags to error check their flags. In a way, the switches error check themselves. '''Ant''' uses a bunch of if blocks and exceptions. It has to error check the switches..'''Make''' has a bunch of very obfuscated comments laced throughout the code. Using '''Ant'' puts all their documentation right before each function, and each piece of documentation is, like, 3 paragraphs long and is presented in very plain English. .If you have time, try modifying one of the programs to add a revisionnew command-tracking toolline switch that is your learn ID. The switch doesn't have to do anything, or can do something very trivial. (A prize to the first group that does this successfully!) Sure, rather than doing it manuallywe'll see=Other Wiki Courses=[[lkates:dps909]]
1
edit

Navigation menu