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
JawnV6
Jul 4, 2004

So hot ...

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.

Any ideas?

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.

Adbot
ADBOT LOVES YOU

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
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:
<document id=##### title="a bitchin title" headers=3> //I need to pull the ID and title out of here to be turned into text.
<header>first header</header><header>second header</header>
<p>some text</p> //from here down it's just HTML content that I want to turn straight into RTF (thought about doing .docx, but seems overkill for the purpose)
<to>
<td>table header</td><td>another header</td>
//... and so on
</document>
I've done some preliminary googling, but searching phrases like "parse xml" or "xml library" tends to just point me at forum posts or MSDN articles that don't help me decide what language or library to even start with. Can anyone point me at a good starting point for reading?

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
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.

Thermopyle
Jul 1, 2003

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

Hughmoris posted:

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?

Look at this maybe? I haven't really messed with the IE functions inAutoIT.

Sedro
Dec 31, 2008

LeftistMuslimObama posted:

XML code:
<document id=##### title="a bitchin title" headers=3> //I need to pull the ID and title out of here to be turned into text.
<header>first header</header><header>second header</header>
<p>some text</p> //from here down it's just HTML content that I want to turn straight into RTF (thought about doing .docx, but seems overkill for the purpose)
<to>
<td>table header</td><td>another header</td>
//... and so on
</document>
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.

You should consider converting to HTML because your source is so close.

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

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:
Local $hWnd = WinWait("[CLASS:WindowsForms10.Window.8.app8]", "", 10)
Local $oIE = _IEAttach($hWnd, "embedded", 1)
Local $oForm = _IEFormGetCollection($oIE, 0)

$checker = 1
$i = 0

While $checker = 1
   If _IEFormElementCheckBoxSelect($oForm, $i, "", 1, "byIndex") Then
	  $i = $i + 1
   Else
	  MsgBox(0, "", "all boxes checked")
	  $checker = 0
   EndIf
WEnd
It ain't pretty but it does the job. That will loop through the entire page, filling checkboxes as it goes. It fails at the end of the page and ends the loop.


Thermopyle posted:

Look at this maybe? I haven't really messed with the IE functions inAutoIT.
Yeah, the IE functions are proving to be very useful but pretty drat confusing.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

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.

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.

That seems like the strangest direction to go, but what the hell--I might as well at least look at it.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

You should consider converting to HTML because your source is so close.

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.

Sedro
Dec 31, 2008

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.
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.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

nielsm
Jun 1, 2009



Word can open HTML since 15 years ago. Try it.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:
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.

Volmarias
Dec 31, 2002

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

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.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:

Volmarias posted:

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.

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!

Volmarias
Dec 31, 2002

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

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 :ssh:

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:

Volmarias posted:

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 :ssh:

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!

Dren
Jan 5, 2001

Pillbug

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.

Volmarias
Dec 31, 2002

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

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.

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS

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.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



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 :shrug:

JawnV6
Jul 4, 2004

So hot ...

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.

BigRedDot
Mar 6, 2008

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:

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.


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

Thermopyle
Jul 1, 2003

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


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.

BigRedDot
Mar 6, 2008

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.

Flannelette
Jan 17, 2010


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.

shrughes
Oct 11, 2008

(call/cc call/cc)
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.

Flannelette
Jan 17, 2010


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?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
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:
<parent-document title="title" id="id"> //I want to print the title and ID here.
  <child_prereqs count="1"> //this is garbage, I don't want it
    <grandchild_prereq title="title"> //I want to to print the title and contents of this element
     content
    </grandchild_prereq>
  </child_prereqs>
  <child_main_text title="title"> //I want to print the title and contents of this element.
   content
  </child_main_text>
  <child_fixes count="2"> //garbage, dont' want
     <grandchild title="Fix Detail"> //want title
         <great_grandchild_problem title="Previous Behavior"> //want title and contents
             content
         </great_grandchild_problem>
         <great_grandchild_resolution title="Fixed behavior">//want title and content
             content
         </great_grandchild_resolution>
     </grandchild>
  </child_fixes>
   ...
</parent-document>
As you can see, my problem is that I need to print the values from some of the parent document's children and from some of its grandchildren. I've tried a few different XSLTs and so far I've been able to do these:
  • Print the parent's title and ID, along with all of the content but only titles of grandchildren (and a lot of content is doubled
  • Print the parent's title and ID, along with all of the titles of children and all content, but no grandchild titles
  • create horror

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 version="1.0" encoding="UTF-16"?>
<?xml-stylesheet type="text/xsl" href="drnstransform.xsl"?>
<notes>
<release_note id="2730505" title="dummy document" filters="E">
<Prereqss number="2">
<Prereqs title="Prereq"><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></Prereqs>
<Prereqs title="Prereq"><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></Prereqs></Prereqss>
<references number="0"></references>
<main_body_text><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></main_body_text>
<fix_details number="2">
<fix_detail><previous_behavior><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></previous_behavior>
<present_behavior><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></present_behavior>
</fix_detail>
<fix_detail>
<previous_behavior><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></previous_behavior>
<present_behavior><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></present_behavior></fix_detail></fix_details>
<am_i_affected_count number="0"></am_i_affected_count>
<what_if_i_do_nothing_count number="0"></what_if_i_do_nothing_count>
<followup_steps_count number="0"></followup_steps_count>
<specialized_content number="0"></specialized_content>
<lists number="0"></lists>
<setup_instructions_count number="2">
<setup_instructions title="Config Instructions"><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></setup_instructions>
<setup_instructions title="More Config"><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></setup_instructions></setup_instructions_count>
<testing_instructions_count number="1"><testing_instructions title="Verification Info"><p>LOREM IPSUM LOREM IPSUM</p><calculated_values/></testing_instructions></testing_instructions_count>
<technical_information_count number="0"></technical_information_count><search_result_count number="0"></search_result_count>
</release_note>

<release_note>... more release_note elements can exist in a document, I need to process them all.</release_note>
</notes>
And here's my XSLT (edit: I should note that I'm trying to keep this generic because we regularly add and remove possible child elements from release_note so creating templates for each element I want to render would require constant maintenance. I really just need to act on anything with a title element, but select="release_note//*[@title]" didn't work for me):
XML code:
<?xml version="1.0" encoding="UTF-16"?>

 <xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
 <xsl:template match="notes">
	<html><body>
		<xsl:apply-templates select="release_note"/>

	</body></html>
 </xsl:template>
	
 <xsl:template match="release_note">
	<h2><xsl:value-of select="@id" /> - <xsl:value-of select="@title" /></h2>
	<xsl:apply-templates />
 </xsl:template>
 
 <xsl:template match="release_note/*">
	<h3><xsl:value-of select="@title" /></h3>
	<xsl:copy-of select="current()"/>
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="release_note/*/*">
	<h3><xsl:value-of select="@title" /></h3>
	<xsl:copy-of select="current()"/>
</xsl:template>


</xsl:stylesheet>
Finally, here's what's currently being spit out by that transform. Note that only grandchild titles appear, and several of the lorem ipsums are doubled:

terrible document posted:

2730505 - dummy document

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM
Prereq

LOREM IPSUM LOREM IPSUM
Prereq

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM
Config Instructions

LOREM IPSUM LOREM IPSUM
More Config

LOREM IPSUM LOREM IPSUM

LOREM IPSUM LOREM IPSUM
Verification Info

LOREM IPSUM LOREM IPSUM

The MUMPSorceress fucked around with this message at 16:23 on Sep 2, 2014

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



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]

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

Space Kablooey
May 6, 2009


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?

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
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'.

Space Kablooey
May 6, 2009


Really? I thought you could do stuff like access the camera and the audio recording of the devices.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:
Is there a decent multi platform app development environment people here recommend? I am looking at corona, but lua is weird...

TheEffect
Aug 12, 2013
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

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

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.

TheEffect
Aug 12, 2013

ShoulderDaemon posted:

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.

That's good information to know, interesting.

Thank you.

Volmarias
Dec 31, 2002

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

TheEffect posted:

That's good information to know, interesting.

Thank you.

See also "joe job". Email is from the age when security was one university admin calling another when a user misbehaved.

Adbot
ADBOT LOVES YOU

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
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?

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