|
Triple Tech posted:Uhh, what does your exposure to Perl have to with it? You could have done the exact same thing, storing an anonymous array as the value of each key. That doesn't really work. In Perl, hash keys aren't real scalars, they're just strings. This means that if you do: code:
You can still store references as hash keys (and I do it occasionally) but it has some heavy caveats. This is what mister_gosh meant. If you're set on doing it though, use Tie::RefHash or Tie::RefHash::Weak which will actually do what you want. Filburt Shellbach fucked around with this message at 16:21 on Mar 27, 2008 |
# ¿ Mar 27, 2008 16:19 |
|
|
# ¿ Apr 29, 2024 12:30 |
|
Triple Tech posted:Clearly not. Oh. I misunderstood. You guys keep saying "the value for each key" and I took that to mean "each key", not "each value". English! Anyway, keying by object is useful, and I do wish Perl supported it better.
|
# ¿ Mar 27, 2008 16:43 |
|
Tots posted:
code:
|
# ¿ Mar 28, 2008 07:58 |
|
I'd just like to point out that Perl has changed in the last decade, so please stop getting your Perl code from Matt's Script Archive. It'd also be nice if people would discuss programming without getting into language debates.. StumblyWumbly: I'd recommend any of Perl, Python, or Ruby. I know Perl can run fine on Windows, but I don't know about the other two. Look up ActiveState Perl or Strawberry Perl.
|
# ¿ Apr 3, 2008 04:37 |
|
Avenging Dentist posted:Does anyone in the world actually do web development exclusively in UNIX? Of course. Firebug is godly.
|
# ¿ Apr 14, 2008 20:04 |
|
Mr.Radar posted:I have a question about automake. My program's source code includes a header file which is automatically derived from another file by a Perl script. I want make to run the Perl script whenever the derived header file is out-of-date (i.e. when its modification timestamp is earlier the one on the file it is derived from). How do I do this? Have a rule that creates the header file from the other_file, and has the header file depend on both the script and other_file: code:
|
# ¿ Jun 1, 2008 21:39 |
|
Terminal.app seems to screw up the basic 16 colors. Turning off bold and using "Use bright colors for bold text" is still not good enough. It also doesn't let you tweak the exact colors you use (except for foreground and background). I can't seem to get rid of the scrollbar. This is totally a nitpick but it's annoying. Even tuning scrollback lines down to zero doesn't hide it. I use screen so I never actually scroll up in the terminal itself. The scrollbar is ugly wasted space. The block cursor does not draw whatever character is under it. Playing with its color's opacity does help, but I shouldn't have to do that. I don't like the other cursor displays because it's harder to find the cursor. iTerm gets these all of these right, so I use it. Unfortunately, it crashes practically every day. But I always run everything in screen, so it's no more than a few seconds of annoyance. Filburt Shellbach fucked around with this message at 13:14 on Jul 10, 2008 |
# ¿ Jul 10, 2008 13:11 |
|
(We have a Perl thread, you know ) One part that's definitely wrong is: code:
If that doesn't fix your bug, please post more code.
|
# ¿ Jul 20, 2008 21:43 |
|
tripwire posted:but I don't want to capture the nested substring because that will fuckup later captures I have to do. Are you sure? In Perl anyway this doesn't apply; each open paren indicates a new capture. As in, open paren in the regex literal. Nesting doesn't create new captures. It becomes really easy to reason about how substrings are being captured once you internalize this. code:
|
# ¿ Oct 8, 2008 15:46 |
|
tripwire posted:This won't work in the posix api because you can't access captured group by name, you have to access them by order in which they appeared. The URI could contain a variable amount of capture groups in it, as could the headers. Please reread my post, because this is exactly the point I address. tripwire posted:Like I posted earlier, If I was using perl I wouldn't have this problem. I'm forced to use the posix regex.h api which doesn't support captures in nearly as easy a way. I know. I was just using Perl as an example. Just try it with your regex library. I bet it'll work.
|
# ¿ Oct 8, 2008 18:12 |
|
The Dissonant posted:I'm interested in doing some AI programming. Anyone know any websites that offer some good exercises for doing this kind of stuff? You're going to want to get a book. I highly recommend Russel and Norvig's AI: A Modern Approach.
|
# ¿ Apr 14, 2009 21:10 |
|
|
# ¿ Apr 29, 2024 12:30 |
|
Vince McMahon posted:Is there perhaps a way to force a redirect from the thumbnail to the high resolution image? No browser would request the thumbnail URI again, and that's such a specific need that I doubt any browser supports it. Could you instead direct your users to click the thumbnail then save that image?
|
# ¿ Apr 22, 2009 11:40 |