pretty-print

Vim indentation for c++ templates?

隐身守侯 提交于 2019-12-04 08:42:20
问题 Does anyone have or know about vim plugin/macro/function that indents nicely c++ templates? When I highlight template definition in vim .hpp/.h file and indent it with '=' I get something like this: > template < > class TFilter, > class TParser, > class TConsumer, > class TDataProcessor, > class TDataFeed, > class TSymbolMap > > > struct DataFeedTraits > { > typedef TFilter Filter; > typedef TParser<TSymbolMap> Parser; > typedef TConsumer<Parser> Consumer; > typedef TDataProcessor<Filter

Pretty printers for maps throwing a type error

为君一笑 提交于 2019-12-04 08:42:03
问题 I've configured pretty printers using http://wiki.eclipse.org/CDT/User/FAQ#How_can_I_inspect_the_contents_of_STL_containers.3F. It successfully works for vector and other containers. However I can't get to inspect maps as in the example below: #include <map> #include <iostream> using namespace std; int main () { map <int, string> mapIntToString; map <int, int> mapInt2; mapIntToString.insert (map <int, string>::value_type (3, "Three")); mapInt2.insert (map <int, int>::value_type (3, 4));

How to print from GitHub

早过忘川 提交于 2019-12-04 07:25:34
问题 If I want to print a markdown file from GitHub as it appears on screen, for example: https://github.com/RestKit/RestKit/blob/master/Docs/Object%20Mapping.md Then how can I accomplish that? What code do I need to change in the resulting github html page (that I save) such that the printout will honor the look & feel of the markdown? So far the only clue I have is this one: https://makandracards.com/makandra/4947-how-to-print-github-wiki-pages But it is more of a utilitarian (non-programmatic)

how to pretty print source code of common languages in browser html output with javascript?

喜你入骨 提交于 2019-12-04 06:29:47
how to pretty print source code of common languages in browser html output with javascript? I mean so that there is some indentation and code formatting. Currently i only got http://alexgorbatchev.com/SyntaxHighlighter/ for coloring the syntax. But i would also like some indentation and other formatting. Example: user puts in some code. system formats and highlights code in the browser view. so-> is there a general code formatter for formatting code? best in javascript I am grateful for any help. Probably SyntaxHighlighter is the most popular. But you have a choice, have a look at 16 Free

Pretty Print Excel Formulas?

心已入冬 提交于 2019-12-04 05:10:56
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 something more readable without manually doing it in Vim or the like. Excel does do color-matching on the parentheses, but it's still all mashed together on one line. This VBA code will win no awards, but it's O.K. for quickly looking at typical formulas. It just does what

Pretty-print haskell source code with comments

喜你入骨 提交于 2019-12-04 04:16:20
I'm trying to reformat/reprint haskell source code (remove/add whitespace, linebreaks, change indention style...). I've found the package haskell-src-exts which can parse and pretty-print haskell source code. Using the function parseFileWithComments :: ParseMode -> FilePath -> IO (ParseResult (Module, [Comment])) I also get the comments included in the source code. Now I want to print the Module/AST with the comments at the original positions, but I cannot find a function which will do that. I can only pretty-print the AST. Do I have to implement printing of the AST plus the comments myself or

Compact but pretty JSON output in python?

◇◆丶佛笑我妖孽 提交于 2019-12-04 03:42:16
问题 JSON is written either with indent=None (default) as a single line (unreadable to a human eye) or with ident=N with a newline after each comma. What I would like to see is a more compact but still pretty output, similar to what Common Lisp pretty-printing does. E.g., instead of { "cleanup":{ "cpu":6936.780000000001, "wall":7822.319401979446 }, "finished":"2017-08-14 18:36:23", "init":{ "cpu":1365.73, "wall":1380.7802910804749 }, "job":"timings", "run":{ "cpu":953.6700000000001, "wall":8350

Haskell — easier to read show function? (for debugging)

℡╲_俬逩灬. 提交于 2019-12-04 01:58:17
I'm looking for a function like show that produces more readable output. It certainly doesn't have to work on all classes. I searched "haskell pretty print" on Google, but that seems to produce compiler source code printers. Debugging stuff like the following (newlines inserted manually for stackoverflow formatting) is difficult! (fromList [(Ref {name = "phi", lenRef = 4},fromList [CompNode {val = 1, ident = CNId {uid = 4, zone = 0}, deps = []},CompNode {val = 2, ident = CNId {uid = 5, zone = 0}, deps = []},CompNode {val = 3, ident = CNId {uid = 6, zone = 0}, deps = []},CompNode {val = 4,

C#: “Pretty” type name function?

感情迁移 提交于 2019-12-03 22:36:18
The name properties of System.Type class return a strange result in case of generic types. Is there a way to get the type name in a format closer to the way I specified it? Example: typeof(List<string>).OriginalName == "List<string>" The problem with "pretty" names is they are different depending on the language you are using. Imagine the surprise of a VB.NET developer if OriginalName returned C# syntax. However, it's pretty fairly easy to make this yourself: private static string PrettyName(Type type) { if (type.GetGenericArguments().Length == 0) { return type.Name; } var genericArguments =

Pretty Print output in a sideways tree format in console window

岁酱吖の 提交于 2019-12-03 16:33:33
I have a dictionary such as this created using Python. d = {'a': ['Adam', 'Book', 4], 'b': ['Bill', 'TV', 6, 'Jill', 'Sports', 1, 'Bill', 'Computer', 5], 'c': ['Bill', 'Sports', 3], 'd': ['Quin', 'Computer', 3, 'Adam', 'Computer', 3], 'e': ['Quin', 'TV', 2, 'Quin', 'Book', 5], 'f': ['Adam', 'Computer', 7]} I wanted to print this out in a sideways tree format rather on the console. I've tried pretty print but when the dictionary gets long, it becomes difficult to read. For example, with this dictionary, it would return: a -> Book -> Adam -> 4 b -> TV -> Bill -> 6 -> Sports -> Jill -> 1 ->