Google Analytics İzleme

24 Ağustos 2009

Asp.Net'de oturum açan NT kullanıcı adını tespit etme

Getting the User Name :

using three ways we can get the User Name using C#

1) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;

string strName = p.Identity.Name;

[ OR ]

2) string strName = HttpContext.Current.User.Identity.Name.ToString();

[ OR ]

3) string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name

string strName = Request.ServerVariables[5]; //Finding with index

In Above 3 Cases returnin string contains DomainName\WinNTLoggedUserName

(for Ex: Microsoft\Bill.Gates. Here Microsoft is domain Bill.Gates is Logger User Name )

Using string operations seperate the DomainName and UserName.

kaynak:

http://www.codeproject.com/KB/aspnet/How_to_NT_User_Name.aspx


21 Ağustos 2009

Stop running this script? A Script on this page is causing Internet Explorer to run slowly

Aşağıdaki uyarıyı internet explorer'da bir web sayfasında alıyorsanız:
Stop running this script? A Script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Yes / No"

Kütükten çalıştırılacak javascript ifadesinin sayısını yüksek verebilirsiniz. varsayılan olarak 5,000,000' dır.

Do this:

1. Using a Registry Editor such as Regedt32.exe, open this key:
HKEY_CURRENT_USER\Software\Microsoft\InternetExplo rer\Styles

Note If the Styles key is not present, create a new key that is called Styles.
2. Create a new DWORD value called "MaxScriptStatements" under this key and set the value to the desired number of script statements.

HOWEVER whats different is this:

Set the "MaxScriptStatements" Value to DECIMAL, then type 0 to Disable the damn box, Voila! no more "script is taking for too long" box.


kaynak:

How to set time-out period for script: http://support.microsoft.com/kb/175500

http://forums.asp.net/p/1297674/2523672.aspx
http://www.askmehelpdesk.com/internet-web/internet-explorer-stop-running-script-73040.html

ORA-01795: bir listedeki ifadelerin maksimum sayısı 1000'dir

Aşağıdaki hatayı alıyorsanız:
ORA-01795: bir listedeki ifadelerin maksimum sayısı 1000'dir
ORA-01795 Maximum number of expressions in a list is 1000.

Şu adımları uygulayabilirsiniz:
---------------------------------

maximum number of expressions in a list is 1000

Cause: More than 254 columns or expressions were specified in a list.

Action: Remove some of the expressions from the list.

----------------------------------

the problem is purely related to oracle limitations.

One possible workaround would be to split the IN clause in several parts with less than 1000 elements
and concatenate the new IN clauses with OR:

like : SELECT * FROM TableX where (TableX.column IN (?, ..., '<=1000 ?' ) OR TableX.column IN (?, ..., '<=1000 ?' ) OR ...)


------------------------------------

There is a miximum number of elements allowed in an IN list and it is 1000. Go beyond this and you get this error. I suspect toad has generated a query that exceeds this limit.

The two most common approaches to getting around this are:

1) split the workload up such that you never generate more than 1000 items in an IN list (this was suggested already)

2) join to a table that contain the list of values you want. There is no limit with this method as it is a simple join.

Good luck, Kevin

------------------------------------------

-- Instead of having:
s.userId IN (:users)
-- We will have:
(
s.userId IN (:users0) OR
s.userId IN (:users1) OR
... OR
s.userId IN (:usersN)
)

-------------------------

Kaynak:
http://codingwithcoffee.com/?p=121
http://jira.springframework.org/browse/SPR-3396
http://ordba.blogspot.com/