|
yaoi prophet posted:Monkey patching or duck punching. The former is a derivation from 'guerilla patching', and the latter is because if it walks like a duck, but it doesn't quack like a duck, you punch it until it makes the noise you want That isn't monkey patching because he's not modifying a class, he's modifying an instance. I know monkey patching as modifying an existing class and then all instances of that class (and the class itself of course) get whatever modifications you've made regardless of whether you want to or not. I don't know what the name is for that particular feature.
|
# ? Nov 27, 2010 19:35 |
|
|
# ? May 15, 2024 07:33 |
|
Maybe this is my C++ experience working against me but I can't see that as being anything but a bad thing. How would it not cause problems and bugs?
|
# ? Nov 27, 2010 20:04 |
|
ultra-inquisitor posted:What is the name of the language feature that lets type definitions be modified at runtime? eg Prototypes fit this bill (ish)
|
# ? Nov 27, 2010 20:36 |
|
Vino posted:Maybe this is my C++ experience working against me but I can't see that as being anything but a bad thing. How would it not cause problems and bugs? The only example that I've come across in my very limited experience is eventlet for python. It monkey-patches python standard libraries like socket to support async I/O. I guess as far as bugs go, it's just like any other thing you code...issues with it get reported and fixed?
|
# ? Nov 27, 2010 20:58 |
|
Vino posted:Maybe this is my C++ experience working against me but I can't see that as being anything but a bad thing. How would it not cause problems and bugs? Wikipedia posted:Monkey patching is used to:
|
# ? Nov 27, 2010 23:48 |
|
Vino posted:Maybe this is my C++ experience working against me but I can't see that as being anything but a bad thing. How would it not cause problems and bugs? It does cause problems and bugs. Sometimes it is possible to monkey patch when it is not possible to edit. Roughly, when you're monkey patching something else is already broken. At best it is like ad-hoc dependency injection: Use *these* socket libraries instead of the stdlib ones. Other times it is just 'man why doesn't string have this it would be cool' and praying that no-other library wants to add those methods.
|
# ? Nov 28, 2010 14:05 |
|
This is a query about which language/library/whatever is best to use for the task at hand. I have an assignment to produce a "Direct Manipulation" interface. The idea is that the interface will teach the user how to do a task such as making a pizza. To quote my assignment:The Assignment posted:Direct manipulation interfaces draw on users’ real-world knowledge by using representations of concrete objects and hence are believed to make the systems easy to learn. The fact that actions can be undone is intended to encourage users to explore the system. DM interfaces frequently use animation to show the effect of an action and cursor changes to denote the action to be performed. Metaphors may be used when the objects within a system have no obvious concrete representation. The code isn't important. Marks are awarded based on the interface alone. I'm having a hard time deciding what language/library/whatever is best to use. I've been looking into C# but I'm not sure it's the best tool. It's great since it has a lot of the stuff done already, such as buttons though I haven't found a way to make draggable items. I've thought maybe javascript but that seems like a comedy option and I don't have much experience in it. Any ideas? Thanks for the help.
|
# ? Nov 29, 2010 17:43 |
|
I don't know much about it, but I'm pretty sure C# has support for the drag and drop stuff you'd be interested in. The other option you should consider is C++/Qt4. Qt4 makes making a nice looking interface easier than anything else I've tried.
|
# ? Nov 29, 2010 18:11 |
JavaScript doesn't actually sound as a bad idea at all, especially not if you use something like jQuery UI. Flash or Silverlight may also be options. It sounds like graphical quality is important for the project, and I'd say that general desktop application languages/frameworks aren't the most suited for that.
|
|
# ? Nov 29, 2010 18:46 |
|
Thanks a lot for the suggestions. I've gone with the JQuery as it seems pretty simple and does exactly what I need it to do.
|
# ? Nov 30, 2010 00:01 |
|
Is there a library that will let me read a PDF or SVG and let me know the X/Y/width/height coordinates of everything in it? E.g. something that will resolve nested transformation matrices, font sizes and kerning and other font metrics, or any other layout aspects of the format. I guess I'm looking for a PDF renderer with an API where I can query where it's putting things on the page. Does such a thing exist? N.Z.'s Champion fucked around with this message at 02:46 on Dec 1, 2010 |
# ? Nov 30, 2010 23:39 |
|
You guys have discussed monkey patching and duck punching but what about monkey punching? Because that sounds really humourous and cool.
|
# ? Dec 1, 2010 00:57 |
|
Scaramouche posted:You guys have discussed monkey patching and duck punching but what about monkey punching? Because that sounds really humourous and cool. It should probably be something more extreme. Come to think of it, nothing really prohibits __metaclass__ from being called self-recursively in Python....
|
# ? Dec 1, 2010 04:03 |
|
I propose "snake-loving". If an exception is thrown, you have the opportunity to examine and edit the callstack. When you make changes, the runtime modifies the sequence of calling classes so that it would have worked how you describe. Then just try it again. Coming soon to a batshit scripting language near you.
|
# ? Dec 1, 2010 04:08 |
|
Well, that's what we have continuations for, right?
|
# ? Dec 1, 2010 04:14 |
|
Internet Janitor posted:I propose "snake-loving". If an exception is thrown, you have the opportunity to examine and edit the callstack. When you make changes, the runtime modifies the sequence of calling classes so that it would have worked how you describe. Then just try it again. That sounds both awesome and terrible at the same time.
|
# ? Dec 1, 2010 04:25 |
|
Congratulations, you've just badly reimplemented Lisp exceptions.
|
# ? Dec 1, 2010 04:46 |
|
Also available in dylan.
|
# ? Dec 1, 2010 05:16 |
|
Internet Janitor posted:I propose "snake-loving". If an exception is thrown, you have the opportunity to examine and edit the callstack. When you make changes, the runtime modifies the sequence of calling classes so that it would have worked how you describe. Then just try it again. I sort of want to implement this. Actually I think I just want to think about how you'd do it but never actually write anything.
|
# ? Dec 1, 2010 05:59 |
|
Plorkyeran: If you are successful, you could theoretically produce a language in which self-modification and exceptions are the only forms of flow control. God help us all.
|
# ? Dec 1, 2010 06:36 |
|
Well the obvious ultimate extension of the idea is a language where the only two operations are exception throwing and stack rewriting but I have a feeling that if one somehow found a way to make that work it'd be boringly similar to lambda calculus.
|
# ? Dec 1, 2010 07:21 |
|
Plorkyeran posted:I sort of want to implement this. Forget about implementing it. I just want to see the dev hype and the fanboyism and the surrounding something so mind-blowingly wretched.
|
# ? Dec 1, 2010 14:41 |
|
Plorkyeran posted:Well the obvious ultimate extension of the idea is a language where the only two operations are exception throwing and stack rewriting but I have a feeling that if one somehow found a way to make that work it'd be boringly similar to lambda calculus. Well, you see, there isn't a need for an integer type because numbers are represented by the depth of the call stack. /
|
# ? Dec 1, 2010 15:13 |
|
mr_jim posted:Well, you see, there isn't a need for an integer type because numbers are represented by the depth of the call stack. drat you all.
|
# ? Dec 1, 2010 16:43 |
|
Ugh, finding ColdFusion resources sucks. Does anyone know if it's possible to get the value from an existing cookie on another domain using ColdFusion? Wording it like that sounds like a pretty big security hole, but it's worth a shot. I need to check if a cookie exists from another website, because the web-app I'm working on will need to use that session cookie for its calls if it exists, otherwise I have to go through the authentication process to get a session value first.
|
# ? Dec 1, 2010 17:31 |
|
Pleads posted:Ugh, finding ColdFusion resources sucks. The whole point about the address associated with cookies is that they're only given to that particular website. If I had a website which could unconditionally grant cookies, I could pose as the site's vistors on any website they happened to be logged in on - be it a bank or Facebook. So yes, it would be a massive security hole - which is why you can't do it.
|
# ? Dec 1, 2010 17:41 |
|
N.Z.'s Champion posted:Is there a library that will let me read a PDF or SVG and let me know the X/Y/width/height coordinates of everything in it? E.g. something that will resolve nested transformation matrices, font sizes and kerning and other font metrics, or any other layout aspects of the format. I know a different group of devs here uses something like that to rip apart PDFs for our product and I'm fairly sure it's using and API on some piece of Adobe software to extract most of the information you mention. I should mention that I know it still depends on either the PDF having all font information embedded or the local machine having all the font installed or things start coming out wrong, anyway. Edit: sorry I can't be more helpful :\ Munkeymon fucked around with this message at 23:57 on Dec 1, 2010 |
# ? Dec 1, 2010 17:45 |
|
Pleads posted:Does anyone know if it's possible to get the value from an existing cookie on another domain using ColdFusion? The only way to solve your problem requires the third-party domain to tell actively tell your domain the cookie value, (e.g. by writing something like "<img src=http://yourdomain.com/?cookie=0x92323266w436....>" to the browser)
|
# ? Dec 1, 2010 17:46 |
|
I thought so Sadly we don't have access to how the second site sets its cookies despite controlling its license. Hosted solutions Thanks!
|
# ? Dec 1, 2010 18:40 |
|
Let's imagine a hypothetical snake loving implemention in Python. There's a few obvious "practical" applications: VB's greatest contribution to programming, On Error GoTo Next: code:
code:
code:
|
# ? Dec 1, 2010 19:44 |
|
What have I spawned?
|
# ? Dec 1, 2010 21:08 |
|
Plorkyeran posted:Let's imagine a hypothetical snake loving implemention in Python. There's a few obvious "practical" applications: What the gently caress
|
# ? Dec 1, 2010 21:27 |
|
Any suggestions for programs or scripts for custom pasting around a selection? I'm looking to be able to 1) select a word in a plain text file 2) hit a key combination (like Crtl + something) 3) have it enter text before and after my selection. So I select the word "fox" and hit a key, and it turns it into <seg>fox</seg> or whatever I want it to put around the selection.
|
# ? Dec 2, 2010 06:39 |
|
I have extremely rudimentary understanding of programming (I did a tiny bit of C++ programming in high-school (I'm 31 now) and read like 3-4 chapters of teach yourself c++), but have always dreamed of programming my own turn based strategy style of game - most likely in a roguelike style. My question is, how long would it take me to build the knowledge to be able to do something like this - probably in Python because of its friendliness - considering I have a full-time job, house, wife, and dogs? Sorry, bit of a loaded question but I'm just trying to understand if this is a pipe-dream or an actual possibility.
|
# ? Dec 2, 2010 07:02 |
|
Thrombosis posted:Any suggestions for programs or scripts for custom pasting around a selection? I'm looking to be able to If you're using Mac OS X and don't mind copying then pasting the selected text, here's some AppleScript, for which you could set a hotkey with something like FastScripts: code:
|
# ? Dec 2, 2010 07:20 |
|
PotatoManJack posted:I have extremely rudimentary understanding of programming (I did a tiny bit of C++ programming in high-school (I'm 31 now) and read like 3-4 chapters of teach yourself c++), but have always dreamed of programming my own turn based strategy style of game - most likely in a roguelike style. Work your way through Learn Python the Hard Way and you will have everything you need to make your dream project playable. Give yourself a month to work through that book.
|
# ? Dec 2, 2010 07:28 |
|
I'm looking for information about calculating the effective resolution of a display. I'm basically trying to compare a monochrome LCD of a given resolution/size to a grayscale LCD with different resolution/size. I'm going to mock up some different screens in Photoshop but I'd also like to have some 'scientific' data to back up why we really need to splurge on a grayscale LCD for a device.
|
# ? Dec 3, 2010 00:06 |
|
I'm looking at hacking on Clang for a lab project - but all the clang plugin tutorials that I've found appear to be broken for the current svn checkout of llvm/clang. They mainly seem to complain about missing header files, and if I'm lucky, I get complaints about no matching function for call to clang:iagnostic:iagnostic(clang::TextDiagnosticPrinter*&). I know there are a few clang fans around here; anybody know of any better ways of getting my feet wet (taht don't involve sifting through INT_MAX doxygen pages)?
Dijkstracula fucked around with this message at 09:00 on Dec 3, 2010 |
# ? Dec 3, 2010 08:56 |
|
Dijkstracula posted:I'm looking at hacking on Clang for a lab project - but all the clang plugin tutorials that I've found appear to be broken for the current svn checkout of llvm/clang. They mainly seem to complain about missing header files, and if I'm lucky, I get complaints about no matching function for call to clang:iagnostic:iagnostic(clang::TextDiagnosticPrinter*&). I know there are a few clang fans around here; anybody know of any better ways of getting my feet wet (taht don't involve sifting through INT_MAX doxygen pages)? Most Clang and LLVM C++ APIs are pretty unstable; there was a very recent change which moved all the header files in llvm/System to llvm/Support, and some of the code in Diagnostic got split out into a separate object which can be shared between translation units. I suggest using CompilerInstance to create these things; the code in examples/ — e.g. examples/clang-interpreter — is really the best getting-started guide I can suggest. Feel free to PM me or open a thread.
|
# ? Dec 3, 2010 19:13 |
|
|
# ? May 15, 2024 07:33 |
|
I have a messaging system that consumes arbitrary binary sequences from a number of producers. Assuming all producers can read all other producers output, is there a way to uniquely identify producers that makes it impossible for producers to masquerade as other producers that doesn't rely on shared keys?
|
# ? Dec 6, 2010 01:48 |