|
taqueso posted:They are going to have a lot of typing to do when the number of seconds in a minute changes. (Ya, I know it is generated by a script) Hmm, I'm trying to rationalise this. Could this possibly be so they could change the internal representation to milliseconds or something other than an integer number of seconds? Perhaps for an embedded platform? I've no idea what the context is for this so maybe that's silly.
|
# ? Feb 1, 2012 18:17 |
|
|
# ? May 14, 2024 09:51 |
|
Jonnty posted:Hmm, I'm trying to rationalise this. Could this possibly be so they could change the internal representation to milliseconds or something other than an integer number of seconds? Perhaps for an embedded platform? I've no idea what the context is for this so maybe that's silly. https://github.com/twitter/time_constants/blob/master/README explains it. It's for performance reasons... Seriously?
|
# ? Feb 1, 2012 18:44 |
|
Juuu posted:https://github.com/twitter/time_constants/blob/master/README explains it. It's for performance reasons... Seriously? Twitter has thousands of servers. Having constants loaded when the app loads instead of calculating times during actions saves them real money.
|
# ? Feb 1, 2012 19:09 |
|
The T_#_SECONDS appear stupid, but they only make up 101 lines out of 1208, and are presumably only there for symmetry with non-seconds definitions. T_7_DAYS on the other hand, is obviously more understandable than 25200, less error prone than 60*60*24*7, and faster than doing the math at runtime with a library, as justified in the README. It is perhaps premature optimization (or maybe it was well justified from profiling!), but it's definitely not ' what were they thinking?!'.
|
# ? Feb 1, 2012 19:09 |
|
Zhentar posted:It is perhaps premature optimization (or maybe it was well justified from profiling!), but it's definitely not ' what were they thinking?!'. Ruby time stuff is notoriously slow, and I don't doubt that Twitter Engineering profiled it out.
|
# ? Feb 1, 2012 19:16 |
|
Zhentar posted:The T_#_SECONDS appear stupid, but they only make up 101 lines out of 1208, and are presumably only there for symmetry with non-seconds definitions. T_7_DAYS on the other hand, is obviously more understandable than 25200, less error prone than 60*60*24*7, and faster than doing the math at runtime with a library, as justified in the README. The benchmark compares the constants to a method that converts an integer to a Time object (or something, I'm not a Ruby/ActiveSupport expert) and then back to an integer representing seconds. I doubt the difference compared to a straightforward multiplication would be as significant.
|
# ? Feb 1, 2012 19:24 |
|
Zhentar posted:The T_#_SECONDS appear stupid, but they only make up 101 lines out of 1208, and are presumably only there for symmetry with non-seconds definitions. T_7_DAYS on the other hand, is obviously more understandable than 25200, less error prone than 60*60*24*7, and faster than doing the math at runtime with a library, as justified in the README. They could done macros that calculated the seconds from given time periods, e.g. code:
|
# ? Feb 1, 2012 19:27 |
|
What happens when you let your marketing director hire his buddy to design new products? It's cool: he's a pro with if statements.php:<? $valueAA=e($_GET['valueAA']); $valueBB=e($_GET['valueBB']); if ($valueAA==NULL OR $valueBB==NULL){ $a1900 ="selected='selected'"; $b2012 ="selected='selected'"; $valueAA ="1900"; $valueBB ="2012"; } elseif ($valueAA=="1900"){ $a1900 ="selected='selected'"; } elseif ($valueAA=="1971"){ $a1971 ="selected='selected'"; } elseif ($valueAA=="1972"){ $a1972 ="selected='selected'"; } //... snip elseif ($valueAA=="2012"){ $a2012 ="selected='selected'"; } //repeated for $valueBB ?> Luckily, the actual programmers are able to foist further development off onto a consulting company, so I don't have to fix this mess
|
# ? Feb 1, 2012 20:19 |
|
Mr.Radar posted:They could done macros that calculated the seconds from given time periods, e.g. I would like to know how they are going to a) use macros in a language which has none and b) rely on compilation optimization in a language which is not compiled. (yes I know that the ruby interpreter could do this [and in fact probably does] but I don't know if that's good to rely on if you need the response time that they are apparently aiming for with this library)
|
# ? Feb 1, 2012 20:32 |
|
Look Around You posted:I would like to know how they are going to a) use macros in a language which has none and b) rely on compilation optimization in a language which is not compiled. Oops. I got confused by Dicky B's post into thinking the original code was C. Edit: of course, the answer is to preprocess their Ruby source code with the C preprocessor Mr.Radar fucked around with this message at 20:40 on Feb 1, 2012 |
# ? Feb 1, 2012 20:37 |
|
Which would, of course, not work, because it's not like the C preprocessor does constant folding either (except to resolve #if conditions).
|
# ? Feb 1, 2012 21:06 |
|
rjmccall posted:Which would, of course, not work, because it's not like the C preprocessor does constant folding either (except to resolve #if conditions). Hence the (well, and the fact that Ruby syntax is different enough from C syntax to make it unlikely that most ruby code could be preprocessed correctly if at all).
|
# ? Feb 1, 2012 21:35 |
|
Mr.Radar posted:They could done macros that calculated the seconds from given time periods, e.g. This presupposes that Fixnum's * method is pure and free of side-effects (it's not necessarily so), in addition to the aforementioned lack of a Ruby preprocessor or compiler.
|
# ? Feb 1, 2012 22:32 |
|
Zhentar posted:The T_#_SECONDS appear stupid, but they only make up 101 lines out of 1208, and are presumably only there for symmetry with non-seconds definitions. T_7_DAYS on the other hand, is obviously more understandable than 25200, less error prone than 60*60*24*7, and faster than doing the math at runtime with a library, as justified in the README. Fair enough for seconds, minutes, hours, days and even weeks. But months and years?
|
# ? Feb 2, 2012 09:32 |
|
Why the hell does Twitter need constants for both years and solar years? edit: Skyrim's PC version was compiled without any compiler optimizations. A modder rewrote the x87 code to SSE2 and inlined a bunch of getters and got a boost of ~40% performance. Bethesda has now released a patch that, among other things, "Improved compiler optimization settings" Malloc Voidstar fucked around with this message at 12:08 on Feb 2, 2012 |
# ? Feb 2, 2012 10:54 |
|
Aleksei Vasiliev posted:Why the hell does Twitter need constants for both years and solar years? These are the same chucklefucks who evidently didn't understand what heap fragmentation was on release so you could put a performance counter on virtual bytes and just count the minutes until it hit 2 gb and then Skyrim would crash for some mysterious reason. How much you want to bet that in this patch, they turned on full optimization instead of doing profiling and setting optimization pragmas in the methods that would benefit the most?
|
# ? Feb 2, 2012 14:09 |
|
http://thexploit.com/secdev/critical-php-remote-vulnerability-introduced-in-fix-for-php-hashtable-collision-dos/ tee hee
|
# ? Feb 2, 2012 16:53 |
|
hieronymus posted:These are the same chucklefucks who evidently didn't understand what heap fragmentation was on release so you could put a performance counter on virtual bytes and just count the minutes until it hit 2 gb and then Skyrim would crash for some mysterious reason. They shipped on the PS3. They know exactly what heap fragmentation is. When you have 256MB of system memory to work with it's impossible to release a multiplatform SKU without knowing all about heap fragmentation and doing everything possible to avoid it.
|
# ? Feb 2, 2012 18:37 |
Hughlander posted:They shipped on the PS3. They know exactly what heap fragmentation is. When you have 256MB of system memory to work with it's impossible to release a multiplatform SKU without knowing all about heap fragmentation and doing everything possible to avoid it. Or they had different people working on the PC version of the engine and the PS3 version, and they didn't really talk.
|
|
# ? Feb 2, 2012 18:42 |
|
There are about 10 million electricity meters in Texas. My company keeps a database of these so we know which meter is tied to which address and some other bits of information. I discovered that our process to update this list was: 1. Read one line from the csv file we download every month 2. Delete the record associated with the meter we just read 3. Insert the record for that meter from the file 4. Go to 1 Do this 10 million times and it takes about 30 hours. I rewrote it in about an hour and got a 6000% speed increase
|
# ? Feb 2, 2012 18:43 |
|
nielsm posted:Or they had different people working on the PC version of the engine and the PS3 version, and they didn't really talk. Or maybe they just had a bug in the PC version? No, it must be damning proof of Bethesda's fundamental incompetence. Only they would have the balls to release software with flaws in it.
|
# ? Feb 2, 2012 19:53 |
|
edit: you know, I'm going to retract this because I can't confirm it
raminasi fucked around with this message at 20:27 on Feb 2, 2012 |
# ? Feb 2, 2012 20:24 |
|
If only Bethesda hadn't released game after game that all have exactly the same kinds of bug in them (I've even fallen through the floor a few times in Skyrim so far), because if they had done that then people might be less inclined to poke fun at them. I also heard rumours that the PS3 slowdown bug is due to disk fragmentation related issues. vvvvvv Flying bears are a new bug, complete lockups are an old one, the latter I've seen happen up to 4 times an hour. Also, Ebay say to move CPU intensive operations like joins out of the DB http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf (page 22). This is yet another reason to boycot Ebay. Zombywuf fucked around with this message at 22:32 on Feb 2, 2012 |
# ? Feb 2, 2012 21:31 |
|
Yeah everyone like a good flying bear video, but for a game of such (indeed unprecedented) scale, Skyrim is remarkably low on bugs and doesn't have anything to do with this thread. I think I saw like 2-3 serious bugs in 140 hours of my playthrough. For content, I had a task of fixing an order management system recently. Made by one of the biggest software houses in the region while at it. They put it together using the same component they'd usually use to display tables of 0-50 rows, nd of course their clients didn't bother to check how it would act if the number of rows were 100k+. So every time the user opened the page, the system 1) read from the database into RAM every row of the orders table 2) read from the database into RAM every row of the products table 3) read from the database into RAM every row of the customers table then happily combined, ordered and filtered them as nice Java lists. Repeat the same procedure every time the user clicked anything on the page.
|
# ? Feb 2, 2012 22:26 |
|
I'm sitting here rewriting a bunch of pages for a client for this internal web app that were originally written by their in-house "developer", Frank. The pages are just basic reporting pages but the HTML is probably the worst I've ever seen in my life. For instance, Frank's method of displaying a simple label: code:
|
# ? Feb 2, 2012 22:36 |
|
Zombywuf posted:(I've even fallen through the floor a few times in Skyrim so far) I'm pretty sure every 3d game has "this bug". Fell through the map in Operation Metro last night...
|
# ? Feb 2, 2012 23:16 |
|
I had the wonderful job of cleaning up someone else's mess. The whole system was terrible, but this one little snippet makes me laugh (ASP.NET C#):code:
Anyway, instead of "cleaning up" the solution, I Shift+Deleted it and started from scratch in MVC. My soul was cleansed.
|
# ? Feb 3, 2012 00:00 |
|
mintskoal posted:
|
# ? Feb 3, 2012 00:06 |
|
the last place I worked, we had a vendor: *deliver a $1,000,000 app. As delivered it was an unholy mess of Drupal with Django piled on top of it. It could only service one request per second per XL AWS instance. The company brass figured that this experience meant that this vendor now "really understood our process", and handed them another $1,000,000 contract. They delivered another app. It was also an unholy mess of Drupal with Django piled on top of it. It also required one server per request per second. They used a root-level process to parse cookies with a raw python eval(). They took some of the worst things they did which were obviously in violation of the coding best practices we had specified, and stuck them all in a file called "dragons.py", as in, here there be dragons. They overrode python internals for no reason that they could explain or that we could discern. -------- last week I used a <font> tag in a production app because I was too lazy to do CSS inside a JSP for a one line change. i r not gud webdev.
|
# ? Feb 3, 2012 04:56 |
|
sXe.spengler posted:an unholy mess of Drupal with Django piled on top of it. What? How is that even possible?
|
# ? Feb 3, 2012 05:30 |
|
I just found an old PHP script that used sqlite2. The issue here wasn't sqlite2. It was remote access to it: the other end would exec("rm -rf /tmp/sqdb"); exec("wget -q -O /tmp/sqdb phpurl"); - which would send the entire database, run an insert, then send it back up in a cURL HTTP POST
|
# ? Feb 3, 2012 06:02 |
|
sXe.spengler posted:$1,000,000 app What kind of scope does a $1mil web app have? (serious Q)
|
# ? Feb 3, 2012 06:41 |
|
More importantly, who do I need to fellate to get a contract like that?
|
# ? Feb 3, 2012 06:49 |
|
A 1 million dollar app is around 3 senior developers, 3 junior developers and a manger working for a year once you figure in total cost of employment and other operating costs and a 10% profit margin. You might be able to squeeze in another junior developer if you had everyone telecommute. Common infrastructure like art asset management, quality assurance (whoops), and hardware staff will inflate that bill further.
|
# ? Feb 3, 2012 07:10 |
|
Sinestro posted:What? How is that even possible? Dunno, but I'm currently benignly supporting a server that runs some sort of Drupal/Django mix. So there's at least one more of them. The way the project is going, I'm sure it costs about $1M, but it sure as hell isn't going to make that much.
|
# ? Feb 3, 2012 07:11 |
|
baquerd posted:A 1 million dollar app is around 3 senior developers, 3 junior developers and a manger working for a year once you figure in total cost of employment and other operating costs and a 10% profit margin. You might be able to squeeze in another junior developer if you had everyone telecommute. Common infrastructure like art asset management, quality assurance (whoops), and hardware staff will inflate that bill further.
|
# ? Feb 3, 2012 07:17 |
|
Plorkyeran posted:I was going to object to the notion of 6 devs and a manager with no testers or designers, but on second thought that may not be all that uncommon for enterprise software. Designers as in software architects or art type designers? Developers can totally learn to do the former without a separate person in that role, and some special few can do good graphical design (most, like me, should stay the gently caress away from anything more complicated than colored lines and dots).
|
# ? Feb 3, 2012 07:24 |
|
Zombywuf posted:You're never going to sell me on that semicolon. Would this make you feel better? The last thing is evaluated always returned. Statements are separated by semicolons. if you put a semicolon, and there is nothing after it, what is returned is the evaluation of nothing, which is nil.
|
# ? Feb 3, 2012 07:52 |
|
evensevenone posted:Would this make you feel better? The last thing is evaluated always returned. Statements are separated by semicolons. if you put a semicolon, and there is nothing after it, what is returned is the evaluation of nothing, which is nil. This discussion has passed and I don't have the rust compiler on this computer but is block-keyword { ; stuff } legal? Add to that the fact that a stray semicolon will literally cause a compilation error even if it's in a space where they almost always are legal and you have a problem IMO. edit: and I'm not sure "pay more attention when you code" is applicable here; thinking extremely hard about the placement of a ";" is probably not the best usage of a developer's time. Especially when an extremely subtle one character difference (that looks legal) is a compilation error. edit(again): removed retarded incorrect statement made due to lack of sleep (this is a running theme) Look Around You fucked around with this message at 11:53 on Feb 3, 2012 |
# ? Feb 3, 2012 11:11 |
|
|
# ? May 14, 2024 09:51 |
|
evensevenone posted:Would this make you feel better? The last thing is evaluated always returned. Statements are separated by semicolons. if you put a semicolon, and there is nothing after it, what is returned is the evaluation of nothing, which is nil. No. It's still a major semantic change for what could be a spec of dust on your screen. I don't want to use a language where a bottle of screen cleaner is a debugging tool.
|
# ? Feb 3, 2012 12:03 |