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
Corla Plankun
May 8, 2007

improve the lives of everyone
That's super easy to do with autohotkey. If you can't figure it out I can make you a little script later tonight after I figure out why my desktop isn't booting.

Adbot
ADBOT LOVES YOU

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Corla Plankun posted:

That's super easy to do with autohotkey. If you can't figure it out I can make you a little script later tonight after I figure out why my desktop isn't booting.

You were right, it was pretty simple to write in AutoHotKey. This seems to work, but I'm having an issue with restoring the old contents of the clipboard after performing the search. Text content works fine, but if the clipboard contains image data then that gets blown away when I try to restore it. Is there a way to preserve the contents of the clipboard data completely, or is AutoHotKey only capable of handling text data?

code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

; Variables
SearchUrl = [url]http://jisho.org/search/	;[/url] Search text gets appended to the end of the string

^Space::
	Old = %ClipBoardAll%	; Store the current contents of the clipboard 
	Clipboard = 		; Blank the clipboard so ClipWait knows when to fire
	Send ^c 		; Copy the highlighted text
	ClipWait, 1		; Wait for the clipboard to get the text. Continue after 1 second (in case nothing's highlighted)
	Run, %SearchUrl%%Clipboard% 	; Perform the web search
	Clipboard = %Old%	; Restore the user's clipboard content
	Old =			; Clear up memory
Return
Edit: This doesn't work at all with Unicode characters...
Edit 2: Nevermind, the issue was with the PDF I was trying to copy text from

IAmKale fucked around with this message at 05:37 on Sep 11, 2015

Chunjee
Oct 27, 2004

Was going to write that for you but looks like you got the main idea down already.

code:
^Space::
if (Clipboard != "") { ;if cliboard data is not an image or blank
	SearchUrl := "http://jisho.org/search/" . Clipboard   ; Search text gets appended to the end of the string
	Run, %SearchUrl%
} else {
	Msgbox, your clipboard doesn't have recognised text.
}
Return
See if that works any better for you. Doesn't modify clipboard so you shouldn't have any trouble restoring.

Chunjee fucked around with this message at 05:16 on Sep 11, 2015

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Chunjee posted:

See if that works any better for you. Doesn't modify clipboard so you shouldn't have any trouble restoring.
Thanks for your version, I see an area or two I might be able to improve my script. As for restoring the clipboard, I figured that out too - I just updated my last post with the most recent version. I tested it by copying a segment of an image in Paint.NET and then running a search with the script. Hitting Ctrl+V right afterwards pasted the image data back into Paint.NET just fine!

Plus this had the added benefit of no longer needing to hit Ctrl+C first - I went from this:

Highlight text, Ctrl+C, Alt+Tab over to Chrome, middle-click Jisho shortcut, Ctrl+V, Enter

to this:

Highlight text, Ctrl+Space

:D

Srebrenica Surprise
Aug 23, 2008

"L-O-V-E's just another word I never learned to pronounce."
It seemed like the Python script posted last page was working perfectly but I've used it a few times recently and it now seems to be ignoring natural order (it's going 1, 10, 11, 12, 2, when I can verify from page order on uploaded materials that it was ordering them perfectly before) and also including thumbs.db for some reason, when I can tell it should be specifically excluding it. Some rear end screwed around on my work PC and updated Python but I rolled back to 2.7 to check if that did anything and it didn't seem to fix it. I realize how bizarre this is, but does anyone have any ideas?

..btt
Mar 26, 2008
That is what happens when you sort those numbers alphabetically. If you want numeric order, the files must be called, e.g. 01, 02, 10, 11, etc. If the numbers reach 100 they well instead need padding to three characters, e.g. 001. Perhaps that's always how it worked, and you just had different input before? I don't see anything to order them specifically in the code.

Sebbe
Feb 29, 2004

Srebrenica Surprise posted:

It seemed like the Python script posted last page was working perfectly but I've used it a few times recently and it now seems to be ignoring natural order (it's going 1, 10, 11, 12, 2, when I can verify from page order on uploaded materials that it was ordering them perfectly before) and also including thumbs.db for some reason, when I can tell it should be specifically excluding it. Some rear end screwed around on my work PC and updated Python but I rolled back to 2.7 to check if that did anything and it didn't seem to fix it. I realize how bizarre this is, but does anyone have any ideas?

Here's a version that enforces natural sorting:

Python code:
import os
import sys
import re

def natural_key(text):
    """ Provides a natural sort key for a string. Taken from http://stackoverflow.com/a/3033342/79061 """
    return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', text)]

def listfiles(start):
    for dirname, dirnames, filenames in os.walk(start):
        result = ";".join(f for f in sorted(filenames, key=natural_key) if f != 'thumbs.db')
        if result: print result

def main():
    try:
        listfiles(sys.argv[1])
    except IndexError:
        print 'usage: python listfile.py C:\\path\\to\\folder'

if __name__ == '__main__':
    main()

Srebrenica Surprise
Aug 23, 2008

"L-O-V-E's just another word I never learned to pronounce."

Sebbe posted:

Here's a version that enforces natural sorting:
Thanks a bunch!

edit: works perfectly!

Srebrenica Surprise fucked around with this message at 07:55 on Oct 17, 2015

Trig Discipline
Jun 3, 2008

Please leave the room if you think this might offend you.
Grimey Drawer
I'm teaching some technical workshops to some very novice people soon, and what I'd really like is a very simple online app that will let me keep track of whether the students think I'm going too fast or too slow. Here's my ideal setup:

I have a private URL that I send to students in the class.

On that page, the students see a slider or set of ~ 9 buttons ranging from WAY TOO SLOW to WAY TOO FAST, with some intermittent values in between.

Students can move their sliders/buttons back and forth at will, and said info is automatically transmitted to the instructor's web page, where I see either a constantly updated average or the overall distribution (density plot or histogram) of the students' feedback.



This may already exist somewhere, but I haven't quite found anything suitable yet. I can fake something like this with Google Forms, but it requires that students constantly click links to revise and resubmit their answers, and requires me to constantly refresh to update the results page. I'd like something that requires as little moment-to-moment interaction as possible, so they can just change their scores when they feel bored or swamped, and so that I can just glance at a separate tab or screen and have some idea of how they're feeling about the class. I'd also like it to be anonymous, so students don't feel compelled to pretend to understand more than they actually do.

Inspector_666
Oct 7, 2003

benny with the good hair
I would say that if you're worried about going too fast, having people try to respond to your lecture in real-time may not be the best way to go about it.

Trig Discipline
Jun 3, 2008

Please leave the room if you think this might offend you.
Grimey Drawer
This is not my first technical class, and I'm asking because I have encountered a need for exactly this, suggested by students themselves. If it ends up being a distraction we'll axe it, but we've already seen huge benefits from using etherpad for live chat and note-taking.

e: We're also wanting to use this to revise the course and see what needs more, and less, attention for novices. A lot of times people won't raise their hands to say that they didn't understand something, but they will push the hell out of an anonymous button.

Trig Discipline fucked around with this message at 06:57 on Nov 18, 2015

fishmech
Jul 16, 2006

by VideoGames
Salad Prong
I need a program that can clean up my Kindle. Here's what I mean:

When you read a book on the kindle, it makes a matching folder in the same folder as the book file is, with a matching name. As an example:
For the book at F:\documents\Alien Emergencies_ A Sector General Omnibus_B003J5UJ72.azw it creates a folder F:\documents\Alien Emergencies_ A Sector General Omnibus_B003J5UJ72.sdr that contains metadata and a way to mark your progress in your book.

It's supposed to delete the "sidecar" folder when you delete the book on the device, but it doesn't always do it, and the device gets cluttered with these over time. And since there's only like 3 GB of storage on it hundreds of folders at 200 KB to 2 MB does add up.

What I'd like is a program that finds all folders with a name ending with ".sdr" in a given folder and its subfolders, and looks for any matching file of the extensions ".azw", ".mobi", ".txt", ".pdf", ".prc", ".pdb", ".azw1" or ".azw3". If the program can't find a match, it should move the ".sdr" folders to another folder where they can then be manually deleted.

The program should be able to run on Windows 7 or later, but if it's easier to make it just run on Windows 10 that's fine too.

mobby_6kl
Aug 9, 2009

by Fluffdaddy
That's easy, but I gotta sleep now.

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Sorry things got a bit busy. Here you go:

KindleKleaner

Just copy the executable to the base directory (like F:\documents) and run it from there. It'll move all orphaned .sdr files to a new subfolder called ".SDRs". It's not checking for any specific extensions, just anything else, let me know if that's a problem. Folders starting with a dot (.) are skipped. Also I tested it on my own system but it very well can delete everything and send me your bitcoins, so your own risk etc.

fishmech
Jul 16, 2006

by VideoGames
Salad Prong

mobby_6kl posted:

Sorry things got a bit busy. Here you go:

KindleKleaner

Just copy the executable to the base directory (like F:\documents) and run it from there. It'll move all orphaned .sdr files to a new subfolder called ".SDRs". It's not checking for any specific extensions, just anything else, let me know if that's a problem. Folders starting with a dot (.) are skipped. Also I tested it on my own system but it very well can delete everything and send me your bitcoins, so your own risk etc.

The program only moves .sdr files, when it needs to also move folders that are named *.sdr Not sure how to change that in the source code myself, otherwise I just would.

It has managed to clean up some older problem files already though so that already helps a bit!

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Oh wow, somehow I missed that those are folder and not files, even though you explicitly say so in several places. Probably has something to do with reading the requirements at 1:30am :v:

I'll change it so that it moves the "Book2.sdr" folder and everything in.
Book1.txt
Book1.sdr\abc.xyz
Book2.sdr\def.xyz

fishmech
Jul 16, 2006

by VideoGames
Salad Prong

mobby_6kl posted:

Oh wow, somehow I missed that those are folder and not files, even though you explicitly say so in several places. Probably has something to do with reading the requirements at 1:30am :v:

I'll change it so that it moves the "Book2.sdr" folder and everything in.
Book1.txt
Book1.sdr\abc.xyz
Book2.sdr\def.xyz

Yeah that'll work fine. Thanks for the work!

mobby_6kl
Aug 9, 2009

by Fluffdaddy
So that was super straightforward to change but I don't blame you for not messing with that code, it's... a bit sketchy :)

KindleKleaner

fishmech
Jul 16, 2006

by VideoGames
Salad Prong

mobby_6kl posted:

So that was super straightforward to change but I don't blame you for not messing with that code, it's... a bit sketchy :)

KindleKleaner

Just used it and it worked perfectly! And my Kindle now has 300 fewer junk folders and about 200 MB of space was recovered. Thanks a lot!

Chunjee
Oct 27, 2004

I use a vertical taskbar but lately it fills up with things and then I have to start flipping between two pages. I'd like to get a 2nd row of icons but so far this doesn't seem possible for vanilla Windows 7.
This is the best workaround I found so far, but seems like a lot of work and is not persistent between restarts.


You can make the taskbar wider; but the icons just get wider. I want a separate column; Ideally without any text.


->
Obviously less open stuff would help.

Chumbawumba4ever97
Dec 31, 2000

by Fluffdaddy
Hey, everybody. I actually came across this thread by pure chance while googling for obscure Windows programs. Please forgive me if I am doing something wrong in my request. And please keep in mind that I know nothing about programming other than making bad AOL punters in 1996.

I feed stray cats in my neighborhood, and I trap them to get them neutered/spayed (and if they are friendly, usually a home; otherwise I just release them after being fixed). I do not like leaving the traps out overnight because it's freezing here in VT (plus I feel bad leaving them in a trap for hours no matter what the weather). Anyway, the solution I came up with was I set up an IP camera that makes a loud beep on my laptop when it detects motion, so yes I get very broken sleep but I don't really mind.

The trap is set up in a way that I can close it from bed, so if the alarm goes off and it's a cat, I spring the trap and then go outside and bring the cat downstairs for warmth and food until I can get it help. If the alarm sounds for a movement that is from a raccoon or something that is not a cat, I don't spring the trap and I just go back to sleep.

This has been working except for the fact that THE LOUD BEEPING ALERT DOES NOT STOP UNTIL THE drat RACOON OR WHATEVER LEAVES. So I have to lay there and stare at the ceiling instead of going back to bed because if I mute it, I'll fall back asleep and and won't get any more alerts that night. If I wait the 20 drat minutes for the racoon or whatever to leave, I've been up so long that I usually can't fall back asleep.

Help me goons smarter than I am, please. Is there any way to make a small Windows program that I can just type in the length of time I want the computer to be muted? Then after that amount of time, Windows will unmute? This is how I picture it:


(sorry for the crude mock-up).

I searched for something that did this for quite a bit of time but came up with nothing. In fact, I only managed to find one other person on the entirety of the internet that also wanted to know if such a program existed.

If someone could please help, it would be greatly appreciated. This with the combo of a baby who is teething is giving me some pretty bad sleep deprivation so any help would be literally improving my quality of life. :D

ToxicFrog
Apr 26, 2008


Uncle at Nintendo posted:

If someone could please help, it would be greatly appreciated. This with the combo of a baby who is teething is giving me some pretty bad sleep deprivation so any help would be literally improving my quality of life. :D

Here you go. Based on nircmd.

Unzip somewhere, double-click raccoons.bat, enter how many minutes you want it to mute for. Press any key to unmute early.

Chumbawumba4ever97
Dec 31, 2000

by Fluffdaddy

ToxicFrog posted:

Here you go. Based on nircmd.

Unzip somewhere, double-click raccoons.bat, enter how many minutes you want it to mute for. Press any key to unmute early.

A response with the program I needed in less than an hour :stare:

Thank you so, so much. I somehow have never heard of nircmd before. Holy moley what a useful piece of software. When I was googling what I wanted, all I got were people complaining about volume issues in Windows.

Seriously, thank you again. If you ever have questions about uh, modding retro game consoles or something, let me know. You've literally gifted me extra sleep; thank you again!

Chunjee
Oct 27, 2004

I did a quick 1 hour version.


http://www.mediafire.com/download/41vnjxnrjp8da2y/Put-A-Sock-In-It.zip compiled and source included.

The "UnMute" is more of a "Toggle mute status and kill the timer". With another 20mins I could check the system's current sound status.

Chumbawumba4ever97
Dec 31, 2000

by Fluffdaddy

Chunjee posted:

I did a quick 1 hour version.


http://www.mediafire.com/download/41vnjxnrjp8da2y/Put-A-Sock-In-It.zip compiled and source included.

The "UnMute" is more of a "Toggle mute status and kill the timer". With another 20mins I could check the system's current sound status.

This one works just as well too. Plus I love the sock icon.

Thank you both so much.

nexxai
Jul 17, 2002

quack quack bjork
Fun Shoe
Ok, I've tried to wrap my head around Swift and Xcode for the last few days and being that I'm absolutely not a programmer, am not getting very far.

What I'm trying to do is build a VERY simple app for my wife that tracks her decision making; specifically whether she made a good choice or a bad choice.

The way I envision it, the main screen would just be two big buttons "Good Decision" and "Bad Decision" and something smaller at the bottom to review previously recorded ones, and then once either is clicked, the next screen asks for the time/date of the decision and a description of the circumstances surrounding it, and then the ability to save it in CoreData.

The list of previously recorded decisions could be sorted by good/bad decision, or by date.

An example:

GOOD DECISION -> April 4, 2016 7:45PM, "Chose to not have thirds of a meal." -> Save.

That's literally it. Depending on the results, I'd even consider buying all of the source code from you so I can make it pretty for her with graphics and stuff.

Can anyone help me out?

gary oldmans diary
Sep 26, 2005

nexxai posted:

Can anyone help me out?
Asking your wife to help you catalog her daily failures seems itself like an advanced iteration of a bad decision/habit started long ago. I would consider re-evaluating the problem itself, rather than acting on the current perspective of it.

I don't know the specifics of your relationship, but you see how your idea seems harsh from an outside perspective, right?

Corla Plankun
May 8, 2007

improve the lives of everyone

nexxai posted:

Ok, I've tried to wrap my head around Swift and Xcode for the last few days and being that I'm absolutely not a programmer, am not getting very far.

What I'm trying to do is build a VERY simple app for my wife that tracks her decision making; specifically whether she made a good choice or a bad choice.

The way I envision it, the main screen would just be two big buttons "Good Decision" and "Bad Decision" and something smaller at the bottom to review previously recorded ones, and then once either is clicked, the next screen asks for the time/date of the decision and a description of the circumstances surrounding it, and then the ability to save it in CoreData.

The list of previously recorded decisions could be sorted by good/bad decision, or by date.

An example:

GOOD DECISION -> April 4, 2016 7:45PM, "Chose to not have thirds of a meal." -> Save.

That's literally it. Depending on the results, I'd even consider buying all of the source code from you so I can make it pretty for her with graphics and stuff.

Can anyone help me out?

Sometimes I'm like, "man, i forgot to roll the trash to the curb last night. I'm such a poo poo husband." And then I see a dude on the internet who nags his wife with such enthusiasm and dedication that he's literally outsourcing it to a mobile dev so he can keep it going even when he's not around. lovely husband telepresence: the future is now.

Corla Plankun fucked around with this message at 07:28 on Apr 7, 2016

Chunjee
Oct 27, 2004

nexxai posted:

Can anyone help me out?

Could do something like this:




Does this have to work on a phone? Never worked with CoreData before but I can save as JSON.

Of course I would want to know this is something she wants. Making a list of all transgressions is ill advised.

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Are you going to have your own version too? You can put down this app idea there. Actually you'll probably need to extend the specs to three options, with "loving terrible" category as well.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

nexxai posted:

Ok, I've tried to wrap my head around Swift and Xcode for the last few days and being that I'm absolutely not a programmer, am not getting very far.

What I'm trying to do is build a VERY simple app for my wife that tracks her decision making; specifically whether she made a good choice or a bad choice.

The way I envision it, the main screen would just be two big buttons "Good Decision" and "Bad Decision" and something smaller at the bottom to review previously recorded ones, and then once either is clicked, the next screen asks for the time/date of the decision and a description of the circumstances surrounding it, and then the ability to save it in CoreData.

The list of previously recorded decisions could be sorted by good/bad decision, or by date.

An example:

GOOD DECISION -> April 4, 2016 7:45PM, "Chose to not have thirds of a meal." -> Save.

That's literally it. Depending on the results, I'd even consider buying all of the source code from you so I can make it pretty for her with graphics and stuff.

Can anyone help me out?

I can think of circumstances where this doesn't make you a lovely person, but to think you could post this without explaining why this doesn't make you a lovely person...makes me think you're doing this for reasons that make you a lovely person.

nexxai
Jul 17, 2002

quack quack bjork
Fun Shoe
Oh wow, this blew up. Sorry for not explaining more, I guess when you live it every day, you forget other people might not experience the same stuff.

Anyways, this is absolutely NOT about being a nagging husband whatsoever. I love my wife more than she loves herself a lot of days in fact. She has some health issues and making good decisions is really important to her daily health. She has something similar to fibromyalgia, which really limits what she can physically do in a day. Whereas you and I can get up and shower and go to work and go to the gym and go out for dinner and go out to a buddy's house, she can *maybe* do one of those things if she's having a *really* good day. But since she can be rather determined (to the point of almost being stubborn), she'll try and do too many things in one day, and then what ends up happening is that she wears herself out to the point of exhaustion and being bed-ridden for 2-3 days.

The app would be more to help reinforce those days where she only did one thing even if she felt like she had the energy to do 2 or 3 for example, more than to point out the days when she didn't make good choices.

Her and I actually talk about her good *and* bad choices regularly in a very constructive - and what I think is positive - way; in fact, she's the one that comes to me a lot of the time saying "nexxai, today I made a bad choice...." We have a *very* healthy and communicative relationship, this app would just help us keep track so that we can try and see patterns if there are any, and to show her that she makes more good decisions than she thinks.

Chunjee posted:

Could do something like this:




Does this have to work on a phone? Never worked with CoreData before but I can save as JSON.

Of course I would want to know this is something she wants. Making a list of all transgressions is ill advised.

Yeah, that would be awesome, as long as you could add a date field (in case we're not adding the decision at the very second that it happened).

nexxai fucked around with this message at 15:45 on Apr 7, 2016

Chunjee
Oct 27, 2004

Had a feeling this had more to do with a health condition than anything else.

What I posted might take 1~3 hours. It would only work on windows, I mention this because I know Swift is an iOS thing. I have a small window of time today I'll try to finish it. A custom date button will be there as well, forgot that in the mock up.

If it has to work on a phone I'd have to do it as a web app and that would take significantly longer.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Well that sounds a little better!

nexxai
Jul 17, 2002

quack quack bjork
Fun Shoe

Chunjee posted:

Had a feeling this had more to do with a health condition than anything else.

What I posted might take 1~3 hours. It would only work on windows, I mention this because I know Swift is an iOS thing. I have a small window of time today I'll try to finish it. A custom date button will be there as well, forgot that in the mock up.

If it has to work on a phone I'd have to do it as a web app and that would take significantly longer.
Yeah, I'd really prefer it work on a phone because the whole point is we want to be able to record the decision, whatever it was, as soon as she remembers it, which could very easily be when we're out for dinner or at one of her doctor's appointments.

Chunjee
Oct 27, 2004

I better stand back for now. Too many unfinished web apps for me to take on another.

Corla Plankun
May 8, 2007

improve the lives of everyone
Does anyone still have a link to the image-sorting program from way way long ago in this thread (or maybe the original?) It was SO drat useful

gary oldmans diary
Sep 26, 2005
How did it sort them?
Incidentally, I wish I still had the app that separated static and animated GIFs.

fattredd
Mar 4, 2015

Woops
There was an app posted somewhere in here that was a self contained text encryption file. Any saved text would generate a new encrypted exe with the text in it.

Anybody have a copy of it/know where it is? I just spent like 20 min Ctrl-F ing all 70 pages and can't find it.

Adbot
ADBOT LOVES YOU

mobby_6kl
Aug 9, 2009

by Fluffdaddy

gary oldmans diary posted:

How did it sort them?
Incidentally, I wish I still had the app that separated static and animated GIFs.

I think it just showed you them one by one and moved them based on a key you pressed.

IIRC I made that GIF program, I'll try to see if it's still around somewhere.

  • Locked thread