|
gibbed posted:I RE'd a little bit of the testalib.exe and it appeared to just be XORing the content with a generated table based on the key (this is just from a quick look though, I could be wrong). So yeah, crappy obfuscation. That's how AES-CTR and AES-OFB work, except the table is so fantastically large it's impractical to store.
|
# ¿ Feb 22, 2011 05:44 |
|
|
# ¿ Apr 25, 2024 11:32 |
|
tef posted:to really beat php you have to have it easy to 'deploy' it to oversold shared hosting code:
|
# ¿ Mar 4, 2011 07:15 |
|
Eliza posted:My guess is that Python sees you're trying to manipulate a tuple's values, fails as would be expected, but hands the operation to the value anyway, where it succeeds since it's a mutable. Assigning a[0] with a simple a[0] = <value> fails as would be expected. Nah, it only sees that you're modifying a list. That the list is pointed at by a tuple doesn't even enter consideration.
|
# ¿ Mar 28, 2011 15:39 |
|
AzraelNewtype posted:This is almost certainly backwards. Odds are very high that it's doing the append before attempting the assignment to immutable tuple, rather than throwing an exception but deciding to continue on anyway. List appends aren't in place in python, are they?
|
# ¿ Mar 28, 2011 22:16 |
|
NotShadowStar posted:But XML. scales. like. a. boss. The best part was the simple XSLT used to rename a variable, and Tim Bray crying from laughter in the audience.
|
# ¿ Apr 4, 2011 17:32 |
|
. accepts any character, * is a Kleene star closure, your automata theory textbook should cover all this.
|
# ¿ Apr 13, 2011 01:23 |
|
nielsm posted:It'd be nice to replace those irregular expressions with regular expressions and parser generators... one can wish. This is generally what I do. I find https://github.com/bkerley/crapshoot/blob/master/lib/crapshoot/parser/scan.rl#L19-%23L30 to be more readable than a regexp that could parse the same thing.
|
# ¿ Apr 13, 2011 15:32 |
|
tef posted:no it is totally serious and not tongue in cheek. I wish it was. That's as serious as a drunk clown playing with a rubber chicken.
|
# ¿ May 21, 2011 03:25 |
|
Lumpy posted:I am, and let's just say it's mainly a place for designers. There's so much bad PHP and JavaScript there it's hilarious.
|
# ¿ May 22, 2011 14:53 |
|
Pardot posted:Since we're still talking about fizzbuzz, here is the best solution: Shouldn't rand(4) be the same if you seed it the same every time? Edit: jiggled by trailing if
|
# ¿ May 23, 2011 21:46 |
|
MOOMIN.EXE posted:one of the developers at my jorb used to insist on doing seperate commits on every single file he modified I do that. It makes git bisect more useful than it already is.
|
# ¿ Jun 11, 2011 17:03 |
|
ColdPie posted:I think you are confused.
Yes, broken code with failing tests gets committed. This is why you run tests before building and deploying. At the same time, I can go back to the reasoning for any line of code, the test that explains the reasoning, and see the commit comment for why I did it. Comments get stored in the git history which can be blamed to individual lines and disappear automatically when the lines they refer to are changed. In-line comments can't do that. If something gets broken, I can run git bisect against the particular test that requires that feature until I see where it breaks. I don't worry about repo bloat because commits are really loving cheap in git.
|
# ¿ Jun 11, 2011 19:18 |
|
Ensign Expendable posted:
"ifTrue" and "ifFalse" are methods defined on the True and False classes. Smalltalk owns.
|
# ¿ Jul 7, 2011 15:59 |
|
tef posted:http://futureboy.us/frinkdocs/ I met the creator of that on Saturday during "Crash & Compile" at defcon; they won because one of the teams was a PDP-11 gimmick team that picked their language from a d12, and another team used the other gimmick team's d20 from last year.
|
# ¿ Aug 10, 2011 00:52 |
|
TasteMyHouse posted:This is looking at commit messages, not comments. Still, php devs probably don't use those either. ecommerce-mvc-cms-framework.fixed the colors.backup2.real.zip
|
# ¿ Aug 15, 2011 20:09 |
|
meinstein posted:
Couldn't you use an xpath? code:
|
# ¿ Aug 22, 2011 23:54 |
|
thelightguy posted:Amazingly, there are still hotline servers up, and they're serving up exactly what they were serving back in 2001.... Mac warez and low-res porn jpegs. It's like a blast from the past. "DO NOT DOWNLOAD ANY .SIT OR .HQX IF U WORK FOR THE GOVERNMENT LAW ENFORCEMENT"
|
# ¿ Aug 26, 2011 02:56 |
|
JediGandalf posted:So in this very thread I posted some rather horrific Javascript for a mortgage calculator we use and then attempted to "clean" it up with some jQuery. Well here is my solution: Except for the forums mangling your indentation, that looks pretty much par for the course for jQuery.
|
# ¿ Sep 2, 2011 22:16 |
|
Jabor posted:
Oh duh; this is why I prefer to use the DOM: code:
Cocoa Crispies fucked around with this message at 05:40 on Sep 3, 2011 |
# ¿ Sep 3, 2011 05:37 |
|
pokeyman posted:Speaking of, and here's an opportunity to ask, I've seen code that aligns all preprocessor directives to the left no matter what. So you get stuff like It's probably because preprocessor tokens are "special," since they're more about the implementation of the software than the design of it.
|
# ¿ Sep 6, 2011 23:47 |
|
Biowarfare posted:Why not just use hasChanged && (module1.reload(), module2.reload(), module3.reload(), module4.reload()); Because being cute with short-circuiting is way worse than using an if statement.
|
# ¿ Sep 7, 2011 01:42 |
|
NotShadowStar posted:Introducing goto would also require some very complex rules on the limits of jumping because otherwise somebody is going to do something very hosed up that'll put the stack in a hosed up state that would bring down most interpreted languages. I've used longjmp in a project for a defense contractor. Sleep well.
|
# ¿ Sep 8, 2011 17:38 |
|
Plorkyeran posted:
Take a drink every time you see a for-switch in this thread.
|
# ¿ Sep 9, 2011 19:08 |
|
kalleth posted:
At least move it to the model so you can unit test it.
|
# ¿ Sep 11, 2011 06:24 |
|
kalleth posted:$3 per hour gets you software developers, guys, remember that I have one experience with the cheap kind of developer, and I will never fear offshoring again.
|
# ¿ Sep 11, 2011 18:16 |
|
HardDisk posted:Why's this so awful? How are you supposed to keep track of all that indentation? It's also a 300 line function, which is 200 lines longer than fits on my screen. Something that big could probably be turned into 30 (or fewer) ten-line functions.
|
# ¿ Sep 12, 2011 01:25 |
|
Monkeyseesaw posted:There is a vast gap between the minimal semantic markup it takes to describe for example a news article with navigation menu and the actual markup you need so you can write the set of CSS rules that makes it look half-way decent. That's the very definition of a failed styling language and it should have been immediately obvious to anyone paying attention. Learn to use CSS and HTML better; you'll find that it's not actually as complicated as you believe it is, and your stress level at work will go down. For what it's worth, I don't see huge div stacks on The New York Times, Wired, or Ars Technica beyond what's needed to semantically organize the content. Monkeyseesaw posted:All signs point to us entering a whole new generation of browser wars. I can't loving wait. I mean we *just* got IE on the same page as everybody and now everything's fragmenting again. Everything's fragmenting on frills like WebGL; layout and other important things are stabilizing. JavaScript VMs are getting faster, and JavaScript compatibility libraries are frighteningly commonplace. I'd say for 99% of sites, the features at the intersection of modern Firefox, Chrome, and IE9 are all you need.
|
# ¿ Sep 17, 2011 15:31 |
|
shodanjr_gr posted:This reminds me of this practice that a cooworker who worked for a defence contractor mentioned. http://ruby.sadi.st/Heckle.html
|
# ¿ Sep 21, 2011 22:53 |
|
nielsm posted:"C++ doesn't need garbage collection, because it doesn't produce garbage." C++ doesn't have garbage collection, because it would collect itself!!!
|
# ¿ Sep 26, 2011 19:02 |
|
Bhaal posted:I wish it were the case, and I'm sure he's spent plenty of time on those sorts of things, but his background primarily speaks of php, c# and java Those are prime languages where you want to use break/continue all the time instead of just mapping and reducing the poo poo out of all your things too.
|
# ¿ Oct 4, 2011 00:24 |
|
Tom Preston-Warner of GitHub presented at RubyConf last saturday, and one of his points was "code as if it's going to be open-source." So if you're writing something, make it modular, clean, and don't leave your dingus experiments in.
|
# ¿ Oct 6, 2011 18:06 |
|
Hammerite posted:I just looked up "ActiveRecord" on wiki and it sounds like a terrible idea. How on earth would you perform complicated select queries that involve joins? Why would you ever not write your own SQL? Apart from the building queries using string concatenation + unescaped input, I don't see the basis for your objection. Rails was built for web applications like Basecamp. Most queries in these are pretty simple: select a single entry from one table, and join in the kind of record you'll be iterating over: @author = Author.includes(:posts).find(params[:author_id]) produces SELECT * from author INNER JOIN posts WHERE post.author_id == author.id WHERE author.id == 1; Optimizing the language for the common case (simple queries) is the sane thing to do, especially if you still leave in an interface or two for more complex uses.
|
# ¿ Oct 6, 2011 20:26 |
|
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 |
|
Aleksei Vasiliev posted:make a pull request that just requests the file be deleted Those are the best: "+ 426 additions, - 24,623 deletions" https://github.com/tomdale/everyjs.com/pull/26
|
# ¿ Oct 8, 2011 04:20 |
|
plushpuffin posted:I have to work on an application for which this isn't true, and it's a nightmare. Calling A.B.C.D.E.F is pretty commonplace, and each call always involves a SQL query and a home-made cache implementation (which never, ever removes anything from its cache). Whoa you mean a code horror is in fact a code horror, you don't say? (ps ActiveRecord supremacy:) code:
|
# ¿ Oct 8, 2011 19:49 |
|
Sedro posted:
Why is there a check for if the source is ICollection<T> when you just try treating it as an ICollection next?
|
# ¿ Oct 8, 2011 22:53 |
|
Sedro posted:Because ICollection<T> doesn't implement ICollection ICollection<T> can't even be cast to a ICollection?
|
# ¿ Oct 9, 2011 01:16 |
|
tef posted:i guess you're saying you want type erasure? I want duck typing
|
# ¿ Oct 9, 2011 01:19 |
|
Munkeymon posted:Is it weird that I find the notion of an entry point for a It seems kind of nice to me, actually. Presuming I can put a main in an included file, I can put it at the top of the file, instead of jamming it in at the bottom or using some weird DOM event hooks to trigger it to start.
|
# ¿ Oct 11, 2011 15:11 |
|
|
# ¿ Apr 25, 2024 11:32 |
|
Munkeymon posted:There may be things you want to have done before the DOM is ready and things you will want to do after, so driving that with the regular event system just makes sense. I would agree that it's nice to have main(){} as a shorthand for the code to hook the DOM Ready event (if that's what it actually means - I haven't found that in the docs yet), but jQuery pretty well solved event management problems already. Now what about something you want run after the file is parsed but before the DOM loads? How does jQuery help you put that at the top of the file where you can find it quickly instead of at the bottom?
|
# ¿ Oct 11, 2011 16:26 |