Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

10-01-2013 , 08:01 PM
Can you explain why you wouldn't have the data model be:

Code:
has_many :supervisees, class_name: 'User', foreign_key: 'supervisor_id'  (or whatever you want to call it)

belongs_to :supervisor, class_name: 'User', foreign_key: 'supervisor_id'
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:03 PM
Or do clients have many different admins through multiple projects? I'm assuming that you have an admin to watch over a given client (so they watch many) and one client belongs_to a given supervisor admin?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:05 PM
Then you could keep the structure of the User model as quite lean, and have different profiles for when you need to get respective admin/client information, or just deal with a fat database model and store it all in there.

Two different profile models would allow you to keep the profile info namespaced, and the user shared info in the main app.

Or you could just duplicate the user code in different namespaces, not a big deal.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:10 PM
It's the second one where an admin has many clients but a client belongs to an admin. The admin in this case is more like "consultant" or site owner. The admin is acting as the company and the clients are customers.

Then a project is started by the admin which is linked to a customer. The project belongs to an admin AND client and the client might have multiple projects going on with the same admin and each project would be separate.

Edit:
The clients don't really need much info about the admin so the admin really won't have many fields. However the admin needs to know a lot about the client (full billing address, potential billing info, the whole 9 yards). That's why I didn't want to share it. Also I'm not really sure what your code sample does. I never used the class_name or foreign_key values like that.

Last edited by Shoe Lace; 10-01-2013 at 08:15 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:20 PM
Just allows you to define self-referential relationships. So a user can belong_to and have_many :users at the same time.

It's a bit weird, and might push in favor of a second class. I'm playing with something on my text editor, will see what I come up with.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:24 PM
I'm a bit rusty on these type of things, but I think code like this would give you a many to many relationship of admin to clients, through the project model.

You'd probably have to add some custom validations on these models to make sure the right user was getting the right association, etc.

Code:
class User < ActiveRecord::Base
  has_many :overseen_projects, class_name: 'Project', 
    foreign_key: 'admin_supervisor_id'

  has_many :projects, foreign_key: 'client_id'

  has_many :clients, through: :overseen_projects, class_name: 'User', 
    foreign_key: 'client_id'

  has_many :admin_overseers, through: :projects, class_name: 'User',
    foreign_key: 'admin_supervisor_id'

  has_one :admin_profile

  has_one :client_profile

end

class Project < ActiveRecord::Base

  belongs_to :admin_supervisor, class_name: 'User', foreign_key:
   'admin_supervisor_id'
  belongs_to :client, class_name: 'User', foreign_key: 'client_id'

end
edit: I changed one boo boo in the code.

Last edited by Nchabazam; 10-01-2013 at 08:30 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:32 PM
I think I have to read up some more on self ref models. I only watched that one railscasts video the other day. I sort of see what's going on, thanks. The admin_overseers is throwing me off, is that like the inverse of the clients?

Would you keep the client profile completely denormalized then?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:35 PM
Had to wikipedia denormalization.

I don't know/pay attention to performance nearly as much as you do, but it strikes me like creating one more join when you periodically need the client information is better than storing it all in one blob.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:37 PM
Yes, admin_overseers would be the opposite of clients.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:38 PM
I wasn't thinking about it from a performance POV. It's possible clients might have multiple forms of payment so a single client_profile model/table might be weird to deal with because the multiple amount is unknown.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 08:43 PM
I think you could probably store a bunch of different payment types off of the client_profile

so a client_profile has_one :stripe_information, has_one :credit_card_information

etc

I like keeping the code as easy to read/understand as possible, so often I may go a bit overboard with tables. I need to read up on database optimization stuff at some point though, but I doubt I'll ever be spearheading an app where that really starts to matter, so meh.

Running out now, but PM me if you have more questions. Good luck!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 10:51 PM
Quote:
Originally Posted by Larry Legend
Perhaps the best one?

relevant link and keeping the troll alive!
I was hoping that was kitkat, but what of dreaming?

I don't like that small box scrolling at all. The words rush up too fast for me to see them, then I have to scroll up and down just to find the sweet spot.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 11:46 PM
Quote:
Originally Posted by clowntable

Also...
Brag: 1.5/2 conference papers I submitted have been accepted (one was rejected but accepted as a shortened extended abstract so I'm counting that as 0.5)
Beat: No major conferences, Finland/Slovakia will be cold during November, not all that happy with the papers actually kinda rushed etc.
Variance: Might link PDFs after the conference, 0.5 one on is on our didactic concept for AI, accepted one on the architecture of our game server (Prolog+Java/Tomcat+HTML/CSS/JS+PostgreSQL)
Yes, I want to read it thought I'm too stupid to get it anyways.

Quote:
Originally Posted by Xhad
So I think I've found a new low in software defaults. I "upgraded" my phone to iOS 7 last week. After missing some important calls, I dug around and found out that the "Do Not Disturb" setting was changed to be on by default. The "Do Not Disturb" setting suppresses most incoming calls and messages. So my phone defaulted to not taking calls.
"It just works." Except I wonder what "it" refers to at times.

Quote:
Re: dark patterns - Is it possible to quantify short-term conversions vs. long-term, particularly for things like ad-based sites where long-term users are a big deal? I have two Google+ accounts that I didn't even want, yet I go out of my way to avoid Google's ads out of spite because of this situation.

I suppose being vague in your signup process is a different matter because it infuriates fewer people, but I wonder if anyone has taken numbers on "I'm looking to jump ship the second someone who isn't a jerk offers a similar product" vs. "this is a cool thing made by cool people" or if it's even possible to do so.
The problem with measuring this metric is that, intuitively, one would think it has a horrible long-term gain, so the majority of companies that employ these strategies would fail. The problem is that the success stories would eclipse the failures and the failures would be chalked up to other factors.

I think though, that Microsoft, and in particular Internet Explorer is illustrative of this fact. Here, users are locked into using sub-optimal browsers at work or on XP, and it is apparent there is a backlash. Even MS puts out ads admitting they sort of screwed up, and (IDK?) IE 10 is a modern level browser. I wouldn't know, as my personal trust, and perhaps many other people who don't really care to ponder it, has been shattered for life, or something very close to it.

Quote:
Re: flat deisgn - Is there any data or even a single usability expert's opinion in favor of it? Not a rhretorical question, it just seems to me like a sin committed by graphic designers optimizing for screenshots and not users, but I'd be interested to see an opposing view.
I don't know either way. I prefer minimalism over anything else, though not to the extreme of default bootstrap.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 11:50 PM
Quote:
Originally Posted by Larry Legend
Good thoughts here.

If you are not already familiar with the way Google (and Mayer specifically) views design, this is a good read: http://www.fastcompany.com/1403230/g...designers-data
Interesting read indeed. I wish she was still at Google, maybe browsing youtube wouldn't feel like a chore and gmail would make some modicum of sense. I guess not having someone to say no isn't good for Google?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-01-2013 , 11:57 PM
Quote:
Originally Posted by gaming_mouse
Can't remember if I or anyone else has posted this here, but I thought this was a good talk about the bolded insight:

http://businessofsoftware.org/2013/0...t-development/

Her idea is that what we really want to buy is a new a vision of ourselves, a different and better life. When you go all the way to the bottom, that's what it's always about. It rings true to me.
I watched that one about 2 months ago. She is a good speaker, but I don't recall much about the "how" of doing all of that.

These two videos always interested me in how to think about this stuff:

Rory Sutherland: Life lessons from an ad man

Malcolm Gladwell Choice, happiness and spaghetti sauce

As for the Sinek lecture, yes, it is pretty good. If you are interested, you should check out one of his 20 minute lectures. The industry that surrounded his thoughts sort of worked like this: figure out who you are as a company first, then figure out the customers you appeal to, which certainly places many assumptions on its ear. I do think that there is much to be said about this though, and in many ways, I agree. It is often obvious*, especially with the new social stuff, that they don't really have a clue what they represent or who they are as a company and a culture.

*By obvious, I mean that this is what I perceive, and therefore it must be true to me at least. I suppose many others felt that way if they are no longer in business. Seriously, every one I meet at a meetup is working on a new social media / food app.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2013 , 01:21 AM
My fam owns a landfill and I recently started working part time at one of the transfer stations. They use a scale (weight tronix wi-130) at this site to weigh the garbage trucks as they come in and once again as they leave to get the tonnage. I run the scale and write down the weights on a printed-out spreadsheet forum. The scale has an old-school looking outlet which looks like it could be connected to an old computer but as it is now, is hooked up to an ancient looking printer type thing that prints out the gross, tare, and net weights (which I then write down). I'm sure I could convince the fam to pay me to write up a program so that all this info could be auto-inserted into a database or spreadsheet of some sort. Problem is, this scale looks like it was created long before USB and I'm having problems trying to figure out how to get this info to a computer. And even If I get that far, how to parse what it sends into real data in say, C# or something easy like that. If anyone is bored I would love some advice b/c I could really use a project like this to keep me busy =P

The scale:
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2013 , 07:29 AM
Quote:
I think you could probably store a bunch of different payment types off of the client_profile

so a client_profile has_one :stripe_information, has_one :credit_card_information
Ok cool, that's what I was thinking too. I'm not too concerned about the performance. If the database doesn't get hit too often then it's not a big deal. I don't think these profile grabbing queries will be too expensive either and they won't change too often at all.

Last edited by Shoe Lace; 10-02-2013 at 07:37 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2013 , 01:47 PM
yeah so this "full legacy browser support" css grid system that I'm using (mostly ignoring) for this project I'm working on has the following code:

​​
@media screen and (min-width: 768px) {
.hide-on-desktop {
display: none !important;
}
}

Nice work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2013 , 03:56 PM
Anyone know if the architecture for the Rockstar servers they are running GTA online on have anything published about them?

I'm guessing they haven't opened up about everything, but I have always been interested in how companies datacenters and obv custom ones, although in the case of Rockstar they might be hiring all of that out I guess.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-02-2013 , 04:40 PM
Quote:
Originally Posted by Ryanb9
My fam owns a landfill and I recently started working part time at one of the transfer stations. They use a scale (weight tronix wi-130) at this site to weigh the garbage trucks as they come in and once again as they leave to get the tonnage. I run the scale and write down the weights on a printed-out spreadsheet forum. The scale has an old-school looking outlet which looks like it could be connected to an old computer but as it is now, is hooked up to an ancient looking printer type thing that prints out the gross, tare, and net weights (which I then write down). I'm sure I could convince the fam to pay me to write up a program so that all this info could be auto-inserted into a database or spreadsheet of some sort. Problem is, this scale looks like it was created long before USB and I'm having problems trying to figure out how to get this info to a computer. And even If I get that far, how to parse what it sends into real data in say, C# or something easy like that. If anyone is bored I would love some advice b/c I could really use a project like this to keep me busy =P

The scale:
pic of the connector might help here
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2013 , 01:09 AM
Its almost like (if not) an old monitor connection. Looks similar to this
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2013 , 05:03 AM
Ah! The AR-936 invisible data connection port -- good luck decoding their proprietary data scheme!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2013 , 06:18 AM
Quote:
Originally Posted by Ryanb9
If anyone is bored I would love some advice b/c I could really use a project like this to keep me busy =P

The scale:
I know this doesn't help from a personal project perspective, but the scale supports some third party automation modules that you can plug in.

WI-130 Manual:
Quote:
- OPTO 22 I/O Modules
- Remote Expanded Control Interface for 8, 16, 24, or 32 OPTO 22 I/O Modules
Opto 22 automation modules: http://www.opto22.com/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2013 , 11:45 AM
g_m,

no dude, that's clearly VGA
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-03-2013 , 11:57 AM
It even has a missing pin, how cute.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m