SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Polter
Topic Author
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Attached Code Ugliness, Poor Readability

November 27th, 2012, 3:37 pm

I've had a rather poor user experience involving the output of the "Attached Code" feature. This is on Windows NT 5.1--6.2 (although NT 5.1 had the best looks, I think) and various window managers under several Linux distros. It looks uniformly bad, pretty much independent of the screen resolution (e.g., on a 24" screen with native resolution 1920 x 1200 the text looks as small and as bad as on an old, trusty 21" CRT running at 1024 x 768).This is how the source code is currently output:<font class="ftfixedwidthfont">// source code</font>Here are several solutions that come to mind, sorted from trivial-to-implement-under-60-secs through less-trivial-but-still-easy to doable:1. either permit the HTML code or enable the symbol corresponding to <pre> ... </pre> (and just that -- no font-size and no font-family changes, please);2. drop the following CSS style: ftfixedwidthfont {font-family:courier,ms sans serif,arial;font-size:10px} -- at least remove the 10px font-size, but preferably just drop it entirely, it's wrong anyway -- preformatted code should use the following style: http://stackoverflow.com/a/9753612 (this is possibly a better alternative to dropping it altogether), overriding font-family to anything more specific than "font-family:monospace" is just tacky; 3. change the HTML output from using the font-with-class tag to simply use <pre> ... </pre> -- this way, font-size & font-family become customizable browser options, for free;4. add a code highlighter, e.g., as in here (note how it also uses "font-family:monospace" in the generated webpage code).Options #1 and #4 have the advantage of allowing for multiple code fragments in one post, which is quite an useful feature for a discussion involving, say, proposed code changes (with description thereof) in multiple iterations/evolutions -- or, for instance, this.
Last edited by Polter on November 26th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 62898
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Attached Code Ugliness, Poor Readability

November 27th, 2012, 6:32 pm

And then some posters don't even use Attach code, CMapPair grumpy = CIntToString::value_type(123,"Grumpy");CMapPair sleepy = CIntToString::value_type(202,"Sleepy");CMapPair sneezy = CIntToString::value_type(716,"Sneezy");
Last edited by Cuchulainn on November 26th, 2012, 11:00 pm, edited 1 time in total.
Step over the gap, not into it. Watch the space between platform and train.
http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
Polter
Topic Author
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Attached Code Ugliness, Poor Readability

November 27th, 2012, 6:38 pm

To be honest, the current font settings in the Attach Code are so bad that I'm considering doing it myself.If only the whitespace format preservation & monospaced fonts could be enabled independently...
Last edited by Polter on November 26th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
Hansi
Posts: 3300
Joined: January 25th, 2010, 11:47 am

Attached Code Ugliness, Poor Readability

November 27th, 2012, 8:55 pm

You can override the ftfixedwidthfont class via a personal style sheet.
 
User avatar
Polter
Topic Author
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Attached Code Ugliness, Poor Readability

November 27th, 2012, 9:27 pm

Apparently I can't :-/ Or, to be precise, only the color seems to be overridable, here's what I've tried:@namespace url(http://www.w3.org/1999/xhtml);@-moz-document domain('wilmott.com') {.ftfixedwidthfont { font-family: "Comic Sans", "Comic Sans MS", cursive; font-size: 55px; color: #0000ff;}}Changes like these should be noticeable ;-) However, only the text color changed to blue.// userChrome.css and userContent.css got no reaction, so I've tried http://addons.mozilla.org/en-US/firefox ... e-manager/ -- but, again, only the color seems to be overridable. Ideas?
Last edited by Polter on November 26th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
Hansi
Posts: 3300
Joined: January 25th, 2010, 11:47 am

Attached Code Ugliness, Poor Readability

November 28th, 2012, 1:27 pm

Tried in chrome, works fine, didn't restict domain though.
 
User avatar
Alan
Posts: 10321
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Attached Code Ugliness, Poor Readability

November 28th, 2012, 11:49 pm

QuoteOriginally posted by: PolterI've had a rather poor user experience involving the output of the "Attached Code" feature. This is on Windows NT 5.1--6.2 (although NT 5.1 had the best looks, I think) and various window managers under several Linux distros. It looks uniformly bad, pretty much independent of the screen resolution (e.g., on a 24" screen with native resolution 1920 x 1200 the text looks as small and as bad as on an old, trusty 21" CRT running at 1024 x 768).This is how the source code is currently output:<font class="ftfixedwidthfont">// source code</font>Here are several solutions that come to mind, sorted from trivial-to-implement-under-60-secs through less-trivial-but-still-easy to doable:1. either permit the HTML code or enable the symbol corresponding to <pre> ... </pre> (and just that -- no font-size and no font-family changes, please);2. drop the following CSS style: ftfixedwidthfont {font-family:courier,ms sans serif,arial;font-size:10px} -- at least remove the 10px font-size, but preferably just drop it entirely, it's wrong anyway -- preformatted code should use the following style: http://stackoverflow.com/a/9753612 (this is possibly a better alternative to dropping it altogether), overriding font-family to anything more specific than "font-family:monospace" is just tacky; 3. change the HTML output from using the font-with-class tag to simply use <pre> ... </pre> -- this way, font-size & font-family become customizable browser options, for free;4. add a code highlighter, e.g., as in here (note how it also uses "font-family:monospace" in the generated webpage code).Options #1 and #4 have the advantage of allowing for multiple code fragments in one post, which is quite an useful feature for a discussion involving, say, proposed code changes (with description thereof) in multiple iterations/evolutions -- or, for instance, this.I never tried Attached Code. But, when I want to post code, I just open the equation editor and include it between\begin{verbatim}\end{verbatim}
 
User avatar
Polter
Topic Author
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Attached Code Ugliness, Poor Readability

November 29th, 2012, 12:23 am

Testing:CC++
 
User avatar
Polter
Topic Author
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Attached Code Ugliness, Poor Readability

November 29th, 2012, 12:29 am

Yeah, this does look better!There are some inconveniences involved (I think it's impossible to edit the source code once it's posted?), but at least it's more readable (wish the LaTeX parser supported syntax highlighting...). And I've noticed that by clicking on the image in what I've just posted I can edit the LaTeX source (so, copy-pasting, while somewhat involved, is still possible). So, I'm considering using this as a workaround for now -- thanks, Alan!Meanwhile, once the Administrator wakes up and deals with Forum Error / coldfusion.mail.MailSessionException, I'd really appreciate if this problem was next to be dealt with :-)
Last edited by Polter on November 28th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
AndyNguyen
Posts: 166
Joined: December 10th, 2007, 4:08 am

Attached Code Ugliness, Poor Readability

November 29th, 2012, 12:52 am

QuoteOriginally posted by: Polter4. add a code highlighter, e.g., as in here (note how it also uses "font-family:monospace" in the generated webpage code).Options #1 and #4 have the advantage of allowing for multiple code fragments in one post, which is quite an useful feature for a discussion involving, say, proposed code changes (with description thereof) in multiple iterations/evolutions -- or, for instance, this.Any platform that is based on PHP would support these basic GeSHi code highlighter functions.I don't know what can be done to add the features that you request since FuseTalk is a rather interesting platform.
 
User avatar
AndyNguyen
Posts: 166
Joined: December 10th, 2007, 4:08 am

Attached Code Ugliness, Poor Readability

November 29th, 2012, 12:53 am

QuoteOriginally posted by: Polter4. add a code highlighter, e.g., as in here (note how it also uses "font-family:monospace" in the generated webpage code).Options #1 and #4 have the advantage of allowing for multiple code fragments in one post, which is quite an useful feature for a discussion involving, say, proposed code changes (with description thereof) in multiple iterations/evolutions -- or, for instance, this.Any platform that is based on PHP would support these basic GeSHi code highlighter functions.I don't know what can be done to add the features that you request since FuseTalk is a rather interesting platform.
 
User avatar
Polter
Topic Author
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Attached Code Ugliness, Poor Readability

November 29th, 2012, 1:25 am

A client-side solution (e.g., third-party JavaScript) comes to mind: http://www.webdesignbooth.com/9-useful- ... ts/However, that's option #4. I'd already be satisfied with option #1, involving flipping the "Allow HTML" switch -- http://i1-scripts.softpedia-static.com/ ... k-9169.png(No idea if that's possible, but I'd be enough to allow only <pre> and </pre> -- and/or, add a custom BBCode ([pre] [/pre] ?) analog).// If anything, FuseTalk Inc. seems to also offer customization services -- http://www.fusetalk.com/addbenefits.html -- but, again, going that way doesn't seem to be the necessary condition. Options #1--#3 are non-invasive and cost-free.
 
User avatar
Hansi
Posts: 3300
Joined: January 25th, 2010, 11:47 am

Attached Code Ugliness, Poor Readability

November 29th, 2012, 6:10 am

QuoteOriginally posted by: PolterMeanwhile, once the Administrator wakes up and deals with Forum Error / coldfusion.mail.MailSessionException, I'd really appreciate if this problem was next to be dealt with :-)Forum maintenance seems a minimal priority so I wouldn't expect a functionality upgrade. I'm sure this isn't the up to date version of FuseTalk and from the looks of it it's already an expensive legacy system that's being keept around "because it works".
 
User avatar
ExSan
Posts: 4582
Joined: April 12th, 2003, 10:40 am

Attached Code Ugliness, Poor Readability

November 29th, 2012, 7:08 am

QuoteOriginally posted by: PolterTesting:CC++this looks much better !
 
User avatar
Hansi
Posts: 3300
Joined: January 25th, 2010, 11:47 am

Attached Code Ugliness, Poor Readability

November 29th, 2012, 7:11 am

QuoteOriginally posted by: ExSanQuoteOriginally posted by: PolterTesting:CC++this looks much better !But does not allow for copy paste.
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On