Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Boosh!
Apr 12, 2002
Oven Wrangler
How would you handle a navigation which would have new content in a drop down a couple of times a week, if not daily, without republishing your entire site (FWIW, I have an antiquated CMS in RedDot)?

In the past I'd have a small jQuery function that would read a JSON file but I was wondering if there's something simpler around that I am missing.

Adbot
ADBOT LOVES YOU

kedo
Nov 27, 2007

IMO the "right" way to do that would be through the CMS. If it were WordPress (for example), I'd probably have that chunk of content automagically generated from an excerpt from the most recent post in whatever category. No clue if RedDot is capable of something like that. Generally speaking I find it's better to insert content into a page server-side than it is client-side, especially if it's important content.

But if that's not a possibility then your solution is probably fine.

Boosh!
Apr 12, 2002
Oven Wrangler

kedo posted:

IMO the "right" way to do that would be through the CMS. If it were WordPress (for example), I'd probably have that chunk of content automagically generated from an excerpt from the most recent post in whatever category. No clue if RedDot is capable of something like that. Generally speaking I find it's better to insert content into a page server-side than it is client-side, especially if it's important content.

But if that's not a possibility then your solution is probably fine.

Our CMS spits out static pages unfortunately; there is no server-side scripting. I appreciate the reply, thanks man!

Oh My Science
Dec 29, 2008
What is the general consensus on non-compete clauses in contracts? I would prefer not signing one but I'm not sure what arguments to use aside from "I don't want to limit my career growth" which sounds an awful lot like "I will quit as soon as I get a better offer".

EAT THE EGGS RICOLA
May 29, 2008

Oh My Science posted:

What is the general consensus on non-compete clauses in contracts? I would prefer not signing one but I'm not sure what arguments to use aside from "I don't want to limit my career growth" which sounds an awful lot like "I will quit as soon as I get a better offer".

Generally unenforceable depending on a bunch of stuff, talk to a lawyer, this is important.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

EAT THE EGGS RICOLA posted:

Generally unenforceable depending on a bunch of stuff, talk to a lawyer, this is important.

Yeah, if its trying to tell you not to work on your time in contexts completely unrelated to their own IP, they're asking for a lot more than an employee.

A Professionals union membership might be worth thinking about, as they will generally have contract lawyers on demand, which can turn out to be a shade cheaper if you need/want to do it with any regularity.

kedo
Nov 27, 2007

Depends entirely on what it says. If it says something like, "You can't work for any other business in a related field for X years," (where X is often 2) it's super unenforceable and also an rear end in a top hat move. What exactly does it say?

If the company you're applying to isn't full of jerks, you could ask that it be removed and they'd probably do it.

e: If you need to argue the point with them, I would bet :10bux: that you also have a confidentiality/trade secrets section as well as a non-solicitation section. This is the argument I made with my current employer: "I already can't share any of our secrets or solicit current or past clients because of these two clauses, so this non-compete clause is unnecessary. In today's job market, it's unrealistic to expect an employee to not work another job in the same industry in X years." Worked for me, but your results may vary.

kedo fucked around with this message at 22:12 on Apr 1, 2014

Oh My Science
Dec 29, 2008
Spot on Kedo, all of those things are present.

In it's current form it's too vague, which may actually be in my favour. It simply says "cannot work for a company that competes in the same market" which means jack poo poo since most sites offer collaboration / sharing / video features. I only see those features growing in popularity in the next few years.

For reference it's a small startup that is privately funded.

kedo
Nov 27, 2007

Yeah, talk to a lawyer if you want to be sure but that's most likely going to be unenforceable. IANAL and all that poo poo, but I've heard this repeated a million times over lots of very reliable places.

However if it's in there and you part ways with the company on poor terms it means they have the ability to make your life miserable at least until it gets thrown out of court. So either way your best bet is still to try to get it removed. Otherwise if it's an opportunity you can't pass up you can roll dem dice and hope nothing bad happens.

\/\/ Yeah, better safe than sorry. Struck some bad advice.

kedo fucked around with this message at 22:36 on Apr 1, 2014

Robot Arms
Sep 19, 2008

R!

EAT THE EGGS RICOLA posted:

Generally unenforceable

Nope.

EAT THE EGGS RICOLA posted:

talk to a lawyer, this is important.

Yep.

Oh My Science
Dec 29, 2008
I have a lawyer I consult for some freelance work. If he cant help me he can make a referral.

Oh My Science
Dec 29, 2008

quote:


9.1. The Employee covenants and agrees that:

9.1.1. During the Term of employment, the Employee shall devote his or her full working

9.1.2. During the Term and for a period of one (1) year following the Employee’s

time, attention and efforts to xxxx and in its related affairs as directed by xxxx;

termination the Employee shall not compete in any way with xxxx in any

geographical region in which xxxx conducts or may in the future conduct business,

directly or indirectly, whether as owner, partner, shareholder or agent, officer,

director, employee, independent contractor, consultant or otherwise, unless acting in

accordance with xxxx’ prior written consent.

9.1.3. The Employee shall not be prohibited from web-development or use of web-
development technologies and for the purposes of Article 9.1.2, “competition” shall

9.1.4. The Employee acknowledges and agrees that the time frames for which the

be defined as conducting business, directly or indirectly, whether as owner, partner,

shareholder or agent, officer, director, employee, independent contractor, consultant

or otherwise with a person (whether corporate or individual) which is in the business

of or involved in development or maintenance of a web-based platform which allows

real-time editing with multiple users having the ability to video conference.

aforesaid covenant shall apply have been considered by the Employee who has

taken independent legal advice with respect thereto and the restraint and restriction

of and on the future activities of the Employee are reasonable in the circumstances.

{Client Files/27451/1/E1494565.DOC }

9.1.5. The parties agree that if the time frames set out in this Article are found to be

unenforceable by a court of competent jurisdiction, the time frames will be amended

to the time frames as established by a court of competent jurisdiction.



For anyone interested in what the amended version looks like.

V No. I was simply showing people what it looks like since we were discussing it. If it eases your mind I have already sent it for review.

Oh My Science fucked around with this message at 23:28 on Apr 1, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Are you seriously asking a bunch of engineers for legal advice and hoping the response you get back is correct?

Talk to a lawyer. Trust none of us. We aren't lawyers.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo

Oh My Science posted:

For anyone interested in what the amended version looks like.

V No. I was simply showing people what it looks like since we were discussing it. If it eases your mind I have already sent it for review.

Regardless if it is enforceable or not, I wouldn't sign something like that.

E: If you're competent and basically anywhere in the western world, it's an employee's world.

Oh My Science
Dec 29, 2008
Just to follow up on our earlier conversation I actually spoke with a lawyer.

He suggested two things:

1. If I were terminated the non-compete should be void.
2. Non-competes are typically paired with 'consideration' clauses entitling me to x months of salary (usually the term of the contract) + severance should I leave.

They did not like those two things. He told me his lawyer would laugh at #2 and that #1 was out of the question.

I'm really torn. On one hand the job has the potential to be very interesting, but like any startup it could disappear at any time. Even if it beats the odds and does succeed I could spend years (not likely these days) learning a specific set of tech and be barred from finding work on a similar product / environment which would now be my bread and butter.

I technically don't need the job and could turn it down, it just sucks that this wasn't part of the initial discussion. Makes me feel like the bad guy for trying to protect my own right to work.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
IANAL but do get one thing straight. You are not, and never will be the bad guy for arguing your side of a contract. You are a worker who deserves a fair contract, and it sound alike the employer is biting off more than they are entitled.

pipes!
Jul 10, 2001
Nap Ghost

What Maluco said, plus if you have a blog, write about your experience. The tech industry is an amazingly exploitative place, and sometimes just getting an honest record out can get a discussion going outside of normal sphere business bureaucratic bullshit.

kedo
Nov 27, 2007

Oh My Science posted:

I'm really torn. On one hand the job has the potential to be very interesting, but like any startup it could disappear at any time. Even if it beats the odds and does succeed I could spend years (not likely these days) learning a specific set of tech and be barred from finding work on a similar product / environment which would now be my bread and butter.

I technically don't need the job and could turn it down, it just sucks that this wasn't part of the initial discussion. Makes me feel like the bad guy for trying to protect my own right to work.

A good employment contract doesn't only protect the company, it's should also protect you. This one is clearly very one sided and thus is a bad contract imo. But that point aside, the fact that the person you're talking to apparently won't even consider removing or modifying the contract should tell you something.

This is a real lovely situation, I feel for you man. You're not the bad guy here at all.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Just want to point out that there is a thread with a supposedly real lawyer currently on page two of the COC list: http://forums.somethingawful.com/showthread.php?threadid=3611767 He might be a little more helpful.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo

Oh My Science posted:

Just to follow up on our earlier conversation I actually spoke with a lawyer.

He suggested two things:

1. If I were terminated the non-compete should be void.
2. Non-competes are typically paired with 'consideration' clauses entitling me to x months of salary (usually the term of the contract) + severance should I leave.

They did not like those two things. He told me his lawyer would laugh at #2 and that #1 was out of the question.

I'm really torn. On one hand the job has the potential to be very interesting, but like any startup it could disappear at any time. Even if it beats the odds and does succeed I could spend years (not likely these days) learning a specific set of tech and be barred from finding work on a similar product / environment which would now be my bread and butter.

I technically don't need the job and could turn it down, it just sucks that this wasn't part of the initial discussion. Makes me feel like the bad guy for trying to protect my own right to work.

Tell them to gently caress off. There's no reason to sign something like that, especially if you're getting anything other than wink-wink nod-nod from them when you push back.

Oh My Science
Dec 29, 2008

Munkeymon posted:

Just want to point out that there is a thread with a supposedly real lawyer currently on page two of the COC list: http://forums.somethingawful.com/showthread.php?threadid=3611767 He might be a little more helpful.

Thanks for this, I'll wait until I have a second opinion before I do anything rash. Really tempted to make an ultimatum, but I suspect that won't go over well.

This relationship is off to a rocky start anyway, can't imagine what kind of poo poo they might pull later.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Munkeymon posted:

Just want to point out that there is a thread with a supposedly real lawyer currently on page two of the COC list: http://forums.somethingawful.com/showthread.php?threadid=3611767 He might be a little more helpful.

Except that dude doesn't seem to be responding to any questions :(

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop
I was playing with a data-driven site in django and nearly barfed at the tutorial:

HTML code:
<ul>
{% for choice in poll.choice_set.all %}
        <li>{{ choice.choice_text }}</li>
{% endfor %}
</ul>
After how neat the data modeling was, and how nicely it works in the admin view automatically, they smack you with a template language that arc-welds logic to presentation. That's basically PHP from 20 years ago. Is this really the best that we can do in 2014?

Yes, django is better than that. It's just an awful piece of code to showcase as "how to make a django site", and more intros should focus on the best-practices that the framework supports, not "hello world". Now to find some examples of how to do it "right".

This exercise is in search of a framework that can show a realtime view of a database limited by an ACL for the user logged in - and lets me just take a designers HTML and auto-generate the backend JSON and frontend javascript to update the correct DOM node. Obviously all that together may be too much to ask, but is there anything that accomplishes big chunks of that?

In terms of types of things I need to do, consider a weather station aggregation website. Collection of data from dozens of different users who each can change some information for stations they control. Groups of stations by location and a live-view of data coming in.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Harik posted:

After how neat the data modeling was, and how nicely it works in the admin view automatically, they smack you with a template language that arc-welds logic to presentation. That's basically PHP from 20 years ago. Is this really the best that we can do in 2014?

Yes, django is better than that. It's just an awful piece of code to showcase as "how to make a django site", and more intros should focus on the best-practices that the framework supports, not "hello world". Now to find some examples of how to do it "right".

I'm really not sure what else you expected because every MVC framework I've ever seen that generates HTML looks like some version of that. You're right that it looks like super old PHP, but PHP at least started life as a reasonable templating language, so you're arguing against yourself on that point.

quote:

This exercise is in search of a framework that can show a realtime view of a database limited by an ACL for the user logged in - and lets me just take a designers HTML and auto-generate the backend JSON and frontend javascript to update the correct DOM node. Obviously all that together may be too much to ask, but is there anything that accomplishes big chunks of that?

In terms of types of things I need to do, consider a weather station aggregation website. Collection of data from dozens of different users who each can change some information for stations they control. Groups of stations by location and a live-view of data coming in.

Knockout, Angular or (maaaybe) React* all come to mind, but you're still going to have to wire stuff up yourself to some degree.

Maybe you want Meteor? Hope you like Mongo(loid)DB.

There are probably others I'm not familiar enough with, so hopefully someone else can fill up both in.

*I doubt you'll be anywhere near "dropping in" the designer's HTML with React

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Munkeymon posted:

Maybe you want Meteor? Hope you like Mongo(loid)DB.
Is this the new MiKKKro$haft, or what?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Misogynist posted:

Is this the new MiKKKro$haft, or what?

I can't make fun of badly written cargo-culty software? Everything I hear about it makes me want to avoid it, so I want to pass that along.

Meteor is a neat idea - just wish they had a better back end.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Harik posted:

I was playing with a data-driven site in django and nearly barfed at the tutorial:

HTML code:
<ul>
{% for choice in poll.choice_set.all %}
        <li>{{ choice.choice_text }}</li>
{% endfor %}
</ul>
After how neat the data modeling was, and how nicely it works in the admin view automatically, they smack you with a template language that arc-welds logic to presentation. That's basically PHP from 20 years ago. Is this really the best that we can do in 2014?

I don't get it, what's wrong with that snippet? Where's the logic?

ManoliIsFat
Oct 4, 2002

fletcher posted:

I don't get it, what's wrong with that snippet? Where's the logic?

Some people hate absolutely any logic beyond tag replacements (for loops and if elses are logic). "Thin Controllers, Fat Models, Dumb Views"


\/\/\/I don't disagree. I think it's very much a smell thing what someone calls "logic" in a template.

ManoliIsFat fucked around with this message at 19:11 on Apr 4, 2014

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

ManoliIsFat posted:

Some people hate absolutely any logic beyond tag replacements (for loops and if elses are logic). "Thin Controllers, Fat Models, Dumb Views"

It is a dumb view though. It doesn't care what poll.choice_set.all is as long as it's iterable and has a property called choice_text. You may as well write
code:
{% for k in obj %}
for all the templating engine cares.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Harik posted:

I was playing with a data-driven site in django and nearly barfed at the tutorial:

HTML code:
<ul>
{% for choice in poll.choice_set.all %}
        <li>{{ choice.choice_text }}</li>
{% endfor %}
</ul>
After how neat the data modeling was, and how nicely it works in the admin view automatically, they smack you with a template language that arc-welds logic to presentation. That's basically PHP from 20 years ago. Is this really the best that we can do in 2014?

That's not logic.

wwb
Aug 17, 2004

^^^ bingo.

I was around for the great movement towards web controls in ASP.NET back in the early part of this century. This pretty roundly backfired -- it was a great idea on the surface but it turned out that intermixed html and a little light templating logic are vastly superior to locking up everything in fancy server-side templates. Especially in this modern era of javascripts and such.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Thermopyle posted:

That's not logic.

Even worse, it's a law of Demeter violation! :supaburn:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Doc Hawkins posted:

Even worse, it's a law of Demeter violation! :supaburn:

Maybe. I mean, you could have a template engine whose only tag is:

code:
{{ PAGE }}

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Thermopyle posted:

That's not logic.

I'd argue with that, since they have {% ifequals %} tags as well. Control loops and hardcoded table information? (by default, the Model field names map directly to database columns).

PHP code:
<ul>
<?php for ($a in $poll_choice)
    echo "<li>$a.choice_text</li>";
?>
</ul>
(the PHP probably wrong, I haven't worked on it in ages)

It's not business logic, but it still means writing code/pseudocode in your HTML. I guess I could live with it, but I'd rather some way to describe my model such that it generates the initial template and the javascript for live updating of the same data. Doing it in two separate places is just begging for a first-refresh glitch.

Edit:
Something like
HTML code:
<ul id=choices>
{% format choices polls/choice_fragment %}
</ul>

...
choice_fragment:
<li>{{ choice_text }}: {{choice_count }}</li>
Especially if the latter generates both the initial template and the JS that formats and inserts the AJAX update.


Harik fucked around with this message at 23:56 on Apr 4, 2014

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Harik posted:

I'd argue with that, since they have {% ifequals %} tags as well.

By that reasoning, CSS selectors are "logic", as is anything that is at all general purpose because it has to react to the data. (Like alternating odd/even row colouring, automatically creating the right number of columns for a table, locale-formatting of dates or making them "whatever ago", singular/plural, blah blah.)

I've counted angels on this pin before, and I generally end up with this: if the template rules are read-only with respect to the data model, it's a politically correct view. You can have fun arguments as to whether navigation state is the view's purview or not, given sufficient beer, but in most cases that rule has been a good guide for my spidey sense. (I think navigation state is view, but since it requires state it's easy for it to end up accidentally overreaching.)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
code:
{% if user.admin %}
<a href="/admin">go to admin panel</a>
{% endif %}
Oh no, my view is not pure, it has logic! Let me try again!

code:
if user.admin:
    user_admin_link = "<a href=\"/admin\">go to admin panel</a>"
else:
    user_admin_link = ""
code:
{{ user_admin_link }}
Much better :cool:

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Suspicious Dish posted:

code:
{% if user.admin %}
<a href="/admin">go to admin panel</a>
{% endif %}
Oh no, my view is not pure, it has logic! Let me try again!

code:
if user.admin:
    user_admin_link = "<a href=\"/admin\">go to admin panel</a>"
else:
    user_admin_link = ""
code:
{{ user_admin_link }}
Much better :cool:

Toy example. Change it to a stack of ACL limited options and watch the template bloat with knowledge of every possible thing it might be asked to do. Or you could have a function {{ show_admin_options }} that reads the ACL for the user and pulls in sub-templates for each access that is granted.

That's exactly what I'm complaining about - there's no reason to use a framework for a toy site, so the fact that the documentation shows you how to make a toy site with non-scalable practices is bad. The Django book is a lot better at that, at least. It's showing reasons to actually use the framework rather than just knocking out the site in PHP in an afternoon.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
You're harping on about a tutorial where you are clearly not the target audience. Go look at the automatic admin source, or the Django Rest Framework, or something and stop whinging about the tutorial not dropping first timers into a world of complexity straight off the bat.

For many people Django will be their entry point into doing any web dev at all, it was for me too, so I'm glad for that.

fuf
Sep 12, 2004

haha
omg Internet Explorer 8 :negative:
So much wasted time.

Three things:

1) What is the actual market share for IE8? I keep seeing different numbers, ranging from like 1% to 20%.

2) What are people's thoughts on displaying a "You are using an outdated browser, you should update" message for IE8 users? Do you think maybe it comes across badly and annoys users?

3) Bootstrap etc advocate a "mobile first" approach where you default to a one-column mobile layout and then use media queries to adjust for wider screens. But IE8 doesn't support media queries. So do you a) write a whole separate stylesheet for IE8? b) use a polyfill to get media queries working in IE8, or c) forget "mobile first" and make your default layout the one that IE8 users will see?
(I couldn't get (b) to work, so I did (a). If I was starting from scratch I think I would do (c))

Adbot
ADBOT LOVES YOU

cbirdsong
Sep 8, 2004

Commodore of the Apocalypso
Lipstick Apathy

fuf posted:

3) Bootstrap etc advocate a "mobile first" approach where you default to a one-column mobile layout and then use media queries to adjust for wider screens. But IE8 doesn't support media queries. So do you a) write a whole separate stylesheet for IE8? b) use a polyfill to get media queries working in IE8, or c) forget "mobile first" and make your default layout the one that IE8 users will see?
(I couldn't get (b) to work, so I did (a). If I was starting from scratch I think I would do (c))

To use Bootstrap 3 with IE8, I have a separate IE8 stylesheet that defines the width of the container class and has all the column classes BS3 keeps in media queries. (If you compile BS3 from LESS, you can use Bootstraps .make-grid-columns mixins to do this easily.) IE8 gets the widest breakpoint and only the widest breakpoint, since that's usually the easiest to support. It's not exactly elegant, but it gets the job done, and that's all I'm worried about for IE8.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply