Wednesday, May 13, 2015

Making a simple webapp using flaskr

Most flask examples use a blog as an example. This is probably very similar (and I'm pretty sure 90% was from another tutorial) but I just wanted to show some differences.

First we create a schema, and make a database

schema.sql looks like this.
Before running that you'll need to create the initial db which can be done via the command line in the same folder as your flaskr.py file
sqllite3 flaskr.db < schema.sql

 at the command line type python
>>
from flaskr import init_db
init_db()
This *should* create the first intance of the database.

finally when you're ready, start the following file with
sudo python flaskr.py

So here is the code to run for the simple server(flaskr.py)



So if you want different data stored off, you can change your schema, and the insert/select statement.

If you don't care about storing data, (you just want to perform actions) you can ignore most of the sql related items, and just read the data and perform whatever operation

For example

Now that we have a working app.

If you want to see the app get "data"
go to your browser and type in your ip address (if you did your IP and port as your values) and the data to send for example:
http://192.168.0.1/add?text=yourock&title=thistutorialhopefullyhelps

So now on your python script
request.args.get('title')  should pull out "you rock" and
request.args.get('text') should pull out "this tutorialhopefullyhelps"


Good luck!


This is the site that I had most of my tutorial from:
http://flask.pocoo.org/docs/0.10/tutorial/schema/#tutorial-schema
And the last example some came from here:
http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask

Monday, February 16, 2015

10 Tips for an Awesome Technical Resume

I've been asked a few times about providing tips regarding resumes. I'd like to provide them here.

  1. GPA is a must for some companies, keep it on if it's above 3, off if it's below (but know who you're applying to, if they care about GPA then you'll need to give it eventually).
  2. Don't use your school's email address on your resume. If companies don't have any openings but like you, they may not be able to get in contact with you in 2 years when they do if you use myname@unm.edu on your resume.
  3. Personal Email addresses should be professional looking. If you have an email account that has inappropriate words in the name, email is cheap, get a new address, you can link to your main account if you need to, but don't put dogpoo@gmail.com for your contact info.
  4. Quantitative, Quantitative, Quantitative. I think it bears repeating.
    I supported Einstein creating the Theory of Relativity, did you get him coffee, or tell him the secrets to the universe. I might hire the person but I would need to know if they make good coffee, or change the world first.
  5. Anything that is older than 8-10 years not related to what you're applying to, remove it. Generally if it's not useful to show a potential employer you had a paper route, leave it off.
  6. I would generally exclude Office, and Windows and probably iOS as "skills" employers expect you to know those two, and you don't need to explicitly state it. Linux is good to mention somewhere.
  7. Your intro shouldn't be "I want job x, with company y for reason z". That's boring and most hiring people are probably going to jump over it, instead opt for an intro. Tell people about yourself and what things you're interested in (this should typically be someone related to the job).
  8. Be concise, keep the resume to 1 page. It's amazing how many new grads straight out of college have bolstered their resume to 4 pages. I would dare say, with almost any amount of experience aim for 1 page.
  9. You don't need to break up your current job by project, and/or year.
  10. Remove redundant data. If you've written requirements on 3 projects, specify only that. You don't need to specify all 3 projects and what you did for each specific one.


If you want to take a look at my "sort of living" resume check out http://onaclovtech.com/
Above all, a resume is a piece of paper that attempts to give you an opportunity to talk to someone in person. Your goal is to give people something easy to read, that makes them want to talk to you at the end (or even mid ways through ;)).