afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
I keep getting sucked into coding the entire day! Sans the afternoons when I usually take a break and head out for errands into the summer heat -- I think there may be something wrong with this plan. OTOH I usually go from my room which only has the electric fan to places with aircon, and I avoid the blackouts that way so this plan is somehow accidentally completely okay!

I have 75 tabs open right now, and I really need to cut down, so I'm taking some time tonight to knock things down a bit. Here, have some links:


  • [site community profile] dw_mobile: New official community for the mobile page, headed by [personal profile] dreamatdrew; mobile brainstorming post in [site community profile] dw_biz

  • Animal Reviews blog: Humorous reviews of animals. Science and snark!

  • Dreamwidth swag, eeeeeeh! I am plotting :-)

  • jQuery Widgets tutorial - I've been doing a lot of jQuery lately. jQuery is seriously *gorgeous* as far as frameworks go. I love it. Hmm, I just realized I'm not doing a proper widget though, but that can wait until later. I'm still pretty happy with the shape of my code

  • chocolate ice cubes, via [community profile] omnomnom

  • Typewriter sound effects for the mac. Not going to grab the application, but that brings up memories of our typing class in high school, where we learned to touch type, occasionally blindfolded, on actual typewriters. Mine broke during final exams -- one moment I'm typing away, the next, ball bearings are flying everywhere. I may or may not have learned to type in Dvorak to wipe away the memories of that class from my mind.

  • jQuery developer guide - some good medium-level tips. These do assume you're familiar with basic jQuery concepts.

  • Information on packaging Perl modules; was useful to background information which helped me in figuring out how to install GTop (asdfghhjklklk;;lgh) in Ubuntu 9.10: Hints for Distributors from the Perl Foundation, Debian Perl Packaging Policy. Long story short, there are three main places for packages to put perl modules. For personal installations, you'll want to be using "site" (not "perl", or "vendor". I think that "vendor" is the default of some packaging tools), and that most of the issues I've run into when installing are because the installer tool or the perl module metadata assumes that you're wanting to install into the vendor location

  • Knitted hanging planter! Nifty intersection of [community profile] gardening and [community profile] knitting *g*

  • Keratosis pilaris a fairly common skin condition(?). I apparently have keratosis pilaris alba, (just rough bumps, less scary-looking than the picture). I used to try to "fix" it, but gave up when lotions had no visible effect.

    Apparently there are whole lines of products that can be used against this. Most are marketed as anti-acne, but may help with this as well. Whole lines. I am excited!

  • Filipino version of the Voltes V theme song (with english translations). Went to karaoke a couple of days ago, to Chicago (near Metrowalk), which has a pretty big selection of non-English songs. The big winner for me were the lyrics to the Voltes V theme song (Filipino version -- which is not a translation of either the Japanese or the English theme songs). Voltes V against kidnappers, carnappers, dognappers, snatchers, hold-uppers --- ahhahahhahahah. So much a sign of the times, yes



In other news, working on Dreamwidth has been very agreeable to me. I've come to think of my days as ten half-days, not as five whole days. That gives me a lot of flexibility, and means I have my afternoons free go take care of business for offices that are only open during the daytime (or else to take a siesta. Mmm siesta).

NTS: Take driving exam, get driver's license

It's been a bit odd because I feel that I have a lot of free time even though I've been working a lot, but I've tallied up hours roughly and everything seems right. It's just that the two-to-four extra hours I'd spend on DW stuff after my dayjob is now free time? Plus, I no longer have a one-hour commute (two hours both ways) eating up my time. Will take some getting used to.

I've been playing with Charlie (our minischnauz) a lot. I think he likes my being home about as much as I do *g*

Other things -- my fingernails are now black, my toenails are pearly white, and I somehow ended up in Divisoria (cheap clothes *G*) and came away with five pairs of shorts, two summer dresses, and a skirt. I have never had a summer dress before *G* (Used to think I wasn't girly enough to try these, but they feel great in the summer heat, and they look pretty too *G*)

AGH. Silly mistakes

Thursday, March 18th, 2010 04:42 pm
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
In my attempt to conquer Bug 2344: Default View/Default filters should be default when adding from hover menu, I wrote this line of code:

$success ||= $filter->add_row( userid => $u->id )

What I thought it said:

* add this user to the filter
* once you've added the user, check whether it was successful, and keep a running tab on the status so you'll know in the end whether everything succeeded or not

What it was actually saying:
* once you've successfully done one thing (e.g., added the user to a filter or subscribed to that user), we're done. We don't need to do anything else (in this case, adding a user to the filter).

So now I've rewritten it more properly as:

$success = $filter->add_row( userid => $targetu->userid ) && $success;

(I got the boolean logic initially wrong too *rueful*)


This was an entire afternoon's worth of frustration (whyyyyyyy isn't it adding the user to the filter? Why doesn't it print out any of my warn statements within add_row? I didn't realize I wasn't calling it at all), solved with one of those flashes of insight you get when you get up and grab a glass of water and happen to reread your code when you get back.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
Started from these instructions, but some modules try to install files into /usr/lib, which causes an error about being unable bto overwrite. I ran into this while trying to install a later version of Net::OpenID::Server/Net::OpenID::Consumer, in particular.

One solution is to force the install, but I don't know what other effect that could have.

The better solution is in this comment with similar but slightly different series of steps, from debian-administration.org.

(Note: in case it wasn't clear -- I had to figure it out through trial and error -- the rules.MakeMaker.noxs you're editing is the one in ~/.dh-make-perl)

So far so good; about to try it out.

ETA: Works!
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
I am excited. My mom is going to the US to visit my grandmother and see some of her sisters, and this means that I can order technical books and have her take them home. I thought about it a bit, and I really want these three books:

* Programming Perl
* Mastering Perl
* Perl Best Practices

I would have been happy with one, but O'Reilly has a promo where you can buy two and get one free, and my resolve cracked (THREE IS MY HAPPY NUMBER). I also briefly considered switching one out to get the Perl Cookbook but the cookbook is of the more expensive variety, and also, I could not decide which of the first three I could bear to switch out. [personal profile] denny assures me that the knowledge I have absorbed of Perl from poking around means that I can skip Learning Perl, which is good -- one less book to need to buy. I am sweating at the thought of the price, as it is. It's... urgh. It's a lot of money.

But guys, guys, I just bought books. Eeeeh. I hit the buy button and everything and they're now on their way!

(I've been tempted to buy these books before, and have them shipped to my country, but the price of world-wide shipping for three books is $39.48, almost as much as another book! "Almost", here, being a difference of 50 cents)

Anyway, anyway, I'm just so happy and excited. It's the first time that I've tried to order a book from overseas. I have a few technical books which I scavenged from a sale (also my textbooks that I bought for my university courses *grin* I should go look at the Unix Network Programming one again, for kicks), but on the whole I have too few books related to my field. This is the first time I'm buying a technical book that I actively hunted for/want/need, instead of just stumbled upon.

My face right now: ^_________^
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
Not the inside-inside, Perl guts, but trying to update all (DW) layout layers, to get all the updated features!

Long-term goal (actually, medium-term, because once the site goes live, everything needs to be stable, so I won't be able to do any drastic changes) is to turn this layout/feature chart entirely green. I know it's not possible; I can at least try what is reasonable.

One The hard thing about developing with S2 "officially" is that the quickest (only?) way to get feedback on your changes is to apply the layout to your journal, use the S2 compiler (layeredit.bml), apply changes, check journal, rinse repeat. However, then you have to copy the updated layer to bin/upgrading/s2layers. I've found that last step error-prone: tedious to pick out the changes bit by bit and transfer them manually. If I try to replace the entire layer in one go, I find that I have a hard time copy-pasting more than a screenful in vi (hm, have I ever tried just truncating the file and then pasting everything into a blank file? I don't think I have. Maybe I should do have tried that before trying to work around it).

So, anyway! Perl script! You give it the name of the layout. It reads the updated version which is currently "live" (on your dev site need to set the base URL; localhost works fine reads from ljconfig.pl). It then updates the static file in bin/upgrading/s2layers. After that, just need to do cvsreport.pl or hg diff or svn diff or commit or whatever. I've stuck in my ~/bin, so I can run it from anywhere, which is pretty convenient:

http://afunamatata.com/scripts/dreamwidth/s2sync.old

(This assumes that $LJHOME is set properly, and live versus cvs directories are in their normal LJ-setup locations, though this is really more for DW, since it overwrites bin/upgrading in DW-free)

Sample in action )

At some point, I may find it useful to modify it so that it accepts and upgrades multiple layouts (and themes??), but too much trouble to do so now, since I'm not touching themes at all.

And hopefully this will make development that much easier :) I was dreading keeping my live layout versus my diff-able layout in sync, but I am looking forward to coding this weekend now.


Update
[livejournal.com profile] exor674 just came up with a much prettier version <3 http://pastebin.com/f2fc673b3

I'm appropriating it for my own use.

Update2
Slightly tweaked version here: http://afunamatata.com/scripts/dreamwidth/s2sync!

(Basically, sanity check to make sure it's a layout layer, and also put the output directory into a variable, so that people who want to stick it straight into live instead of under cvs/ can change just the one line)

It now accepts either layer id (as a number), or layout name or redist_uniq, so either of these will work:
$ s2sync 333
$ s2sync bob/layout
$ s2sync bob


Also, output slightly changed:

dh-afuna@li-166:~/dw/cvs/dw-free$ s2sync 336
Can only handle layout layers at /dreamhack/8080-afuna/bin/s2sync line 33.
dh-afuna@li-166:~/dw/cvs/dw-free$ s2sync 333
bob/layout written to /dreamhack/8080-afuna/dw/cvs/dw-free/bin/upgrading/s2layers/bob/layout.s2
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
Damn. PHP also uses @$. First thing I thought when I saw it was, "Oh neat, it's dereferencing an array reference." Then I realized a) the variable on the LHS wasn't an array, and b) I was in the wrong language.

(It's used for error control instead, which is also neat in its own way, I guess.)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
I forgot that certain characters under certain conditions will cause parts of a word to be expanded as a variable in Perl. (In other words, my password was wrong because a portion of it was being recognized as a variable "$xyz", which was blank ;))

*whistles innocently*

The original twitter2lj.pl script is barely recognizable, as I had to redo the feed fetching, parsing, authentication, time(zone) handling, and posting to LJ. However! The HTML format of the output remains (mostly) the same.

Had to rework the feed-fetching-related stuff because the RSS feed has too few items (only 20). The archives XML file, which gives 80 items at a time, is in XML, but not RSS. They require different approaches to authentication as well. I feel a bit guilty about fetching directly from the archives instead of from latest items, but I only do it once a day, so it seems reasonable enough.

Given the problem with the password, the authentication for my RSS feed probably never worked. I just didn't notice it, because authenticating on that feed had no effect, given my settings!

For some reason, @lj_tags = ["tweets"]; was parsed as "array(0xblah)" when posted $lj->Setprop_taglist (in LJ::Simple). However, using @lj_tags = qw(tweets); works. As does using LJ::Simple::QuickPost. It's likely I've misunderstood something about the way lists work in Perl.
ETA: Ciaran has explained it to me :)
( [] indicates an array reference. I got that first line from the original code, which uses QuickPost, which expects an array reference, so it worked for that, but not when I switched to Setprop_taglist. Refreshing my memory about scalars vs lists vs references now *g*)

Now that it works, I have to resist the urge to redo it to optionally use JSON instead of XML (for the sake of those who had trouble installing the XML::Parser, since that would only affect a few people, and of those few people, I'm probably the only one who wants to do Twitter->LJ via this script). I also have to resist the urge to add options to grab other things available via the Twitter API.

So yay, my Twitter stuff archived here: http://afuna.livejournal.com/tag/tweets (backdated so that it doesn't double-spam, forchrissake).

<3 [livejournal.com profile] aveleh, [livejournal.com profile] murklins, [livejournal.com profile] ciaran_h for bearing with my babbling over IM (while I tried to figure out how to best tweak certain things *g*)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
The lack of sleep has been getting to me, and it's been making my dreams weird. So I shared a brief snippet of a dream with a friend:

<Afuna> earrlier I had a dream where I was debuginging, and the problem/solution was that it did not have any undernwear
cut for typos, code, mention of underwear, and mention of underwear in code )
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
I find it interesting that servers respond to the Range header in so many different ways.

My newest toy is a simple Perl script which I wrote to test why certain feeds can't be syndicated on LJ. I've only had a chance to use it twice, but both times the feed couldn't be created because the Range header makes the remote server return 206 (Partial Content) instead of 200 (OK), and each server had a different idea of how it should serve up partial content. And to confuse things even more, some servers return 200(OK) even when the Range header is specified.

First request I tried it with, the remote server returned the feed as a gzipped stream. Second request I tried it with, the server couldn't handle a byte range beyond a certain size (the size of the feed, maybe?); anything larger than that, and it returned 416 (Requested Range Not Satisfiable). I know that the problems with Bad Behaviour are also caused by the range header, but I am not certain about the specifics, other than that it's rejecting the requests because the byte range starts with a 0.

I really should drop this, since there's literally nothing I can do about any of it and there are more productive things I could be doing right now. But. Maybe I'll just check out one more feed if another request about failed feed creation comes in, even if finding out what's wrong isn't likely to help get the feed syndicated.

Enough synning for today! I'm jumping ahead of myself again. I have yet to answer a feed change request where the answer is a simple "yep, valid. Feed changed"; I should get on that soon ;)

January 2017

S M T W T F S
1234567
891011121314
1516171819 2021
22232425262728
293031    

Syndicate

RSS Atom

Most Popular Tags

Expand Cut Tags

No cut tags