2009/12/28

Mail Server Setup With Exim, MySQL, Cyrus-Imapd, Horde Webmail On Centos 5.1 - Page 2 | HowtoForge - Linux Howtos and Tutorials

Mail Server Setup With Exim, MySQL, Cyrus-Imapd, Horde Webmail On Centos 5.1 - Page 2 | HowtoForge - Linux Howtos and Tutorials: "$_prefs['initial_application'] = array( 'value' => 'imp', 'locked' => true, 'shared' => true, 'type' => 'select', 'desc' => sprintf(_('What application should %s display after login?'), $GLOBALS['registry']->get('name')) );"

2009/12/17

天狼星資源部 SiriusResource: SQL 2008 Express 安裝問題 SQL 2008 Express Installation Problem

天狼星資源部 SiriusResource: SQL 2008 Express 安裝問題 SQL 2008 Express Installation Problem: "SQL 2008 Express 安裝問題 SQL 2008 Express Installation Problem

在安裝SQL 2008 Express 的時候,
會有一個Installation Check的物體出現.

而Failed的就係這個:

Performance counter registry hive consistency check:
'The Performance counter registry hive is corrupted'



會要求你去看技術文件http://support.microsoft.com/kb/300956
但就無講Windows Vista的解決方法.
在找過滿多網站及用不同的關鍵字之後.
以下就係各個解決方法:
(註*:Windows XP & Windows Server 個個未用過.)

Windows XP & Windows Server
方法出處:Link

Windows Vista
用regedit在[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\]加個004機碼,
之後係009機碼複製Counter同Help的內容過去004機碼中,就可以解決上面的問題!
之於出於什麼問題,可能係SQL 2008 Express的語言問題.
方法出處:Link"

2009/12/09

OVER Clause (Transact-SQL)

OVER Clause (Transact-SQL): "Ranking Window Functions < OVER_CLAUSE > :: = OVER ( [ PARTITION BY value_expression , ... [ n ] ] <ORDER BY_Clause> ) Aggregate Window Functions < OVER_CLAUSE > :: = OVER ( [ PARTITION BY value_expression , ... [ n ] ] )"

2009/12/08

phplist 2.10.10 : fixing FCK editor’s image upload problem | Life, Work and Technology

phplist 2.10.10 : fixing FCK editor’s image upload problem | Life, Work and Technology: "Open file :
view sourceprint?
1.PHPListRoot/admin/FCKeditor/editor/filemanager/connectors/phplist/config.php

on line number 28 change:
view sourceprint?
1.} elseif (is_file('../../../../../../../../config/config.php')) {

to:
view sourceprint?
1.} elseif (is_file('../../../../../../config/config.php')) {

and on line number 29, change:
view sourceprint?
1.include '../../../../../../../../config/config.php';

to
view sourceprint?
1.include '../../../../../../config/config.php';

Thats it! Save the file and you should be able to instantly upload images using the FCK editor"

phplist Documentation: Message Tracking

phplist Documentation: Message Tracking: "Click tracking

Click tracking monitors whether a recipient has clicked on a link contained within a HTML or Text message. When enabled, all links in your messages will be converted to links that go through phplist. This will make sure that clicks are tracked and registered in the database. Click tracking can therefore be a simple and reliable way to monitor how many people have clicked through to your site from a message you have sent.
Note: Keep in mind that click tracking still is experimental. Your feedback is welcome and may help improve this feature.

If you want to use click tracking, you need to enable the clicktrack setting in your config.php file:

# Click tracking
# If you set this to 1, all links in your emails will be converted to links that
# go via phplist. This will make sure that clicks are tracked. This is experimental and
# all your findings when using this feature should be reported to mantis
# for now it's off by default until we think it works correctly
define('CLICKTRACK',1);

# Click track, list detail
# if you enable this, you will get some extra statistics about unique users who have clicked the
# links in your messages, and the breakdown between clicks from text or html messages.
# However, this will slow down the process to view the statistics, so it is
# recommended to leave it off, but if you're very curious, you can enable it
define('CLICKTRACK_SHOWDETAIL',0);"

phplist 標題亂碼問題 « 更夜

phplist 標題亂碼問題 « 更夜:

admin/send_core.php

"找到 1034 行 , 原始碼應該長這樣
//value=''.htmlentities(iconv('ISO-8859-1','UTF-8',$subject),ENT_QUOTES,'UTF-8').'' size=40></td></tr>
改成
//value=''.htmlentities($subject,ENT_QUOTES,'UTF-8').'' size=40></td></tr>

下面的1040行, 原來的code
value=''.htmlentities(iconv('ISO-8859-1','UTF-8',$from),ENT_QUOTES,'UTF-8').'' size=40></td></tr>
改成
value=''.htmlentities($from,ENT_QUOTES,'UTF-8').'' size=40></td></tr>"

2009/11/27

SQL Server Date Time Format

SQL Server Date Time Format:
"In SQL Server used Cast or Convert function to Format DateTime value or column into a specific date format.Both function are used to convert datetime to varchar or string.

CAST function Syntax: CAST(expression as data_type)

Let's convert current date time to varchar

select cast(getdate() as varchar)

CONVERT function is used to change or convert the DateTime formats.By using convert function you can get only Date part or only Time part from the datetime.

CONVERT Function Syntax: CONVERT(data_type,expression,date Format style)

Let's take Sql Server DateTtime styles example:

Format


Query

USA mm/dd/yy


select convert(varchar, getdate(), 1)

ANSI yy.mm.dd


select convert(varchar, getdate(), 2)

British/French dd/mm/yy


select convert(varchar, getdate(), 3)

German dd.mm.yy


select convert(varchar, getdate(), 4)

Italian dd-mm-yy


select convert(varchar, getdate(), 5)

dd mon yy


select convert(varchar, getdate(), 6)

Mon dd, yy


select convert(varchar, getdate(), 7)

USA mm-dd-yy


select convert(varchar, getdate(), 10)

JAPAN yy/mm/dd


select convert(varchar, getdate(), 11)

ISO yymmdd


select convert(varchar, getdate(), 12)

mon dd yyyy hh:miAM (or PM)


select convert(varchar, getdate(), 100)

mm/dd/yyyy


select convert(varchar, getdate(), 101)

yyyy.mm.dd


select convert(varchar, getdate(), 102)

dd/mm/yyyy


select convert(varchar, getdate(), 103)

dd.mm.yyyy


select convert(varchar, getdate(), 104)

dd-mm-yyyy


select convert(varchar, getdate(), 105)

dd mon yyyy


select convert(varchar, getdate(), 106)

Mon dd, yyyy


select convert(varchar, getdate(), 107)

hh:mm:ss


select convert(varchar, getdate(), 108)

Default + milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM)


select convert(varchar, getdate(), 109)

mm-dd-yyyy


select convert(varchar, getdate(), 110)

yyyy/mm/dd


select convert(varchar, getdate(), 111)

yyyymmdd


select convert(varchar, getdate(), 112)

Europe default + milliseconds dd mon yyyy hh:mm:ss:mmm(24h)


select convert(varchar, getdate(), 113) or select convert(varchar, getdate(), 13)

hh:mi:ss:mmm(24h)


select convert(varchar, getdate(), 114)"

2009/11/23

Database Mail in SQL Server 2005 — DatabaseJournal.com

Database Mail in SQL Server 2005 — DatabaseJournal.com: "Database Mail in SQL Server 2005
By Muthusamy Anantha Kumar aka The MAK

The SQL Mail problems, that we faced in SQL Server 7.0 and 2000, are no more. SQL Server 2005 supports and uses SMTP email now and there is no longer a need to MAPI client to send email. In SQL Server 2005, the mail feature is called Database Mail. In this article, I am going to demonstrate step-by-step, with illustrations, how to configure Database Mail and send email from SQL Server.

Database Mail has four components.

1. Configuration Component

Configuration component has two sub components. One is the Database Mail account, which contains information such as the SMTP server login, Email account, Login and password for SMTP mail.

The Second sub component is Database Mail Profile. Mail profile can be Public, meaning members of DatabaseMailUserRole in MSDB database can send email. For private profile, a set of users should be defined.

2. Messaging Component

Messaging component is basically all of the objects related to sending email stored in the MSDB database.

3. Database Mail Executable

Database Mail uses the DatabaseMail90.exe executable to send email.

4. Logging and Auditing component

Database Mail stores the log information on MSDB database and it can be queried using sysmail_event_log.

Step 1

Before setting up the Database Mail profile and accounts, we have to enable the Database Mail feature on the server. This can be done in two ways. The first method is to use Transact SQL to enable Database Mail. The second method is to use a GUI.

In the SQL Server Management Studio, execute the following statement.

use master
go
sp_configure 'show advanced options',1
go
reconfigure with override
go
sp_configure 'Database Mail XPs',1
--go
--sp_configure 'SQL Mail XPs',0
go
reconfigure
go

Alternatively, you could use the SQL Server Surface area configuration. Refer Fig 1.0.


Fig 1.0

Step 2

The Configuration Component Database account can be enabled by using the sysmail_add_account procedure. In this article, we are going create the account, 'MyMailAccount,' using mail.optonline.net as the mail server and

makclaire@optimumonline.net as the e-mail account.

Please execute the statement below.

EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = 'MyMailAccount',
@description = 'Mail account for Database Mail',
@email_address = 'makclaire@optonline.net',
@display_name = 'MyAccount',
@username='makclaire@optonline.net',
@password='abc123',
@mailserver_name = 'mail.optonline.net'

Step 3

The second sub component of the configuration requires us to create a Mail profile.

In this article, we are going to create 'MyMailProfile' using the sysmail_add_profile procedure to create a Database Mail profile.

Please execute the statement below.

EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = 'MyMailProfile',
@description = 'Profile used for database mail'

Step 4

Now execute the sysmail_add_profileaccount procedure, to add the Database Mail account we created in step 2, to the Database Mail profile you created in step 3.

Please execute the statement below.

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = 'MyMailProfile',
@account_name = 'MyMailAccount',
@sequence_number = 1

Step 5

Use the sysmail_add_principalprofile procedure to grant the Database Mail profile access to the msdb public database role and to make the profile the default Database Mail profile.

Please execute the statement below.

EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@profile_name = 'MyMailProfile',
@principal_name = 'public',
@is_default = 1 ;

Step 6

Now let us send a test email from SQL Server.

Please execute the statement below.

declare @body1 varchar(100)
set @body1 = 'Server :'+@@servername+ ' My First Database Email '
EXEC msdb.dbo.sp_send_dbmail @recipients='mak_999@yahoo.com',
@subject = 'My Mail Test',
@body = @body1,
@body_format = 'HTML' ;

You will get the message shown in Fig 1.1.


Fig 1.1

Moreover, in a few moments you will receive the email message shown in Fig 1.2.


Fig 1.2

You may get the error message below, if you haven't run the SQL statements from step 1.

Msg 15281, Level 16, State 1, Procedure sp_send_dbmail, Line 0
SQL Server blocked access to procedure 'dbo.sp_send_dbmail' of
component 'Database Mail XPs' because this component is turned off as part of
the security configuration for this server. A system administrator can enable
the use of 'Database Mail XPs' by using sp_configure. For more information
about enabling 'Database Mail XPs', see 'Surface Area Configuration'
in SQL Server Books Online.

You may see this in the database mail log if port 25 is blocked. Refer Fig 1.3.


Fig 1.3

Please make sure port 25 is not blocked by a firewall or anti virus software etc. Refer Fig 1.4.


Fig 1.4

Step 7

You can check the configuration of the Database Mail profile and account using SQL Server Management Studio by right clicking Database Mail [Refer Fig 1.5] and clicking the Configuration. [Refer Fig 1.6]


Fig 1.5


Fig 1.6

Step 8

The log related to Database Mail can be viewed by executing the statement below. Refer Fig 1.7.

SELECT * FROM msdb.dbo.sysmail_event_log


Fig 1.7
Conclusion

This article has demonstrated step-by-step instructions, with illustrations, how to configure Database Mail and send email from SQL Server."

2009/11/06

CodeProject: Removing HTML from the text in ASP. Free source code and programming help

CodeProject: Removing HTML from the text in ASP. Free source code and programming help:
"Function RemoveHTML( strText ) Dim TAGLIST TAGLIST = ';!--;!DOCTYPE;A;ACRONYM;ADDRESS;APPLET;AREA;B;BASE;BASEFONT;' &_ 'BGSOUND;BIG;BLOCKQUOTE;BODY;BR;BUTTON;CAPTION;CENTER;CITE;CODE;' &_ 'COL;COLGROUP;COMMENT;DD;DEL;DFN;DIR;DIV;DL;DT;EM;EMBED;FIELDSET;' &_ 'FONT;FORM;FRAME;FRAMESET;HEAD;H1;H2;H3;H4;H5;H6;HR;HTML;I;IFRAME;IMG;' &_ 'INPUT;INS;ISINDEX;KBD;LABEL;LAYER;LAGEND;LI;LINK;LISTING;MAP;MARQUEE;' &_ 'MENU;META;NOBR;NOFRAMES;NOSCRIPT;OBJECT;OL;OPTION;P;PARAM;PLAINTEXT;' &_ 'PRE;Q;S;SAMP;SCRIPT;SELECT;SMALL;SPAN;STRIKE;STRONG;STYLE;SUB;SUP;' &_ 'TABLE;TBODY;TD;TEXTAREA;TFOOT;TH;THEAD;TITLE;TR;TT;U;UL;VAR;WBR;XMP;' Const BLOCKTAGLIST = ';APPLET;EMBED;FRAMESET;HEAD;NOFRAMES;NOSCRIPT;OBJECT;SCRIPT;STYLE;' Dim nPos1 Dim nPos2 Dim nPos3 Dim strResult Dim strTagName Dim bRemove Dim bSearchForBlock nPos1 = InStr(strText, '<') Do While nPos1 > 0 nPos2 = InStr(nPos1 + 1, strText, '>') If nPos2 > 0 Then strTagName = Mid(strText, nPos1 + 1, nPos2 - nPos1 - 1) strTagName = Replace(Replace(strTagName, vbCr, ' '), vbLf, ' ') nPos3 = InStr(strTagName, ' ') If nPos3 > 0 Then strTagName = Left(strTagName, nPos3 - 1) End If If Left(strTagName, 1) = '/' Then strTagName = Mid(strTagName, 2) bSearchForBlock = False Else bSearchForBlock = True End If If InStr(1, TAGLIST, ';' & strTagName & ';', vbTextCompare) > 0 Then bRemove = True If bSearchForBlock Then If InStr(1, BLOCKTAGLIST, ';' & strTagName & ';', vbTextCompare) > 0 Then nPos2 = Len(strText) nPos3 = InStr(nPos1 + 1, strText, '</' & strTagName, vbTextCompare) If nPos3 > 0 Then nPos3 = InStr(nPos3 + 1, strText, '>') End If If nPos3 > 0 Then nPos2 = nPos3 End If End If End If Else bRemove = False End If If bRemove Then strResult = strResult & Left(strText, nPos1 - 1) strText = Mid(strText, nPos2 + 1) Else strResult = strResult & Left(strText, nPos1) strText = Mid(strText, nPos1 + 1) End If Else strResult = strResult & strText strText = '' End If nPos1 = InStr(strText, '<') Loop strResult = strResult & strText RemoveHTML = strResult End Function"

'error handling easy... (Try-Catch for VB)

'error handling easy... (Try-Catch for VB): "VBScript example:

Option Explicit

Dim nTest

With New Try: On Error Resume Next
nTest = 1 / 0 'Division by zero
.Catch: On Error GoTo 0: Select Case .Number
Case 11
MsgBox .Description
End Select: End With


Class Try '*** programmed by Robert Einhorn, Budapest, 2008 ***
Private mstrDescription
Private mlngHelpContext
Private mstrHelpFile
Private mlngNumber
Private mstrSource

Public Sub Catch()
mstrDescription = Err.Description
mlngHelpContext = Err.HelpContext
mstrHelpFile = Err.HelpFile
mlngNumber = Err.Number
mstrSource = Err.Source
End Sub

Public Property Get Source()
Source = mstrSource
End Property

Public Property Get Number()
Number = mlngNumber
End Property

Public Property Get HelpFile()
HelpFile = mstrHelpFile
End Property

Public Property Get HelpContext()
HelpContext = mlngHelpContext
End Property

Public Property Get Description()
Description = mstrDescription
End Property
End Class"

2009/03/11

A Rich Text Editor plugin for jQuery

A Rich Text Editor plugin for jQuery: "A Rich Text Editor plugin for jQuery"

A Rich Text Editor plugin for jQuery

You are searching a unbloated Rich Text Editor for jQuery? I have something that will certainly fit your needs.

I have made this Rich Text Editor plugin as simple as possible to be easily changed. The file jquery.rte.js is only 7ko uncompressed, is compatible with major browsers (IE6, Firefox 2, Opera 9, Safari 3.03) and degrade gracefully in a textarea for others.

  1. "submit" />

Google關鍵字行銷專家:關鍵字廣告免費諮詢: Search-Based Keyword Tool @ Google 關鍵字建�

Google關鍵字行銷專家:關鍵字廣告免費諮詢: Search-Based Keyword Tool @ Google 關鍵字建�: "Search-Based Keyword Tool @ Google 關鍵字建議工具"

CodeProject: Bulilding PHP like associative array in ASP. Free source code and programming help

CodeProject: Bulilding PHP like associative array in ASP. Free source code and programming help

Introduction

I am a veteran ASP programming, spending gigabytes of time in prepearing and creating classes using vbscript. Recentely i moved to PHP, it is a greate language. But one thing strikes my mind, why should people pick up php rather than asp. Yes, php engine is greate and efficient, but i found out the key point of php, that is associative array. The asp programmer are frequently using the code snippet like below,

Dim MyList()
Redim MyList (2)
MyList(0)="Sujoy"
MyList(1)="Kumar"
MyList(2)="Roy"

The above code is pretty simple one. I am storing the three parts of my name(First, Middle, Last in that order) . Now in my code if i want to get first name i will write as below

fname=MyList(0)

If i want to add some more values in the list, then when i will use them later like address=MyList(10) it is required to remember the index number 0 or 1 or bla bla, But what if i can use the code the below way

Dim MyList
MyList("fname")="Sujoy"
MyList("address")="3.0 VBScript, Microsft Corp."

Yes, this is an associative array. If you know php you will see, you need to write such type of code at each 5 line.

But how could you do it in ASP. God is here, he had given us "Scripting.Dictionary" object and concept of class. You can do it folks. Lets see to do it.
What is Associative Array?

Well, even though the concept of associative array is not associated with PHP, i will go to explain that staff.

We ASP programmer all new about array, but there we need to use "index" number to access any element. Like the first sample code snippet. But in associative array, things are different. You can access any element of array not only by "index" but by "name". Like you ASP gues rmember that so much used code of "recordset" object like

Set rs=CreateObject("ADODB.RecordSet")
rs.Open (...,"SELECT name FROM list")
name1=rs.Fields("name").Value
name2=rs.Fields(0).Value

Both name1 and name2 will give equal result. So one element can be access by index (0) or name ("name"). when you are bound to use only index, be sure you are using simple poor Array of ASP, but when you can access element by name and index both, you are defininely using Associative Array.

Request.Form is an associative array, if you check its type using "TypeName" method, it will show you "Dictionary" . "Scripting.Dictionary" is the entry point to us, the ASP programmer, to start using associative array.
My Array

Keep an eye on the page, you will get the code that will open up all the window of your imagination. But to keep up with your concentration take a look athe code snippet

Class AssocArray
Private dicContainer

Private Sub Class_Initialize()
Set dicContainer=Server.CreateObject("Scripting.Dictionary")
End Sub

Private Sub Class_Terminate()
Set dicContainer=Nothing
End Sub


Public Default Property Get Item(sName)
If Not dicContainer.Exists(sName) Then
dicContainer.Add sName,New AssocArray
End If

If IsObject(dicContainer.Item(sName)) Then
Set Item=dicContainer.Item(sName)
Else
Item=dicContainer.Item(sName)
End If
End Property

Public Property Let Item(sName,vValue)
If dicContainer.Exists(sName) Then
If IsObject(vValue) Then
Set dicContainer.Item(sName)=vValue
Else
dicContainer.Item(sName)=vValue
End If
Else
dicContainer.Add sName,vValue
End If
End Property
End Class

You can now write

Dim MyList:Set MyList=New AssocArray
MyList("name")("first")="Sujoy"
MyList("name")("last")="Roy"

Happy coding
Few Thought

The domain of using this associative array is endless. Suppose , yo are writing a order procesing page, and want to store the full details of transaction, which may contain 50 fields. Then you have to enter 50 fields in database table. But what if you store that data in associative array. And write a fewline of code which will convert the stored data in an xml formatted string, which can be stored! Similaraly, this data can be fetched later to use again.. Think..
License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here
About the Author
Member 708995



Location: India India

追蹤者

關於我

提供香港新界大埔區中、小學和幼兒園褓母車接送及機場接載服務。歡迎來電查詢!