Kayıtlar

Dynamic keyword in the asp.net views

Suppose you need to write a view that displays a list of Album instances. One possible approach is to simply add the albums to the view data dictionary (via the ViewBag property) and iterate over them from within the view. For example, the code in your Controller action might look like this: 1 2 3 4 5 6 7 8 public ActionResult List () { var albums = new List<Album>(); for ( int i = 0 ; i < 10 ; i++) { albums.Add( new Album {Title = "Product " + i}); } ViewBag.Albums = albums; return View (); } In your view, you can then iterate and display the products, as follows: 1 2 3 4 5 <ul> @foreach (Album a in (ViewBag.Albums as IEnumerable <Album> )) { <li> @a.Title </li> } </ul> Notice that we needed to cast ViewBag.Albums (which is dynamic) to an IEnumerable before enumerating it. We could have also used the dynamic keyword here to clean the view code up, but we would have lost the benefi t of IntelliSense when accessing the pr...

Threads Affect Scalability güzel bir konu

Resim
Bu alıntıyı bu kitaptan yaptım. Buradan satın alabilirsiniz Link  İşimizin can alıcı noktasına çok değerli bir açıklama ile örnek vermiş. Bir sistemin nasıl çalıştığını bilirseniz size dönüşü sıradışı sonuçlar olacaktır. Her developerın bilmesi gereken bir iş akışı. Aksi hal performans arttıracam derken tahayyülün iğvasına dönüşebilir. Threads Affect Scalability  I’ve noticed that many large sites end up spending a lot of effort optimizing their systems in the wrong places. As an example, let’s say that you’re building a one-page site that should support 1,200 simultaneous users, with a response time of one second or less, and you have plans to scale-up later on to 120,000 users. During load testing, you reach your maximum acceptable response time after reaching 120 simulated users on a single CPU, and the CPU is 24% busy. As you increase the load, you find that CPU use stays the same, but response time increases. By the time you reach 1,200 users, response time is ten...

Belgesel var belgesel var

bobiler.örg 'den Gönderi

Son tatil yolculuk rotası 2936 km

Daha Büyük Görüntüle

Sunucu üzerinde anlık bağlantıyı görmek istersek

netstat -an|find /c /v  "ok"

Resim dosylarını runtime olarak çevirmek için servis

http://proxy.boxresizer.com/convert?resize=462x338&source=[imagepath]

Binary resim dosyasını fiziksel hale getirmek için

var fs = new BinaryWriter ( new FileStream ( @"C:\\tmp\\" + filename + ".ico" , FileMode . Append , FileAccess . Write )); fs . Write ( imageByteArray ); fs . Close ();