Skip to main content

Posts

Enable Audit Record in Sql server

Command in Sql Server Master database USE MASTER GO CREATE SERVER AUDIT audit_test                                           TO FILE (FILEPATH = 'G:\') GO CREATE SERVER AUDIT SPECIFICATION audit_test_spec       FOR SERVER AUDIT [audit_test] ADD (FAILED_LOGIN_GROUP), ADD (SUCCESSFUL_LOGIN_GROUP) WITH (STATE=ON) GO Now check in Security-> Audit -> Audit log

How to find the active SQL connections and kill them

Find Active connections in sql server select     db_name(dbid) as [Database Name],     count(dbid) as [No Of Connections],     loginame as [Login Name] from     sys.sysprocesses where     dbid > 0 group by     dbid, loginame How to kill a SQL connection set nocount on declare @databasename varchar(100) declare @query varchar(max) set @query = '' set @databasename = 'xxx' if db_id(@databasename) < 4 begin print 'system database connection cannot be killeed' return end select @query=coalesce(@query,',' )+'kill '+convert(varchar, spid)+ '; ' from master..sysprocesses where dbid=db_id(@databasename) if len(@query) > 0 begin print @query exec(@query) end Thanks

New Smartphone with 12GB RAM, 1TB storage unveiled

Here is the News -- Turing Robotics Industries (TRI) has unveiled its latest smartphone - the Turing Phone Cadenza. It comes with 'Voice On' technology which enables the smartphone to be switched On/Off using voice commands. Users can also use these voice commands for biometric authentication. The Turing Phone Cadenza features a 5.8-inch Quad HD display of 1440x2560 pixel resolution. It is powered by not one, but two Qualcomm Snapdragon 830 (even though the same hasn't been officially announced) CPUs paired with a an astonishing 12GB of RAM and 1TB of internal storage. The storage can be further expanded up to 500GB by installing a microSD card. The Cadenza runs Turing's own Swordfish OS with deep learning Artificial Intelligence (AI) features a 60MP rear camera with IMAX 6K recording facility and a 20MP dual-front camera. Users can install up to 4 sim cards in the smartphone and it houses a huge 100Wh battery with graphene and hydrogen fuel cells.  In related ne...

How to put delay before doing an operation in WPF

Here is the code : The call to Thread.Sleep is blocking the UI thread. You need to wait asynchronously. Method 1: use a DispatcherTimer tbkLabel . Text = "two seconds delay" ; var timer = new DispatcherTimer { Interval = TimeSpan . FromSeconds ( 2 ) }; timer . Start (); timer . Tick += ( sender , args ) => { timer . Stop (); var page = new Page2 (); page . Show (); }; Method 2: use Task.Delay tbkLabel . Text = "two seconds delay" ; Task . Delay ( 2000 ). ContinueWith ( _ => { var page = new Page2 (); page . Show (); } ); Method 3: The .NET 4.5 way, use async/await // we need to add the async keyword to the method signature public async void TheEnclosingMethod () { tbkLabel . Text = "two seconds delay" ; await Task . Delay ( 2000 ); var page = new Page2 (); page . Show (); }

im2col function in MATLAB explanation

Let us suppose we have A=[1 1;2 2] 1 1 2 2 ... ok Now img2col syntax  == im2col(A,[m n],block_type) Where block type = ('distinct','sliding') distinct places 0's in the final output,,,for padding, sliding,,repeats from the very first matrix element. after all elements read out. Now.. Now [m n] -- very important .... Number of Rows to show = M*N (if m=2 ,, n=2 then each column has 4 elements..) and Number of element fetch to repeat is M in row... That means,, OUTPUT OF THIS - im2col(A,[2 2], 'sliding') ans =      1      2      1      2 -- if  A=[1 1 1;2 2 2] A =      1     1     1      2     2     2 then im2col(A,[2 2], 'sliding') ans = contains 4 rows....as 2*2 ...   and fetch 2 elements as M=2 here... and slidin...