|
Sigh. After all my hard work educating and pestering and pesuasive arguments.code:
DONT LEECH IMAGES Somebody fucked around with this message at 20:00 on Oct 7, 2011 |
# ? Oct 7, 2011 09:51 |
|
|
# ? Jun 6, 2024 06:19 |
|
I'm a freelance developer. I sometimes get to play with other people's code and most of the time that's not a problem at all. But sometimes … I had to make a mobile (as in html) version of a website in flash. There's a backend (also in flash) and some php files to communicate to the database. Ok sounds good so far, should be easy. But : - the code is good old spaghetti php. There is a directory called /classes which contains some files with functions in it (not classes, just functions). - the database is horrible. Field names are CamelCased most of the time, but not all of the time. - One table has a field called 'DateCreated', in another table the field is called 'CreationDate'. By this point i'm pleasantly surprised they used a datetime for these fields. O wait no it's not really a datetime, it's a varchar(32). - Boolean's are not stored as tinyint(1)'s, but as a varchar(8). Possible values seem to be 'Yes', 'No' or 'no'. Some of the functions also return FALSE or (string) 'Ok' - Password stored as plaintext: check. - Use $_GET directly in mysql_queries: check - 5 lines of php to try and emulate html_entity_decode(): you bet
|
# ? Oct 7, 2011 10:27 |
|
NotShadowStar posted:Thats the most horrible thing ever. Etsy posted some long treatise on they segmented client site from app side from database side and everybody was in their own fence. Client people received stuff from app people, app people never touched the database but requested procedures from the database people. It sounds loving horrible. SQL style databases are looking like a really bad first choice these days anyway, way to much overhead for really simple stuff. So.. Uhm, I'm taking a course in "Databases" right now at the University and they are forcing us to do basically everything using procedures in Transact-SQL, the application should only be a graphic interface. It feels horrible but can someone give me a quick answer to why exactly?
|
# ? Oct 7, 2011 11:04 |
|
zokie posted:So.. Uhm, I'm taking a course in "Databases" right now at the University and they are forcing us to do basically everything using procedures in Transact-SQL, the application should only be a graphic interface. It feels horrible but can someone give me a quick answer to why exactly? NotShadowStar is wrong. SQL is a terrible language (this is why it feels horrible), but it is well worth learning how to use an RDBMS. When your couch instance gets overloaded you have one option: buy bigger hardware. With an RDBMS you have masses of options, the best part is that the cleanest model is usually the fastest. Stored Procedures are just an abstraction layer, you should write them as you would write any other function, effectively turning domain specific queries into data model queries.
|
# ? Oct 7, 2011 11:17 |
|
NotShadowStar posted:Thats the most horrible thing ever. Etsy posted some long treatise on they segmented client site from app side from database side and everybody was in their own fence. Client people received stuff from app people, app people never touched the database but requested procedures from the database people. It sounds loving horrible. SQL style databases are looking like a really bad first choice these days anyway, way to much overhead for really simple stuff. I like it. It is an api, not an org-chart. It doesn't dictate who can change what
|
# ? Oct 7, 2011 12:20 |
|
P.s I'm not in web-dev
|
# ? Oct 7, 2011 12:22 |
|
code:
I don't know if it's worse that the Cookie library uses old Netscape style cookies or that it fails to parse its own output. Edit: oh man, the timestamp on the source code says 2000 Edit2: Marvel at the responsiveness of the Python community http://bugs.python.org/issue3073 Edit3: Oh look, there's a cookielib module as well. It handles cookies. Does it expose a way of parsing individual cookie headers? Of course not. Edit4: I am now writing a cookie parser and am experiencing the joy once again of constructing python datetime objects with timezones. Zombywuf fucked around with this message at 13:29 on Oct 7, 2011 |
# ? Oct 7, 2011 12:57 |
|
Zombywuf posted:NotShadowStar is wrong. SQL is a terrible language (this is why it feels horrible), but it is well worth learning how to use an RDBMS. When your couch instance gets overloaded you have one option: buy bigger hardware. With an RDBMS you have masses of options, the best part is that the cleanest model is usually the fastest. Stored Procedures are just an abstraction layer, you should write them as you would write any other function, effectively turning domain specific queries into data model queries. Aww look at this post. If you're going to try and be an rear end in a top hat at least get your facts straight. https://github.com/cloudant/bigcouch http://www.mongodb.org/display/DOCS/Sharding+Introduction
|
# ? Oct 7, 2011 13:28 |
|
NotShadowStar posted:Aww look at this post. If you're going to try and be an rear end in a top hat at least get your facts straight. Awww how cute, CouchDB is all grown up. Now the question is why should I use bigcouch over one of the many other clustering solutions such as CouchBase. What's my migration plan? Can I transition online or do I have to take the service down? And most importantly, why didn't I just use a Postgres DB with a normalised schema in the first place?
|
# ? Oct 7, 2011 13:32 |
|
Relational data model => relational database management system Non-relational ("key-value" or "document-based") data model => potentially NoSQL database system Shoehorning one into the other => coding horror
|
# ? Oct 7, 2011 13:37 |
|
Zombywuf posted:Awww how cute, CouchDB is all grown up. Now the question is why should I use bigcouch over one of the many other clustering solutions such as CouchBase. What's my migration plan? Can I transition online or do I have to take the service down? And most importantly, why didn't I just use a Postgres DB with a normalised schema in the first place? I too just always fall back to what I know instead of investigating solutions that fit the problem.
|
# ? Oct 7, 2011 13:52 |
|
NotShadowStar posted:I too just always fall back to what I know instead of investigating solutions that fit the problem. I too assume a person who disagrees with me hasn't spent many months investigating multiple databases with their various tradeoffs. There are valid reasons to use NoSQL databases, but for the most part start with a relational DB unless you have a drat good reason.
|
# ? Oct 7, 2011 14:00 |
|
Why would you want to use a nosquirrel db
|
# ? Oct 7, 2011 14:22 |
|
DISCLAIMER: I WORK FOR A NOSQL COMPANY IN THE ADVOCACY DEPARTMENT AND ALL MY EXPERIENCE IS WITH WEB APPS I recommend people start with Postgres because it's a known quantity and most sites never get big enough to where "scalability" matters. If your poo poo is too slow because it's popular you've already loving won. If you want something that has a fancier model than "some columns," MongoDB is good to start with because it's easy to use on Heroku. If you know you're going to start big (i.e. you're developing software for a business that's already big), you might want to look into the more scalable NoSQL databases like Cassandra (if you can model your data to fit) or Riak (which actually has secondary indices and full-text search now). Stored procedures are big now, but we call them "HTTP APIs that are Rails/Sinatra/whatever apps with no UI that only exist to serve internal clients." Twitter is one of these now.
|
# ? Oct 7, 2011 14:29 |
|
BonzoESC posted:If you know you're going to start big (i.e. you're developing software for a business that's already big), you might want to look into the more scalable NoSQL databases like Cassandra (if you can model your data to fit) or Riak (which actually has secondary indices and full-text search now). Now Riak I approve of, sadly I've never had a chance to use it in anger. I'd really stay away from Cassandra though, it just screams abandonware. Also schema changes can't be done online IIRC. Also if you're doing large scale (like at least a terrabyte, preferably petabyte) data warehousing Vertica is well worth a look. Most NoSQL DB's are specialisations of single aspects of relational databases. Vertica for example is a specialisation of normalisation for data size reduction, if this is your problem then it will do it better than the general system. Riak is a specialisation of sharding, and does it better than the general solution. CouchDB as far as I can tell is a specialisation of "I know javascript so I will use that."
|
# ? Oct 7, 2011 14:46 |
|
Cassandra is great if you use it for its intended purpose: Many, many writes. However, it is an absolute hog when it comes to resources, and is incredibly vague at times. You'll often find yourself wondering if anything is happening at all, simply because the command-line tool hasn't been updated yet, or there's no corresponding JMX Bean for what you want to know about.
|
# ? Oct 7, 2011 14:58 |
|
Zombywuf posted:CouchDB as far as I can tell is a specialisation of "I know javascript so I will use that." CouchDB is a fantastic storage/distribution engine that, regrettably, has been seized by developers and community hell bent on turning it into an end to end application platform. That said, you could do worse if you are writing micro applications that need to be portable in the data availability sense
|
# ? Oct 7, 2011 15:20 |
|
Zombywuf posted:Vertica is well worth a look
|
# ? Oct 7, 2011 15:47 |
|
So we use ESP, which, I guess is kind or like php or asp, except the programming language is Javascript. I don't think that the platform exposes anything of the underlying system, you have to make all your access functions in C and expose them to ESP. Well, I'm supposed to list a bunch of files on the page. There is no read_dir() or list_files()" function, bummer. But someone has made a "system()" function that runs commands in the shell and returns the output. Oh well, I guess I'll just run system("ls -l /some/directory/somewhere"). I get only one result. I find the system() function. After it gets the output from the command, it iterates through it and does code:
There are also getFile() and readFile(), one reads a file into a variable, the other just dumps it into the browser as is. Except both do the same thing as above. I suggested that I'll just implement a "listFiles()" that returns a list of files. Instead I was told to make a script that returns the file list from ls on one line I'm so used to terrible Javascript and html, but somehow I expected the C backend to be maybe buggy, but not insane.
|
# ? Oct 7, 2011 16:21 |
|
Sagacity posted:Is there any code somewhere to look at, or some kind of "getting started" guide? The site is full of buzzwords but there's no way to actually look at anything short of requesting an evaluation. Oh yeah, you have to pay for it. The licensing is pretty reasonable (much cheaper than the hardware you'll be running it on), I remember their sales guys stifling a laugh that we only needed a couple of TB license. The thing about its use of buzzwords is that Vertica started out before "column store" was a buzzword. If you think you might need it (the use case is data warehousing queries that take hours) then you should be able to get an evaluation copy and lots of docs pretty easily.
|
# ? Oct 7, 2011 16:26 |
|
Zombywuf posted:If you think you might need it (the use case is data warehousing queries that take hours) then you should be able to get an evaluation copy and lots of docs pretty easily.
|
# ? Oct 7, 2011 16:29 |
|
Sagacity posted:Ah, fair enough. We're doing OLAP stuff on a fairly small dataset by Big Data standards (about half a terabyte) that needs to be 'live' (i.e. not aggressively cached) and we're just trying to explore a few options. I'm sure they'll have to stifle a few more laughs in our office as well, then Heh, been there. Aggressive normalisation is possible solution, as is buying a lot of disks. Riak may be the way to go depending on workload and consistency requirements.
|
# ? Oct 7, 2011 18:22 |
|
I hate my classmates. INFINITY = 40000 #circumference of the earth
|
# ? Oct 7, 2011 22:19 |
|
Scaevolus posted:I hate my classmates.
|
# ? Oct 7, 2011 22:25 |
|
Scaevolus posted:I hate my classmates. If they're working with diffeomorphisms of the Riemann Sphere this could be considered sort of correct Sort of... By which I mean, not really.
|
# ? Oct 7, 2011 22:25 |
|
Hey, what's 75 (or 8) kilometers between friends?
|
# ? Oct 7, 2011 22:26 |
|
pseudorandom name posted:Hey, what's 75 (or 8) kilometers between friends? actually, what he forgot to tell you is it's in centimetres
|
# ? Oct 7, 2011 22:32 |
|
Sometimes people really want to write Java.code:
|
# ? Oct 7, 2011 22:48 |
|
Scaevolus posted:Sometimes people really want to write Java. And what about that says Java to you?
|
# ? Oct 7, 2011 22:57 |
|
Ugh it too me a second to realize that was actually a function call rather than a syntax error.
|
# ? Oct 7, 2011 22:59 |
|
baquerd posted:And what about that says Java to you?
|
# ? Oct 7, 2011 23:00 |
|
tripwire posted:That's how you cast in java dumbass And about 50 other languages... dumbass.
|
# ? Oct 7, 2011 23:01 |
|
You're exactly the kind of person we're making fun of
|
# ? Oct 7, 2011 23:04 |
|
tripwire posted:You're exactly the kind of people we're making fun of Your powers of deduction are astounding, how did you acquire them? I hope someday I can simultaneously construct generalizations and misrepresentations as well as you do.
|
# ? Oct 7, 2011 23:07 |
|
baquerd posted:And what about that says Java to you?
|
# ? Oct 8, 2011 00:20 |
|
Have you ever wanted to fit your executable inside the ELF header?
|
# ? Oct 8, 2011 00:23 |
|
There's an IRC channel with an IRC bot to coordinate pick up games of 6v6. The first incarnation of the bot worked well, but when a second guy took over the channel he wrote his own bot from scratch rather than maintain the original code. Today the original author was defending his code. He believes it's "perfectly fine", or at least "once you understood how it was built then it was fine". I really hope this guy isn't a professional programmer: https://github.com/550/tf2ib/blob/master/pug.py
|
# ? Oct 8, 2011 01:02 |
|
yaoi prophet posted:Have you ever wanted to fit your executable inside the ELF header?
|
# ? Oct 8, 2011 02:05 |
|
Smugdog Millionaire posted:I really hope this guy isn't a professional programmer: https://github.com/550/tf2ib/blob/master/pug.py
|
# ? Oct 8, 2011 02:07 |
|
|
# ? Jun 6, 2024 06:19 |
|
yaoi prophet posted:Have you ever wanted to fit your executable inside the ELF header? ELF origami. I love it.
|
# ? Oct 8, 2011 02:27 |