Skip to main contentdfsdf

Tarik Guney's List: Programming

  • Nov 03, 09

    In software engineering,
    the singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects (say, five). Some consider it an anti-pattern, judging that it is overused, introduces unnecessary limitations in situations where a sole instance of a class is not actually required, and introduces global state into an application.

    • Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program's operation if properly and appropriately used. The opposite of lazy loading is Eager Loading.
  • Nov 09, 09

    Static constructors in C# programming language.

    • A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only. It is called automatically before the first instance is created or any static members are referenced.
    • A static constructor does not take access modifiers or have parameters.

    2 more annotations...

  • Nov 09, 09

    In computer science, a binary tree is a tree data structure in which each node has at most two children. Typically the first node is known as the parent and the child nodes are called left and right. In type theory, a binary tree with nodes of type A is defined inductively as TA = μα. 1 + A × α × α. Binary trees are commonly used to implement binary search trees and binary heaps.

    • Not to be confused with B-tree.
  • Nov 09, 09

    Lazy initialization is primarily used to improve performance, avoid wasteful computation, and reduce program memory requirements

    • Basic) methods for lazy init
    • The XElement class (declared in System.Linq.XML) provides a Load method that can retrieve an XML data from a url with GET  method:
  • Dec 19, 09

    Hidden features of Javascript, the popular client side programming language.

    • Ajax is a popular term used to describe asynchronous (versus synchronous)  requests made from the client to the server. In JavaScript, Ajax requests  are handled using the XMLHttpRequest object, which lets you open a  connection, send the request, then handle the data returned by the server  seamlessly in the background.
  • Dec 21, 09

    Dave Ward shows us how to pass json Objects to Asp.net and create their counterparts on server which makes creating things easily on asp.net part.

    • One unfortunate anti-pattern that often emerges in this situation is a service method with too many parameters:
  • Dec 21, 09

    How to get ClientID property in asp.net inline scripting to avoid complex asp.net clientid scheme.

    • The better solution is to use inline ASP.NET code to inject the control’s ClientID property:
    • $get('<%= TextBox1.ClientID %>')
  • Dec 23, 09

    How to pass anon methods via Delegate. This article shows this in an easy way.

    • Creating anonymous methods is essentially a way to pass a code block as a delegate parameter
  • Dec 23, 09

    Creating custom Events in Javascript to decouple your projects code.

  • Dec 25, 09

    This article simply shows how to call Synchronous methods Asyncly.

    • If the asynchronous call has not completed, EndInvoke blocks the calling thread until it completes
    • Most people are familiar only with the high level frameworks like WebForms and WebServices which sit at the very top level of the ASP.NET hierarchy.
    • WebForms are definitely the easiest way to build most Web interfaces, but if you’re building custom content handlers, or have special needs for processing the incoming or outgoing content, or you need to build a custom application server interface to another application, using these lower level handlers or modules can provide better performance and more control over the actual request process. With all the power that the high level implementations of WebForms and WebServices provide they also add quite a bit of overhead to requests that you can bypass by working at a lower level.

    57 more annotations...

  • Jan 06, 10

    Different use of 'default' keyword in C#. It is also used for distinguishing whether a type is value type or reference type and also getting the default value of a variable by its type.

  • Mar 10, 10

    With the number of publicly offered Web service APIs, it's now much easier to get content from different Web sources and to build mashups—if you have access to the right APIs and tools. Discover how you can combine an obscure cross-domain call technique (JSONP) and a flexible JavaScript library (jQuery) to build powerful mashups surprisingly quickly.

    • The same-origin policy prevents  a script loaded from one domain from getting or manipulating properties of  a document from another domain. That is, the domain of the requested URL  must be the same as the domain of the current Web page. This basically  means that the browser isolates content from different origins to guard  them against manipulation. This browser policy is quite old and dates back  to Netscape Navigator 2.0.
    • One relatively simple way to overcome  this limitation is to have the Web page request data from the Web server  it originates from, and to have the Web server behave as a proxy relaying the  request to the actual third-party servers. Although widely used, this  technique isn't scalable. Another way is to use frame elements to create  new areas in the current Web page, and to fetch any third-party content  using GET requests. After being fetched, however, the  content in the frames would be subject to the same-origin policy limitations.

         

      A  more promising way to overcome this limitation is to insert a dynamic  script element in the Web page, one whose source is pointing to the service  URL in the other domain and gets the data in the script itself. When the  script loads, it executes. It works because the same-origin policy doesn't  prevent dynamic script insertions and treats the scripts as if they were  loaded from the domain that provided the Web page. But if this script  tries to load a document from yet another domain, it will fail.  Fortunately, you can improve this technique by adding JavaScript Object  Notation (JSON) to the  mix.

    5 more annotations...

1 - 18 of 18
20 items/page
List Comments (0)