Is it a title/caption generating app? Does it find random photos and feature one a day with this caption? Does it secretly hack into your computer and take a picture of you?(Don’t do that last one.) When you’re ready, make a website.
It would be connected to a gmail account– (could modify it to a facebook account?). App will have access to friend’s list and calendar. The user selects friends they want to always keep on their social calendar and then give them frequency (regular intervals of time the user wants to see them.). Friends can also be grouped if you always see a certain set of friends, but they can be peeled off too.
Interface: A series of concentric circles each with a friend icon sliding on each line (like a track). The grand circle is similar to a clock face but instead of the hands moving, it’s the face, the hand always pointing up. The clock scales with the plans that you have, but can zoom in if you wish. A person with less far out plans won’t see an empty calendar but a differently scaled (large icons) circle.
Active (brightly colored) icons for “friend-instances” or an event planned with a friend. Inactive (dimmed) icons for friend “potential friend-instances” for the recommended slot to see this particular person based off the preference indicated by the interval of time you enjoy seeing this person. And then some other state of icon, “Routine” for standing appointments. So most active icons will have a follower of a tickmark indicating an automatic emailer* followed by a dimmed icon at a variety of intervals indicating the next potential date.
Circle of friends connects users. If a person needs to cancel, they click the friend-instance icon and click the cancel date option which triggers a new email to inform the other user that plans are canceled. The active icon goes away. The trailing inactive icon doesn’t.
*automatic emailer– it emails your friend with a generic message, hey, let’s grab some coffee on this {{date}}? (or some other generic activity you like doing together, indicated in the friend settings)– can be disabled when going on trips, can be influenced by calendar.
Comments by my technical advisor, Myco:
I can see the use of this for someone like yourself, who likes to keep social events flowing so that you can keep in contact with people. For others, this would be a bit of a change for them, to schedule regular meet ups. However I think the strongest selling point for the app is that most people *want* to be more social and stay in touch with people. promising them to help them with that is your value proposition.
If you boil down the concept to its most basic, it would be this:
Get a list of people.
Set the interval for each person.
Remind the user to set up a meeting at the specified interval.
So that would be what you would want to build first. From there, you would expand into the different psychologically useful features:
The circle UI, which is psychologically satisfying for the user.
The automatic emails, which force the user into a meeting instead of procrastinating.
The streamlining of the start process, which helps guide the user through the potentially tedious task of picking out friends from a large list.
This is the simplest app and it’s all created by naming it “helloworld.” However, making an app that actually does stuff is something else. Continue to follow this blog for more details.
As started the day before, the afternoon session continued on with fleshing out the methods associated with the QuoteModel class in our database. The first step was to list all of the behaviors and then write the methods.
The instructors emphasized how simple methods are. You describe what they take, what they do, and what they return. In class, we split up into groups to write different methods that will be used in the data base.
Delete Method
I was in the delete group. We broke down the method into parts. Select the quote, confirm delete, put quote in the trash box, and hide quote on display. And we were wrong. The instructors told us to think like a computer. We’re deep into the back-end of the process. We’re at the point of actually deleting something.
The process of deleting a thing in a database. You get the id. In this method, we start out with the id, then find the entity it’s attached to, then delete the key. Apparently, if you delete a key to an entity, you essentially delete the entity.¹
In the making of a method, developers ask themselves, now, how would I break this. In this case, it would be to give a nonexisting ID number. So, we must validate that the id exists in the database. A simple “if not” (I like python, so clean.) will do the trick.
At first we raised a generic exception, but we were advised to make a custom exception, that way when we’re debugging, it will point to the exact problem and we will be better able to handle it. To make a custom exception, create a new class outside of the class (put it with the rest of your exception classes, you’ll probably have a few) and then call it in the method (as seen below).
Delete Method (this is a class method)
Kwargs
In the following method, one of the parameters it takes in is **kwargs. It’s kind of a way of saying “stuff.” The important part is the asterisks and by convention, should name it kwargs, but you can name it anything. It just means that it can handle what you throw in.
Edit Method (this is an instance method)
“You would use *args when you’re not sure how many arguments might be passed to your function, i.e. it allows you pass an arbitrary number of arguments to your function.” — and kwargs are named arguments.
One can tell that one of the instructors wrote this code. There’s really excellent code comments. Each code comment states what the method does, what it takes in and what it returns. As for knowing what expressions to use, that could be found in the NDB Datastore API. Finding what you need takes some time and knowledge about how databases work.
a list method and a sorted list method (both class methods)
Upvoting Method
This group’s challenge was to make sure that a person could only upvote a thing once and to remove the vote if the method was called again by the same user (a functionality similar to the “like button” on Facebook). Their solution was to require the username of the user to run the method and then storing that in the list and if that person’s name is already in the list they are taken out of the list.
Upvoting Method (this is a instance method)
Footnotes
My question for the instructor: What do keys, IDs and entities look like in a hierarchical diagram explaining the structure of a database? Answer: “There is no hierarchy. In a non-relational database everything is flat. Each object has one key that you can use to identify the object or you can query the object by one of its attributes.” -Joe
A couple of days ago, I painted this. It was an afternoon where I had a friend over and thought it would be a fun time to break out the acrylics. I call this painting “Leaf falling under bridge in a small town.” I was talking to Ryan, as we were trying to name it, giving examples of pretentious titles for works and I liked it and thought it fit. I was originally going to call it “Birth” because the central figure kind of looks like a fetus.
Here’s the painting underneath it. A couple of months ago, I was painting under the influence and started to see things in the painting and elaborated on that. The swooping yellow became too phallic to ignore, so I tried to make it more “kid friendly” by adding a pegasus playing chess, but that became a strangely square pepperoni pizza. I knew then that I would paint this over the first chance I got.
Joe Parente and Joey Perrott are doing afternoon sessions with the Web Coding Bootcamp. I’m learning a lot and transcribing my notes down below.
Python is an interpreted¹ programming language. It supports multiple programming paradigms, but the instructors mostly focused on the object oriented (OO) style. Everything can be understood as an object. Functions (methods²) and classes define actions and attributes for objects. There are statements (if, for, while, try, etc.) and expressions. Included data types are integers, strings, dictionaries, lists and my favorite tuple³ (mostly because it sounds cute).
I’m approaching this subject after becoming somewhat familiar with javascript so a lot of my learning is a bit of a translation from one programming language to another. Some things are the same like “append” but “prompt” becomes “raw input.” The list of Python reserved words and builtins will be good to memorize. The slicing is a little different from JavaScript Array slice() Method syntatically.
Example of a Function
Class
There was a lot to be learned about classes. Classes have attributes and methods. Def__init__ defines the construction.
“The __init__ method (init for initialise) is called when the object is instantiated. Instantiation is done by (effectively) calling the class.”
Handling Exceptions is the way Python doesn’t break when expected disconnects occur. Using a try block you can catch an error and have the program do something else.
Python works in and with other frameworks and languages:
There are two types of databases, relational and non-relational⁴. In our first python project, we’ll be working on a quote database using The Python NDB Datastore API.
First, as a class, we created a model (a well defined data structure) with just attributes. Then, we translated that into a syntactically correct model that used Property Classes such as StringProperty.
A class written in pseudocodeA class and class method
Best Practices
Name variables well (i.e. def Add (firstnumber, secondnumber).
When programming, think of user experience along the way (in their example, they used “enumerate” to make the selection from the list easier.
Except as narrow of an error as possible in try blocks.
Never store a user’s password in a database in plain text.
Do not expose your data base to the public.
Always document your code (code comments called doc strings). When you comment on methods: say what it does, and talk about the required arguments and what they look like and what it returns.
Footnotes
Compiling vs. interpreting is mostly a matter of how the work of “understanding” the program is divided up between different processes, and the line is a bit blurry these days as languages and products try to offer the best of both worlds.
Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element.
What this means
Because of this, .mouseover() is not the same as .hover(), for the same reason .mouseover() isnot the same as .mouseenter().
$('selector').mouseover(over_function)// may fire multiple times// enter and exit functions only called once per element per entry and exit
$('selector').hover(enter_function, exit_function)
2. Why am I seeing “hover” “mouseenter/mouseleave” and “mouseover”?
“In OO [object oriented] world, the two are commonly used to mean the same thing.
From a pure Math and CS perspective, a function will always return the same result when called with the same arguments ( f(x,y) = (x + y) ). A method on the other hand, is typically associated with an instance of a class. Again though, most modern OO languages no longer use the term “function” for the most part. Many static methods can be quite like functions, as they typically have no state (not always true).”