topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 2, 2021, 12:07 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - highend01 [ switch to compact view ]

Pages: [1] 2 3 4 5 6 ... 8next
1
Coding Snacks / Re: [Solved] Adjust Subtitle (SRT) Timestamps
« on: December 21, 2020, 01:54 AM »
It didn't like the linebreaks in your j.srt file, hence the output
The timestamp you're using on the command line doesn't exist in the file so I've changed the logic to:
It begins to shift times beginning with the first timestamp that is larger (or equal to) than the one you're giving on the command line.
Before it was: Once the given timestamp matches one in the file, begin to shift from there...

So with "00:34:09,263" it will turn this (from j.srt):
304
00:33:21,776 --> 00:33:25,361
No! I have lice.

305
00:35:17,846 --> 00:35:20,847
We'll sing again together,
just like before.

into this (clipboard):
304
00:33:21,776 --> 00:33:25,361
No! I have lice.

305 -> These (and all following) timestamps will be shifted by -95 seconds
00:33:42,846 --> 00:33:45,847
We'll sing again together,
just like before.

2
Coding Snacks / Re: [Solved] Adjust Subtitle (SRT) Timestamps
« on: December 20, 2020, 12:32 PM »
Show me the exact command line you've used and a link to the .srt file to download it, please.

3
Coding Snacks / Re: Adjust Subtitle (SRT) Timestamps
« on: December 20, 2020, 08:00 AM »
Something like this should work...

It needs to be invoked via command line parameters:
"Adjust .srt times.exe" "D:\1.srt" "00:00:04,049" 200

Arg 1: The .srt file to parse
Arg 2: The first (from) timestamp where the time shifting should begin
Arg 3: The amount of time in milliseconds (either positive or negative) to shift
          If you need a shifting of multiple seconds, e.g -2.3 -> -2300 ms, use "-2300"

This is the content of a test .srt file:
1
00:00:00,230 --> 00:00:02,939
hi this is Roger in Finland and today

2
00:00:02,939 --> 00:00:04,049
we're gonna take a look at how to add

3
00:00:04,049 --> 00:00:05,730
subtitles to your videos either for

10
00:00:15,990 --> 00:00:18,660
[Music]
not playing loud
zzzZZZzzz

11
00:00:18,660 --> 00:00:21,180
solution is to go through generate an

12
00:00:21,180 --> 00:00:23,160
srt subtitles file it can be done



and this is what gets copied to the clipboard:
1
00:00:00,230 --> 00:00:02,939
hi this is Roger in Finland and today

2
00:00:02,939 --> 00:00:04,049
we're gonna take a look at how to add

3
00:00:04,249 --> 00:00:05,930
subtitles to your videos either for

4
00:00:16,190 --> 00:00:18,860
[Music]
not playing loud
zzzZZZzzz

5
00:00:18,860 --> 00:00:21,380
solution is to go through generate an

6
00:00:21,380 --> 00:00:23,360
srt subtitles file it can be done


4
@oblivion

Do you think you could recommend a Wacom Intuos Art S for desktop usage only (no drawing or any kind of digital art, only navigation, file selection, left and right clicking in browsers, file manager, etc.)?
I would use the pen if necessary but the Art reacts to finger movement as well which would be a big plus for me, although I don't know how easy it would be to e.g. hit a close button of a window with the fingertip when not using the pen...

Thanks!

To all others using a (Logitech) mouse/trackball:
I use a M570 since about 6 years. It's my second one after the first fell apart completely after 4 years. I had the same problem that the left and right micro switches began to fail after a short time (not even a year). I've ordered replacement switches: Omron D2F-01F - 0662RAE

When my first M570 died (the Omron switches were already in since 3 years) I thought: Ok, I still have 6 micro switches left (bought 8 in the first place) and I could just use two of them for the new device but what I finally did was: Solder my first two off of the old device and resolder them back into the new one. The new one was _brand new_ (I had just received it) but before I began to use these M570 trackballs I've had lost a lot of Logitech mices because of the micro switch issues) so I knew it would only be a question of time before the new one would fail as well.
Overall I'm using my first Omron pair since 5 years now and I'm using my trackball about 10-14 hours daily. One can still buy quality parts so I'd say: Go for Omron switches :Thmbsup:

5
You Kokomite link leads to Kododea (a screen magnifier tool)...

6
Post New Requests Here / Re: [REQ] VPN Gate OVPN Configs Downloader
« on: January 23, 2020, 11:53 AM »
You have the sourcecode^^

Use a progress bar instead and move the buttons...

7
Use AHK and create a simple GUI for what you need...

8
The .png files you've attached to your previous post are working fine as well.

AHK v1.1.32.00

9
pngs gives error so attached ico files
The three .png files I'm using here are working perfectly fine...

10

#NoEnv
#SingleInstance force
#Persistent

Gosub, Check
SetTimer, Check, 5000
return


Check:
result := Runret("cmd /c netsh wlan show interfaces")
RegExMatch(result, "im)channel\s+:\s*(?P<Channel>\d{1,3})", match)

If (matchChannel >= 1 && matchChannel <= 14)
Menu, Tray, Icon, %A_ScriptDir%\_green.png
Else If (matchChannel >= 34)
Menu, Tray, Icon, %A_ScriptDir%\_red.png
Else
Menu, Tray, Icon, %A_ScriptDir%\_grey.png

return


; http://www.autohotkey.com/board/topic/15455-stdouttovar/page-7
Runret(cmd, params="") {
; Assemble command + parameters
cmd := (params) ? cmd . " " . params : cmd

DllCall("CreatePipe", "Ptr*", hStdInRd , "Ptr*", hStdInWr , "Uint", 0, "Uint", 0)
DllCall("CreatePipe", "Ptr*", hStdOutRd, "Ptr*", hStdOutWr, "Uint", 0, "Uint", 0)
DllCall("SetHandleInformation", "Ptr", hStdInRd , "Uint", 1, "Uint", 1)
DllCall("SetHandleInformation", "Ptr", hStdOutWr, "Uint", 1, "Uint", 1)

; Fill a StartupInfo structure
if A_PtrSize = 4 ; We're on a 32-bit system
{
VarSetCapacity(pi, 16, 0)
sisize := VarSetCapacity(si, 68, 0)
NumPut(sisize,    si,  0, "UInt")
NumPut(0x100,     si, 44, "UInt")
NumPut(hStdInRd , si, 56, "Ptr") ; stdin
NumPut(hStdOutWr, si, 60, "Ptr") ; stdout
NumPut(hStdOutWr, si, 64, "Ptr") ; stderr
}
else if A_PtrSize = 8 ; We're on a 64-bit system
{
VarSetCapacity(pi, 24, 0)
sisize := VarSetCapacity(si, 96, 0)
NumPut(sisize,    si,  0, "UInt")
NumPut(0x100,     si, 60, "UInt")
NumPut(hStdInRd , si, 80, "Ptr") ; stdin
NumPut(hStdOutWr, si, 88, "Ptr") ; stdout
NumPut(hStdOutWr, si, 96, "Ptr") ; stderr
}

DllCall("CreateProcess" , "Uint", 0 ; Application Name
, "Ptr", &cmd ; Command Line
, "Uint", 0 ; Process Attributes
, "Uint", 0 ; Thread Attributes
, "Int", True ; Inherit Handles
, "Uint", 0x08000000 ; Creation Flags (0x08000000 = Suppress console window)
, "Uint", 0 ; Environment
, "Uint", 0 ; Current Directory
, "Ptr", &si ; Startup Info
, "Ptr", &pi) ; Process Information

DllCall("CloseHandle", "Ptr", NumGet(pi, 0))
DllCall("CloseHandle", "Ptr", NumGet(pi, A_PtrSize))
DllCall("CloseHandle", "Ptr", hStdOutWr)
DllCall("CloseHandle", "Ptr", hStdInRd)
DllCall("CloseHandle", "Ptr", hStdInWr)

VarSetCapacity(temp, 4095)
size := 0
Loop
{
result := DllCall("Kernel32.dll\ReadFile", "Uint", hStdOutRd, "Ptr", &temp, "Uint", 4095, "UintP", size, "Uint", 0)
if (result = "0")
break
else
output := output . StrGet(&temp, size, "CP850")
}
DllCall("CloseHandle", "Ptr", hStdOutRd)
return output
}

11
Write a simple .ahk script which executes
netsh wlan show interfaces
and parses the content afterwards.

Regarding capturing the cmd output, e.g.: https://autohotkey.c...5-stdouttovar/page-7

If Channel is 1-14 you're on 2,4 GHz and if it's 36+ (both values depend on country, look at e.g. https://en.wikipedia...(802.11a/h/j/n/ac/ax)
you're on 5 GHz.

~15 lines of code, 3 16x16 px .png / .ico files (e.g. grey = no wifi connection, green = 2.4 GHz, red = 5 GHz, or whatever you'd prefer)...

Works at least on Win 10...

12
General Software Discussion / Re: looking for cheap email hoster
« on: January 13, 2020, 01:24 AM »
www.SneakEmail.com: Sorry, account creation is currently disabled

Are there any other recommendable services like this?

13
set /p snum="Enter Job Number: "
>%snum%.txt echo Job Number is %snum%
start "" notepad %snum%.txt
>>%snum%.txt echo Next line
>>%snum%.txt echo Last line


14
Post New Requests Here / Re: [REQ] VPN Gate OVPN Configs Downloader
« on: December 05, 2019, 04:05 AM »
With a download progress bar...

2019-12-05_110557.png

15
Post New Requests Here / Re: [REQ] VPN Gate OVPN Configs Downloader
« on: December 03, 2019, 06:21 AM »
Not heavily tested but the basics are working...

You're free to modify it, but reference to my user account name here if you do this...

After you've downloaded the servers (via the belonging button), select one or more (via holding shift or ctrl) in the listview and click on the "Save config(s)" button.
You may want to choose a different path via the "Choose" button first, because the C:\ root may not be writable without appropriate permissions...

16
You can't send "keystrokes" over a network, you need to send "messages" (to a program that listens to them on each client pc).
E.g. with https://autohotkey.c...on-of-winsock-tcpip/
If that still works...

17
#NoEnv
#SingleInstance force
SetWorkingDir %A_ScriptDir%
FileEncoding UTF-8
SetBatchLines, -1

drive := "C:\"
file  := "Dummy.txt"
path  := drive . file
text  := "Dummy"


if FileExist(drive) {
    Loop {
        EmptyFile(path)
        FileAppend, % text, % path
    }
}

EmptyFile(file) {
    hFile := DllCall("CreateFile", Str, file, UInt, 0x40000000, UInt, 3, UInt, 0, UInt, 5, UInt, 0, UInt, 0)
    DllCall("CloseHandle", UInt, hFile)
    return hFile > 0 ? 1 : hFile
}

But ofc this empties the file before it gets overwritten...

OpenFile() would impose too many problems (no unicode, no > 128 file path length...)

19
#NoEnv
#SingleInstance force
SetWorkingDir %A_ScriptDir%
FileEncoding UTF-8
SetBatchLines, -1

drive := "C:\"
file  := "Dummy.txt"
path  := drive . file
text  := "Dummy"


if FileExist(drive) {
    Loop {
        if FileExist(path)
            FileDelete, % path
        FileAppend, % text, % path
    }
}

20
Sure, add the stuff from the stackoverflow link. Done.

21
Post New Requests Here / Re: Select Range of Files Via Batch File
« on: April 07, 2019, 11:16 AM »
findstr has a regex mode as well...

22
Who else would like to take the next step?
Maybe... You?

23
Google stopped working (again)?

https://stackoverflo...32-bits-of-precision

Includes ways how to circumvent this restriction. Have fun learning a minimal amount of batch scripting!

24
You are kidding me, right?

That's the exact same thing, only in green...

@SETLOCAL EnableDelayedExpansion
@ECHO OFF

REM 1 MB = 1048576 bytes
REM 157286400 = 150 MB
SET Max=157286400
SET Src=R:\tst_src
SET Dst=R:\tst_dst

IF EXIST "%Src%" (
    IF EXIST "%Dst%" (
        SET /a Size = 0
        FOR %%I IN ("%Src%\*") DO (
            SET /a Size += %%~zI
            IF !Size! GTR %Max% GOTO :EOF
            MOVE /Y "%%I" "%Dst%" >NUL 2>NUL
        )
    )
)

25
Use the last batch file I wrote and count up their size instead of count?

Pages: [1] 2 3 4 5 6 ... 8next