tag:blogger.com,1999:blog-28740570120770566432024-02-07T00:19:35.238-05:00renascencegirlAnything and Everything: Web Design, Gardening, Photography, Cooking and more...nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.comBlogger138125tag:blogger.com,1999:blog-2874057012077056643.post-55867068255780951702014-11-21T10:14:00.000-05:002014-11-21T10:14:27.906-05:00A funny thing happened on the way to site-buildingIt all started when I tried to sql-sync my database from my local setup to my remote test server.<br />
<br />
<code>drush sql-sync @dev @test<br />
ssh: Could not resolve hostname @dev: Name or service not known</code><br />
<br />
hm. So I google my error and find <a href="https://github.com/drush-ops/drush/issues/668">an issue on the Drush Github project</a> for the exact same problem. Awesome! it's already been fixed. So I just need to update drush.<br />
<br />
Having previously installed drush as a git repository, I cd over to that dir and and do a git pull. yes? Well along the way I notice that the drush github page now suggests <a href="https://github.com/drush-ops/drush#installupdate---a-global-drush-for-all-projects">installing with Composer instead</a>, so I decide to update to that process. Probably I could've just stuck with my previous method, but in the interest of doing things "the right way"... this is where I keep getting myself in trouble. Ok:<br />
<br />
<code>composer global update</code><br />
<code>#tried composer -V and global update just to see where I stood...<br />
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.<br />
...<br />
Composer could not find a composer.json file in /Users/E/.composer<br />
...<br />
drush (master)$ /usr/local/bin/composer self-update [Composer\Downloader\TransportException] <br />
The "https://getcomposer.org/version" file could not be downloaded: allow_u <br />
rl_fopen must be enabled in php.ini...</code><br />
<br />
Sigh. So I fix allow_url_fopen. I run composer self-update. I try to install drush again... composer.json?? It took a bit more research to get this right, and I honestly don't remember what I did now. But here's what it wound up as:<br />
<code><br />
{<br />
"require": {<br />
"drush/drush": "dev-master"<br />
}<br />
}<br />
</code><br />
<code><br /></code>
Swell. I think at this point I managed to run the command to get drush re-installed. Now I've got the version of drush with the fix for my original issue! or so I thought... I took a closer look at <a href="https://github.com/drush-ops/drush/commit/0c95bce6c78e83d05fddc3f8b07fb6b9a09799c6">the code fix</a> for the ssh problem, found that file in my install and compared. The code didn't match, but the hash when I had updated with composer showed it was the most recent version! I had the new updates, but I also had the old git clone of drush. Guess which one my shell was pointing at?<br />
<br />
Eventually. Eventually I check which drush, where drush, what drush?? and find my bash_profile export PATH pointing in too many directions (wrong!: /Applications/drush/drush:/.composer/vendor/bin:), which if I'd been paying slightly more attention I might've noticed in step one of installing with Composer. Removed the old path, kept the .composer path and I think that's when it finally worked.<br />
<br />
At least I'm pretty sure that's what happened. By the time I was done with this I had completely forgotten that I was trying to sql-sync. So I finally, finally got back to that and it actually just worked. So now I need to figure out pushing the rest of my initial local dev stuff up and after that it'll all be pushing code up and pulling data down.<br />
<br />
It's going to be really weird doing front-end work after spending so much time on configuring and getting things to just function... one day at a time.<br />
<div>
<br /></div>
nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com1Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-89837127932387509862014-06-23T17:17:00.003-04:002014-06-23T17:17:58.823-04:00Getting up to speed on CSS toolsI did this backwards. It should have been mixins, Sass, Smacss, Compass, Singularity. Then again, sometimes starting and the end and working your way back lets you see the bigger picture and understand how it all fits together. Says the girl who started Drupal with core contributions.<br />
<br />
<b><a href="https://github.com/Team-Sass/Singularity">Singularity</a></b> (compass extension)- ratio-based grids (<a href="http://vimeo.com/63509346">quick walkthrough video here</a>), very easy to make different widths <code>$grids: 1 2 3 2;</code> Also can use px, pt. Integrates with breakpoint- add an <code>@include breakpoint(30em){@include grid-span(2, 3);}</code>. Very cool, super easy way to get responsive design out fast.<br />
<br />
<a href="http://oocss.org/spec/css-mixins.html"><b>Mixins</b></a>- A mixin is an at-rule used to define a ruleset than can then be *reused* in other rulesets. Yay reusable code. I think mostly as a n00b I'm always surprised when things like this aren't a given- it makes perfect sense to be able to define a thing and then plug it in wherever you need that thing. But is this the same thing as the mixins Compass is using?<br />
<code><br />
/* define a mixin */<br />
@mixin .muffinstyle {<br />
display: inline-block;<br />
background-color: blue;<br />
}<br />
/* use a mixin */<br />
<br />
p .bakery {<br />
include: .muffinstyle;<br />
border: 1px solid red;<br />
}<br />
</code><br />
<br />
ok, <a href="https://stackoverflow.com/questions/3453257/what-is-the-purpose-of-the-symbol-in-css">Stackoverflow question on the CSS at-rule here</a>. So basically anything preceded by an @ is an instruction for the user agent, rather than styling rulesets. I've been using @media, @font-face and so on, but hadn't really thought about the construct itself. Here's <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule">MDN on at-rules</a> and <a href="http://www.w3.org/TR/css3-syntax/#syntax-description">W3C on CSS syntax</a> (this one's really helpful). There's a very handy graphic and description <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#CSS_statements">here on CSS statements and their subsets</a>, at-rules and rulesets.<br />
<br />
<a href="http://compass-style.org/"><b>Compass</b></a>- Ok, so there are CSS mixins, then there are Compass mixins... which are just a predefined set of CSS mixins? oh. And then Singularity pairs with Compass. <i>I get it. </i>/several hours of digging and reading later.<br />
<br />
<a href="http://sass-lang.com/guide"><b>Sass</b></a>- This also makes all kinds of sense. Things like variables to hold info in a more logical spot while you're writing, then output a fully fleshed out CSS file at the end. Saves on typing, mistakes, and again with the reusable code. Compass is for writing Sass. Got it. Wow, nesting. So logical, so tidy. Ah, and we're on the new version that uses curly braces, which seems a lot better than just indenting anyway. I do not generally approve of dropping semi-colons and such even if it *is* more minimalist.<br />
<br />
<a href="http://smacss.com/book/"><b>Smacss</b></a>- I really appreciate this- organizing, categorizing, approaching css in a logical fashion rather than throwing properties left and right and hoping it all works out. See my next post on approaching a problem, too. I might disagree with a couple things Snook says (and this book is a little old already), but his general point is spot on. I think this will fit into my brain even better after my next two or three tabs, too... Things start getting interesting once we drill down to <a href="http://smacss.com/book/type-module">the "module" level</a>. Goals: increase semantics and decrease reliance on specific HTML<br />
<br />
Next: More depth from <a href="http://webuild.envato.com/blog/how-to-scale-and-maintain-legacy-css-with-sass-and-smacss/">Legacy CSS with Sass and SMACSS</a> and <a href="https://medium.com/objects-in-space/objects-in-space-f6f404727">modular SASS development using SMACSS and BEM</a>.<br />
<br />
In other predictable news, something here needed homebrew to install... I think it was a Ruby update. I have Ruby 1.8.7, but would like to have the current. Probably doesn't matter. But I think to update I need homebrew and homebrew last I checked needed xcode and 10.6.8 does not the xcode have. BUT. I think I can install the sass/singularity/compass package with just ruby. I hope. Later. Not now. Because this is always ridiculous, and generally why I'd rather stick with simple, low-level stuff.<br />
<br />
Next: <a href="http://www.appnovation.com/blog/creating-drupal-8-theme-sasssingularity-breakpoint">Creating a Drupal 8 Theme with Sass, Singularity & Breakpoint</a>nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-7163197463932793172014-06-14T19:05:00.000-04:002014-06-16T18:12:42.204-04:00That avocado-quinoa thingLast week in Austin I had the pleasure of dining at <a href="http://www.lambertsaustin.com/">Lambert's BBQ</a> with a couple of <a href="https://twitter.com/robertDouglass/status/475757569261043712">fellow Drupalists</a>. We ordered a fleet of tasty dishes, but made particular note of an avocado/quinoa confabulation that lay beneath a trout: <i>Cold Smoked Rainbow Trout, </i><i>Avocado Quinoa, Bella Verde Cilantro, </i><i>Tomato & Serrano Vinaigrette. </i>The quinoa adhered to the little blocks of avocado and added subtle crunch to each bite, while also imparting significant flavor for two typically understated ingredients. Must've been _some_ vinaigrette. So, I decided to try to create something similar. And got a little distracted, so it's completely different, but not bad.<br />
<h3>
Avocado and Quinoa salad-thing</h3>
<b>1 cup quinoa, any variety (the restaurant used plain, I used tricolor)</b><br />
<b>1 tbl olive oil, salt</b><br />
<b>~2 cups water</b><br />
<br />
Toast the quinoa in the olive oil and salt until it begins to smell nutty. Add the water, bring to a boil, then simmer until the water is absorbed and the quinoa is the desired texture. Let cool.<br />
<br />
<b>1 small cucumber</b><br />
<b>1 small onion (red)</b><br />
<br />
Meanwhile, dice cucumber and onion (I had a spring onion, but red would probably be better). Toss together in a bowl.<br />
<br />
<b>2 limes</b><br />
<b>2 avocados</b><br />
<br />
Squeeze a couple of limes and reserve the juice (debatably, lemon might've been better). Dice two avocados (peel then slice) and toss with lime juice.<br />
<br />
<b>handful of cilantro</b><br />
<b>couple sprigs dill</b><br />
<b>salt and pepper</b><br />
<br />
Chop herbs, add to cucumber and onion along with avocado and lime juice. Salt and pepper to taste and careful fold everything together with the quinoa. Let sit in the fridge for a bit for the flavors to relax, then serve at room temperature or chilled.<br />
<br />
Suggestions welcome!nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com2Austin, TX, USA30.267153 -97.74306079999996729.828484 -98.388507799999971 30.705822 -97.097613799999962tag:blogger.com,1999:blog-2874057012077056643.post-41473499122157608402014-06-11T14:54:00.000-04:002014-06-11T14:54:21.761-04:00The Joy of "The Joy"<span id="docs-internal-guid-c33c2da6-8c1d-c8c9-42ec-c81f707f67bf"></span><br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-c33c2da6-8c1d-c8c9-42ec-c81f707f67bf"><span style="font-family: 'Times New Roman'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><i>This article originally appeared in the </i><a href="https://www.facebook.com/mountaincourier" style="font-style: italic;">Mountain Courier</a><i> in March 2013, and I completely forgot to post it to my blog! My friend Suzanne, who edits and writes for the paper, suggested I write the article after seeing my collection of </i>Joys<i> in my kitchen pantry. </i></span></span></div>
<span id="docs-internal-guid-c33c2da6-8c1d-c8c9-42ec-c81f707f67bf">
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: 'Times New Roman'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">The sun slowly rises over a small sea of pop-up tents, my coffee and my breath adding to the quietly dissipating morning fog. A lone jogger pads by, the only traffic at this early hour. Piles of neatly stacked root vegetables, compulsively organized by a sleep-deprived farmer, wait patiently for the 10 am rush. My numbing fingers flick through the pages of a cookbook I’m perusing, looking for recipes to recommend with today’s cuts of grass-fed beef, pork, lamb and chicken that I’m here to peddle.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">I was a vegetarian for the first 20 or so years of my life and have since been playing catch-up on how to cook things like pork belly and beef tongue. My customers and I, the adult novice, have found this particular cookbook quite handy for basic information and creative uses for a wide range of ingredients, both familiar and novel. The book is the <i>Joy of Cooking</i>, my ultimate guide on all things food.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">Farm markets vary greatly across the region and the seasons, which translates into a certain amount of uncertainty as to what will be available at any given time. Seasonal produce is preferable for freshness, nutrition and the local economy, but sometimes one just doesn’t know what to do with a pile of kale and turnips, much less the wealth of parsnips or variety meats. It is here, in the unexpected and unexplored, that a good reference on cooking becomes invaluable.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">It was not my intention to collect multiple editions of the <i>Joy of Cooking</i>. When my first copy came to me, I was more interested in it as a book—an antique <i>livre</i> to add to my library—than as a cookbook. A quick read-through, however, inspired me to assemble an unnecessarily complex cake using separate recipes for the batter, frosting, filling, and probably cake syrup as well, not to mention decoration. My notes on the subject are still tucked into the pages of this 1943 edition (1946 printing).</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">This first <i>Joy</i> was a gift from my mother, purchased in an antiquarian bookshop in Vermont on the advent of my first apartment, and thereby my first kitchen. Before this, my cooking skills had approximately encompassed rice, eggs, and—thanks to a summer in a friend’s well-appointed kitchen—homemade pizza and cinnamon rolls. As a vegetarian still working on my thesis, my most elaborate dish was stir-fried vegetables with tofu. The <i>Joy</i> was essential to me for basic instructions, factual lookups, information on the latest new ingredient from the food co-op and rules for baking. It was indeed the ideal first cookbook.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">As things progressed I acquired two more editions: a brand new 75th anniversary revision bought as retail therapy, and my grandmother’s own 1952 edition complete with her notes and clippings. My three copies currently reside with a 1972 revision owned by a roommate; four <i>Joys</i> in total.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">Irma Rombauer’s first edition came into being in 1931 as a collection of personal recipes from her “Victorian roots” to pass on to her children as they left the nest. It was also intended as a helpful guide to the newly minted housewife, alone and bewildered in her kitchen, written to be “so clear that a child can follow it.”</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">The early editions were a very personal affair for Irma and her daughter, Marion Rombauer Becker, who provided the first illustrations as well as helping her mother test recipes and organize the book. Irma’s wit and familiar tone lend themselves to a very friendly text in which the cook can feel as if she has a personal relationship with her cookbook and its writer. My 1943 <i>Joy</i> includes advice on war rationing, as well as bunches of recipes for aspics, gelatine salads, timbales and soufflés, all in the interest of disguising an array of leftovers. My recipe of choice, however, is for Crepes Suzette (essentially flaming French pancakes), which comes with an amusing anecdote about the dish’s origins with Chef Henri Charpentier and the Prince of Wales.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">Both the 1943 and 1952 editions contain extensive advice on entertaining, how to execute full dinner service and from which direction the servants should serve the fish course. There is a handy chart on various fish and how to cook them, quite a lot on baking and confections, nutrition charts, wine charts, herb charts, leftovers charts and a glossary. Irma also took care to “give this book the impression of sobriety and stability it deserves [such that] the alcoholic cocktails have been relegated to the chapter on Beverages.” On the other hand, she also acknowledged that while smoking at the dinner table was très gauche (it destroys the palate), the hostess must provide cigarettes and an ash tray to make her guests as comfortable as possible.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">My grandmother’s <i>Joy</i>, the 1952 revision, continues largely along the same track as the 1943 with general rules aimed at gaining an understanding and then a variety of applications. There are some exciting additions such as more pasta, which “takes a good deal of doctoring to make palatable,” a more organized list of household hints and with the new illustrator, Ginnie Hoffman, diagrams for everything. Irma and Marion can be seen slightly at odds in the introduction, where Irma insists that no cook will read anything but the recipe and information that he or she is looking for, while Marion believes that explaining how the book works is worth a page or two.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">These earlier versions also include a fairly extensive section on game lumped in with poultry. Terrapin, of course, is now protected under the Endangered Species Act, and not many would consider squirrel a viable food source, never mind bear. While the inclusion of frog legs, aspics and the use of the singular “cooky” may give these editions a dated appearance, even the very earliest <i>Joy</i> in my collection emphasizes nutrition, taking note of Americans’ tendency toward overeating and not balancing caloric intake with nutritional needs.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">As time and culture have progressed through the last 75 years, the target audience shifted away from the blushing bride and housewife toward an independent new cook. In the middle years, many sections bit the dust, including “Know Your Ingredients,” much of the entertaining instruction, and the gelatine concoctions. The 1970s were a time when horizons and palates were broadening, food was being shipped greater distances and people were eating tofu, of all things. Marion Rombauer Becker reorganized the book into sections on The Foods We Eat, Heat and Keep, which meant that absolutely everything was shuffled and, I found, rearranged in illogical order. The 1975 edition was the most popular <i>Joy</i> ever, so it must have made sense to most readers and cooks.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">Which brings us to the 75th anniversary <i>Joy</i>, published in 2006, thanks to Ethan Becker, Marion’s son. As a Rombauer broodling and graduate of Le Cordon Bleu, Ethan brought respect for heritage and tradition while being open to change. The revision he put together organizes the recipes once again by their place in a meal, beginning with drinks, then hors d’oeuvres, vegetables, meats, desserts, and finishing with methods for preserving. The glory of this edition is the encyclopedic appendix that brings back “Know Your Ingredients,” a plethora of substitution, conversion and other charts, and information on every method you might need to know. Contrary to my assumption, this edition actually contains an expanded section on game, although the handy diagram on squirrel is omitted.</span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; color: #222222; line-height: normal;">
<span style="font-family: inherit;">So here we are, back from market with an armload of food, ready to experiment, to learn a new way of preparing a favorite squash and what exactly to do with a bundle of fiddleheads. Any bride, bachelor, or impulse shopper will find his or her way with <i>Joy</i>, branching out into ethnic cuisines, more modern dishes and favorite personal recipes from Ethan, Marion and Irma herself.</span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px; line-height: normal;">
<br /></div>
</div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: 'Times New Roman'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Epilogue: I have since also acquired a mint condition, dust jacket-intact 1964 edition of <i>Joy. </i>It is happily nested with the others and gets regular attention from the chef.</span></div>
<div>
<span style="font-family: 'Times New Roman'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</span><a href="https://drive.google.com/file/d/0BzCDnhRbK9WvSFNGMHhBTm5VN3c/edit?usp=sharing">The original version of this article in the print edition is here as a PDF</a>. It includes tidibits from other contributors in a four page layout extravaganza.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com1Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-4132102380190780852014-05-30T21:24:00.001-04:002014-05-30T21:24:30.434-04:00In which I talk to myself a lotMore on setting up my first Drupal/Git/Drush site...<br />
<br />
I've opted to ignore the multitudinous <a href="https://drupal.org/node/207036">potential php settings</a> for now, and am hoping things just work for the moment. Otherwise I'll keep procrastinating by fussing with server settings forever. I did find that my <a href="http://wiki.dreamhost.com/Installing_PHP5">php version is easily changed</a> by clicking edit on a domain in the dreamhost panel. And then my Drupal install moseys along much better.<br />
<br />
If someone wanted to drop me a lecture/note about how I shouldn't be toying with D8 on a live server because [security] I'd actually be curious to know more.<br />
<br />
Oh here we are, the <a href="http://wiki.dreamhost.com/PHP.ini">php.ini wiki page for dreamhost</a>: "We seriously aren't kidding about this" edition. Okay, yeah, still going to try not to mess with it for now. SO, moving along. Complete install using appropriate database. tum tetum.<br />
<br />
Got hostname right, port default appears ok. Dreamhost phpmyadmin seems to have organized my dbs using the underscore I dropped in to differentiate test and production dbs. Hoping that's not a problem. Totally writing things to db now! whee. This is so nerve wracking, given how frequently things seem to break. Then I'll have to go back and clone to my root directory for my site, too, but not until I have something worth having up front.<br />
<br />
meh, nuts. Admin menu doesn't display, just shows "array." Works fine on local. Maybe I'm not doing this quite right if things are that different. Also the whole thing is slow as all get out. oh, I needed to clear my cache. When did drush cc all go the way of the dodo? It's hard to keep up with a learning curve that keeps doing loop-the-loops.<br />
<br />
ehhh I got distracted working frontend site building and haven't been keeping notes! I still can't get my search block to display, not sure why. Finally got my blog view to display the grid first by disabling the contextual filter (tho I'm still not sure why it was showing "3 2014" instead of "May 2014").<br />
<br />
Now need to get my <a href="https://drupal.org/node/670460">drush site aliases</a> up and working so I can push the db up and see what happens. I suppose I might as well be doing my dev on my /test directory, since I'm not really doing dev so much as design. Heaven help me if I ever get to the theming part of the program here. At least my concept is super simple and minimalist. For now. Now where did I put my sketches?<br />
<br />
Or I could just export the dang db and import it to the remote and deal with it later when I have slightly more time. It bothers me to do this the "wrong" way, though. Ok, export, import check. Then I just need to... definitely not the most elegant way to do this. Kinda broke things. Totally lost track of my git system. Maybe I should just get my site-aliases to work.<br />
<br />
Note to self: fix things with chmod u+w. Finally got back to close to where I started by copying settings.php over. <a href="https://www.digitalocean.com/community/articles/how-to-migrate-and-sync-drupal-sites-with-drush">Somewhat easier to follow instructions for site aliases here</a>. That plus the instructions in <a href="http://example.aliases.drushrc.php/">example.aliases.drushrc.php</a>. <br />
<br />
<a href="http://robinmonks.com/2012/02/installing-drush-on-a-shared-dreamhost-account/">Dreamhost specific Drush install instructions</a>!? yes! ... no. That installs the old Drush, I need Drush 7, which requires composer, which requires that the php phar extension be enabled, which it isn't. Seriously, you've got to be kidding me. I just want to sync my database! Ok, <a href="http://serverfault.com/questions/317416/enabling-phar-on-dreamhost-shared-hosting/376638">got the phar extension working</a>, though I *really* don't understand why it wasn't. See also (again) <a href="http://wiki.dreamhost.com/PHP.ini#phprc">Dreamhost's wiki here on php settings</a>.<br />
<br />
Finally got Drush on the remote, more or less. So now running drush @test status locally at least comes up with a different result... "Drush 7.0-dev does not support Drupal" and "Fatal error: Call to undefined function conf_path() in /home/[me]/.composer/vendor/drush/drush/includes/bootstrap.inc on line 783" ...what? ok, maybe I need to do my alias a little different, can't get that until I run the install script again on the remote? Do I even remember how to do this part anymore?? ok, got drush site-alias @self copied, added to my drushrc.php locally, eventually got rid of a stray paren that was really messing things up, and <i>finally</i> drush @test status works!<br />
<br />
... now I can try syncing my dbs. Which fails on the first try with "Error: no database record could be found for source @dev." erm. Ok, so both @dev and @test pass drush sql-conf. That's good. ...I'm completely at my wits end here. HELP.<br />
<br />
And then I can set up an alias for my production site, which I haven't even provisioned or whatever yet- need to clone to site root, install, set up alias, and sync. Right? That should be easy at this point. ...right?<br /><br />
Eventually I will get to <a href="https://drupal.org/theme-guide/8">theming</a>!nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-33265686281308193132014-05-27T16:46:00.000-04:002014-05-27T17:10:05.294-04:00Useful things I just did<a href="http://wiki.dreamhost.com/Environment_Setup#Setting_a_user-friendly_prompt">Environment setup</a> for ssh stuff on my server. Eventually found and edited my bash_profile. Remembered how to vi and unix properly. Can't remember what I was originally trying to do.<br />
<br />
<a href="http://wiki.dreamhost.com/Ssh#By_hand">Setting up SSH</a>. Basic stuff. <a href="https://kimmo.suominen.com/docs/ssh/">Understanding SSH</a>.<br />
<br />
Oh yeah, here's where I started, <a href="http://wiki.dreamhost.com/Drupal">Drupal on Dreamhost</a>.<br />
<br />
/me clambers back out of rabbit hole to find a new one to explore... <br />
<br />
oh, and adding an alias to my bash_profile <code>alias ll='ls -la'</code> for more verbose file listings. Cause otherwise I can't *see* .bashrc, say, without at least <code>ls -a</code>.<br />
<br />
Crash course: <a href="https://drupal.org/node/803746#clone">clone local</a>, push to <a href="http://wiki.dreamhost.com/Drupal#Drupal_7">server</a>, bam, test site.<br />
<br />
More or less. Reminder: <a href="https://drupal.org/documentation/install">Installing Drupal</a>. Includes <a href="https://drupal.org/node/66187">db setup</a>.<br />
<br />
Page two of install gives me "no data from server." ... what? the first page is fine, but I click "english" and it gives up? It's not even a WSOD!<br />
<br />
Sweet <i>bunnies</i>. Upgraded MAMP, <i>again</i>, broke things. Eventually remembered to change my mysql password in /Applications/MAMP/bin/phpMyAdmin/config.inc.php (I had changed it away from 'root' at some point, for obvious reasons).<br />
<br />
wooo finally got through the install script. Since I've only done core stuff before I don't really know what all I should use for a production site- username, site name, that sort of stuff. Just going to wing it.<br />
<br />
So this is probably one of those stupid questions, but do I have to go through the install script every time I push up from dev to stage and prod?<br />
<br />
So trying to push from my local dev environment to my test directory on my dreamhost server: fails, gives me a fatal, no directory, not a git repo message. I think I just had <a href="http://git-scm.com/book/en/Git-on-the-Server-The-Protocols#The-SSH-Protocol">my ssh url written wrong</a>, so switched from ssh://user@server/files/stuff.git to user@server:files/stuff.git and that seems to work. But now I'm not quite sure what that did for me- "This directory is not the working tree, where you edit and commit code. Rather, it is simply the central location for the git objects and history..." ok, so I still need to clone from there to test site. hm.<br />
<br />
ok, so now that I'm drawn myself a nice diagram of where my branches and repos and whatnot are, plus associated dbs, I think I can keep moving along... somewhere I had a <a href="https://drupal.org/node/670460">thing for using drush to keep sites synched</a>... Can't handle adding that into the mix right now, just going to try getting my site up and running first.<br />
<br />
With a little help from the <a href="http://git-scm.com/docs/git-clone">git pages</a>, cloning into mysite/test so I can try just a plain install on a live site with a real db. Then I just need to figure out how to pull the db back to local (I think an export will have to do for now, lest I find myself in hours of drush trouble).<br />
<br />
... I should really probably be doing this with D7, not a totally random variety of D8. I'll just hit mysite/test and run through the install script real quick... <i>My php installation is too old???</i> you can't be serious. *checks dreamhost info* ... php 5.2.17.<br />
<br />
*Head-desk*<br />
<br />
Nobody say <a href="https://drupal.org/requirements">anything</a>. TBC after some coffee, methinks.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.8189466 -77.059324599999968 38.8189466 -77.059324599999968tag:blogger.com,1999:blog-2874057012077056643.post-32684072622643383342014-04-22T13:07:00.000-04:002014-04-22T16:01:02.430-04:00Comparison of Arrays, brieflySo. Everything is an object. That <a href="http://renascencegirl.blogspot.com/2013/07/an-introduction-to-jquery-notes.html">was js, right</a>? An object can be an association between a key (name) and a value. Which makes an object sort of an array, right? Because an array is a collection of key:value pairs. If key is a name, that's an object, if it's an index value, that's an array. <a href="https://en.wikipedia.org/wiki/Attribute%E2%80%93value_pair">Key:value pairs</a>. Yep.<br />
<br />
Examples from things I have some familiarity with:<br />
<br />
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Description">JavaScript array creation:</a><br />
<code>var myArray = ["element1", "element2", "bunnies"];<br />
console.log(myArray[2]); <br />
//prints "bunnies"</code><br />
<br />
jQuery object (<a href="https://learn.jquery.com/using-jquery-core/jquery-object/">more than just an array</a>):<br />
<code>var divs = $("div");<br />
console.log(divs); <br />
//prints "[0: div.container, 1: div.logo, 2: div.content...]"</code><br />
<br />
PHP:<br />
<code>$animals = array("dragon", "giraffe", "hedgehog");<br />
echo $animals[2];<br />
//displays "giraffe"</code><br />
<br />
Python Lists (mutable, homogenous):<br />
<code>>>> colors = [['blue', 'red'], ['sage', 'vermillion']]<br />
>>> colors[-1][0]<br />
'sage'</code><br />
<br />
And Python Dictionaries (essentially objects/associative arrays):<br />
<code>>>>dict = {'nonfiction': ['Pollan', 'Berners-Lee'], 'fiction': ['Tolkien', 'Asimov']}<br />
>>> dict['nonfiction'][1]<br />
'Berners-Lee'</code><br />
<br />
And Python Tuples (immutable, heterogenous):<br />
<code>>>>tup = ('a', 3, -0.2)<br />
>>>tup[1]<br />
3</code><br />
<br />
Java (fixed length):<br />
<code>String[] rabbits = {"fuzzy", "hoppy", "ears"};<br />
System.out.println(rabbits[1]);<br />
//prints "hoppy"</code><br />
<br />
<a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf">C</a> (Closest to Java. Info from<a href="http://c.learncodethehardway.org/book/ex8.html"> Learn C the Hard Way</a>. I hadn't touched C before today, forgive me.):<br />
<code>main(){</code><br />
<code>char name[] = "Petunia"; </code><br />
<code>//creates array of chars {'p', 'e', 't'...etc}<br />
printf("name is %s.\n", name);<br />
printf("or also %c %c %c.", name[0], name[1], name[2]);<br />
}<br />
//prints<br />
name is Petunia.<br />
or also P e t.</code>nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com2tag:blogger.com,1999:blog-2874057012077056643.post-17664300690293709932014-04-21T13:56:00.000-04:002014-04-22T13:10:12.277-04:00Useful bits of Drupal doc + site building initWarning: contents are entirely stream of conscious/notes.<br />
<br />
The<a href="https://drupal.org/best-practices"> best practices guide for Drupal</a> has a lot of very important points to consider, but for my own technical edification, I'm focusing on just a few aspects. <a href="https://drupal.org/node/1283408">Handy list of core modules</a> <b>to become familiar with</b> if not fully memorize, just so I grasp the breadth of Drupal functionality a little better. Right now I only know a few nooks and crannies! I'd love to do a big long workshop just to be taught, start to finish, how to build a basic site.<br />
<br />
<b>Read this next: </b><a href="https://drupal.org/node/22282" style="text-decoration: underline;">Using test sites</a> has some good starting points for setting up test environments, multiple servers, the sorts of things I need to be doing below (keeping test sites sych'd. synced? argh). I'll have a local install, then push to a test server (how to keep it private while being up with the same db/etc as my live site?), then from test to live. So the only problem is that my local dev env will be somewhat different from production. <b>Forthcoming: </b>post on Dreamhost's setup in relation to Drupal's needs. I've only posted my placeholder site up there with FTP and plain HTML files! No idea about dbs.<br />
<br />
<a href="https://www.youtube.com/watch?v=84Ud3V9NPw8">Ok, so.</a> (don't even ask about that link, I don't know.) I want to actually develop my website. I want to do this with Drupal. Obviously.<br />
<br />
Erm, or I could<a href="https://github.com/drush-ops/drush#install---composer"> update my drush setup</a>, instead. Went for a git repo this time, for my own sanity, but now apparently it needs something called Composer, too (Almost typed "composter." Guess where my mind is). I think it might be working now, hoping I don't really need to update all those php settings again. It's a wonder anything works, given how many configuration files I need to keep track of...<br />
<br />
-Problem the first: <b>Which version of Drupal?</b> Do I go with D7 and have the benefit of contrib modules, established practices, lots of support? Or do I go with D8, which I'm at least as familiar with, probably more so, and get ahead of the curve and become more adept with what's to come? Keeping in mind that D8 actually incorporates bunches of modules that used to be in contrib, probably covering most of my immediate needs, but also keeping in mind that some things might still be broken, regular updates will be necessary, and the whole thing could break at any minute?<br />
<br />
In my experience, breaking things is the best way I learn how systems work. Even though I know I'll have to rebuild bunches of times to compensate for my own learning and updates to core while it's in development, that will help solidify any new things I learn along the way. Too often I find myself figuring something out once, but then I don't run into the same situation again in my tiny bubble, so I forget it. Database setup, for instance. I need to get my head wrapped around how the DB works.<br />
<br />
-Databases and test sites: <a href="https://drupal.org/node/120617">Keeping local and test sites synchronized</a>... <a href="https://drupal.org/node/670460">using drush</a>.<br />
What is stored in the db? <b>How does Drupal use its db? </b>how is it accessed? Can I easily switch dbs? What would that be useful for? How do I move the live db back to stage and dev sites for testing? download a backup and connect? is there a faster way to get it re-connected, too? (drush!) Looks like I definitely don't want to use the same database for more than one instance of the site or I'll risk contaminating it with screwed up code. Probably <b>reading the drush instructions</b> for <code>drush sql-sync</code> will clear a bunch of this up.<br />
<br />
<b>What's a session variable</b>, exactly? cookies?<br />
<br />
Acquia cloud does this very nicely on its own with the drag and drop setup. Do I need a paid subscription to push to production? can I host my site somewhere that isn't Acquia and still <b>use Acquia cloud</b>? How much time should I spend playing with Dev Desktop?<br />
<br />
What do I do on the backend v. the frontend? what will I use the CMS interface for, just content creation? Adding modules? Theming (this is a knowledge void for me right now)? Develop on a test, test the new thing, then install on the live site? What do I do frontend and what backend and then push? how much pulling should I do? I need to <b>separate my creation phases</b> (site building/dev and site maintenance/content updates)...<br />
<br />
[TODOs are bold]nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-26683941994111686672014-03-07T17:46:00.000-05:002014-03-07T17:47:26.976-05:00Becoming a Drupal Core Mentor<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT5vDyb0hZ3e-7MRuQjiyWG7IXro9jsMtPRqq60jwEbg1UhlaZUyidpeZMP5iTCeePjt5AXconkWO0JnBSiecSJc6ZSbUTK3hiW0CQEg3-rQJfkpKwONXlyu-JHJ10jBOz4pgBmAtT0QM/s1600/313.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .2em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT5vDyb0hZ3e-7MRuQjiyWG7IXro9jsMtPRqq60jwEbg1UhlaZUyidpeZMP5iTCeePjt5AXconkWO0JnBSiecSJc6ZSbUTK3hiW0CQEg3-rQJfkpKwONXlyu-JHJ10jBOz4pgBmAtT0QM/s1600/313.JPG" /></a></div>t's finally time to start doing something I should have done long ago: mentoring new core contributors! I've spent a small chunk of time as a mentee, setting up my own development environment (dev env), finding issues in the mentoring queue and on Drupal.org (d.o), and interacting with other core contributors. While writing documentation and doing rerolls has been a great way to learn Drupal, the real rewards have come from working with other contributors. It's been a great comfort to know that I can ask for help on IRC, and can always find a mentor online during the core mentoring office hours.<br />
<br />
And the bonus is that teaching others is the best way (for me) to learn things! So I went to YesCT for some advice on where to start. Here are a few resources she pointed me to (in addition to <a href="https://drupal.org/core-mentoring/mentor-resources">this big page o' mentor resources</a>):<br />
<br />
First of all, the most important thing to remember for everyone in the Drupal community is that "we are all mentors." <a href="http://comm-press.de/en/blog/we-are-all-mentors">This blog post from YesCT</a> is pretty much what I was trying to say in para #1, but she says it better. Being friendly is the best way to encourage new contributors to come back! See also: <a href="http://webchick.net/node/9">WebChick's comic</a> about her first encounter on IRC with "the Drupal Community on a Bad Day."<br />
<br />
Next we have a key component of being a mentor: reviewing new contributor's work. This requires knowing <a href="http://drupalmentoring.org/reviewer-instructions">how to review the contributor's work</a>, and <a href="https://drupal.org/contributor-tasks/review">how to review a patch itself</a> (to check that it was done correctly). Sticking with the theme of constructive criticism, gentle reminders, helpful pointers and other supportive input here. Teaching contributors how to interact and communicate with others is a great way to keep everyone positive and engaged.<br />
<br />
As a side project, I'd like to help update dm.o and d.o to merge issue task instructions with the regular issue queue, essentially add functionality to the d.o issue queue. Todo for me: read through <a href="https://drupal.org/project/issues/search?issue_tags=Core%20mentoring%20on%20d.o">these related core mentoring on d.o issues</a>. I had just <a href="https://twitter.com/ekl1773/status/431514296515063808">recently noted</a> that having contributor task instructions linked on d.o as they are on dm.o would be much easier than googling them every time I start work on a new issue. Turns out <a href="https://drupal.org/node/2013222">there's an issue for that</a>! (there's also a google doc I won't link to here, but, note to self...)<br />
<br />
Then we've got <a href="https://drupal.org/core-mentoring/sprint-resources">resources for planning a sprint</a>, which I'd really like to do at a Drupalcon in the near future, but am currently lacking a topic to sprint on. If anyone needs a sprint co-leader, I'm happy to help!<br />
<br />
Part of sprinting of contributing is going to be getting everyone set up with a local environment to work with. At an event like Drupalcon, or even something on a smaller scale, this can become problematic if everyone is downloading new software etc at the same time. So here are the <a href="https://drupal.org/dctdi">Drupal Community Tools Download Instructions</a> (dctdi. Tech is almost as bad as gov't with the acronyms). We've also got an <a href="https://drupal.org/core-mentoring/austin">Austin specific Core Mentoring</a> page here and of course <a href="https://drupal.org/dev-env">the perennial dev env setup page here</a>.<br />
<br />
Phew. So far I've had a look at most of those pages, but I need to go back and read the issues for dm.o->d.o as well as go through the mentor resources links thoroughly. It's just really great to have a specific goal and project to work on! I enjoy contributing on issues, but with the current D8 beta push it's been hard to find anywhere I fit in lately. Tallyho.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-13467281270922518562013-12-30T17:08:00.001-05:002013-12-30T17:08:14.554-05:00Drupalcon Prague notes<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZyjdvuiFgplFntAza1WRkVnI16NlagZNeFZ2PErMjMRjoQswAmcnYaNkIVVEQaaqWLCjkpEA5RcUOqZTyH1RGjgzJoeWLGVTsrsUtq1wiXbApW2t8ylVKRB4HGEuuZ8HebzY1HKI9HrI/s1600/009.JPG" imageanchor="1" style="clear: left; float: left; margin-top: 0.5em; margin-right: 0.5em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZyjdvuiFgplFntAza1WRkVnI16NlagZNeFZ2PErMjMRjoQswAmcnYaNkIVVEQaaqWLCjkpEA5RcUOqZTyH1RGjgzJoeWLGVTsrsUtq1wiXbApW2t8ylVKRB4HGEuuZ8HebzY1HKI9HrI/s1600/009.JPG" width=75; height=75;/></a></div>s one might expect, my lofty goal of watching the 20 or so DrupalCon Prague sessions I would have attended in person didn't quite work out... But here are some brief notes on the sessions I've looked at so far:<br />
<br />
<br />
<b><a href="https://prague2013.drupal.org/session/evolving-frontend-development-dancing-tip-hurtling-rocket">Frontend development; dancing on the tip of a hurtling rocket</a></b><br />
<br />
This is almost verbatim why I wanted to be a librarian, and how I came to web development: "What we do as developers is provide content and provide access to that content. That is essentially the value we provide as professionals: There's information out there; we're making it possible for individuals out in the world to get to that content." -Jesse Beach<br />
<br />
It's fascinating to think about how accessibility goals can be translated into more general applications later on. With proper DOM semantics and metadata the entire web could be twice as useful and useable.<br />
<br />
<a href="https://prague2013.drupal.org/session/not-invented-here-proudly-found-elsewhere-drupal-8-story" style="background-color: white; color: #3f00c9; font-family: 'Times New Roman', Times, FreeSerif, serif; line-height: 21px;"><b>From Not-Invented-Here to Proudly-Found-Elsewhere: A Drupal 8 Story</b></a><br />
Alex Pott- This was marked beginner! I get the general gist, but the code examples were a bit over my head. <a href="http://www.phptherightway.com/">Recommended reading on PHP</a>- good, something helpful, recommended, up to date.<br />
<br />
<b><a href="https://prague2013.drupal.org/session/drush-optimizations-your-development-workflow">Drush Optimizations for Your Development Workflow</a> & <a href="https://prague2013.drupal.org/session/drush-do-i-really-have-use-it">Drush- Do I Really Have To Use It?</a></b><br />
Two sessions on Drush from Prague- One was all about convincing people to use Drush (already there, though not entirely clear on how it actually works with a drupal site... should, again, read the basic docs), and the other was adding Drush functionality to your contrib modules (so too advanced). Had I been in Prague, the "Getting Drush Installed" BOF would have been perfect.<br />
<br />
<b><a href="https://prague2013.drupal.org/keynote/lisa-welchman">Lisa Welchman Keynote: The Paradox of Open Growth</a></b><br />
"Governance is about stewardship. It's about taking care of something." "It seems like it's really just for people who are developers. You could be more inclusive and welcoming" (slight paraphrase). Given that I know people try really hard with mentoring and so on, that seems unfortunate.<br />
<br />
And then she brings up shape-note music as a standards practice! Crazy cross-over with my singing experience and hearing from my friend Lynn recently that she had just adapted (<a href="https://sites.google.com/site/windbornemusic/">with her group</a>) a traditional Chinese piece into shape note.<br />
<br />
TBC...nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-71652991177335777012013-10-14T16:19:00.000-04:002013-10-31T12:56:57.411-04:00In which I stumble over PHP<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGrIFBoyQX75MCxsH2mDWA2GcbLV03NZSFT-EpJdIqTMOvB7R5bSQnsnG5J-gDankrGe5aWp9x23ZS5wVQNcQcuq9Wf0WNYKkwgLj5lngH5KNi46Y1qxGGmxMeLMGsoCKOOuz3XJxmlbQ/s1600/679.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .5em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGrIFBoyQX75MCxsH2mDWA2GcbLV03NZSFT-EpJdIqTMOvB7R5bSQnsnG5J-gDankrGe5aWp9x23ZS5wVQNcQcuq9Wf0WNYKkwgLj5lngH5KNi46Y1qxGGmxMeLMGsoCKOOuz3XJxmlbQ/s1600/679.JPG" /></a></div>
his post was originally just called "learning by doing," but then I was feeling so embarrassed about not recognizing PHP when I fell over it that I renamed it. This post is also on understanding the elements of <a href="https://api.drupal.org/api/drupal/core%21modules%21help%21help.api.php/function/hook_help/8">hook_help() in general</a> in order to write <a href="https://drupal.org/node/1876904">views_help()</a>. Warning: contains questions that are not-stupid!<br />
<br />
<b>1. What does <code>$output = '';</code> do, exactly?</b><br />
This is most likely a PHP thing, which I have absolutely zero experience with. I know $ as jQuery, but now I'm not even sure that's what it's doing here. Yeah, that would be PHP- the <a href="http://us.php.net/manual/en/language.variables.basics.php">$ indicates a variable</a>. I've been avoiding learning PHP for the timebeing in the interest of focusing elsewhere without distraction, but a quick look through the <a href="http://us.php.net/manual/en/">PHP online documentation</a> will help me with the syntax here. This explains why no one answered my pathetic pleas for explanation on this previously. I feel pretty dumb for not recognizing/thinking of this right off. The functions look enough like functions that I wasn't paying much attention to details, but... yeah.<br />
<br />
So, question part B: why so many lines for defining $output? Why not in one big block? Is that just for readability, using a new line of PHP for what would be a new line of HTML? The first line $output = ''; is just initializing the output variable, or rather, defining it. Subsequent lines $output .= ''; are concatenating, or adding, those strings onto the previous definitions. Now I'm looking at <a href="https://drupal.org/node/360052">coding best practices for Drupal</a> and <a href="http://www.odi.ch/prog/design/php/guide.php">for PHP</a>. This also spills over into question 2, below.<br />
<br />
<b>2. <code>$output .= '<h3>' . t('About') . '</h3>';</code> What are the periods doing in there? </b><br />
<br />
The separation of html elements and the string to be translated makes sense, no reason to include code in translatable strings. The periods seem to be for <a href="https://drupal.org/coding-standards#concat">concatenation of strings/elements</a> in the $output variable, since otherwise just using = would reassign the entire variable.<br />
<br />
In alexpott's Drupalcon Prague session <a href="https://prague2013.drupal.org/session/not-invented-here-proudly-found-elsewhere-drupal-8-story">From Not-Invented-Here to Proudly-Found-Elsewhere: A Drupal 8 Story</a>, he recommends <a href="http://www.phptherightway.com/pages/The-Basics.html#strings">PHP The Right Way</a>, which just happens to have a few more opinions on things than the <a href="http://us.php.net/docs.php">standard PHP docs</a> (new version in beta!).<br />
<br />
In PHP The Right Way, we find <a href="http://www.phptherightway.com/pages/The-Basics.html#strings">a note on concatenation</a> recommending that strings be kept under 120 characters, and that if they should be longer, to use concatenation operators (eg a period, . ) combined with indented newlines for readability. This method is recommended over using concatenating assignment operators (eg period equals, .= ). The example of what <i>not</i> to do looks exactly like our $output variable here.<br />
<br />
... which means I found the right bit of doc! and that it's usually impossible to keep up with standards, best practices and the latest in code. Plus, I'm sure I'm still missing some reasoning and background here.<br />
<br />
<b>3. More on <a href="https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/function/t/8">the translate function <code>t()</code></a>:</b><br />
<br />
In views_help() the translate function is part of the concatenated string assigned to $output. In point two, above, it marks the string "About" as translatable: t('About'). Whatever is inside the translate function is added to the database of strings to be translated into the current language from English, which is the standard. The translate function works with <a href="https://drupal.org/node/322729">the Localization API</a> to pick out which bits of text are translatable.<br />
<br />
The Localization API seems to mostly do the work of targeting strings for translation either through a translate function or "known locations." The translate function identifies strings, and the Localization Server extracts them. You know, I'm a somewhat visual person, I just keep wanting <i>maps</i> for all these things.<br />
<br />
EDIT: This bit from <a href="https://drupal.org/node/304258">the Drupal JS API docs</a> finally explains how the translate function works:<br />
<blockquote class="tr_bq">
<span style="font-family: Times, Times New Roman, serif;">The <code style="background-color: #f6f6f2; border: 0px; line-height: 1.5em; margin: 0px; padding: 1px; vertical-align: baseline; white-space: pre-wrap;">Drupal.locale</code> property works in conjunction with <code style="background-color: #f6f6f2; border: 0px; line-height: 1.5em; margin: 0px; padding: 1px; vertical-align: baseline; white-space: pre-wrap;">Drupal.t()</code>, the JavaScript equivalent of the server-side <code style="background-color: #f6f6f2; border: 0px; line-height: 1.5em; margin: 0px; padding: 1px; vertical-align: baseline; white-space: pre-wrap;">t()</code> function. It holds a collection of string translations so that <code style="background-color: #f6f6f2; border: 0px; line-height: 1.5em; margin: 0px; padding: 1px; vertical-align: baseline; white-space: pre-wrap;">Drupal.t()</code> can then access the required string from <code style="background-color: #f6f6f2; border: 0px; line-height: 1.5em; margin: 0px; padding: 1px; vertical-align: baseline; white-space: pre-wrap;">Drupal.locale</code> in order to translate what was passed into it.</span></blockquote>
<br />
<b>4. What are these link tokens? ! is preferable to @?</b><br />
<br />
After my preliminary expectations of easiness on this one were doused, I think I at least determined that this is not the same sort of token as the <a href="https://drupal.org/documentation/modules/token">generic placeholder substitution token</a>. It seems that instead of just using <code><a></code> tags, links are created using link tokens and an array. Previously, the links were marked with @, but from a comment on the views_help issue I've gathered that ! is the new @. Perhaps this is another PHP thing. Perhaps I will just go read my PHP books now and call it quits on this blogpost.<br />
<br />
<br />
Read next: <a href="https://drupal.org/node/121997">Working with JS in Drupal</a><br />
<br />
And in the meantime: watch <a href="https://prague2013.drupal.org/program/schedule/monday">session slideshows from DrupalCon Prague</a>! I'm so happy these are available.<br />
<br />
And also, finally went to do something with <a href="http://www.drush.org/about">Drush</a> and found it not cooperating, so now I need to backtrack on that, put it back together, and hope that the <a href="http://drupal.stackexchange.com/questions/85281/im-on-drush-version-6-cant-do-a-drush-status-on-my-drupal8-site-whats-the-s">latest version is really the right thing for D8</a>. Oh, now I really feel dumb. Should have watched <a href="https://prague2013.drupal.org/session/drush-optimizations-your-development-workflow">this session from Prague</a> first, too. Somewhere in the process of downloading the latest, adjusting .bash_profile and connecting to the example aliases file, I broke it even worse. And creating a mysql file somewhere to cooperate with MAMP.<br />
<br />
All this is in the notes on the <a href="https://github.com/drush-ops/drush">Drush github page</a>, of course, but after a while I just started feeling like a complete moron. Finally figured out that drush self-update is no longer included (I must've had a much older version <a href="http://renascencegirl.blogspot.com/2013/06/ignore-setting-up-local-drupal.html">installed earlier</a>, not sure how/why), found a <a href="http://assets.labfiftyfive.com/drush-cheat-sheets/Lab55-Drush_Cheat_Sheet-Extended_version.pdf">drush cheatsheet</a>, and managed to uninstall my modules, check my modules, reinstall... I think I've got it now, but jeez. I keep getting stuck between versions, missing important documentation and feeling really lost, which is incredibly discouraging because then I can't even begin to do simple tasks. Hopefully if I just keep chugging along it'll all work eventually.<br />
<br />
<br />nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com4Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-77098556573642145652013-09-19T15:55:00.002-04:002013-09-19T15:55:46.149-04:00Learning is easy, doing is difficult<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIzS9ISkdOPhfWmqU1iJzpXwRhEahsStqTFQxJw_rkBWUDSYeQYcGlNI1t_5uGPb5zGg6sDfyehgncIhYN99V21X5GKnIYY3zw9RfudfmShONyNpW4IcfafWmxm8CXAMa3BsPqN-lwxIk/s1600/155.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .5em;"><img alt="E" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIzS9ISkdOPhfWmqU1iJzpXwRhEahsStqTFQxJw_rkBWUDSYeQYcGlNI1t_5uGPb5zGg6sDfyehgncIhYN99V21X5GKnIYY3zw9RfudfmShONyNpW4IcfafWmxm8CXAMa3BsPqN-lwxIk/s1600/155.JPG" title="" /></a></div>veryone knows this - the potential for failure increases with the amount of work you're doing. What I need to keep in mind is that it will also plateau and decrease as I gain experience and skills over time, and that it <i>will</i> take time to get there<i>. </i>Patience is not always easy.<br />
<br />
I learn by winging it, charging into a project and trying to do everything right away. Once I figure out that I can't bulldoze my way through, I start getting a sense for what I need to know, then I can backtrack and fill in the gaps before going forward or finishing up. It's not necessarily a great strategy, and sometimes leads to excessive frustration and going in circles, so I try to recognize when I'm just wasting time beating my head against something.<br />
<br />
One of the things I thought I should do before I get too much further is just to go through some of the basic and general documentation for Drupal, so I have a better sense of how it works on both the front and back end. Sometimes when I start thinking I've got a hold on things I just glance over at the #drupal-contribute channel on IRC and feel humbled. Anyway, some disjointed notes:<br />
<br />
<a href="https://drupal.org/documentation/understand">Understanding Drupal</a>- the basic stuff, explaining the system from the front.<br />
<a href="https://api.drupal.org/api/drupal/8">Drupal 8.x API reference</a>- all the stuff I've felt clueless about; hooks, menus, useful things when you're poking at core.<br />
<br />
I had a poke around <a href="http://drupalsites.net/">DrupalSites.net</a> to see if anyone had something like what I want to do... no luck. Mostly I need to be able to use taxonomy terms on photos and blog posts (and whatever else I may add) and be able to search, sort, combine, filter etc for browsing (hello Views, my new best friend). And I'd like to be able to upload and update directly from Lightroom. I have a Lightroom plugin that lets me upload to Picasaweb and update files remotely without having to touch the site itself. So that's most of my needs, apart from some static pages for "About" and whatnot (see previous post): Taxonomy and ease of upload/modification.<br />
<br />
...And someday, e-commerce. At that point, possibly authenticated users who can create little albums of my photos, save and share combinations that explore how each photo speaks to another through composition, color, subject, mood. I'm seeing this with draggable stuff, a large "desktop" where "prints" can be moved around freely, just as you would when laying out a gallery show using contact prints. But that's all someday. Maybe not even until after the D8 release, so going backwards to a D7 site would just flatten my little brain.<br />
<br />
Cron jobs- at last I know how this works in the filesystem. (I'm less sure why I kept the bit below:)<br />
<ul style="background-color: white; border: 0px; box-sizing: border-box; color: #222222; font-family: 'Lucida Grande', 'DejaVu Sans', 'Bitstream Vera Sans', Verdana, Arial, sans-serif; font-size: 13px; line-height: 17.984375px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 0.692em; padding: 0px 0px 0px 2em; vertical-align: baseline;"><li style="border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">status</strong>: A bitmapped field indicating the status of the file. The first 8 bits are reserved for Drupal core. The least significant bit indicates temporary (0) or permanent (1). Temporary files older than <a class="local" href="https://api.drupal.org/api/drupal/core%21modules%21system%21system.module/constant/DRUPAL_MAXIMUM_TEMP_FILE_AGE/8" style="border: 0px; box-sizing: border-box; color: #0678be; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" title="Maximum age of temporary files in seconds.">DRUPAL_MAXIMUM_TEMP_FILE_AGE</a> will be removed during cron runs.</li>
</ul><div><span style="color: #222222;"><span style="font-family: Times, Times New Roman, serif; line-height: 17.984375px;">All caps is a constant?</span></span><br />
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;"><br />
</span></span> </span><br />
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;">I plucked out <a href="https://drupal.org/node/1876904">a new task from the queue</a> for myself, since it looked pretty easy and writing documentation is always a good way to learn more. While I'm in the API docs, I thought to check out <a href="https://api.drupal.org/api/drupal/core%21modules%21help%21help.api.php/function/hook_help/8">how hook_help() works</a> (keep in mind here that I know zero PHP, only some jQuery, and a bit of JS generally). Now I not only have a better idea what I'm trying to write for views_help(), but I have context for understand how hooks work. whee! I've only drafted some text so far, but might go ahead and make the patch so it can keep moving forward. </span></span></span><br />
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;"><br />
</span></span></span> <span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;">There's a doc for <a href="https://drupal.org/node/632280">writing the help text itself</a>, but I still need to figure out/understand what exactly output=. does and if there's a more sensible way to deal with the <a href="https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/function/t/8">translation bits t()</a> than adding them in by hand, not that that would be super difficult in this case. Maybe somewhere in the <a href="https://drupal.org/node/303984">Multilingual Support docs</a>... <a href="https://drupal.org/node/322729">Localization API</a>? ah-ha. Well again, at least now I sort of understand all that. </span></span></span><br />
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;"><br />
</span></span></span> <span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;">I think that's enough for one post, more later!</span></span></span><br />
<br />
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222;"><span style="line-height: 17.984375px;"><br />
</span></span></span></div>nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-2167398930771606132013-08-23T19:30:00.000-04:002013-08-24T00:42:34.686-04:00Afternoon coffee (at 7 pm)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7tU-CLYcUBJo0FKUbLVQssy69VYKhgqispM7wxY67PH22o7UDokcf2b-j_nnvTrDYoJofOxz79fpWSKTvzeXEPKQnpOVdEWH7SABkIYo8Xa36B0Fco_TEcZJa7zfrQ_cVKMdddzIgr8/s1600/681.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .4em;"><img alt="T" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7tU-CLYcUBJo0FKUbLVQssy69VYKhgqispM7wxY67PH22o7UDokcf2b-j_nnvTrDYoJofOxz79fpWSKTvzeXEPKQnpOVdEWH7SABkIYo8Xa36B0Fco_TEcZJa7zfrQ_cVKMdddzIgr8/s1600/681.JPG" title="T" /></a></div>
hese things always begin with the best of intentions, not to mention quite innocently. I had two objectives this afternoon (oh dear, and I see it's now 7pm. oops):<br />
• Have a cup of coffee and plow through <a href="https://api.drupal.org/api/drupal/8">some documentation</a>. And, I prefer having a small snack with my coffee, a croissant, a cookie, a slice of cake...<br />
• Use up the heavy cream I accidentally bought to go in said coffee because I hadn't <i>had</i> coffee yet (the lack of a dilutionary dairy substance being the issue) and so instead of the milk I usually get I got a half litre of very thick, organic cream.<br />
<br />
<div>
So what did I do? well I <a href="https://twitter.com/ekl1773/status/370962484389482497">tweeted</a> of course, asking for recipes. <a href="https://twitter.com/HarlanH">@HarlanH</a> (data scientist extraordinaire) thoughtfully replied and reminded me of the existence of recipes that <i>aren't</i> for baked goods. Crazy, right? In retrospect, I ought to have just gone with his first thought and done a cream sauce for pasta. Instead, I followed his other recommendation to check out something called <a href="http://www.eatyourbooks.com/">Eat Your Books</a>.<br />
<br />
As it turns out, Eat Your Books is a handy dandy, plug your cookbooks/magazines/blogs into it-search engine for physical collections. I faintly heard choirs of angels as I poked through the homepage: finally, I can search my cookbooks without pulling each one off the (rather precarious) shelf and flicking through the index, then a handful of recipes trying to find a use for my one stray ingredient! That method works ok for main ingredients, like zucchini, or pork chops, or even chocolate, but not for say, whole vanilla beans, cracked wheat, or, in this case, heavy cream.<br />
<br />
I added my top cookbooks with haste. A free subscription only allows 5 resources on your e-shelf: Mastering the Art of French Cooking, The Art of French Baking, The Essentials of Baking, The Joy of Cooking and The Pie and Pastry Bible. That covers everything I usually look through, anyway. And lo, <i>five hundred and forty four</i> recipes appeared!<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFSdA4kfFkDvPOMa0WdnASHHRosSFgu7mjuN8y5axTybwqiujRhGsAOEyzlPZFW2aI-QsggdK1fL6eh3AXkwP7FqLjgGl3EKVP4vJtQE7fdIygjQV7jJMGwSuA-6hVZnPachZGWi5kLtI/s1600/EKL_7884.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFSdA4kfFkDvPOMa0WdnASHHRosSFgu7mjuN8y5axTybwqiujRhGsAOEyzlPZFW2aI-QsggdK1fL6eh3AXkwP7FqLjgGl3EKVP4vJtQE7fdIygjQV7jJMGwSuA-6hVZnPachZGWi5kLtI/s320/EKL_7884.jpg" width="320" /></a>It being me, I didn't really have many other ingredients on hand apart from the standard baking arsenal, so I used the filters to narrow things down to "cakes." The filters are actually quite useful. Frankly, a paid subscription would be worth it, only $25 a year, I think. I would prefer some integration with other services, maybe add things I bought on Amazon, or pull in my "<a href="http://www.librarything.com/catalog/ekl1773&tag=cookbooks&collection=-1">cookbooks</a>" tag from LibraryThing. More so, I would like to be able to search <i>all</i> my physical books digitally. I can always use Google Books, but I don't think I've seen a service that will let me save my books and then search them. I'd love to be wrong about this, so please correct me if that's the case.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUGNC8Uz2YXf-7SyuVd6-7_VGhVuRk-oMN8eB_ngaCaJrGLYQwFGQWQtexDIEBD0mg4BQ3rj7i-Jz961TN5n-jKZJf1Y_P1jmy4g9oLHMNpPvmRoDNs4UoaXMpI1SnMCpQr1XvGNf8aVE/s1600/EKL_7892.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUGNC8Uz2YXf-7SyuVd6-7_VGhVuRk-oMN8eB_ngaCaJrGLYQwFGQWQtexDIEBD0mg4BQ3rj7i-Jz961TN5n-jKZJf1Y_P1jmy4g9oLHMNpPvmRoDNs4UoaXMpI1SnMCpQr1XvGNf8aVE/s320/EKL_7892.jpg" style="margin-top: 1em;" width="320" /></a></div>
Right, so anyway, I wound up with a recipe from the 75th Anniversary Joy for Black Forest Cake. I made it a little easier, just two layers instead of three, and amusingly enough, I had half as much heavy cream as it called for (still plenty). I also had some sweet cherries I preserved in brandy back in cherry season, so that covered cherries and kirsch, and I had the cream, chocolate, just enough eggs (market tomorrow!). So here it is, the result of two hours, a lot of flipping back and forth in the Joy for base recipes, and some impatient refrigeration time.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The grand irony here, of course, is that I just used up all the cream in the cake, and now have nothing to put in my coffee.<br />
<br /></div>
nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com1Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-72282071936575998572013-07-18T19:46:00.001-04:002013-07-18T23:28:25.499-04:00An Introduction to jQuery [notes]<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXzqosSn27K9gtiRH-gcal3rxjRrKdD3wh8HrwuYAalN_B0r6tARw5rhkqWY4c5OdgWe8c8mfx8kLN8Jq_ur1jTNZbsiN_5U4HHxCKVXyNZsZxICTQ8RNVojyhbr_3xeifpY90uQBSOI/s1600/209.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .5em;"><img alt="F" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXzqosSn27K9gtiRH-gcal3rxjRrKdD3wh8HrwuYAalN_B0r6tARw5rhkqWY4c5OdgWe8c8mfx8kLN8Jq_ur1jTNZbsiN_5U4HHxCKVXyNZsZxICTQ8RNVojyhbr_3xeifpY90uQBSOI/s1600/209.JPG" title="F" /></a></div>
inally getting on to actual jQuery! This about sums it up: "...we can use jQuery to perform its core functionality: getting some elements and doing something with them." All this reading is well and good, but I need to actually be querying and scripting in order to really understand. Therefore, I think it's time to go back to <a href="http://www.codecademy.com/tracks/jquery">Codecademy for the jQuery lessons</a> as soon as I read through <a href="http://jqfundamentals.com/chapter/jquery-basics">jqfundmentatals</a>.<br />
<br />
The jQuery Fundamentals page links to the <a href="http://www.w3.org/TR/CSS2/selector.html">CSS2 spec on CSS Selectors</a>, but there are some changes in <a href="http://www.w3.org/TR/css3-selectors/">the CSS3 spec</a>. Memorizing the spec details isn't the most critical thing for me right now, and I have a pretty good grasp of combinators and pseudo-elements, IDs and classes.<br />
<br />
The trouble with W3C specs, of course, is that user agent (UA, aka browsers) implementations may vary. Pseudo elements: I should try out <a href="http://www.w3.org/TR/CSS2/selector.html#first-letter"><code>:first-letter</code> for drop-caps</a> (though it wont help with my image drop-caps).<br />
<br />
<b>Q: </b>So what exactly is a jQuery object? What does one do with it once it's created? Where is it stored and what is its lifespan? Backing up slightly, what does a regular old JS object look like?<br />
<br />
<b>A:</b> As usual, I'm complicating things. Your generic JS object looks about like the code below, using literal notation to make the comparison easier. "All objects in JavaScript are descended from <code>Object</code>; all objects inherit methods and properties from <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/prototype"><code>Object.prototype</code></a>, although they may be overridden" (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#Object_instances">MDN reference</a>) "Objects are a collection of properties, and properties are associations between a name and a value"(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects">more MDN</a>). If a property is a function, then it is a <i>method</i> for that object. Pretty much everything in JS is actually an object. (see also: prototypes and classes)<br />
<code><br />
var Bunny = {<br />
ears : "long",<br />
tail : "puffy",<br />
hop : function (height) {<br />
console.log("Hopped "+ height);<br />
}};</code><br />
<br />
The jQuery object is a JS object in that it stores elements and has methods, but it is an array-like object that just lists the DOM elements from the query. An array-like object has key:value pairs, but the key in this case seems to just be the index.<br />
<br />
<code> var a = $('div');<br />
console.log(a);<br />
/*returns from my blog homepage, more or less:<br />
{<br />
0: div#navbar.navbar section,<br />
1: div#Navbar1.widget Navbar,<br />
2: div#navbar-iframe-container,<br />
3: div.body-fauxcolumns...}<br />
*/</code><br />
<code><br />
</code> The jQuery object can be stored as a variable, or just called once and used, otherwise it disappears after use (?). I'd like to better understand memory and troubleshooting leaks (<a href="http://stackoverflow.com/questions/5046016/jquery-memory-leak-patterns-and-causes?rq=1">StackOverflow discussion</a>). Basically, it looks like as long as there's a reference to an object, that object has memory allocated to it.<br />
<div>
<br /></div>
"Truthy" and "falsy" are a little ridiculous sounding... what's the difference between those and just true/false? Anything that evaluates to True is truthy, to False is falsy, but there are other possible evaluation results as well, like NaN, undefined, null, and any number of things – these are not specifically True or False, but they have trueness or falseness ascribed to them. It's descriptive instead of referring to the specific True/False booleans that you might return. <a href="http://www.mitya.co.uk/blog/2011/Apr/Twisted-logic-understanding-truthy-and-falsy-174">This short article from 2011</a> explains it much better than I am (and I like his zebra).<br />
<br />
Helpful tidbits:<br />
<ul>
<li><code>$()</code> is a function. Functions in JS are <b>objects</b> and have methods and properties. <code>$()</code> always returns an object, and objects are always truthy.</li>
<li><code>$( 'li' ).eq( 0 ).is( '.special' );</code> to find whether the selection using <code>.eq()</code> to select a <b>specific single{ element</b> matches the parameter in the <code>.is()</code> method (selector, DOM element, jQuery object, function); returns boolean.</li>
<li>Use <b>getters</b> and <b>setters</b> (methods) to do things with jQuery objects. <b>Iteration</b> over elements can be explicit (<code>.each();</code>)or implicit (<code>.html();</code>), and you can chain methods together on a single selection. </li>
<li>Then we also have <b>filtering</b>, <code>.not(); .filter(); .has();</code> on selections, which are more or less "without," "within previous selection," and "contains," respectively. ...many more methods here in the top hit on Google for "<a href="http://oscarotero.com/jquery/">jQuery cheatsheet</a>" (includes CSS selectors!). I'm a visual person.</li>
<li>Plus, find other items/make other selections <b>relative to a previous selection</b> with things like <code>.children();</code>,<code> .next();</code>,<code> .parent();</code> etc and add to existing selection with, by george, <code>.add();</code></li>
<li>More on how to use jQuery in the context of your basic HTML page <a href="http://learn.jquery.com/about-jquery/how-jquery-works/">here from the jQuery folks</a>. </li>
</ul>
That's probably enough for now. I have a bit more of the jqfundamentals page to read through, then back over to Codecademy, then moving on to "<a href="http://www.amazon.com/dp/0596517742">JavaScript: The Good Parts.</a>" Please comment if you notice something I've got wrong or that could use clarification.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-42366365535875933242013-07-11T23:08:00.000-04:002013-07-12T12:48:22.687-04:00JavaScript Hoisting<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9N9bGh1y5HpPyipCqbJFFshD9hmW00Fpnca6VwXx8-xCavvPUqQ9Q6aVE1EFTC_x35i0LKdvGYSMsLzufIEKnvFMfCPF-jdXgq2YANYxkXQbk8bWxUvKByQGQdtjk5TjJ_Q4JZ3VhnIs/s1600/342.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .5em;"><img alt="J" border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9N9bGh1y5HpPyipCqbJFFshD9hmW00Fpnca6VwXx8-xCavvPUqQ9Q6aVE1EFTC_x35i0LKdvGYSMsLzufIEKnvFMfCPF-jdXgq2YANYxkXQbk8bWxUvKByQGQdtjk5TjJ_Q4JZ3VhnIs/s200/342.JPG" title="" width="50" /></a></div>
ust in case there weren't enough clueless people on the web trying to figure this out, I thought I'd add a bit here in the interest of <i>my</i> figuring it out. In the process of processing JavaScript (<b>Note to Self: </b>see "JavaScript Interpreter"), things are sometimes executed in ways you might not be expecting. This can change the scope of some variables and functions and confuse the bejeezus out of anyone who isn't paying enough attention. Including me.<br />
<br />
Some definitions:<br />
<ul>
<li>A JS function <b>expression</b>: <span style="background-color: white; font-family: monospace; font-size: 15px; line-height: 21px;">var myCode = function(a, b) {stuff;};</span></li>
<li>A JS function <b>declaration</b>: <span style="background-color: white; font-family: monospace; font-size: 15px; line-height: 21px;">function myCode (a, b) {stuff;};</span></li>
<li>Hoisting: Pretty much what it sounds like, some things are lifted upwards and therefore are executed sooner in the script than where they were originally written. So, something that was written like so:<br />
<code>function bunny (){<br />
rabbit();<br />
var carrot= 2;<br />
}</code><br />
Is actually executed like so:<br />
<code>function bunny (){<br />
var carrot; //declaration gets hoisted<br />
rabbit();<br />
carrot= 2; //assignment stays put<br />
}<br />
</code></li>
</ul>
So, what does this have to do with scope? JS has <i>function level scope.</i> Blocks do not create a new scope (eg if statements do not create a new scope, only functions can. Compare/contrast with a C-based language). This is actually <a href="http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html">the most helpful block of text</a> (from Ben Cherry) that I've read while pondering all this:<br />
<blockquote class="tr_bq">
In JS, a name enters a scope in in one of four ways:<br />
<ol>
<li><b>Language-defined</b>: All scopes are, by default, given the names <code>this</code> and <code>arguments</code>.</li>
<li><b>Formal parameters</b>: Functions can have named formal parameters, which are scoped to the body of that function.</li>
<li><b>Function declarations</b>: These are of the form function foo() {}.</li>
<li><b>Variable declarations</b>: These take the form var foo;.</li>
</ol>
Function declarations and variable declarations are always moved (“hoisted”) invisibly <i>to the top of their containing scope</i> by the JavaScript interpreter. Function parameters and language-defined names are, obviously, already there. [names are also resolved in this order] [emphasis mine]</blockquote>
<br />
When to use what: If you're aware of hoisting and how things will execute, then use whatever floats your boat, even intentionally use hoisting to get your function declaration moved up. Because a function declaration is <i>all</i> declaration, not declaration plus assignment as in a function expression, the entire function gets hoisted at once. A function expression only has the "var blah;" hoisted, leaving the actual function body (assignment expression) behind. (see also <a href="http://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/">Angus Croll on function declarations/expressions</a>. The fifth time I came back to that page I got the right quiz answers (and not just from memorizing them)).<br />
<br />
How functions execute with hoisting when a script runs (examples taken from <a href="http://www.youtube.com/watch?v=tZm1KRHB9sQ&feature=c4-feed-u">my hangout on air with JBeach</a>):<br />
Written like so:<br />
<code>(function () {<br />
a = grapefruit;<br />
b = applesauce;<br />
<br />
function grapefruit () { //function declaration<br />
return 'citrus in your eye';<br />
};<br />
var applesauce = function () { //function expression<br />
return 'goodness';<br />
};<br />
}());<br />
</code><br />
Executed like so:<br />
<code>(function () {<br />
function grapefruit () { //function declaration hoisted<br />
return 'citrus in your eye';<br />
};<br />
var applesauce; //function expression declaration (?) hoisted<br />
a = grapefruit;<br />
b = applesauce;<br />
<br />
applesauce = function () { //function expression<br />
return 'goodness';<br />
};<br />
}()); // returns "citrus in your eye" for a and "undefined" for b.<br />
</code><br />
<br />
I think I've got the concept, even if I haven't quite got the details of how it runs (slight lack of applied JS knowledge here, but working on that).<br />
<br />
There was also mention of NFEs and IIFEs somewhere along the way here. NFEs are nicer than anonymous functions should you need to track one through a tangle of code. IIFEs are somewhat also known as Self-Executing Anonymous Functions, but with some nuance. An IIFE does invoke itself, can be anonymous or named, <i>and</i> can be self-executing.<br />
<ul>
<li>Named Function Expression (<a href="http://kangax.github.io/nfe/">NFE</a>): <code>var myFunc = function myFunc (){code here}</code></li>
<li>Immediately Invoked Function Expression (<a href="http://benalman.com/news/2010/11/immediately-invoked-function-expression/">IIFE</a>): <code>(function myFunc (){code here}());</code></li>
</ul>
<br />
<i>Disclaimer: For goodness' sake don't take my word for any/all of this if you've just stumbled across my blog. I'm just learning and these posts are essentially my notes. Please do read the articles I've linked to, read as much as you can, experiment, and figure it all out for yourself, too.</i><br />
<i><br /></i>
<i>And if I've got something not quite right or downright wrong, please leave a comment. Thank you...</i>nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-31404658880979287412013-07-03T22:24:00.003-04:002013-07-03T22:24:59.141-04:00Basic notes on JavaScript<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivXjNPJtrgWCp4nCR8eZ7mOCUTMoO8AzyVnAYP299qsLERmYfii1io6rAUsv-zqUdgxjLwdX9C0kXJNBdnSESKYOr4yFQAReII5xqkTUBY0Pr0WUZTBIXEBAQju0cid2wl6dDlmkTdfd0/s83/006.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 0; margin-right: .5em; margin-top: .2em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivXjNPJtrgWCp4nCR8eZ7mOCUTMoO8AzyVnAYP299qsLERmYfii1io6rAUsv-zqUdgxjLwdX9C0kXJNBdnSESKYOr4yFQAReII5xqkTUBY0Pr0WUZTBIXEBAQju0cid2wl6dDlmkTdfd0/s83/006.JPG" /></a></div>
bout a year ago I spent a good chunk of time obsessing over <a href="http://www.codecademy.com/ekl1773">Codecademy</a> lessons and my "streak." Despite the headache I got from figuring out the math on a couple of loops, I really enjoyed JS as a language and am pleased to say I can still just write out a loop (at least for something simple) on demand. I stopped poking at their lessons just because I wanted to move on to some other subjects and work on live projects, but I would still like to finish up at some point. I've certainly learned that everyone has a different style and that syntax/best practices change and vary continuously.<br />
<br />
Just did a little brushing up on JavaScript generally going through this <a href="http://jqfundamentals.com/chapter/javascript-basics">JS basics page</a>, then moseying over the Mozilla Developer Network (MDN) pages for further reading. I also have <i><a href="http://www.amazon.com/dp/0596517742">JavaScript: The Good Parts</a></i> on hand to chug my way through, though I think that may be ongoing and involve more practice/ trying things out, too.<br />
<ul>
<li>Use a <b>function expression</b> (<code>var myCode = function(a, b) {stuff;};</code>) rather than a function declaration (<code>function myCode (a, b) {stuff;};</code>). Finally got <a href="http://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/">a good explanation for this here</a>: "To quote <a href="http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting">Ben Cherry’s excellent article</a>: 'Function declarations and function variables are always moved ("hoisted") to the top of their JavaScript scope by the JavaScript interpreter.'"</li>
<li>Consider scope! Variables declared without <code>var</code> are global, so (almost) always use <code>var</code>.</li>
<li>Hooray for OOP. I do like putting things in boxes and generally tidying up.</li>
<li>Object literal syntax: var thingy = {property1: 'value', property2: 'value';}; <b>Point:</b> if value is a function (rather than a primitive?), then the property is a <i>method</i>. </li>
<li>Dot notation: objectname.propertyname</li>
<li>Bracket notation: objectname['propertyname']</li>
<li>While I can handle <code>this</code>, I don't particularly <i>like</i> <code>this.</code></li>
<li>Ternary operators, shorthand for if/else: <code>var status = ( a === 'aaaa' ) ? 'Panic' : 'Calm';</code> (had a hard time coming up with a neutral for this one. Essentially: For <i>status</i>, if value of <i>a</i> is panicked screaming, assign value of "Panic" to <i>status</i>. Otherwise, assign value "Calm.")(Personally I much prefer "Don't Panic" to "Keep Calm and Carry On," particular since the latter has been so overused lately)</li>
<li>Further reading on <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/JavaScript_Overview?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FJavaScript_Overview">JS overview here</a> was very helpful for just clarifying where it stands in relation to Java and ECMAScript, plus some basic properties. Once I found MDN, I abandoned old W3Schools. </li>
<li>I need a better understanding of how code executes. Closures? Hoisting? ack.</li>
<li>So, scope? </li>
</ul>
<div>
Things read: </div>
<div>
<a href="http://jqfundamentals.com/chapter/javascript-basics">JQuery Fundamentals: JS Basics</a></div>
<div>
& all the links at the bottom of the JS Basics page.</div>
<div>
<a href="http://jibbering.com/faq/notes/closures/">This bit on JS closures</a> (still not sure I understand).</div>
<div>
And "<a href="http://byfat.xxx/if-hemingway-wrote-javascript">If Hemingway Wrote JavaScript</a>," which is amusing even if you don't know anything about code.</div>
nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-30216173315227974192013-06-20T23:20:00.000-04:002013-06-20T23:22:54.494-04:00My Dad Thinks Git is Just an Expletive<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNDsnlJqzdxFRU0HWVJawYRNpR0iUi0Mba7pvSqv_mYN05gVvXP2q6acrJKTmbJpJjuyPpeArOg-gyxuKEDDrwpHJxLraft-3plVI1xnUW3S_d3cA-jElflAL4Uip7dUc8W0Te5UuydDE/s1600/210.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .5em;"><img alt="F" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNDsnlJqzdxFRU0HWVJawYRNpR0iUi0Mba7pvSqv_mYN05gVvXP2q6acrJKTmbJpJjuyPpeArOg-gyxuKEDDrwpHJxLraft-3plVI1xnUW3S_d3cA-jElflAL4Uip7dUc8W0Te5UuydDE/s1600/210.JPG" title="" /></a></div>
irst, reviewing some of the <a href="http://www.git-scm.com/book/en/Git-Branching-What-a-Branch-Is">Git documentation</a>. The Git book is probably my favorite piece of instructional material available on the interwebs today [that I use/have encountered so far]. Now that I've been doing some branching, checkouts, commits, etc, I'm feeling a lot more confident about this, but wanted to just skim back over things anyway. Also <a href="http://ndpsoftware.com/git-cheatsheet.html#loc=workspace;">this Git cheatsheet</a> is too pretty.<br />
<br />
Some things to clear up:<br />
: The R words: <i>Rebase</i>, <i>Revert</i>, <i>Rollback</i>.<br />
: The difference between <i>Fetch</i>, <i>Pull</i> and <i>Rebase.</i><br />
<ul>
<li><a href="http://www.git-scm.com/docs/git-rebase">Rebase</a> is actually a merge, I just happen to use it to integrate the newest origin/8.x into my local branch. <i>Merge</i> is a three way merge, <i>rebase</i> pulls in commits from another branch, rewinds your current branch and replays all the changes sequentially to get you back to your current commit with the other branch merged in. Mostly this makes things neater and erases the history of the working branch, making it look like you've been on the master branch the whole time. Easier to merge into the remote later, too. </li>
<li><a href="http://www.git-scm.com/docs/git-revert">Revert</a> means to undo a specific commit without deleting it from the commit history.</li>
<li><a href="http://www.git-tower.com/files/applicationHelp/pgs/Commits_UndoingCommits.html">Roll back</a>, on the other hand, is resetting HEAD to the commit you've chosen to roll back to. This deletes any newer commits entirely, taking you back in time permanently. I think what Git Tower calls Roll Back is <code><a href="http://www.git-scm.com/docs/git-reset">git reset <commit></a></code>?</li>
<li><a href="http://www.git-scm.com/docs/git-fetch">Git Fetch</a> <i>only</i> fetches an update from your designated remote. </li>
<li><a href="http://www.git-scm.com/docs/git-pull">Git Pull</a> pulls that update down <i>and</i> merges it into your current branch. </li>
</ul>
<br />
My previous questions about Git were things like: how do I use it to track a site in production? I was thinking I would install it remotely on my host and update there. I think I should work on the site locally and then push up to my server. Haven't actually looked into that yet. <a href="https://drupal.org/node/803746">This handy dandy bit of documentation on d.o</a> (Drupal.org, I have gathered) should have plenty of info on Drupal web dev with Git. The most difficult things there will be handling the databases and figuring out why I need development, staging and production sites all up at once. I don't think I'm understanding the latter properly.<br />
<br />
Now, all I have to do is get a super good grasp of PHP and JavaScript. Right. Starting with the<a href="http://jqfundamentals.com/"> JS and JQuery fundamentals here</a>.<br />
<br />
Then later, for fun, I'll poke around a local install of D8! whee! If I could figure out local hosting well enough I'd broadcast my experiments publicly using my handy-dandy built-in Apache server... but that honestly is a total side-trip that I shouldn't take right this moment.<br />
<b><br />
</b> <b>TDL! </b>Finish configuring local hosting capabilities outside of MAMP and figuring out site-serving capabilities. Also read more "history of the internet/web" books, because it fascinates me. Also find those studies referenced in <a href="http://www.librarything.com/work/book/93862663">Tim Berners-Lee's book</a> regarding emergent properties of the www.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com2Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-65475975366924846282013-06-19T16:41:00.002-04:002013-06-19T17:03:04.229-04:00Drupal 8: Some things learned<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoA4ILeJgaFkRpWU4m3gsrPjLGCBRYY-QLvbXbS67gKaxicfBDQF7OA84gzCJqa7BeXervwIzyIiUxG2Og3oyjaqfTzHvEpPhBhBRS6EdJ7ZnOktXe2_unRqs1svJIeAIlC5um879_F2I/s1600/333.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .4em;"><img alt="J" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoA4ILeJgaFkRpWU4m3gsrPjLGCBRYY-QLvbXbS67gKaxicfBDQF7OA84gzCJqa7BeXervwIzyIiUxG2Og3oyjaqfTzHvEpPhBhBRS6EdJ7ZnOktXe2_unRqs1svJIeAIlC5um879_F2I/s1600/333.JPG" title="" /></a></div>
ust a quick recap on <a href="https://drupal.org/node/1008402">my last reroll</a>. A wonderfully patient mentor and I spent far too many hours poking at the comments and working back through the entire reroll to figure out exactly what was up. In the end, my original question got answered and some further clues were found in the issue comments. And, I think I finally got the hang of Git/Git Tower (thanks to the commenter on my last post, too)! It felt really good to be flicking between branches and understanding what was where. I need to further define all the "R" things for myself, Rebase, Revert, Roll-back... Just to get things clear.<br />
<ul>
<li>The first helpful thing was the discovery that I was rerolling from the wrong patch. <a href="https://drupal.org/node/1008402#comment-5957034">#64</a> was the actual last successful patch, and #65 (which I had been working with) was just to correct a typo, but also introduced an unintentional error, which no one noticed until #81 posted an interdiff. <b>Note to self:</b> also be sure to add an interdiff when needed and other helpful things as YesCT suggested like links to instructions and better notes on exactly what I did. </li>
<li>One helpful mentor also pointed out that patches/interdiffs could be applied in reverse with <code>curl https://...blah.patch | git apply -R</code></li>
<li>It's also worth remembering to diff a <i>rebased</i> branch against your HEAD branch so you don't wind up with a diff file that includes all the commits between when you started your working branch and the current update of origin/8.x. If that makes sense. I wound up with a very clogged diff by leaving a branch a little too long.</li>
<li>Glancing through the interdiff between #64 and #65 added in #81 helped me find the typo in question and then simply modify that file and run the diff. </li>
<li>The biggest problem, and my original question for office hours, was where to put the contents of a test file that had been wiped from 8.x in the intervening year. Eventually we wound up putting that chunk of the patch in a deeper testing directory, but I never would have known where to add it on my own. </li>
<li>The method my mentor used to find that test file I think involved searching for other pieces of the previous, now absent test file, where I had just been searching for the parts of the test file affected by this patch. Still not super confident about this grepping business and I feel like I've heard it belittled somewhere as one of those things newbies abuse/misuse. Could be wrong.</li>
<li>Apart from that, the rerolling instructions were pretty spot on. There was a question of branching, and I think everyone just has different styles with regard to pulling down the most recent commits of 8.x and then creating a new branch for the issue you're working on, plus then a temporary testbranch to test the new patch on. </li>
</ul>
I'm mostly not tagging mentors here so as not to be a bother/presumptuous/something, but I continue to be grateful for their patience and helpfulness and willingness to spend time bringing new people into the fold. ... resisting the urge to start singing Guys and Dolls here, though I once played one of the Mission Band members on stage.<br />
<br />
Now moving on to <a href="http://drupalmentoring.org/task/2416">a JS issue</a>, and first spending some time brushing up my skills there thanks to some prescribed reading. I'm always torn about whether I'd prefer to read tech books on the computer or in print. Staring at the screen for ages gets to me, but a print book is too disconnected from the associated topics (and less searchable). I'll just have to take regular breaks to stare at my blooming sugar snap peas instead!<br />
<br />nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-57182954022483018482013-06-17T20:38:00.000-04:002013-06-17T22:54:57.484-04:00Drupal 8: Understanding the reroll process<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUegYBWNBFPBDknUCJJq3247QQ1CWvNJKo70IBDQM-lz4QSaCsShz08EUZlPAppK2rFXXv6nB75PiR44mi2Yb1wr-CgQAfYv6x4ryyD3iue_m_bLeGf6pwjLDRNBOlfit774ID-2UmJfw/s1600/476.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: .2em; margin-right: .5em; margin-top: .5em;"><img alt="N" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUegYBWNBFPBDknUCJJq3247QQ1CWvNJKo70IBDQM-lz4QSaCsShz08EUZlPAppK2rFXXv6nB75PiR44mi2Yb1wr-CgQAfYv6x4ryyD3iue_m_bLeGf6pwjLDRNBOlfit774ID-2UmJfw/s1600/476.JPG" title="" /></a></div>
ow that I'm trying to work on a slightly more involved reroll task, I'm coming up with a bunch more questions and some realizations about my workflow. First of all, I need to make sure to use my own time efficiently and not spend hours and hours trying to sort things out instead of taking a break and attacking a different problem. Secondly, I need to familiarize myself further with Drupal as a CMS before I have much chance of patching, rerolling and otherwise contributing to the open source project.<br />
<br />
Also I badly need a better notetaking system because Blogger just lost my entire two page blog-post notes I had written here. @%#&! Text files, sadly, would be an improvement. I think I likely also said something about how to prioritize my time in order to become a highly useful Drupal contributor! This probably entails becoming more familiar with Drupal generally, working with it as a CMS, poking around the file tree etc.<br />
<br />
This is the second reroll I've looked at, but the first to really be any fuss. Apart from sorting out the reroll system and infrastructure (which I think I've mostly got now), it's being able to parse the code on my own, rewrite it if necessary (?) and in this case update a year-old patch. This should actually be really easy, but I'm just figuring it out, so bear with me.<br />
<br />
On applying<a href="https://drupal.org/files/stream_wrappers-allow_symlinks-1008402-65.patch"> the patch</a> to the last commit it was known to work with, and then rebasing from the current version of 8.x, I got the following output. Only one conflict, which is nice. What do the lines marked "M" and "A" here mean?<br />
<blockquote class="tr_bq">
$ git rebase 8.x<br />
First, rewinding head to replay your work on top of it...<br />
Applying: Applying patch from https://drupal.org/node/1008402#comment-5963414<br />
Using index info to reconstruct a base tree...<br />
M<span class="Apple-tab-span" style="white-space: pre;"> </span>core/lib/Drupal/Core/StreamWrapper/LocalStream.php<br />
A<span class="Apple-tab-span" style="white-space: pre;"> </span>core/modules/system/tests/file.test<br />
Falling back to patching base and 3-way merge...<br />
CONFLICT (modify/delete): core/modules/system/tests/file.test deleted in HEAD and modified in Applying patch from https://drupal.org/node/1008402#comment-5963414. Version Applying patch from https://drupal.org/node/1008402#comment-5963414 of core/modules/system/tests/file.test left in tree.<br />
Auto-merging core/lib/Drupal/Core/StreamWrapper/LocalStream.php<br />
Failed to merge in the changes.<br />
Patch failed at 0001 Applying patch from https://drupal.org/node/1008402#comment-5963414<br />
The copy of the patch that failed is found in:<br />
/Users/E/Sites/drupal/.git/rebase-apply/patch<br />
When you have resolved this problem, run "git rebase --continue".<br />
If you prefer to skip this patch, run "git rebase --skip" instead.<br />
To check out the original branch and stop rebasing, run "git rebase --abort".</blockquote>
If something is deleted in HEAD but modified in the patch, wouldn't that mean it isn't needed any more and should also be removed from the patch? Or else that chunk of code has been moved elsewhere. I'd like to just glance at the current commit for 8.x, but Git Tower doesn't seem to want to let me do anything without committing any/all changes in my working branch. That seems rather unhelpful, so perhaps I'm missing something about branch checkout?<br />
<br />
Why does it look like the reroll instructions are saying I need to rewrite the code in question? I don't have specific experience/context for this patch, so not confident enough to really understand what's going on with it.<br />
<br />
Some steps to clarify for myself before I move on from this:<br />
<br />
<ul>
<li>Understand output of rebase/apply above: M and A are <strike>pretty definitely "Modify" and "Apply," as I had assumed (other options were "Merge" and "Add.")</strike> "Modified" and "Added"! </li>
<li>Is file.test still in HEAD? Looks like no? There is no file.test in HEAD, from what Git is telling me. Unfortunately, branching is still giving me issues, and now I seem to have a stray un-named branch and some commits that Git Tower is hung up on. meh. Trying again... Appropriate commit to pull, should I lose things here: git checkout -b symlinks-old fe01ab6e16a73a</li>
<li>Ah ha. Ok, so yes, file.test is no longer in core/modules/system/tests/, but it looks like tests have been sorted out a bit, so maybe that chunk of code is somewhere else. In theory, what should happen here is that I ... have 8.x to diff against, and a branch checked out for this reroll. I attempt to rebase in my working branch, and when it doesn't work, I ... add the bit of code that used to be in file.test to wherever it might be now, then git add (being careful not to add files.test back in to HEAD accidentally), then hit rebase --continue, then keep going with <a href="https://drupal.org/patch/reroll">the reroll instructions</a>.</li>
<li>If not, did the code in this patch move somewhere else? What I did here was an attempt at using grep to search for a line from the file.test file anywhere in the tests directory. No luck. Tested my grepping (sp?) skills by just searching "symlink" and that pulled up a lot, but not the specific line from the file this patch was attempting to modify. So, looks like that test was just deleted/moved somewhere in the last year.</li>
<li>Does that mean that the testing part of the patch is no longer relevant, or that it should be incorporated into a different testing file? This is something I'm not experienced with, so can't attack. Will add comment to this effect in a bit, once I double check that I'm not just missing something easy. The lovely mentors at office hours are great for nudging in the right direction.</li>
<li>What does <a href="https://drupal.org/node/1008402#comment-5952150">comment #61</a> have to do with this? #61 is just updating the patch to match the changes to the D8 test files, which seem to move around a lot. I had a look at some of the previous patch versions, and my previous bullet is definitely the case. I just can't be quite sure of where to put the tests, or where they went if I'm just not finding them appropriately.</li>
</ul>
<br />
::Take break for dinner and something not-the-computer-screen. I would've succeeded with the two hour task routine if I hadn't lost my notes. Really. Hoping office hours tonight are helpful and that nothing breaks this time (last Monday I spent 75% of the office hours mopping up a broken bottle in the pantry. sigh).<br />
<br />
Some goals for this week: brush up on PHP, play with a functional install of Drupal as a CMS so I know what I'm looking at working on the backend. Kind of excited about <i>using</i> Drupal.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com2Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-42454213069377077122013-06-13T18:25:00.001-04:002013-06-13T18:25:44.177-04:00Drupal dev env sans MAMP... almost<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGzqn8XvlSWo9HxbeV7Z5SlUA5f4TGspc1kWnsblh8ipyIv8gp1YbEjgJngpHS3irQvLb1QpICifqaUX57AMAn2_X5qJYSWxyetNcPgmKz7vyZFak7oBcdiJpdvF8EoUOI7-Y354SAAlU/s1600/004.JPG" imageanchor="1" style="clear: left; float: left; margin-top: .5em; margin-right: .5em;"><img alt="A" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGzqn8XvlSWo9HxbeV7Z5SlUA5f4TGspc1kWnsblh8ipyIv8gp1YbEjgJngpHS3irQvLb1QpICifqaUX57AMAn2_X5qJYSWxyetNcPgmKz7vyZFak7oBcdiJpdvF8EoUOI7-Y354SAAlU/s1600/004.JPG" title="" /></a></div>nother day, another blip on the learning curve. Today I attempt to set up a local hosting environment without using MAMP. Unfortunately, it looks like <a href="https://drupal.org/node/5338">the doc regarding this manual set up</a> is from 2008, five years and several OS updates out of date, which means I'm winging it, finding new directory paths, etc. At some point later on I may spend some time updating the documentation for all this, but not until I have a full grasp myself.<br />
<br />
I'm going to start <a href="https://drupal.org/requirements/webserver">back here with requirements again</a>, while looking at the manual setup of MySQL and PHP mentioned above. So I'm also looking at <a href="http://rzen.net/development/local-develoment-in-osx/">this manual setup blog post over here</a>, which should at least point me in the right directions. Managing databases from cli (command line) is not really what I wanted to be doing here.<br />
<ol><li>Apache server. Got it, version 2.2.22. Comes with OS X, all I have to do is turn on web sharing... which I seem to have left running and should probably turn off more often. Configuration is in httpd.conf. It's apparently <a href="https://drupal.org/node/5338">very debatable</a> just <i>which</i> httpd.conf file I should be working on, or whether I should use a separate file like <i>username</i>.conf. Either way, they are here: /etc/apache2/httpd.conf or /etc/apache2/users/<i>username</i>.conf This part I did previously with /Applications/MAMP/conf/apache/original.</li>
<ul><li><b>Question: </b>what exactly is this /etc/ directory? Heck, what are all these invisible directories? I really don't know how the system works that well, and Mac OS obscures all the useful things from the average user (eg not me, who somehow permanently turned on "show invisibles." Wish I remembered how...)</li>
</ul><li>MySQL: downloaded, install... fix socket? can't find mysql.sock? Oh, initialize grant tables, maybe that's what I'm missing. Need mysql user? <a href="http://www.malisphoto.com/tips/mysql-on-os-x.html#Anchor-User">Checking that with dscl</a>. Find proper PATH for bash profile, think I got that. Also checking info <a href="http://dev.mysql.com/doc/refman/5.5/en/postinstallation.html">on MySQL site here</a> for security and initial setup. And here to get <a href="http://www.malisphoto.com/tips/mysql-on-os-x.html#Anchor-User">mysql OS user account set up</a>? But then that's outdated too, and the data directory is actually /usr/local/mysql/data. And I can't get mysqld_safe to work either. Ok, permissions are wrong on my error log? checked using <a href="http://dev.mysql.com/doc/refman/5.6/en/starting-server.html">shell> ls -la /usr/local/mysql/var,</a> but it still says permission denied. And I need a <a href="http://www.php.net/manual/en/mysql.installation.php">mysql connection extension</a> thing? <a href="http://www.php.net/manual/en/mysqli.installation.php">mysqli</a>? GAH. Alright, I give up. I can connect via cli to MySQL if I turn it on in the prefpane. Not a clue about that extension though. </li>
<li>Attempted to use Homebrew, but it turns out that it needs XCode, which is only OS X 10.7.4+ and I'm on 10.6 something. At this point, I would like to upgrade, but, more software costs...</li>
</ol><div>Then checked back on the original issue I was following that was messing up MAMP, and it seems there's <a href="https://drupal.org/node/2004086">a patch that fixes the issue</a>, so provided that works, I'm back to figuring out more of Git, rerolling, and possibly creating patches. All of which is really not that difficult, but these background headaches are pretty killer.</div><div><br />
</div><div>And I got my Drupal install page back up, just had to reset my MAMP port to 80. And thank goodness, configuration goes smoothly, no more errors. So the lesson here is that I need a backup server/db environment and more knowledge of how to configure the whole shebang. I'll work on finishing that setup some time when it will be a challenge and not a headache. </div><div><br />
</div><div>Now on to more patches! yay!</div>nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-25879003010780265422013-06-11T22:59:00.001-04:002013-06-11T23:01:19.811-04:00An attempted re-roll and several more hurdles<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTMYdVFig2lLw2EetW17yvszDJzlCJ2cnmlEEqbiJqF_yMRcrt-Js8f4ZsRaZCIxL49MZnVMYLx_5rghXrDzeZE1wu_u3Uhz0vEmCv2-qK-S5hj4KSGFQPuVi6VlfS2lmuidJa1hjfvUk/s1600/001.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em; margin-top: .5em;"><img alt="A" border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTMYdVFig2lLw2EetW17yvszDJzlCJ2cnmlEEqbiJqF_yMRcrt-Js8f4ZsRaZCIxL49MZnVMYLx_5rghXrDzeZE1wu_u3Uhz0vEmCv2-qK-S5hj4KSGFQPuVi6VlfS2lmuidJa1hjfvUk/s200/001.JPG" title="" width="87" /></a></div>
ssignment the second! With the help of Git Tower to tidy up my git messes, it's time to try out a re-roll. Or at least, futzing around with a patch until it works. This one was assigned to me during the core mentoring office hours, which meant it was already rather late at night. I couldn't work on it for at least 10 hours, so inevitably someone else had a whack at it first. Not a problem, always good to get things done, and I kind of like the competitive aspect there.<br />
<br />
However, the posted reroll failed the automated tests, and a subsequent comment indicated that a single element was missing from that reroll that had (presumably) been in the previous version. Hokay. So where does that leave me? If it's missing just one thing, that one thing can be inserted and then tested again, yes?<br />
<br />
Problems: I need to make sure I'm testing accurately, refreshing my entire local repo every time. I need to figure out exactly what is missing and where it goes. Update patch file. Test again. Upload. That seems easy, right? It's the technical details of <i>how</i> to do all that correctly and the <i>first</i> time that I get hung up on and unsure about. I need a lot of practice.<br />
<ol>
<li>Actually, on this one, I'm going to take a close, side-by-side look at the two versions of the patch and see if I can isolate the missing bits, drop them in, and call it a day. This should also clue me a little more regarding patch structure. I get the concept and the diff and the +/-, but parsing all that together on read through will take some practice. Doing this manually seems to have worked, my patch applies.</li>
<li>Also going to try doing it this way, per berdir on IRC: "one trick would be to apply the previous patch over the current one with --reject, then the file should be added but all other changes would conflict and you can ignore them" </li>
</ol>
<div>
And <a href="https://drupal.org/node/1972514">said patch</a> passed tests and was reviewed affirmatively, so I guess it's ok. Frankly I'm amazed that things don't get broken more and that so many contributors are also patient mentors. Or my sample from the IRC is skewed, but I'm definitely grateful for that patience. </div>
<div>
<br /></div>
<div>
Or rather, I'll try that second option as soon as I seriously sort out how to get my branches to work. Seems like changes I make on a checked out branch are still affecting my local head? That doesn't seem quite right. And meanwhile, 8.x doesn't seem to be working with MAMP anymore and I think that's enough for one night. Really looking forward to getting more experienced with all this.</div>
nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-81788502487869897582013-06-11T16:09:00.000-04:002013-06-11T16:09:52.441-04:00Backtracking: Git review<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCF3JZCHvW5hj_BHAxD3uYZP72z99NLfXtRXz6l2fVaT-6eMuUlZmi87BSeZJgpT4ECQFfm1Bq3MjySJT9c_6PedZhslPuX6XuzOPBlza0MEPRNK7gMSake2i-Suj-jYLZX4zgO3K3p-4/s1600/220.JPG" imageanchor="1" style="clear: left; float: left; margin-top: .5em; margin-right: .5em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCF3JZCHvW5hj_BHAxD3uYZP72z99NLfXtRXz6l2fVaT-6eMuUlZmi87BSeZJgpT4ECQFfm1Bq3MjySJT9c_6PedZhslPuX6XuzOPBlza0MEPRNK7gMSake2i-Suj-jYLZX4zgO3K3p-4/s1600/220.JPG" /></a></div>ome time ago, I installed git and set up a repository or two for personal projects. My needs were limited to keeping track of what I had done and being able to backtrack if I needed to. Obviously, I've been vastly underutilizing git's capabilities, so today I'm going back through <a href="https://drupal.org/node/991716">some documentation</a> to brush up my existing skills and to add a few more, specifically <code>checkout</code> and <code>branch</code>.<br />
<br />
Thanks again to Jesse, who walked me through branching and checkouts via screenshare on Saturday. Otherwise I had things more or less right: pull updates down, wipe db, settings.php, /php and /config files from sites/default/files. I'll want to set up a nice script to do this for me at some point. <b>Note to self: </b>seriously, list of things to do "later." Takeaways: get a GUI for git, test a branch/checkout, and "git is <i><a href="http://www.imdb.com/title/tt0120148/?ref_=fn_al_tt_1">Sliding Doors</a>.</i>" Loved that. Oh and try out <a href="http://www.sublimetext.com/">Sublime</a>. And find a budget for software. phoo.<br />
<ol><li>Install a git GUI. <a href="http://www.git-tower.com/">Git Tower</a> is reputedly the bestest, and in the interest of being on the same page, I think I'll just go with that. Free 30-day trial, yay. I do actually like command line, but for <a href="http://www.git-tower.com/learn/tips-tricks-organize.html">things like branches</a>, it does seem like a more visual interface would be helpful to understand where I am. </li>
<li>Get totally distracted by WWDC stuff. Lament not having every single piece of new tech as it debuts. </li>
<li>Do some reading/research. Really should have gone through the <a href="https://drupal.org/documentation/git">Drupal Git Documentation</a> earlier. Very helpful. This <a href="http://vimeo.com/20459209">video on further git usage</a> (sandbox creation, pushing, etc) will be handy later. <b>Note to self: </b>I need a way to differentiate between these learning posts, there's a bit of overlap. Might as well create an SSH key while I'm here... My interpretation of "Patch" is basically "structured diff merged into existing code." Seems very straightforward.</li>
<li>Start fresh with a new clone of 8.x in Tower, changing directory to user/sites/drupal instead of my documents/[complicated] directory. </li>
<li>Test making a branch and checking it out - nice folder structure in the sidebar. Not quite sure about adding patches though. It seems to apply, but then I get a bunch of things in the status tab. So do I then commit those to my local branch? Does the curl method I've been using do both? Learning yet more software, I guess. Will have to work on that.</li>
</ol>Later: reading through some tasks and instructions on drupalmentoring.org in preparation for tonight's office hours. Ask about task assignment and review. Figure out what the heck less and more are/do.nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-10703510084868603382013-06-07T23:06:00.000-04:002013-06-07T23:06:51.493-04:00Drupal: Re-checking that last patch?<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwsNSZlZqvrbPrJaEXxgV-Y7JXiR06GXXdinQsHXr4f2aqKANzXwO2c3v2smlDTrt_CtWdxKv5EEgJ4vLnlCJH7dq2Vl3i5rFS3UQMicnHlcYwnjvBPLtpR5RVFYoxoOjJ8kX-eD1a3jQ/s1600/686.JPG" imageanchor="1" style="clear: left; float: left; margin-top: .5em; margin-right: .5em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwsNSZlZqvrbPrJaEXxgV-Y7JXiR06GXXdinQsHXr4f2aqKANzXwO2c3v2smlDTrt_CtWdxKv5EEgJ4vLnlCJH7dq2Vl3i5rFS3UQMicnHlcYwnjvBPLtpR5RVFYoxoOjJ8kX-eD1a3jQ/s1600/686.JPG" /></a></div>oday I went back to take a look at the patch I reviewed yesterday, and it looks like it needs a little more review. Unfortunately, by the time I got to it, I think the patch was behind HEAD again, despite a rerolling earlier in the day, but on my second attempt after re-cloning, it seemed to apply ok.<br />
<br />
While I'm here, some notes on my updating procedure. I'd love to find some more streamlined notes on this, will have a look in a sec.<br />
<ul><li>The method I've been using is <a href="https://drupal.org/dev-env">just to git pull</a> (super minimal instructions) changes down without <a href="https://drupal.org/node/1399218">examining and merging</a> (slightly more detailed, includes "what if patch doesn't apply") as individual steps. Git pull usually resets the install... I think. Or it did every other time I used it, but not this last time. <b>Question: </b>what's the best way to test that I've got the latest and greatest down properly?</li>
<li>So since that usually requires a reinstall, I also have to wipe the db from phpMyAdmin in MAMP. </li>
<li>Apply patch using curl, check with git diff</li>
<li>That seems to be it, then I just reconnect to the now empty db during the install process. Usually. I guess this update didn't change anything in that vicinity?</li>
</ul><div>Supposing that I have the newest HEAD (I have gathered this is what the latest version is called) down, let me just make sure I have everything clean and fresh and double check that the patch isn't applying... wipe db, pull, patch. Nope-ity no. </div><div><br />
</div><div>Time to learn something new! Or just muddle around and feel silly about things, we'll see. What to do if a patch doesn't apply: Applying a patch manually, copy error msg into issue, "re-rolling" and adding to issue queue. </div><div><br />
</div><div>First I want to test if I get that error I found in my last post without the patch applied. Nice fresh copy, connect db, test. Error is still there. <b>Question: </b>Should I create a new issue for it, if I can't find it elsewhere? </div><div><br />
</div><div>hm. Ok, now the patch is applying again. Maybe that was just me? And just pulling doesn't reset everything, so how do I uninstall in order to start over? Seems silly to wipe the whole thing and re-clone each time. Grah, ok, wiped sites/default/files/php and /config_*, ditched settings.php and replaced it with a fresh copy, reloaded. </div><div><br />
</div><div>Retesting patch... only partially works. Noted as best I could on the issue, but am so uncertain about the quality of my testing environment that I don't trust my reviewing capabilities. There's got to be a better way to set up and test without having to completely wipe and re-clone, but just pulling doesn't always reset? Rather confused and going to bed. </div>nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969tag:blogger.com,1999:blog-2874057012077056643.post-69432205207496354822013-06-06T18:16:00.001-04:002013-06-06T18:17:29.685-04:00First Patch for Drupal 8.x<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi598hkTAjsiNRyyGhczL95FklKUbJr7segtRb1u5geyYYxBjunhQmLjg4BHScM5_7JBo4ipcx31c5JbfbkgbfeuIwsnLmzcpJGWWuRgnAntjI38ykqfLqCFN1JY89-J5s6Lj0TWntOrY/s1600/758.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 0; margin-right: .5em; margin-top: .2em;"><img alt="W" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi598hkTAjsiNRyyGhczL95FklKUbJr7segtRb1u5geyYYxBjunhQmLjg4BHScM5_7JBo4ipcx31c5JbfbkgbfeuIwsnLmzcpJGWWuRgnAntjI38ykqfLqCFN1JY89-J5s6Lj0TWntOrY/s1600/758.JPG" title="" /></a></div>
hew! Now that everything is set up, I'm back to <a href="https://drupal.org/dev-env">the dev env page</a> to get my first patch down, in, tested and confirmed. Hopefully I can get this done before someone else jumps on it. <strike>I kind of wish there was a check-out system for issues</strike>– oh I see, they're assigned, got it. So, here's my first issue for patch review: <a href="http://remove%20drupal_add_css%28%29%20from%20book.module/">Remove drupal_add_css() from book.module</a>.<br />
<div>
<br /></div>
<div>
Actually, step one: blink, get glass of water. Thanks to <a href="https://drupal.org/profile/profile_my_mentors/jessebeach">Jesse</a> for plucking out a nice easy issue for me to start with and being so encouraging about my progress. </div>
<ol>
<li>Apply the patch: <ul>
<li>First, git pull in Drupal directory. Sigh, right, of course. Configure again. Argh, so now my settings.php file wont write itself. Whelp, no idea what that was about, but I fixed it by creating a new default folder. I think the permissions had gotten screwed up on the previous, probably my own doing? Ok, wiped the entire thing, re-installed, re-db'd, reconnected. </li>
<li>Pull down latest version of the patch. Finally found more detailed instructions on <a href="https://drupal.org/node/1399218">where to download the patch to here</a>, 'cause I wanted to be sure. Went for "<span style="background-color: #f6f6f2; color: #222222; font-family: 'Bitstream Vera Sans Mono', Monaco, 'Lucida Console', monospace; font-size: 12px; line-height: 17.984375px; white-space: pre-wrap;">curl http://drupal.org/files/[patch-name].patch | git apply -"</span> Didn't get any errors, so that seems to have worked. </li>
<li>Run git diff to see changes... shiny, looks just like the view from the issue tracker. Will have to figure out how to use git diff a bit later. <b>Note to self: </b>make list of things to do "a bit later."</li>
<li>hm, but if I look at the module code, I'm not seeing the second addition from the patch. ohoh, duh, because that's a deletion, not an addition. Right!</li>
</ul>
</li>
<li>Enable the book module: Well that was easy, yay. This is, I'm a little sheepish to admit, my first time looking at the inside of a Drupal install. But look, the extend tab, logically, is modules, right? And then I just click this handy checkbox... The super easy, obvious UI is making me so happy. </li>
<li>Put some articles into a book: Articles, or book pages? I'll do some of both. </li>
<li>Verify that book.theme.css is still loading: tested by a) inspecting elements with Chrome dev tools, and b) using jQuery to find specific selectors in the dev tools console. Seems to work fine. Yay!</li>
<li>Set the issue to "Reviewed and Tested by the Community" or "RTBC": Done. Wrote a nice, hopefully brief enough comment detailing my steps and mentioning the error I got for an unrelated (I think) issue. [Any issues I work will be <a href="https://drupal.org/project/issues/user">recorded on my Drupal.org profile</a> (you have to have an account to see my profile, but <a href="https://drupal.org/node/2012526">this issue is here</a>).]</li>
</ol>
<div>
That should be it for now. I'll have to go find another issue to work on next! Well, right after I know that last one went ok. And maybe do a little more reading on patches and contributions and things. </div>
nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.8189466 -77.059324599999968 38.8189466 -77.059324599999968tag:blogger.com,1999:blog-2874057012077056643.post-79003730385105085972013-06-06T14:01:00.000-04:002013-06-06T14:39:13.847-04:00Local/Drupal: complete!<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJIISAp805ZzlruZibSWaKy3O1jKfERxD9id-5016p-m9t_A7Vl8KGo5h_wpTpkBhoE0KwJZmvjoWpnHXYTHYMr-KTMMoV7rCYIvGppvWlqZ5K1ZovfINiBpHTYAgNFNDTqAHU65SEXWw/s1600/504.JPG" imageanchor="1" style="clear: left; float: left; margin-right: .5em;"><img alt="O" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJIISAp805ZzlruZibSWaKy3O1jKfERxD9id-5016p-m9t_A7Vl8KGo5h_wpTpkBhoE0KwJZmvjoWpnHXYTHYMr-KTMMoV7rCYIvGppvWlqZ5K1ZovfINiBpHTYAgNFNDTqAHU65SEXWw/s1600/504.JPG" title="O" /></a></div>
k, picking up from where I left off yesterday - configuring and finishing the local install of Drupal. References: <a href="https://drupal.org/dev-env">dev env set up page</a> and <a href="https://drupal.org/documentation/install">installation/configuration instructions</a>. Instructions focus on command line tools, so that's good. Thank goodness I had already installed Git and know a few Unix commands or I'd <i>really</i> be behind the curve on this.<br />
<br />
<br />
<ol>
<li>Neat, here's a handy <a href="https://drupal.org/best-practices">list of best practices</a> for CMS usage. Completely agree about backups, and definitely need to test mine for the WordPress site I'm maintaining. ...Documentation can be such a rabbit hole; if I don't stop myself I'll just keep reading for hours.</li>
<li>First we check <a href="https://drupal.org/requirements/webserver">system requirements</a>, which I already looked at <a href="http://renascencegirl.blogspot.com/2013/06/ignore-setting-up-local-drupal.html">yesterday</a>. Double checking in more detail now. I will want to enable <a href="https://drupal.org/getting-started/clean-urls">clean URLs</a> on my own site later on.<ul>
<li>Web Server: Apache, check. Apache Virtualhost configuration file would be httpd.conf, I think, so I change the AllowOverride to "All" there.</li>
<li>DB server: MySQL is what MAMP uses, with PHPMyAdmin, so I should be set there. Not sure how to check what rights my account has or how to change max_allowed_packet, so I'm hoping everything just works. And my PHP is obviously already connected to MySQL. </li>
<li>Good lord I wish I knew what I was doing.</li>
<li>Might need to up my memory for my own photography site later on. Maybe by the time I do that, I'll have plenty of experience and it'll be straightforward.</li>
<li>My favorite words today: "Enabled by default." </li>
<li>On the bright side, I feel pretty confident about my skills once I have things installed. It's just finding all the configuration files and prying out info about new systems that's challenging.</li>
</ul>
</li>
<li><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfw3JuhBizS7mqgAAUZs3iWEf-9qT52XPoSKOgtqZWM-_Tnz08LDpIgnUN5y3OwBkyA4duM9wqI2RmA2wlbGJwdJjjZl-MJBCTICbvjweUtgOFOZQUiyyyqcfNR-X3qJp-9LzoLXij-y0/s1600/Screen+shot+2013-06-06+at+12.22.29+PM.png" imageanchor="1" style="float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfw3JuhBizS7mqgAAUZs3iWEf-9qT52XPoSKOgtqZWM-_Tnz08LDpIgnUN5y3OwBkyA4duM9wqI2RmA2wlbGJwdJjjZl-MJBCTICbvjweUtgOFOZQUiyyyqcfNR-X3qJp-9LzoLXij-y0/s320/Screen+shot+2013-06-06+at+12.22.29+PM.png" width="320" /></a></div>
Download instructions not relevant, already have the local directory and Dreamhost has its own instructions that I'll use for my site later. oop, actually I do need to drop the Drupal folder contents into my specified web root, or just redirect the web root. I "woohoo'd" when I saw this in my browser. A little soon for the woohoos, perhaps. <br />
<br />
</li>
<li>Oh hey, <a href="https://drupal.org/node/778936">Mac specific install notes</a> regarding PHP, MAMP and other things from my last post. Whoops. Also this note on <a href="https://drupal.org/node/22676">CVS repository</a>... <b>Question: </b>is this relevant, and wouldn't the Git functionality supersede it? I should figure out how to keep my local version up to date. I bet that's later in the instructions... </li>
<li>Looks like Drupal will create its own DB, so I'm off the hook for that... Might have to adjust settings.php, but I know where to find it, so I'll come back to this step if the install script throws an error. </li>
<li>Checking my MAMP install against <a href="https://drupal.org/node/66187">the instructions here</a>. Hm. Well this is saying I DO need to create my DB (and <i>here</i> are those pesky user rights from above). hm! all these instructions overlap, so I'm just going to stick with this one, then check back on the INSTALL.txt instructions, and really everything should work fine anyway. Really appreciating the detailed instructions on this link for db creation (necessary or not). Found max_allowed_packet here, too. </li>
<li>Annd filling out the db info on the install page... looks like I wont need much more from the help docs at this point, though I do wonder if I should do "minimal" or "standard." Standard makes sense for testing, rather than custom, right? right.</li>
<li>Ok, I think... I think that's done. I get the site login page, changed some settings as in the MAMP local instructions above, db works, only thing I feel stupid about is not installing in the directory I should have. <b>Question: </b>how could I move the entire shebang? What's connected? MAMP needs the location, but the installation script wrote a whole bunch of db links I'm not sure about. Not critical, just irritating to my file system.</li>
</ol>
<div>
And with that, I move on to the rest of the dev env instructions and start my first patch/module/test!</div>
<br />nopehttp://www.blogger.com/profile/14339885013628227274noreply@blogger.com0Alexandria, VA 22301, USA38.8189466 -77.05932459999996838.794203599999996 -77.099665099999967 38.8436896 -77.018984099999969