|
Hughmoris posted: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 times, 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. What's the failure mode if you tell _IEFormElementCheckBoxSelect to check a box that isn't there? If it's something you can detect within AutoIT, just loop to infinity and bail on the error. If it silently fails pick some arbitrarily large number and check all 1000 boxes.
|
# ? Aug 29, 2014 00:14 |
|
|
# ? May 31, 2024 21:43 |
|
I need to bang out a really rudimentary script or program to process a text file containing a bunch of XML. Most of the tags are just HTML formatting (which I would like to turn into RTF formatting instead), and a couple elements with tags containing metadata I need to turn into printed text. I know Java, but I haven't actually worked with XML in it and I'm willing to pick up the basics of another language if I can produce the program more rapidly in that language. Back story (vague to protect certain business details), I work as a technical writer at a software vendor. For *reasons*, certain documents we produce are stored as strings in a database and those strings contain XML tags. To stay vague, let's pretend it's literally an array of strings whose contents are XML markup and text. Can you say "internally developed content management system"? Anyway, for more *reasons*, it's pretty difficult to spellcheck/proof/find-and-replace these documents as they exist in the database. As the only person with programming experience in my department (I'm going back to school to finish my CS degree), I was asked to come up with a way to dump a bunch of these documents out of the database and into a file that we can proof in Word. I've already written the part to just dump all the XML out into a .txt file in the language our database uses, but it's uniquely unsuited to parsing the XML. The xml looks kinda like this: XML code:
|
# ? Aug 29, 2014 01:46 |
|
Python and lxml or Ruby and nokogiri would be my suggestions for language/library. I mean, you can solve this kind of problem in any language reasonably well.
|
# ? Aug 29, 2014 01:55 |
|
Hughmoris posted:This seems like it would be a relatively simple problem but I can't think of a solution for it... Look at this maybe? I haven't really messed with the IE functions inAutoIT.
|
# ? Aug 29, 2014 02:10 |
|
LeftistMuslimObama posted:
You should consider converting to HTML because your source is so close.
|
# ? Aug 29, 2014 02:24 |
|
JawnV6 posted:What's the failure mode if you tell _IEFormElementCheckBoxSelect to check a box that isn't there? If it's something you can detect within AutoIT, just loop to infinity and bail on the error. If it silently fails pick some arbitrarily large number and check all 1000 boxes. Going off this, I decided to explore how failure modes worked. I came up with something hideous but functioning: code:
Thermopyle posted:Look at this maybe? I haven't really messed with the IE functions inAutoIT.
|
# ? Aug 29, 2014 02:59 |
|
JawnV6 posted: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. That seems like the strangest direction to go, but what the hell--I might as well at least look at it.
|
# ? Aug 29, 2014 04:06 |
|
Sedro posted:If you have unquoted attributes like headers=3, that's not XML technically which means most XML tools will choke on it. There are libraries for parsing HTML (which can handle your "almost XML" ) available for most modern languages. I would also recommend Python for that. They probably are quoted, I was typing that out from memory. The first line of each document is actually a declaration of an XML schema. I'll give those python libraries a looksee, they look simple enough.
|
# ? Aug 29, 2014 04:37 |
|
LeftistMuslimObama posted:They probably are quoted, I was typing that out from memory. The first line of each document is actually a declaration of an XML schema. I'll give those python libraries a looksee, they look simple enough.
|
# ? Aug 29, 2014 05:25 |
|
Sedro posted:In that case, if HTML output works for you, you could try XSLT. I wouldn't ever recommend that normally, but converting XML to HTML is the whole purpose of its existence. And since you almost have HTML already, it shouldn't take much effort. I need to produce a document that can be opened in Word for proofing purposes, so I'd need to change the HTML to RTF or pack up the XML into a docx file. I'm guessing that parsing HTML into RTF is going to be way less effort than messing around with OpenXML to make a word document.
|
# ? Aug 29, 2014 05:56 |
Word can open HTML since 15 years ago. Try it.
|
|
# ? Aug 29, 2014 06:17 |
|
nielsm posted:Word can open HTML since 15 years ago. Try it. Right you are. I am a space case today. If you can't tell from my posts in this thread, I am constantly assaulted from all sides for development requests lately. Granted, anything I develop makes my own and hundreds of other people's jobs easier and faster, but it makes keeping details about a given project straight difficult. Thanks for your help everyone. I'll check out some XSLT tutorials and hopefully report back with success.
|
# ? Aug 29, 2014 06:33 |
|
So I am not sure where to ask this but... Would there be any point in a thread to talk about potential projects your dreaming up. I have plenty of ideas for apps and web apps but without sounding them out to a friend who is a programmer by trade, and has experience, I have no idea on their validity, yet he is too busy sometimes and goons have various different experiences. The subforum is hidden so it would be goon only, which should reduce the idea stealing.
|
# ? Aug 29, 2014 13:23 |
|
thegasman2000 posted:So I am not sure where to ask this but... Would there be any point in a thread to talk about potential projects your dreaming up. I have plenty of ideas for apps and web apps but without sounding them out to a friend who is a programmer by trade, and has experience, I have no idea on their validity, yet he is too busy sometimes and goons have various different experiences. The subforum is hidden so it would be goon only, which should reduce the idea stealing. There's at least one nice derail earlier in the thread, but the TL;DR is No - Ideas are a dime a dozen. Your "brilliant" ideas have been thought of 100 times over. - Developers are constantly bombarded with "good ideas". They don't have time for the ideas they're working on, let alone yours. - The people bombarding them typically have no skills to contribute aside from "great ideas", but want part of the proceeds. - Things that sound simple or complex to laymen tend to be really difficult; there's an art to making software that seems simple and effortless, because it takes a lot of thought and effort. The conclusion is invariably that you should spend some time to learn to program yourself, so that you can get a better idea about your ideas and whether they're worth sharing in the first place. On the plus side, we can tell you all of this instead of your friend.
|
# ? Aug 29, 2014 13:37 |
|
Volmarias posted:There's at least one nice derail earlier in the thread, but the TL;DR is No Sorry I wasn't clear. I am learning to programme and I want to make these projects myself not pay for them. I have ideas like everyone but without asking someone with more experience I don't know if its manageable. For example I wanted to make a complete Point of sale system for a local restaurant. Now in my mind this was a simple database skin, with some calculation built in but my mate went erm thats pretty complex and will spiral into payment gateways and data protection and yeah the project went from seemingly viable to totally not worth the effort roll someone elses and call it good. I would like to add that your response was WAY nicer than I would have expected bearing in mind you thought I was an "ideas guy" coming up in here. So thanks!
|
# ? Aug 29, 2014 13:44 |
|
thegasman2000 posted:I would like to add that your response was WAY nicer than I would have expected bearing in mind you thought I was an "ideas guy" coming up in here. So thanks! The knives don't come out until someone consistently refuses to get a clue. I'm glad that you're learning to program. Generally, if you want to know more about a particular subject, do a little research then just ask. I assure you, no one is going to steal your ideas because as with all things in computers someone probably already thought of it in the 70s
|
# ? Aug 29, 2014 13:56 |
|
Volmarias posted:The knives don't come out until someone consistently refuses to get a clue. Yeah thats why I wondered if it would be ok to soundboard them here. Or in a more appropriate thread. The specific language thread is only helpful in this instance when you know what language to use. Side note: Learn Python the hard was is awesome. If your not already programming and wan to learn use this!
|
# ? Aug 29, 2014 14:00 |
|
thegasman2000 posted:So I am not sure where to ask this but... Would there be any point in a thread to talk about potential projects your dreaming up. I have plenty of ideas for apps and web apps but without sounding them out to a friend who is a programmer by trade, and has experience, I have no idea on their validity, yet he is too busy sometimes and goons have various different experiences. The subforum is hidden so it would be goon only, which should reduce the idea stealing. This thread idea sounds more suited to YOSPOS where people can tell you just how lovely and terrible your ideas are and savagely mock you for failing to google for 10 seconds to find the countless previous attempts that litter the internet.
|
# ? Aug 29, 2014 15:14 |
|
Dren posted:This thread idea sounds more suited to YOSPOS where people can tell you just how lovely and terrible your ideas are and savagely mock you for failing to google for 10 seconds to find the countless previous attempts that litter the internet. Seriously though, feel free to ask your questions in this thread unless there's one better suited you know about. Just try and do a little research first.
|
# ? Aug 29, 2014 15:29 |
thegasman2000 posted:So I am not sure where to ask this but... Would there be any point in a thread to talk about potential projects your dreaming up. I have plenty of ideas for apps and web apps but without sounding them out to a friend who is a programmer by trade, and has experience, I have no idea on their validity, yet he is too busy sometimes and goons have various different experiences. The subforum is hidden so it would be goon only, which should reduce the idea stealing. I hate people bringing my job ideas as much as the next idea but I think a COBOL themed "post your app idea" where people could throw out random ideas and discuss those "countless previous attempts that litter the internet" because there's probably a lot to be gained.
|
|
# ? Aug 29, 2014 15:53 |
|
thegasman2000 posted:Yeah thats why I wondered if it would be ok to soundboard them here. Or in a more appropriate thread. The specific language thread is only helpful in this instance when you know what language to use. This sounds like a good thing to put in project.log Thing is, I frequently forget it exists, so
|
# ? Aug 29, 2014 16:43 |
|
Rocko Bonaparte posted:That seems like the strangest direction to go, but what the hell--I might as well at least look at it. It might only make sense for me since we're dealing with data that's bouncing around the internet and the client wanted online charts anyway. But honestly going back to your original question C# also has a great Chart control that I've been using for realtime stuff streamed over serial ports. That might work better and it's less of a distance to the language.
|
# ? Aug 30, 2014 00:36 |
|
Rocko Bonaparte posted: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: You should look at Bokeh. It is a library that targets the browser as a first class concern for interactive charting and dashboards that can handle streaming or large data. It has bindings in Python but can actually be driven by any language. There is nascent support for Julia and Scala bindings, for example and R bindings are planned for the near future. It also has Matplotlib compatibility so you can take your existing MPL code and easily get interactive plots in the browser or ipython notebook. It's under very active development with around 10k downloads/month and 2k stars on GitHub. Here's a candlestick example, which will soon be even easier than the 10 or so lines shown here: http://bokeh.pydata.org/docs/gallery/candlestick.html Here is the full gallery of interactive examples: http://bokeh.pydata.org/docs/gallery.html And here is the talk I gave recently at SciPy: https://www.youtube.com/watch?v=B9NpLOyp-dI
|
# ? Aug 30, 2014 06:55 |
|
BigRedDot posted:bokeh Suggestion: Documentation tutorials always irritate me when they don't have a "next" link at the end of each page. I have to figure out which page I'm on, find it in the table of contents on the left, figure out if the table of contents lists the subheadings on the page I'm on or not, then figure out which page is the next page to click.
|
# ? Aug 30, 2014 17:26 |
|
Thermopyle posted:Suggestion: Documentation tutorials always irritate me when they don't have a "next" link at the end of each page. I have to figure out which page I'm on, find it in the table of contents on the left, figure out if the table of contents lists the subheadings on the page I'm on or not, then figure out which page is the next page to click. Hey that's a really good idea! I wrote most of the tutorial in a blur at 3AM before a giving it at PyData London. If you could make a GitHub issue with this suggestion it would be much appreciated.
|
# ? Aug 30, 2014 18:12 |
My problem: I have found a flash app that is perfect for my other thermal camera problem (feed in and post processes the video feed from my IR camera). Problem: the app mirrors the video because that's what the program its based off did. I have ripped apart the app and tried to find the code that is doing it but no luck. I have tried to contact the author with no luck. I went through all the possibilities and I believe it is a .matrix that's doing it. Mainly because I don't know how to recompile the .swf after I've broken it down into its base folders (because I can't code for poo poo). I can break it down but I can only recompile it from a swf to an exe not from a bunch of folders to a swf. This is the app http://photo-booth-for-windows-7.en.softonic.com/ The main program is in the "1" swf file, the others are unimportant.
|
|
# ? Aug 31, 2014 07:23 |
|
I'm guessing if there's nothing obviously flipping the image, it's some kind of coordinate setup code or other general transformation parameter that's doing it.
|
# ? Aug 31, 2014 16:47 |
That's what I'm thinking, unfortunately I can't test anything because I don't know how to put the program back together once I rip it apart. Can it be done? Once I have the program down to an editable state of a bunch of folders containing .as files and such how can I put it back together into a .swf file?
|
|
# ? Sep 1, 2014 10:55 |
|
Alright, I've run into a pretty severe roadblock with XSLT for parsing these XML documents. The problem is, some of the elements are "empty" elements that just have a count of their children, but others aren't like that. I basically have this structure: pseudocode (edit, I forgot that there's even some damned great-grandchildren in here that i Need sometimes) (double edit: Another note, any of the ones where I want to keep the content, that content might be HTML marked up text where I need to preserve the HTML (there might be tables or lists, for example, or hyperlinks): XML code:
No matter how much I google about XPATH, I can't seem to create an XPATH that just operates on anything with a title element below the parent-document level. I suspect all the random doubling I get is because I'm somehow processing nodes twice, but I don't see where. Here's a sanitized version of the document (line breaks are arbitrary, the source document doesn't contain any): XML code:
XML code:
terrible document posted:2730505 - dummy document The MUMPSorceress fucked around with this message at 16:23 on Sep 2, 2014 |
# ? Sep 2, 2014 15:43 |
|
LeftistMuslimObama posted:I really just need to act on anything with a title element, but select="release_note//*[@title]" didn't work for me In XPath 'anything with a title attribute' would just be //*[@title] and 'any release_note with a title attribute' would be //release_note[@title]
|
# ? Sep 2, 2014 19:38 |
|
Munkeymon posted:In XPath 'anything with a title attribute' would just be //*[@title] and 'any release_note with a title attribute' would be //release_note[@title] Yeah, I tried using //*[@title] and it didn't pick up everything. I can only ever seem to get templates to apply to one "level" of the xml structure.
|
# ? Sep 2, 2014 19:53 |
|
I didn't see a phonegap thread, and I'm not sure if the JS, Web dev or any of the mobile-platforms threads are more fitting, so I'm posting here. I'm trying to find a general getting started guide for Phonegap and came across this one that seems promising. Right in the start, it tells you to use Phonegap Build to build the app, and then I got confused. I went to the trouble of installing npm, cordova and phonegap itself to do exactly what that service does, right? If so, do I still have to use Phonegap Build? If I don't have to use that, how do I follow that tutorial, but using the tools that I installed on my machine?
|
# ? Sep 2, 2014 21:16 |
|
Phonegap is a bad thing that won't let you create an application any better than just putting something up on a web server, for obvious reasons. My advice is 'don't do that'.
|
# ? Sep 3, 2014 01:48 |
|
Really? I thought you could do stuff like access the camera and the audio recording of the devices.
|
# ? Sep 3, 2014 14:07 |
|
Is there a decent multi platform app development environment people here recommend? I am looking at corona, but lua is weird...
|
# ? Sep 3, 2014 17:35 |
|
There's a very simple Perl script that sends an e-mail from an Exchange account to everyone in a separate text document. This is another one of those items that I've inherited in my job. My question is how does Perl verify the account credentials of the sender? If I change the "from" e-mail address to my boss's e-mail then it sends from his account without me knowing his password or anything like that. This seems to be a major security risk. How does this work? The line of code that seems most pertinent is- my $sender = new Mail::Sender {smtp => 'xxx.xxx.com', from => 'xxx.xxx@xxx.com', on_errors => 'die'}; TheEffect fucked around with this message at 18:50 on Sep 3, 2014 |
# ? Sep 3, 2014 18:46 |
|
TheEffect posted:If I change the "from" e-mail address to my boss's e-mail then it sends from his account without me knowing his password or anything like that. This seems to be a major security risk. How does this work? Yep, this is how email works. Sender addresses are essentially unchecked; anybody can send email appearing to be from anybody else. There are systems (such as SPF) which can ensure that at least the mail originated from a machine which is "supposed" to be able to send email for a given domain, and you can then have policies in place on all such machines (such as SMTP auth) which ensure that passwords are required to send email or whatever, but that all has to be configured specifically on a per-site basis. You should probably talk to your Exchange admin if you're concerned that Exchange isn't properly authenticating outgoing emails.
|
# ? Sep 3, 2014 18:51 |
|
ShoulderDaemon posted:Yep, this is how email works. Sender addresses are essentially unchecked; anybody can send email appearing to be from anybody else. That's good information to know, interesting. Thank you.
|
# ? Sep 3, 2014 19:02 |
|
TheEffect posted:That's good information to know, interesting. See also "joe job". Email is from the age when security was one university admin calling another when a user misbehaved.
|
# ? Sep 3, 2014 19:05 |
|
|
# ? May 31, 2024 21:43 |
|
I've given up on XSLT for my XML problem. It just plain can't handle the weird structure this data is stored in. As an alternative, I've been looking at SAX: http://docs.oracle.com/javase/tutorial/jaxp/sax/parsing.html I'm very comfortable in Java (it's what all my CS courses have been in), and this looks pretty easy to do. It looks like each time an element is found in the file by the SAX parser, it just invokes the startElement callback method. I think I could use this to simply check if each element has a Title attribute and, if so, print its title and text contents to an html file. The only worry I have is it mentions that it will treat "<" characters in the text contents as additional elements, but my suspicion is that this won't apply because I'm just printing the content of XML straight to a file rather than trying to parse them as more deeply nested XML elements. Does this sound right? Basically, when I get to an element that contains a title attribute, can I print its text node straight to file without any special handling and not lose any <P>, <TR>, etc tags within? Or do I need to print char-by-char to ensure this is handled right?
|
# ? Sep 3, 2014 21:46 |