An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#12199 - 10/04/10 06:15 AM Code tag issues
cyn Online

Administrator

Registered: 08/03/09
This post contains content pulled from 4 replies starting at Re: Flash Cookies Raise Privacy Concerns, copied over here in an attempt to keep the off-topic tangents in that Lounge thread to a minimum and discussion of FTM/UBBT features here in FineTunedMac Feedback.


artie505 said:
Why does UBB.threads cut off everything after the first [code] including the non-code tagged text?


Hal Itosis said:
If you were trying to post raw bytes from a .sol file (using TextEdit as a go-between?), it's likely there were some control characters in there —aka: "low ASCII" (0x00 to 0x1f). UBB forums software probably detest control characters in messages even more than html code. They are sneaky because they're invisible and —instead of displaying a character —they attempt to control the display!

edit#3: as always, tabs (0x09) and newlines (0x0a) are quite acceptable.

To post the contents of stuff like...

~/Library/Preferences/Macromedia/Flash\ Player/macromedia.com/support/flashplayer/sys/settings.sol

...use one of the following Terminal commands to translate it first:

vis
od -cb
hexdump -c
xxd
strings
more


I.e., try out each and decide which one you think conveys the content best.
E.g.,
$ xxd ~/Library/Preferences/Macromedia/Flash\ Player/macromedia.com/support/flashplayer/sys/settings.sol
Code:
0000000: 00bf 0000 0151 5443 534f 0004 0000 0000  .....QTCSO......
0000010: 0008 7365 7474 696e 6773 0000 0000 0004  ..settings......
0000020: 6761 696e 0040 4900 0000 0000 0000 000f  gain.@I.........
0000030: 6563 686f 7375 7070 7265 7373 696f 6e01  echosuppression.
0000040: 0000 0011 6465 6661 756c 746d 6963 726f  ....defaultmicro
0000050: 7068 6f6e 6502 0000 0000 0d64 6566 6175  phone......defau
0000060: 6c74 6361 6d65 7261 0200 0000 000d 6465  ltcamera......de
0000070: 6661 756c 746b 6c69 6d69 7400 4059 0000  faultklimit.@Y..
0000080: 0000 0000 0000 0d64 6566 6175 6c74 616c  .......defaultal
0000090: 7761 7973 0100 0000 1177 696e 646f 776c  ways.....windowl
00000a0: 6573 7344 6973 6162 6c65 0100 0000 1063  essDisable.....c
00000b0: 726f 7373 646f 6d61 696e 416c 6c6f 7701  rossdomainAllow.
00000c0: 0000 0011 6372 6f73 7364 6f6d 6169 6e41  ....crossdomainA
00000d0: 6c77 6179 7301 0000 001a 7365 6375 7265  lways.....secure
00000e0: 4372 6f73 7344 6f6d 6169 6e43 6163 6865  CrossDomainCache
00000f0: 5369 7a65 0000 0000 0000 0000 0000 0018  Size............
0000100: 616c 6c6f 7754 6869 7264 5061 7274 794c  allowThirdPartyL
0000110: 534f 4163 6365 7373 0100 0000 0c74 7275  SOAccess.....tru
0000120: 7374 6564 5061 7468 7303 0000 0900 000e  stedPaths.......
0000130: 7361 6665 6675 6c6c 7363 7265 656e 0100  safefullscreen..
0000140: 0000 1164 6973 616c 6c6f 7750 3250 5570  ...disallowP2PUp
0000150: 6c69 6e6b 0100 00                        link...

edit: as another for example, i used strings and od in this earlier post.


Virtual1 said:
normally I pipe to xxd -c 48, but as we're all aware, code blocks are gimped on screen width in this version of bbs.

(anyone found a way around that yet? 16 bytes per line is entirely silly)


Hal Itosis said:
No way around it. Currently the code "window" width is fixed at 62 chars. I think a very reasonable (minimum) width would be 82 chars (80 + 2 for the scrollbar).

But —as far as xxd goes —hoping to get the 48 bytes (times 2... plus the address field) is highly unlikely. That's way too wide (Think of MacBook or iPad small screens). Even xxd -c 24 would require 96 chars (94 + 2 for the scrollbar).

Maybe tacit (or someone?) would give us 96 chars (please?)... that would be nice. But we definitely *need* 82 at the very least i'd say. [the vertical space could be limited perhaps... maybe 32 lines before scrollbars kick in.]
_________________________
FineTunedMac Forums Admin

Top
#12200 - 10/04/10 06:17 AM Re: Code tag issues [Re: cyn]
cyn Online

Administrator

Registered: 08/03/09
Artie, if control characters aren't the explanation I think we need more info to figure out why what you were trying to post was getting cut off.

V1 and Hal, I'm pretty sure I've seen a setting I can change to adjust the code box size, and I've got an idea of a way to test it without risking messing up the existing display while we do so. Will get into it after I clean up the Lounge thread and get some breakfast, and post back.
_________________________
FineTunedMac Forums Admin

Top
#12204 - 10/04/10 09:44 AM Re: Code tag issues [Re: cyn]
cyn Online

Administrator

Registered: 08/03/09
Turns out there's more than one setting involved but I think I'm on the right track. If you switch to the "Experimental" style you shouldn't get scrolling in a code block 'til 83 characters now...at least that's how it's working for me in Firefox.

The colored block header isn't the same width yet, that's next.

Let me know how it looks and if you see any problems.

Edit: Header's also done now.


Edited by cyn (10/04/10 10:14 AM)
_________________________
FineTunedMac Forums Admin

Top
#12213 - 10/04/10 09:30 PM Re: Code tag issues [Re: cyn]
artie505 Online


Registered: 08/04/09
> Artie, if control characters aren't the explanation I think we need more info to figure out why what you were trying to post was getting cut off.

I'm not certain what that means, cyn, but here's the deal...

I attempted to post
Code:
xyz
text
Code:
zyx
text

and everything after the initial [code] was deleted; I'd've expected guessed, anyhow, that the text, at least, would come through.
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#12217 - 10/05/10 01:08 AM Re: Code tag issues [Re: cyn]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Originally Posted By: cyn
Turns out there's more than one setting involved but I think I'm on the right track. If you switch to the "Experimental" style you shouldn't get scrolling in a code block 'til 83 characters now...at least that's how it's working for me in Firefox.

Let me know how it looks and if you see any problems.

Using the latest Safari (5.0.2) here.

Code:
                  _____ __    __    ___    ___  ______      __
                 / ___/|  T__T  T  /  _]  /  _]|      T    |  T
                (   \_ |  |  |  | /  [_  /  [_ |      |    |  |
                 \__  T|  |  |  |Y    _]Y    _]l_j  l_j    |__j
                 /  \ |l  `  '  !|   [_ |   [_   |  |       __
                 \    | \      / |     T|     T  |  |      |  T
                  \___j  \_/\_/  l_____jl_____j  l__j      l__j

                                         ,nn
                                         ((/
                                         \ \,_/)     |\
                                          \ Y /      | "--=-._
                                           \ /     ,"  _--.   "=._ __
                                           //     /  /'    "-     " /
                                          //     /  :    ,v, \     7
                                         /(_____/   |   !>@<!|     |
                                         "-----(    \    "^" /     |
                                               | Y   ',_   _/      |
                                               | |"-.   """        \
                                               \ \,^v"*=.____y     _\
                                                \  *.^ V^v^v/     / \\
                                                 \   '""**"'     /   \\
                                                  |-_           /  __//
                                                  |/ ""*=---=<|" ,>  /
                                                  ||         ||  E__/
                                                  ||         ||
                                                  ||         ||
                                                  ||         ||
                                              _.-"  \       /' "=._
                                           <<<______)       (__._ vv>
                                                                `"""'
12345678901234567890123456789012345678901234567890123456789012345678901234567890
.........1.........2.........3.........4.........5.........6.........7.........8

I like the silvery/blue theme color too.

Thanks so much!!!!!!!!!


Edited by Hal Itosis (10/05/10 01:32 AM)

Top
#12218 - 10/05/10 01:24 AM Re: Code tag issues [Re: artie505]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Originally Posted By: artie505
I'm not certain what that means, cyn, but here's the deal...

I attempted to post

I'm not certain what "attempted to post" means, so here's the deal...
  1. What did you attempt to post?
    [as mentioned, .sol files contain control chars, including "null" 0x00... which may possibly cause the gateway to stop reading input.]

  2. What steps did you take?
    [i.e., was TextEdit the "go-between" or what then?]

  3. Details, details.

  4. Is it still a problem?
confused



Ignore this test (84 chars):
Code:
123456789012345678901234567890123456789012345678901234567890123456789012345678901234
.........1.........2.........3.........4.........5.........6.........7.........8....


Yup, i think 80 is a good compromise. I believe 80 chars was the original "tty" width in Unix (or something like that).

AH-HA. Someone has tweaked the width again!
Looks like we got 83 now! (before scrollbar)

Oh wait... it depends too on how much my font/zoom is set (doh).
Okay... so it's 83/84 chars at "actual size"... and then when i zoom,
it becomes 80/81. That's great. I think the experiment was a success.


Edited by Hal Itosis (10/05/10 02:03 AM)

Top
#12219 - 10/05/10 01:31 AM Re: Code tag issues [Re: Hal Itosis]
artie505 Online


Registered: 08/04/09
I attempted to post the contents off settings.sol, opened in TextEdit, with copy & paste.

I guess my post got no further than [code] because the first character in the file is 0 with / through it.

> Is it still a problem?

My recent post to you in the Flash thread in the Lounge ran into the same issue.
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#12220 - 10/05/10 01:43 AM Re: Code tag issues [Re: artie505]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Depending on how the software doing the processing is designed, a null char might mean "absolutely nothing to see here... just keep going" -- or "you've reached the end of this... go no further".

Here's a chart i use to keep some notes about control chars:
Code:
OCT  HEX   SYM  VALUE                    KEY SEQUENCE
======================= control chars ====================== misc notes ===========
000  0x00  NUL  null                       control @   (control-shift 2)
001  0x01  SOH  start of header            control a  [readline: top of paragraph]
002  0x02  STX  start of text              control b  [readline: back one char]
003  0x03  ETX  end of text                control c  int: signal SIGINT [2]
004  0x04  EOT  end of transmission        control d  [readline: end of file]
005  0x05  ENQ  enquiry                    control e  [readline: end of paragraph]
006  0x06  ACK  acknowledge                control f  [readline: forward one char]
007  0x07  BEL  bell [\a]                  control g  [readline: abort search]
010  0x08  BS   backspace [\b]             control h  [readline: backward delete]
011  0x09  HT   horizontal tab [\t]        control i   (or just type tab key)
012  0x0a  LF   line feed [\n] newline     control j   (or just type return key)
013  0x0b  VT   vertical tab [\v]          control k  [readline: kill (cut) right]
014  0x0c  FF   form feed [\f]             control l  [readline: clear screen]
015  0x0d  CR   carriage return [\r]       control m   (or just type return key)
016  0x0e  SO   shift out                  control n  [readline: next command]
017  0x0f  SI   shift in                   control o
020  0x10  DLE  data link escape           control p  [readline: previous command]
021  0x11  DC1  device control 1           control q  start: (flow control)
022  0x12  DC2  device control 2           control r  [readline: reverse search]
023  0x13  DC3  device control 3           control s  stop: (flow control)
024  0x14  DC4  device control 4           control t  status: signal SIGINFO [29]
025  0x15  NAK  negative acknowledge       control u  [readline: kill (cut) left]
026  0x16  SYN  synchronous idle           control v  [readline: "control" prexfix]
027  0x17  ETB  end of transmission block  control w  [readline: erase word]
030  0x18  CAN  cancel                     control x
031  0x19  EM   end of medium              control y  [readline: yank (paste)]
032  0x1a  SUB  substitute                 control z  suspend: signal SIGTSTP [18]
033  0x1b  ESC  escape                     control [   (or just type esc key)
034  0x1c  FS   file separator             control \  quit: signal SIGQUIT [3]
035  0x1d  GS   group separator            control ]
036  0x1e  RS   record separator           control ^   (control-shift 6)
037  0x1f  US   unit separator             control _  [readline: undo last edit]

 -   -

177  0x7f  DEL  delete                     control ?   (or just type delete key)

After 037 comes 040, which is the first "printable" character... a space.

See man ascii for some handy tables (on occasion).

FWIW, some of those "readline" control sequences also work in TextEdit (and all Cocoa apps). E.g., control-a to move to the beginning of a paragraph, and control-e to move to the end of a paragraph, control-k to cut text (rightwards from the cursor to the end of the paragraph), and control-y to paste the buffer (as filled by control-k... not command-X or C !!!).


Edited by Hal Itosis (10/05/10 08:27 PM)

Top
#12221 - 10/05/10 02:05 AM Re: Code tag issues [Re: Hal Itosis]
artie505 Online


Registered: 08/04/09
Just switched to "Experimental..." ultimate coolth (Anybody remember who used the word coolth? Was it Maynard G Krebs?)

Thanks for the chart, Hal, but I don't begin to follow it; when you guys get to talking about hex and octyl I stop reading. I mean... I kinda follow what's going on, but I can't begin to translate it.

But I just took a fresh look at "settings.sol," and saw something I've been overlooking which I'll post in the other thread so cyn doesn't have a cow. grin
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#12260 - 10/07/10 04:54 PM Re: Code tag issues [Re: cyn]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Hi cyn, now viewing this page with my iPad (tested both horizontal and vertical orientation). The width of the code block looks to be perfect. I.e., when using the Experimental theme. I'd say setting the same width on the other themes would be a wonderful idea.

smile


Edited by Hal Itosis (10/07/10 05:06 PM)

Top
#12268 - 10/09/10 12:56 AM Re: Code tag issues [Re: Hal Itosis]
cyn Online

Administrator

Registered: 08/03/09
I like perfect grin but before I change the other styles, let me give you (and anyone else who's interested) the details in case we can get this even better.

Width is designated in pixels, and these settings govern not only the code block but also the php and quote blocks. Here are the defaults and what I changed them to:

Code:
	   default  Experimental
container    510        680
header       502        672
body         500        670

So...should I do some tweaking, or go ahead and update the other styles to the new numbers?
_________________________
FineTunedMac Forums Admin

Top
#12270 - 10/09/10 08:10 AM Re: Code tag issues [Re: cyn]
joemikeb Online
Moderator

Registered: 08/04/09
Loc: Fort Worth, Texas
I have never had occasion to use the code block but FWIW the Experimental size settings seem to be working perfectly well. grin
_________________________
joemikeb • moderator

Top
#12291 - 10/09/10 02:54 PM Re: Code tag issues [Re: cyn]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Pixels huh. Just guessing but, 680 seems like it would only offend someone working at old-fashioned "VGA" sizes (640x480). I say go with what we got now... and put those same 3 'experimental' settings across the board.

Top
#12304 - 10/09/10 06:19 PM Re: Code tag issues [Re: Hal Itosis]
cyn Online

Administrator

Registered: 08/03/09
Ok, I updated ubbthreads-dark, ubbthreads_finetunedmac and ubbthreads_stock to the wider code/quote/php blocks, and deactivated the Experimental style.

Enjoy!
_________________________
FineTunedMac Forums Admin

Top
#12307 - 10/09/10 07:01 PM Re: Code tag issues [Re: cyn]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Looking good!!! The dark theme is especially attractive on an iPad.

How nice that these particular tweaks also work retroactively. I seem to recall some code block adjustments made at the old MFI forums... but they only affected newer posts. [as older ones retained whatever format they were originally posted in.]

And thanks again... I look forward to posting some shell scripts and code snippets.

Top
#12313 - 10/09/10 11:20 PM Re: Code tag issues [Re: cyn]
artie505 Online


Registered: 08/04/09
I didn't have the wherewithal to participate in the discussion of the specs, cyn, but many thanks for the fix; I know that it will most assuredly make my life easier.
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top

Moderator:  alternaut, cyn, dkmarsh