Showing posts with label Browser\Web\HTML\CSS. Show all posts
Showing posts with label Browser\Web\HTML\CSS. Show all posts

May 10, 2009

TinyMCE – The RAD WYSIWYG editor

TinyMCE is a powerful, most used WYSIWYG editor control for web browsers. It comes with the following features:

  • Easy to integrate, takes only a couple lines of code.
  • Theme and template support.
  • Easy to extend with custom code. (Plugins and callbacks)
    Customizable HTML output. Block elements and force attributes.
  • International language support (Language packs).
  • Multiple browser support, currently Mozilla (PC, Mac and Linux), MSIE (PC) and FireFox (PC, Mac and Linux) and some limited Safari support.

TinyMCE converts HTML TEXTAREA fields or other HTML elements to editor instances as shown in code.

To use TinyMCE, you need to download scripts files. The downloaded file structure is shown below however you need to configure only jscripts folder on your web server.

/tinymce/
/tinymce/docs/
/tinymce/docs/zh_cn/
/tinymce/examples/
/tinymce/examples/zh_cn/
/tinymce/jscripts/
/tinymce/jscripts/tiny_mce/
/tinymce/jscripts/tiny_mce/langs/
/tinymce/jscripts/tiny_mce/plugins/
/tinymce/jscripts/tiny_mce/plugins/<plugin folders>
/tinymce/jscripts/tiny_mce/themes/
/tinymce/jscripts/tiny_mce/themes/advanced/
/tinymce/jscripts/tiny_mce/themes/default/
/tinymce/jscripts/tiny_mce/themes/simple/

The examples with downloaded package has several implementations of text editors using TinyMCE.

Following is snippet of full feature editor using TinyMCE with code.

tinyMCE


When you submit contents in TextArea, TintMCE provides various APIs to process contents. Obviously you need to write some code for processing the contents. (e.g. saving in database)

Following is the code to add full feature editor using TinyMCE copied from this location.

<script type="text/javascript" src="<your installation path>/tiny_mce/tiny_mce.js"></script>
<
script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

// Theme options
theme_advanced_buttons1 : "save,newdocument,,bold,italic,underline,strikethrough,,justifyleft,justifycenter,justifyright,justifyfull,,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,,search,replace,,bullist,numlist,,outdent,indent,blockquote,,undo,redo,,link,unlink,anchor,image,cleanup,help,code,,insertdate,inserttime,preview,,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,,hr,removeformat,visualaid,,sub,sup,,charmap,emotions,iespell,media,advhr,,print,,ltr,rtl,,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,,styleprops,spellchecker,,cite,abbr,acronym,del,ins,attribs,,visualchars,nonbreaking,template,blockquote,pagebreak,,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

// Example content CSS (should be your site CSS)
content_css : "css/example.css",

// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",

// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>

<
form method="post" action="somepage">
<
textarea name="content" style="width:100%">
</
textarea>
</
form>

November 23, 2008

Load-Balanced Cluster and Session State Management

Load balancing scales the performance of server-based programs, such as a Web server, by distributing client requests across multiple servers. Load balancing technologies, commonly referred to as load balancers, receive incoming requests and redirect them to a specific host if necessary.

Load balancers uses following algorithms to intelligently distribute load and/or maximize the utilization of all servers within the cluster.

Round-robin. A round-robin algorithm distributes the load equally to each server, regardless of the current number of connections or the response time. Round-robin is suitable when the servers in the cluster have equal processing capabilities; otherwise, some servers may receive more requests than they can process while others are using only part of their resources.

Weighted round-robin. A weighted round-robin algorithm accounts for the different processing capabilities of each server. Administrators manually assign a performance weight to each server, and a scheduling sequence is automatically generated according to the server weight. Requests are then directed to the different servers according to a round-robin scheduling sequence.

Least-connection. A least-connection algorithm sends requests to servers in a cluster, based on which server is currently serving the fewest connections.

Load-based. A load-based algorithm sends requests to servers in a cluster, based on which server currently has the lowest load.

The two major categories of load balancing implementations are:

Software-based load balancing. Software-based load balancing consists of special software that is installed on the servers in a load-balanced cluster. The software dispatches or accepts requests from the client to the servers, based on different algorithms. The algorithms can be a simple round-robin algorithm or a much more complicated algorithm that considers server affinity. For example,

Microsoft Network Load Balancing is a load balancing software for Web farms, and Microsoft Component Load Balancing is a load balancing software for application farms.

Hardware-based load balancing. Hardware-based load balancing consists of a specialized switch or router with software to give it load balancing functionality. This solution integrates switching and load balancing into a single device, which reduces the amount of extra hardware that is required to implement load balancing. Combining the two functions, however, also makes the device more difficult to troubleshoot.

Session State Management

Server session management requires the load balancer to direct all requests from one client within the same user session to the same server instance.

To avoid session loss due to server failure in a load balancing group, there are two approaches:

· Centralized state management

The centralized state management approach stores the session state information on a centralized server in a different tier from the application servers. Each time the application server receives a request that is part of a session; it fetches the session state from the session management server before processing the request. The session management service can be a database or another type of application that runs on a server that stores shared resources and is configured for high reliability.

· Asynchronous session state management.

Using the asynchronous session state management approach, every server broadcasts its session state to all other servers whenever the session state is changed; therefore, every server contains the state information for all sessions, and any server can process a request that is part of a session. Session state also survives individual server failures. This solution is cheaper because no extra equipment is required but harder to configure and maintain because it involves asynchronous calls. Storing the state for all sessions on every server can also be less efficient.

May 30, 2008

High scalable architectures

Last week I came across interesting web site by Todd Hoff who was former IBM and Intuit Employee.

His site http://highscalability.com/ on high scalable architectures has some big shot web sites explaining lore, art and science behind it. Some examples are:

His personal web site is at http://possibility.com/Tmh/ and Wiki stuff is at http://www.possibility.com/wiki/index.php?title=Main_Page

October 25, 2007

URLOpenBlockingStream() won't work with ISS compression.

In C++, URLOpenBlockingStream() method creates a blocking type stream object from a URL and downloads the data from the Internet.

We had issue where user was getting exceptions while using this method. Apparently it was happening due to ISS compression enabled on sever.

On a Windows 2003 Server (IIS 6 and compression are only available on this platform), you find the metabase.xml file. Right click on the file and click edit.

In the metabase.xml, you delete the asp file extension from the deflate and gzip compression sections (highlighted in red below)



<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="0"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="FALSE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"

HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="exe

asp
dll"

>
</IIsCompressionScheme>
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="1"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"

HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="exe

asp
dll"
>

January 06, 2007

Change or Remove Internet Explorer Description in Title Bar


To change or remove Internet Explorer Description in Title Bar: (E.g. Your name/company name etc)

  1. Go to the following key in the Registry Editor:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
  2. Double-click the Window Title icon in the right pane.
  3. If the key doesn’t exist, right-click in the pane, then choose New, String Value, type Window Title, and press . Type what you want to see on IE’s title bar, or type nothing to show only the site name.
  4. Click OK. Close Registry Editor and any Internet Explorer’s windows.

Note that the hyphen that normally separates the site name from the page title will remain.

January 05, 2007

IIS Compression

Shannon send me this article on IIS Compression
http://www.dotnetjunkies.com/Article/16267D49-4C6E-4063-AB12-853761D31E66.dcik

Here's something else for it.
http://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx

Create Compression Folder (optional)

The first thing I do is create a folder on the D drive where the static file compression will be cached. I call it ASPNetCompressTemp but you can call it anything you want or leave the default of “%windir%\IIS Temporary Compressed Files” if that works for you. The IUSR_{machinename} will need write permission to the folder. If you use custom anonymous users, make sure to assign the proper user. IIS will still work even if the permissions are wrong but the compression won't work properly. Once running, it's worth double checking Event Viewer to see if any errors are occurring that keep IIS Compression from working.

Enable Compression in IIS

- From the IIS snap-in, right-click on the Web Sites node and click on Properties
- Select the Service tab
- Enable Compress application files - Enable Compress static files
- Change Temporary Directory to the folder that you created above, or leave it at it's default
- Set the max size of the temp folder to something that the hard drive can handle. i.e. 1000.
- Save and close the Web Site Properties dialog

Note: The temporary compress directory is only used for static pages. Dynamic pages aren't saved to disk and are recreated every time so there is some CPU overhead used on every page request for dynamic content.

July 17, 2006

Some Technical Terms (Mostly Web / Service related)

Here are some technical terms mostly related to web or web service.

BPEL
Business Process Execution Language (or BPEL, pronounced 'bipple', or 'bee-pell'), is a business process modeling language that is executable. BPEL is an Orchestration language.
Origins of BPEL can be traced to WSFL and XLANG. It is serialized in XML and aims to enable programming in the large.

WSFL
Web Services Flow Language (WSFL) is an XML language proposed by IBM to describe the composition of Web services. WSFL has been superseded by BPEL.

XLang
XLang is an extension of the WSDL such that "an XLANG service description is a WSDL service description with an extension element that describes the behavior of the service as a part of a business process"

POX
Plain Old XML (POX) is a term used to describe basic XML, sometimes mixed in with other, blendable specifications like XML Namespaces, Dublin Core, XInclude and XLink. People typically use the term as a contrast with complicated, multilayered XML specifications like those for Web Services or RDF.

Workflow
Workflow at its simplest is the movement of documents and/or tasks through a work process. More specifically, workflow is the operational aspect of a work procedure: how tasks are structured, who performs them, what their relative order is, how they are synchronized, how information flows to support the tasks (wordflow) and how tasks are being tracked.

RSS
RSS(Really Simple Syndication) is a family of web feed formats used to publish frequently updated digital content, such as blogs, news feeds or podcasts.

XPDL
The XML Process Definition Language (XPDL) is a format standardized by the Workflow Management Coalition to interchange Business Process definitions between different workflow products like modeling tools and workflow engines. XPDL defines a XML schema for specifying the declarative part of workflow.
XPDL is designed to exchange the process design, both the graphics and the semantics of a workflow business process. XPDL contains elements to hold the X and Y position of the activity nodes as well as the coordinates of points along the lines that link those nodes. This distinguishes XPDL from BPEL which is also a process definition format, but BPEL focuses exclusively on the executable aspects of the process. BPEL does not contain elements to represent the graphical aspects of a process diagram.

REST
REST (representational state transfer) is an approach for getting information content from a Web site by reading a designated Web page that contains an XML (Extensible Markup Language) file that describes and includes the desired content. For example, REST could be used by an online publisher to make syndicated content available. Periodically, the publisher would prepare and activate a Web page that included content and XML statements that described the content. Subscribers would need only to know the URL (Uniform Resource Locator) for the page where the XML file was located, read it with a Web browser, interpret the content data using the XML information, and reformat and use it appropriately (perhaps in some form of online publication).

POX is different from
REST in that the latter refers to a style for communication protocols, while the former only refers to an information format style. REST could be seen as POX over HTTP with some peculiarities.

Web2.0
Web 2.0, a phrase coined by O'Reilly Media in 2004, refers to a perceived second-generation of Web-based services—such as social networking sites, wikis, communication tools, and folksonomies—that emphasize online collaboration and sharing among users. O'Reilly Media used the phrase as a title for a series of conferences, and it has since become widely adopted.

SAAS
Software as a service (SaaS) is a model of software delivery where the software company provides maintenance, daily technical operation, and support for the software provided to their client. SaaS is a model of software delivery rather than a market segment; it assumes the software is delivered over the internet. Software can be delivered using this method to any market segment, from home consumers to corporations.

JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language

ATOM
The name
Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (APP for short) is a simple HTTP-based protocol for creating and updating Web resources.

XINS
XML Interface for Network Services (XINS) is an open source technology for definition and implementation of internet applications, which enforces a specification-oriented approach.

WSCL
The Web Service Conversation Language (WSCL) proposal defines the overall input and output message sequences for one web service using a finite state automaton FSA over the alphabet of message types.

XML-RPC
XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism. It is a very simple protocol, defining only a handful of data types and commands, and the entire description can be printed on two pages of paper. This is in stark contrast to most RPC systems, where the standards documents often run into the thousands of pages and require considerable software support in order to be used.

WS-MetadataExchange
One of many Web Service specifications,
WS-MetadataExchange deals with the exchange of information about a Web Service. It is a protocol used by a web service to describe itself.

WSML
The
Web Service Modeling Language WSML is a language for the specification of ontologies and different aspects of Web services. In this respect WSML provides a syntax and semantics for the Web Service Modeling Ontology WSMO. WSML uses well-known logical formalisms in order to enable the description of various aspects related to Semantic Web Services.

WSMX
WSMX (Web Service Modelling eXecution environment) is the reference implementation of WSMO (Web Service Modelling Ontology). It is an execution environment for business application integration where enhanced web services are integrated for various business applications. The aim is to increase business processes automation in a very flexible manner while providing scalable integration solutions.

February 13, 2006

Error while looking MIME type for JPEG image file in Netscape

Error while looking MIME type for JPEG image file :

Reson:

Internet Explorer treats all jpegs as type=>image/pjpeg
Netscape/Internet Explorertreats all jpegs as type=>image/pjpeg

where as

Netscape/Firefox treats all jpegs as type=>image/jpeg

What genius at microsoft decided to rename the mime type for jpgs?

December 20, 2003

A d v a n c e d C S S R e f e r e n c e

This site has all info on CSS

February 01, 2003

Simple HTML/Script to zoom image on clicks

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<script language="Javascript" event="onclick" for="Grphic">
Grphic.width *= 1.5 ;
Grphic.height *= 1.5 ;
</script>
<BODY>

<img src="images\seal.bmp" id=Grphic>

January 08, 2003

Inserting Watremaek on HTML page

#HTML>
#Body>


#script language="JavaScript">

if (document.alldocument.getElementById)
document.body.style.background="url('wmark.jpg') white center no-repeat fixed"

#/script>

#/body>
#/HTML>

December 20, 2001

Running Text in HTMLPage

Created on 11/28/2000

<HTML>

<STYLE>.spanstyle
{
COLOR: red; font-style=Arial; FONT-SIZE: 10pt; FONT-WEIGHT: bold; POSITION: absolute; TOP: -50px; VISIBILITY: visible
}
</STYLE>

<SCRIPT>
var x,y
var step=10
var flag=0

var message="Ajit S. MUNGALE, IBM India Pune "

message=message.split("")

//alert(message);

var xpos=new Array()
for (i=0;i<=message.length-1;i++)
{
xpos[i]=-50
}

var ypos=new Array()
for (i=0;i<=message.length-1;i++)
{
ypos[i]=-50
}

function handlerMM(e)
{
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}

function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y

for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}

else if (flag==1 && document.layers)
{
for (i=message.length-1; i>=1; i--)
{
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y

for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("makesnake()",10)
}

for (i=0;i<=message.length-1;i++)
{
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}

if (document.layers)
{
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
</SCRIPT>

<BODY aLink=red bgColor=<ffffff leftMargin=0 onload=makesnake()
style="OVERFLOW-X: hidden; OVERFLOW-Y: scroll; WIDTH: 100%" FONT face= "SUBAK"; text=<000000
topMargin=0 marginheight="0" marginwidth="0" >

<hr>
<font color=<ffffff size=6>
<p align="center"><marquee bgcolor=<060777 width=65%>Ajit S. Mungale IBM India Pune</marquee></p>
</font>
<hr>


<hr>
<p align="center">
<MARQUEE bgColor=lightsteelblue direction=up
style ="BORDER-BOTTOM-COLOR: black;
BORDER-BOTTOM-STYLE: double;
BORDER-LEFT-COLOR: black; BORDER-LEFT-STYLE:
double; BORDER-RIGHT-COLOR: black;
BORDER-RIGHT-STYLE: double; BORDER-TOP-COLOR:
black; BORDER-TOP-STYLE: double; COLOR:
crimson; DISPLAY: block; FONT-FAMILY:
monospace;HEIGHT: 115px; WIDTH: 82px"
scrollDelay=200 trueSpeed>ajit s. Mungale, IBM India Ltd.</MARQUEE>
</p>
<hr>

<p align="center">
<MARQUEE bgColor=lightsteelblue direction=down
style ="BORDER-BOTTOM-COLOR: black;
BORDER-BOTTOM-STYLE: double;
BORDER-LEFT-COLOR: black; BORDER-LEFT-STYLE:
double; BORDER-RIGHT-COLOR: black;
BORDER-RIGHT-STYLE: double; BORDER-TOP-COLOR:
black; BORDER-TOP-STYLE: double; COLOR:
crimson; DISPLAY: block; FONT-FAMILY:
monospace; HEIGHT: 115px; WIDTH: 90px"
scrollDelay=200 trueSpeed>
<FONT face=SUBAK >AOrV _w§Ji{, Am` ]s _ , [wU{</FONT>
</MARQUEE>
</p>
</body>
</HTML>

September 28, 2001

Set HomePage using VB

Private Declare Function RegCreateKey Lib _
"advapi32.dll" Alias "RegCreateKeyA" _
(ByVal HKey As Long, ByVal lpSubKey As _
String, phkResult As Long) As Long

Private Declare Function RegCloseKey Lib _
"advapi32.dll" (ByVal HKey As Long) As Long

Private Declare Function RegSetValueEx Lib _
"advapi32.dll" Alias "RegSetValueExA" _
(ByVal HKey As Long, ByVal _
lpValueName As String, ByVal _
Reserved As Long, ByVal dwType _
As Long, lpData As Any, ByVal _
cbData As Long) As Long

Private Const REG_SZ = 1
Private Const HKEY_CURRENT_USER = &H80000001

Private Sub SaveString(HKey As Long, Path As String, _
Name As String, Data As String)

Dim KeyHandle As Long
Dim r As Long

r = RegCreateKey(HKey, Path, KeyHandle)
r = RegSetValueEx(KeyHandle, Name, 0, _
REG_SZ, ByVal Data, Len(Data))
r = RegCloseKey(KeyHandle)

End Sub

Private Sub SetStartPage(URL As String)

Call SaveString(HKEY_CURRENT_USER, _
"Software\Microsoft\Internet Explorer\Main", _
"Start Page", URL)

End Sub

Private Sub SetWindowTitle(Title As String)

Call SaveString(HKEY_CURRENT_USER, _
"Software\Microsoft\Internet Explorer\Main", _
"Window Title", Title)

End Sub

Private Sub Command1_Click()

SetStartPage ("http://iknown.blogspot.com/")
SetWindowTitle ("Ajit Mungale")
End Sub

January 12, 2001

Set HomePage Link(HTML)

<HTML XMLNS:IE>
<HEAD>
<TITLE>Javascript - Set default homepage for browser</TITLE>
<STYLE>
@media All
{
IE\:HOMEPAGE {BEHAVIOR: url(<default<homepage)}
}
</STYLE>

<SCRIPT language=JavaScript type="text/javascript">
function fnSet(){
oHomePage.setHomePage(oHomeHref.value);
event.returnValue = false;
}
</SCRIPT>
</HEAD>

<IE:HOMEPAGE id=oHomePage></IE:HOMEPAGE>

<br> <align="center">
<A HREF="javascript://" onClick="fnSet();" id=oHomeHref value="http://www.amexweb.com/" align="center">Set <b>'AmexWeb'</b> as default Homepage in the Browser.</A>

</BODY>
</HTML>