|
Suspicious Dish posted:Context: this post. Back in the early 90s, Amiga OS programmers called these things "tag lists"! Looks like someone was reminiscing a bit. Of course, that was back before we had fancy associative maps.
|
# ? Feb 5, 2012 16:39 |
|
|
# ? May 16, 2024 18:06 |
|
Flobbster posted:Back in the early 90s, Amiga OS programmers called these things "tag lists"! Looks like someone was reminiscing a bit. I would have been fine if it was [ ["foo", 3], ["bar", 10] ] or even [ "foo", 3, "bar", 10 ]. I fully accept that JSON doesn't have an "ordered map" type. It's just awkward and inconvenient to represent a key/value pair by a JSON dictionary.
|
# ? Feb 5, 2012 17:18 |
|
shrughes posted:You people are hysterical. Why don't you complain about the subtraction operator, that's indistinguishable from a dust particle too. Clearly you have better dust than me. The dust on my screen forms dots not perfectly horizontal bars.
|
# ? Feb 5, 2012 17:39 |
|
xarph posted:Please, PLEASE tell me you have a successful example. Here's my chef program in all its stupid glory - it's a "banana smoothie" recipe that outputs the word "banana" when run on the command line: code:
EDIT: breakin them tables FLEXBONER fucked around with this message at 19:03 on Feb 5, 2012 |
# ? Feb 5, 2012 19:01 |
|
{'foo': 3} isn't even valid JSON
|
# ? Feb 5, 2012 19:12 |
|
Janin posted:{'foo': 3} isn't even valid JSON Oh yeah, JSON requires double quotes for strings. That's not the code's bug, it's mine.
|
# ? Feb 5, 2012 19:14 |
|
Poop Delicatessen posted:Here's my chef program in all its stupid glory - it's a "banana smoothie" recipe that outputs the word "banana" when run on the command line: Only B? What the gently caress would you need to do to get an A?
|
# ? Feb 5, 2012 19:20 |
|
ymgve posted:Only B? What the gently caress would you need to do to get an A? Produce a more interesting output. You have to undrestand, Ian Bogost is a crazy person.
|
# ? Feb 5, 2012 19:25 |
|
Poop Delicatessen posted:Produce a more interesting output. When you say "output", are you referring to the output of the program qua program or the program qua recipe? Hammerite fucked around with this message at 08:52 on Feb 6, 2012 |
# ? Feb 6, 2012 08:50 |
|
Hammerite posted:When you say "output", are you referring to the output of the program qua program or the program qua recipe? The former.
|
# ? Feb 6, 2012 16:34 |
|
Poop Delicatessen posted:The former. Oh come on, I bet if it produced an amazing beef bourguignon and printed "MOO" you'd have got an A. edit: or made a tasty pie and calculated pi
|
# ? Feb 6, 2012 16:48 |
|
"So each node has either a branch or a leaf..." "Wait, what?" code:
edit: Didn't think to describe the body of Branch and Leaf. w00tz0r fucked around with this message at 06:18 on Feb 7, 2012 |
# ? Feb 7, 2012 00:39 |
w00tz0r posted:I guess that's one way to construct a tree. Looks like someone chopped down a forest and left the bits piled up on the ground.
|
|
# ? Feb 7, 2012 00:47 |
|
w00tz0r posted:I guess that's one way to construct a tree. http://www.youtube.com/watch?v=pH5KJZuuyg8#t=1m52s It's a highly attractive "tree" for sure. It almost looks like a hemlock. It's a coat rack.
|
# ? Feb 7, 2012 01:11 |
|
That video made my day.
|
# ? Feb 7, 2012 03:27 |
|
w00tz0r posted:"So each node has either a branch or a leaf..."
|
# ? Feb 7, 2012 04:00 |
|
Volte posted:Haskell programmer found code:
|
# ? Feb 7, 2012 04:04 |
|
I think Branch and Leaf are supposed to inherit from Node or something. Either that or it's an incomplete paste and Branch is what contains the pointer to the subtree. Still really dumb though
|
# ? Feb 7, 2012 06:11 |
|
Volte posted:I think Branch and Leaf are supposed to inherit from Node or something. Either that or it's an incomplete paste and Branch is what contains the pointer to the subtree. Still really dumb though It's the latter, Branch has a pointer to a list of Nodes.
|
# ? Feb 7, 2012 06:14 |
|
That looks like it's supposed to be a tree implemented with discriminated unions.
|
# ? Feb 8, 2012 06:15 |
|
GrumpyDoctor posted:That looks like it's supposed to be a tree implemented with discriminated unions. Isn't it, though? Node has a bool value that can be used to check type. Still, goddamn.
|
# ? Feb 8, 2012 07:16 |
|
The matrix operations on dict python-ideas thread seems to me like it belongs in this thread.julien tayon posted:Proposing vector operations on dict, and acknowledging there was an The details of the proposal make a surprising amount of mathematical sense, but to me (and everyone who replied on the mailing list) the implementation is bizarre. julien tayon posted:
Sturla Molden posted:
I can see how you can view dicts as a sorted set of key-value pairs in terms of the natural ordering of the keys, but this guy doesn't seem to be able to articulate an answer to "why the hell do you want to do this; if you're going to do linear algebra on sparse matrices why don't you use any of the appropriate SciPy classes that benefit from decades' worth of optimization (e.g. using LAPACK)" Maybe he's a genius and the joke's on me, but his inability (or unwillingness) to answer simple questions makes me wonder: julien tayon posted:
(maybe stealth) EDIT: I should have looked closer at that SciPy page -- one of the sparse matrix types is based on a dictionary of keys. It looks like the main advantages of this type are that they're easy to build, certain matrix operations are fast (e.g. addition), and you can very easily transform them to other SciPy matrix types when you need to do anything more advanced. I'm starting to think that the only horror is wanting to include a watered-down version of SciPy matrix manipulation in the standard library. Lysidas fucked around with this message at 18:15 on Feb 8, 2012 |
# ? Feb 8, 2012 18:07 |
|
I don't have the code to actually post, but I'm doing an online submission for a recommendation letter for one of my students' scholarship applications, and as I was reading the instructions (a pretty standard "upload a Word doc or PDF"), I see this thing highlighted in red:quote:Please note that you can not upload documents with more than 7 characters, spaces or symbols. Name your document with a simple name, such as essay.doc In the first place, the way it's written it sounds like the letter, not the filename, can only be 7 characters Secondly, why? If you're accepting arbitrary uploads via HTTP, they can (and probably should) discard the filename provided by the user and rename it using some naming convention anyway. Maybe the back-end server is an old 8.3 DOS machine but they told users to stick with 7 just to be extra safe.
|
# ? Feb 9, 2012 15:18 |
|
deltree windows&.doc
|
# ? Feb 9, 2012 15:41 |
|
Obviously it's because after chaining the numerous if statements to reject every insecure combination they could think of, up to 7 characters, they decided the code was too long.
|
# ? Feb 9, 2012 18:47 |
|
code:
|
# ? Feb 9, 2012 20:16 |
|
Not a coding horror so much as a large-company process horror. Okay, it's a bit of a coding horror as well. I work on a client/server-architected app. Our core-code team handrolled the RPC mechanism between the client & server. This is less terrible than it sounds as there is no "standard" RPC mechanism between the client & server technologies we use. A while back someone got worried that we were sending all the data between the client & server unencrypted. So they implemented an "encrypted" RPC, which is the same as a regular RPC except that all of the data between the client & server is encrypted. I got a call from one of our higher-level tech support guys a few days ago to track down a bug one of our customers was hitting, which was related to an RPC that happened to be encrypted. The root cause turned out to be that the encrypted RPC would silently drop the beginning of the returned data if the response was too large. I dutifully reported this to our core team. The core team refused to fix the bug and asked why we were sending so much data back in the first place. (Nowhere is it documented that there is a size limit on the return value for encrypted RPCs, and there explicitly isn't a size limit on the response for non-encrypted RPCs which the encrypted RPCs are supposed to be a drop-in replacement for.) Now my job is to implement a workaround for this RPC, outside of the RPC. Other users of the encrypted RPC? Better hope they don't start returning too much data. Extra bonus horror: [nah] ozymandOS fucked around with this message at 08:34 on Jan 29, 2016 |
# ? Feb 10, 2012 04:12 |
|
BP posted:Extra bonus horror: the fix we are putting in place is to stop using the encrypted form of the RPC. This is because the "encryption" on the RPC is actually just a keyless transposition/obfuscation, not any real form of encryption. The core team didn't really share this with anyone--we've been transmitting sensitive data with essentially zero security for years. Haha, saw this coming a mile away.
|
# ? Feb 10, 2012 06:17 |
|
BP posted:This is less terrible than it sounds as there is no "standard" RPC mechanism between the client & server technologies we use. Well ok. BP posted:Extra bonus horror: the fix we are putting in place is to stop using the encrypted form of the RPC. This is because the "encryption" on the RPC is actually just a keyless transposition/obfuscation, not any real form of encryption. The core team didn't really share this with anyone--we've been transmitting sensitive data with essentially zero security for years. Yes, roll-your-own encryption. Good idea or the best idea?
|
# ? Feb 10, 2012 07:49 |
|
Clearly the solution is for your team to implement your own encryption and also response-splitting technology on top of the core team's encrypted rpc stuff. There's a reason they call it networking stack!
|
# ? Feb 10, 2012 11:41 |
|
Use their encrypted RPC mechanism to transmit a single bit, then roll your own PPP implementation of top of it. Then you can layer TCP/IP on top of that and finally your own RPC mechanism to top it all off.
|
# ? Feb 10, 2012 14:14 |
|
code:
|
# ? Feb 10, 2012 22:49 |
|
Would it be too generous to suggest that someone forgot to add if (debug) around that garbage?
|
# ? Feb 11, 2012 00:17 |
|
pokeyman posted:Would it be too generous to suggest that someone forgot to add if (debug) around that garbage? Why would you think that? (production)
|
# ? Feb 11, 2012 00:30 |
|
isn't just putting in openssl/gnutls like a 10-line change? why did your team roll their own encryption?
|
# ? Feb 11, 2012 00:50 |
|
I don't even understand the code. It will only use the XFF address if the connection IP address is a LAN address, but not otherwise? In what situations would that happen?
|
# ? Feb 11, 2012 00:52 |
|
Biowarfare posted:Why would you think that? ymgve posted:I don't even understand the code. It will only use the XFF address if the connection IP address is a LAN address, but not otherwise? In what situations would that happen? Debugging is the only situation I came up with, so that's why I thought that.
|
# ? Feb 11, 2012 01:17 |
|
What on earth is it trying to do? I followed it mostly until it got to:code:
Actually even the previous one is always true (if ip is x.168 or octet 3 is < 256 (always)).
|
# ? Feb 11, 2012 01:28 |
|
The Gripper posted:What on earth is it trying to do? I presume it's to do something like allowing X-F-F to be parsed for logging to access.log/error.log or for DB/logins/etc It doesn't actually work. edit: the only thing that that function is called in is to log to access.log on page hit access.log's IPs consist entirely of 10.* LAN IPs. Impotence fucked around with this message at 01:34 on Feb 11, 2012 |
# ? Feb 11, 2012 01:32 |
|
|
# ? May 16, 2024 18:06 |
|
I just thought of a reason why it might be there - if there is a transparent proxy/concentrator in front of the web server, it will allow the server to log the real IPs. Of course, this doesn't work at all since they ignore 10.x.x.x.
|
# ? Feb 11, 2012 01:51 |