|
Data Graham posted:Yeah, unfortunately this is my business partnership, not my day job. Trust me, I've changed day jobs enough times in pursuit of coding nirvana, and what I'm doing right now is as close to that as I've ever been. This is not a good business environment, you should still get out or resign yourself to a business built on a poor technical foundation because your partner is clueless.
|
# ? Mar 3, 2015 20:04 |
|
|
# ? May 9, 2024 08:22 |
|
What exactly is this dude bringing to the table in this partnership?
|
# ? Mar 3, 2015 20:18 |
Pretty much what I'd thought. And like a battered wife, I will continue to make excuses about why it just is the way it is, and I'd better get used to it, and maybe if I'm patient enough and diligent enough I can change him (i.e. gradually assume more and more control over the tech stack as I accumulate successes over time until he's no longer involved with that part of the business). E: ^^ It's not primarily a web business; it's mostly to do with cars and low-level embedded hardware, and he has encyclopedic domain knowledge there and huge drive and competence. But we're building lots of hybrid software/hardware stuff, and while I'm in charge of most of the customer-facing and upper-level software layers, he handles everything from the sysadmin level on down, including the soldering and welding and such. It's my money but like 80% his expertise that's keeping us running. Hm. Do I need a cow/animal avatar to be in this thread?
|
|
# ? Mar 3, 2015 20:23 |
|
Since you're a partner, what happens if you ignore his opinions and just do things the right way? What's he going to do, fire you? Code it himself? Unlikely.
|
# ? Mar 3, 2015 21:27 |
|
Data Graham posted:
No, but it helps.
|
# ? Mar 3, 2015 23:41 |
|
quote:AJAX: nice to have, but takes too long to develop and doesn't really get you anything.
|
# ? Mar 4, 2015 01:00 |
No joke, he thinks it makes things unintuitive and harder to use. I'll grant that any UX can be badly designed, sure, including some championship bad ideas of mine. But just about anything has got to be better than a form with a submit button that posts to itself like it's 1997. You'll appreciate his favorite technique for building a website that obscures the URL path: Frames. Also Lumpy posted:Edit for content: JSP is fine. Django is fine. PHP can actually be fine. MySQL is fine. PostGRES is fine(er). It's more about being aware of the limitations of your choices and being prepared to deal with them once you start scaling than the actual choices themselves in my opinion. "The new hotness" can be a poorer choice, since less people have banged their heads against its limitations yet. Except Cold Fusion. Never use Cold Fusion. Ever. I still have nightmares. I want to hear some of this. I imagine it'll be cathartic for both of us. My favorite clown-college trick from CF is how it serializes JSON: code:
Oh, but wait, there's another option that sounds like it'll make things more sensible, "serializeQueryByColumns": code:
|
|
# ? Mar 4, 2015 04:26 |
|
/\/\/\/\ They've designed it so it sends as little data across the wire as possible - they're saving sending the key for every column/row in the payload with that structure. Is this a noble goal? No it is not. Can't explain that CITY/City thing though. Back on task: You've truly landed yourself with a massive idiot. We see this, you see this, you need a way to defeat his self-assured industry "experience". Firstly, and even you're suffering from this: getting something done is better than getting something done perfectly. If you consider all the pros and cons of every aspect you'll never start your project, let alone release it. Secondly, you can't have the two of you running a 50/50 democracy if you're not seeing everything eye-to-eye. Who's actually going to be developing and maintaining this thing? If you have existing systems, then you both have prior knowledge and infrastructure. You should be working on something similar to that, while improving upon any obvious failings. If you're the one who's going to be doing most of the work, you should be the one picking a stack where your knowledge lies already. I'm not going to tell you to go code in ASP because that's not something you have experience with. For personal projects, unless the objective is to learn, then you should pick something you already know (framework OR language), and run with that. If you're going to share the workload, you should pick a common ground.. and by the sound of things, settle on a very firm "Definition of Done" which you both must firmly adhere to (tests and test coverage?) Thirdly - and this is what you wanted to know - you have to pick the right tool for the right job. There wouldn't be so many languages and frameworks out there if everything was created equally. What are you trying to make? Does an existing framework or technology get you most of the way there without months of reinventing the wheel and ending up with bug-filled shitpile? There's not one technology that far exceeds the others (unless we keep talking about ColdFusion), and especially when you start taking about NoSQL vs RDBMS, you're talking about two very different beasts for two very different tasks. In reality, it's perfectly OK to use both of those kinds of databases at the same time on one project, depending on what it is you're trying to do. quote:he was part of an emmy-winning team that built some kind of super-high-availability thing in JSP that broadcast millions of data streams to embedded TV receivers over some kind of proprietary packet stream quote:and he's very firm and loud about what kinds of technologies he will allow on his network. Step 1: What do you need? NoSQL vs SQL Most (all?) NoSQLs don't support relational data, so they're really fantastic as being document stores, and in Mongo's case it can do some crazy fast poo poo with aggregation, high availability and other magic. What you need to ask yourself is do you need relational data or an aggregate-able document store? Going to have users and categories and posts? Probably going to want to go relational. So which one do you pick? You pick the one you know best and doesn't make you angry. Step 2: What do you want? ORM vs raw SQL Most ORMs are great time-savers and bug-killers. Populating entities via an ORM is a breeze, a time saver, and usually makes sure your data doesn't suck balls before it smashes into the database. Loading an entity from the database which has lots of relations can normally be controlled - you can usually specify if you want the relation to be lazy or eagerly loaded. This is certainly the case in Doctrine (PHP), where most my knowledge lies. Most ORMs also allow you to write raw SQL, so you really lose nothing by using an ORM over using a flat DB interface. Having those tools is much better than not. Language and Framework Frameworks save time. Figuring out which framework to use is heavily related to the language and scale of your application. If you become the next facebook or pintrest then you can un-gently caress yourselves later when you have the investment to spend on a massively scalable high-availability setup. Until then, unless your business is live-or-die on a particular aspect, start with whatever works and has the features you need. Figuring out which language to use is normally personal choice. PHP, Ruby, Perl, Python, even JavaScript (alright maybe not javascript) are fine languages. The only part of your post I can comment on is PHP; it gets hammered by script-kiddies because it's so god drat popular. Wordpress, anyone? And then there's arguments for Arguments sake Apache vs Nginx (or lighttpd) I don't even need to make this argument. Apache has a good record, but nginx and lighttpd are quickly taking over. Whats stopping most people? nginx takes a bit more configuration at the server level, rather than the domain-level. Don't take my word for it, how about benchmarks run by a large web hosting company: http://wiki.dreamhost.com/Web_Server_Performance_Comparison Not only is it about speed, its about memory usage and scalability. Linux, FreeBSD..? AWS EC2, CoreOS, Docker, Ansible. gently caress off with your manual server setup. Vagrant to run the same server image locally. Virtualise all of the things. Security of credentials Environment variables seem to be an accepted practice. If you have code injection that allows them to be seen then you have much bigger problems. lovely coding practices MVC is the ground floor these days. If it ain't MVC then you're going to get fired. Why the christing gently caress would you ever read from a table to get an increment ID? This isn't reliable. The second you implement master/slave read/write and scale to meet the traffic demands (or availability requirements) you'll be reading stale data and duplicating IDs. The master is designed to have reliable transactions and increments. Even MongoDB is designed to do this with high availability, where multiples writes go into multiple servers and get resolved at the end, all with unique identifiers. You knew this already. I am just angry about it. And finally, the most important argument that I have to re-iterate: Speed to Market If you're not online then you're not making money. If you're not making money, why the gently caress are you going through this rigmarole? You've already spent time loving about with poo poo that doesn't matter just to prove a point, looked at everything upside down and backwards, and made a thing you're not going to use. What a fantastic waste of your time. If you want to get a flag up, poo poo out a site on SquareSpace or Wordpress and then replace it later with something adequate, but well written, in the democratically selected, peer reviewed and committee appointed language and framework of not-your-choice. Alternatively, build something in half that time by just picking a thing that makes sense. Use said thing. Find bugs. Fix bugs. Release.
|
# ? Mar 4, 2015 04:54 |
|
Data Graham posted:You'll appreciate his favorite technique for building a website that obscures the URL path:
|
# ? Mar 4, 2015 05:16 |
Good points all, and I wish I could print this out along with my Unix History Timeline and have it decorate my office as a shining set of principles by which to live. I don't disagree with any of them. We're not just starting out, though. We're entering our seventh year of this venture and we've got numerous sites in production that have been running for years, developed under this lovely regime which he considers cutting-edge and bulletproof. When we started out I was having to treat IE6 as a mainstream target. Just thinking about that makes me thank my lucky stars that I've got it so easy today. The car analogy image is on-point and apt; thing is, he's adamant about "do it right the first time so we don't have to waste time on this poo poo once it's out in prod". Iterating is anathema to what we do (lots of small projects we have to put rapidly behind us). And some things are simply not negotiable. Colocating or virtualizing the hardware is an absolute non-starter; he wants physical control or bust. We just went through a major migration process to bring the last few straggling servers in-house. Using something like AWS is an "over his dead body" kind of thing. I have to pick my battles. quote:http://wiki.dreamhost.com/Web_Serve...ance_Comparison This is good stuff; just what I was hoping for. Thanks! (Regarding the JSON serialization thing—yeah, I get what they think they're trying to do, but why not even provide an option to serialize as rich objects? If they decided at some arbitrary point late in the game to appoint themselves a bulwark against redundancy and chattiness, they picked a hell of a place to make their stand.)
|
|
# ? Mar 4, 2015 05:48 |
|
Apart from biting your tongue and taking it how it's given, your only other option is to say "Why am I even bothering to try innovate and improve out approach if you're going to tie my hands behind my back about every little thing? Why don't you let me champion this one thing, we can see how it goes, and if it turns out to be a problem by an agreed deadline, then you can say I told you so, and we can do this however you like.". All with your best "I'm going to resign over this" face on.
|
# ? Mar 4, 2015 06:03 |
To this point—v1nce posted:Secondly, you can't have the two of you running a 50/50 democracy if you're not seeing everything eye-to-eye. Who's actually going to be developing and maintaining this thing? His attitude is along the lines of "I will bring my administrative expertise to bear to ensure 100% uptime and make sure nothing ever breaks, provided you code to my standards using my stack. If you want to do your own thing on your own servers, fine, go ahead, but I won't help maintain it and don't come crying to me when it explodes massively. And I will not under any circumstances allow a product with our names on it go into production if it is not a proven system that I know personally to work, and that means no 'frameworks'." I feel like my best chance is to run my own servers (i.e. the art site) according to modern principles and let it "just work" for a good long time, and maybe keep some surreptitious before/after benchmarks for JSP versus Django, just for my own curiosity if nothing else. Sooner or later it'll have proved itself just by continuing to exist while everything else has come and gone. E: ^^ That's pretty close to the tack I've been taking. It provokes many an offended shouting session on his part, which is why I don't like doing it, but I feel like it's got to eventually wear him down. E2: In fact, fairly recently I used almost that exact wording. I told him "Only just in the last few years I've come to feel like I've been able to code with all my fingers, making every little piece of the system sing and dance. And now you're telling me I have to code with my arms taped to my sides." His response was something like, "Yes, but what if your fingers get broken? I have to come in and maintain your stuff, and if I don't know what the hell you're doing with all this convoluted modern poo poo, I might as well start over from scratch." Which is why I have some sympathy for his attitude toward AJAX-heavy designs. If this is what qualifies as "you are better at this than I am" from him, I feel like that may be the clearest possible sign I'll ever get that I should leave well enough alone. Data Graham fucked around with this message at 06:11 on Mar 4, 2015 |
|
# ? Mar 4, 2015 06:03 |
|
If you hand code it, aint nobody going to know how it works. At least if it's written in Symfony2 you could hire someone like me, and I'd go "oh, I get it" inside a few days/weeks depending on how massive the system is. If you dump a framework-less chunk of code in my lap, I'm just going to say "I don't like this. I will never like this". and I'm going to rewrite most of it to my own personal taste, because there's no standard approach. For an IT guy, not being able to support a simple alteration to a standard linux web stack just because its not using your favorite toys really stands as a testament to incompetence, and not much else. I don't care how much domain experience you have. In web, if you stop learning, you're dead. Fake edit: You virtualise on AWS because you can automatically scale to your present needs (including burst, for high traffic events), only paying for exactly what you use.
|
# ? Mar 4, 2015 06:22 |
You don't have to convince me of the virtues of AWS, incidentally. My day job uses it, and it's been a godsend. Spin up multiple dev environments at a moment's notice? Double the available RAM? Snapshot-restore our DB from RDS to an arbitrary point in time right down to the second? No problem. But when it comes to our business, for our own stuff, he wants the blinkenlights right where we've got our cameras on them. But yeah, I harbor fantasies of somehow making him sit down so I can teach him things about how modern MVC/MVT systems work and why they're worth learning. I just put up a giant whiteboard almost solely so I have the option should the opportunity present itself. v1nce posted:NoSQL vs SQL More related to my day job than the present situation, I might have some questions along these lines. We're trying to get into some real-time processing of alert data and chats, and that means we've been digging through the various relevant frameworks, like Meteor, Sails, Firebase, etc. It's looking like Deployd is the thing that most closely matches our needs, and we're going to be trying to integrate it alongside our existing core such that both Deployd and our main Django can talk to the MongoDB backend as a secondary to our existing MySQL. Indexing and searching are big needs for us, which is why Firebase ultimately wouldn't do the job; you don't get any searchability on arbitrary attributes, and if you want to index a different relation you basically need to make a whole separate top-level schema and replicate your data into it. Mongo seems to be able to do it, though. It's all new territory for me, so it should be a fun week. Hoping I don't encounter too much plebbery.
|
|
# ? Mar 4, 2015 06:45 |
|
This is the closest thing to gooninawell.txt I think I've ever seen in COBOL. Unless you're making millions, it sounds like you're wasting your time and talent fighting with an old grump instead of working on a new project. How old are you, and how much actual truth is there to this statement: "There's no disengaging from this." Why not? Data Graham posted:But yeah, I harbor fantasies of somehow making him sit down so I can teach him things about how modern MVC/MVT systems work and why they're worth learning. I just put up a giant whiteboard almost solely so I have the option should the opportunity present itself. Why are you letting him make decisions about anything outside his purview when he doesn't even know how MVC patterns work? If this were really a partnership he would listen to you and give when you have obvious expertise over him on an issue. In reality it sounds like you just have a dick boss. You already seem to know and understand the benefits of all the technologies and practices v1nce and others are talking about, so what are you hoping to get out of this? Ghostlight posted:Sever. kedo fucked around with this message at 20:47 on Mar 4, 2015 |
# ? Mar 4, 2015 18:12 |
Just venting, in part. I know how this all sounds, and I know that in a vacuum (i.e. if this were just Some Job), the answer would be as easy as any other job I've walked away from. But honestly, like I said, I'm trying to get perspectives from people on a purely technical level, so I have something to go to bat with. I haven't interacted with anybody else in my whole career when it comes to either Java/JSP or ColdFusion; it's all just been me floundering in the dark. If people have horror stories (or success stories!) about either platform, I'd love to hear them, even if it's just anecdotal poo poo. I may not ever be able to out-shout him just by saying "I don't like programming in CF"; he'll just accuse me of being lazy. But if I have real things I can point to as reasons why the world is moving away from such platforms, rather than just my gut feelings and personal experiences, I have more of a possibility of making it stick. Like, I've tried saying that I simply can't get my head around Java and Objective-C, no matter how often or how hard I try; and he'll say "bullshit, you're just giving up before you give it a chance, remember how when we got started you were all like I'll never understand X and now you're confidently working with it? All you have to do is try, and if you don't get there, you have only yourself to blame." You know what I mean? I have anecdotal and personal reasons for not wanting to use certain things, but I can't use those in defense. I need an arsenal of technical points I can fall back on when I get backed into a corner (and he's very good at talking hard at me when I don't have facts or ready comebacks at my disposal). Then again, I guess I don't have any reason to believe that beefing up my technical reasoning laundry list will carry any weight when it hasn't in the past. Demonstrations of technical merit/flaws haven't done much to convince him. Maybe, as I've said, the only answer is just to keep assuming more and more control as organically as possible, until he's no longer a meaningful factor. (I'm 39, and I've got hundreds of thousands invested in this, and there is a clear path to success that we're executing. But if I pull out I'm very very hosed.) Data Graham fucked around with this message at 19:35 on Mar 4, 2015 |
|
# ? Mar 4, 2015 19:32 |
|
I wrote an AI to help you formulate a winning argument against himcode:
Have you ever changed his mind on anything?
|
# ? Mar 4, 2015 19:42 |
Not a lot, no. At least, if he has, he hasn't shown or admitted it, or he's couched his capitulation in ways that make it still ring hollow. Example: the way that "vars table"-gate shook out in the end was that, after I made all my arguments and asked where his reasoning was coming from and asked probing questions intended to expose whether he really knew anything about how index fields work (I'm pretty sure he doesn't, I mean, the way he worded things at one point suggested to me that he thinks a primary key is fundamentally faster than another index key), he said something like: "If you want to do it your way, fine. But when it fails, you have to be ready to accept full responsibility for your choice and its consequences, and I won't help you recover from it. It's time to put on the big-boy pants. Either you do it the way we've been doing it, which we know is fine, or you do it however you want to and once it fails you don't ever get to question me and my experience again." If it keeps him happy, I'll keep using a drat vars table. Honestly I'm more willing to undergo a huge catastrophic failure in production once we actually end up sustaining the kind of load he thinks he's ready for, than to change things to "my way" and never have him run across anything that is undeniably his fault and that he can't pin on me. So, no, I don't need to change things; I just feel like I should. I know "what good looks like", in Ray Dalio-ese, and I feel an obligation to make things the best I can. But pragmatism still trumps idealism in the situation we're in, and I'd rather keep a fragile peace than create an atmosphere that's even more tense and unbalanced than when he thinks things are going his way and he isn't being disrespected and attacked and taken advantage of. This seriously isn't what this subforum is for, right, and I really didn't mean to come in here and dump my dumb personal issues on the thread. I was really just hoping to commiserate on a technical level with people who have survived the trenches that I'm slogging through.
|
|
# ? Mar 4, 2015 19:57 |
|
Data Graham posted:If it keeps him happy, I'll keep using a drat vars table. Honestly I'm more willing to undergo a huge catastrophic failure in production once we actually end up sustaining the kind of load he thinks he's ready for, than to change things to "my way" and never have him run across anything that is undeniably his fault and that he can't pin on me. He'll still blame that failure on anyone but himself y'know. But if you're willing to have everything go down in flames (sounds bad to me but it's your business!) then it's probably just not worth worrying yourself over. He sounds like an rear end in a top hat and a bully, and you're either going to have to take him on - and possibly be butting heads non-stop - or just let him call the shots. He doesn't sound like someone who'll accept any advice or ideas that he's not already working with, so why not take up an enjoyable hobby or side project instead? Maybe you could hypnotise him or leave suggestive messages around, work his subconscious so he thinks the new ideas were something he discovered for himself, because he's so smart
|
# ? Mar 4, 2015 20:11 |
That's the kind of thing that has the best chance of success, in my experience. It's win-win
|
|
# ? Mar 4, 2015 20:32 |
|
Data Graham posted:"If you want to do it your way, fine. But when it fails, you have to be ready to accept full responsibility for your choice and its consequences, and I won't help you recover from it. It's time to put on the big-boy pants. Either you do it the way we've been doing it, which we know is fine, or you do it however you want to and once it fails you don't ever get to question me and my experience again." I have some real-world advice for you: as long as you allow him to define that word however he wants, nothing will ever be his fault and you'll be stuck with his bullshit forever. If you want a probably dumb idea for how to get him to shut up, Make a bet. He wins: you wait for him to die to do sane things with software. You win: he shuts the gently caress up about software best practices and just makes the servers not catch fire. Come up with an exactingly detailed spec for a front-end or API or whatever the gently caress it is you do. Define every behavior you can think of: invalid vs valid URL handling, input sanitation, response time and memory usage for ~100 concurrent users writing data over ~10 minutes - anything you can think of. Whichever of you completes it first in the tool set of your choice wins because time is money. You'll probably win while he's off re-inventing the wheel again.
|
# ? Mar 4, 2015 21:23 |
|
Data Graham posted:But if I have real things I can point to as reasons why the world is moving away from such platforms, rather than just my gut feelings and personal experiences, I have more of a possibility of making it stick. If you are representing this fellow correctly, as an FYI I just want to say this has never and will never work with this type of engineer. You have zero chance of convincing him. Zero. I mean, I know you're saying you don't want advice on how to deal with the "social" side of this, but really you're just spinning your (and our) wheels. Either leave the company, force him out of the position to make decisions on this stuff, or suck it up and deal with it.
|
# ? Mar 4, 2015 23:44 |
I know how much it sucks to be trying to help someone and all they do is make excuses. (Lord knows I hear it from him enough.) I apologize for that. The situation continues to evolve, though. Part of why I'm trying to be more proactive about it now is that the server topology is now such that I have more freedom and more of a say in things, so I'm kinda trying to flex a little. So, I'll see how this continues to play out. We'll see what things look like a few months from now. Thanks. E: Deployd is p cool.
|
|
# ? Mar 5, 2015 00:14 |
|
Well there's always the coding horrors thread
|
# ? Mar 5, 2015 00:25 |
|
I don't care what your relationship with this guy is on paper, he's not your partner, he's your boss and he's a dick of one too. Man up.
|
# ? Mar 5, 2015 01:10 |
He treats it more like a military dynamic, actually.
|
|
# ? Mar 5, 2015 01:21 |
|
Yo. I'm a junior in college and landed a pretty laid back internship making a simple website for some financial planning firm. Right now, I'm in the sketching/mock up phase of the design and I have a quick question: So, I've come to understood when you make a header logo for your site, text should never be an image and always text because of screen readers of whatever. My client gave me an image of their logo including both text and an image in one jpeg. Now I know I should keep the logo and find the correct font, but Google Fonts doesn't have it and I'm not willing to pay for a font service. What do I do? It's pretty bad to download self-host a font and make your users download it, right? Should I just keep the text in the image or what?
|
# ? Mar 5, 2015 02:02 |
|
Nothing wrong with it being an image, I think most sites use an image. Just set the alt text appropriately.
|
# ? Mar 5, 2015 02:14 |
Yeah, you don't want to try to recreate a logo from fonts and vector graphics or whatever. A properly designed logo will have specially placed letters and shapes and you won't be able to do it perfectly even if you do find the exact font they used. If you're building a pro site for a company, an incorrectly reproduced logo is as bad as no logo. It's good to design for accessibility, but yeah, all you need to do is set alt="Company Inc." and you're fine.
|
|
# ? Mar 5, 2015 02:29 |
|
TABLES. I've got data in 5 columns: date, amount, etc. I need to sort the different rows by column - I'm doing this using list.js. I also need to expand each row, vertically, so you can view more information about all the things in this row using a simple show/hide. Here's my problem - this has to be built in a table, so what should my markup be for this "more info" section? I need it to be inside its appropriate tr, but I can't create a new row, because the sort function will sort it as a separate row. I've tried nesting it various ways, but it always breaks my sorting. I know this is tables 101, but I'm rusty. Using tables, I need to insert a full-width content area at the bottom of each of these rows. How? pre:<table> <tbody> <tr> <th>Date</th> <th>Description</th> <th>Amount</th> <th>Color</th> <th>Size</th> </tr> <tr> <td>11/12/2012</td> <td>shirt</td> <td>2</td> <td>red</td> <td>small</td> </tr> <tr> <td>06/22/2014</td> <td>shoe</td> <td>1</td> <td>blue</td> <td>medium</td> </tr> <tr> <td>10/03/2015</td> <td>hat</td> <td>1</td> <td>yellow</td> <td>large</td> </tr> </tbody> </table>
|
# ? Mar 5, 2015 02:30 |
|
jackpot posted:Using tables, I need to insert a full-width content area at the bottom of each of these rows. How? pre:<tr><td colspan="5">content</td></tr>
|
# ? Mar 5, 2015 02:37 |
|
Data Graham posted:Yeah, you don't want to try to recreate a logo from fonts and vector graphics or whatever. A properly designed logo will have specially placed letters and shapes and you won't be able to do it perfectly even if you do find the exact font they used. If you're building a pro site for a company, an incorrectly reproduced logo is as bad as no logo. The logo is pretty shittily designed as well because it's very long, but maybe I can place the words under each other or something. Thanks, guys!
|
# ? Mar 5, 2015 02:46 |
|
No, I'm just doing a bad job of describing it. The way I'm doing my sorting - which is probably what needs to change, not the table - treats every tr as a new element to be sorted. So if I put this info in a new tr, then sort it all by date or whatever, that tr is going to separate itself from its parent tr. I'll try to put together a fiddle for it, but really I think I just need a smarter sorting method.
|
# ? Mar 5, 2015 02:47 |
Yeah, I think the sorting is what needs to be tweaked. When I encounter this kind of layout I generally just use a secondary (hidden) row below each one which I can windowshade down to display. Whatever I'm using for sorting has to take that into consideration. (You can even do wacky "2n+1" type CSS stuff to make alternating row colors continue to work properly.) I'm not too familiar with list.js, but does it just operate on the value of a column/cell? What I would look into is setting the cell values as custom attributes on the <tr> blocks, like: <tr class="displayed" value="100" color="red"><td class="value">100</td><td class="color">red</td>...</tr> <tr class="details" value="100" color="red"><td colspan="5"></td></tr> And see if you can modify the list.js code to operate on that attribute instead of the cell values. It doesn't look too impenetrable, and if it's jQuery-based (or if there's a similar utility out there that is), it'll make using the attributes that much easier. Incidentally, you probably want your header cells in a <thead>, not as the first row of your <tbody>. Data Graham fucked around with this message at 03:29 on Mar 5, 2015 |
|
# ? Mar 5, 2015 03:19 |
|
jackpot posted:No, I'm just doing a bad job of describing it. The way I'm doing my sorting - which is probably what needs to change, not the table - treats every tr as a new element to be sorted. So if I put this info in a new tr, then sort it all by date or whatever, that tr is going to separate itself from its parent tr. I'll try to put together a fiddle for it, but really I think I just need a smarter sorting method. Each TD contains two DIVs. The top has the content. The bottom has the 'expanded' info and is hidden or zero height by default. When you add class 'active' or whatever to the row, the bottom div in each cell becomes visible. Detail stays with data in the same row, but it looks like two. I'm phone posting or I'd make a fiddle for you.
|
# ? Mar 5, 2015 06:00 |
|
Lumpy posted:I'm phone posting or I'd make a fiddle for you.
|
# ? Mar 5, 2015 08:01 |
That problem actually reminds me, here's a technical conundrum that has bugged me for years: server side data paging. Say you've got a db table with, like, thousands of rows, way too many to show in the browser all at once. You want to display a table of these rows, sorted by the column of choice, one page at a time (say, 50 rows). It would be nice to do all the sorting and filtering client-side, but I'm not about to go loading 10k rows into Javascript. I want to sort and limit this on the server side. That means being able to display a pager widget that indicates what page you're on, as well as sorting/filtering controls on the columns. The only way I've found to do this is with two queries: one to find how many rows are in the table to begin with (so you can make the pager widget), and one with ORDER BY and LIMIT clauses to show the appropriate page. Both queries have to have the same constraints and joins, otherwise the overall count will be wrong. Does anyone know a more elegant way to do this? Sometimes these queries can be fairly slow (like if I'm doing subselects to get the number of orders per customer or something), and this technique doubles the execution time right when I need it least. I can get away with omitting stuff like the subselects in the preliminary query, which helps, but I feel like there's got to be a better way in general, and probably an obvious-in-retrospect one.
|
|
# ? Mar 5, 2015 13:31 |
|
Data Graham posted:That problem actually reminds me, here's a technical conundrum that has bugged me for years: server side data paging. Pagination?
|
# ? Mar 5, 2015 14:33 |
Yes? I understand the concept, I'm trying to implement it efficiently on the server side. I have a paginate() routine that I've been using in roughly the same form since about 1998 and ported from perl to CF to JSP to PHP to python, but I want to know if there's a better way to do the querying at the heart of it.
|
|
# ? Mar 5, 2015 14:52 |
|
|
# ? May 9, 2024 08:22 |
|
You could use a window function:SQL code:
If the query is expensive this will likely be faster than running it twice.
|
# ? Mar 5, 2015 17:06 |