|
https://github.com/godlygeek/tabular This also works well, though I never could figure out how to align properly on '=>'.
|
# ? Jul 28, 2013 14:03 |
|
|
# ? Jun 8, 2024 07:42 |
|
I haven't tried tabular. With Align that's as simple as typing :Align =>
|
# ? Jul 28, 2013 14:40 |
|
fidel sarcastro posted:https://github.com/godlygeek/tabular code:
|
# ? Jul 28, 2013 16:50 |
|
Tabularize (and I imagine Align) work by searching up and down till they hit lines that don't match the aligning characters, so usually they don't need a selection. I use tabularize a lot for my CSS, makes it much nicer to read by left aligning all the properties, it just kicks in whenever I type <property-name>: , not entirely necessary but since the automation tools are there, may as well use them.
|
# ? Jul 28, 2013 22:04 |
|
feedmegin posted:Hard drive? My first code was on a zx spectrum's tape drive somewhere. Kids these days I still have a pile of C30 cassettes for my old zx81...
|
# ? Jul 29, 2013 12:58 |
|
Volte posted:Here is a picture of that assignment I found. It was so ridiculous I just had to take a photo (sorry it was from before I owned a phone with a decent camera). The assignment was to take an integer and print the word representation of it, which I did by recursively breaking the number up into three digit groups. The correct way was a massive case statement. When I confronted him about it he babbled something about not understanding my code and that he couldn't read the comments because they weren't green and so he couldn't tell where the comments stopped and the code began. I failed this assignment, other people got 100% even if their code didn't compile or make sense. I feel you buddy. I had a CS course where the professor (who didn't know what she was on about and was clearly teaching because she couldn't hack it as an engineer) was talking about something... unfortunately I can't remember the exact case. Anyways, she mentions it during class, and I raise my hand, and I point out, "yeah, I'm not sure that's true. In practice, wouldn't it be better if ____ ?" she responded with a general "no this is better" and just ignored me, but I countered with "Yeah I'm pretty sure I could get a Knuth quote telling you the exact opposite" and she just kinda hand-waived it away "oh sure sure". Then we get the midterm, and that exact situation comes up as a question. I know she just wants me to say "Yes because..." but I take the time to say "No; you could say ____ but ____" and I give all my examples, I quote Knuth and poo poo, I write up two pages front and back explaining every nuance of the issue. I get my midterm back, and I got 0 points for that question. Kid next to me just wrote "Yes." and got full credit. I went to argue with her, and she just said "come to me during my office hours". I went to her office, and she's out of town for two weeks. She comes back, I go to her office, and "Oh this test was two weeks ago, its too late to dispute" Some professors really hate that their job involves education. Zaphod42 fucked around with this message at 18:40 on Jul 29, 2013 |
# ? Jul 29, 2013 18:33 |
|
Zaphod42 posted:hosed up story That poo poo is worth going to the dean over, dude.
|
# ? Jul 29, 2013 19:10 |
|
Dicky B posted:I haven't tried tabular. With Align that's as simple as typing :Align => Apparently it's just as easy in Tabular (:Tabularize /=>/), but it didn't work using the shortcut set up in spf13. It's me, guys. I'm the coding horror.
|
# ? Jul 29, 2013 20:38 |
|
Beamed posted:That poo poo is worth going to the dean over, dude. I almost did, but I had just previously had an experience where the school charged me $200 for a late fee, even though I shouldn't be charged the late fee, tell me there was nothing I could do about it, and then shuffle me back and forth between two different departments until I gave up. As a result, I could barely afford to eat for awhile.(poor college student, paying my own way by working through college) So at first I was like "I'm mad as hell, and I'm not going to take it anymore!" but after awhile it was just "gently caress, I'm going to get a decent grade in that class anyways, but there's things for other courses that need more of my attention than raising a stink to the dean..." Yeah I guess I should have. Although I'd probably have just been ignored.
|
# ? Jul 29, 2013 21:26 |
|
There's a similar plugin called sublime align for sublime text if anyone else uses that.
|
# ? Jul 29, 2013 22:23 |
|
Here's a fun one I ran into the other day - as best as I can remember:php:<? $query = "declare @insertquery NVARCHAR='BULK INSERT mytable from '".db_escape($file) . "'with (fieldterminator=char(9), rowterminator=char(10), FORMATFILE='" . db_escape($fmtfile) . "'); EXEC @insertquery;"; $db->execute($query); ?> Now, I know how this got written - they probably wrote the bulk insert query in SQL server (where you can't dynamically specify the file to bulk insert using a variable). But... then they ended up writing dynamic SQL within a PHP string. I nearly had to leave for the day. I found this little masterpiece after my company switched the way we escape strings to start using unicode, and all of a sudden there was an unexpected 'N' appearing in the query making it fail - for the unfamiliar, MSSQL specifies unicode strings like N'My String'. (and yes, not using PDO/prepared statements is another horror) The Velour Fog fucked around with this message at 03:48 on Jul 30, 2013 |
# ? Jul 30, 2013 03:45 |
|
I've never seen such terrible code as written by people for the Microchip PIC series of processors. It's honestly a flat out blacklist for me if I find that a potential contractor uses them. They seem to be universally used by hobbyists who ask other hobbyists for examples of how to do things and the terrible code festers and breeds on their forums.code:
code:
Before you ask, of course he uses a case statement for the dozens of possible Rx_PC_Command options, right? code:
But Harik, you might ask, obviously with a complex user interface there would be protocol documentation, right? Of course there is - in the form of an email giving usage examples for a handful of the commands. The rest is an adventure in code spelunking. code:
Of course, the coup-de-grace on that last little snippet: code:
code:
Oh, you may think he's not following convention and using mixed-case in defines - nope, any named position offset is a variable in the .data section that's not marked const. All the #defines in the project are obviously cut&paste from examples, followed by this beauty: code:
It also follows the Microchip PIC project management convention perfectly: the entirety of main_project_file.c code:
Oh and just for good measure, how about some random memory corruption? code:
A remote-activated shock collar for people. I'm sure nothing will go wrong. Thankfully the redesign is with a different processor specifically so they won't try to get me to reuse any of this poo poo. Edit: Sorry about the wide-post, preview showed the [code] box just truncating that dumb array. Harik fucked around with this message at 04:09 on Jul 30, 2013 |
# ? Jul 30, 2013 03:55 |
|
Harik posted:But Harik, you might ask, obviously with a complex user interface there would be protocol documentation, right? Of course there is - in the form of an email giving usage examples for a handful of the commands. The rest is an adventure in code spelunking. This is attitude is loving prevalent in the perl community. http://search.cpan.org/~nigelm/HTML-Scrubber-0.09/lib/HTML/Scrubber.pm#METHODS posted:First a note on documentation: just study the EXAMPLE below. It's all the documentation you could need
|
# ? Jul 30, 2013 04:55 |
|
Zaphod42 posted:I almost did, but I had just previously had an experience where the school charged me $200 for a late fee, even though I shouldn't be charged the late fee, tell me there was nothing I could do about it, and then shuffle me back and forth between two different departments until I gave up. As a result, I could barely afford to eat for awhile.(poor college student, paying my own way by working through college) He doesn't actually think you should go to the dean, he's making fun of you for being an awful turd who argues with the professor and quotes Knuth in an intro to loving programming class. You're That Guy that everyone rolls their eyes at and complains about and sighs forlornly when they see on the first day of a new class.
|
# ? Jul 30, 2013 06:08 |
|
Ephphatha posted:This is attitude is loving prevalent in the perl community. I like how this is the part you take notice of. The code quality on this entire project is amazing. Looking over at the server side, It's both hideously over-engineered and under-designed at the same time with things "future proofed" in 4 layers of abstraction, yet trying to do anything requires either 100% top-down refactoring or hacking a side-channel through most of it. A perfect storm of scope creep, demo-itis and fresh CS grads first solo design coming together in one unmanageable mess.
|
# ? Jul 30, 2013 06:41 |
|
It's what I do all day . I'd give examples of some of the code I work on but I haven't met anyone (outside of coworkers) who even knows what SQR is without googling yet.
|
# ? Jul 30, 2013 07:49 |
|
Ephphatha posted:This is attitude is loving prevalent in the perl community. (edited because I don't want to start another petty argument) Gazpacho fucked around with this message at 09:10 on Jul 30, 2013 |
# ? Jul 30, 2013 09:02 |
|
Ruby, everyone: http://ruby-doc.org/stdlib-1.9.3/libdoc/digest/rdoc/Digest/HMAC.htmlRuby docs posted:CAUTION: Use of this library is discouraged, because this implementation was meant to be experimental but somehow got into the 1.9 series without being noticed. Please use OpenSSL::HMAC in the “openssl” library instead.
|
# ? Jul 30, 2013 16:36 |
|
Zaphod42 posted:I feel you buddy. I had a CS course where the professor (who didn't know what she was on about and was clearly teaching because she couldn't hack it as an engineer) was talking about something... unfortunately I can't remember the exact case. Yeah, uh, maybe you should have quoted someone who knows what he's talking about, not this "Professor Knuth" guy who apparently couldn't even hack it as an engineer.
|
# ? Jul 30, 2013 16:58 |
|
Deus Rex posted:Yeah, uh, maybe you should have quoted someone who knows what he's talking about, not this "Professor Knuth" guy who apparently couldn't even hack it as an engineer. But how awesome was Dragon's Lair?
|
# ? Jul 30, 2013 17:04 |
|
I had a professor demonstrate how to use a membership function for some arbitrary data structure to find a member in O(n) time by removing members until the function returns false. I couldn't see in what plausible scenario that would actually be better than simply traversing the structure but I still dropped it when it wasn't going anywhere. In retrospect maybe she was trying to show that the upper limit for a search in a data structure with a O(1) membership function is O(n) but if it was she was wording it really weirdly.
|
# ? Jul 30, 2013 17:20 |
|
Volte posted:Here is a picture of that assignment I found. It was so ridiculous I just had to take a photo (sorry it was from before I owned a phone with a decent camera). The assignment was to take an integer and print the word representation of it, which I did by recursively breaking the number up into three digit groups. The correct way was a massive case statement. When I confronted him about it he babbled something about not understanding my code and that he couldn't read the comments because they weren't green and so he couldn't tell where the comments stopped and the code began. I failed this assignment, other people got 100% even if their code didn't compile or make sense. In more general terms, this is a major reason why I transferred from a large general university to a small technical school for my bachelor's. I have nothing against grad students, but they tend to know gently caress-all and care about your success even less. In my first school I think I saw most of my professors a total of three times: once on the first day of the term, once for the midterm, and once for the final. Edit: Wow, I didn't pay attention to what page I was on. Sorry =/ Che Delilas fucked around with this message at 18:04 on Jul 30, 2013 |
# ? Jul 30, 2013 18:02 |
|
Harik posted:I like how this is the part you take notice of. That's how overdesigned things tend to work out. I don't think I've ever seen preemptive abstraction that actually turned out to be the correct abstraction once it was actually needed.
|
# ? Jul 30, 2013 18:56 |
|
Plorkyeran posted:That's how overdesigned things tend to work out. I don't think I've ever seen preemptive abstraction that actually turned out to be the correct abstraction once it was actually needed. If a programming team is reasonably skilled coming up with sensible solutions as they are needed wouldn't be that much of a burden as long as refactoring time is budgeted for.
|
# ? Jul 31, 2013 00:42 |
|
Bunny Cuddlin posted:Ruby, everyone: http://ruby-doc.org/stdlib-1.9.3/libdoc/digest/rdoc/Digest/HMAC.html
|
# ? Jul 31, 2013 01:42 |
|
Isilkor posted:Is there a reason they can't just replace (what I assume is) their own implementation of HMAC with a small wrapper around OpenSSL, since they're already recommending that and it's part of the standard library? Why bother with continuously updating the wrapper when it shouldn't be there in the first place? I imagine they want to just totally yank this out of the next version.
|
# ? Jul 31, 2013 02:07 |
|
Doing some refactoring of my own old code and came across this gem:php:<? else { // Something that can't own an Item owns this Item return false; } ?>
|
# ? Jul 31, 2013 13:12 |
|
Isilkor posted:Is there a reason they can't just replace (what I assume is) their own implementation of HMAC with a small wrapper around OpenSSL, since they're already recommending that and it's part of the standard library? OpenSSL probably isn't a required library to run ruby? Ruby compiles on targets/platforms that OpenSSL doesn't? OpenSSLs license isn't compatible with Rubys at the source level? Could be any of them.
|
# ? Jul 31, 2013 14:53 |
|
Hughlander posted:OpenSSLs license isn't compatible with Rubys at the source level? Actually, Ruby and OpenSSL is fine, but Ruby scripts that are GPL licensed (without an OpenSSL linking exception), or Ruby scripts that use a GPLed module, cannot be lawfully distributed if they also link (actually, load) OpenSSL. Thus use of the OpenSSL module in Ruby must be very explicit. Amusingly, as Ruby does runtime "linking", the common interpretation of license issues means this program is not lawful to distribute: code:
|
# ? Jul 31, 2013 17:37 |
|
Scaramouche posted:Man I can't believe you guys aren't down with your latin selves. I thought every programmer was classically educated. I had a developer get pissy at me because I used the term "ex post facto" in a document.
|
# ? Jul 31, 2013 22:41 |
|
Pixelboy posted:I had a developer get pissy at me because I used the term "ex post facto" in a document. Why the gently caress would you?
|
# ? Aug 1, 2013 01:14 |
|
ExcessBLarg! posted:Actually, Ruby and OpenSSL is fine, but Ruby scripts that are GPL licensed (without an OpenSSL linking exception), or Ruby scripts that use a GPLed module, cannot be lawfully distributed if they also link (actually, load) OpenSSL. Thus use of the OpenSSL module in Ruby must be very explicit. Amusingly, as Ruby does runtime "linking", the common interpretation of license issues means this program is not lawful to distribute:
|
# ? Aug 1, 2013 04:47 |
|
Gazpacho posted:Anyone claiming that the GPL prohibits a program licensed under it from linking to OpenSSL at runtime is just wrong. The OpenSSL license requires that all software using it must include a blurb in the docs, like the four-clause BSD license. That clause is incompatible with the GPL, which requires that any linked software have terms that impose no more conditions than the GPL itself. The FSF interpretation of GPL linking with regard to dynamic languages is that there is no such thing as dynamic linking in that context. That is, effectively a single statically linked binary is created every time the script runs. Therefore, yes, under the FSF's own interpretation of the GPL requirements, that snippet of Ruby is a GPL violation because the resulting software has contradictory license terms. Nobody gives a poo poo if you do this with your own code, but the instant you begin distributing the conflicted script, you create confusion and possible legal issues. If the FSF's interpretation of the linking issue in dynamic languages wasn't so silly, it wouldn't be a problem.
|
# ? Aug 1, 2013 05:26 |
|
My recent coding horror:code:
|
# ? Aug 1, 2013 07:20 |
|
McGlockenshire posted:The OpenSSL license requires that all software using it must include a blurb in the docs, like the four-clause BSD license. That clause is incompatible with the GPL, which requires that any linked software have terms that impose no more conditions than the GPL itself. The GPLv2 posted:You may not impose any further restrictions on the recipients' exercise of the rights granted herein. The BSD license requires attribution and the copyright notice. The GPL requires attribution and an appropriate copyright notice. I'm not seeing the conflict.
|
# ? Aug 1, 2013 13:24 |
|
Zombywuf posted:The BSD license requires attribution and the copyright notice. The GPL requires attribution and an appropriate copyright notice. I'm not seeing the conflict. quote:Copyright (c) <year>, <copyright holder> He specifically referred to the above 4-clause BSD, which requires considerably more than attribution (which is the reason nobody's used it in years, moving on to 3- and 2-clause variants of the BSD license or other permissive licenses like the MIT and ISC licenses.
|
# ? Aug 1, 2013 14:04 |
|
McGlockenshire posted:The FSF interpretation of GPL linking with regard to dynamic languages is that there is no such thing as dynamic linking in that context. That is, effectively a single statically linked binary is created every time the script runs. Therefore, yes, under the FSF's own interpretation of the GPL requirements, that snippet of Ruby is a GPL violation because the resulting software has contradictory license terms.
|
# ? Aug 1, 2013 16:23 |
|
from one of our scss filescode:
|
# ? Aug 2, 2013 00:31 |
|
Ronald Raiden posted:from one of our scss files Well at least it's honest!
|
# ? Aug 2, 2013 20:18 |
|
|
# ? Jun 8, 2024 07:42 |
|
The readme for some example code from a 3rd party vendor we're integrating with posted:The PHP library source code and example is so lucid, it can practically serve as its own documentation That is pretty much the entire document, which was a .docx. The code is not lucid. I'd post some examples but it's under NDA, presumably to prevent merciless mocking on coding forums.
|
# ? Aug 5, 2013 11:47 |