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
PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

hayden. posted:

I'm converting a simple app I have to Codeigniter and a MVC structure is all new to me. I'm trying to figure out how to best structure this app.

It's a pretty simple to-do list that uses the nestedSortable jQuery plugin. My PHP queries/prints all the root level items, and whenever it runs into a folder it also prints all of the items within the folder.

My question stems from the contents of the folder needing to be within <ol> tags. Is this how I should approach printing a folder (within a controller)?

$this->load->view('templates/folderStart.php', $item); //has <ol> tag
$this->print_folder_items($whatever);
$this->load->view('templates/folderEnd.php', $item); //has </ol> tag

Just seems kind of messy.

The list should be contained all within one view, which may load subviews but does not necessarily need to. Doing it this way, you risk having to change the logic in the controller if you want to change the structure of the list. You can have as much "complexity" in a view as you feel is necessary for the display of that view, and it's still considered well-designed MVC. You don't necessarily want to break down everything into the smallest possible views, if for no other reason than it will be a massive pain in the rear end when you want to go change something.

Adbot
ADBOT LOVES YOU

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

The Merkinman posted:

I asked this in the recommend me a tablet thread a while ago and wanted to ask here as well:
Tablets (iOS, preferably Android) still aren't suited for web development are they?

If you're comfortable with developing in a basic SSH terminal, it's possible but extremely unpleasant, until you need to gently caress with images in a non-trivial way. If you have an external keyboard, it might be slightly less unpleasant, but I still wouldn't recommend it.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Oh My Science posted:

No, get a MacBook Air, maybe a Chrome Book if you can live with the Chrome OS.

Or a Windows ultrabook (mind you, I bought mine before the abortion that is Windows 8).

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

kedo posted:

OpenTable and CityEats are the two most popular/widely used reservation systems. Sadly, as far as I'm aware neither have APIs. You just have to embed their little widgets.

OpenTable is pretty much the industry standard, at least everywhere I've ever been. The sad part isn't the APIs, it's the exorbitant loving fees. I wish I'd come up with that poo poo, because they're literally making something like a dollar per diner reserved (yes, per diner, not per table), in addition to insane monthly fees. I have no idea how they maintain market share at that price, but they're certainly doing something right.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Joementum posted:

Web fonts work great if you don't have to worry about anyone with Windows XP ever trying to use your site.

Windows XP is over a decade old at this point and is being EOL'd next year. I'd really rather focus on making my site look great on modern computers instead of making sure it looks equally decent on old computers, unless I have a compelling reason to believe my site's audience will be primarily a bunch of people with old-rear end computers.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Lumpy posted:

It is never* OK to do a straight query to the database with $someQueryString.





* This is not 100% true, but if you act like it is, nothing bad will happen, and the things you write will be less awful.

I would argue the only time it's acceptable, and even preferable, as a part of good coding practice is if there are no variables in the query. Then you're just wasting time by preparing a statement before executing it. Otherwise, the added safety of statements means they should be used every single time.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

mmm11105 posted:

I'm doing a small site for a friend, that he needs to be able to edit. However, all he needs to be able to do is edit the text in a few boxes and upload photos (with auto resizing, and thumbnails). What would be the best CMS? Everyone seems either too complicated (he doesn't need page management or a blog of anything of that sort), or too simple to handle the photo gallery. I'd rather not confuse him with a UI that has a million options he won't use.

I'd recommend WordPress. It's pretty simple, and it can be extended if it's needed down the line. The problem with trying to get the simplest possible solution to any problem is that any given person uses approximately 20% of the features of any software/system/etc., but every user uses a different 20%, so unless you have extraordinary luck or roll your own solution, you're not likely to find a system that does what you want without having a bunch of additional, possibly confusing features.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Yeah, it's pretty confusing the first time you deal with it. I thought I was having a pixel density problem, but it turned out some third-party mailing list signup that my client wanted to use helpfully re-styled my goddamn website by changing max-width on all imgs on mobile devices. Whichever designer came up with that needs a good, solid beating. And, of course, because it loads itself asynchronously and pretty far down the page, there's no easy way to restyle it without putting little bits of CSS far down the page, or using the dreaded !important.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Ema Nymton posted:

Just chiming in to say that Drupal is loving garbage. I used to like it, but Drupal 8 is somehow an unrecognizable, incomprehensible pile of words and menus that do gently caress all. Writing a whole site in Notepad++ with HTML and CSS and arranging everything manually would be preferable to this mess.

Every CMS is terrible all the time. They're all designed to offload minor unpleasantness on "content creators" by turning it into a five-fingered prostate exam for developers.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

nexus6 posted:

I'd say that CMSs are fine so long as you know what you're doing. "I don't know how to do thing in [CMS]" does not mean "CMS is terrible". By that metric I think Wordpress is awful because I don't know how to use it yet, astoundingly, it's very popular. A colleague hated Drupal because he never bothered to learn how to write modules for it or use it's API and his code is loving horrendous.

WordPress is legitimately terrible though, even though I've bent my brain enough to figure out how it usually likes to work.

If you have constant access to an actual developer, I'd argue it's usually better to use a framework like Django instead of cobbling together an approximation of what you want using a traditional CMS. Every CMS has the inherent disadvantage of dealing with unstructured data, which means you're always going to be wasting time trying to make a general purpose tool do whatever it is you want. Further, you still need to know traditional HTML/CSS and probably JavaScript if you, for any reason, would like to do something non-trivial in terms of design anyway.

Maybe there's some CMS that doesn't have these problems, but ultimately the less you have to force your ideas to fit the CMS's paradigm, the closer it becomes to a framework, and at that point why not just use a framework instead?

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

nexus6 posted:

What genius at Wordpress thought it was a great idea (and still is) to store absolute URLs in the database? How are you supposed to set up a separate staging/test/preview site without doing a search and replace on the entire database?

Is their development philosophy "gently caress it, we'll do it live"?

Well, you see, it's because WordPress is a heinous piece of crap made of piss and poo poo and garbage.

See also: the reason why version control doesn't exist in stock WordPress, which I would consider to be a crucial part of any content MANAGEMENT system.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

The Merkinman posted:

Anyone have a lot of experience with jQuery Valdation?
I'm trying to do a thing where it'll clear a certain field if that field has a certain error. I'm not sure if that's even possible. I might be able to get away with always clearing a certain field if there is any sort of error.
I tried seeing about invalidHandler but when I put that in validate() nothing happens except the whole validation no longer runs on submit claiming TypeError: validator.numberOfInvalilds is not a function.
code:
$("#myForm").validate({
		invalidHandler: function(event, validator){
			var errors = validator.numberOfInvalilds();
			if (errors){
				$("#newPassword").val('');
			}
		},
		rules:{
			email:{
				required: true,
				email: true
			},
			password:{
				required:true,
				minlength:8
			},
			password2:{
				required:true,
				minlength:8,
				equalTo: "#newPassword"
			}
		},
		messages:{
			email: {
				required: "Please enter your email address.",
				email: "Please double-check your information and try again."
			},
			password: {
				required: "Please create a new password between 8 and 16 characters.",
				minlength: "Please create a new password between 8 and 16 characters."
			},
			password2:{
				required: "The passwords entered do not match. Please try again.",
				minlength: "The passwords entered do not match. Please try again.",
				equalTo: "The passwords entered do not match. Please try again."
			}
		}
	});	

You have a typo on the third line. It should probably be numberOfInvalids instead of numberOfInvalilds. There may be other problems as well, I'm not sure, but that's definitely causing the error.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Thermopyle posted:

I never have and never will (hopefully) be involved in crafting the design of mass emails, but every time this gets brought up I wonder about something...are non-HTML-capable email clients just so much in the minority anymore that people just ignore that they exist?

If anything, I think with wearables they're getting more common.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Lumpy posted:

It's that Marketing Types™ refuse to believe they exist. They also believe people will spend hours appreciating the rich content of their lovingly crafted message.

If I'm being honest, I do like to see a nicely-crafted e-mail as opposed to text-only if I'm being marketed to. On the other hand, no one needs more than a basic MailChimp template* to make their e-mail look presentable anyway, so it's not something anyone needs to be spending a huge amount of time on.

* I would also argue there's no particularly good reason to avoid a commercial e-mail provider like MailChimp if you're just doing marketing, because they've gone through all the hassle of making sure poo poo works, and even the most expensive packages are nothing compared to developer time.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

FuriousAngle posted:

Hi everybody! Please let me know if this isn't the place to ask.

Skill level: Pretty beginner, I have the basic concepts of HTML 5 and CSS down, with some JS
Project Requirements: Probably CSS and JS


Would anyone mind helping me out? I'd be very grateful! I'd even be happy with a point in the right direction.

I'm looking for a simple, clean way to switch between different sets of text. Ideally I'd like to have a set of radio buttons at the top to let the user switch between three sets of text scattered throughout a page. The way I know how to do it would involve hiding each individual instance of all txtB and txtC while the txtA button is depressed, and that seems like it can get tedious and messy as far as code goes. I feel like there's got to be a better way for me to group everything according to type and use some buttons to toggle which values are shown.

Simple code:

code:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
	<input type="radio" name="edition" value="txtA">Show Text A<br>
	<input type="radio" name="edition" value="txtB">Show Text B<br>
	<input type="radio" name="edition" value="txtC">Show Text C<br>

	<p>Text A.</p>
	<p>Text B.</p>
	<p>Text C.</p>
	<p>Universal Text.</p>
	<p>Text A.</p>	
	<p>Text B.</p>
	<p>Text C.</p>
	<p>Universal Text.</p>

</body>
</html>
Desired output:

Text A./Text B./Text C.
Universal Text
Text A./Text B./Text C.
Universal Text


Any input would be AWESOME.

Assign a CSS class to each set of text (let's say "textA" "textB" "textC" to keep things simple). When a radio button is selected, set the two non-active classes to have "display:none" in CSS, and the active class to have "display:block".

Is this enough to get started with or would you like more help?

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
I have been asked to make changes to a decade-old site that still uses an incomprehensible maze of nested tables and tiny little GIFs to create rounded corners on sections. I'm hoping I can convince the client to allow me to do a full re-design of the site using modern techniques, but if not, gently caress my life.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Data Graham posted:

The <font> tag :ghost:



E: scuse me, the <FONT> tag

Double-checked my new project, and sure as gently caress that's lingering around too.

I remember doing background-image tricks to create rounded corners before border-radius was well supported (read: when I couldn't convince clients to drop support for old versions of IE), but at least I did them with CSS (still shameful, though).

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

ModeSix posted:

I have a question regarding API endpoints and frameworks(?).

I am building an Angular app and I want ideas about what to use for the backend API. Ideally I'd like to use a MySQL database, which I know can be supported properly by several technologies.

Should I build a custom API using express?

Should I roll with something like Loopback?

Should I use ASP.net?

Or is there some other alternative that is recommended. It's basically wide open, as I'll be deploying to my own server, so I can spin up anything on the backend really.

For information about what I am doing, it's going to be a sort of web portal for teachers (myself included) to interact with students, assign homework, receive requests from students for help, etc. This is why I'd prefer MySQL because I'd like to use a relational database. I'm not completely opposed to using a php driven API, but I'd prefer not to.

Or if there is another database suggestion, please give it. I'm not going to use something like Firebase that I'll have to pay for, needs to be strictly free.

I'm quite fond of Django myself, and Django REST Framework is quite nice for building a REST API, if that's what you're after. You can use it with a variety of databases, including but not limited to SQL, and you can use the builtin ORM or write your own queries when necessary.

The other nice thing is it includes a fairly robust user and permission control system out of the box.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Scaramouche posted:

Hmm, that one's tougher. On the one hand I want to say "just start throwing together stuff in HTML" so you learn the basics, but on the other, almost no one does that any more so I'm not sure if that's a basic that's worth learning.

Almost no one makes full sites out of just HTML any more, but it's still a foundational skill that you need in order to do pretty much anything else, including anything non-trivial in WordPress (if you don't want to use dozens of fragile plugins which are more work to set up and maintain in the long run anyway).

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

kedo posted:

A number of backend developers I've worked with who consider <div> a reasonable element to use for literally every single piece of content or layout on a page would beg to differ.

Ignoring for the moment the fact that this, in a sense, proves my point, I was talking about building and maintaining a complete website. You either need to know HTML and CSS to some degree, or be working with someone that does. Someone involved had better know HTML.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Scaramouche posted:

Oh yeah, and I'm not arguing against it even. But I don't think I've written my own <HTML>, <HEAD>, and <BODY> information in a dog's age, which is a significant (thought not total) part of HTML. It seems like everything up until the first <div class="content"> is getting handled for you now by various tools, and the lumbering ever-expanding CSS/Javascript juggernaut handles everything else. Another example is that I haven't used TABLE in forever either, because CSS columns are pretty cool. Or <IFRAME>. I think the only old school HTML only structures I use on the reg are:
- <Hx> (hilariously only for the obsolete SEO intangibles that people insist on having; formatting wise CSS handles anything H does)
- <p>/<br/>
- <ul>/<ol>/<li>
- <div>
- <strong>/<em>

That might be though that I'm not really a display guy, having come up through databases/server side, and am a weak scrub compared to the rest of you.

<table>s are cool and good, because sometimes you need to display tabular data. Why would you go through the hassle of formatting that all with css when there's absolutely no point?

If you are not displaying tabular data, though, you should not be using a table.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Assuming no one can answer your question directly, you could consider breaking the large file up on the server side and then downloading each chunk separately with a single XHR each, then assembling the chunks again client-side as required. Possibly not ideal, but it would work.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
90% of the time you don't need to do those kinds of queries, though. You should still learn SQL, but having an ORM to take care of the simple stuff is very nice.

Django is good, you should learn it.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Maluco Marinero posted:

The in built admin site is a really nice party trick up Django's sleeve. Has come in handy for nearly every project I've done for some sort of custom workflow. We do bespoke middle tier stuff, budgets of around $10k - $50k AUD. Django is a real handy tool for hitting those deadlines cleanly while still nearing all their goals. That said we have some custom stuff for templating that lets us do everything in React.js.

The built-in admin site (and built-in user handling) is excellent, and a big part of the reason I stick with Django for most anything I can.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
I just ignore ancient IE versions at this point -- I don't even mention them to clients. Better to ask forgiveness than permission, and so far I've had zero complaints in the past five years anyway.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Definitely make the availability of the English pages known. Remember that Spanish-speaking visitors may well be fluent in English but may prefer to read pages in Spanish where available.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
A friend of mine has been developing a wordpress site cobbled together out of tables and shortcodes and sadness to get everything the way he wants it, and now the design's responsiveness is just as predictably lovely as you'd imagine and I have been asked to make something that will work on mobile devices without making baby Jesus cry.

Just how hosed am I? Is there anything that can be done? I told him the best thing to do is just remove the media queries from the CSS, so at least the full website shows up without a whole bunch of mis-sized and overlapping poo poo. I said I could make a separate mobile version of the website (which he is wont to call an "app" but I don't believe he actually wants an app, just a mobile website) but that's going to be utterly horrendous because it will require either separate updates, or some kind of godforsaken process to inspect the content on the main website (either via screenscraping or by reading the wordpress database directly).

I keep hoping there's an obvious thing that I'm missing that will make this a simple task that will not result in me wanting to tear my hair out.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Scaramouche posted:

I've never used it, but maybe something like this?
https://en-ca.wordpress.org/plugins/any-mobile-theme-switcher/

The idea is the plugin magically detects mobile traffic and then displays the WP content using a separately specified theme. You'd still need to purge his bad stuff that overrides basic things but it might work. Or it might be horrible, I've never tried.

My gut says the "easiest" way to is to restart from scratch with a good desktop/mobile theme where most of the work has already been done for you.

As far as I can tell, this was a horrid choice to build a website that looked as close as possible to a client's previous website that needed rebuilt for some unknown reason. It seems the base theme was not really properly modified to support what the client wanted so everything's been hacked together in a dreadful manner. I don't think he (or his client) will be fond of the suggestion that the past month or two of work should be ditched or significantly refactored, even though it would be the right choice from a development standpoint.

It would also be 100% better to use a framework that allows for well-structured database access too, but he's unreasonably fond of wordpress.

That theme switcher sounds like it could be workable. Apparently he's also found a plugin for the table plugin that can modify the tables to be responsive somehow. It sounds like he's building a precarious tower of poo poo and garbage and I don't want to touch it if I don't have to.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

huhu posted:

Do this. Trust me.

If I'm going to rewrite a whole bunch of poo poo, it's sure as gently caress not going to be WordPress-based. All the lovely compromises that were already made were a result of WordPress's many weaknesses.

I'm still not clear on why the client requested a full re-write in the first place, or most especially why it's being moved from ExpressionEngine to WordPress.

It's just a horrible clusterfuck.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

ToxicSlurpee posted:

That and Wordpress is horrendously insecure and also comes with the extra baggage of somebody saying "hey, let's install this theme!" without realizing that the theme so generously provided for free from Random Internet Human #1,937,562 will very possibly be full of malware.

And if you want it to update itself in a convenient fashion when security holes are discovered, which is "frequently", you have to give it permission to overwrite its own code. There's no way that could ever go wrong!

It's also a giant target, because it's so common, so poorly coded, and a lot of the default options can't be changed so literally every WordPress site will have the exact same weak points to abuse!

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Warbird posted:

What would you recommend as an alternative fairly idiot proof alternative?

Nothing? Eventually any system that tries to reduce complexity to the point it's remotely idiot-proof will run up against the fact there is a certain level of complexity that cannot be safely eliminated without making extreme compromises (ignoring for the time being that WordPress has made myriad unforced errors with regards to things like their heinous database schema, and almost-nonexistent security structure). While that can be a fair trade for a personal blog or something, it's ridiculous to use for anything beyond a certain level of complexity because you spend so much time forcing a square peg into a round hole that you end up with a slow, unmaintainable monstrosity of plugins, shortcodes, and key-value pairs stored in databases, that you're actually further behind than if you just did it correctly in the first place.

Professional developers should not be recommending WordPress outside a very narrow scope. If you're paying a developer to handle the complex bits, then you don't need WordPress's level of "simplicity" and there's no reason to put up with its compromises.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Drupal is slightly more powerful than WordPress but still pretty awful to work with.

If you have hosting that can support it, Django is definitely my favourite thing to work with. Very flexible, easy enough to set up, simple to explain to whoever's going to be making edits, and it's easier for me as the designer/developer to control how things end up looking while still allowing the client the ability to change content, since the data is as well-structured as I choose to make it.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Gmaz posted:

If you know PHP there's always Laravel and pretty much every major higher level language has an MVC web framework like Django.

I've worked with a few PHP-based frameworks now, and I really like Django by comparison. The auth/admin system is way more flexible out of the box than other MVC systems I've worked with, and while it's not a complete CMS out of the box, I don't find it particularly more challenging to get it to a usable point than I would writing, say, a WordPress theme, because you don't have to make as many concessions to how the system wants you to do things. If you're going to build a pure blog, you're probably better off sticking with a more typical CMS (WordPress really isn't bad if all you want is a blog).

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Dominoes posted:

Hey dudes. Speaking of POST, how can I send data via POST from javascript to a server (ie Django), without using AJAX? Most search results about javascript or jquery and POST are about AJAX - but I don't want AJAX (I think), since I'm trying to update the web page after sending the request, which AJAX appears not to do.

You can either use a callback on the AJAX method the reloads the page (document.location.reload() if I'm not mistaken), or you could use the submit() method on a form that contains the data you want to submit.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Lumpy posted:

Or even better, don't post the same question in different threads simultaneously! That way people don't miss out on context and people don't spent time answers something you may have gotten solved 5 minutes ago in "the other thread"

And people don't end up replying with a summary of what someone posted in the other thread in response to the same question because they didn't realize it was the same poster asking the original question in both cases (what I just did -- full credit for the solution goes to Data Graham).

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
I've hated wordpress for a while now, but I'm actually coming to admire how exquisitely bizarre it is. It's getting to the point that multiple plugins on this one site I'm trying to unfuck for a friend, have created an ecosystem of sorts. Some plugins are fighting with others; some are symbiotic, and gently caress knows nothing can be disturbed even the smallest amount without catastrophic consequences. Encapsulation? What the gently caress is that??? Let's just expose everything to everyone!

It's absolutely fascinating, even though it makes me want to smash the dev team's balls with a hammer.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

fletcher posted:

Having a hard time coming up with the right terms to google for this one. Lets say you are coloring counties of a particular region on a map. How do you go about picking colors that are easy to distinguish from one another? How do you then ensure that two regions that border each other don't have the same color (within reason)? I'm using leaflet for this, not seeing anything on the plugins page that touches on this stuff though.

Not that it's useful in a practical sense for you, but this general class of problem has a lot of research and history behind it: https://en.wikipedia.org/wiki/Graph_coloring

I'm not sure if that will give you any starting points for doing what you need to do, but I always find it quite interesting to read about.

Actually picking the colours to use is a different matter, of course. EDIT: But huhu's link seems really good in explaining the considerations in that field, so read that with regards to picking the colours to use.

PT6A fucked around with this message at 02:55 on Mar 24, 2017

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
What's the largest CSS file you've ever seen? My new record from just now is 1.5MB. After being compressed, it's a mere 1.1MB.

I suspect this is the correct answer to my client's (who's subcontracted part of the work to me, so he's ultimately responsible for this monstrosity) question of "why is the site loading slowly?"

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

No Gravitas posted:

Did you minify it? Compress it with zopfli?

By compressed, I meant minified, so yes. I don't know if the server is configured to serve gzip-compressed files because I don't control that (and I don't think my client controls that directly either, so who the gently caress knows).

Adbot
ADBOT LOVES YOU

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Like I said, the minifying was good at reducing 1.5MB to 1.1MB, but that's still, frankly, way too loving much for a basic corporate site (or anything, frankly).

Even if you don't take into account the page weight of such a stylesheet, the sheer quantity of CSS is almost certainly an indication that it's extremely difficult to modify/maintain in anything approaching a sane way.

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