kaberett: Overlaid Mars & Venus symbols, with Swiss Army knife tools at other positions around the central circle. (Default)
[personal profile] kaberett
Wiki page on Version Control.

Tonight I logged into my Dreamhack for the first time since September (there were over 700 commits that I was behind by, um), and [personal profile] randomling was an absolute sweetheart and held my hand through the process of (a) updating my Dreamhack and (b) submitting my first patch since, er, we migrated.

(... whereupon I promptly forgot everything I ever knew about updating language strings, and mark was very sweet about it...)

IN THE PROCESS, I ended up tweaking the wiki page a bit, to include things I ran up against and needed to check with other people.

What else would you like to see in there? Leave suggestions in comments and we can edit them in!
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)
[personal profile] sophie
It's been a while since I posted anything in this series of entries, and I apologise for that! Today, though, I'll be explaining how to actually use classes in Perl and the Dreamwidth code and constructing new objects.

How do you use classes? )

That's a lot to take in, so I'll leave off for now! I hope I've explained things well, but I'm sure that there are bits that are going to be incomprehensible. If you need me to explain anything further, please ask in the comments - I'll be happy to try to explain it.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)
[personal profile] sophie
Welcome to the second part of the series on object-oriented programming - or OO - as it applies to the Dreamwidth codebase. :)

If you haven't already read the first part, you'll want to do that before reading this part. I also realise that I never got around to explaining what 'methods' are in the first post, so I'm going to do that right now before delving into the main part of this post:

What are methods? )

As with the last post, if you have any questions on this, feel free to let me know in the comments!


So, with that explanation of methods out of the way, it's time to move onto our next topic - how it applies to the DW codebase.

I'm going to do this as a few posts, each dealing with their own topic, because I've got a fair amount to say about them. I'm still not entirely sure how many there'll be, but I'm writing them one at a time so there may be some time (a few days to a week) between each one.

A couple of things to note before I begin:
  • This post may require some basic knowledge of Perl and/or programming in general. Not much, I promise! (Things such as what a 'string' is, etc.) But all the same, if anybody finds themselves confused by anything I write, feel free to ask for clarification in the comments. I won't bite!

  • Secondly, if you're used to OO from another language, you'll find some things about Perl's implementation of OO to be strange and baffling. That's because Perl wasn't actually designed with OO in mind; OO support came later, and to be honest, it shows. Still, it's what we use, so I hope I can at least help with understanding it.(**)

    (**) There is a version of Perl in the works which does a much better job of not only OO but a lot of other things - Perl 6 - but at the cost of revamping a lot of the language such that you probably wouldn't be able to use it without spending some time making sure your code conformed to it. For this series, therefore, I'll be concentrating on Perl 5, which is what most Perl developers - including DW and LJ - use.


With all that said, let's move onto our first topic!

What is an 'object' in Perl? )


That's about it for this post. There's a lot of stuff here so feel free to ask questions if there's anything you don't understand! My next post will probably talk about how you can create and use an object, as well as some example of existing classes in the codebase.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)
[personal profile] sophie
The Dreamwidth codebase uses object-oriented programming a lot, or "OO" as it's known. But what exactly is OO? In this post I'm going to explain the concepts of OO. I plan this to be the first in a series; in later posts I'll explain how OO programming relates to the DW codebase, some gotchas that might arise, and other such things.

For now though, an introduction to the basic concepts of OO!

So, what is OO exactly? )

And that, in a nutshell, is what OO is all about. In the next post on this subject - which may be in a few days or a week, I don't know yet - I'll be talking about how this applies to the Dreamwidth codebase. :)

If anybody has any questions so far about what I've said in this post, please feel free to comment!
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
[personal profile] fu
In celebration of the world cup, the jQuery book from SitePoint is free today: http://sale.sitepoint.com/. I just grabbed a copy, and I suspect a bunch of you will appreciate one as well *g*

(found via IRC)
kareila: "Mom, I'm hungry." "Hush, I'm coding. You ate yesterday." (coding)
[personal profile] kareila
I just bought a used copy of Mercurial: The Definitive Guide, only to discover in the first few pages that the full text is freely available online.

Here is the link: http://hgbook.red-bean.com/
wychwood: archaeology: computer, trowel, books (Arch - archaeology)
[personal profile] wychwood
Joel Spolsky, who writes the generally informative and entertaining Joel on Software blog, just posted a tutorial guide to Mercurial. A lot of it isn't particularly relevant to the average Dreamwidth dev, but I know I came out of it feeling as though I had a little more idea of what was happening, or supposed to be happening, with patches and updates and all!
blithespirit: (Default)
[personal profile] blithespirit
 Hi folks,
Not sure this is the right place to ask, but I have a friend who is a sys admin with Perl experience who is interested in helping out the Dreamwidth project/community. He mentioned that he has Perl experience, specifically. I have been waxing lyrical about the awesomeness of Dreamwidth & the fact that it helps train its users/community members to be able to work on the code, and got him interested in helping. :)
He said he was interested in maybe helping with Perl mentoring, if that would be of use.
Can anyone help me point him in the right direction - I'd like to show him what needs to be done/the various entry points for helping out, etc. 
Thanks in advance, love your work, etc etc. <3
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
[personal profile] afuna
Here's the process to take an existing theme layer and convert it into patch form (with all the fluff and trimmings to make it work on the customize page, have proper credit, etc).

Adding a theme layer to an existing style



To add a theme layer to an existing style, you need to edit two files:

bin/upgrading/s2layers/$layoutname/themes.s2 (or themes-local.s2)
cgi-bin/LJ/S2Theme/$layoutname.pm (or $layoutname_local.pm)

in detail )

Adding an entirely new style from a theme layer



This entry is purely about generating patches from a layer which is already s2-ified, so I won't cover the conversion from a stylesheet to a theme layer. If you need it, see the tutorial for S2 property conversion, which is thoroughly amazing. :)

Hopefully you won't need to do that yourself (the task is time-consuming, but not very complicated,so it's perfect for when you have plenty of time on your hands, but not much brainpower to spare). Let's just move on past it; I'll assume that either the theme came ready-converted, or that you did the conversion on your own.

So, you'll basically end up editing five files:

bin/upgrading/s2layers.dat
bin/upgrading/s2layers/$layoutname/layout.s2
bin/upgrading/s2layers/$layoutname/themes.s2

cgi-bin/LJ/S2Theme/$layoutname.pm
cgi-bin/LJ/S2Theme.pm

in detail )


Other things: images for layouts go under: htdocs/stc/$layoutname/imagename.png, etc. (under stc so that we can access them as relative urls from stylesheets, though in practice, we've been setting them as absolute URLs in properties by using variables, etc)

And uhh. I guess that's it!

Edit: 10/01: fixed a few errors, clarified a few instructions, courtesy of [personal profile] zvi
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)
[staff profile] denise
So, you have the "Welcome to your Dreamhack!" email sitting in front of you ... and absolutely no idea where to start. You've never used any kind of Unix-based operating system before, and the Wiki pages might as well be in Klingon.

Fear not! I've written a command-line tutorial on the Wiki. I've tried to keep it simple but cover everything that might be useful.

(If you're experienced with Unix and want to expand it, please do! Do try to avoid confusing people, though -- we don't need to get into everything.)
yvi: Dreamsheep in Germany's national colors (Dreamsheep - Germany)
[personal profile] yvi
So, [personal profile] afuna is enabling me again.

The idea basically is that it's easier to actually do some bugfixes aster a few days of learning basic Linux commands and some Perl exercises, because the big code can be intimidating. But sending people to read a book is also not very welcoming and also not always relevant to the type of code we are dealing with here.

Besides, doing a tutorial where you learn what $u->{userid} does is hopefully more interesting than doing $foo->{bar} exercises.

So, how about instead we have some Dreamwidth-specific tutorials and exercises?

What I am thinking about is an area on the Wiki with a general introduction to how the code is structured (which we already have, it may just need to be elaborated and tied into this new system) and what the basic Linux commands you may need are (cd, cp, grep, find, diff), and after that a few tutorial problems.

These would need to be:

1) ordered in difficulty level
2) relevant to the kind of problem you are likely to come across in the first bugs (searching for where code is, searching for where functions are defined and what they return, getting the value of a variable,...)
3) interesting
4) deal with the different kinds of code (Perl, BML, CSS, S2)
5) not take too long - an hour max for each one, so that you can hopefully do them in one session
6) with an obvious result; ideally many of the exercises would be based on an existing bugfix

Then for the first examples, I'd like have a detailed walk-through, including how to generate the patch in the end and how you'd upload the patch. Also, the page could link existing walk-throughs, which are also very helpful.

Does this sound like a good idea? Does this sound interesting to the new developers here, would you like to have that? [This would definitely not replace help on IRC or through this community] And for anyone who is new or still remembers being new, what areas would help be needed in?

Would anyone be interested in helping me with that? My strength is definitely not with putting things into understandable words, but I think I can come up with small, interesting challenges, example patches and such things.

And lastly, if you think this is a good idea, throw suggestions at me.
cesy: "Cesy" - An old-fashioned quill and ink (Default)
[personal profile] cesy
There's been discussion in a couple of places recently about making it easier for people to start out in development when you know pretty much nothing. I think someone is working on an official guide, but I figured I'd put something up here in the meantime, as [personal profile] 7rin was asking.

Firstly, most of our dev-training currently happens on IRC. The wiki page explains how to get on there. However, I know IRC isn't possible for everyone, so I think the plan is for people to be able to ask stuff in this community as well.

The first thing to do is to request a Dreamhack. These are our development boxes, and are the basic tool you'll need to do anything. Note that getting one and not using it doesn't use up any resources, so don't worry if you have to drop out of dev stuff later. Once you've got it, follow the steps in the getting started wiki page on Dreamhacks, though it may not all make sense at this stage.

You've then got two choices of method, depending on how you prefer to learn. Either way, a really important point to bear in mind is that at various points in this process, it will all go horribly wrong. That's normal. There will be something you don't understand, or something breaks, and you have no idea what's going on. That's okay. Post an entry here, or drop a comment to any dev (*) and we'll find someone who can help you fix it. We all have it happen to us on a regular basis. Things Going Wrong is a normal part of programming, not a sign that you've failed. This is important to remember when you've spent three hours banging your head against a brick wall. Anyway.

Method 1
Start having a look at Bugzilla. For Bugzilla, I'd suggest you first set up a new email address, as it gets displayed publicly, set it to forward to your main address, and then sign up on Bugzilla. The most useful search is for the keyword "effort-minor", which should include all the easy bugs. Once you've got a Dreamhack running that you can log into, and you've found a bug you like the look of, I'd suggest asking in IRC or the community to check whether it's harder than it looks or anything like that.

Method 2
Just look at the code on your Dreamhack for something where you know what it does (for example htdocs/userinfo.bml is the profile) and read a Perl book/online guide to figure out what's going on in there, asking in IRC or here when you're stumped. If you've never used a command line before, this wiki page will help.

This: http://www.perl.org/books/beginning-perl/ and http://www.ebb.org/PickingUpPerl/ are the Perl books we recommend.

http://wiki.dwscoalition.org/notes/BML is the Wiki page for BML. But BML is evil.

Other resources
Other resources to look at, if you haven't already, are the wiki and this community. Membership is open and posting is open to all members so you should be able to post in here if you get stuck.

http://www.linux.org/lessons/beginner/toc.html looks like a good Linux introduction and is relevant from lesson 5/6 onwards.

W3Schools have a good basic guide to CSS.

Of course, I've glossed over an awful lot of things, there, so do tell me which bits need more explaining.

(Thanks to [personal profile] yvi for her suggestions and additions.)

(*): This includes me, most of the people commenting in this community, and anyone posting in [site community profile] changelog. Most of us can be contacted by PM, or just leave a comment on any public entry, either here or in our journals.
kareila: "Mom, I'm hungry." "Hush, I'm coding. You ate yesterday." (coding)
[personal profile] kareila
[staff profile] denise sez:

I'd really like to see someone's thought processes while implementing something big/major that relies on working with DB stuff: what's the best practice bits that we just won't think about because we don't know enough? What sort of stuff should we do just because that's the best way to do it? Etc.


I am not a professional database designer, but I've read a few books and learned my way around MySQL, so I'll try to share my thoughts by way of the spec I've implemented for Bug 215: Implement v-gifts. Fair warning: although that spec has benefited from one round of peer review, it hasn't been approved yet, so it might will change again.

Read more... )

Profile

dw_dev_training: The stylised 'd', with the word 'dev' above, and the word 'training' at the side, representing the dw_dev_training comm. (Default)
Dreamwidth Development Training

January 2017

S M T W T F S
1234567
891011121314
151617 18192021
22232425262728
293031    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 1st, 2017 12:27 am
Powered by Dreamwidth Studios