Course Recap

Well this has been quite the semester, I ultimately bit off more than I could chew with my website (though perhaps less than the final state of the site might suggest,more on that later). I certainly learned a great deal in this course, that tends to happen alot when I’m in over my head.

so a bit about where I was before the course started and where I am now. Coming into the class my experience writing applications for the web was extremely limited. I had some minimal experience with html and no familarty with css or javacript, oddly enough I did have some experience with php (well jsps and servlets, which are similar in concept)and I had a good grasp of sql and database design. I’m much more comfortable with html now, most of my issues wth that were just that I hadn’t really been introduced to css. CSS wasn’t hard to learn either, though how to use it well is a fair bit harder. Javascript was also fairly simple,it was basically like learning any other language aside from a few quirks and limitations, I mostly used javacript for my RSS reader but I had ideas for all sorts of little widgets I could have done. Where I ultimately ran into trouble was working with PHP, particularly when doing certan database operations. Specifically my mistake was underestimating the importance of having access to the server the code is running on, debugging without access to the error log is nightmarish and a mistake I intend to never make again. I had alot of trouble attempting to get an apache server running on windows and everyone I asked about it only set it up on linux, I should have just bit the bullet and sorted it out before preceding. I also regret not getting in to alot of the newer/more advanced technologies like AJAX, JQUERY, HTML 5, etc; this course threw alot at me and I had trouble absorbing it all. We also touched on the model view controller concept which I was already familiar with from java. I didn’t  stick to this format as much as I should have, I really should have written classes to handle my database transactions and temporary storage of data(this would have mattered more and more if I was using  tables repeatedly ). I intended to go back and rewrite a number of things to conform to the MVC model later, but I really should have just done it that way to begin with.

All that said I don’t want to give the impression that I disliked the class, I really appreciate that it tried to introduce us to so much instead of just covering the bare minimum. It gave me a better idea of what sort of technology and tools were out there instead of pretending the field was static. There really wasn’t enough time in a semester to really cover everything in sufficient depth (well maybe enough to cover it, just not enough to learn it) and the large number of topics might have made some of my time management issues worse (I personally tend to be alot more productive when I can really focus on one thing for a reasonable chunk of time, jumping from topic to topic too often hurts my productivity). I still think I learned a great deal more in this class than I would have if the scope had been less ambitious, even if it made me a little uncomfortable at times (actually me being uncomfortable is probably a good indicator that I’m learning something)

Week 9: Unnecessary exhaustion

For some reason I thought we were expected to have all database functions working and at least a rudimentary functioning front end version of all our websites features. I got so wrapped up desperately trying to cobble as much of that together as I could that I didn’t even bother reading week nine’s actual assignment until last night. The assignment seems to imply that we weren’t  actually expected to have it done, we just needed to be working on it and have something to show for it. This is a bit of a relief since I failed to get everything working just yet, I am however hitting myself over not reading the assignment right away. First off the actual assignment is a day late since I had no time to do it at the last minute on sunday, but more importantly I’ve completely exhausted myself from lack of sleep and probably won’t be back to normal until mid week. This is of course entirely my own fault but it is frustrating nonetheless.

Now on to catching up on the ACTUAL assignment

quiz score was 20 of 20

JQuery demo page can be found here  http://ps11.pstcc.edu/~c2230a17/demo/

in depth description of what I did on my site will be posted once I get home. I tried to document it as I went and then forgot my flash drive when the bus showed up suddenly honking furiously

 

This is sort of important. if you are reading this in class right now while reviewing my site there are some things you need to know.

I’ve been messing with a number of things, mostly related to the portfolio page. The portfolio page is supposed to show you a table containing all the companies you’ve added to your portfolio, the most recent price and performance records (from the data used to draw my charts) are listed next to it and then next to the row for each company are two buttons. the first let’s you set alerts for that company and the second removes that company from your portfolio. the page also has a dropdown menu with a list of companies and a button that let’s you add that company to your portfolio.

right now I have the combobox with the button to add companies, posts the company name you selected to a php file. that file takes the company and and your username and queries the alerts table for any matching records. If no records are returned then it creates a new alerts record with all non key fields set to their default values and redirects you back to the portfolio page.

unfortunately I don’t have the portfolio table (an actual table, not a database table) quite finished. I wrote most of the code for it but by the time I got to doing that I was too tired to figure out how to get the data from the other tables to go with the companies in your portfolio. For some reason I was trying to think up some crazy sub query to do it all in one go but I realized last night I could just run a new query for that data in each iteration of the loop that creates the table your companies are displayed in. So at the moment there is no way to get to the alerts page using site navigation, but it can be reached by typing in http://ps11.pstcc.edu/~c2230a17/alerts.php. that said you will need to be signed in to go to that page and it doesn’t work as intended if there are no request parameters

Under normal circumstances you would get there by clicking the alert button next to a record on the portfolio page. that posts to the alerts page and pulls up the entry in the alerts table matching that company and your username the values of the form fields on the alerts page are initialized to the values from the database record. if you hit the submit button then it will post to a php file that updates the database and redirects you back to the portfolio page. The alerts page is nearly finished though I have a few more lines of code to finish and haven’t added form validation yet.

That is what I’ve spent the most time on but I did a few other things. I messed with the login system a bit to only require you to be logged in for the portfolio and alerts page (also the settings that the tutorial included page but I forgot to put that up) and modified the navbar to display a login or logout option based on your login status. I also created a CSS on the front page that let’s you select a company from a dropdown menu and when you hit submit it reloads the page and displays a CSS feed containing recent news items about that company.

The charts page has not been worked on yet.

 

Even more stuff tonight

Week 8: please just kill me now

First of all this week was just brutal. It was a half week but the workload was higher than normal and I was already behind due to technical problems from the week before. Dr brown suggested I intall apache (and the supporting software like php, mysql, etc), and I followed his advice. This was my first  mistake.

I spent most of a day trying to get apache working, no matter what I tried it would say it could not bind to port. now presumeably this meant something else was using that port, turns out skype uses the same port. So I changed that, but it still didn’t help. I eventually just gave up and was now further behind than ever. I am at least making some progress now but I’m beyond exhausted

I got 20 of 20 on the quiz, these are starting to feel like a waste of time

 

Summary of this weeks progress and goals

What I’ve done

-wrote a list of all the classes, files, and pages I’ll need, how they are organized and a brief description of what they do (I also listed the functions for the classes)

this is mostly for me to help manage my workflow. I may post it later

-created tables for the feed picker, chart app, and alerts

 I do have a bit of a problem regarding how to best store Boolean values since mysql does not support that data type. I CAN do it, it’s just clunky. Aside from that I don’t know what else to tell you,  they exist and are mostly empty except for the one that supports the feed menu.

-moved navbar to its own file in the includes folder

-did the same for footer: I do need to go back and specify certain values for the footer on some pages so it will match up with the rest of the page

-Wrote classes for user alerts, chart data

                I still need to write classes that handle database operations for those classes

-Moved RSS Feed sidebar to its on file: This is very much a work in progress more on that below.

What I’m doing

-Finish up the login system

                The login system currently works, but is a giant mess. As is it just forces you to login if you aren’t currently logged in. What I want it to do is just prevent you from visiting the settings and portfolio pages and for the navbar to display a login button when you are logged out and a logout button when you are logged in (currently it displays a logout button since you are assumed to be logged in) I also haven’t gotten around to styling the welcome or settings page. I just can’t waste any more time on it right now since Dr Brown will penalize much more heavily for leaving other things undone.

-Build the RSS feed selector prototype

This is coming along reasonably well, I have a menu that lets you select a company and sends a request containing the corresponding ticker symbol. I can then append the ticker symbol to this http://finance.yahoo.com/rss/headline?s=  to return the raw feed. I now need to parse the returned feed AND figure out how to display it on the same page as the form, I seem to recall having some issues with that before. You can see the front end on my main page here http://ps11.pstcc.edu/~c2230a17/ , currently selecting a company only takes you to a blank page that displays the ticker symbol (I wanted to confirm the form worked properly) I should have it working as intended relatively soon though.

-Build the portfolio prototype

                After some thought I decided to revise how I intend to have the portfolio page look and function. The portfolio page itself should have a table that displays all companies you’ve selected with their most recent data displayed next to them followed by two buttons. The first lets you set or update alerts for that company (pressing it sends you to the alert page with that companies current settings loaded), the second button removes the company from your portfolio (deletes the database entry and reloads the page). There should also be a form that lets you add a company to your portfolio. I’m currently writing some very rough versions of these two pages.

-Build the chart prototype

I will be using google charts, more on that later

Week 7, The Database

!!This post isn’t finished just yet!!

 I’m having some issues connecting to the database using outside programs (not sure what the exact hostname needs to be when you aren’t accessing it locally) which makes things slightly more cumbersome. I’ll probably just write a temporary page with some scripts that create my tables tonight. I’ll probably try to create an RSS feed for a selected company during the break (I have the script for the feed, I just need to create a combobox with the ticker names for companies in it and plug the ticker name you pick into the script), and try to get the login system done.

Edit: Actually I need to learn how to use and read as RSS Feed, well down the rabit hole I go.

New Bitmap Image

ok so this is a prototype of sorts. the reader I have now won’t work for what I want. It’s closed source and makes you manually create the reader for each feed all you get to see is an include tag. I want something I can write the feed url into to change the feed it displays.

The feed request  is  http://finance.yahoo.com/q/h?s=ge

?s is the ticker symbol, you can change it to return a feed for whatever company you want.

Dr Brown had us make sure we could connect using out MySQL accounts, I went ahead and used it to support a phpbb forum. I need to add some stuff to the forum and change the visuals a bit but that is on the back burner for now.

More mportantly the database is supposed to store user info and account settings and probably the data used to draw my charts. I say probably because I may be able to pull it from somewhere else. A classmate pointed me to the bloomberg api and that almost certainly would work. The api is open source, the data sadly is not. Google also had an api…. had, it is no longer available. unfortunately I have not found a suitable data source just yet. I did however find an RSS feed that grabs the latest 25 news items for a company by ticker symbol which is something I wanted to do early on. I might try implementing that this week. At any rate I still REALLY need to find a datasource.

Now back to the database. I gave a brief overview of what my tables should look like last week but here is a quick recap.

the user table: key is username

UserName: String

EMail: String

Password: String

The User Alerts Table: key is username + company

UserName: String

Company: String

PFloor: num

PCeil: num

Split: boolean

BBack: boolean

Then the market data table (if I have one) use company name and date as it’s key and then has one field for each kind of data I want to store (price, dividend, market cap, P/E ratio)

Quiz score was 20 of 20 again

*Update: I may have found something that will work, yahoo finance might work and I have a few other potential sources to look into.

 

Site to do list

  • finish log in system
  • implement portfolio page/alert system
  • cookies
  • implement charts
  • by company rss feed (select a ticker symbol from a combobox,then it pulls up a list of recent news items for that company)
  • redo front page article format
  • twitter feed for article updates
  • customize forum to fit the site
  • clean up the site in general, add various details etc

Week 6 peer review follow up

First things first php quiz score was 20 of 20

Ok so I’ve made it through the first peer review and I’d like to offer some feedback on some of the more common responses

-amateurish visual design, switch to bootstrap.
I agree. I felt the same way, I just wanted to learn a bit on my own first.

I got a fair bit of feedback on color scheme and contrast as well. some of these issues had occured to me but I thought I had done
“enough” to adress the issue. I guess not, so I’ll revisit that.

login page looked the worst
Yeah, I really didn’t put much effort into that, I just wanted the page to be there. I was kind of surprised so many people payed attention to it. It isn’t staying that way.

-I need better documentation.
I really do, I am inexcuseably backwards about that sort of thing sometimes. I have a bunch of stuff scrawled in notebooks, I’ll go ahead and post the relevent bits of that.

-The portfolio page should be available from all pages.
yeah that is probably a good idea.

What am I working on now?

1. Redoing the entire site using bootstrap. I needed to do this but I’m trying not to spend too much time on it. For Now I’m just going to use a jumbotron page templet and gradually customize it as I get spare time.

2. Reading up on PHP. I’ve never used PHP before but I have worked with JSPs and Servlets which is the Java equivalent, I already understand the concept I just need to figure out the syntaxt.

3. Setting up a forum usng phpbb

4. Creating a login system

_________________________________________________________________________

Below are some of my notes; I haven’t transferred them all from my notebooks just yet so check back later.

_________________________________________________________________________

How are alerts handled
1. once a day the database for stocks is updated
2. once the updates have been made we begin checking alerts for each user account
3. for each stock with alerts you make a query
select*
from Stocks
where name == company && date == latest
4. store the returned tuple as a object
5. check each alert condition against the corresponding variable
6. repeat this process for each company with alerts
7. repeat 3-6 for each user account

if any of the alerts return true the site sends an email to the user. To avoid sending an email for every alert triggered, the e-mail is only sent once all the user’s alerts have been checked
1.If any return true we send an email beginning with a generic opening message
2. then for each alert that returned true and string describing the alert is appended to the e-mail body

_________________________________________
database entries for stocks look like this
Table Stocks
Name* String
Date* Date
P_E Number (it’s a ratio, debating the best way to store this)
Price Number
Dividend Number
M_Cap Number

*these two form the primary key
entries for user alerts should probabably look like this

username* string
company name* string

these form the primary key

P_Cap: Number
P_Floor: Number
Fed_Alert: Boolean
Split_Alert: Boolean

then there is a field for each alert they can select, if they haven’t selected that alert it will be false for boolean fields or null for number fields.

How do charts work?

well the concept is pretty simple, your just drawing lines between a series of points. For any given chart you need three pieces of information; the stock name, the statistic you selected, and the time range. You then query the database based on that

Select date, stat*
from records
where name == name && date >= beginning date && date <= ending date

*whichever one you selected

that gets you a series paired dates and values.

the dates determine the x coordinate and the value of the selected statistic determines the y coordinate. I have a few unresolved issues to address however.

-what if there are more datapoints than the width/height in pixels of the canvas

-the value of the y coordinates for varying stocks and statistics may vary wildly, but I want charts to be comparable to eachother regardless of what they measure. how can I best accomplish this?

Each of the three pieces of information is selected from a seperate form. The stat is selected from a set of (mutually exclusive)buttons on the left side of the chart, the time range is selected from a set of buttons (also mutually exclusive) at the bottom of the chart. The stock is selected from a dropdown menu or… something, I’ve not quite settled on how best to handle that (a dropdown is fine for the limited number of stocks included in my version but would become unwieldly if the list was more comprehensive)

selecting any one of these redraws the chart, which brings up an issue I had last year

When I was using JSPs and servlets I ran into a bit of an issue when I wanted to include information in a servlet request other than user input. I couldn’t figure out how to get it to take anything that wasn’t a field in the form that sent the request. I came up wwith a workaround where I added an invisible field that the JSP set the value for (in that case it set the value to the name of the current user, but it could be anything). PHP might be different but if not I’ll have to use something similar(store the last selected value for each of the three fields and paste the relevent two into the invsible fields on each of the three forms when the page loads. Everything has a default value when you first visit the page).

Week 4, now with content!

These first three weeks have been less productive than I would have liked with several distractions followed by a nasty cold and a general post summer funk. But with my cold clering up I am suddenly far more eager to dig into my work, I guess nothing cures malaise like a brief period of total misery.

Now onto the site. I looked it over and realized it looked like total crap. I was using images for the header and sidebars and the header image was really too gaudy and didn’t really match the rest of the site, the site just looked crudely slapped together in general. I don’t have any decent image editing software so my options were a bit limited.So I’ve been going through and pretty much redoing the entire layout.

I’ve also gone ahead and created most of the pages the final site will use, did some wireframe mockups for the chart page and inserted them as images to act as placeholders, and I’ve been working on lots of other little touches to make the site look more polished. So I’ve mostly just been rewriting a bunch of CSS and HTML, I’ve not added any scripts to the site just yet (I haven’t really done anything that needs it yet). I’ll probably try to shoehorn something in before the weekend is over (I thought of doing a button to change stylesheets, but I’m still still working on the first stylesheet, I could maybe create different verions of the mockup and have a button (or several) that changes the image so it looks like you switched to different charts, but that might be too much effort for something I’ll just be throwing away. I’ll probably think of something, time permitting)

a comparison of the site layout this week to last week

before-after

link to the current site http://ps11.pstcc.edu/~c2230a17/index.html

I forgot to post this last week, but my javascript quiz score was 19 of 20

Week 3

Note: I am sick this weekend so forgive me if any of this looks a little disjointed or incoherent, I’m having trouble maintaining my train of thought at the moment. I’ll make sure to clean things up later if necessary.

I believe we were supposed to think about site layout this week, we also looked at page layouts for mobile devices since they are likely to be the most important consideration going forward.

Not having a smartphone or similar device, I haven’t really seen enough sites on mobile devices to recognize common patterns. But from what I have seen I feel there is really only one major guideline, try to render things down into small chunks that remain useful and coherent. This approach will often lead to some loss of functionality and you will have to ask yourself what is necessary to core functionality and what isn’t. If you can’t break a page down like this without serious damage to it’s primary function then it might not be suited for use on mobile devices (or maybe you didn’t try hard enough, it could be that).

Here is an example mockup of my graphing page simplified for mobile devices. It retains the primary functions of the performance graphs, everything is clearly labeled with obvious functions, and the layout is clean and simple. On the other hand a layout like this makes it alot harder to compare multiple charts side by side and probably pushes me to drop a number of features (though I could probably include most of them if they were tucked away in a popup window or something)

quick mockup

 

Now on to overall site layout. The site should consist of the following pages

A main page- explains the site and hosts a few articles

A  graphs and statistics page- where you can view the relative performance of different stocks, based on a variety of metrics, over different time periods

A login page- self explanatory

A user settings page- once logged in you can set user preferences, may be combined with…

Portfolio and alerts page- where users select what stocks to track and set alerts

A forum- Optional, but why not. seems like every site has a forum

twitter feed- I really don’t care about twitter but I suppose I could set it up to automatically tweet site updates.

Week 2

well we’re on to week 2. It’s been a short week due to the holiday. I’m actually slightly behind because I spent some classtime fiddling with the file transfer client instead of following along with the lesson (to be fair I was more concerned with the prospect of not being able to access the server off campus than having to review the CSS material a couple of extra times). At any rate I should be caught up by sunday and most of my other work is out of the way.

currently I have a generic 3 column front page mockup, I’ll probably be redoing it entirely since I really haven’t done much (external in particular)css before and kind of slapped that layout together.

My previous experience with web applications mostly involved JSPs and servlets, I’ve done some server side processing. input using forms, and database queries/entries/updates using MYSQL. None of that really involved making things look pretty.

Also here is this weeks quiz.

quiz2

 

Friday update: I’ve redone the page from scratch (as though there was much to redo). I’ve moved most of the formatting to the style sheet(s) I’m building so far it’s mostly text formatting and column layout. I’ve also inserted some background images for the site header and sidebars, I added those directly to the HTML but they could just as easily go in the style sheet. I’m on the fence about which one is more appropriate. I suppose I need to add a few extra pages to the site, though they’ll basically just be more placeholders at this point.

Saturday update: Today I’ve continued looking into css (really just anything related to the visual elements of the site layout). There were a few things I wanted to figure out how to do, one of them was getting the sidebars to run the full height of the page regardless of the content they contained. The short answer is you can’t really, you have to fake it with the page background. I’ve added a second placeholder page for graphical data on selected stocks, the  meat of the site as far as coding goes will likely be related to this page though I might want to divide it into several pages depending on how much stuff I actually get around to implementing  (I haven’t really finalized what the “site map” should look like just yet). I also added a grand total of one offsite link, I’ll add a few more in the next few days.

 

I almost forgot, I really need to start looking at what other people are doing.

One more note: I will not have computer access sunday

Web development term project

I’ve settled on a website geared towards helping casual investors pick stocks, while I’m certainly no expert in the subject I am a firm believer in the idea that you can gain a basic understanding of any subject with access to high quality  tools and information.

I can’t quite recall when this idea first came to me but I vaguely recall someone making stock selection sound far harder than I thought it really was and thinking that it was really just a matter of having access to a few relevant facts about a company, how it performed historically, how it compares to it’s peers, and some basic knowledge about stocks(or other assets) and economics. Which got me thinking about a number of applications and resources that would help people do that.

A brief and likely incomplete list of resources

a collection of relevant data on publicly traded stocks and possibly other assets (other asset types such as commodities, currency, derivatives, bonds,etc are tricky and can be volatile or unpredictable. I am less confidant that I could provide much useful information about them)
for stocks this would include things like
-Price Earnings ratio
-share price including adjustments for (or at least notice of) events like stock splits, buybacks, mergers, etc.
* this should likely include the number of shares in circulation
-dividends

each of these should have regular data-points over a long period of time. this data is used to create graphs tracking performance over different time periods
-preferably you can display multiple graphs to compare different statistics for the same company or company different companies to each other

-Tracked stocks will be searchable by name, ticker abbreviation, the index they are traded on, and maybe sector.

-I’d also like to build in a few statistical analyses tools to help spot certain things like price volatility automatically (perhaps as a search option).

-the charts should also mark significant events such as recessions or major fed moves.
once a user creates an account they can build virtual portfolios to track the performance of multiple stocks and can set alerts to notify them when certain conditions are met (such as a stock moving above or below a specified value, rapid changes in a stocks price, splits, buybacks, etc.). The site will could also have a regularly updating article section, or maybe just a few basic primer articles and useful links.

A brief note on actually building the site: I am not looking forward to designing and creating the databases required for this project

 

Oh and here is the quiz screenshotquizscreen

 

I’d like to describe this more thoroughly  but I am stuck dogsitting my brother’s new chocolate lab puppy while he is in ton for the weekend and I keep having to stop to deal with her never ending attempts to chew me and everything I own into tiny pieces. Further updates later I guess.

 

Minor update: I am having issues with connecting to ps11 using filezilla so I can’t set up the landing page just yet. I’ve e-mailed professor Brown, hopefully I’ll get a response before I get back from work and can set it up before midnight.