Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Mario
Oct 29, 2006
It's-a-me!

Thermopyle posted:

Yeah, I don't get it either. Could it have anything to do with 64/32 bit? I'm going to try on some other win7 and vista pc's I have in a little bit...

edit: Yeah, it works fine on a Vista 32 bit computer I have. I'll do some googlin' and see if I can't find an issue related to 64/32 and printf.
Tried it and it's the same on Win7 64, but adding fflush(stdout); before returning from main made it work (compiled with MS VC++ 10).

Adbot
ADBOT LOVES YOU

Mario
Oct 29, 2006
It's-a-me!
If you're on Windows, this PowerShell script should work (at your own risk)
code:
$winrar = "C:\Program Files\WinRAR\Rar.exe"

foreach($file in Get-Childitem . -Exclude "*.rar" | Where-Object {!$_.PSIsContainer})
{
	$outputFileName = $file.BaseName + " [" + $file.Extension.Replace(".", "") + "]"
	& $winrar a -df $outputFileName $file.Name
}
You need to have WinRAR installed and the first line has to point to its command line executable.

Mario
Oct 29, 2006
It's-a-me!

Sagers posted:

I'd like to request a Greasemonkey script that automatically reveals spoilers on the SA forums without having to mouseover.

How about a Stylish script instead? This is just a quick one tested in Firefox that should cover most spoilers; there's probably a few things it misses though:
CSS code:
@namespace url([url]http://www.w3.org/1999/xhtml[/url]);

@-moz-document domain("forums.somethingawful.com") {
    .bbc-spoiler, .bbc-spoiler li {
        background-color: #FAFAFA !important;
        box-shadow: none !important;
        cursor: pointer !important;
    }
    
    .bbc-spoiler img {
        visibility: visible !important;
    }
}
e: This one will show them all without doing anything, I realize now you might have wanted a button to reveal on demand.

Mario fucked around with this message at 03:50 on Sep 5, 2013

Mario
Oct 29, 2006
It's-a-me!
I will counter with a PowerShell script instead of a separate program:
code:
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "awesome.exe"
$startInfo.Arguments = ""
$startInfo.UseShellExecute = $false
$startInfo.RedirectStandardOutput = $true

$process = [System.Diagnostics.Process]::Start($startInfo)
while ($process.HasExited -eq $false)
{
    $outputLine = $process.StandardOutput.ReadLine()
    if ($outputLine -ne $null)
    {
        $outputLine # Pass the output to the console
        if ($outputLine.Contains("warning!"))
        {
            $process.Kill()
            "The day is saved"
            break
        }
    }
    else
    {
        # Wait check for more output
        Start-Sleep -s 1
    }
}
Basically, this runs your program and captures the standard output from the process. It still echos the output to the console, but it examines each line and will kill the process if the line contains "Warning!".

e: You might also have to redirect standard error, depending on how the message is reported.

Mario
Oct 29, 2006
It's-a-me!
If you're on Windows, you don't have to bother with Cygwin unless you want it anyways -- use PowerShell instead:
code:
Get-Content files.txt | Foreach-Object { Copy-Item -Recurse $_ C:\Some\DestinationFolder }

  • Locked thread