- 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).
|
#
¿
Jul 28, 2011 04:59
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 21, 2024 00:27
|
|
- 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.
|
#
¿
Jul 30, 2011 02:32
|
|
- Mario
- Oct 29, 2006
-
It's-a-me!
|
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
|
#
¿
Sep 5, 2013 03:48
|
|
- 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.
|
#
¿
Feb 12, 2015 04:17
|
|
- 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 }
|
#
¿
Jun 21, 2015 23:19
|
|