Archive

Author Archive

Download test!

April 22nd, 2009
Author: tanker Categories: Uncategorized Tags:

code

April 22nd, 2009

<!– /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:新宋体; panose-1:2 1 6 9 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:”\@新宋体”; panose-1:2 1 6 9 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:”\@宋体”; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:”"; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:”Calibri”,”sans-serif”; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:”Times New Roman”; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-bidi-font-family:”Times New Roman”; mso-bidi-theme-font:minor-bidi;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0; layout-grid:15.6pt;} div.Section1 {page:Section1;} –>

//—————————————————————————-

//! TSArray.h

//!

//! Author: Yuge Zhou SUID: 973916484

//!

//! @file

//!

//! @brief This file defines the Class TSArray.

//!

//! This class provides a basic function to implement the three-dimensioned array.

//! This single-dimensioned array can accece the element use three index in each dimension.

//! and user can also chang the size of the array according to user’s wishes.

//! user can use << and >> to add the data of the array easily.

//!

//! This class use the NodeSLList.h and IntNode.h

//! to help implement the function

//—————————————————————————-

#ifndef _H_TSARRAY_

#define _H_TSARRAY_

#include“NodeSLList.h”

#include <iostream>

using std::ostream ;

using std::istream;

//—————————————————————————

//! @brief This class provides a basic function to implement the Three-dimensioned array..

//—————————————————————————

class TSArray

{

//—————————————————————————-

//! @brief Define the << operator the help output the detail of the array

//!

//! @param output the output ostream;

//! @param tsarray the TSArray object which need to be outputed

//! @return The ostream

//—————————————————————————-

friend ostream &operator<<(ostream& output, const TSArray & tsarray);

//—————————————————————————-

//! @brief Define the >> operator the help input the data of the array

//!

//! @param input the input ostream;

//! @param tsarray the TSArray object which need to be inputed

//! @return The istream

//—————————————————————————-

friend istream &operator>>(istream& input , TSArray & tsarray);

public:

//—————————————————————————-

//! @brief Constructor : Creates the Board object.

//!

//! @param rows The number of rows of the Three-dimensioned array

//! @param columns The number of rocolumnsws of the Three-dimensioned array

//! @param depth The number of depth of the Three-dimensioned array

//—————————————————————————-

TSArray(int rows=0, int columns=0, int depth=0);

//—————————————————————————-

//! @brief Destructor: deletes TSArray object.

//—————————————————————————-

~TSArray();

//—————————————————————————-

//! @brief Define the () operator the get data of element the array

//!

//! @param row The number of the row of the Three-dimensioned array

//! @param column The number of the columnsws of the Three-dimensioned array

//! @param depth The number of the depth of the Three-dimensioned array

//!

//! @return The value of the array element

//—————————————————————————-

int operator()( int row=1, int column=1, int depth=1) const;

//—————————————————————————-

//! @brief Define the () operator the get data of element the array

//!

//! @param row The number of the row of the Three-dimensioned array

//! @param column The number of the columnsws of the Three-dimensioned array

//! @param depth The number of the depth of the Three-dimensioned array

//!

//! @return The reference of the array element

//—————————————————————————-

int &operator()( int row=1, int column=1, int depth=1);

//—————————————————————————-

//! @brief Define the = operator the refined the assignment function

//!

//! @param right The TSArray object need to be assigned.

//!

//! @return The reference of left object

//—————————————————————————-

const TSArray & operator=(const TSArray &right );

//—————————————————————————-

//! @brief Define the == operator to compare the TSArray object

//!

//! @param right The TSArray object need to be compared.

//!

//! @return equality always return FALSE for different-sized arrays

//—————————————————————————-

bool operator==( const TSArray &right) const;

//—————————————————————————-

//! @brief Define the != operator to compare the TSArray object

//!

//! @param right The TSArray object need to be compared.

//!

//! @return inequality always return TRUE for different-sized arrays

//—————————————————————————-

bool operator!=( const TSArray &right) const

{

return ! ( *this == right ); // invokes Array::operator==

}

//—————————————————————————-

//! @brief This will dynamically change the size of the array in any or all dimensions.

//! When the array is made larger in any dimension, existing elements will not be

//! affected. When the array is made smaller in any dimension, existing elements

//! will be truncated (pruned) in that dimension.

//!

//! @param row The number of the row of the Three-dimensioned array

//! @param column The number of the columnsws of the Three-dimensioned array

//! @param depth The number of the depth of the Three-dimensioned array

//—————————————————————————-

void ChangeSize(int row, int column, int depth);

private:

//Record the size of the three-dimensioned array

int rowsMax, columnsMax, depthMax, init;

//The data container

NodeSLList *ns;

};

#endif

Author: tanker Categories: Uncategorized Tags:

April 22nd, 2009

Author: tanker Categories: Uncategorized Tags:

April 22nd, 2009
Author: tanker Categories: Uncategorized Tags:

April 22nd, 2009
Author: tanker Categories: Uncategorized Tags:

April 22nd, 2009

Try Ryt

When someone copies code with those slanted quote marks and apostrophes and pastes it into their template file, the code won’t work. The quote marks and apostrophes must be converted into text quote marks and apostrophes, not those pretty smart quotes.

To make the code look pretty, I converted the quote marks and other characters to HTML character entities and the results are:

<a href="http://lorelle.wordpress.com/" title="Lorelle's article on WordPress">Lorelle's article on WordPress</a>

Now, the quote marks and apostrophes are straightened up in text form, ready for copying.

With the quote marks, apostrophes, and slash marks turned into character entities and the code wrapped in a <code> tag, the underlying code looks like:

&lt;a href=&#34;http:&#47;&#47;lorelle.wordpress.com/&#34; title=&#34;Lorelle&#39;s article on WordPress&#34;>Lorelle's article on WordPress&lt;/a>

This is hard to read but necessary to display the code for your readers to use. The &lt; character code replaces the < and takes the power of the code command away so the code is just text.

You may also notice that the greater than arrow (>) isn’t converted. Some versions of WordPress will automatically convert this arrow into it’s character entity code (&gt;) or may leave it. Since there is no opening arrow to indicate this is “code”, the use of that arrow is unimportant and ignored.

To display a bit of WordPress code from a WordPress Theme which initiates the Customizable Post Listings WordPress Plugin, if it exists, it would be written like this:

&lt;?php if (function_exists(&#39;c2c_get_recent_posts&#39;)) {
  echo (&#39;&lt;li id=&#34;recent&#34;>Recent Articles&lt;ul>&#39;);
 c2c_get_recent_posts(10);
  echo (&#39;&lt;/ul>&lt;/li>&#39;);
} ?>

When published on your WordPress blog, it would look like the proper code:

<?php if (function_exists('c2c_get_recent_posts')) {
  echo ('<li id="recent">Recent Articles<ul>');
 c2c_get_recent_posts(10);
  echo ('</ul></li>');
} ?>

The character entities convert to their proper “look” as text and code on the page. The reader can copy and paste that directly into their own code files and it should work, if the code works.

To make code work as a printable and copyable code, the most popular character codes that need converting are:

  • < - &lt;
  • ” - &#34;
  • ‘ - &#39;
  • / - &#47;

I have a longer list of conversion examples in Signatures and Writing Code.

There are many ways to convert your code into publishing content. You can do the conversion manually using a text editor with a good search and replace function. Use an online code converter or paid, shareware, or freeware code converter program. Or if you use code regularly in your WordPress blog, get a WordPress Plugin that make the job much easier from within your Write Post panel.

To use an online or downloadable program to convert code to something publishable on your blog, consider the following:

At all times when working with code, use a text editor not a word processor so the quote marks, apostrophes, and other code will not be automatically converted into characters which will not copy and paste well into your code files.

Publishing the Code That Writes the Code

As you’ve seen, I’ve taken the step of publishing the code that will generate the code readers will see on their browser screens. This is much harder than you may think.

Since character entity codes within the code are necessary for the code to display in its pieces, I have to convert each character entity code into something that convert and display properly.

I explain this is greater detail in my article on publishing signatures and writing code in your WordPress posts, but here is an example.

In order to display a quote mark as a text quote, and then display it as I write it, and then display it as the code it took to write it, this is the evolution of the character code:

" - &#34; - &amp;&#35;34;

As I have to break down each part of the character code in order for those parts to display, replacing each character code element with its printable equivalent, the underlying code gets longer and longer, and much more complicated to read. And very hard work.

For more information on writing and publishing code on your blog, se

Author: tanker Categories: Uncategorized Tags:

dddd

April 22nd, 2009
地图图片
 //---------------------------------------------------------------------------- //! TSArray.h //! //! Author: Yuge Zhou SUID: 973916484 //! //! @file //! //! @brief This file defines the Class TSArray. //! //! This class provides a basic function to implement the three-dimensioned array. //! This single-dimensioned array can accece the element use three index in each dimension. //! and user can also chang the size of the array according to user's wishes. //! user can use &amp;lt;&amp;lt; and &amp;gt;&amp;gt; to add the data of the array easily. //! //! This class use the NodeSLList.h and IntNode.h //! to help implement the function //---------------------------------------------------------------------------- #ifndef _H_TSARRAY_ #define _H_TSARRAY_ #include&amp;quot;NodeSLList.h&amp;quot; #include &lt;iostream&gt;using std::ostream ; using std::istream; //--------------------------------------------------------------------------- //! @brief This class provides a basic function to implement the Three-dimensioned array.. //--------------------------------------------------------------------------- class TSArray { //---------------------------------------------------------------------------- //! @brief Define the &amp;lt;&amp;lt; operator the help output the detail of the array //! //! @param output the output ostream; //! @param tsarray the TSArray object which need to be outputed //! @return The ostream //---------------------------------------------------------------------------- friend ostream &amp;amp;operator&amp;lt;&amp;lt;(ostream&amp;amp; output, const TSArray &amp;amp; tsarray); //---------------------------------------------------------------------------- //! @brief Define the &amp;gt;&amp;gt; operator the help input the data of the array //! //! @param input the input ostream; //! @param tsarray the TSArray object which need to be inputed //! @return The istream //---------------------------------------------------------------------------- friend istream &amp;amp;operator&amp;gt;&amp;gt;(istream&amp;amp; input , TSArray &amp;amp; tsarray); public: //---------------------------------------------------------------------------- //! @brief Constructor : Creates the Board object. //! //! @param rows The number of rows of the Three-dimensioned array //! @param columns The number of rocolumnsws of the Three-dimensioned array //! @param depth The number of depth of the Three-dimensioned array //---------------------------------------------------------------------------- TSArray(int rows=0, int columns=0, int depth=0); //---------------------------------------------------------------------------- //! @brief Destructor: deletes TSArray object. //---------------------------------------------------------------------------- ~TSArray(); //---------------------------------------------------------------------------- //! @brief Define the () operator the get data of element the array //! //! @param row The number of the row of the Three-dimensioned array //! @param column The number of the columnsws of the Three-dimensioned array //! @param depth The number of the depth of the Three-dimensioned array //! //! @return The value of the array element //---------------------------------------------------------------------------- int operator()( int row=1, int column=1, int depth=1) const; //---------------------------------------------------------------------------- //! @brief Define the () operator the get data of element the array //! //! @param row The number of the row of the Three-dimensioned array //! @param column The number of the columnsws of the Three-dimensioned array //! @param depth The number of the depth of the Three-dimensioned array //! //! @return The reference of the array element //---------------------------------------------------------------------------- int &amp;amp;operator()( int row=1, int column=1, int depth=1); //---------------------------------------------------------------------------- //! @brief Define the = operator the refined the assignment function //! //! @param right The TSArray object need to be assigned. //! //! @return The reference of left object //---------------------------------------------------------------------------- const TSArray &amp;amp; operator=(const TSArray &amp;amp;right ); //---------------------------------------------------------------------------- //! @brief Define the == operator to compare the TSArray object //! //! @param right The TSArray object need to be compared. //! //! @return equality – always return FALSE for different-sized arrays //---------------------------------------------------------------------------- bool operator==( const TSArray &amp;amp;right) const; //---------------------------------------------------------------------------- //! @brief Define the != operator to compare the TSArray object //! //! @param right The TSArray object need to be compared. //! //! @return inequality – always return TRUE for different-sized arrays //---------------------------------------------------------------------------- bool operator!=( const TSArray &amp;amp;right) const { return ! ( *this == right ); // invokes Array::operator== } //---------------------------------------------------------------------------- //! @brief This will dynamically change the size of the array in any or all dimensions. //! When the array is made larger in any dimension, existing elements will not be //! affected. When the array is made smaller in any dimension, existing elements //! will be truncated (pruned) in that dimension. //! //! @param row The number of the row of the Three-dimensioned array //! @param column The number of the columnsws of the Three-dimensioned array //! @param depth The number of the depth of the Three-dimensioned array //---------------------------------------------------------------------------- void ChangeSize(int row, int column, int depth); private: //Record the size of the three-dimensioned array int rowsMax, columnsMax, depthMax, init; //The data container NodeSLList *ns; }; #endif 
Author: tanker Categories: Uncategorized Tags:

这个是 Windows Live Writer 发布的

April 22nd, 2009

Creek 是大师的

&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; void ChangeSize(int row, int column, int depth); &lt;/p&gt;  &lt;p&gt;private:   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; //Record the size of the three-dimensioned array    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int rowsMax, columnsMax, depthMax, init;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; //The data container    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; NodeSLList *ns; &lt;/p&gt;  &lt;p&gt;};&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;

Author: tanker Categories: Uncategorized Tags:

April 22nd, 2009

volution of this type of plugins, even the author advises to use Priyadi’s Code Autoescape instead of his own.

Conclusionimg_7703

As you can deduct from the information I provided here, my choice was Dean Code Source Syntax highlighting that I currently use for Roumazeilles.net. The stro
ngest reason was clearly the

ccccccccccccccccc

ccccccccccccccccc

ability to do syntax coloration to increase readability even for small code snippets (I care about my readers confort).

I can’t say I saw every aspect of these plugins in the comparison (benchmark) but it led me to a reasoned choice that I wanted to share with you. You may be doing a

Author: tanker Categories: Uncategorized Tags:

April 22nd, 2009

#ifndef _H_TSARRAY_
#define _H_TSARRAY_

#include"NodeSLList.h"

#include <iostream>
using std::ostream ;
using std::istream;

//---------------------------------------------------------------------------
//! @brief  This class provides a basic function to implement the Three-dimensioned array..
//---------------------------------------------------------------------------
class TSArray
{
    //----------------------------------------------------------------------------
    //! @brief Define the << operator the help output the detail of the array
    //!
    //! @param output  the output ostream;
    //! @param tsarray the TSArray object which need to be outputed
    //! @return The ostream
    //----------------------------------------------------------------------------
    friend ostream &operator<<(ostream& output, const TSArray & tsarray);

    //----------------------------------------------------------------------------
    //! @brief Define the >> operator the help input the data of the array
    //!
    //! @param input  the input ostream;
    //! @param tsarray the TSArray object which need to be inputed
    //! @return The istream
    //----------------------------------------------------------------------------
    friend istream &operator>>(istream& input ,  TSArray & tsarray);

public:
    //----------------------------------------------------------------------------
    //! @brief Constructor : Creates the Board object.
    //!
    //! @param rows The number of rows of the Three-dimensioned array
    //! @param columns The number of rocolumnsws of the Three-dimensioned array
    //! @param depth The number of depth of the Three-dimensioned array
    //----------------------------------------------------------------------------
    TSArray(int rows=0, int columns=0, int depth=0);

    //----------------------------------------------------------------------------
    //! @brief Destructor: deletes TSArray object.
    //----------------------------------------------------------------------------
    ~TSArray();

    //----------------------------------------------------------------------------
    //! @brief Define the () operator the get data of element the array
    //!
    //! @param row The number of the row of the Three-dimensioned array
    //! @param column The number of the columnsws of the Three-dimensioned array
    //! @param depth The number of the depth of the Three-dimensioned array
    //!
    //! @return The value of the array element
    //----------------------------------------------------------------------------
    int operator()( int row=1, int column=1, int depth=1) const;

    //----------------------------------------------------------------------------
    //! @brief Define the () operator the get data of element the array
    //!
    //! @param row The number of the row of the Three-dimensioned array
    //! @param column The number of the columnsws of the Three-dimensioned array
    //! @param depth The number of the depth of the Three-dimensioned array
    //!
    //! @return The reference of the array element
    //----------------------------------------------------------------------------
    int &operator()( int row=1, int column=1, int depth=1);

    //----------------------------------------------------------------------------
    //! @brief Define the = operator the refined the assignment function
    //!
    //! @param right The TSArray object need to be assigned.
    //!
    //! @return The reference of left object
    //----------------------------------------------------------------------------
    const TSArray & operator=(const TSArray &right );

    //----------------------------------------------------------------------------
    //! @brief Define the == operator to compare the TSArray object
    //!
    //! @param right The TSArray object need to be compared.
    //!
    //! @return equality – always return FALSE for different-sized arrays
    //----------------------------------------------------------------------------
    bool operator==( const TSArray &right) const;

    //----------------------------------------------------------------------------
    //! @brief Define the != operator to compare the TSArray object
    //!
    //! @param right The TSArray object need to be compared.
    //!
    //! @return inequality – always return TRUE for different-sized arrays
    //----------------------------------------------------------------------------
    bool operator!=( const TSArray &right) const
    {
        return ! ( *this == right ); // invokes Array::operator==
    }

    //----------------------------------------------------------------------------
    //! @brief This will dynamically change the size of the array in any or all dimensions.
    //!     When the array is made larger in any dimension, existing elements will not be
    //!     affected. When the array is made smaller in any dimension, existing elements
    //!     will be truncated (pruned) in that dimension.
    //!
    //! @param row The number of the row of the Three-dimensioned array
    //! @param column The number of the columnsws of the Three-dimensioned array
    //! @param depth The number of the depth of the Three-dimensioned array
    //----------------------------------------------------------------------------
    void ChangeSize(int row, int column, int depth);

private:

    //Record the size of the three-dimensioned array
    int rowsMax, columnsMax, depthMax, init;

    //The data container
    NodeSLList *ns; 

};

#endif
Author: tanker Categories: Uncategorized Tags: