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
Jiblet
Jan 5, 2004

Limey Bastard

Corla Plankun posted:

Aren't teamspeak's hotkeys global? I don't think many people would use it if they had to alt-tab back to Teamspeak every time they wanted to say something.
Sorry? Not quite sure what I can say to make the problem any clearer...

TeamSpeak doesnt recognise my keyboards stupid extra keys.
I want to make it.
AHK is a way to do that, IF I can make talk to the TS3 window.

That's really all.

Adbot
ADBOT LOVES YOU

Corla Plankun
May 8, 2007

improve the lives of everyone
What I am saying is all you have to do is send the keystroke that teamspeak is expecting and you don't have to do any real code. Just:

code:
VK45::Q
Where VK45 is whatever the address of your media key is, and Q is whatever button teamspeak's hotkey is bound to.

Jiblet
Jan 5, 2004

Limey Bastard
Ah possibly. How do I find the address of the media key though?

underlig
Sep 13, 2007

Jiblet posted:

Ah possibly. How do I find the address of the media key though?
Try the "Special Keys" part of http://www.autohotkey.com/docs/KeyList.htm to identify it (hopefully)

Corla Plankun
May 8, 2007

improve the lives of everyone
Just press it and look at your key history in autohotkey.

Tedronai66
Aug 24, 2006
Better to Reign in Hell...

dotalchemy posted:

Not sure if OP is still around / interested / has site code, but I've got hosting available if something like the OP had running is of interest to anyone? Happy to offer it up as this thread is quite awesome.

Also, congratulations to UglyCrackBaby for getting an entire Point of Sale / back office system written in tiny sections. If anyone would like to start out on a tiny kernel first, I'll supply requirements for tiny driver API's / GUI's / distributed filesystems and hypervisor funtionality over the course of the next 12 months.

I'd love for a site to be there with fulfilled/open project and stuff. Hell, I'd be tempted to get hosting myself and see if I could do anything.

In fact, I just may do that as a weekend project or something.

corgski
Feb 6, 2007

Silly goose, you're here forever.

Anyone here use Linux on the PPC architecture?

I'm looking for a Linux PPC build of lwjgl to use with OpenJDK 7. It appears that the build scripts assume linux is x86 or x64, even though they target PPC just fine on OS X. It should be as simple as adding a new build target... I hope.

Either way, $15 or equivalent SA gift certs for the person who pulls it off. :)

Ian McLean
Sep 9, 2012

statpedia.org
Post Stats on Anything
Hi,

I am looking for some help developing Statpedia.

Here is a demo of the current progress: https://www.youtube.com/watch?v=4Z5uISriMtQ

The link to the website in it's current progress is statpedia.com/staging/week-21

anyways, if anyone is interested, feel free to contact me at ian@statpedia.com

Thanks,

Ian

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Ian McLean posted:

Hi,

I am looking for some help developing Statpedia.

Here is a demo of the current progress: https://www.youtube.com/watch?v=4Z5uISriMtQ

The link to the website in it's current progress is statpedia.com/staging/week-21

anyways, if anyone is interested, feel free to contact me at ian@statpedia.com

Thanks,

Ian

You are aware you have a publicly viewable post history? If you want help, make a job offer, not a plea for 'help'.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.
Also I'm pretty sure it doesn't qualify for being a tiny app.

Hoborg
Oct 19, 2006

by T. Mascis

Aleksei Vasiliev posted:

Also I'm pretty sure it doesn't qualify for being a tiny app.

I'm reminded of the aftermath of Wikipedia's early success in 2003/2004 when there were a load of sites calling themseles "WikiThis" or "ThatPedia", even if they weren't wikis (*cough*wikileaks) or something in the public interest - I'm getting flashbacks.

Of course that campaign was shortly-lived after Jimmy Wales' Wikia pretty much conquered the wiki-website category. I genuinely want to know what this "Statpedia" thing is - but I must tell Ian McClean that I have zero interest in working for it because he has demonstrated exactly how you don't recruit people to work for you (and being a goon for less than a month too? check!).

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
There's also a somewhat more established competitor in statistics by the name of WolframAlpha as well.

ufarn
May 30, 2009
Does anyone know a good UserScript/GreaseMonkey tutorial for customizing the CSS for a site?

If not, can you write a basic boilerplate I can use for future pet hobby projects? Maybe upload it to Gist?

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

I'd recommend stylish, it's like greasemonkey except specifically for CSS instead of JS
https://addons.mozilla.org/en-US/firefox/addon/stylish/

gary oldmans diary
Sep 26, 2005
Right about now I wish I knew where I could upload a Wink-created swf.

ufarn posted:

Does anyone know a good UserScript/GreaseMonkey tutorial for customizing the CSS for a site?

If not, can you write a basic boilerplate I can use for future pet hobby projects? Maybe upload it to Gist?
Firefox?
  1. Install Stylish, restart
  2. Go to the webpage with what you want to edit
  3. Open DOM Inspector (Tools > Web Developer > DOM Inspector | CTRL-SHIFT-I)
  4. (In DOM Inspector) Edit > Select Element by Click
  5. (In the page you want to edit) Click something to edit
  6. (In DOM Inspector) Right-click the highlighted item in the tree view > Copy Selector > *You might see many options here including
    1. All elements of this type (ex:"DIV")
    2. A class selector to edit a class someone wrote into the website's custom CSS meant to be applied to several elements prefixed by "." (ex:".blockedtext")
    3. An ID selector meant to be specific to that one single instance of an element per page prefixed by "#" (ex:"#forumheader")
    4. A CSS selector using complex selection rules (ex:"DIV[lang="en"][class="mw-content-ltr"][dir="ltr"]")
  7. In DOM Inspector's tree view, you may find that what you actually want to change is the parent of the element you actually clicked on, so click higher-level elements and watch the blinking red selection box DOM Inspector displays on the page. Copy the CSS selector that best fits the element or set of elements you want to change.
  8. Right-click Stylish icon on Add-on bar > Write new Style > For subdomain.domain.com
  9. (In the Stylish editor) On the empty line between the curly brackets, paste the selector you copied in DOM Inspector. You can add more selectors separated by commas if you want to apply the same rules to all of those elements (ex:".header, .footer").
  10. Following the CSS selectors you wrote/copied, add your own set of curly brackets
  11. (Within your curly brackets) Write the CSS attribute changes you want to make. If you're interested in CSS I'm sure you have some in mind, but W3 and W3Schools are pretty good. If you want to edit some CSS changes that a website has applied, DOM Inspector's style view can help you find out how those changes are written.
    Each rule should be terminated by a semicolon, but since we also want to override other CSS we're going to add "!important" to every CSS rule we write.
  12. Click "Preview"
  13. If you like your CSS changes, give it a name and save it.
  14. Right-click the Stylish icon on the page you wrote a new style for and turn your style on and off again really fast to your heart's content.

Time for an example. Let's say you don't vote threads and don't Digg threads. Might as well get rid of the distracting voting thing on your end, then. It uses the class selector "threadrate" in SA's HTML according to DOM Inspector.
In Stylish:
code:
@namespace url([url]http://www.w3.org/1999/xhtml[/url]);

@-moz-document domain("forums.somethingawful.com") {
.threadrate {
    display: none !important;}
}
You'll find yourself using "display: none !important;" a lot. So very much.

gary oldmans diary fucked around with this message at 01:32 on Oct 1, 2012

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



Hogburto posted:

You'll find yourself using "display: none !important;" a lot. So very much.
On an only vaguely related note, I'm going to say that if -and only if- your only goal is to hide elements from pages in Firefox, Adblock Plus with Elements Hiding Helper does a decent job without having to edit the CSS manually.

ufarn
May 30, 2009
I was thinking more along the lines of a simple foo.user.js file. That way, I can save it in my Dropbox folder and point Opera to it (or drag them to Chrome to install them as extensions). Stylish, AdBlock, and the like are generally really hard to synchronize across devices and installations in my experience - at least last I used them some years ago.

Microplastics
Jul 6, 2007

:discourse:
It's what's for dinner.
Hi guys. This looks like the thread to ask for a programming favour! I'm looking for a program that will do the following:

  1. Take a URL from a list of URLs (in say a text file),
  2. Download the source code of the webpage that that URL leads to,
  3. Copy that source code to sheet 1 in a new xls (or xlsl) spreadsheet (with each line on a separate row in column A),
  4. Save and close the file, naming it after the position of the URL in the list (e.g. the third URL would result in 0003.xls),
  5. Move onto the next URL in the list and repeat

Alternatively for step 3, it could save to a text file, but it would all need migrating to spreadsheets so it would be a massive time-saver if it could do that directly instead. The number of URLs is in the thousands.

A lot would then need to be done with the data in the spreadsheets, but I know my way around VBA so I could sort it all out then.

How feasible is this?

A COMPUTER GUY
Aug 23, 2007

I can't spare this man - he fights.
If you can use Ruby - quick and dirty script to do that. You'll need the gems open-uri and spreadsheet. Also, the list of URLs must be separated by newlines in a file called urls.txt in the same directory as the script.

Ruby code:
require 'rubygems'
require 'open-uri'
require 'spreadsheet'

# first we open our file of urls - name it urls.txt in the same directory as this script
position = 1
File.open('urls.txt').each_line do |s|
	puts "Reading #{s}"
	# gives us an array of the html of the page, split by line
	html = open(s).read().split("\n")
	
	# creating our spreadsheet and first worksheet
	book = Spreadsheet::Workbook.new
	sheet = book.create_worksheet
	row_num = 0
	puts "Creating worksheet"
	html.each do |row|
		next unless row.length > 0
		sheet.row(row_num)[0] = row
		row_num += 1
	end
	
	# writing the spreadsheet out to this directory
	book.write "#{position.to_s.rjust(4, '0')}.xls"
	puts "Wrote to #{position.to_s.rjust(4, '0')}.xls"
	position += 1
end
e: added some puts statements and filtering out blank lines from the html

A COMPUTER GUY fucked around with this message at 17:25 on Nov 15, 2012

Microplastics
Jul 6, 2007

:discourse:
It's what's for dinner.
Awesome thanks! Unfortunately iI know nothing about Ruby but I'll do some research and see how i get on. . (and see what these "gems" are all about)

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

KKKlean Energy posted:

Hi guys. This looks like the thread to ask for a programming favour!
I was bored so I wrote a lovely WinForms app that does what you asked for. Download executable and source

Screenshot:


edit: Forgot to package Excel interop dlls with the executable. I've updated the contents of the zip file. FYI: This uses Excel automation so you'll have to run it on a computer that has Excel installed.

Fiedler fucked around with this message at 14:56 on Nov 16, 2012

Microplastics
Jul 6, 2007

:discourse:
It's what's for dinner.
Oh awesome thanks so much! I'll have to give it a whirl when I get home :) Cheers!

Rhymenoserous
May 23, 2008

Ian McLean posted:

Hi,

I am looking for some help developing Statpedia.

Here is a demo of the current progress: https://www.youtube.com/watch?v=4Z5uISriMtQ

The link to the website in it's current progress is statpedia.com/staging/week-21

anyways, if anyone is interested, feel free to contact me at ian@statpedia.com

Thanks,

Ian

Thanks for signing your post. If you hadn't I never would have realized who was making it.

Ian

Microplastics
Jul 6, 2007

:discourse:
It's what's for dinner.

Fiedler posted:

I was bored so I wrote a lovely WinForms app that does what you asked for. Download executable and source

Screenshot:


edit: Forgot to package Excel interop dlls with the executable. I've updated the contents of the zip file. FYI: This uses Excel automation so you'll have to run it on a computer that has Excel installed.

Oops... I forgot to mention that I need to be logged in for it to work :/ It completely passed me by that the program wouldn't have access to the cookie that Chrome has to let me log in! :doh: Other than that it works perfectly :)

For reference I'm trying to strip some data from a thread on SA - any idea how that could work?

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.
Here's a tweaked version: Executable and source

This version has an IE browser control with an address bar. Enter the URL of the website into the address bar and hit enter. Login to get cookied. Then specify the input file name and the output directory and click the big Go button.

Microplastics
Jul 6, 2007

:discourse:
It's what's for dinner.
Man you are a genius. Given how quickly you came up with this it must be pretty easy code for you but to me it's just a little bit like magic. Works beautifully.

Thanks so much!

pipes!
Jul 10, 2001
Nap Ghost
Not so much an app as much as an Alfred extention, but I have this half-baked piece of Bash:

code:
echo "scale=3; {query} / 16" | bc
echo $em | pbcopy
It's for a script to convert pixel values to ems, something I have to do a lot for web development. Basically, I'm trying to wrap up the first line into the variable $em, so I can copy it to the clipboard. However, I've hit a wall since I don't know Bash at all, or its syntax - this was more or less cobbled together through trial and error.

If it helps any, {query} should be escaped via the spaces.

ToxicFrog
Apr 26, 2008


pipes! posted:

Not so much an app as much as an Alfred extention, but I have this half-baked piece of Bash:

code:
echo "scale=3; {query} / 16" | bc
echo $em | pbcopy
It's for a script to convert pixel values to ems, something I have to do a lot for web development. Basically, I'm trying to wrap up the first line into the variable $em, so I can copy it to the clipboard. However, I've hit a wall since I don't know Bash at all, or its syntax - this was more or less cobbled together through trial and error.

If it helps any, {query} should be escaped via the spaces.

I have no idea what you mean by "{query} should be escaped via the spaces".

For the rest of it, though - variable assignment in bash is just name=value. The value you want here is the output of the echo|bc, which you can get using $() ($(cmd) runs cmd and expands to the output of that command), something like this:

code:
em=$(echo "scale=3; {query} / 16" | bc)
echo $em | pbcopy
If that's the only thing you use $em for, though, you don't even need the variable; you can just pipe the output of bc straight into pbcopy:

code:
echo "scale=3; {query} / 16" | bc | pbcopy

pipes!
Jul 10, 2001
Nap Ghost

ToxicFrog posted:

I have no idea what you mean by "{query} should be escaped via the spaces".

That was poorly-phrased, sorry. {query} is used by Alfred to place inputted text into its extensions. The spaces characters surrounding {query} escape it, so Bash doesn't choke.


ToxicFrog posted:

code:
echo "scale=3; {query} / 16" | bc | pbcopy

And this works perfectly! :monocle:

Thank you so much, you've saved me countless hours of work. I didn't realize you could pipe it directly out like that, very cool.

dirby
Sep 21, 2004


Helping goons with math
I know this is trivially easy in python or whatever but it's been ages since I programmed anything like this. All I want is something that takes one text file and does a bunch of simple replacements based on, say, a csv file. Like table.csv has many lines like blah, BLAH2.0 and the program will take input.txt and yield an output which has every instance of "blah" replaced by "BLAH2.0", etc. If it makes a difference, the csv might have all sorts of dangerous characters in it.

Edit: Some searching pulled up this related stackoverflow page which suggests that while there might be a way to do it with a pure batch file, Windows PowerShell might be a useful thing to have and allows me to do it with a command like:Get-Content input.txt | ForEach-Object { $_ -replace "foo", "bar" } | ForEach-Object { $_ -replace "baz", "bloo" } | Set-Content output.txt, which is good enough for my purposes.

Edit2: Except it doesn't handle square brackets. I then tried dicking around with various batch files people posted, but couldn't get them to work. I guess I'll literally have to open a python tutorial because I think it would save me time at this point.

dirby fucked around with this message at 18:36 on Nov 25, 2012

YO MAMA HEAD
Sep 11, 2007

Could some Applescript guru figure out how to make a right-click service to securely erase free space on a volume? It'd be nice to do that quickly with flash drives. Terminal command is something like diskutil secureErase freespace 1 but I'm not sure how to pass partition information to Automator/Applescript. Thanks!

neogeo0823
Jul 4, 2007

NO THAT'S NOT ME!!

Hello, coders. I've been pointed to here to ask for some help with a Greasemonkey script I've been trying to work out.

A bunch of goons and myself play this browser based game together. Every month, our alliance has to ask our membership to fill out a form to give our leaders some specific data that we use for various things. The problem is that most of our goons are very :effort: and it would be very nice if we could find a way to automate the data mining process and take the user interaction out of it.

What I need is a script that our members can install that will, upon them logging into the game, scrape specific data from a couple of pages of their profile, and then upload the data to a central place(google doc spreadsheet, perhaps?) for others to view.

I can provide screenshots and source code of the pages in question, if anyone can help me write this out. Unfortunately, I've got literally zero experience in coding, so at the very least, I'd be very thankful if someone could walk me through how to write a script by myself.

Sylink
Apr 17, 2004

helopticor posted:

I know this is trivially easy in python or whatever but it's been ages since I programmed anything like this. All I want is something that takes one text file and does a bunch of simple replacements based on, say, a csv file. Like table.csv has many lines like blah, BLAH2.0 and the program will take input.txt and yield an output which has every instance of "blah" replaced by "BLAH2.0", etc. If it makes a difference, the csv might have all sorts of dangerous characters in it.

Edit: Some searching pulled up this related stackoverflow page which suggests that while there might be a way to do it with a pure batch file, Windows PowerShell might be a useful thing to have and allows me to do it with a command like:Get-Content input.txt | ForEach-Object { $_ -replace "foo", "bar" } | ForEach-Object { $_ -replace "baz", "bloo" } | Set-Content output.txt, which is good enough for my purposes.

Edit2: Except it doesn't handle square brackets. I then tried dicking around with various batch files people posted, but couldn't get them to work. I guess I'll literally have to open a python tutorial because I think it would save me time at this point.

Python can do this easily, depending on how big this file is you can do it with only a few lines something like

file = open('r','bullshit.csv')
text = file.read()
text.replace('whatever','replacement')

then open another file and write it.

I can write up a script for you if you PM me some details.

Bobbin Threadbear
May 6, 2007

neogeo0823 posted:

Hello, coders. I've been pointed to here to ask for some help with a Greasemonkey script I've been trying to work out.

A bunch of goons and myself play this browser based game together. Every month, our alliance has to ask our membership to fill out a form to give our leaders some specific data that we use for various things. The problem is that most of our goons are very :effort: and it would be very nice if we could find a way to automate the data mining process and take the user interaction out of it.

What I need is a script that our members can install that will, upon them logging into the game, scrape specific data from a couple of pages of their profile, and then upload the data to a central place(google doc spreadsheet, perhaps?) for others to view.

I can provide screenshots and source code of the pages in question, if anyone can help me write this out. Unfortunately, I've got literally zero experience in coding, so at the very least, I'd be very thankful if someone could walk me through how to write a script by myself.

I'd be willing to try making this. Contact me on AIM: Pyrouscent

MrPablo
Mar 21, 2003

helopticor posted:

I know this is trivially easy in python or whatever but it's been ages since I programmed anything like this. All I want is something that takes one text file and does a bunch of simple replacements based on, say, a csv file. Like table.csv has many lines like blah, BLAH2.0 and the program will take input.txt and yield an output which has every instance of "blah" replaced by "BLAH2.0", etc. If it makes a difference, the csv might have all sorts of dangerous characters in it.

Edit: Some searching pulled up this related stackoverflow page which suggests that while there might be a way to do it with a pure batch file, Windows PowerShell might be a useful thing to have and allows me to do it with a command like:Get-Content input.txt | ForEach-Object { $_ -replace "foo", "bar" } | ForEach-Object { $_ -replace "baz", "bloo" } | Set-Content output.txt, which is good enough for my purposes.

Edit2: Except it doesn't handle square brackets. I then tried dicking around with various batch files people posted, but couldn't get them to work. I guess I'll literally have to open a python tutorial because I think it would save me time at this point.

This Ruby script should do what you want: replacer.rb.

Usage:
code:
  ruby replacer.rb subs.csv input.txt output.txt
Where subs.csv is a CSV file containing the value to search for in the first column and the associated replacement value in the second column.

Oneiros
Jan 12, 2007



YO MAMA HEAD posted:

Could some Applescript guru figure out how to make a right-click service to securely erase free space on a volume? It'd be nice to do that quickly with flash drives. Terminal command is something like diskutil secureErase freespace 1 but I'm not sure how to pass partition information to Automator/Applescript. Thanks!

This might qualify more as a Coding Horror, but I whipped this up for you instead of studying for finals.

http://pastebin.com/rUvTti2W

YO MAMA HEAD
Sep 11, 2007

How nice! I wish I had looked into it a little more, the "disk of" construction is pretty straightforward. Thanks!

madeupfred
Oct 10, 2011

by FactsAreUseless
This is a really tiny and kind of stupid, but I would be willing to pay for an app that takes the County Results by state at http://www.politico.com/2012-election/results/president/(Insert State Here)/ and saves them in an Excel workbook.

Thermopyle
Jul 1, 2003

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

madeupfred posted:

This is a really tiny and kind of stupid, but I would be willing to pay for an app that takes the County Results by state at http://www.politico.com/2012-election/results/president/(Insert State Here)/ and saves them in an Excel workbook.

That URL isn't any good. If I replace (Insert State Here) with Missouri or MO, it's still a That Page Is Not Found.

Adbot
ADBOT LOVES YOU

the littlest prince
Sep 23, 2006


Thermopyle posted:

That URL isn't any good. If I replace (Insert State Here) with Missouri or MO, it's still a That Page Is Not Found.

Has to be all lower-case apparently.

  • Locked thread