e168f08: Final Project Proposal, and about the Final Project
philadelphia
· 1 year ago
Hi,
The project I am envisioning requires some geometry functions within the DB. MySQL has this functionality. Sqlite3 does not. May I use mySQL?
Specifically, I'm integrating geo-kit functionality for a Google Maps mashup which will provide dynamic user information on a live map. But I want to include asynchronous search functionality to find map points (stored in the DB) within some defined distance, and this is most easily accomplished via a geo-kit call which leverages functionality in the DB. While I could write the functionality in Ruby, it will not function as efficiently, and it will be an overly complex rewrite of a function which is available directly on mySQL.
Please let me know. Mike
jgn
· 1 year ago
Write it up in your proposal, and describe the trade-offs for doing it with MySQL vs. custom Ruby + Sqlite3. If possible, include time estimates for doing it each way.
If you can justify it, it may get approved.
swithin
· 1 year ago
Conceptual Overview of Project: Spiritual Measurement Platform - Codename "InterEthos"
Create a system of data tables to allow users to create and apply taxonomy indexes (ie. a "folksonomy" system) against the human spirit of people. At its core the data system must have the flexibility to allow users from different cultures to have totally different ways of thinking about spirituality, taxonomy structures, and the valuable outputs such a system could / will provide.
Subsystem of three classes of user identities: 1) for non-registered users (user identities created by parties other than the owner, and not claimed or validated by the owners), 2) for registered users (owners create and pro-actively link to their own identity), and 3) verified users (owners create, verify, and maintain their identity with a structured regularity and protocol).
XML profile calls from browsers visiting remote websites where mentions are made of people measured by the system, along with displays in sidebar of the browser depicting the "ethos" of said people.
Browser plugin that allows users to input a list of "people to watch for", which pulls the profiles and allows manipulation of (posting to) those profiles when on relevant content. Posting to other people's profiles will require that the users be registered in the system, at the very least (there may be different levels and measurements of how users can be "registered with the system").
Once a core data platform is created and accepted as being valuable, then a system to replicate the server into a network of servers will be created and deployed. The ultimate goal is to create a cloud of servers, which stripe the overall data, and which preclude the possibility of one entity owning and/or controlling the platform.
swithin
· 1 year ago
Sorry to have used the word "classes" above in "three classes of user identities". I do not mean there are Ruby classes. I should have said "three types of user identities".
One other concept: One far out end-goal is for a person to be able to walk into a physical ballroom filled with a hundred people whom s/he has never met, and be able to immediately "assess" who is in the room. Maybe the person is looking for "like-minded" people, or people with similar skills, or people with a similar Myers Briggs profile. Maybe the person is looking for a "diamond in the rough" person who can satisfy a particular need in a current project.
Of course the same situation might happen in a virtual reality ballroom, similar to Hero's trip to the bar in the book "Snow Crash".
jgn
· 1 year ago
It's funny, but "type" also bears some technical freight. So how about "categories"?
The ballroom app sounds like a lot of fun.
I am an old friend of Neal Stephenson's. Great guy. Scary smart.
DanielS
· 1 year ago
A quick question. In the Use Cases section above you say:
"In large part this is where your FP proposal will talk about controllers."
Do you want us to actually list the controllers? If so what sort of information are you expecting? I have a similar question about the "Pages" section and the views and actions.
jgn
· 1 year ago
Sorry I didn't get to this sooner -- You do not have to list explicitly your controllers, though it may certainly help you plan your work.
If you controllers diverge from the typical CRUD model, then it could help your TA understand better what you're trying to do.
Jody
· 1 year ago
A worker has many skills through the worker_skills table.
I'm trying to save a worker.
How can I write a worker validation that will make sure the new worker has at least one skill in the worker_skill table? In the controller, I"m creating the skill, and then creating the worker, then creating the worker_skill record.
I thought validates_presence_of only works on columns in the actual table that you're creating so I'm a bit unsure how to approach this one.
Jody
jgn
· 1 year ago
I think you would have to write a custom validation -- remember that you can implement validate and do anything you want (e.g., query other tables). If you find an error, you add it to the errors object: http://api.rubyonrails.org/classes/ActiveRecord...
(This is discussed in AWDR.)
Jody -- Sure you need this? Suppose that a Worker has already been created with a particular skill, but for whatever reason, it's determined to be an error. You might want to remove the skill, save the worker, and come back to it later, to re-add an appropriate skill. In this case, it is easy to imagine a worker with no skills. So . . . don't worry about this? If a Worker has no skills, you would report this in the UI.
Jody
· 1 year ago
Well, it's probably fine that way I suppose. In my app's terminology a skill is one of the services that a company offers that the worker can do.
We wouldn't have a worker that belongs to a company but doesn't do at least one of the company skills but I guess letting them add it later and catching it in the view is a perfectly good solution that makes this much easier for me.
Thanks!
jgn
· 1 year ago
Believe it or not, when you feel as though a supposedly dependent object is "required" it pushes you in the direction of your primary object being the join table. I.e., worker_skills.
I.e., if the customer (web application user) is only interesting in skills, and a worker has no skills, then the customer doesn't care about the worker.
Jody
· 1 year ago
Yep, that's part of the issue. For example, in a hair salon, they wouldn't a worker who can't do either cut or hair color but the customer really cares about the worker as much as the skill.
Jody
· 1 year ago
Ahh, I realized why I started going down this road in the first place now.
My app is multi-tenant meaning that skills belong to workers through worker skills but workers actually belong to a particular company. The only way I can associate the skills with the company are if there is a linkage through a worker. It's kind of flawed in that regard.
Is there a way to associate skills, to a company, even though it would be through 2 tables (workers, then worker_skills), not one?
Jody
· 1 year ago
I think I'll add a company_id to the skills table instead of trying to do all the joins though the multi-level nesting. Not elegant but it will work well.
jgn
· 1 year ago
Exactly. I don't think it is inelegant -- why? Because of the sentences above:
A worker has skills. A company has skills.
That's reality. Let the schema follow that at the start. You may very well find eventually that a company has "company skills" which are different from "worker skills." But that's for Version 2.0 after you get VC funding. :-)
jgn
· 1 year ago
First off, the object of the final project is to be "done," so don't let these modeling details get in the way. Your grader will be interested in whether you have satisfied the promise of your proposal, but not whether the schema is perfect (for one thing, that requires domain knowledge, and the staff doesn't have domain knowledge in all of the student project areas).
My experience is that it is best to write sentences about your entities and see what comes up. Here's what I am hearing:
There are skills. Companies have skills. Workers have skills. [NOTE: The sentences do sound a bit funny; "skills" is not a word I associate with companies, but "capabilities" is a word I do associate with both companies and workers.] Workers belong to companies. [only one?]
Now, I might engage a company for a particular skill. Do they, at this moment in time, have workers with that skill? I don't know. But it seems entirely reasonable to me to imagine a company that tells me that they have a skill, but for whatever reason can't fulfill work in that skill at the particular time.
There is nothing wrong with have a join table between skills and companies and a 2nd join table between skills and workers. It must means that to answer the question, can company X actually provide help in skill A, you have to do a bit more work. So say to yourself: Can I provide a list of companies with workers right now with a paricular skill? YES, that should be pretty easy. It's going to look like:
And then get the unique companies. Something like that.
For the final project KEEP IT SIMPLE. I would STRONGLY advise having only one model (EITHER Company or Worker) that is ultimately associated with Skill. The reason is that if there are multiple, you are going to have to be very careful to define your associations. In the CCC example, you will see that we defined maybe too many associations, and had to define associations where we specify the class name, etc., and it got more complicated than we would have liked (which drove last year's students a bit mad).
Jody
· 1 year ago
I'm having a bit of a tough time getting the observers to work properly. Should this be alerting me when the text field changes?
The project I am envisioning requires some geometry functions within the DB. MySQL has this functionality. Sqlite3 does not. May I use mySQL?
Specifically, I'm integrating geo-kit functionality for a Google Maps mashup which will provide dynamic user information on a live map. But I want to include asynchronous search functionality to find map points (stored in the DB) within some defined distance, and this is most easily accomplished via a geo-kit call which leverages functionality in the DB. While I could write the functionality in Ruby, it will not function as efficiently, and it will be an overly complex rewrite of a function which is available directly on mySQL.
Please let me know.
Mike
If you can justify it, it may get approved.
Spiritual Measurement Platform - Codename "InterEthos"
Create a system of data tables to allow users to create and apply taxonomy indexes (ie. a "folksonomy" system) against the human spirit of people. At its core the data system must have the flexibility to allow users from different cultures to have totally different ways of thinking about spirituality, taxonomy structures, and the valuable outputs such a system could / will provide.
Subsystem of three classes of user identities: 1) for non-registered users (user identities created by parties other than the owner, and not claimed or validated by the owners), 2) for registered users (owners create and pro-actively link to their own identity), and 3) verified users (owners create, verify, and maintain their identity with a structured regularity and protocol).
XML profile calls from browsers visiting remote websites where mentions are made of people measured by the system, along with displays in sidebar of the browser depicting the "ethos" of said people.
Browser plugin that allows users to input a list of "people to watch for", which pulls the profiles and allows manipulation of (posting to) those profiles when on relevant content. Posting to other people's profiles will require that the users be registered in the system, at the very least (there may be different levels and measurements of how users can be "registered with the system").
Once a core data platform is created and accepted as being valuable, then a system to replicate the server into a network of servers will be created and deployed. The ultimate goal is to create a cloud of servers, which stripe the overall data, and which preclude the possibility of one entity owning and/or controlling the platform.
One other concept:
One far out end-goal is for a person to be able to walk into a physical ballroom filled with a hundred people whom s/he has never met, and be able to immediately "assess" who is in the room. Maybe the person is looking for "like-minded" people, or people with similar skills, or people with a similar Myers Briggs profile. Maybe the person is looking for a "diamond in the rough" person who can satisfy a particular need in a current project.
Of course the same situation might happen in a virtual reality ballroom, similar to Hero's trip to the bar in the book "Snow Crash".
The ballroom app sounds like a lot of fun.
I am an old friend of Neal Stephenson's. Great guy. Scary smart.
"In large part this is where your FP proposal will talk about controllers."
Do you want us to actually list the controllers? If so what sort of information are you expecting? I have a similar question about the "Pages" section and the views and actions.
If you controllers diverge from the typical CRUD model, then it could help your TA understand better what you're trying to do.
I'm trying to save a worker.
How can I write a worker validation that will make sure the new worker has at least one skill in the worker_skill table? In the controller, I"m creating the skill, and then creating the worker, then creating the worker_skill record.
I thought validates_presence_of only works on columns in the actual table that you're creating so I'm a bit unsure how to approach this one.
Jody
(This is discussed in AWDR.)
Jody -- Sure you need this? Suppose that a Worker has already been created with a particular skill, but for whatever reason, it's determined to be an error. You might want to remove the skill, save the worker, and come back to it later, to re-add an appropriate skill. In this case, it is easy to imagine a worker with no skills. So . . . don't worry about this? If a Worker has no skills, you would report this in the UI.
We wouldn't have a worker that belongs to a company but doesn't do at least one of the company skills but I guess letting them add it later and catching it in the view is a perfectly good solution that makes this much easier for me.
Thanks!
I.e., if the customer (web application user) is only interesting in skills, and a worker has no skills, then the customer doesn't care about the worker.
My app is multi-tenant meaning that skills belong to workers through worker skills but workers actually belong to a particular company. The only way I can associate the skills with the company are if there is a linkage through a worker. It's kind of flawed in that regard.
Is there a way to associate skills, to a company, even though it would be through 2 tables (workers, then worker_skills), not one?
A worker has skills.
A company has skills.
That's reality. Let the schema follow that at the start. You may very well find eventually that a company has "company skills" which are different from "worker skills." But that's for Version 2.0 after you get VC funding. :-)
My experience is that it is best to write sentences about your entities and see what comes up. Here's what I am hearing:
There are skills.
Companies have skills.
Workers have skills.
[NOTE: The sentences do sound a bit funny; "skills" is not a word I associate with companies, but "capabilities" is a word I do associate with both companies and workers.]
Workers belong to companies. [only one?]
Now, I might engage a company for a particular skill. Do they, at this moment in time, have workers with that skill? I don't know. But it seems entirely reasonable to me to imagine a company that tells me that they have a skill, but for whatever reason can't fulfill work in that skill at the particular time.
There is nothing wrong with have a join table between skills and companies and a 2nd join table between skills and workers. It must means that to answer the question, can company X actually provide help in skill A, you have to do a bit more work. So say to yourself: Can I provide a list of companies with workers right now with a paricular skill? YES, that should be pretty easy. It's going to look like:
Worker.find(:all, :include => { :companies, :skills }, :conditions => [ 'skills.name = ?', needed_skill ])
And then get the unique companies. Something like that.
For the final project KEEP IT SIMPLE. I would STRONGLY advise having only one model (EITHER Company or Worker) that is ultimately associated with Skill. The reason is that if there are multiple, you are going to have to be very careful to define your associations. In the CCC example, you will see that we defined maybe too many associations, and had to define associations where we specify the class name, etc., and it got more complicated than we would have liked (which drove last year's students a bit mad).
<% observe_field("new_customer", :frequency => 0.25, :function => "alert('Element changed')") %>
<%= text_field_tag "new_customer", '', :size => 30 %>