Testing BBCodes and Smilies

A place for discussions that are NOT related to the US Hawks. This area is provided for the convenience of our members, but the US Hawks specifically does not endorse any comments posted in these forums.
Forum rules
Be Polite!!

This forum is for discussions that are NOT related to the US Hawks. This area is provided for the convenience of our members, but the US Hawks specifically does not endorse any comments posted in this forum.

Testing BBCodes and Smilies

Postby Bob Kuczewski » Fri Oct 15, 2010 2:13 pm

This isn't much of a topic, but I wanted a place to test some BB Codes ...

Just quote this topic to see how these are done.


Testing BB Codes without TT:
  1
   2
    3
     4
      5
       6
        7
         8

Testing BB Codes with TT:
  1
   2
    3
     4
      5
       6
        7
         8


Testing BB Codes with TT and color:
  1
   2
    3
     4
      5
       6
        7
         8


Testing BB Codes with TT and color at 25%:

  1
   2
    3
     4
      5
       6
        7
         8


Testing BB Codes with TT and color at 50%:

  1
   2
    3
     4
      5
       6
        7
         8


Testing BB Codes with TT and color at 80%:

  1
   2
    3
     4
      5
       6
        7
         8


Testing BB Codes with TT and color at 200%:

  1
   2
    3
     4
      5
       6
        7
         8


Testing BB Codes with TT and random colors at 200%:
          
          
          
          


Testing BB Codes with TT and random colors and a border at 200%:
              
              
              
              
              
              


Here's the same example using Pixels (px) at 200%:
              
              
              
              
              
              


Here's an example of mixing normal text with "Pixel" text at 200%:

              
              
     COOL     
    COLORS    
              
              

Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Re: Testing Smilies

Postby Bob Kuczewski » Fri Oct 15, 2010 10:48 pm

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek: :srofl: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbdown: :thumbup: :wave: :wtf: :yawn:
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Testing External Images

Postby Bob Kuczewski » Fri Dec 03, 2010 10:10 pm

Testing External Images:

Image

and External Images as Links:

Image

Image
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Making Bar Graphs in BBCode

Postby Bob Kuczewski » Sun Jul 17, 2011 7:45 pm

I wrote a little java program to calculate spacing values in powers of 2 (up to 8):

Code: Select all
  public class spacing1248 {
    public static void main ( String args[] ) {
      try {
        char c;
        String s;
        do {
          System.out.print ( "Please enter the number of spaces to indent > " );
          s = null;
          do {
            // Read a character from standard input
            c = (char)(System.in.read());
            if ( Character.isDigit(c) ) {
              // Add this digit character to the number string
              if (s == null) s = ""; // Be sure that the string is empty and not null
              s += c; // Append the character to the end of the number string
            } else {
              // Check to see if we have any digits accumulated
              if (s != null) {
                // Convert these digit characters to an integer number of spaces to print
                int num_spaces = Integer.parseInt(s);
               
                System.out.print ( num_spaces + " " ); // Print out the number (handy for keeping track)
                // Loop through all currently implemented spacing widths (8,4,2,1)
                for (int n=8; n>0; n=n/2) {
                  // Produce each size (8,4,2,1) while there are sufficient remaining spaces at that size
                  while ( num_spaces >= n ) {
                    System.out.print ( "[" + n + "][/" + n + "]" ); // Print out the actual codes
                    num_spaces = num_spaces - n;        // Reduce the number remaining
                  }
                }
               
                System.out.println ( "\n" ); // Add an extra blank line to make it look nice
              }
              s = null;  // Reset the string to null to signal the end of this case
            }
          } while ( s != null );
        } while (true);
      } catch (Exception e) {
      }
    }
  }

To use this, just save it in a file called "spacing1248.java". Then compile it and run it:

Code: Select all
$ javac spacing1248.java
$ java spacing1248

Please enter the number of spaces to indent > 1
1 [1][/1]

Please enter the number of spaces to indent > 2
2 [2][/2]

Please enter the number of spaces to indent > 3
3 [2][/2][1][/1]

Please enter the number of spaces to indent > 4
4 [4][/4]

Please enter the number of spaces to indent > 7
7 [4][/4][2][/2][1][/1]

Please enter the number of spaces to indent > 8
8 [8][/8]

Please enter the number of spaces to indent > 9
9 [8][/8][1][/1]

Please enter the number of spaces to indent > 13
13 [8][/8][4][/4][1][/1]

Please enter the number of spaces to indent > 23
23 [8][/8][8][/8][4][/4][2][/2][1][/1]

Please enter the number of spaces to indent > 47
47 [8][/8][8][/8][8][/8][8][/8][8][/8][4][/4][2][/2][1][/1]

Please enter the number of spaces to indent > 65
65 [8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][1][/1]

Please enter the number of spaces to indent > ^C
$

So if you want to come up with a code string for 47 spaces, you just type in 47 and get this:

         {8}{/8}{8}{/8}{8}{/8}{8}{/8}{8}{/8}{4}{/4}{2}{/2}{1}{/1}        (Note that I've used curly brackets instead of square brackets to be able to show them)

That's 5 8's (or 40) plus 4 plus 2 plus 1 = 47

This makes it fairly easy (and less error prone) to develop graphs like this one:

Membership history of US Hawks Forum starting from August 13th, 2010:

              13 in August (13 total)

                 +3 in September (16 total)

                            +11 in October (27 total)

                               +3 in November (30 total)

                                    +5 in December (35 total)

                                       +3 in January (38 total)

                                           +4 in February (42 total)

                                                +5 in March (47 total)

                                                      +6 in April (53 total)

                                                          +4 in May (57 total)

                                                            +2 in June (59 total)

                                                                    +8 in July (67 total)


Here's how you'd run the program to generate that graph:

Code: Select all
$ java spacing1248
Please enter the number of spaces to indent > 13
13 [8][/8][4][/4][1][/1]

Please enter the number of spaces to indent > 13
13 [8][/8][4][/4][1][/1]
Please enter the number of spaces to indent > 3
3 [2][/2][1][/1]

Please enter the number of spaces to indent > 16
16 [8][/8][8][/8]
Please enter the number of spaces to indent > 11
11 [8][/8][2][/2][1][/1]

Please enter the number of spaces to indent > 27
27 [8][/8][8][/8][8][/8][2][/2][1][/1]
Please enter the number of spaces to indent > 3
3 [2][/2][1][/1]

Please enter the number of spaces to indent > 30
30 [8][/8][8][/8][8][/8][4][/4][2][/2]
Please enter the number of spaces to indent > 5
5 [4][/4][1][/1]

Please enter the number of spaces to indent > 35
35 [8][/8][8][/8][8][/8][8][/8][2][/2][1][/1]
Please enter the number of spaces to indent > 3
3 [2][/2][1][/1]

Please enter the number of spaces to indent > 38
38 [8][/8][8][/8][8][/8][8][/8][4][/4][2][/2]
Please enter the number of spaces to indent > 4
4 [4][/4]

Please enter the number of spaces to indent > 42
42 [8][/8][8][/8][8][/8][8][/8][8][/8][2][/2]
Please enter the number of spaces to indent > 5
5 [4][/4][1][/1]

Please enter the number of spaces to indent > 47
47 [8][/8][8][/8][8][/8][8][/8][8][/8][4][/4][2][/2][1][/1]
Please enter the number of spaces to indent > 6
6 [4][/4][2][/2]

Please enter the number of spaces to indent > 53
53 [8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][4][/4][1][/1]
Please enter the number of spaces to indent > 4
4 [4][/4]

Please enter the number of spaces to indent > 57
57 [8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][1][/1]
Please enter the number of spaces to indent > 2
2 [2][/2]

Please enter the number of spaces to indent > 59
59 [8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][8][/8][2][/2][1][/1]
Please enter the number of spaces to indent > 8
8 [8][/8]

Please enter the number of spaces to indent > ^C
$

In this example, I had to enter 2 numbers for each bar (which is why I grouped them that way in the output). For each bar, I had to calculate the previous count (running sum from the previous month) to be shown in blue along with the current month's count to be shown in red. Since the first month (August) didn't have any previous total, it was just 13. But the next month (September) had the previous 13 plus the additional 3. October had the total of 16 from September plus 11 new members. So that's why I ran it that way.
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

New version: MembershipBars.java

Postby Bob Kuczewski » Sun Jul 17, 2011 9:48 pm

OK, as Ken Fowler used to say ... "I modified the program" ...

Code: Select all
/* This program calculates the BBCodes to show membership bars as follows:

     ============= 13 in August 2010 (13 total)
     #############=== +3 in September 2010 (16 total)
     ################=========== +11 in October 2010 (27 total)
     ###########################=== +3 in November 2010 (30 total)

   Each bar has a "previous" section (#) along with a "new" section (=).
*/


public class MembershipBars {

  static int newmembers[] = {
    /* Add new member counts for each month */
    /* Month:    J   F   M   A   M   J   J   A   S   O   N   D */
    /* 2010 */                              13,  3, 11,  3,  5,
    /* 2011 */   3,  4,  5,  6,  4,  2,  8 };

  static int year = 2010;
  static int firstmonth = 8; // August
  static String monthnames[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
 
  public static String get_string ( int num_spaces ) {
    String s = "";
    // Loop through all currently implemented spacing widths (8,4,2,1)
    for (int n=8; n>0; n=n/2) {
      // Produce each size (8,4,2,1) while there are sufficient remaining spaces at that size
      while ( num_spaces >= n ) {
        s += "[" + n + "][/" + n + "]";
        num_spaces = num_spaces - n;        // Reduce the number remaining
      }
    }
    return (s);
  }

  public static void main ( String args[] ) {
    System.out.println ( "[quote]Membership history of the US Hawks Forum starting from August 13th, 2010:" );
    System.out.println ();
    System.out.println ( "[size=100][tt]" );
    int total_members = 0;
    for (int m=0; m<newmembers.length; m++) {
      String monthname = monthnames[(firstmonth+m-1)%12];
      if (((firstmonth+m-1)%12) == 0) year++;
     
      // Start by printing the previous total
     
      if (total_members > 0) {
        System.out.print ( "[bg=#0000FF]" );  // Blue
        System.out.print ( get_string ( total_members ) );
        System.out.print ( "[/bg]" );
      }
      if (newmembers[m] > 0) {
        System.out.print ( "[bg=#FF0000]" );  // Red
        System.out.print ( get_string ( newmembers[m] ) );
        System.out.print ( "[/bg]" );
      }
     
      System.out.print ( " " );
      if (total_members > 0) System.out.print ( "+" );
      System.out.println ( newmembers[m] + " in " + monthname + " " + year + " (" + (total_members+newmembers[m]) + " total)" );
      System.out.println();
     
      total_members += newmembers[m];
    }
    System.out.println ( "[/tt][/size][/quote]" );
  }
}

Here's the output when pasted into the forum:

Membership history of the US Hawks Forum starting from August 13th, 2010:

              13 in August 2010 (13 total)

                 +3 in September 2010 (16 total)

                            +11 in October 2010 (27 total)

                               +3 in November 2010 (30 total)

                                    +5 in December 2010 (35 total)

                                       +3 in January 2011 (38 total)

                                           +4 in February 2011 (42 total)

                                                +5 in March 2011 (47 total)

                                                      +6 in April 2011 (53 total)

                                                          +4 in May 2011 (57 total)

                                                            +2 in June 2011 (59 total)

                                                                    +8 in July 2011 (67 total)

As you can see, this version is written for the specific task of creating the membership report charts. It's table driven, so the only part that changes from month to month is this table:

Code: Select all
  static int newmembers[] = {
    /* Add new member counts for each month */
    /* Month:    J   F   M   A   M   J   J   A   S   O   N   D */
    /* 2010 */                              13,  3, 11,  3,  5,
    /* 2011 */   3,  4,  5,  6,  4,  2,  8 };

This makes it easy to run without having to remember very much from month to month!!
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Testing Video

Postby Bob Kuczewski » Wed Jul 20, 2011 8:41 pm

Testing flash...

[flash="http://youtu.be/_FDJTApk5Hw"]Testing Video[/flash]
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Re: Testing BBCodes and Smilies

Postby Bob Kuczewski » Thu Jul 21, 2011 10:59 am

This is a simple test to see if I can embed a hard-coded video...

Here's how the "youtube" tag was coded (curly brackets instead of angle brackets):

{iframe width="425" height="349" src="http://www.youtube.com/embed/G92geHiET7Q" frameborder="0" allowfullscreen}{/iframe}

It was inserted with just the tags: {youtube}{/youtube}

[youtube][/youtube]

This worked when the "youtube" tag was configured this way.
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Re: Testing BBCodes and Smilies

Postby Bob Kuczewski » Thu Jul 21, 2011 11:11 am

This never seemed to work:


The youtube tag was modified to include w, h, and s parameters:

[youtube w="425" h="349" s="http://www.youtube.com/embed/G92geHiET7Q"][/youtube]

{iframe width="425" height="349" src="http://www.youtube.com/embed/G92geHiET7Q" frameborder="0" allowfullscreen}{/iframe}

[youtube "425" "349" "http://www.youtube.com/embed/G92geHiET7Q"][/youtube]
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Re: Testing BBCodes and Smilies

Postby Bob Kuczewski » Thu Jul 21, 2011 11:20 am

The youtube tag was modified to only the s parameter:

[youtube w="425" h="349" s="http://www.youtube.com/embed/G92geHiET7Q"][/youtube]

{iframe width="425" height="349" src="http://www.youtube.com/embed/G92geHiET7Q" frameborder="0" allowfullscreen}{/iframe}

[youtube "425" "349" "http://www.youtube.com/embed/G92geHiET7Q"][/youtube]

[youtube="http://www.youtube.com/embed/G92geHiET7Q"][/youtube]
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Re: Testing BBCodes and Smilies

Postby Bob Kuczewski » Thu Jul 21, 2011 11:23 am

Another try:

[youtube="http://www.youtube.com/embed/G92geHiET7Q"][/youtube]
Join a National Hang Gliding Organization: US Hawks at ushawks.org
View my rating at: US Hang Gliding Rating System
Every human at every point in history has an opportunity to choose courage over cowardice. Look around and you will find that opportunity in your own time.
User avatar
Bob Kuczewski
Contributor
Contributor
 
Posts: 8397
Joined: Fri Aug 13, 2010 2:40 pm
Location: San Diego, CA

Next

Return to Free Speech Zone / Off-Mission Discussions

Who is online

Users browsing this forum: No registered users and 72 guests