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
redleader
Aug 18, 2005

Engage according to operational parameters
Anyone have any favorite hex editors? I want to take a look at some game data files as a little challenge for myself and want to know if anyone has a hex editor they really love. Windows freeware, preferably :)

Adbot
ADBOT LOVES YOU

redleader
Aug 18, 2005

Engage according to operational parameters

pr0k posted:

I'm trying to learn XSL in a hurry and not in a good way.

Say I have input xml:
code:
<thing>
 <createdate>2014-04-09T10:37:25-05:00</createdate>
</thing>
I want to make a fixed-length file with this data, but the date and time go in separate fields.

like:
code:
DATE:20140409
TIME:103725
Here's my xsl (1.0)
code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<xsl:output method="text" indent="no"/>
  <xsl:template match="/">
    DATE:<xsl:value-of select="$CreatedDate"/>
    TIME:<xsl:value-of select="$CreatedTime"/>
  </xsl:template>
  <!--==================    VARIABLES  ==================-->
  <xsl:variable name="CreatedDate">
    <xsl:apply-templates select="/thing/createdate"/>
  </xsl:variable>
  <xsl:variable name="CreatedTime">
    <xsl:apply-templates select="/thing/createdate"/>
  </xsl:variable>

  <!--==================   FORMATTING  ==================-->
  <xsl:template match="createdate">
    <xsl:value-of select="substring(concat(translate(., '-', ''), '        '), 1, 8)"/>
  </xsl:template>
  <xsl:template match="createdate">
    <xsl:value-of select="substring(concat(translate(substring-after(.,'T'), ':', ''), '        '), 1, 6)"/>
  </xsl:template>
</xsl:stylesheet>

Result:

code:
    DATE:103725
    TIME:103725
This isn't going to work, is it? I googled it but I just don't understand why this is so freakin hard? I know the formatting is matching the node both ways and it's just picking the last one, but I want to apply the formatting to the variable, not the node.

The issue here is that the XSLT processor has no way of distinguishing the two templates matching createdate. Both your createdate templates have the exact same priority when choosing which template to apply - see this StackOverflow question.

This goes into far more detail than you probably need, but the takeaway point is this (my emphasis):

W3C posted:

It is an error if this leaves more than one matching template rule. An XSLT processor may signal the error; if it does not signal the error, it must recover by choosing, from amongst the matching template rules that are left, the one that occurs last in the stylesheet.

I assume this is why both variables end up with the value from the time template. You could fix this by changing the priority of the two templates by adding a mode to the template and the apply-template:

XML code:
  <xsl:variable name="CreatedDate">
    <xsl:apply-templates select="/thing/createdate" mode="date"/>
  </xsl:variable>
  <xsl:variable name="CreatedTime" >
    <xsl:apply-templates select="/thing/createdate" mode="time"/>
  </xsl:variable>

  <xsl:template match="createdate" mode="date">
    <xsl:value-of select="substring(concat(translate(., '-', ''), '        '), 1, 8)"/>
  </xsl:template>
  <xsl:template match="createdate" mode="time">
    <xsl:value-of select="substring(concat(translate(substring-after(.,'T'), ':', ''), '        '), 1, 6)"/>
  </xsl:template>
(This may or may not be possible depending on what else you have going on in your XML/XSLT.)

redleader
Aug 18, 2005

Engage according to operational parameters

pr0k posted:

Aha, thank you! I saw the 'mode' suggestion somewhere, probably on SO, but I didn't grok it.

Is what I am doing stupid? I have two different backend systems that create the same XML. I need at least two different flat-file outputs, one delimited, one fixed. I figured using XSL would be the way to go. I could just make perl scripts, which seems a lot neater and easier to read and follow...?

Nothing too stupid about processing XML with a tool designed to process XML :v: I can think of a few places at work where we use XSLT to turn XML to CSV and/or JSON (not that I'd recommend creating JSON this way).

I guess it depends on how complicated the rest of the output needs to be. If you need to e.g. aggregate data then it may be easier to do it in Perl. If you're got the XSLT mostly written and working and you're happy with it then you might as well keep it.

If you're much more comfortable in Perl (and if other people in your organisation are proficient too) then you could definitely use Perl. Just make sure you use a proper XML library for parsing the documents instead of writing a bunch of regexes!

Personally, I'd be slightly more inclined to use another language rather than running an XSL transform for writing to a flat file. If the output was XML, I'd almost certainly do XSLT.

redleader
Aug 18, 2005

Engage according to operational parameters

it is posted:

I'm looking in a very badly-made HTML page for an element. The element has two descendants (not necessarily children): one is a div with the text, say, 'SpongeBob' and another is a div with the text, say, 'SquarePants.' What's the proper XPath for "a tr that has a descendant with this text and another descendant with that text?" Thanks!


I work with lovely document structures on a daily basis. //tr[.//div[text() = 'Spongebob'] and .//div[text() = 'Squarepants']] might work for you, given an HTML structure like:

HTML code:
<html> 
  <body> 
    <table> 
      <tr> 
        <td><div>Spongebob</div></td>  
        <td><div>Squarepants</div></td> 
      </tr>  
      <tr> 
        <td><div>Some other stuff</div></td>  
        <td><div>Not Squarepants</div></td> 
      </tr> 
    </table> 
  </body> 
</html>
If you need to match any element containing that text, replace the div like so: //tr[.//*[text() = 'Spongebob'] and .//*[text() = 'Squarepants']].

//tr matches any and all <tr> elements in the document - you might want or need to change this to be more selective.
.//div matches all descendent divs of the current node (and .//* matches all descendent elements of any kind of the current node).

redleader
Aug 18, 2005

Engage according to operational parameters

Slanderer posted:

We're using SVN here (and I'm running TortoiseSVN on my machine), and I'm trying to figure out how to do something extremely stupid. There's an XML file I need to occasionally commit changes to, except I cannot commit any changes to a specific line in the file (the line identifies the hardware debugger I'm using, which is different than what the rest of the team uses). There is no nice solution to it, since the file is parsed by an embedded development IDE has no concept of local settings. I'm wondering if there is a way to prevent myself from committing changes this single line in the XML file. Would I have to do some nonsense with hook scripts that run before and after a commit that change the line in the file back to the default value and then back to my setting again?

You could look into using TortoiseSVN's restore after commit feature.

When you need to commit a change to this file, right click on it in the TortoiseSVN commit window and hit 'restore after commit' (you might need to dig in some submenu to find this option). Then open up the file and find and revert that particular line - you can do this when viewing the file diff in WinMerge or Beyond Compare or TortoiseDiff or whatever. Then commit as normal. TortoiseSVN will commit the file without your hardware debugger line, and will also restore that line on your machine so you can keep working without faffing around to change it back.

But yeah, a commit hook might well be more ergonomic and less irritating. It comes down to 'can I be bothered writing a script to make my life occasionally a bit easier?'

The TortoiseSVN docs mention that TortoiseMerge can choose which changes to include, but I've never used this.


I'd use restore after commit a lot more at work if our deployment process wasn't so... nonexistent.

redleader
Aug 18, 2005

Engage according to operational parameters

JawnV6 posted:

Gosh, I wonder if it was carefully constructed after considering the targeted recursive backtracking implementations instead of magically falling out of the sky.

It's pretty easy to accidentally stumble upon a regex that runs into catastrophic backtracking land without realising. At work we had an email validation regex that went exponential on long invalid input, that I only found accidentally when I ran a unit test that took 15 minutes to succeed :v:

redleader
Aug 18, 2005

Engage according to operational parameters
Man, I knew what the response would be like when I used the trigger phrase "email validation regex". To address the issue, (1) I know it's a bad idea, (2) it would be institutionally impossible to change, (3) I don't really give enough of a gently caress about this horror because it really is a drop in an ocean of bad code, bad practice, and bad process.

JawnV6 posted:

Boy my face sure is red! If I ever come across a situation where I'm forced to run a user-provided regex or attempt to validate an email with a regex I'd have to think long and hard. Unless, by some weird coincidence, those are both terrible ideas to implement regardless of underlying regex implementation.

Wholeheartedly agreed, but my point is that unknowingly stumbling into a regex that exhibits catastrophic backtracking isn't that hard, particularly since no one actually understands how their particular regex engine works (or indeed how any regex engine at all works).

redleader
Aug 18, 2005

Engage according to operational parameters
There's nothing wrong with an EAV (entity-attribute-value - your option 1) schema, and they're not terribly inefficient if indexed properly. It might be a bit tricky to actually query, depending on your ORM or whatever. Some people consider EAV tables to be a code smell or even an outright antipattern, usually because people often go overboard and jam all their data into EAVs (at which point you've just designed a lovely key-value store).

I'm not familiar with Postgres' hstore or json features, but I'd definitely look into those. It's probably overkill to involve a separate nosql data store.

redleader
Aug 18, 2005

Engage according to operational parameters

piratepilates posted:

tinkerpop, Gremlin

I'm trying to imagine having a serious conversation about adopting graph databases at work and having to use these words in a group of adults

redleader
Aug 18, 2005

Engage according to operational parameters

piratepilates posted:

You think just the names are bad? Take a look through the tinkerpop documentation first.

Christ, you're not kidding.

redleader
Aug 18, 2005

Engage according to operational parameters
Maybe EditorConfig would be needs-suiting? I'm going to give it a shot with VS since VS2017 comes with out of the box support. Your big-name IDEs should have plug-ins or similar.

redleader
Aug 18, 2005

Engage according to operational parameters

Triglav posted:

So I have two arrays, one with things I'm interested in (needles) and another taken from a constantly changing API (haystack). The contents and length of the haystack are constantly changing.

I'm trying to quickly iterate over the haystack and find values associated with my needles, but the way I'm doing it is way too slow for my liking. In pseudocode, this is what I'm doing:

code:
needles = ["b","c"]
haystack = ["a"=>7,"b"=>4,"b"=>3,"c"=>11]

foreach needles as needle
  foreach haystack as key=>val
    if needle==key
      print val
    end
  end
end
It works, but it's way too slow. It repeatedly iterates through the haystack for each needle. If the haystack were tiny I probably wouldn't care much, but it's large. How can I do things faster?

Turn haystack into a hashmap for quick lookups.

code:
haystackMap = { key: value for (key, value) in haystack }    // Create hashmap from haystack

foreach needle in needles:
    if haystackMap.hasKey(needle):
        print haystackMap[needle]    // Gets they key's value
end
This needs to loop over haystack once. Looking up a value in a hashmap is a constant-time operation, so looking for the needles should be noticeably faster. You'll need to figure out the details of creating and looking up values from a hashmap for the language you're using, since every language has their own unique snowflake differences.

Other questions to ponder:
  • Have you profiled your code and found that this is a bottleneck?
  • How big is haystack? I'm a little surprised that the time from this operation is noticeable at all.

redleader
Aug 18, 2005

Engage according to operational parameters
If the haystack can change while you're iterating over it, then I don't think the original code would work too well either. At what point can the haystack change? Are you dealing with multiple threads?

redleader
Aug 18, 2005

Engage according to operational parameters
Is it easy to identify when the haystack changes? Do you typically run your lookup on the same haystack data a few times before it changes? If so, you could eat the cost of building a hashmap for the haystack once and use it until the haystack changes, then rinse and repeat.

redleader
Aug 18, 2005

Engage according to operational parameters

Jabor posted:

It might be time for an avatar change, I think. Perhaps something with George Zipf would be appropriate, given the context.

But your current av is just so perfect! :(

redleader
Aug 18, 2005

Engage according to operational parameters

Rolfus posted:

So. I'm a stupid newbie who wants to learn how to make a simple html app that plays a video and presents some buttons. I hope this is the thread for it.

The idea is that people visit a website to take a test. They watch videos, click buttons, then get a score based on the ratio of right and wrong answers. What I need is for one of you adults to tell me where to start. I used to make terrific (lovely) websites with dreamweaver years ago, but now I'm basically starting from scratch. How do I do this?

If it's simple enough, one of those Google docs forms that I've seen floating around would do.

redleader
Aug 18, 2005

Engage according to operational parameters
Could you generate a client in $(language of choice)? You could then write integration tests in a real language, rather than scripting a GUI client.

redleader
Aug 18, 2005

Engage according to operational parameters

Gul Banana posted:

i think the missing piece here is that javascript is single threaded. nothing else *can* run until your script is finished, so nothing can hit those websocket’s callbacks until they have been set

For now (if some mad men have their way).

IMO, Javascript's single-threaded event loop is one of its best features.

redleader
Aug 18, 2005

Engage according to operational parameters
If you're dead set on finding a spec, the event loop is defined (in a browser context, at least) in the HTML 5 spec.

ES6 defines the behavior of "jobs", which you can think of as being equivalent to tasks in the event loop (they're actually browser microtasks, although the difference between these and tasks is a bit irrelevant if you're learning about the event loop).

There's some very good info here, and you can go digging into the specs if you really want.

redleader
Aug 18, 2005

Engage according to operational parameters

huhu posted:

I'm looking to round out my general understanding of programming languages and have been working almost entirely with Python, JavaScript, and C++ (via the Arduino). What language would be most beneficial with the least amount of properties in common with Python and JavaScript and to a lesser degree C++?

Haskell. Erlang. Forth. Smalltalk. J/K/APL. Prolog. Agda/Idris/Coq. Ocaml/F#. Java/C#. Lisp. Cobol. R. SQL.

redleader
Aug 18, 2005

Engage according to operational parameters

Fire Storm posted:

The Perl thread is locked for archiving so I'm asking in here instead.

I'm trying to pull some information from BMC Control-M 7 and could use some help. I am currently using Perl simply because I found someone using code to get the information they needed using Perl so if Python or any other language would be better, I can switch. I have exported the entirety of our Control-M system (database?) via XML because it seems that it's the only way to get the information I need. Basically, I am making a cross-reference sheet of which Control-M job runs what Oracle (OEBS) report. I got a script from Perl Monks that got me on the right track, but I think the weird formatting of the XML file is causing some issue. The script works perfectly fine for normal fields, such as JOBNAME and PARENT_TABLE, but the fields I need, PROGDESP and PROGNAME, have a different formatting than the rest of the job.

The only other export at my disposal, CSV, does not list the OEBS reports, just the job names.

Based on how weird the XML formatting is in the file, is it possible to use Perl like this to process everything (and if so, I could use some help), or is the file format a hacked together piece of crap that probably won't work?

My other option is to manually search the XML file, but it's several hundred reports over 6300 jobs across roughly 200 tables, making the full XML file a bit over 900k lines and 13MB. It's also long enough that Notepad++ stops search and replace after a few hundred thousand lines!



Oh, and the full XML file will not import into Excel and using an XML to CSV converter I found somewhere separated this file into a dozen other files.

Code and sample XML file are HERE. The XML is of 2 jobs, one job that uses a command string (JOBNAME = bkp-sql-full) and one that uses OEBS (JOBNAME = class_user004).

It's late, the first Google result for "perl xpath" returned a module that started talking about 'scalar contexts' and I decided that I didn't want to learn Perl, I had Python installed, and Python is a very batteries-included language. So!

Python code:
import xml.etree.ElementTree as ET
import csv

doc = ET.parse('new.xml')

with open('jobs.csv', 'w', newline='') as csvfile:
	writer = csv.writer(csvfile)
	rowheader = ['JOBNAME', 'PARENT_TABLE', 'BAKER', 'PROGDESP', 'PROGNAME']
	writer.writerow(rowheader)
	
	# This script returns all JOBS whether they have a BAKER attribute or not.
	# Use the following to only output jobs that have a BAKER attribute.
	# for job in doc.findall('./*/JOB[@BAKER]'):
	for job in doc.findall('./*/JOB'):
		jobname = job.get('JOBNAME')
		parent_table = job.get('PARENT_TABLE')
		baker = job.get('BAKER') or ''
		
		progdesp_node = job.find("./AUTOEDIT2[@NAME='%%OAP-PROGDESP']")
		progdesp = progdesp_node.get('VALUE') if progdesp_node is not None else ''
		
		progname_node = job.find("./AUTOEDIT2[@NAME='%%OAP-PROGNAME']")
		progname = progname_node.get('VALUE') if progname_node is not None else ''
		
		row = [jobname, parent_table, baker, progdesp, progname]
		print('{} {} {} {} {}'.format(*row))
		writer.writerow(row)
This Python script (written for 3.6.0, but should work with few to no minor alterations in older versions) will run over an XML file, extract job names, tables, prog_desps(:confused:), and prog_names, and spit them out into a CSV file in the current directory. Hopefully you can figure out how to tweak the code to suit your purposes. I'm not a Python programmer and this is a quick and dirty script, so it's going to be rather un-pythonic, but I don't think you or I actually care about that.

It uses the ElementTree module (specifically, its XPath support) to find and pull data out from the <JOB> elements, and the csv module to write the CSV file.

Since it parses the XML file into a bunch of objects, you may find that it takes a long time and a lot of memory to run on your 13mb XML file. If it outright dies due to OOM, we'll have to take another look at it.

redleader
Aug 18, 2005

Engage according to operational parameters

Fire Storm posted:

...but I think the weird formatting of the XML file is causing some issue. The script works perfectly fine for normal fields, such as JOBNAME and PARENT_TABLE, but the fields I need, PROGDESP and PROGNAME, have a different formatting than the rest of the job.

Based on how weird the XML formatting is in the file, is it possible to use Perl like this to process everything (and if so, I could use some help), or is the file format a hacked together piece of crap that probably won't work?

It sounds like when you say 'formatting', you're actually referring to the XML structure - the layout and nesting of elements and attributes. Formatting is more about where you put newlines, how you indent lines, etc. The formatting of an XML document is mostly1 independent of its structure, and you can reformat an XML document to make it more human-readable without changing the structure (and therefore the meaning of the document). Luckily2, your XML file is syntactically valid, so you can pull whatever data you need out of it using common, well-known libraries in basically every language.

Let's tidy up your example file by formatting it and removing uninteresting elements and attributes. This allows us to clearly see the 'shape' of the XML, and incidentally figure out why your Perl script wasn't working.
XML code:
<DEFTABLE>
  <TABLE>
    <JOB JOBNAME="bkp-sql-full" PARENT_TABLE="adhoc-temp"></JOB>
    <JOB JOBNAME="class_user004" PARENT_TABLE="Table">
      <AUTOEDIT2 NAME="%%OAP-PROGNAME" VALUE="FNDSCURS" />
    </JOB>
  </TABLE>
</DEFTABLE>
There's clearly two 'types' of data here - elements (<JOB>, <TABLE>, <AUTOEDIT2>, ...) and attributes (your 'normal fields' - JOBNAME, PARENT_TABLE, VALUE, ...). In most (all?) XML libraries, elements and attributes are accessed differently.

In your Perl script:
Perl code:
if ( $s->att('BAKER') ne '' ) {
    print $s->att('JOBNAME') , ',', $s->att('PARENT_TABLE'), ',', length $s->att('BAKER'), ',', $s->att('BAKER'), ',', print $twig, "\n";}
}
$s->att will return the value of an attribute on the current node (which is a <JOB>), and only the current node. This is perfect for the JOBNAME and PARENT_TABLE attributes of a <JOB>, but won't allow you to get the progname from a child <AUTOEDIT2> element. To get the progname, you need to find the appropriate child <AUTOEDIT2> element, and call att('VALUE') method on that child. I don't know any Perl, but what you'd most likely do is find a method that returns all children of $s, and filter those to find one that has an element name of AUTOEDIT2 and the right NAME attribute.

This sort of 'traverse the XML tree willy-nilly' is so common that a bunch of XML nerds got together and created an extremely cool and good (not to mention pretty intuitive) DSL for querying XML documents - XPath! If you've ever written a file path before, you're halfway to reading and writing XPaths. In that Python script, I used XPath a couple of times:
  • doc.findall('./*/JOB'), where doc is the root of the XML document. The XPath expression starts at the current node (. means 'current node'), finds all child elements of any name (./* - the * means 'any name'), and finds the JOB children of these child elements (./*/JOB). Effectively, this means 'get all the third level <JOB> elements in the current document'.
  • progdesp_node = job.find("./AUTOEDIT2[@NAME='%%OAP-PROGDESP']"), where job is a <JOB> element. This expression finds a child <AUTOEDIT2> element (./AUTOEDIT2) which has an attribute (@ - get it? ATtribute? @tribute? how droll) called 'NAME' (@NAME) with a value '%%OAP-PROGDESP' ([@NAME='%%foo']) .

If you expect to do a lot more work with XML, I recommend you do a bit of reading on XML itself, then learn XPath. Choose a language and learn about its XML libraries. I use .NET's XmlDocument class a lot, which is rock solid. If you stick with Python, you'll want to look at picking up a better library. ElementTree's XPath support is utterly miserable.


1 Barring some edge cases with whitespace between elements that aren't a problem for you, and that I'm not really confident about identifying.
2 In theory, everyone creates XML by using libraries that guarantee a well-formed document. In practice, a non-zero number of people create malformed 'XML' by manually writing invalid garbage to a file and calling it XML.

redleader
Aug 18, 2005

Engage according to operational parameters

Thermopyle posted:

I've been thinking about improving software quality and came across QuickCheck, aka, property-based testing. It seems like a neat idea. Hypothesis is a python (and java?) implementation.

Just looking for any thoughts about it...downsides, upsides, anything you want to say about it.

I've never had a chance to use property-based myself, but fellow forums user MononcQc has a neat blog post on it, and is writing a book on the subject (in Erlang, but a lot of the theory should apply to other languages).

redleader
Aug 18, 2005

Engage according to operational parameters
The convention seems to be to return 202 with a Location for the actual resource. You can return 303 from the 'queue job' endpoint once your job has finished and the resource is available.

redleader
Aug 18, 2005

Engage according to operational parameters

TooMuchAbstraction posted:

Remember, there's absolutely nothing wrong with a library that contains a single file that has a single 10-line function.

Counterpoint: npm

redleader
Aug 18, 2005

Engage according to operational parameters

SurgicalOntologist posted:

Any ideas on how to parse it?

"Dear $vendor, your "xml" isn't. Please provide me with a version that can be understood by an actual XML parser"

redleader
Aug 18, 2005

Engage according to operational parameters

lifg posted:

And what is the best and is it IBM Informix?

Microsoft® SQL Server™ 2017

redleader
Aug 18, 2005

Engage according to operational parameters

Star War Sex Parrot posted:

Just pick a random one from here IMO.

Looks like a perfect opportunity to create a "real or not" game a la this.

redleader
Aug 18, 2005

Engage according to operational parameters
"READ UNCOMMITTED is cruise control for cool!" - our CTO.

redleader
Aug 18, 2005

Engage according to operational parameters

Magnetic North posted:

This is sort of silly to ask, but I'm genuinely curious about what the general consensus thinks about this after a discussion today at work. Is Hungarian notation in C#/VIsual Studio worth doing? All the devs hate it and the bosses demand it.

Like sUsername and dPrice and xXmlInput? Totally loving useless, and deeply offensive to all with a modicum of taste

redleader
Aug 18, 2005

Engage according to operational parameters

PierreTheMime posted:

I still have to deal with SOAP occasionally and configuring WSDLs is a good reminder why most places don’t use it now.

My God, imagine having data that you can validate against a schema! The horror!

redleader
Aug 18, 2005

Engage according to operational parameters
VS Code Live Share can do real time, read only collaborative editing. Do you need formatting, or is plain text ok?

redleader
Aug 18, 2005

Engage according to operational parameters

petit choux posted:

Gimmick, heh. You have to be a gimmick poster to be so combatative and easily offended on such short notice and such little provocation. Are you even aware that you're posting in the Something Awful forums? Gently caress off. You will not be an issue going forward.

lmao

redleader
Aug 18, 2005

Engage according to operational parameters
I'm starting to get the feeling that REST is like monads, but even fewer people actually understand what Fielding was getting at.

redleader
Aug 18, 2005

Engage according to operational parameters

Lordshmee posted:

I am. As this page plainly states, that’s totally a thing that can happen: https://www.rabbitmq.com/confirms.html. Based on what Jabor said above, it feels like this is basically screaming into the void and hoping someone hears. Sure, it’ll usually be ok, but if I want to do order processing where money is involved that just isn’t good enough.

I've worked in order processing where money is involved and I can assure you that this isn't true.

redleader
Aug 18, 2005

Engage according to operational parameters
Also, your ORM or whatever sucks.

redleader
Aug 18, 2005

Engage according to operational parameters

Plorkyeran posted:

If you really want to confuse the gently caress out of everyone you can use filter-branch to reformat every commit, then merge the result into the original branch. That way you can view every commit as either the reformatted or original version, and no force pushes required.

And every person who looks at the history for the rest of time will get tripped up by there being two sets of commits making the same changes.

Oooh, do this

redleader
Aug 18, 2005

Engage according to operational parameters
My recommendation would be to find the person who created that XML, and beat them senseless with the nearest fire extinguisher.

Have you tried registering the ShortDateFormat namespace in an XPathContext, a la this?

redleader
Aug 18, 2005

Engage according to operational parameters
monads are just the starting point on a long and nuanced journey though functional programming's 500,000 unique and subtly different mathematical objects. strap in.

Adbot
ADBOT LOVES YOU

redleader
Aug 18, 2005

Engage according to operational parameters

Protocol7 posted:


This is very true, some way to know why a null object was returned could be very useful.


code:

public class ResultException { }

public class ObjectFoundException<T> : ResultException { T Value { get; } }

public class ObjectNotFoundException : ResultException { }

public class ObjectAccessDeniedException : ResultException { }

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