Category: IT


from http://blog.manontheground.net/traveller/2008/07/svndeltasourcee.html

I tried to update one of my subversion working copies today and got the following message:

“Delta source ended unexpectedly”

Here’s how I solved the problem:
Step 1: I identified the file that was causing the problem.
Step 2: I made sure that all changed files in the problem file’s directory were committed to the repository.
Step 3: I deleted the problem file’s directory from my working copy (not the repository!)
Step 4: I updated my entire working copy

THE BIG LIST OF MYSOURCE MATRIX KEYWORDS

from http://matrixsecrets.com/keywords/

Last updated: February 22, 2010

Common Asset Keywords

Keyword Output Version
%asset_assetid% The unique ID of the current asset  
%asset_name%    
%asset_short_name%    
%asset_type% Type code (eg. page_standard)  
%asset_url% Full web address of the current asset  
%asset_href% “Web path” of the current asset (ie. relative href/link)  
%asset_thumbnail% IMG tag for the thumbnail for this asset  
%asset_thumbnail_alt% ALT attribute of Thumbnail  
%asset_thumbnail_url% URL to the image for the thumbnail for this asset  
%asset_thumbnail_caption% Caption of the thumbnail for this asset  
%asset_metadata_X%    
%metadata_field_X% Insert other metadata field value  

Anywhere (global) keywords

Keyword Output Version
%globals_X% A meta-keyword which allows you to list (nearly) any keyword for the current asset. 3.14.5+
%globals_asset_attribute_X% A more specific version of %globals_X% used for asset attributes. 3.14.5+
%globals_asset_attribute_X:Y% A more specific version of %globals_asset_attribute_X% used for listing an asset attribute for the asset ID specified in Y. 3.14.5+
%globals_icon% Asset Map icon of asset type X. 3.24.0RC1+
%globals_site_X% A meta-keyword which allows you to list (nearly) any keyword for the current site. 3.14.5+
%globals_user_X% A meta-keyword which allows you to list (nearly) any keyword for the current user 3.14.5+
%globals_date_X% Prints the current server date and time. Date and time can be formatted by replacing X with aPHP formatted server date/time, for example %globals_date_M% prints the three letter representation of the current month. 3.20.2+
%globals_get_X% Non-array value of a GET variable. 3.14.5+
%globals_post_X% Non-array value of a POST variable. 3.20.0+
%globals_server_X% Value of PHP Server Variable 3.14.5+
%globals_session_X% Session var. from Matrix sandbox  
%globals_cookie_X% Variable from the current user’s cookies. 3.24.0+
%globals_random% Random whole (integer) number.  
%globals_random_X_Y% Randomly generated number (X to Y). For example, to generate a random number from 1 to 10 use %globals_random_1_10%. 3.22.0+
%globals_asset_charset%   3.20.6+
%globals_asset_languages%   3.20.6+
%nested_asset_X%    
%referring_X% Keyword of referring asset  

Keyword Modifiers

Keyword Output Version
%X^Y% Allows the modification of an existing keyword. 3.24.1+
%X^urlencode% URL encoded version of X. 3.24.1+
%X^uppercase% UPPERCASE version of X. 3.24.1+
%X^charcount% Number of characters in X. 3.24.1+

Less Common Asset Keywords

Keyword Output Version
%asset_created_by_name%    
%asset_created_by_assetid%    
%asset_created_by_url%    
%asset_published_by_name%    
%asset_status_changed_by_name%    
%asset_status_description%    
%asset_status_colour%    
%asset_thumbnail_v_X%    
%asset_type_icon% Asset Map icon of the current asset. 3.24.0RC1+
%asset_updated_by_name%    
%asset_version%    
%asset_version_major%    
%asset_version_minor%    
%asset_version_micro%    
%link_target_X% Keyword of the linked asset. 3.24.1+
%link_relation%   3.24.1+

Date Keywords

Keyword Output Version
%asset_created_X% PHP formatted date the asset was created  
%asset_updated_X% PHP formatted date the asset was created  
%asset_published_X% PHP formatted date the asset was created  
%asset_created%    
%asset_updated%    
%asset_created_short%    
%asset_updated_short%    
%asset_created_readable%    
%asset_updated_readable%    
%asset_created_readabledate%    
%asset_updated_readabledate%    
%asset_created_readabletime%    
%asset_updated_readabletime%    
%asset_created_iso8601%    
%asset_updated_iso8601%    
%asset_created_rfc2822%    
%asset_updated_rfc2822%    
%asset_created_ical%    
%asset_updated_ical%    
%asset_published%    
%asset_published_short%    
%asset_published_readable%    
%asset_published_readabledate%    
%asset_published_readabletime%    
%asset_published_iso8601%    
%asset_published_rfc2822%    
%asset_published_ical%    
%asset_status_changed%    
%asset_status_changed_short%    
%asset_status_changed_readable%    
%asset_status_changed_readabledate%    
%asset_status_changed_readabletime%    
%asset_status_changed_iso8601%    
%asset_status_changed_rfc2822%    
%asset_status_changed_ical%    

Permissions Keywords

Keyword Output Version
%asset_read_permission% Comma separated list of the full names for users with read access  
%asset_write_permission% Comma separated list of the full names for users with write access  
%asset_admin_permission% Comma separated list of the full names for users with administrator access  
%asset_read_permission_email% Comma separated list of email addresses for users with read access  
%asset_write_permission_email% Comma separated list of email addresses for users with write access  
%asset_admin_permission_email% Comma separated list of email addresses for users with administrator access  
%asset_read_permission_email_linked% Comma separated list of linked email addresses for users with read access  
%asset_write_permission_email_linked% Comma separated list of linked email addresses for users with write access  
%asset_admin_permission_email_linked% Comma separated list of linked email addresses for users with administrator access  

Asset Listing Keywords

Keyword Output Version
%asset_contents% Asset contents with paint layout. Note: doesn’t work for shadow assets (eg. LDAP users) until 3.16.0.  
%asset_contents_raw% Asset contents, no paint layout. Note: doesn’t work for shadow assets (eg. LDAP users) until 3.16.0.  
%asset_contents_paint_X% Asset contents, no paint layout 3.22.0+
%list_current_asset_id%    

Custom Form Keywords

Keyword Output Version
%form_summary_semantic%   3.20.0+
%page_list%   3.20.0+

Image Keywords

Keyword Output Version
%asset_attribute_alt%    
%asset_attribute_caption%    
%asset_attribute_width%    
%asset_attribute_height%    
%asset_attribute_size%    
%asset_attribute_title%    
%asset_attribute_name%    
%asset_file_size_in_bytes%    
%asset_file_size_readable%    
%image_width% Image width in pixels  
%image_height% Image height in pixels  
%image_tag%    

Image Variety Keywords

Keyword Output Version
%image_v_X% Prints the Image Variety using an  tag  
%image_v_X_url%    
%image_v_X_width% Prints the Image Variety width in pixels. 3.20.2+
%image_v_X_height% Prints the Image Variety height in pixels. 3.20.2+

File Keywords

Keyword Output Version
%asset_attribute_title%    
%asset_attribute_name%    
%asset_file_size_in_bytes%    
%asset_file_size_readable%    

News Item Keywords

Keyword Output Version
%asset_attribute_summary%    
%asset_attribute_body%    
%asset_attribute_contact_name%    
%asset_attribute_contact_phone%    
%asset_attribute_show_headline%    
%asset_attribute_show_summary%    
%asset_attribute_show_body%    
%asset_attribute_show_contact_name%    
%asset_attribute_show_contact_phone%    
%asset_attribute_short_name%    
%asset_attribute_name%    
%asset_name_linked_to_link_url%    
%asset_attribute_link_url%    
%asset_attribute_url_suffix%    

Paint Layout Keywords

Keyword Output Version
%paint_layout%    
%begin_X% If paint layout condition met  
%else_X% If paint layout condition not met  
%end_X% End conditional paint layout content  

Standard Page Keywords

Keyword Output Version
%asset_attribute_short_name%    
%asset_attribute_name%    

Search Page Keywords

Keyword Output Version
%X_query% Input box for search terms  
%X_query_logic% Drop down logic chooser  
%X_query_terms% Show the search terms entered by the user  
%results_per_page%    
%structured_root_node%    
%submit_button%    
%result_count%    
%initial_result_count%    
%category_list_linked%    
%initial_layout%    
%next_result_page_href%    
%previous_result_page_href%    
%next_result_page_link%    
%previous_result_page_link%    
%result_page_index%    
%total_result_pages%    
%current_result_page%    
%current_result_page_end%    
%result_list%    
%page_list_X% Sliding list of page numbers  
%X_query_synonyms_message%    
%X_query_synonyms%    
%X_query_suggestions_message%    
%X_query_suggestions%    
%X_query_synonym_search_message%    

Single Calendar Event Keywords

Keyword Output Version
%event_name%    
%event_start_date%    
%event_start_time_12h%    
%event_start_time_24h%    
%event_start_time_ical%    
%event_end_date%    
%event_end_time_12h%    
%event_end_time_24h%    
%event_short_start_time%    
%event_short_end_time%    
%event_end_time_ical%    
%event_start_datetime%    
%event_end_datetime%    
%event_datetime_summary%    
%event_duration%    

Tag Listing Page

Keyword Output Version
%tag_size% The combined tag weighting across the candidate assets. 3.24.1+

User

Keyword Output Version
%asset_attribute_email_image% Prints the user’s email address as an image. 3.22.0+

Design Areas

page_body

<MySource_AREA id_name="page_body" design_area="body" />

page_body (text only)

<MySource_AREA id_name="page_body" design_area="body">
  <MySource_SET name="format" value="Text" />
</MySource_AREA>

metadata

<!-- print all metadata -->
<MySource_AREA id_name="metadata_all" design_area="metadata" /> 

<!-- print a single metadata field -->
<MySource_AREA id_name="metadata_field" design_area="metadata">
  <MySource_SET name="metadata_field" value="keywords" />
</MySource_AREA>

nest_content

<MySource_AREA id_name="nested_example" design_area="nest_content">
  <MySource_SET name="type_codes" value="page" />
</MySource_AREA>

linked_css

<MySource_AREA id_name="css_main" design_area="linked_css">
  <MySource_SET name="tag_type" value="import_tag" />
  <MySource_SET name="media" value="screen" />
</MySource_AREA>

constant_button

<MySource_AREA id_name="link_section" design_area="constant_button">
  <a <MySource_PRINT var='href' />>Privacy Policy</a>
</MySource_AREA>

asset_lineageCommon breadcrumbs (ie. where you are)

<MySource_AREA id_name="breadcrumbs" design_area="asset_lineage">
  <MySource_SET name="levels_to_print"          value="0" />
  <MySource_SET name="prefix_with_home_link"    value="true" />
  <MySource_SET name="suffix_with_current_link" value="true" />
  <MySource_SET name="prefix_with_divider"      value="true" />
  <MySource_SET name="suffix_with_divider"      value="false" />
  <MySource_SET name="unwanted_asset_types"     value="user folder" />
  <MySource_SET name="reverse_lineage"          value="false" />
  <MySource_ASSET><a href="<MySource_PRINT var='asset_link' />"><MySource_PRINT var='asset_short_name' /></a></MySource_ASSET>
  <MySource_DIVIDER><span>&gt;</span></MySource_DIVIDER>
</MySource_AREA>

access_historyReal breadcrumbs (ie. where you have been)

<MySource_AREA design_area="access_history" id_name="back_to_pages">
  <MySource_ASSET><MySource_PRINT var="asset_short_name_linked" /></MySource_ASSET>
</MySource_AREA>

menu_normalMenu/navigation (3 level)

<MySource_AREA id_name="main_menu" design_area="menu_normal">
<ul><!-- BEGIN LEVEL 1 -->
<MySource_SET name="level"                    value="top" />
<MySource_SET name="show_subs"                value="on_current" />
<MySource_SET name="settings.class.normal"    value="" />
<MySource_SET name="settings.class.current"   value="current" />
<MySource_SET name="settings.class.hierarchy" value="current" />

    <MySource_ASSET>
    <lisettings.class" />">
    <MySource_PRINT var="asset_short_name_linked" />

        <ul><!-- BEGIN LEVEL 2 -->
        <MySource_SUB design_area="menu_normal">
        <MySource_SET name="show_subs"                value="on_current" />
        <MySource_SET name="settings.class.normal"    value="" />
        <MySource_SET name="settings.class.current"   value="current" />
        <MySource_SET name="settings.class.hierarchy" value="current" />

            <MySource_ASSET>
            <lisettings.class" />">
            <MySource_PRINT var="asset_short_name_linked" />

                <ul><!-- BEGIN LEVEL 3 -->
                <MySource_SUB design_area="menu_normal">
                <MySource_SET name="show_subs"                value="on_current" />
                <MySource_SET name="settings.class.normal"    value="" />
                <MySource_SET name="settings.class.current"   value="current" />
                <MySource_set name="settings.class.hierarchy" value="current" />

                    <MySource_ASSET>
                    <lisettings.class" />">
                    <mysource_print var="asset_short_name_linked" />
                    </li>
                    </MySource_asset>

                </MySource_SUB>
                </ul><!-- END LEVEL 3 -->                         

            </li>
            </MySource_ASSET>

        </MySource_SUB>
        </ul><!-- END LEVEL 2 -->

    </li>
    </MySource_ASSET>

</ul><!-- END LEVEL 1 -->
</MySource_AREA>

search_box

<!-- substitute ZZZZ for the field name associated with the Search Page -->
<!-- substitute XXXX for the asset id of the Search Page asset -->
<MySource_AREA id_name="search_form" design_area="searchbox">
    <MySource_SET var="field_name"          value="ZZZZ" />
    <MySource_SET var="search_page_assetid" value="XXXX" />
    <MySource_SET var="default_text"        value="" />
    <MySource_SET var="submit_button"       value="false" />
    <MySource_SET var="submit_image_assetid value="" />
    <MySource_PRINT var="form_start" />
        <div id="search_form">
            <MySource_PRINT var="category_list" />
            <label for="queries_ZZZZ_query">Search</label>
            <MySource_PRINT var="box" />
            <span><MySource_PRINT var="submit" /></span>
        </div>
    <MySource_PRINT var="form_end" />
</MySource_AREA>

show_if

<MySource_AREA id_name="logged_in" design_area="show_if">
    <MySource_SET name="condition" value="logged_in" />
    <!--<MySource_SET name="condition" value="simple_edit_mode" />-->
    <!--<MySource_SET name="condition" value="write_access" />-->
    <!--<MySource_SET name="condition" value="admin_access" />-->
    <!--<MySource_SET name="condition" value="server_variable" />-->
    <!--    <MySource_SET name="condition_server_variable" value="HTTP_ACCEPT_LANGUAGE" />-->
    <!--    <MySource_SET name="condition_server_variable_match" value="en" />-->
    <!--    condition_server_var: http://php.net/manual/en/reserved.variables.server.php -->
    <MySource_THEN>You are logged in</MySource_THEN>
    <MySource_ELSE>
        <p>You are not logged in</p>
        <!-- Print the login form that is otherwise hidden through print="no" -->
        <MySource_PRINT id="login_form" />
    </MySource_ELSE>
</MySource_AREA>

request_vars

<MySource_AREA id_name="vars_example" design_area="request_vars">
    <MySource_SET name="method" value="get" />
</MySource_AREA>

<!-- print a single value from the request_vars array -->
<MySource_PRINT id_name="vars_example" var="get_variable_name" />

login_form

<MySource_AREA id_name="login_form" design_area="login_form">
    <MySource_PRINT var="referer" />
    <MySource_PRINT var="system_messages" />
    <MySource_PRINT var="login_heading" />
    <MySource_LOGIN_SECTION>
        <MySource_SET name="give_username_focus" value="false" />
        <MySource_SET name="forward_www_vars"    value="true" />
        <MySource_PRINT var="form_open" />
        <div id="login">
            <MySource_PRINT id_name="__global__" var="current_user"
default="Not logged in" attr="name" />
            <MySource_PRINT var="login_message" />
            <MySource_PRINT var="username_box" />
            <MySource_PRINT var="password_box" />
            <MySource_PRINT var="submit_button" value="Login" />
        </div>
        <MySource_PRINT var="form_close" />
    </MySource_LOGIN_SECTION>
    <MySource_LOGOUT_SECTION>
        <MySource_PRINT var="form_open" />
        <div id="login">
            <MySource_PRINT id_name="__global__" var="current_user"
default="Not logged in" attr="name" />
            <MySource_PRINT var="submit_button" value="Logout" />
        </div>
        <MySource_PRINT var="form_close" />
    </MySource_LOGOUT_SECTION>
</MySource_AREA>

headLet the Calendar asset print its own CSS

<MySource_AREA design_area="head" id_name="head" />

js_calendar_navigator

<MySource_AREA id_name="cal_nav" design_area="js_calendar_navigator" /

Issue with mod_speling

from http://ubuntuforums.org/showthread.php?t=342568

The main problem with mod_speling is that it only modifies the GET on case for files, not directories. This is usually not the problem when migrating from a Windows seb server installation. The problem is general URL case sensitivity.
Yes, you can set up a perl script to change all directories to lower-case, and search all scripts and html files to correct the broken links. Been there, done that. The problem still remains that long-time users of the sites have saved valuable links that no longer work.
I have found two possible solutions, neither of which I have been abel to get to work properly:
1. Use Samba as a pass-through to make Apache case-insensive. http://linux.omnipotent.net/article….ticle_id=11710
I understand the basic principles here. Set up a Samba mountpoint on the directory and mount the Apache web directory to that mount point. In theory, that would make the share case-insensitive. The instructions are unclear and there are none of the usual comments and addenda to this post, leaving me to think it is unusable. Anyone with details on setting this up on a newer system than this 2001 posting please chime in.

2. mod_nocase.c This one scares me too much to try as I don’t have any references from people who have tried it to tell me it is safe to use. http://www.misterblue.com/Software/mod_nocase.htm 
Again, if anyone has details on where to put this file in an Ubuntu 8.04 system or comments on tracing the code, I would appreciate it.

A major goal of the Linux movement should be to make it easy to migrate off the Microsoft monster. I have to believe this problem was solved years ago. 

Thank you for any advice.


Internet Explorer User Agent Style Sheets

The UA Style Sheet is a simple set of css styles that each web browser uses before any other css styles are applied.

This chart lists and compares the different default style sheets used to render HTML in the four major versions of Internet Explorer; IE6, IE7, IE8, and IE9 Platform Preview.

You can download each of these UA stylesheets by using the links at the top of this chart.

IE6 IE7 IE8 IE9
a
color: #00F;
text-decoration: underline;
color: #06C;
text-decoration: underline;
a:visited
color: #800080;
address
display: block;
font-style: italic;
b
font-weight: bold;
bdo
direction: rtl;
unicode-bidi: bidi-override;
blockquote
display: block;
margin: 14pt 30pt;
display: block;
margin: 1em 40px;
body
display: block;
margin: 15px 10px;
zoom: 1;
display: block;
margin: 8px;
zoom: 1;
button
background-color: #D4D0C8;
border-style: outset;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
text-align: center;
zoom: 1;
background-color: #F0F0F0;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
text-align: center;
zoom: 1;
background-color: #F0F0F0;
border-width: 3px;
box-sizing: border-box;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px 8px;
text-align: center;
zoom: 1;
caption
display: block;
padding: 1px 3px 5px;
text-align: center;
zoom: 1;
display: block;
padding: 1px 300zzz 500zzz;
text-align: center;
zoom: 1;
display: table-caption;
text-align: center;
zoom: 1;
cite
font-style: italic;
code
font-family: monospace;
font-size: 10pt;
col
border-color: #D4D0C8;
display: block;
border-color: #F0F0F0;
display: block;
box-sizing: border-box;
display: table-column;
colgroup
border-color: #D4D0C8;
display: block;
border-color: #F0F0F0;
display: block;
box-sizing: border-box;
display: table-column-group;
dd
display: block;
margin: 0 0 0 30pt;
display: block;
margin: 0 0 0 40px;
[dir=rtl] dd
margin: 0 30pt 0 0;
margin: 0 40px 0 0;
del
text-decoration: line-through;
dfn
font-style: italic;
div
display: block;
dl
display: block;
margin: 14pt 0;
display: block;
margin: 1em 0;
dt
display: block;
em
font-style: italic;
embed
zoom: 1;
fieldset
border-style: groove;
border-width: 2px;
display: block;
zoom: 1;
border-style: groove;
border-width: 2px;
display: block;
padding: 0 2px 3px;
zoom: 1;
border-style: groove;
border-width: 2px;
display: block;
margin: 0 2px;
padding: 0 2px 3px;
zoom: 1;
form
display: block;
margin: 14pt 0;
display: block;
h1
display: block;
font-size: 24pt;
font-weight: bold;
margin: 14pt 0;
display: block;
font-size: 2em;
font-weight: bold;
margin: 0.67em 0;
page-break-after: avoid;
h2
display: block;
font-size: 18pt;
font-weight: bold;
margin: 14pt 0;
display: block;
font-size: 1.5em;
font-weight: bold;
margin: 0.83em 0;
page-break-after: avoid;
h3
display: block;
font-size: 13.55pt;
font-weight: bold;
margin: 14pt 0;
display: block;
font-size: 1.17em;
font-weight: bold;
margin: 1em 0;
page-break-after: avoid;
h4
display: block;
font-weight: bold;
margin: 14pt 0;
display: block;
font-size: 1em;
font-weight: bold;
margin: 1.33em 0;
page-break-after: avoid;
h5
display: block;
font-size: 10pt;
font-weight: bold;
margin: 14pt 0;
display: block;
font-size: 0.83em;
font-weight: bold;
margin: 1.67em 0;
page-break-after: avoid;
h6
display: block;
font-size: 7.55pt;
font-weight: bold;
margin: 14pt 0;
display: block;
font-size: 0.67em;
font-weight: bold;
margin: 2.33em 0;
page-break-after: avoid;
head
display: none;
hr
text-align: center;
zoom: 1;
outline: 0 none;
text-align: center;
zoom: 1;
border-style: inset;
border-width: 1px;
display: block;
margin-bottom: 0.5em;
margin-top: 0.5em;
overflow: hidden;
text-align: center;
zoom: 1;
html
overflow-x: auto;
overflow-y: scroll;
zoom: 1;
display: block;
zoom: 1;
i
font-style: italic;
iframe
background-color: #FFF;
height: 150px;
width: 300px;
zoom: 1;
img
zoom: 1;
input
background-color: #FFF;
border-style: inset;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px;
zoom: 1;
background-color: #FFF;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
padding: 1px;
zoom: 1;
ins
text-decoration: underline;
kbd
font-family: monospace;
font-size: 10pt;
legend
zoom: 1;
padding: 0 2px;
zoom: 1;
li
display: block;
display: list-item;
menu
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 14pt 0 14pt 30pt;
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 1em 0;
padding: 0 0 0 30pt;
[dir=rtl] menu
margin: 14pt 30pt 14pt 0;
padding: 0 30pt 0 0;
object
zoom: 1;
ol
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: decimal;
margin: 14pt 0 14pt 30pt;
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: decimal;
margin: 1em 0;
padding: 0 0 0 30pt;
[dir=rtl] ol
margin: 14pt 30pt 14pt 0;
padding: 0 30pt 0 0;
optgroup
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
option
font-family: sans-serif;
font-size: 10pt;
font-style: italic;
font-weight: bold;
p
display: block;
display: block;
margin: 1em 0;
pre
display: block;
font-family: monospace;
font-size: 10pt;
white-space: pre;
display: block;
font-family: monospace;
font-size: 10pt;
margin: 1em 0;
white-space: pre;
rp
font-size: 6pt;
rt
font-size: 6pt;
display: ruby-text;
font-size: 6pt;
ruby
display: ruby;
samp
font-family: monospace;
font-size: 10pt;
script
display: none;
zoom: 1;
select
border-color: #FFF;
border-style: inset;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
zoom: 1;
background-color: #FFF;
border-color: #FFF;
border-width: 2px;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
zoom: 1;
background-color: #FFF;
border-width: 1px;
box-sizing: border-box;
font-family: sans-serif;
font-size: 10pt;
overflow: hidden;
zoom: 1;
small
font-size: 10pt;
font-size: 0.83em;
strong
font-weight: bold;
style
display: none;
zoom: 1;
sub
font-size: 10pt;
font-size: 0.83em;
sup
font-size: 10pt;
font-size: 0.83em;
table
border-color: #D4D0C8;
display: block;
zoom: 1;
border-color: #F0F0F0;
display: block;
zoom: 1;
border-color: #F0F0F0;
border-spacing: 2px 2px;
box-sizing: border-box;
display: table;
zoom: 1;
tbody
border-color: #D4D0C8;
display: block;
border-color: #F0F0F0;
display: block;
box-sizing: border-box;
display: table-row-group;
vertical-align: middle;
td
border-color: #D4D0C8;
display: block;
padding: 1px;
zoom: 1;
border-color: #F0F0F0;
display: block;
padding: 1px;
zoom: 1;
display: table-cell;
padding: 1px;
vertical-align: middle;
zoom: 1;
textarea
background-color: #FFF;
border-style: inset;
border-width: 2px;
font-family: monospace;
font-size: 10pt;
overflow-x: hidden;
overflow-y: scroll;
padding: 1px;
white-space: pre;
zoom: 1;
background-color: #FFF;
border-width: 2px;
font-family: monospace;
font-size: 10pt;
overflow-x: hidden;
overflow-y: scroll;
padding: 2px;
white-space: pre;
zoom: 1;
background-color: #FFF;
border-width: 1px;
font-family: monospace;
font-size: 10pt;
overflow-x: hidden;
overflow-y: scroll;
padding: 2px;
white-space: pre-wrap;
zoom: 1;
tfoot
border-color: #D4D0C8;
display: block;
border-color: #F0F0F0;
display: block;
box-sizing: border-box;
display: table-footer-group;
vertical-align: middle;
th
border-color: #D4D0C8;
display: block;
font-weight: bold;
padding: 1px;
text-align: center;
zoom: 1;
border-color: #F0F0F0;
display: block;
font-weight: bold;
padding: 1px;
text-align: center;
zoom: 1;
display: table-cell;
font-weight: bold;
padding: 1px;
text-align: center;
vertical-align: middle;
zoom: 1;
thead
border-color: #D4D0C8;
display: block;
border-color: #F0F0F0;
display: block;
box-sizing: border-box;
display: table-header-group;
vertical-align: middle;
tr
border-color: #D4D0C8;
display: block;
zoom: 1;
border-color: #F0F0F0;
display: block;
zoom: 1;
box-sizing: border-box;
display: table-row;
vertical-align: middle;
zoom: 1;
ul
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 14pt 0 14pt 30pt;
display: block;
list-style-image: none;
list-style-position: outside;
list-style-type: disc;
margin: 1em 0;
padding: 0 0 0 30pt;
[dir=rtl] ul
margin: 14pt 30pt 14pt 0;
padding: 0 30pt 0 0;
var
font-style: italic;

Interested in other UA Style Sheets?

Firefox 3.6.3
Webkit (r57042)
Opera 10.51

This chart was last updated March 30th, 2010.

Internet Explorer and the Internet Explorer logo are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

HTML DOCTYPE Collection

from http://www.w3.org/QA/2002/04/valid-dtd-list.html

Recommended Doctype Declarations to use in your Web document.

When authoring document is HTML or XHTML, it is important to Add a Doctype declaration. The doctype declaration must be exact (both in spelling and in case) to have the desired effect, which makes it sometimes difficult. To ease the work, below is a list of recommended doctype declarations that you can use in your Web documents.

Template

Use the following markup as a template to create a new XHTML 1.0 document using a proper Doctype declaration. See the list below if you wish to use another DTD.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>An XHTML 1.0 Strict standard template</title>
	<meta http-equiv="content-type"
		content="text/html;charset=utf-8" />
</head>

<body>

     <p>… Your HTML content here …</p>

</body>
</html>

(X)HTML Doctype Declarations List

HTML 4.01
Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
	
XHTML 1.0
Strict (quick reference)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
	
XHTML Basic 1.1 (quick reference):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
	
HTML 5 [NOT a standard yet]
<!DOCTYPE HTML>

MathML Doctype Declarations

MathML 2.0DTD:
<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"
	"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
	
MathML 1.01DTD:
<!DOCTYPE math SYSTEM
	"http://www.w3.org/Math/DTD/mathml1/mathml.dtd">
	

Compound documents doctype declarations

XHTML + MathML + SVGDTD:
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
	
XHTML + MathML + SVG Profile (XHTML as the host language) – DTD:
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
	
XHTML + MathML + SVG Profile (Using SVG as the host) – DTD:
<!DOCTYPE svg:svg PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
	

Optional doctype declarations

Beyond the specificities of (X)HTML processing, Doctype declarations in XML languages are only useful to declare named entities and to facilitate the validation of documents based on DTDs. This means that in many XML languages, doctype declarations are not necessarily useful.

The list below is provided only if you actually need to declare a doctype for these types of documents.

SVG 1.1 FullDTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
	
SVG 1.0DTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
	"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
	
SVG 1.1 BasicDTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN"
	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
	
SVG 1.1 TinyDTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN"
	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
	

Historical doctype declarations

The doctype declarations below are valid, but have mostly an historical value — a doctype declaration of a more recent equivalent ought to be used in their stead.

HTML 2.0DTD:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
HTML 3.2DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
XHTML Basic 1.0DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
	

Problem:

Need to add predefined css in external css to RadEditor in Sitecore CMS

Solution:

  • Add css class to default.css which can be found in WEB_ROOT/Web.config on the following line:

<setting name="WebStylesheet" value="/default.css" />

Example css:

.cufon {
  font-weight: bold;
  color: #666;
}

  • Modify the ToolsFile.xml defined in where the Sitecore uses the RadEditor (in my case: WEB_ROOT/sitecore/shell/Controls/Rich Text Editor/Default.aspx) and add the following lines:

<classes>
  <class name="Clear Class" value="" />
  <class name="Cufon Book" value=".cufonBook" />
  <class name="Cufon Light" value=".cufonLight" />
</classes>

Reference:

  1. RadControls – CSS Styles http://www.telerik.com/help/aspnet-ajax/cssstyles.html
  2. how to load css classes from my own project specfic css in Sitecore’s RAD editor? http://stackoverflow.com/questions/2197212/

PHP Turn On Error Reporting

ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

How to enable Session state in ASP.NET

from http://blog.felipel.com/post/How-to-enable-Session-state-in-ASPNET.aspx

While trying to use the Session state dictionary in a web application, you may eventually receive the following exception:

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.

To my surprise, session state has to be enabled before it can be used. I followed some steps that I found while digging for the solution online that might be helpful:

1. Enable the ASP.NET Session State Manager Service (under Control Panel > Administrative Tools > Services)

2. Enable it in the web.config file: <pages enableSessionState="true">

3. Add the proper http module to the web.config: <add name="Session" type="System.Web.SessionState.SessionStateModule" />

4. At last but not least: Make sure you’re accessing the Session object after it has been initialized. This is very important, since if you try to manipulate it in the page constructor, for example (which was my case), you’ll still get the above exception, even after executing steps 1, 2 and 3. You should be able to access it after the page OnLoad event has been fired.

About the Robots tag

from http://www.robotstxt.org/meta.html

About the Robots <META> tag

In a nutshell

You can use a special HTML <META> tag to tell robots not to index the content of a page, and/or not scan it for links to follow.

For example:

<html>
<head>
<title>...</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>

There are two important considerations when using the robots <META> tag:

  • robots can ignore your <META> tag. Especially malware robots that scan the web for security vulnerabilities, and email address harvesters used by spammers will pay no attention.
  • the NOFOLLOW directive only applies to links on this page. It’s entirely likely that a robot might find the same links on some other page without a NOFOLLOW (perhaps on some other site), and so still arrives at your undesired page.

Don’t confuse this NOFOLLOW with the rel="nofollow" link attribute.

The details

Like the /robots.txt, the robots META tag is a de-facto standard. It originated from a “birds of a feather” meeting at a 1996 distributed indexing workshop, and was described in meeting notes.

The META tag is also described in the HTML 4.01 specification, Appendix B.4.1.

The rest of this page gives an overview of how to use the robots <META> tags in your pages, with some simple recipes. To learn more see also the FAQ.

How to write a Robots Meta Tag

Where to put it

Like any <META> tag it should be placed in the HEAD section of an HTML page, as in the example above. You should put it in every page on your site, because a robot can encounter a deep link to any page on your site.

What to put into it

The “NAME” attribute must be “ROBOTS”.

Valid values for the “CONTENT” attribute are: “INDEX“, “NOINDEX“, “FOLLOW“, “NOFOLLOW“. Multiple comma-separated values are allowed, but obviously only some combinations make sense. If there is no robots <META> tag, the default is “INDEX,FOLLOW“, so there’s no need to spell that out. That leaves:

<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">
<META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW">
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">

Short Url(短网址)实现方式(zz)

from http://i.laoer.com/short-url.html

现在提供Short Url(短网址)的网站越来越多了,特别是Twitter的助Short Url的一臂之力,越来越多的人开始使用Short Url-短网址,现在比较流行的几个Short Url网站有

TinyURL
http://tinyurl.com/

Bit.Ly
http://bit.ly/

Is.Gd
http://is.gd/

等等,Short Url的作用在于把长的Url缩成短的Url,比如,我前两天些的一篇博客,Url是http://i.laoer.com/think-about-http-get-chinese-encode-error.html,我们采用TinyURL,转成的Url是http://tinyurl.com/d4zw8x,只有25个字符,短了很多,请求http://tinyurl.com/d4zw8x的时候,tinyurl会把请求通过HTTP 301转到http://i.laoer.com/think-about-http-get-chinese-encode-error.html上。

实现Short Url的功能并不复杂,但最关键的就是这个短代码要够短,而且需要唯一,我们的例子是“d4zw8x”,6位,还有就是用户输入的同一个Url,应该返回唯一的Short Url,用户在请求长的Url之后,先从数据库查找一下这个长Url是否存在,如果存在,就直接取出其对应的短代码,如果不存在,则生成短代码,与用户的长Url同时保存在数据库中。

最核心的这个短代码的实现方式,我在网上找了两个

第一个是纯随机数的算法,来自Short URL Script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function random($length, $pool = '')
    {
        $random = '';

        if (empty($pool)) {
            $pool    = 'abcdefghkmnpqrstuvwxyz';
            $pool   .= '23456789';
        }

        srand ((double)microtime()*1000000);

        for($i = 0; $i < $length; $i++)
        {
            $random .= substr($pool,(rand()%(strlen ($pool))), 1);
        }

        return $random;
    }

另一个算法来自http://www.snippetit.com/2009/04/php-short-url-algorithm-implementation/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function shorturl($input) {
  $base32 = array (
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
    'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
    'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
    'y', 'z', '0', '1', '2', '3', '4', '5'
    );

  $hex = md5($input);
  $hexLen = strlen($hex);
  $subHexLen = $hexLen / 8;
  $output = array();

  for ($i = 0; $i < $subHexLen; $i++) {
    $subHex = substr ($hex, $i * 8, 8);
    $int = 0x3FFFFFFF & (1 * ('0x'.$subHex));
    $out = '';

    for ($j = 0; $j < 6; $j++) {
      $val = 0x0000001F & $int;
      $out .= $base32[$val];
      $int = $int >> 5;
    }

    $output[] = $out;
  }

  return $output;
}

其返回的是一个4个元素的数组,应为存在可能的重复性,你可以依次使用这4个元素。

Short Url的算法应该还有一些,Short Url网站的作用除了缩短网址以外,在使用者不断增加之后,可以积累庞大的网址信息,这对统计分析是很有用的。

Powered by WordPress. Theme: Motion by 85ideas.