My own personal opinions and thoughts.

The content represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way. And while you are here, check out my photo gallery and projects page... ;D

Chase Jarvis TECH: Complete Workflow for Photo and Video

Chase Jarvis TECH: Complete Workflow for Photo and Video

Without a doubt, one of our most popular posts of 2010 has been this post where we outline in detail our photo and video workflow from capture to delivery of digital assets to clients.

(Source: blog.chasejarvis.com)

ipad + “Eye of the Tiger”

Eye of the Tiger by Survivor. All instruments were played using ipad applications downloaded from itunes.

Web

What’s HTML5 and Why We Should All Care

HTML5 is on the tip of every tech guru’s tongue these days. So what is it? How does it relate to Flash? How does it impact your site? All is answered in this helpful infographic from Focus. This handy printable reference help you understand the possibilities that HTML5 brings. You’ll learn how it works, how the major browsers support it and where it’s headed.

Learn who will own the web’s interactive future. Is it Flash? HTML5? Get the Full image.

ASP.NET Padding Oracle Attack (Demo)

In this video, researchers Juliano Rizzo and Thai Duong demonstrate the technique they developed for stealing cryptographic keys for ASP.NET Web applications, enabling them to compromise virtually any app built on ASP.NET.

You can read the full story of their attack in this article, “Padding Oracle Attack Affects Millions of ASP.NET Apps.”

Some great references:
http://visualstudiomagazine.com/articles/2010/09/14/aspnet-security-hack.aspx
http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3332

Microsoft Security Advisory (2416728)
Vulnerability in ASP.NET Could Allow Information Disclosure
http://www.microsoft.com/technet/security/advisory/2416728.mspx

700x208_forrst-696x208

Forrst invites

I have received invites from Forrst website and Iím looking for some great people to donate them.

What is Forrst?

Forrst is a place for designers and developers to share screenshots, links, code , and questions with their peers. Itís an online community for the web industry and a great place to showcase your work, as well as getting help and getting feedback on your work.

Getting an invite

As the title suggests, I have 8 (update: 13) invites available for Forrst, all I need from you is a link to your portfolio, or latest work, and I will soon announce the 8 (update: 13) lucky people to get invites!

DataBinder (increase performance)

DataBinder.Eval method saves you from writing complex expressions, but using this method does impose a performance penalty on your code, because all the work it does is late-bound. If we want the fastest possible code, you can replace calls to DataBinder.Eval with explicit casts.

For example:

< %# DataBinder.Eval(Container.DataItem, “myField”,“{0:c}”) %>

An equivalent expression using casts would be this:

< %# String.Format(“{0:c}”,(CType(Container.DataItem,DataRowView)(“myField”))) %>

Synchronize Method in dotNet c#

Synchronized methods give us an ability to execute only one thread at a time. This is useful if our method modifies global variable. The program will carry out request of user one, other user request will wait. After first request is carried out, second request will be handled.

In Java World:

public synchronized void SomeMethod() {
	// synchronized code

}
public void SomeMethod() {
	// trivial code  
	StringWriter swr = new StringWriter(params);

 
	Synchronized(swr){
	     // synchronized code
	}
}

In DotNet Word:

[MethodImpl(MethodImplOptions.Synchronized)]

public void SomeMethod() {
	// synchronized code
}
public void SomeMethod() 

{
	// trivial code 
	StringWriter swr = new StringWriter(params);
 
	lock(swr) {
	// synchronized code

	}
}

Personally, I don’t like the implementation of MethodImpl as it locks this or typeof(Foo) – which is against best practice.

In the next example, both lock(this) and MethodImplOptions.Synchronized do the same thing – they lock against the object.This is why MethodImplOptions.Synchronized should be avoided.

[MethodImpl(MethodImplOptions.Synchronized)]
public void SomeMethod() {
	// synchronized code
}

– same as –

public void SomeMethod()
{
	lock(this) {
	// synchronized code

	}
}

Registering a Virtual Path Provider

Unlike most providers, the Virtual Path provider is not registered through the web.config file. You can register the VPP through the Application_Start event in Global.asax or adding the static method AppInitialize into a class located in the App_Code directory.

public static class WebAppStart
{
 public static void AppInitialize()
 	{
  		MyVirtualPathProvider vpp = new MyVirtualPathProvider();
  		HostingEnvironment.RegisterVirtualPathProvider(vpp);
  	}
}

You will get one compilation error if you have multiple static methods with the same name (AppInitialize) in different classes in the App_Code directory.

ASP.NET + JavaScript

The .NET Platform came to facilitate the development of web pages but when we interact on the client-side we have to use the JavaScript language.

The JavaScript is the “only” help, and no doubt crucial, as regards the interaction with the client (client-side). Often we use JavaScript to avoid “PostBack“, less trips to the server.

It is also good for better usability. Who has not made the use of cookies (client-side) to improve usability?

As an example, I leave here a function, which I think it¥s very simple to understand and useful, which means that our “friends” Robots can not “eat” our emails published on the Web. Simple but effective!

<html>
    <head>
        <title>Test</title>
        <script language="JavaScript" type="text/javascript">

            function antispam(name,domain) {
                document.location = "mailto:" + name + "@" + domain;
            }
 
        </script>
    </head>
    <body>

           <p>O meu email È <a href="javascript:antispam('nome','dominio.net');">este</a></p>
    </body>
</html>

Looking Ahead to C# 4.0: Optional and Named Parameters

Bill Wagner has explored two related upcoming features in the C# language: named and optional parameters. These features were added to the language to support COM interoperability, specifically COM interoperability with Microsoft Office.

For a variety of historical reasons, Office COM APIs have large numbers of parameters, several of which have reasonable defaults. In addition, while you may want to use many of the defaults, you may need to specify a value for some of the parameters later in the list. It would be great to call those Office methods having 15 or more parameters by only specifying those parameters where you want something other than the default. Optional and named parameters enable that for you in C# 4.0.

Named and Optional Parameters Explained
Named parameters allow you to call a method by specifying which argument in a method call refers to which formal parameter. Suppose someone had written this trivial Subtract method:

public static int Subtract(int left, int right)
{
return left - right;
}

All three of these calls are equivalent:

result = Subtract(7, 5);
result = Subtract(left: 7, right: 5);

result = Subtract(right: 5, left: 7);

If you don’t specify a name for any of the parameters, the normal order is used. Notice that you can rearrange the order of the parameters by specifying them by name.

Optional parameters enable you to specify a default value for any parameter to a method. Any parameters that have default values must be at the end of the argument list. Optional parameters must be compile-time constants.

One of the things I like the most about named parameters is that you can improve the readability of code.

Please read the complete article here:
Visual Studio Magazine : Looking Ahead to C# 4.0: Optional and Named Parameters

Back to Top