Lets say I have a DOM object (or a string containing xml). Is it in any way possible to serialize the xml in such a way that each attribute appears on a new line?
This is the output I want:
<parent>
<anElement
attrOne="1"
attrTwo="2"
attrThree="3"
/>
</parent>
Preferred if the solution a part of the ...
I'm looking for a way to automatically format and color code I write in an HTML document. I know wikipedia does it, for example on the page: http://en.wikipedia.org/wiki/Nested_function
I'm sure there are libraries out there to do this, but I can't for the life of me, find one. Does anyone have any suggestions?
...
In Python I can use locale.format to pretty-print numbers according to locale setting:
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
'en_US.UTF-8'
>>> locale.format("%.2f",1234567.89,grouping=True)
'1,234,567.89'
How can I do the same in Haskell? I see that there are localeconv and setlocale bindings, but is the...
Are there any beautifiers for (e)lisp? Online preferred
...
Does anyone know of a (free) tool to pretty print Excel formulas? A Google search didn't turn anything up.
I've got a few worksheets of semi-complex formulas to slog through, so this would make my life a bit easier.
I'm just looking to turn something like this
AC6+AD6+(IF(H6="Yes",1,IF(J6="Yes",1,0)))+IF(X6="Yes",1,0)
into somethin...
Hi,
I have written a function to pretty print a javax.xml.soap.SOAPMessage to a string:
public static String soapMessageToString (SOAPMessage msg) {
try {
Writer out = new StringWriter();
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = t...
I'm trying to improve performance in our app. I've got performance information in the form of a tree of calls, with the following node class:
public class Node
{
public string Name; // method name
public decimal Time; // time spent in method
public List<Node> Children;
}
I want to print out the tree such that I can see li...
Hi Guys,
I'm fairly new to ruby, and am configuring IRB. I like pretty print (require 'pp'), but it seems a hassle to always type pp for it to pretty print it. What I'd like to do is make it pretty print by default, so if i have a var , say, 'myvar', and type myvar, it automatically calls pretty_inspect instead of the regular inspect...
Let's say I have a binary tree data structure defined as follows
type 'a tree =
| Node of 'a tree * 'a * 'a tree
| Nil
I have an instance of a tree as follows:
let x =
Node
(Node (Node (Nil,35,Node (Nil,40,Nil)),48,Node (Nil,52,Node (Nil,53,Nil))),
80,Node (Node (Nil,82,Node (Nil,83,Nil)),92,Node (Nil,98,Nil)))
I...
I have a Hibernate Entity:
@Entity
class Foo {
//...
@Lob
public byte[] getBytes() { return bytes; }
//....
}
My VM is configured with a maximum heap size of 512 MB. When I try to persist an object which has a 75 MB large object, I get an OutOfMemoryError.
The names of the methods in the stack trace (StringBuilder,...
I've got some Java code with SQL statements written as Java strings (please no OR/M flamewars, the embedded SQL is what it is - not my decision).
I've broken the SQL statements semantically into several concatenated strings over several lines of code for ease of maintenance. So instead of something like:
String query = "SELECT FOO, BAR...
We have a project with around 500,000 lines of code, managed with git, much of it several years old. We're about to make a series of modifications to bring the older code into conformance with the developer community's current standards and best practices, with regards to naming conventions, exception handling, indentation, and so forth...
Hi,
I have created a XML file using PHP's simple XML, saved the file. When opening the file in php using fopen and printing the contents. my XML looks like this: (see below)
<?xml version="1.0" encoding="UTF-8"?>
<home><orderList><delivery_cost>0.00</delivery_cost><delivery_surname>TEST</delivery_surname><delivery_postcode>1234</delive...
Sorry for this question, apparently all my googling and api searching skills must be failing me. I've written a web crawler in ruby and I'm using Nokogiri::HTML to parse the page. I need to print the page out and while messing around in IRB I noticed a pretty_print method. However it takes a parameter and I can't figure out what it wants...
I'm cleaning up some gross XML, and so I've had pretty_print = True set in the call to etree.tostring() on my lxml output of the XSL transform. However, that left me with a few junk whitespace nodes from the original input, so I added
<xsl:strip-space elements="*"/>
...but that completely collapses all whitespace, ignoring pretty prin...
Is there free text editor with JSON formatting capabilities like XML Tools for Notepad++?
I tested some of Adobe AIR editors and all editors are completely lack of other must have text editing features. Ideally it should be a notepad++ plugin :).
...
I'm new to haskell, and i read through and digested Learn You A Haskell For Great Good, trying out a couple of things along the way. For my first project i wanted to try the classic: FizzBuzz. So i came up with the following code:
import System.IO
fizzBuzz :: (Integral a) => a -> String
fizzBuzz num
| fizz && buzz = "FizzBuzz"
...
What I am looking for is a php function that takes an unformatted query like this:
$sql = "select name, size from things where color = 'green' order by price asc";
so that it would appear in an HTML page something like this:
SELECT
name, size
FROM
things
WHERE
color = 'green'
ORDER BY
price ASC';
There's some co...
Is it possible to change the width that prettyprint (require 'pp') uses when formatting output? For example:
"mooth"=>["booth", "month", "mooch", "morth", "mouth", "mowth", "sooth", "tooth"]
"morth"=>["forth",
"mirth",
"month",
"mooth",
"morph",
"mouth",
"mowth",
"north",
"worth"]
The first array is printed inline because it f...
I'm looking for recommendations for HTML pretty printers which fulfill the following requirements:
Takes HTML as input, and then output a nicely formatted/correctly indented but "graphically equivalent" version of the given input HTML.
Must support command-line operation.
Must be open-source and run under Linux.
...