When you try to get the height of an element that does not exist yet elem.style.height won't work.
So this is how it should be retreived:
document.getElementById('elem_name').offsetHeight;
Tuesday, January 11, 2011
Friday, January 7, 2011
learn c++
Code analyser c# and c++:
http://cppcheck.sourceforge.net/manual.pdf
https://secure.wikimedia.org/wikipedia/en/wiki/List_of_tools_for_static_code_analysis
http://articles.techrepublic.com.com/5100-10878_11-5034931.html
fxcop:
http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=553
stylecop
http://stylecop.codeplex.com/
Books
http://www.amazon.com/dp/0201749629/?tag=stackoverfl08-20
Effective C++: 50 Specific Ways to Improve Your Programs and Design (2nd Edition) (Addison-Wesley Professional Computing Series
Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
http://cppcheck.sourceforge.net/manual.pdf
https://secure.wikimedia.org/wikipedia/en/wiki/List_of_tools_for_static_code_analysis
http://articles.techrepublic.com.com/5100-10878_11-5034931.html
fxcop:
http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=553
stylecop
http://stylecop.codeplex.com/
Books
http://www.amazon.com/dp/0201749629/?tag=stackoverfl08-20
Effective C++: 50 Specific Ways to Improve Your Programs and Design (2nd Edition) (Addison-Wesley Professional Computing Series
Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
Thursday, December 30, 2010
javascript print function
function printbyid(sId) {
var oPrn = document.getElementById(sId);
var oWin = window.open('', "quickprint");
oWin.document.writeln(oPrn.innerHTML);
oWin.document.close();
oWin.focus();
oWin.print();
oWin.close();
}
< div id="sprint" >
....
< / div >
< input type="button" value="Printeaza Raport" onclick="printbyid('sprint');" / >
var oPrn = document.getElementById(sId);
var oWin = window.open('', "quickprint");
oWin.document.writeln(oPrn.innerHTML);
oWin.document.close();
oWin.focus();
oWin.print();
oWin.close();
}
< div id="sprint" >
....
< / div >
< input type="button" value="Printeaza Raport" onclick="printbyid('sprint');" / >
Search stored procedures with some words
select object_name(id),* from syscomments where text like '%IBAN%'
cautare fisiere pe hard-disk
create table #Exista (Id int, Filepath varchar(512), Exista bit)
insert into #Exista(ID,FilePath)
select Id, replace(FilePath,'/','') from Document where TipDocumentaFK = 16 and DocTemplateFK <>21
create table #Res (ExistaFis bit, EsteDir bit,ExistaParinte bit)
declare @Id int, @filePath varchar(512), @res bit
declare crs cursor for select Id, FilePath from #Exista
open crs
fetch next from crs into @Id, @filePath
while @@fetch_status = 0
begin
set @res = -1
truncate table #Res
insert into #Res exec master..xp_fileexist @filePath
select @res = ExistaFis from #Res
if @res <> - 1
update #Exista set Exista = @res where Id = @Id
fetch next from crs into @Id, @filePath
end
close crs
deallocate crs
select * from #Exista where Exista = 0
insert into #Exista(ID,FilePath)
select Id, replace(FilePath,'/','') from Document where TipDocumentaFK = 16 and DocTemplateFK <>21
create table #Res (ExistaFis bit, EsteDir bit,ExistaParinte bit)
declare @Id int, @filePath varchar(512), @res bit
declare crs cursor for select Id, FilePath from #Exista
open crs
fetch next from crs into @Id, @filePath
while @@fetch_status = 0
begin
set @res = -1
truncate table #Res
insert into #Res exec master..xp_fileexist @filePath
select @res = ExistaFis from #Res
if @res <> - 1
update #Exista set Exista = @res where Id = @Id
fetch next from crs into @Id, @filePath
end
close crs
deallocate crs
select * from #Exista where Exista = 0
Foreach printre baze de date
create table #tmpUse (
ProcName varchar(128),
DBName varchar(128)
)
EXEC master.sys.sp_MSforeachdb "USE [?];insert #tmpUse select object_name(id),db_name() from syscomments where lower(text) like '%opendatasource%'"
select object_name(id), * from syscomments where lower(text) like '%opendatasource%'
select object_name(id), * from syscomments where lower(text) like '%openrowset%'
select object_name(id), * from syscomments where lower(text) like '%openquery%'
ProcName varchar(128),
DBName varchar(128)
)
EXEC master.sys.sp_MSforeachdb "USE [?];insert #tmpUse select object_name(id),db_name() from syscomments where lower(text) like '%opendatasource%'"
select object_name(id), * from syscomments where lower(text) like '%opendatasource%'
select object_name(id), * from syscomments where lower(text) like '%openrowset%'
select object_name(id), * from syscomments where lower(text) like '%openquery%'
Sunday, December 19, 2010
Subscribe to:
Posts (Atom)