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 $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«2 »
  • Post
  • Reply
Chunjee
Oct 27, 2004
I can't read or write

The idea is simple, you think of some tiny, one trick pony application or script that you'd like to have for whatever reason. You post your request here, and hopefully someone makes it.

Thread 01 (requires archives)
Thread 02


Making a Request:
• Not all requests will be filled. Mostly because we're doing this for fun and your request might not be
• "And it needs to run on my smartphone" is a good way to get looked over. iPhone doubly so
• Include a link to Freelancer or Bountysource if you are offering money for a completed request
• Offering a Something Awful Gift Cert is highly encouraged (and I don't have an avatar yet )

Post #2 has an example template.





Application guidelines:
• Absolutely no exploitative code! No virii, no backdoors, etc
• If possible provide the source code
• You should use a reliable file hosting like google drive, github, or mediafire as opposed to your own site
• You can post unsolicited apps or fill your own request
• A screen shot is encouraged

Post #3 has an example template for filled requests.





http://www.tinyappz.com/ is dead. I might try getting a replacement together but it probably won't be anything but a searchable collection of completed requests.


Archived info:
4/20/2010 - Here's an archive of every app that was hosted on tinyappz.com. The wiki text is not included, since parsing it out of the database dump would be a huge pain, and I'm not going to put the dump online since it contains the email addresses of people who registered on the site. It's 28 MB.


Hall of Fame:

Hoborg posted:

Request Fill
Name: Directory Image Sorter for mastermenthe, he's my secret boyfriend don'tchaknow? Written by Hoborg, who is totally the god of Klaymen and really not Sevenofnine
Download link: http://bit.ly/fb5rz2
Source Code: C# Source: http://bit.ly/hlifTh
Screenshot:

Volguus posted:

Request Fill
Name: Web Site Monitoring
Download link: https://github.com/sa55231/WebMonitoring/releases
Source Code: https://github.com/sa55231/WebMonitoring
Screenshot:

Chunjee fucked around with this message at Jan 9, 2018 around 19:28

Adbot
ADBOT LOVES YOU

Chunjee
Oct 27, 2004
I can't read or write

Humble Request
Problem:
Description and requirements:
Nice to have features:

Chunjee
Oct 27, 2004
I can't read or write

Request Fill
Name:
Download link:
Source Code:
Features and Usage:
Screenshot:

Chunjee
Oct 27, 2004
I can't read or write

Humble Request
Problem: I need to crop 1,2, or 3, occasionally 4 or more images out of one large image. This can be done in paint with careful use of 'Save As...' but I want to process about 50x20 images a day. Not feasible by hand.
http://www.fmwconcepts.com/imagemagick/multicrop/ works on UNIX machines but I can't find any windows alternative outside of photoshop's 'Crop and Straighten Photos' which would also be super manual.
Description and requirements: Windows executable or Javascript library that will accept a directory or single image file as an argument and process into however many images it can find. The images that I am working with don't need to be unrotated at all, they're level.
Many images don't have whitespace on every side.
Some just one image with lots of whitespace.
Some images are only separated by a thin line. As little as 1-3 pixels. This seems to confuse photoshop's 'Crop and Straighten Photos' function.
Nice to have features: delete the picture after processing. User defined inset amount (amount to trim off borders)

Chunjee fucked around with this message at Aug 3, 2017 around 21:43

Salted_Pork
Jun 19, 2011


Humble Request
Problem: I want to point my phone at the ocean, and it feels me what piece of land is next
Description and requirements: I turn on location, and point my phone at the ocean. It tells me what piece of land I would be looking at if I could see over the horizon
Nice to have features: Users google maps and/or streetview. is called, "Being me that horizon"

wargames
Mar 16, 2008

official yospos cat censor


Humble Request
Problem: I need a Diceroller for PHPBB
Description and requirements: I have a diceroller for PHPBB however its for DnD and not the system I am using which is Legend of the Five Rings.
Nice to have features: The ability to tell it various conditions that the game demands.

https://www.freelancer.com/projects...3782#/proposals

wargames fucked around with this message at Aug 8, 2017 around 11:16

Lord Windy
Mar 26, 2010


Chunjee posted:

Humble Request
Problem: I need to crop 1,2, or 3, occasionally 4 or more images out of one large image. This can be done in paint with careful use of 'Save As...' but I want to process about 50x20 images a day. Not feasible by hand.
http://www.fmwconcepts.com/imagemagick/multicrop/ works on UNIX machines but I can't find any windows alternative outside of photoshop's 'Crop and Straighten Photos' which would also be super manual.
Description and requirements: Windows executable or Javascript library that will accept a directory or single image file as an argument and process into however many images it can find. The images that I am working with don't need to be unrotated at all, they're level.
Many images don't have whitespace on every side.
Some just one image with lots of whitespace.
Some images are only separated by a thin line. As little as 1-3 pixels. This seems to confuse photoshop's 'Crop and Straighten Photos' function.
Nice to have features: delete the picture after processing. User defined inset amount (amount to trim off borders)

I don't have access to a windows computer very often anymore, but wouldn't this program run under Bash on Windows? (Or whatever they call Ubuntu 14.04 being on Windows).

Chunjee
Oct 27, 2004
I can't read or write

Might give that a shot today as I do have Win10 at work now.

EVIL Gibson
Mar 23, 2001

THE CLOUD WILL PROTECT US


Switchblade Switcharoo

Chunjee posted:

Might give that a shot today as I do have Win10 at work now.

There are also windows binaries they make as well

https://www.imagemagick.org/script/...ses.php#windows

Neurozys
Apr 15, 2004



10 years later part 2 finally dies. Good for you - long live part 3!

Coming back to SA always makes me feel old.

Ceros_X
Aug 6, 2006

U.S. Marine


Hopefully this already exists and my google-fu is just weak. I am looking for etherpad for images pretty much. I'd like something that would let me upload a large image (like a map) and several smaller images (like pictures of tiny cars or army menwhatever) and then move the smaller images around the larger image and it save the state. Being able to track multiple users/contributors would be cool, but mainly just want that specific functionality. I looked up collaboration software but most of it is $$$ or aimed at app design or code versioning etc. If there was etherpad:power point version that would work too.

I'm trying to use it for an online Dungeons and Dragons game that would be played over Discord. All the chat/voice would happen over Discord and the map would just keep track of player characters and enemies on a map for battle things. Ideally looking to do a turn based game (not Fantasy Grounds where everyone is online at once - one person posts and then a few hours later someone else posts and moves a dude).

Really hoping this already exists, it is pretty minor for someone to spend time on. Recommendations would be awesome!

Edit: Looking for something browser based, not an installable software

Ceros_X fucked around with this message at Aug 30, 2017 around 00:51

Chunjee
Oct 27, 2004
I can't read or write

Ceros_X posted:

I'm trying to use it for an online Dungeons and Dragons game that would be played over Discord. All the chat/voice would happen over Discord and the map would just keep track of player characters and enemies on a map for battle things. Ideally looking to do a turn based game (not Fantasy Grounds where everyone is online at once - one person posts and then a few hours later someone else posts and moves a dude).

Google slides would probably work for you. https://www.google.com/slides
I think it requires a lot more setup but also check out https://roll20.net/



Neurozys posted:

10 years later part 2 finally dies. Good for you - long live part 3!

Coming back to SA always makes me feel old.

Well speak of the devil.

Paul MaudDib
May 2, 2006

"Tell me of your home world, Usul"


Ceros_X posted:

Hopefully this already exists and my google-fu is just weak. I am looking for etherpad for images pretty much. I'd like something that would let me upload a large image (like a map) and several smaller images (like pictures of tiny cars or army menwhatever) and then move the smaller images around the larger image and it save the state. Being able to track multiple users/contributors would be cool, but mainly just want that specific functionality. I looked up collaboration software but most of it is $$$ or aimed at app design or code versioning etc. If there was etherpad:power point version that would work too.

I'm trying to use it for an online Dungeons and Dragons game that would be played over Discord. All the chat/voice would happen over Discord and the map would just keep track of player characters and enemies on a map for battle things. Ideally looking to do a turn based game (not Fantasy Grounds where everyone is online at once - one person posts and then a few hours later someone else posts and moves a dude).

Really hoping this already exists, it is pretty minor for someone to spend time on. Recommendations would be awesome!

Edit: Looking for something browser based, not an installable software

This can be done with any image editing program that supports layers (eg Paint.Net, GIMP, etc). If you need to share it, you can use any screen-capture/streaming software like Shadowplay, ReLive, or OBS Studio.

Ceros_X
Aug 6, 2006

U.S. Marine


Paul MaudDib posted:

This can be done with any image editing program that supports layers (eg Paint.Net, GIMP, etc). If you need to share it, you can use any screen-capture/streaming software like Shadowplay, ReLive, or OBS Studio.

I use layers a lot with photoshop but screen sharing gimp or whatever doesn't let the other players also move layers around. Screen sharing isn't conducive to a play by post format where everyone does something hours apart, unless I am misunderstanding. Sorry if I explained it poorly!

Chunjee posted:

Google slides would probably work for you. https://www.google.com/slides
I think it requires a lot more setup but also check out https://roll20.net/


Well speak of the devil.

I've used roll20.net before, a little to heavy for what I want. Google Slides is great, though - it'd be perfect if I could lock the sizes of images so I can move them without accidentally resizing them. Should be able to resize them larger, move it, and then resize them small afterward. A little clunky but works great on PC and smart phones. Thanks for the recommendation!

Chunjee
Oct 27, 2004
I can't read or write

Looking at touching up some of my old small app request fills. But I'd really rather take a whack at something new. If I see something that I think I can do in about an hour, I'll usually see it through to some basic functionality even if it takes me three hours.

Fart.Bleed.Repeat.
Sep 29, 2001



Example Template:
Humble Request

Problem: tiny mailserver app that will accept incoming email and forward it to a single other email address

Description and requirements: I have a few domain names but no email set up for any of them. I have a gmail account that I use regularly. Looking into ways to set up a mail server on a PC i have, but I really don't need full smtp/pop capabilities, and I know I'm not diligent enough to keep up with maintaining it so it gets hacked etc. Ideally I would be able to point MX records to its IP address and then give it a destination(my gmail acct), and that's about it. Send mail to anyname@domain.com and it receives it and forwards it to me@gmail.com

Nice to have features: The logical next addition to this would be multiple addresses with different forwarding destinations. Multiple domains?

Thanks!

SamDabbers
May 26, 2003

QUITE.


Fallen Rib

Fart.Bleed.Repeat. posted:

Problem: tiny mailserver app that will accept incoming email and forward it to a single other email address

Most domain registrars offer this service, often included in the cost of your registration.

Chunjee
Oct 27, 2004
I can't read or write

Knifegrab posted:

I was wondering if there were an app that could dim my monitors after I go idle for a set amount of time. Windows recently removed this functionality from 8.1.

Request Fill
Name: IdleDim
Download link: https://www.mediafire.com/file/kctm...wzb/IdleDim.zip
Source Code: in src folder
Features and Usage: a file idledim_options.json controls "brightness" (0-128) and "idletime_mins" (The minutes to wait for 0 user input and dim. Default is 10 mins)
Screenshot:



Works via SetDeviceGammaRamp (https://msdn.microsoft.com/en-us/li...4(v=vs.85).aspx) which I guess is a Windows setting. I don't think it communicates with the monitor itself.
Will restore the original brightness setting upon detection of user input.
May not restore brightness setting if the pc shuts down unexpectedly. Included "Reset Brightness" to bring Windows back to 100% brightness.

Fart.Bleed.Repeat.
Sep 29, 2001



SamDabbers posted:

Most domain registrars offer this service, often included in the cost of your registration.

I did find it in Godaddy, it looked like a pay thing at first but had some credits or something, so all good

Naffer
Oct 26, 2004

Not a good chemist

Humble Request
Problem:
I have a scientific instrument that collects data on samples to individual folders. I would like to be able to go back and calculate how much instrument time was used on each sample.

Description and requirements:

The instrument runs on Windows 7. I think the easiest way to do this would be via the created date and time on the files that the instrument generates.
The file structure for the datasets is :
code:
\[User]\[samplename]\frames\[samplename]_#_###.img
Essentially, the instrument time for that sample would be the difference between the created date and time for the oldest and newest file that matches that file name format in the folder.
I imagine this wouldn’t be too tough to do with a script, but it’s beyond my abilities. What would be useful to me would be a script that gives an output in time in hours on a per sample basis.

Nice to have features:
I think a really nice output format would be something along the lines of:
code:
[User]	[samplename]	[Start date]	[Instrument Time]
If I could run it once and have it produce an output for all samples under all users that would be ideal.

Ptarmigans
Nov 4, 2011



Naffer posted:

Humble Request
Problem:
I have a scientific instrument that collects data on samples to individual folders. I would like to be able to go back and calculate how much instrument time was used on each sample.

Here's what I got with a quick go at it in Python. I'm not 100% on what your preferred formatting is but let me know if you want any changes.

If anyone wants to point out things that can be improved then I am open to critique, I'm not exactly experienced.

Request Fill
Source Code:
code:
import os
import time

with open("output.txt", "w") as out:
    print("Instrument time per sample", file = out)

dirs = next(os.walk("."))[1]
for user in dirs:
    samples = next(os.walk(user))[1]
    for sample in samples:
        path = user + "/" + sample + "/frames"
        files = next(os.walk(path))[2]
        new = 0
        old = 0
        for file in files:
            fileTime = os.path.getctime(path + "/" + file)
            if old == 0:
                old = fileTime
            if fileTime < old:
                old = fileTime
            if fileTime > new:
                new = fileTime
        date = time.strftime("%Y-%m-%d", time.localtime(old))
        diff = round(new - old)
        minute, second = divmod(diff, 60)
        hour, minute = divmod(minute, 60)
        with open("output.txt", "a") as out:      
            print("%s\t%s\t[%s]\t%02d:%02d:%02d" %
                (user, sample, date, hour, minute, second), file = out)
Features and Usage:
Just run it in the parent of the User directory and it will generate a text file with all of the data.

Naffer
Oct 26, 2004

Not a good chemist

Ptarmigans posted:

Here's what I got with a quick go at it in Python. I'm not 100% on what your preferred formatting is but let me know if you want any changes.

If anyone wants to point out things that can be improved then I am open to critique, I'm not exactly experienced.

Request Fill
Source Code:

Thanks for the effort, I installed python 2.7.14 for windows, but trying to run the script gives a syntax error:
code:
with open("output.txt", "w") as out:
    print("Instrument time per sample", file = out)
Some googling told me to swap the "=" out for "==" both times file = out appeared.
I also swapped out getctime for getmtime, since apparently copying the data to a new drive (which I do occasionally) gives new created dates but not modified dates.

Now when I call the script (F:\test>python test.py) it writes this to the console:

code:
('Instrument time per sample', False)
('user1\tSample01\t[2016-12-21]\t01:39:27', False)
('user2\tSample02\t[2016-08-01]\t01:19:59', False)
It creates the output file but leaves it blank.
It also doesn't appear to check that the files whose dates its using for the calculation match the string "Samplename_"

Seriously, this is a pretty awesome start. Thanks.

Ptarmigans
Nov 4, 2011



Sorry about that, I should have specified that it's for Python 3, which doesn't have compatibility with Python 2.

Naffer
Oct 26, 2004

Not a good chemist

Ptarmigans posted:

Sorry about that, I should have specified that it's for Python 3, which doesn't have compatibility with Python 2.

Awesome. I added a couple of features.
1) now it only uses files that match the sample name for the calculation.
2) Added error handling for when it encounters subfolders that don't have the expected path (would throw up if there was a missing frames folder)

code:
import os
import time

with open("output.txt", "w") as out:
    print("Instrument time per sample", file = out)

dirs = next(os.walk("."))[1]
for user in dirs:
    samples = next(os.walk(user))[1]
    for sample in samples:
        path = user + "/" + sample + "/frames"
        if os.path.isdir(path):
            files = next(os.walk(path))[2]
            new = 0
            old = 0
            for file in files:
                fileTime = os.path.getmtime(path + "/" + file)
                if file.startswith(sample):
                    if old == 0:
                        old = fileTime
                    if fileTime < old:
                        old = fileTime
                    if fileTime > new:
                        new = fileTime
            date = time.strftime("%Y-%m-%d", time.localtime(old))
            diff = round(new - old)
            minute, second = divmod(diff, 60)
            hour, minute = divmod(minute, 60)
            with open("output.txt", "a") as out:      
                print("%s\t%s\t[%s]\t%02d:%02d:%02d" %
                    (user, sample, date, hour, minute, second), file = out)
        else:
            print("skipping " + user + "/" + sample)

Ptarmigans
Nov 4, 2011



Naffer posted:

Awesome. I added a couple of features.
1) now it only uses files that match the sample name for the calculation.
2) Added error handling for when it encounters subfolders that don't have the expected path (would throw up if there was a missing frames folder)

Cool, glad to hear it's working. The additions look good .

SpaceAceJase
Nov 8, 2008

and you
have proved
to be...

a real shitty poster,
and a real james


Humble Request
Problem: Sobriety clock in Javascript
Description and requirements:
I'd like to quit a few bad habits, and a simple javascript-driven clock counting upwards with the number of days/hours/minutes/seconds it's been would be a helpful reminder and motivator. I use a web application daily that I can include the script on so it's always near my line of sight.

Nice to have features:
Data returned in JSON as an option? (simple API). Motivational quotes from a source? Open to ideas. I like a minimalist neat UI.

Jaded Burnout
Jul 10, 2004





SpaceAceJase posted:

Humble Request
Problem: Sobriety clock in Javascript
Description and requirements:
I'd like to quit a few bad habits, and a simple javascript-driven clock counting upwards with the number of days/hours/minutes/seconds it's been would be a helpful reminder and motivator. I use a web application daily that I can include the script on so it's always near my line of sight.

Nice to have features:
Data returned in JSON as an option? (simple API). Motivational quotes from a source? Open to ideas. I like a minimalist neat UI.

Some slightly confusing requirements here. The basics (the clock) are easy, but this is presumably a stateful application, i.e. you would want to go away and come back and have it still counting up from the same place, be able to reset it etc. So that means some data storage somewhere, usually a database? At which point you're getting a bit further from simple JS or a script you can embed in something else.

Likewise when you're talking about an API do you mean a method you can call when the script is loaded to get the time in JSON or are you talking about an HTTP endpoint? If the latter then again we're in Slightly Bigger App territory so at the least we'd need to know more details on your plans for hosting this and what frameworks you'd prefer it written in.

Ephphatha
Dec 18, 2009

Enemy Protocol Unknown


That'd be more feasible as a browser plugin if there's a particular browser you use. Something like https://chrome.google.com/webstore/...acmgbecpa?hl=en might be appropriate?

SwissArmyDruid
Feb 14, 2014



Humble Request
Problem:

NVidia Whispermode is locked behind having to log in to GFE

Description and requirements:

Nvidia's frame-limiting toggle is locked behind having to log in to GeForce Experience. Not the actual rate setting, that poo poo's in the Nvidia Control Panel. But the actual toggle on/off, you gotta make an account and log in, or no frame-limiter for you! And as soon as you log out of GFE, the toggle goes away again.

I am highly doubtful that anyone would be able to do this without Nvidia immediately patching the means to do so out of existence, but maybe, just maybe, either someone wants to take a crack at it to spite Nvidia, or knows of a little 100kb app that voodoos Nvidia's black box into activating it.

Nice to have features:

On/Off GUI? Really, it could run on a command line for all I care. I just don't want to have GFE anywhere near my computers.

BeastOfExmoor
Aug 19, 2003
"Mr. Phillips found old Johnny Cash when he was high, high before he ever took those pills, and he's still too proud to die.."

Humble Request
Problem:

I frequently need to replace one file that exists in many subfolders folders, with another file. Rather than manually searching for and replacing these files, I'd love a command line program/script that searches the subfolders for a specific filename, deletes that file, and then copies the new file into that folder.

Syntax like:
ReplaceFile oldfile.bin newfile.bin

Description and requirements:

Ideally this would be something that runs on bare Windows 10.

Nice to have features:
Ideally it would echo back the path of the directories where files have been replaced.

TheLastManStanding
Jan 14, 2008
Mash Buttons!

BeastOfExmoor posted:

Humble Request
Are you replacing the file with one of the same name? Or do you want to set the name of the file you're looking to replace?

Request Fill
Edit: Threw something together in Autohotkey. For the source you'll need Autohotkey 1.1.* to run it and SciTE4AutoHotkey to edit. The program gives you a gui to select the new file and an edit box in case the old file has a different name. There is a checkbox for testing, allowing you to run it without actually replacing anything. A txt log is spit out at the end which lists all the files which were replaced. The script assumes that it's in the root directory to be searched.

Compiled
Source (ahk file)
Source (txt file)

TheLastManStanding fucked around with this message at Dec 9, 2017 around 01:06

nielsm
Jun 1, 2009




Fallen Rib

BeastOfExmoor posted:

Humble Request

Alternative solution, in PowerShell.

Save this to a text file, e.g. Replace-FileByName.ps1:
code:
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
    [string]$SearchFileName,
    [string]$ReplacementFileName,
    [string]$SearchBase=".",
    [switch]$Rename
)
$originalFiles = Get-ChildItem -LiteralPath $SearchBase -Filter $SearchFileName -Recurse -File
foreach ($orgFile in $originalFiles) {
    Write-Verbose $orgFile.FullName
    if ($Rename) {
        Remove-Item -LiteralPath $orgFile.FullName
        Copy-Item -LiteralPath $ReplacementFileName -Destination $orgFile.DirectoryName
    } else {
        Copy-Item -LiteralPath $ReplacementFileName -Destination $orgFile.FullName
    }
}
Then you can call the script like this to replace oldfile.bin with newfile.bin, keeping the oldfile.bin filename:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin
If you'd rather the replaced files are called by the replaement's filename:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -Rename
Or to check what will happen beforehand:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -WhatIf
Or get it to print destination filenames before each replacement, and still perform all the replacements:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -Verbose
You can also get it to confirm before each replacement: (But beware that the "Yes to all" and "No to all" choices don't work due to the foreach loop. I don't know what the best way to get around that is.)
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -Confirm
This isn't thoroughly tested, I'm sure there's plenty of room for improvement.

BeastOfExmoor
Aug 19, 2003
"Mr. Phillips found old Johnny Cash when he was high, high before he ever took those pills, and he's still too proud to die.."

Sorry, I've been super busy for the last week and haven't had time to sit down and look at either of these. I really appreciate both of you taking time to write this silly time saver.

TheLastManStanding posted:

Are you replacing the file with one of the same name? Or do you want to set the name of the file you're looking to replace?

Request Fill
Edit: Threw something together in Autohotkey. For the source you'll need Autohotkey 1.1.* to run it and SciTE4AutoHotkey to edit. The program gives you a gui to select the new file and an edit box in case the old file has a different name. There is a checkbox for testing, allowing you to run it without actually replacing anything. A txt log is spit out at the end which lists all the files which were replaced. The script assumes that it's in the root directory to be searched.

Compiled
Source (ahk file)
Source (txt file)

This is an interesting approach. I use AutoHotKey very minimally, but never would have considered it for this task. Unfortunately I'm a little confused by how to use this script. When I open it, I get a GUI with a browse button which presumably is asking which file I want to replace. I don't know how I select the file I'd like to replace it with, however. And yes, the files will almost always be different filenames.


nielsm posted:

Alternative solution, in PowerShell.

Save this to a text file, e.g. Replace-FileByName.ps1:
code:
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
    [string]$SearchFileName,
    [string]$ReplacementFileName,
    [string]$SearchBase=".",
    [switch]$Rename
)
$originalFiles = Get-ChildItem -LiteralPath $SearchBase -Filter $SearchFileName -Recurse -File
foreach ($orgFile in $originalFiles) {
    Write-Verbose $orgFile.FullName
    if ($Rename) {
        Remove-Item -LiteralPath $orgFile.FullName
        Copy-Item -LiteralPath $ReplacementFileName -Destination $orgFile.DirectoryName
    } else {
        Copy-Item -LiteralPath $ReplacementFileName -Destination $orgFile.FullName
    }
}
Then you can call the script like this to replace oldfile.bin with newfile.bin, keeping the oldfile.bin filename:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin
If you'd rather the replaced files are called by the replaement's filename:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -Rename
Or to check what will happen beforehand:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -WhatIf
Or get it to print destination filenames before each replacement, and still perform all the replacements:
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -Verbose
You can also get it to confirm before each replacement: (But beware that the "Yes to all" and "No to all" choices don't work due to the foreach loop. I don't know what the best way to get around that is.)
pre:
.\Replace-FileByName.ps1 -SearchFileName oldfile.bin -ReplacementFileName d:\newfile.bin -Confirm
This isn't thoroughly tested, I'm sure there's plenty of room for improvement.

This one works great.

Thanks again to both of you!

bsaber
Jul 27, 2007


​Humble Request

Problem: Not sure if this is even possible. Want to be able to edit a JSON file with a nice GUI interface. All the systems that I will be using to edit this file will have Python 3 installed so would prefer to be written in Python with Tkinter so dependencies are kept at a minimum (Needs to work on both Windows and Mac).

Description and requirements: The JSON file is a list that contains objects with varying number and types of properties. There will also be Chinese characters so needs to be able to handle that. Here's an example JSON file:

[{
"catname": "cat",
"name": "blahblahblah 胡說",
"reverse": true,
"startNumber": 444
}, {
"catname": "bat",
"name": "blahblahblah 胡說",
"reverse": true,
"startNumber": 367
}, {
"catname": "sat",
"name": "blahblahblah 胡說",
"reverse": false,
"streams": [{
"imageurl": "https://image/url/image.png",
"videourl": "https://video/url/test.m3u8"
},
{
"imageurl": "",
"videourl": "https://video/url/test.m3u8"
}
]
}]

So I would like to have the objects loaded as a list showing just the "name" property, when you double click it it'll open a new window that will allow you to edit the properties. Just the values and not the actual property names is fine, but if you can do both that'll be awesome too. A save button that confirms if you want to save the changes and an export button that exports the JSON back into the file in the main screen with the object list is all that's needed.

Nice to have features: Uses Python 3 and Tkinter. Support for Linux too would be nice. Would be awesome if there's a create button for creating a new object to add to the list. Not sure how that would look or work. Just a nice to have feature, not needed.

Chunjee
Oct 27, 2004
I can't read or write

Thought I could whip something together in 30mins but those Chinese characters turned out to be more trouble than I was expecting. Will give it another shot today.

Edit: Making some good progress

Chunjee fucked around with this message at Jan 22, 2018 around 18:49

bsaber
Jul 27, 2007


Whoa cool! Thanks!

Chunjee
Oct 27, 2004
I can't read or write

I haven't given up but I did get busy.

There are some online json editors that may be of use:
https://jsonformatter.org/json-editor

bsaber
Jul 27, 2007


Cool, thanks! I appreciate you

Nichael
Mar 30, 2011

Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.


Humble Request
Problem: I work on a political campaign and need something simple that could interact with volunteers.
Description and requirements: I admittedly don't know much about software design but if possible I'd like something that has a newsfeed of events and updates from the campaign that someone on our staff could periodically update, as well as the possibility of sending push notifications to people. Finally, I was thinking it could have in-app purchases that act as donations to the campaign, which can take Play and Apple credits.

I admit this probably is demanding, but I was thinking we could work out a payment scheme based off of donations gotten through the application. And in my opinion, this would be used for a good cause as this is a grassroots campaign funded by small donations.
Nice to have features:
-Push notifcations
-News feed
-Donation mechanism (in-app purchases?)

Adbot
ADBOT LOVES YOU

Capri Sun Tzu
Oct 24, 2017



That is definitely NOT a tiny app mate

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«2 »