CoderBuddy Blog http://coderbuddyblog.com Most recent posts at CoderBuddy Blog posterous.com Fri, 04 Nov 2011 14:27:00 -0700 Create a Facebook App in a minute with CoderBuddy http://coderbuddyblog.com/lose-your-facebook-app-virginity-create-one-i http://coderbuddyblog.com/lose-your-facebook-app-virginity-create-one-i

Cimg4040s
Hi! Maybe you've been meaning to get around to creating a Facebook Application, but months have gone by, and it's still on your to-do list. Now you can create something viral and become rich, impress your boss, or just add another line on your resume.

Here's how to do it!


Get Started, Testing and Fine-tuning


1. Create a Facebook App project on CoderBuddy using this link!  This project will help you create a Facebook-enabled web site. A visitor to your web site will be able to post a status update to Facebook and also get info like their friend list and profile info.

Watch a Video Tutorial to show these steps and extra tips!

 

Image1

2. Go to the Facebook Developer's Apps page at:
 https://developers.facebook.com/apps  (Note: You may need to verify your Facebook account if you haven't already.)

Image2

3. Create an App by clicking on the "+ Create New App" button at the top right corner of the above page. Type in an App Display Name (for example, My First CoderBuddy App), and App Namespace (yournametest) -- it doesn't matter too much what you put in. Check the checkbox that says "I agree to the Facebook Platform Policies" and then press Continue. Fill in the Security image check form.
Image3

Image4
Image5

4. You're now in the Basic settings page for your Facebook App.
Image6
At the bottom of the page where it says "Select how your app integrates with Facebook", click on "Website" and where it says 'Site URL:', type in 'http://username-projectname.coderbuddy.net' . So if your username is adrian and your projectname is instantfacebook-1000, you'd type in


         'http://adrian-instantfacebook-1000.coderbuddy.net'.

Make a note of the App ID and App Secret values at the top of this page (or keep this page open as a tab in your browser, as you'll need them in the next step.

Image7

5. Now, that you've created the app on Facebook, you just need to update your settings in the
CoderBuddy project to talk to Facebook. Click on the FileList link here in this project in
CoderBuddy and click on the file 'guestbookapp/view.py' to edit it -- or the '#' link to the right
of the filename to use our New Editor, shown below. Then paste in the values for App ID and App Secret from your Facebook Apps page into these lines in the first page of the 'guestbookapp/views.py' file:

class GuestbookFB(FacebookClient):
    APP_ID = ""
    APP_SECRET = ""

Imagecb-new

You're all set -- Click on Preview Site and test out your site in CoderBuddy's testing environment. Try out posting a status message to Facebook, and more. Then you can go ahead and start editing the code and the templates!


Tips on Editing This Project

Here are a few files you can check out:

HTML files to change the look of the site:

templates/base.html sets the html for the header and the footer of the pages


guestbookapp/templates/guestbookapp/info.html sets the html for the main part of the site homepage


guestbookapp/templates/guestbookapp/guestbook.html sets the html for the simple guestbook page

The Heart of the Code:

guestbookapp/views.py has the main functionality for the calls to the Facebook API's that
    get data etc., while other parts of the code take care of handling the authentication
    and session handling with facebook.


Publishing Your App For Real ;)

When you're ready and would like to publish this to a web hosting environment and share it with friends, you just need to do a few more things.

1. First of all, get set up to publish it to Google App Engine, by configuring your Google Account and creating an app identifier on App Engine for hosting your app. Just click on Publish to App Engine and we'll help you go through that setup process.

2. Next, you'll want to set up another Facebook App for your production version, since it'll be hosted by a different domain name. Instead of the coderbuddy.net Site URL above, this time use
'http://GAEappid.appspot.com/' where GAEappid is the Google App Engine app identifier you created in the previous step.

3. Finally, add the new APP_ID and APP_SECRET values along with the domain of your live website to the GuestbookFB class in the EXTRA_DOMAINS section of the class GuestbookFB definition in views.py in CoderBuddy -- a few lines below what you changed before. The class will look like this:

class GuestbookFB(FacebookClient):
    APP_ID = "<your old APP_ID>"
    APP_SECRET = "<your old APP_SECRET>"

    EXTRA_DOMAINS = {
        "GAEappid.appspot.com": {
            "APP_ID": "<your new APP_ID>",
            "APP_SECRET": "<your new APP_ID>"
        }
    }

Note: that you'll still be able to test the app in CoderBuddy's test environment, as well as live on Google's servers, because we've set this default app to work in both environments.


4. Click on "Publish to App Engine" link again to make your new APP_ID and APP_SECRET available to your live web site..

Feel free to contact us for help with this via the CoderBuddy site!

We hope you enjoy!!!


Please follow us on Twitter , like us on Facebook , and tell your parents about us, ... ;)

 

- Adrian, Luis and the rest of the CoderBuddy team

P.S. Note that Facebook has a number of policies that developers
should follow - something to be careful about when you start
publishing apps to the public. You can check those out here:

  https://developers.facebook.com/policy/

(For example, they ask you to list a privacy policy, etc.)

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1542650/299902_10150309406153675_501533674_7851972_17839guido.jpg http://posterous.com/users/he66l6xsMhfvk CoderBuddy coderbuddy CoderBuddy
Tue, 11 Oct 2011 06:03:00 -0700 Curiosity-Ordering and the Challenge of Teaching Python to Well-Seasoned Software Engineers http://coderbuddyblog.com/the-challenge-of-teaching-python-to-well-seas http://coderbuddyblog.com/the-challenge-of-teaching-python-to-well-seas

[ In this post, we welcome a guest -- Marilyn Davis. We're interested in how Python is being and can be taught, so we are excited to welcome her to our blog! ]

by Marilyn Davis, Ph.D.
http://www.pythontrainer.com

Marilyn-pythontrainer

As a Python instructor in corporate environments and at UCSC-Extension in the Silicon Valley I mostly teach to working software engineers, who are already well-practiced in at least one other computer language, and are interested in getting back to work as quickly as possible.

These students are usually well-paid, very smart, and anxious to learn this new language that promises to increase their productivity 300% - 900%, depending on their current language.  And, they want this new knowledge fast: in four days.

To survive as an instructor to these engineers with high expectations, I have to be spot-on, as spot-on as the Python language itself.

Guido Van Rossum invented a language that embodies the real point of any programming task: to communicate with other programmers (in a way that, also, the computer understands).  It is a language that respects a programmer's time more than it respects interpreters, machines, or traditions.  It endeavors to move all the hard work of programming out of the programmers view and keep us focused on our own application and on having fun.

To do justice to this marvelous language, I sought to show maximum respect for the student's time by finding a method that keeps them involved and curious, transforming the hard work of learning into fun.

While I teach, I am always listening to the students to discover "curiosity order" for the Python topics.  When a person is curious, learning happens without effort.

And, as with learning to dance, or absolutely anything, the only way is to "learn by doing".

The answer, then, is to present topics in curiosity-order, as short example-filled lectures; followed by lab exercises that are carefully designed to provide practice with the current concepts, and generate curiosity about the next concepts.

When we start a new lab, it always begins with a discussion of solutions to the previous lab.  Again, we are following the pattern of curiosity, then satisfaction.

Here I discuss the curiosity order for Python.

Python In Curiosity Order

The first skill every programmer wants with every new language is to get the computer to say something.  So the first lab is labeled "Output".

Lab 1 -- Output

       Executing a Python program
       Writing to "stdout"
       Assigning: labels and objects
       "str"ings
       "if", "elif", and "else"
       "while" and another "else"
       Iterating with a "for" loop
       Counting loop with "range"
       Relational and logical operators
       "tuples"

The first program shown displays code blocks delimited by indentation, "else" connected with "while", a "for" loop over a range, "if", "else", "+=", the "%" operator.  It leaves students with questions, answered by subsequent code examples involving variously delimited strings, and filling in the blanks about the two looping devices in Python.  And it ends with a list of Python's relational and logical operators.

We start casually, but immediately, with an explanation of Python's memory model (disguised as an explanation of the assignment operator). And we immediately use the word "iterating" because this particular concept is built into most Python objects.

At times a seasoned programmer will find the logical operators "and", "or", and "not", confusing, expecting these operators to be obscure symbols instead of plain English.

That's how the mind-blowing trip of learning Python begins!

Lab 2 -- Input

       Input from "stdin"
       Factory functions
       Catching an exception:
         yet another "else"
       Formatted strings
       Integer division issue

Next, a programmer wants to accept input from the user, which raises questions about user error, which naturally leads to an understanding of the "try" and "except" keywords for catching exceptions.

And here we fill in the blanks about formatting strings and taking complete control of output.

Lab 3 -- Functions

       Function protocol
       "import" and "reload"
       Modules: "math" & "random"
       Introspection
       Identifier scope
       Default function arguments
       Keyword function arguments

The previous lab exercises left the student with no choice except to create duplicate code, which led to an interest in function protocols. The complete function protocol facilities aren't explained at this point because students do not yet know about dictionaries.  No one seems to notice the omission.

While creating their first function namespaces, it is natural to seek to import other namespaces, i.e. libraries; and to call those libraries' functions.  So here we visit the "math" and "random" libraries and learn to introspect their facilities.

Lab 4 -- Sequences

       Sequence types: "str", "tuple", "list"
       Sequence slicing and other manipulations

By now, students have been using tuples and lists naturally and asking the difference between these two types.  So it is time to meticulously compare and contrast the three sequence types and their facilities, reinforcing the concepts of namespaces, introspection, and iteration.

Lab 5 -- Important Trick

       Module: "sys"
       Important trick:
         "__name__" and "'__main__'"

I like introducing the "sys" module at this point; to give the students the power to read command lines, to get to raw IO, and to know how to stop their program cold with "sys.exit".

After that quick power shot, we slow down to understand how the "__name__" attribute of every namespace can be used to conditionally test the module's code; and simultaneously, make that code useful as a library.

It's a deep and powerful lab, well worth the effort.

Lab 6 -- Comprehensions

       Scope issues
       List comprehensions

To lighten the mood after Lab 5, we practice list comprehensions and other functional programming facilities of Python.  These facilities are easy, powerful, and fun, thereby leaving the students in a good mood.

Lab 7 -- Dictionaries

       Importing with "from"
       Dictionaries

After that mood-lifter, and after being familiar with a plain import, the students are interested to to hear an exhaustive lecture on the danger of the "from" keyword so they can apply it wisely in their own work.  This lecture is also a good review of "mutability", which we've been struggling to understand since Lab 4.

Next comes a study of Python dictionaries, always appreciated for their power and straight-forward implementation; and, another surprising, but very useful, iterating object.

Lab 8 -- File IO

       File I/O
       Module: "os"
       Walking A Directory

Now it is time to manipulate files, which brings in more details about exception handling.  We look at the "os" package and its sub-package "os.path".  We use os to walk a directory structure, once again iterating.

Lab 9 -- Packages

       Modules: "shutil", "tempfile"
       Python Packages

The exercises for the previous lab brought up the need for two libraries that are important to some engineers: "shutil" and "tempfile".  So it is a good opportunity to slip in quick examples of
their use.

A zippy explanation of those facilities at this point is also useful to quicken the pace before the packaging lecture, where we need to go slowly.

Making Python packages is the most difficult and tedious lab we have. The steps that are necessary to build a package are hard to believe until they are experienced.

Lab 10 -- Dynamic Code

       Dynamic Code Generation
       Modules:
         "subprocess"
         "glob"
         "profile"

By now, students are willing to study examples of "subprocess", "glob", and "profile"; both to acquire these particular facilities, and also to have practice with more imports and solidify their understanding of the gist of gluing libraries together.

And, being human, not machines, they are getting weary of too much material, too fast.

It is the right time reward and awaken students by demonstrating "exec", "eval", "setattr", and "getattr", the dynamic code generation facilities.  I say "reward" because these mind-blowing facilities are so exciting, powerful, and Pythonic.  Everyone loves this part.

Lab 11 -- Function Fancies

       Function protocols: variable length argument lists
       Formatted printing using a dictionary for replacement
       Unpacking sequences and dictionaries
       Generators (Optional)
       Decorators (Optional)

The study of the remaining function protocol mechanisms is fun enough to again awaken students.  The dictionary replacement into formatted strings usually brings gasps as students realize how much time and aggravation they will save using this facility.

At this time, I always invite students to take a break, or put their heads down for a nap, as we study the facilities that Guido says are "not for the faint of heart".

Being human, this always gets students' undivided attention. And, as they come to understand these facilities, they are quite blown away.

Lab 12 -- OOP

       Module: "shelve"
       Classes
       Inheritance
       Class variable

When we get to the OOP lab, I like to start with a simple import into a familiar code example from the Dictionary lab.  The "shelve" import, with a few new lines of code, provides persistent memory for a dictionary.  This is ridiculously easy.

This then, puts us in a namespace frame of mind; and we're ready to take a tiny leap from there into OOP with Python.


Lab 13 -- Overriding

       Overriding
       "Has-A" vs "Is-A" relationships

The last lab left people finding ordinary, clumsy ways to print their objects' attributes.  They are delighted and relieved to learn how to override Python's special "__str__" method so that the built in "print", "%s", and "str" will interact with their objects.  From there we learn a few other useful overrides, including how to make our own objects iterable.

Once we get that piece of magic, we are real Python programmers.

At this point, I can't resist explaining a few symbols from Unified Modeling Language because I have been using them all along like they were my own.

Lab 14 -- New Style Classes

       Useful attributes
       Iterators
       New style classes
       Attribute control (Optional)
       "property" (Optional)
       Static methods (Optional)
       Class methods (Optional)
       Diamond inheritance (Optional)

We go a little deeper into more esoteric considerations of OOP, if there is interest.

Lab 15 -- Developer Modules

       Context Manager class
       Module: "unittest"
       Module: "optparse"

We finish with a few simple tools that many good software shops like to use.

Lab 16 -- Wrap Up

       Exceptions
       Namespaces
       Nests
       Pitfalls
       Finding Modules and Help

Finally, we are essentially done and a wrap-up is in order.

We fill in the holes in our knowledge of exceptions, and experience a few Python pitfalls in the lab so that the engineers will not waste any time at work worrying about them.

Time permitting, and if there is interest, we study the ubiquitous regular expression facility and learn the few very useful extensions given to us by Python.

Lab 17 -- re Module - a library example (Optional)

       re - Regular Expressions (Optional)
       Search and replace (Optional)
       Named groups (Optional)

Lab 18 -- re Syntax

       Regular expression syntax (Optional)
       Testing regular expressions (Optional)

By now, each student wants to be left alone to delve into one, or many, of the thousands of libraries for Python: the libraries specific to their own work.  And, as with a person who has been taught to fish: the student no longer needs the teacher.

(C)opyright 2011, Marilyn Davis, Ph.D. http://www.pythontrainer.com 

Marilyn specializes in Python training for corporate clients, either through UCSC Extension Corporate Training Department, where students earn University credit; or independently. She has taught Python for Google, Nokia, Cisco, VMware and more. Even the marketing department at Google took a class.

This is a guest post on the CoderBuddy blog. Check out our new service, CoderBuddy, if you'd like a quick way to start coding Python applications, especially with Django and Google App Engine. Please follow us on Twitter as well!

 

 

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1542650/299902_10150309406153675_501533674_7851972_17839guido.jpg http://posterous.com/users/he66l6xsMhfvk CoderBuddy coderbuddy CoderBuddy
Fri, 08 Jul 2011 17:06:00 -0700 Upload and expand a zip file into your CoderBuddy project - New! http://coderbuddyblog.com/upload-and-expand-a-zip-file-into-your-coderb http://coderbuddyblog.com/upload-and-expand-a-zip-file-into-your-coderb

Hi! We've just released a new feature that lets you upload and expand a zip file into your CoderBuddy project. We use this ourselves when we want to add Javascript and other libraries into a project. Here's how to do it:

1. Upload the .zip file (File List -> Upload File, choose the file from your local computer and click on the Upload button)

2. Once it's uploaded, click on the zip file's name from the Project's File List page

3. On the zipfile's page, click on the Unzip link, and you can type in a subdirectory that you'd like the file to be uploaded into.

4. Click on the Unzip button to start the unzipping. It'll display the names of the files from the zipfile as they are unzipped and placed into the project.

Caveats: If you have any problems, just send me an email -- my address is at the bottom of each page when you're logged in on CoderBuddy. CoderBuddy works best for projects w/ 1000 or less files at this time, but if that becomes a limitation for you, just drop us a note. Either way, we'll be working on improving on that. We already have projects with more files than that! 

Thank you and enjoy!!

-Adrian Scott

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1542650/299902_10150309406153675_501533674_7851972_17839guido.jpg http://posterous.com/users/he66l6xsMhfvk CoderBuddy coderbuddy CoderBuddy
Sun, 26 Jun 2011 10:23:00 -0700 CoderBuddy Tip: Try out the New Code Editor and Play with the Editor Preferences http://coderbuddyblog.com/coderbuddy-tip-try-out-the-new-code-editor-an http://coderbuddyblog.com/coderbuddy-tip-try-out-the-new-code-editor-an

If you're already a member of CoderBuddy, we'd like to invite you to try out the new code editor if you haven't already.

When you're in a project, click on the "New Editor (Beta)" link next to the File List link, and that'll start up the code editor. Once it's started up, you can change the Editor Preferences if you'd like -- the options include key-bindings for Vi/Vim and Emacs. There are also a number of theme and font settings you can customize.

You can open multiple files and they'll appear in separate tabs in the editor.The list of open tabs will be saved so they re-open automatically when you return to the editor.

Check out the keyboard shortcuts that are listed on the page too, for some productivity-enhancing tips.

Creating new files still requires using our classic interface for now, as does renaming, deleting and uploading files.

We welcome your feedback on the new editor. We have a bunch of interface upgrades in the works. Thanks for trying it out!

-Adrian

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1542650/299902_10150309406153675_501533674_7851972_17839guido.jpg http://posterous.com/users/he66l6xsMhfvk CoderBuddy coderbuddy CoderBuddy
Thu, 28 Apr 2011 15:09:00 -0700 Did HN's new Who is Hiring account optimize the wrong objective? (minimizing # of posts per month) http://coderbuddyblog.com/did-hns-new-who-is-hiring-account-optimize-th http://coderbuddyblog.com/did-hns-new-who-is-hiring-account-optimize-th

In April, Hacker News tested out a new account, "whoishiring" in an attempt to organize / centralize monthly "Who is Hiring" posts.

While the initial design for the account was going to be to post 3 posts per month (ref), after discussion, the account creator decided to just start one overall hiring post. Effectively the design optimized --> minimized the number of who is hiring posts. 

I'd suggest that the initial idea of having a few, focused regularly-scheduled posts is more effective if we consider the goal to include such objectives as optimal 1) digestion of information and 2) usage of time. At some point, it'd make sense for posts with geographic filtering (e.g. in the subject).

With 3 posts per month, readers can get listings that are filtered for their needs. And at 3 posts total per month, it's not a huge distraction for those who aren't interested at all in those threads. I previously found that having separate posts encouraged me to post, but the single post resulted in a really huge post that made it seem less interesting to post our opportunities.

Your thoughts?

-Adrian

--

P.S. We're hiring and welcome Remote Workers. We're especially interested in candidates in Latin America ( Central and South America). Many of our team are based in Panama, and part of our team is in Brazil. I'm in Brazil right now as a part of Geeks on a Plane, and will soon be in Chile and Argentina in a few days time, so I especially welcome hearing from folks in those countries who'd like to meet up!

At CoderBuddy, our goal is to revolutionize software development. Our founder is a pioneer of social networking (Ryze, as mentioned in The Facebook Effect, etc.) and was a founding investor in Napster. Our angel investors include Internet entrepreneurs who have sold their startups to Google (pre-IPO), Microsoft, Yahoo, Fox, etc., and 500 Startups.

We're looking for a Developer Evangelist / Social Media 'Ho' ;), Front-end developers, Server-side Developers, and a Designer. (Again, we're looking mainly at folks located in Latin America for time-zone and budget syncing.)

Technologies we use include Python, Google App Engine, Django, AJAX, and AWS. Math ability is a plus for developer roles.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1542650/299902_10150309406153675_501533674_7851972_17839guido.jpg http://posterous.com/users/he66l6xsMhfvk CoderBuddy coderbuddy CoderBuddy
Fri, 28 Jan 2011 09:24:00 -0800 The New CoderBuddy Blog http://coderbuddyblog.com/41253081 http://coderbuddyblog.com/41253081

Getting rolling with our first CoderBuddy blog post... CoderBuddy lets you create and publish websites and applications quickly, and get access to free hosting. You can edit your websites and applications through a web-based development environment (IDE). CoderBuddy works with Google App Engine and the Python Language.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1542650/299902_10150309406153675_501533674_7851972_17839guido.jpg http://posterous.com/users/he66l6xsMhfvk CoderBuddy coderbuddy CoderBuddy