Research into .Net's DirectoryServices namespace and its interaction with ADSI - Active Directory Service Interface. Read up through Safari O'Reilly account (seems to be expired now, I cannot access the full chapter). Recommend this book: The .NET Developer's Guide to Directory Services Programming by Joe Kaplan; Ryan Dunn Begin development of the AD connector that abstracts and return a USER object from AD. This will allow the User object to eventually bind to either an AD or SQL backend.
Monday, 7 January 2008
Monday, 12 November 2007
HTML: Auto Adjust IFRAMEs
Auto Adjust IFRAME
------------------
<iframe name="ifr" id="ifr" src="whatever.html" onload="this.style.height
= ifr.document.body.scrollHeight + 5"></iframe>
OR
<iframe id="ifr" src="ifr.html">< /iframe>< br />
<input type="button" onclick="document.getElementById('ifr').style.height
= ifr.document.body.scrollHeight + 5" value="Ajust" />
------------------
<iframe name="ifr" id="ifr" src="whatever.html" onload="this.style.height
= ifr.document.body.scrollHeight + 5"></iframe>
OR
<iframe id="ifr" src="ifr.html">< /iframe>< br />
<input type="button" onclick="document.getElementById('ifr').style.height
= ifr.document.body.scrollHeight + 5" value="Ajust" />
Sunday, 30 September 2007
TSQL: Delete duplicate rows which have the same primary key
--Delete Duplicate Rows
set rowcount 1
delete from hrerequestforapproval
where hrerequestforapprovalid=40508508
set rowcount 1
delete from hrerequestforapproval
where hrerequestforapprovalid=40508508
TSQL: Get Duplicate Rows Count
--Get Duplicate Row Counts
SELECT hrerequestforapprovalid, count(*)
FROM hrerequestforapproval
GROUP BY hrerequestforapprovalid
HAVING count(*) > 1
SELECT hrerequestforapprovalid, count(*)
FROM hrerequestforapproval
GROUP BY hrerequestforapprovalid
HAVING count(*) > 1
Friday, 24 August 2007
HTML: Mailto with CC, Subject, Body prepopulated
<a href="mailto:your.nominateduser@yahoo.com.au?cc=your.nominateduser@yahoo.com.au&subject=A new request&body=Please kindly complete the details below:%0D%0A%0D%0AName:%0D%0ATitle:%0D%0ALocation:%0D%0APhone:%0D%0AMobile:%0D%0A">Click here to email</a>
Wednesday, 15 August 2007
Javascript: Replacing OnLoad attribute in Body tag
//This section runs the SetPage function when the form loads - replaces OnLoad function in body tag
addLoadEvent(SetPage);
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
//Another example will run when page load but code doesn't utilize onLoad attribute in body tag
var frm = document.frmCreateModifyPosition;
window.onload = function(){
if (frm.txtAction[1].checked){
ShowPositionID()
}
}
addLoadEvent(SetPage);
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
//Another example will run when page load but code doesn't utilize onLoad attribute in body tag
var frm = document.frmCreateModifyPosition;
window.onload = function(){
if (frm.txtAction[1].checked){
ShowPositionID()
}
}
Wednesday, 21 March 2007
TSQL: ALTER TABLE
--Alter table
ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL
ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL
ALTER TABLE doc_exb DROP COLUMN column_b
ALTER TABLE doc_exc ADD column_b VARCHAR(20) NULL CONSTRAINT exb_unique UNIQUE
ALTER TABLE doc_exd WITH NOCHECK ADD CONSTRAINT exd_check CHECK (column_a > 1)
ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL
ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL
ALTER TABLE doc_exb DROP COLUMN column_b
ALTER TABLE doc_exc ADD column_b VARCHAR(20) NULL CONSTRAINT exb_unique UNIQUE
ALTER TABLE doc_exd WITH NOCHECK ADD CONSTRAINT exd_check CHECK (column_a > 1)
Friday, 9 March 2007
TSQL: UPDATE from values across server via Linked Server
You'll need to setup a linked server first in Enterprise Manager. This is found under Security > Linked Servers. Right click and select "New Linked Server", follow prompts to complete.
Update Dest
SET helpdefinitiontext = T.helpdefinitiontext
From
[erokwis99\dev].mis.dbo.measure as Dest Join
mis.dbo.measure as T On
Dest.measureid = T.measureid
Update Dest
SET helpdefinitiontext = T.helpdefinitiontext
From
[erokwis99\dev].mis.dbo.measure as Dest Join
mis.dbo.measure as T On
Dest.measureid = T.measureid
Monday, 30 October 2006
CSS: Display property
| Value | Description |
|---|---|
| none | The element will not be displayed |
| block | The element will be displayed as a block-level element, with a line break before and after the element |
| inline | Default. The element will be displayed as an inline element, with no line break before or after the element |
| list-item | The element will be displayed as a list |
| run-in | The element will be displayed as block-level or inline element depending on context |
| compact | The element will be displayed as block-level or inline element depending on context |
| marker | |
| table | The element will be displayed as a block table (like <table>), with a line break before and after the table |
| inline-table | The element will be displayed as an inline table (like <table>), with no line break before or after the table |
| table-row-group | The element will be displayed as a group of one or more rows (like <tbody>) |
| table-header-group | The element will be displayed as a group of one or more rows (like <thead>) |
| table-footer-group | The element will be displayed as a group of one or more rows (like <tfoot>) |
| table-row | The element will be displayed as a table row (like <tr>) |
| table-column-group | The element will be displayed as a group of one or more columns (like <colgroup>) |
| table-column | The element will be displayed as a column of cells (like <col>) |
| table-cell | The element will be displayed as a table cell (like <td> and <th>) |
| table-caption | The element will be displayed as a table caption (like <caption>) |
Monday, 11 September 2006
REGEX; pattern matching
regular expression to match a U.S. phone number:
\(?\d{3}\)? ?\d{3}[-.]\d{4}
This regex matches phone numbers like "(314)555-4000".
Ask yourself if the regex would match "314-555-4000" or "555-4000".
The answer is no in both cases. Writing this pattern on one line
conceals both flaws and design decisions. The area code is
required and the regex fails to account for a separator
between the area code and prefix.
/
\(? # optional parentheses
\d{3} # area code required
\)? # optional parentheses
[-\s.]? # separator is either a dash, a space, or a period.
\d{3} # 3-digit prefix
[-.] # another separator
\d{4} # 4-digit line number
/x
replace all instances of double quotes with
single - /g option is all instances
replace(/\"/g,'\'')
\(?\d{3}\)? ?\d{3}[-.]\d{4}
This regex matches phone numbers like "(314)555-4000".
Ask yourself if the regex would match "314-555-4000" or "555-4000".
The answer is no in both cases. Writing this pattern on one line
conceals both flaws and design decisions. The area code is
required and the regex fails to account for a separator
between the area code and prefix.
/
\(? # optional parentheses
\d{3} # area code required
\)? # optional parentheses
[-\s.]? # separator is either a dash, a space, or a period.
\d{3} # 3-digit prefix
[-.] # another separator
\d{4} # 4-digit line number
/x
replace all instances of double quotes with
single - /g option is all instances
replace(/\"/g,'\'')
Subscribe to:
Posts (Atom)