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.
 
  • Post
  • Reply
regulargonzalez
Aug 18, 2006
UNGH LET ME LICK THOSE BOOTS DADDY HULU ;-* ;-* ;-* YES YES GIVE ME ALL THE CORPORATE CUMMIES :shepspends: :shepspends: :shepspends: ADBLOCK USERS DESERVE THE DEATH PENALTY, DON'T THEY DADDY?
WHEN THE RICH GET RICHER I GET HORNIER :a2m::a2m::a2m::a2m:

Ah thanks. I'm just doing the codeacademy stuff and don't know all the built in methods -- is there a .to_i to turn a string into an integer (if possible), the same way that .to_s converts integer into a string? Or a way to append 'gets' so that the input is accepted as an integer?

Sorry, CodeAcademy is light on the syntactical stuff.

e: got it, thanks all!

regulargonzalez fucked around with this message at 09:21 on Aug 18, 2014

Adbot
ADBOT LOVES YOU

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)
Not sure if this is the right place for this but seems to be the best fit.

My drupal 7 site was hacked by some pro-palestine group and of course I don't have a recent backup. Contacted the host and not surprisingly they are unhelpful. Anyone have any good resources to look at for identifying what they did and removing it? I would very much prefer not having to scrap the whole thing because I find some injected code somewhere. The url is animaltree.org if it is useful at all.

EAT THE EGGS RICOLA
May 29, 2008

nesbit37 posted:

Not sure if this is the right place for this but seems to be the best fit.

My drupal 7 site was hacked by some pro-palestine group and of course I don't have a recent backup. Contacted the host and not surprisingly they are unhelpful. Anyone have any good resources to look at for identifying what they did and removing it? I would very much prefer not having to scrap the whole thing because I find some injected code somewhere. The url is animaltree.org if it is useful at all.

https://www.drupal.org/project/hacked, maybe?

nesbit37
Dec 12, 2003
Emperor of Rome
(500 BC - 500 AD)

Awesome, thanks. It looks like it might be too late for that one since I don't think I can even get to the admin interface of Drupal, just the files and database on the server, but certainly looks good.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
There's not a VBA thread so posting here. I inherited from a coworker the maintenance of a Word macro that parses a document for specific phrases and grammatical constructs that are no-nos in the documents we produce. It then attaches a comment to the offending phrase with revision suggestions.

He doesn't know anything about programming, so he cobbled it together with random googling. Right now it is literally 1000+ blocks of code just like this:
code:
Selection.HomeKey Unit:=wdStory
    Selection.Find.Execute Replace:=wdReplaceAll
    Options.DefaultHighlightColorIndex = wdGray50
        With Selection.Find
        .Text = "As"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = True
        '
        '
        '.MatchAllWordForms = False
    If Selection.Find.Execute Then
    Selection.Comments.Add Range:=Selection.Range
    Selection.TypeText Text:= _
        "Make sure you don't use ""as"" to replace ""because."""
    Selection.Find.ClearFormatting
    Selection.EscapeKey
    End If
    End With
Obviously, this takes 15+ minutes to run on some documents. My first thought to fix this thing was to instead insert all the offending phrases into a map or dictionary at the beginning of the macro and then just parse word-by-word looking each word up in the map. That should return way, way faster than what this code is doing. Problem is, as you can probably see above, many of the no-nos aren't individual words. I'm not really sure how to parse for longer tokens without resorting to what this macro is already doing.

Does anyone have any thoughts on where I can sniff around to try to optimize this thing?

edit: Some sniffing around finds this: http://blogs.technet.com/b/heyscriptingguy/archive/2006/03/21/how-can-i-search-for-and-highlight-words-in-a-microsoft-word-document.aspx which can let me find words using a foreach loop, but wouldn't help with the loading up comments. I'm thinking I could do a hybrid solution:
create a text file with a bunch of lines in the form at of "no-no:comment" and parse it at the start of the script. Put the "no-no" into the array described in the link and then stick both into a map as a key-value pair. Each time a no-no is found, go to the map to find the comment to put it in. Before I start running around coding this up, do y'all think this will be any faster?

The MUMPSorceress fucked around with this message at 21:36 on Aug 20, 2014

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

I remember the first time used Quake's console and changed some variables that were being used by the game. I was kind of amazed. I guess scriptable programs have the same thing going on underneath.

What are some ways that you would bind those to the actual variables in code? Would it be language specific? Would you build some sort of table with values and just index them through there?

["varname", "val"], ["varname2", "val"] ... ?

Jewel
May 2, 2009

You'd probably never give direct variable access but instead keep it functions like everything else. Take source for example:

If you type sv_cheats 1, it calls the binding of "sv_cheats(1)" (potentially 1 being a string).

Same as "bindtoggle k +crouch" would be "bindtoggle('k', '+crouch')" and 'k' and '+crouch' would probably be resolved elsewhere inside the function.

The map would have to support storing functions that can take any commands so it's best to do something like this.

Workaday Wizard
Oct 23, 2009

by Pragmatica
What's so wrong with this code that it actually crashes the compiler?
Java code:
package crashTheSystem
import scala.slick.driver.PostgresDriver.simple._

object crashTheSystem {

  def main(args: Array[String]): Unit = {
      Database.forURL("jdbc:postgresql://localhost/someDB",
        driver = "org.postgresql.Driver",
        user = "someUser",
        password = "somePassword") withSession {
        implicit session => {
          ()
        }
      }
    println("program terminating normally...");
  }

}
Scala version:
"Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_11)"

Scala IDE version:
"Scala IDE build of Eclipse SDK
Build id: 3.0.4-2.11-20140723-2253-Typesafe"

Slick version: 2.1.0 for Scala 2.11

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Bob Morales posted:

I remember the first time used Quake's console and changed some variables that were being used by the game. I was kind of amazed. I guess scriptable programs have the same thing going on underneath.

What are some ways that you would bind those to the actual variables in code? Would it be language specific? Would you build some sort of table with values and just index them through there?

["varname", "val"], ["varname2", "val"] ... ?

In Quake there was a special structure called a cvar and there was a manager which held a collection of those. Any part of the code could register a pointer to a cvar and when you typed into the console, if what you typed matched a cvar, it would update the structure with that value so the variable could be read directly. This was C, no fancy callback or storage or protection, so you had to remember if you wanted the string or float value. There are two reasons for direct access: 1) finding a cvar by name was a linked list search and 2) it would have been more effort to expose the pointer registration stuff to the QuakeC interpreter. So, interpreted code had to look up cvars by name. Incidentally, newly-registered cvars are put at the head of the linked list, I assume as an optimization for the interpreter.

Commands were almost the same. Any part of the code could associate a callback function with a given command name. The command manager also had a linked list of commands, and if the console input matched a command, the callback would be called, and it would have to ask the command system if there was anything else on the line. Key bindings were a little more complex, there was a special command handler for those (though they were registered through the standard command manager): they would set the client's movement state, which would be sent on to the server, which would translate that into actual player movement.

Hughmoris
Apr 21, 2007
Let's go to the abyss!
I am writing a little script in AutoIt where it will open an xml file in notepad, open the Replace window, find a time value (ex: 08:25:00) and then replace it with the value + 10 seconds (08:25:10).

My issue is I don't know how to handle adding the 10 seconds to the original time. To go from 08:25:00 to 08:25:10. It needs to be in that format for the XML. I'll then continue to loop the script and continue to add 10 seconds to the previous time. Any ideas?

Thermopyle
Jul 1, 2003

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

Hughmoris posted:

I am writing a little script in AutoIt where it will open an xml file in notepad, open the Replace window, find a time value (ex: 08:25:00) and then replace it with the value + 10 seconds (08:25:10).

My issue is I don't know how to handle adding the 10 seconds to the original time. To go from 08:25:00 to 08:25:10. It needs to be in that format for the XML. I'll then continue to loop the script and continue to add 10 seconds to the previous time. Any ideas?

https://www.autoitscript.com/autoit3/docs/functions/StringRegExpReplace.htm

IIRC, the Autoit help file has a decent regex tutorial. There's also plenty of them on the Internet.

They'll seem daunting at first, but stuck with it, as they're insanely useful.

Also, that function, combined with the FileOpen function means you don't need Notepad at all.

nielsm
Jun 1, 2009



Convert the time string to a single number, add your offset to that, convert back to a time string.

E.g. "8:25:55" converts to 10 + 25*60 + 8*60*60 = 30355.

Add 10 to that, gets you 30365.

To convert that back:
Divide by 60, result is 506 and a remainder of 5. The 5 is your number of seconds, the 506 is the number of total minutes.
Divide the total minutes by 60, result is 8 and remainder 26. That's your hours and minutes.
Concatenate those results to get the desired 8:26:05

There's also a good chance that your language of choice has some library functions that can do all of this for you.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

Thermopyle posted:

https://www.autoitscript.com/autoit3/docs/functions/StringRegExpReplace.htm

IIRC, the Autoit help file has a decent regex tutorial. There's also plenty of them on the Internet.

They'll seem daunting at first, but stuck with it, as they're insanely useful.

Also, that function, combined with the FileOpen function means you don't need Notepad at all.

RegEx has kicked my butt whenever I've looked at it in the past. Not sure why I have such a hard time understanding it but I know I need to get it under my belt.

nielsm posted:

Convert the time string to a single number, add your offset to that, convert back to a time string.

E.g. "8:25:55" converts to 10 + 25*60 + 8*60*60 = 30355.

Add 10 to that, gets you 30365.

To convert that back:
Divide by 60, result is 506 and a remainder of 5. The 5 is your number of seconds, the 506 is the number of total minutes.
Divide the total minutes by 60, result is 8 and remainder 26. That's your hours and minutes.
Concatenate those results to get the desired 8:26:05

There's also a good chance that your language of choice has some library functions that can do all of this for you.

Thanks for this.

onionradish
Jul 6, 2006

That's spicy.
Hughmoris, something to play with:
code:
#include <Date.au3>
#include <Array.au3>

; $file_contents would normally be read from file
$file_contents = "foo bar 08:25:10 foobar"

ConsoleWrite("ORIGINAL FILE:" & @CRLF & $file_contents & @CRLF)

; Find all time strings (assumes HH:MM:SS) and ensures they will only be changed ONCE
$times = StringRegExp($file_contents, "(\d\d:\d\d:\d\d)", 1)
$times = _ArrayUnique($times) ; so we eliminate duplicates
_ArraySort($times, 1) ; so we make changes based on 'latest' time first

For $old_time In $times
	ConsoleWrite("OLD TIME: " & $old_time & @CRLF)

	; Split HH:MM:SS into separate H, M, S
	$hms = StringSplit($old_time, ":")

	$hours = $hms[1]
	$mins = $hms[2]
	$secs = $hms[3]

	; Convert H, M, S to 'ticks' (1/1000 second) using library
	$ticks = _TimeToTicks($hours, $mins, $secs)

	; Add 10 sec
	$ticks += 10000

	; Convert ticks back to H, M, S
	_TicksToTime($ticks, $hours, $mins, $secs)

	; Convert H, M, S back to a time string
	$new_time = StringFormat("%02i:%02i:%02i", $hours, $mins, $secs)
	ConsoleWrite("NEW TIME: " & $new_time & @CRLF)

	; Replace old time with new time
	$file_contents = StringReplace($file_contents, $old_time, $new_time)

Next

; $file_contents would be written to file
ConsoleWrite("NEW FILE:" & @CRLF & $file_contents & @CRLF)
Thermopyle, I can't decide if the StringReplace() needs to be run line-by-line or can be safely run on the entire file. I *think* the _ArrayUnique() and descending _ArraySort() will prevent multiple changes to a time, but I'm not sure....

onionradish fucked around with this message at 18:06 on Aug 25, 2014

Hughmoris
Apr 21, 2007
Let's go to the abyss!

onionradish posted:

Hughmoris, something to play with:
code:
#include <Date.au3>

; $file_contents would normally be read from file
$file_contents = "foo bar 08:25:10 foobar"
...

Thanks for this Onionradish. I'm still very new to AutoIt and programming in general so this will do be good to walk through some code and break it down and learn.

onionradish
Jul 6, 2006

That's spicy.

Hughmoris posted:

Thanks for this Onionradish. I'm still very new to AutoIt and programming in general so this will do be good to walk through some code and break it down and learn.
See my edit above (code and comment) -- on further thinking, there may be a bug in my code if StringReplace() is used on the entire $file_contents string, where a timestamp would be changed, then changed again (making it wrong). I added some array manipulation, but that might not be enough (and the reasoning for the manipulation is not exactly intuitive to anyone else reading the code, which is always a bad sign).

Your best bet would be to split your $file_contents into an array of lines, make the "gimme a new time string" part (which should be fine) into a function, and make the changes line by line. That way you're confining the changes so things couldn't be changed twice.

onionradish fucked around with this message at 18:16 on Aug 25, 2014

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Hughmoris posted:

RegEx has kicked my butt whenever I've looked at it in the past. Not sure why I have such a hard time understanding it but I know I need to get it under my belt.


If you're on windows, pick up The Regex Coach!

Thermopyle
Jul 1, 2003

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

onionradish posted:

Thermopyle, I can't decide if the StringReplace() needs to be run line-by-line or can be safely run on the entire file. I *think* the _ArrayUnique() and descending _ArraySort() will prevent multiple changes to a time, but I'm not sure....

StringReplace will work on whatever string you give it. You can give it a string containing multiple @CRLF's and it doesn't care.

onionradish
Jul 6, 2006

That's spicy.

Thermopyle posted:

StringReplace will work on whatever string you give it. You can give it a string containing multiple @CRLF's and it doesn't care.
It was the replacement of the time I was worried about. Like whether the code would find ["08:00:00", "08:00:10" ...], and on first pass replace all "08:00:00" with "08:00:10", and next pass replace all "08:00:10" with "08:00:20", etc. -- incorrectly changing the earlier values. I added a descending sort on the times, so in theory that wouldn't happen, but not sure that's a fix, and as I said, seems like a "trick" that's not intuitive to anyone trying to read the code later.

Doing the string replacement on each line seems the safest approach.

onionradish fucked around with this message at 01:13 on Aug 26, 2014

Lil Miss Clackamas
Jan 25, 2013

ich habe aids
Does anyone know anything about Nagios scripting? Assuming this is even the right place to ask. I've been tasked with implementing Windows Event Viewer log monitoring, and I know next to nothing about Nagios. I managed to get some sort of check using CheckEventLog based on what I've found via Google, but whatever it's reporting is definitely not what's in Event Viewer and I can't figure out why. It's supposed to check for a warning or critical event in System, Application, and Security, and email a succinct problem description, but instead it's just reporting back some specific failure of the antivirus' ability to scan one single file, in extremely verbose format.

Thermopyle
Jul 1, 2003

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

onionradish posted:

It was the replacement of the time I was worried about. Like whether the code would find ["08:00:00", "08:00:10" ...], and on first pass replace all "08:00:00" with "08:00:10", and next pass replace all "08:00:10" with "08:00:20", etc. -- incorrectly changing the earlier values. I added a descending sort on the times, so in theory that wouldn't happen, but not sure that's a fix, and as I said, seems like a "trick" that's not intuitive to anyone trying to read the code later.

Doing the string replacement on each line seems the safest approach.

Oh yeah, of course that's what you were concerned about. Don't know what I was thinking.

I think you're probably right that you did it the safest way.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
This thread's seeing traffic again, so just asking if anyone has thoughts about my post up-page.

Edit: I am Obama, killer of threads.

The MUMPSorceress fucked around with this message at 05:39 on Aug 26, 2014

raminasi
Jan 25, 2005

a last drink with no ice

LeftistMuslimObama posted:

This thread's seeing traffic again, so just asking if anyone has thoughts about my post up-page.

Edit: I am Obama, killer of threads.

The link you posted doesn't deal with multi-word search targets. One way to do that involves building a state machine with each terminal state pointing to some comment text, but I don't know if either VBA or you are up to that task. You might also be able to use a trie, but again, this is possibly outside of your wheelhouse and probably outside of VBA's. (And neither of these solutions will be particularly maintainable unless you build in some initial step to convert a simple mapping list to your state machine or trie.)

A simpler hybrid approach would just use the simple dictionary for single-word targets, and then repeat the approach you've already got for the multi-word ones. Your speedup will be (almost) equal to the percentage of targets that are single-word.

raminasi fucked around with this message at 06:39 on Aug 26, 2014

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I wrote a little script that goes through every unresolved JIRA and checks to see if the last comment in the ticket contains a question mark (i.e. somebody is waiting for somebody else to provide more info). The results were pretty interesting...Dug up some really old tickets where people were just left hanging :(

Sedro
Dec 31, 2008
How many of those tickets were actually assigned to the person who is expected to respond to them?

TheEffect
Aug 12, 2013

fletcher posted:

I wrote a little script that goes through every unresolved JIRA and checks to see if the last comment in the ticket contains a question mark (i.e. somebody is waiting for somebody else to provide more info). The results were pretty interesting...Dug up some really old tickets where people were just left hanging :(

What did you write it in?

EAT THE EGGS RICOLA
May 29, 2008

TheEffect posted:

What did you write it in?

This is super easy to do with the JIRA API.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Sedro posted:

How many of those tickets were actually assigned to the person who is expected to respond to them?

Good question! I'm gonna go over it in more detail at the end of the week, that's definitely a good thing to check.

TheEffect posted:

What did you write it in?

I used jira-python. It was insanely easy, only like 7 lines of python.

Scaevolus
Apr 16, 2007

Advice: don't write a script that automatically comments on a thousand JIRA issues without temporarily disabling email notifications.

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
There doesn't seem to be a Lua thread, so I'm going to ask here. If there's a better thread for it, please direct me to it.

I'm writing some code for OpenComputers, a Minecraft mod that lets you make in-game computers and program them in Lua, and I've run into an issue I can't figure out how to solve as a relative Lua newbie. The program is here; it's an implementation of Kalah, the variation of mancala that's best known in the Western world. The issue is this: when the computer player has only one move left, the program crashes thusly:



So what am I doing wrong?

nielsm
Jun 1, 2009



Not going to trace through the entire thing (it's a rather long program), but some starting points:

The complaint is that the seeds variable used at line 221 is nil, it gets initialized at line 219 by indexing into newBoard. Since the indexing succeeds, that indicates that newBoard itself is a valid table, but that the move variable used to index into it does not have a valid key for the table. A starting point for debugging would be to check what the value of move is at that point, as well as checking that the tableCopy function works as advertised.
If both of those look sane, then the original board variable must be missing some major data, so begin tracing how that one gets created/filled.

Liam Emsa
Aug 21, 2014

Oh, god. I think I'm falling.
I couldn't find a programming jobs thread, so..

What's the likelihood of eventually transitioning to a Developer position when starting as a Quality Engineer? Is it a rare or not?

No Safe Word
Feb 26, 2005

Liam Emsa posted:

I couldn't find a programming jobs thread, so..

What's the likelihood of eventually transitioning to a Developer position when starting as a Quality Engineer? Is it a rare or not?

Tada!

(quick answer, though re-ask in there: it's not super rare but it's not often successful from what I've seen)

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Liam Emsa posted:

I couldn't find a programming jobs thread, so..

What's the likelihood of eventually transitioning to a Developer position when starting as a Quality Engineer? Is it a rare or not?

Several people at the place I work have made this transition. I think they were QA for about a year before switching. Make it clear during your performance reviews what your goal is. It also certainly helps to go the extra mile while you are QA, for example identifying some need a the organization and writing a little program or app that solves it or improves productivity or whatever. Just make sure all of your official responsibilities are handled before doing the extra stuff.

You'll probably also get to see how developers are building the features or fixing the bugs that you are reporting, so be sure to learn from that. Bonus points if you can identify creative ways to break the app by looking through the code.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Look for positions where QA is explicitly listed as engineers who can script, code, etcetera. I know that Amazon and Google hire on this criteria. Once you get experience that way, it's usually easier to transition to pure dev.

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.

nielsm posted:

Not going to trace through the entire thing (it's a rather long program), but some starting points:
I figured out what the issue was! (And caught a few other bugs while I was at it.) Turns out I had if moveIndex == {}, which doesn't work, so I changed it to if next(moveIndex) == nil, which does. Thanks for the help!

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I am looking for any libraries that could help me plot interactive candlestick charts. If you didn't know, those are generally use for stock market data to represent open/high/low/close data for time spans. Many plotting libraries support it, but I am superimposing subregions that I found interesting. I do some transformation work so they overlay each other, but with enough plots, it looks like a giant, soupy mess. I'm at the point where I need a less rigid mechanism and was hoping there's a library out there that is easy to modify into doing something like:

1. Being able to scroll through the plots
2. Be able to click through the different plots and have their specific series highlighted
3. Fade out the various plots so that only the areas where many overlap become more bold

I was just using matplotlib in Python, and I don't think I can get this kind of power from that alone. I was assuming I'd just write my own candlestick plotter and interaction code, but that's going to get tedious. I was thinking of finding some rendering engine so I'm not having to do raw drawing commands and maybe get some intersection helpers for selecting data series. That is, if there isn't something already more powerful out there. I'm writing stuff in Python write now, but I'm also comfortable with C++, Java, C#, and Perl.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Can anyone recommend some a book or other online resources for learning some efficient CSG modeling algorithms? 3d boolean operations, etc.

I like to use this web based scripted modeling site: http://openjscad.org/
But I wish it handled higher detail/complex objects a bit more efficiently. It just seems like a modern computer shouldn't be crunching so hard over relatively low poly stuff. Wondering if there is much room for improvement(Big-O improvements?) in the algorithms currently being used? I'm not very well versed in CSG algorithms but i like geometry and optimization problems so I thought I might take a stab at it.

peepsalot fucked around with this message at 22:49 on Aug 28, 2014

Hughmoris
Apr 21, 2007
Let's go to the abyss!
This seems like it would be a relatively simple problem but I can't think of a solution for it...

I have an application at work that is essentially an IE page. After much hair pulling and frustration, I've figured out how to attach AutoIt controls to the application and check a box:
code:
Local $hWnd = WinWait("[CLASS:WindowsForms10.Window.8.app9]", "", 10)  ;creates a window handle
Local $oIE = _IEAttach($hWnd, "embedded")  ;creates a Internet Explorer object
Local $oForm = _IEFormGetCollection($oIE, 0)  ;creates IE form (not sure what that means)
_IEFormElementCheckBoxSelect($oForm, 0, "", 1, "byIndex")  ;Fills the first checkbox in index
_IEFormElementCheckBoxSelect($oForm, 1, "", 1, "byIndex")  ;Fills the second checkbox in index
etc...
My problem is I can't figure out how to loop over the page and check all boxes. I can do a FOR loop and iterate over it a set number of boxes, but the forms are typically of unknown length and I don't want to count the number of checkboxes by hand before I run the script.

Any ideas?

Hughmoris fucked around with this message at 00:14 on Aug 29, 2014

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...

Rocko Bonaparte posted:

I am looking for any libraries that could help me plot interactive candlestick charts.
<snip>
I'm writing stuff in Python write now, but I'm also comfortable with C++, Java, C#, and Perl.

I recently made a switch from matplotlib to some web-based solutions after the former was deemed "too engineery". Both dygraph and d3 let me get prettier web-facing charts quickly. For dygraphs I just modified the python to spit out csv's over CGI and manipulated the data on the browser side.

I will say I was disappointed with Dygraph's example code and pretty much dropped it once I had the bare minimum. For something complex with active data selection you might need someone with stronger javascript chops.

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