|
Mustach posted:Whoah, outside? What kind of language-warring programmer goes out there? Obligatory jargon file link: The Big Room
|
# ¿ Apr 4, 2008 02:03 |
|
|
# ¿ May 6, 2024 19:50 |
|
Lexical Unit posted:JoeNotCharles: Using the shell builtin 'read' may be a more straightforward way to iterate over line-based output code:
|
# ¿ Jun 4, 2008 00:35 |
|
Cody Watts posted:Has anyone worked with this problem before? Can anyone think of a way around it? So far my best guess would be to write the location of the .exe to the registry, and then read and use that value as the working directory when the program starts up. But I'm hoping there's an easier way... You want to use GetModuleFileNameW() to find the canonical path to your running executable, then work your way backward to some directory of interest.
|
# ¿ Jun 9, 2008 17:45 |
|
Free Bees posted:I wrote a script in Ruby where I tried to do some Unix-style forking but it didn't run on my Windows machine. I found out that Windows doesn't support forking, but it must have something similar. What is it and how do I use it in Ruby? Any API provided by your scripting language would be using CreateProcess/CreateProcessEX under the covers -- you shouldn't have to deal with that in your ruby code.
|
# ¿ Jun 19, 2008 03:22 |
|
Clock Explosion posted:and that Java won't let you bind to port 80, they don't notice each other's presence, and thus, the server just stays still, no matter what you do on the HTML page. java can bind to port 80 just fine. Your java server running on some high port isn't going to "notice" connections hitting some webserver on the same system unless you explicitly connect to it. quote:If you need to use sockets on odd ports, I think your only options are PHP(or some other language that you can run server-side like Perl) or a Java applet(which will basically run like poo poo). the applet security context doesn't permit outgoing tcp connections to other hosts/ports.
|
# ¿ Oct 4, 2008 16:05 |
|
Wardhog posted:
since you already have filename, you can just lop it off: dirname=${data%$filename}
|
# ¿ Oct 29, 2008 01:47 |
|
Wardhog posted:You haven't exactly solved my problem, as dirname won't handle Windows-style filenames, but you've suggested another course of action that's looking promising. I didn't mean /usr/bin/dirname, just chose a variable that matches your "filename": code:
|
# ¿ Oct 29, 2008 12:22 |
|
Lexical Unit posted:
Doesn't appear to be the case on 64-bit RHEL5/em64t or 64-bit SLES9/ppc64(I don't have a 64-bit RHEL4 running unfortunately). Net, I believe the symlinks should be there for a _typical_ library. Do you have symlinks for zlib or expat?
|
# ¿ Nov 25, 2008 02:26 |
|
Chib posted:In a Perl regular expression, do you need to escape character a forward slash? If you use something other then / as your delimiter, you can use / as a literal foo =~ m@/foo/bar@/a/b/c@; Note that foo =~ /foo/bar/ is shorthand for m/foo/bar/, but he 'm' becomes mandatory if you pick a different delimiter.
|
# ¿ Jan 25, 2009 00:00 |
|
mistermojo posted:In a C Shell script, how do I output stdout and stderr to a text file (appending it) and display it in the terminal at the same time? for original issue, create_images 2>&1 | tee -a log.txt is a somewhat common idiom. This sends stderr to the same file descriptor as stdout (that tee is already reading). For your followup, create_images is likely waiting for data on stdin -- are you supposed to invoke it with any positional arguments, or feed it data via stdin? a guess about your symptom and how your app wants input: code:
|
# ¿ Feb 4, 2009 15:07 |
|
BDA7DD posted:Nope, that didn't work. It worked so far as that it can now understand what $SRCDIR is, but now the problem is with the $DEFAULTS variable, the script treats it as one single string in the for loop, rather than treating each item separately. I tried removing the escape sequences, still did the same thing. I even tried putting the items in $DEFAULTS into a separate file, newline-separated, and had the script $(cat defaults), $(cat "defaults") and "$(cat defaults)", none of which do what I want them to. Not sure why your separate file didn't work. You should start with smaller, simpler scripts that just echo values -- the script you pastebinned is not in good shape at all. You might find the "IFS" documentation for your shell helpful, or use arrays instead of worrying about the tokenizing. deskchecked array example: code:
|
# ¿ Feb 14, 2009 16:31 |
|
MrMoo posted:There is no need at all unless you are moving to IA64. OP is on Solaris. Most scrap Solaris hardware is 64-bit capable.
|
# ¿ Aug 14, 2009 20:25 |
|
tef posted:is there a tee equivilent in the shell you are using? FWIW a native tee.exe is included in http://unxutils.sourceforge.net/. Not sure it's applicable to cmd.exe, but watch out for changing the exit code of your pipeline with tee.
|
# ¿ Aug 20, 2009 19:32 |
|
fletcher posted:You could do it with a regex but most languages have a URL class to assist with something like this, you may want to look for one. Any built-in is going to have a hard time with this notion of a "base site" being some substring of the domain/host. edit: using it at least getting down to to the hostname with a URL class makes perfect sense, didn't intend to criticise your specific followup. covener fucked around with this message at 02:10 on Oct 24, 2009 |
# ¿ Oct 24, 2009 02:06 |
|
Alcool Tue posted:Perhaps the stupidest question yet posed: not so sure what you're expecting, but here's 3 things to play with code:
|
# ¿ Jan 7, 2010 04:14 |
|
shrughes posted:If it's a hash of a filename you could probably reverse it, unless it's a weirdly long and peculiar filename. Can you elaborate on what you mean here? Do you just mean by guessing hash algorithms and cycling through filenames to see if you can generate a match?
|
# ¿ Feb 9, 2010 13:38 |
|
TheGopher posted:I know basic C concepts. Stuff like pointers, arrays, defining classes, typecasting, etc. Basic stuff. I have no idea where to go from here. To be clear, C is the only language I'm familiar with. I could probably get to the same point with another language with minimal effort because I really understand what I've been taught. TheGopher posted:CarlH (the author of those tutorials) wrote some pretty comprehensive information about programming. If you're about 8 hours into "learning C in 24 hours", you can't really make that call.
|
# ¿ Apr 19, 2010 13:42 |
|
code:
|
# ¿ May 28, 2010 17:34 |
|
Jam2 posted:How do I fix this error? I have gcc 4.2.1 installed. Make sure you don't have environment variable "CC" set to gcc-4.0. Just unset it, and find the dot-file it was set in, rather than replacing the value.
|
# ¿ Apr 21, 2011 15:03 |
|
Munkeymon posted:Alright, I'm not sure where this goes, so I'll just put it here and hopefully it'll get seen. I confirm that the last one ought to match, unless you're confused about what you're getting over the wire. If these rules are in <virtualhost> context,and not htaccess/Directory, the anchor is wrong since what you're matching against will always start with a slash (you can just add it the slash)
|
# ¿ May 3, 2011 18:52 |
|
Munkeymon posted:It's not in <virualhost>. I think the problem may be that my test machine is Windows so ? just isn't a valid character in a path because when I do this: I'm not entirely clear on the applicability of this to the original problem, in this context the bare ? would terminate the URL-path and start the substituted query string. Perhaps the common thread is that you have some windows specific thing blowing up long before htaccess rewritess can even be processed due to the invalid URI->FS mapping. In that case, you should move your rewrites out of htaccess/Directory and into VirtualHost context -- they run earlier there in the Apache API. Fix the anchor and tack on a PT flag as well.
|
# ¿ May 3, 2011 19:43 |
|
Munkeymon posted:We don't use virtual hosts by decree from on high, so I'm not even going to try setting one up for a test. The equivalent to VH context in that case would simply be at the bottom of your apache configuration, not inside any other context -- which acts as like a catch-all vhost. This would get your rules running earlier.
|
# ¿ May 4, 2011 02:58 |
|
Strong Sauce posted:Edit: OK nevermind, I think I mean the normal console version of vim in Windows. Seems gVim works but vim messes up the colors. Anyone know why vim isn't getting it right but gVim is? try in a better console, like the native rxvt from cygwin?
|
# ¿ Mar 29, 2012 11:38 |
|
The Gripper posted:Agreed, if the server crashed it wasn't because of the scrape. Downloading 5000 images is not a huge load by any means, and from your description it sounds like you were requesting one image at a time which wouldn't even put a noticeable load on the server. and "how many images were downloaded over the previous 10 days, and the next 10?"
|
# ¿ Mar 8, 2013 17:39 |
|
Illusive gently caress Man posted:Not exactly a programming question, but how do people go about getting their head around large open source projects? Is there an IDE that can help me somehow? It's a little difficult when I just want to find out where a function is called from, or where a function/variable/constant is declared/defined and it seems like the only way is to either debug it and look at the call stack in gdb, or to open every single #include and 'find in all open files' I'd suggest checking out a a quick cscope howto.
|
# ¿ Mar 23, 2013 20:03 |
|
|
# ¿ May 6, 2024 19:50 |
|
DholmbladRU posted:
You should only have 1 Listen for that port. Apache doesn't track/merge them to avoid trying to bind twice to the same port. You get the same error as if some other service was already bound to that port
|
# ¿ Dec 5, 2014 22:41 |