background preloader

Web development - The Definitive Guide To Forms based Website Authentication

Web development - The Definitive Guide To Forms based Website Authentication

best practices - What should every programmer know about web development .net - How to get compatibility between C# and SQL2k8 AES Encryption Solutions: Add InvalidHandler after jQuery validator initialization If you have a problem where you need to add the option 'invalidHandler' to your jqueryValidate (jQuery Validation Plugin) after it has been initialized, this is how it can be done:$(document).ready(function(){ $("#contactForm").bind('invalid-form.validate', function(event, validator) { alert('validation failed!'); } );}); Note: invalidHandler will be called when validation of form fails on submit (e.g. values for a field is missing or such). This might work for other options of the jqueryValidate plugin, but I'm not sure which property to use. I found the property to bind to in the jquery.validate.js file, you might want to look there.

Avoiding common HTML5 mistakes Between curating sites for the HTML5 gallery and answering readers’ questions here at HTML5 Doctor, I see a host of HTML5 sites and their underlying markup. In this post, I’ll show you some of the mistakes and poor markup practices I often see and explain how to avoid them. Don’t use section as a wrapper for styling One of the most common problems I see in people’s markup is the arbitrary replacement of <div>s with HTML5 sectioning elements — specifically, replacing wrapper <div>s (used for styling) with <section>s. In XHTML or HTML4, I would see something like this: <! Now, I’m instead seeing this: <! Frankly, that’s just wrong: <section> is not a wrapper. With that in mind, here’s the correct way to mark up the above example using HTML5 and a couple of ARIA roles. <body> <header> <h1>My super duper page</h1> <! If you’re not quite sure which element to use, then I suggest you refer to our HTML5 sectioning content element flowchart to guide you along your way. Ah, <figure>. <! Summary

SQL Server EncryptByKey cryptographic message description - SQL Server Security Since the introduction of SQL Server 2008 extensible key management (EKM), new opportunities may arise to handle data encryption on the client while still making the plaintext data accessible to authorized users in SQL Server. One issue between SQL Server and third party clients has been already discussed in the SQL Server Security forum in the past: describing the cryptographic message elements used by the resulting ciphertext generated by EncryptByKey builtin. While we are in the process of finalizing our documentation regarding this subject matter, I would like to take this opportunity to bring you an early draft view of the information and to get your feedback.. Below I will explain each one of the parts of the message along with an example. Notice that in all cases we are using little-endian byte ordering. CipherTextMessage := KeyGUID + EncryptionHeader + EncryptedMessage KeyGUID := {16 bytes} Key_guid. EncryptionHeader := Headerversion + ReservedBytes Detailed analysis of each field:

wordnik/swagger-core - GitHub HTML5 Canvas Tutorials Secure Salted Password Hashing - How to do it Properly If you're a web developer, you've probably had to make a user account system. The most important aspect of a user account system is how user passwords are protected. User account databases are hacked frequently, so you absolutely must do something to protect your users' passwords if your website is ever breached. The best way to protect passwords is to employ salted password hashing. This page will explain why it's done the way it is. There are a lot of conflicting ideas and misconceptions on how to do password hashing properly, probably due to the abundance of misinformation on the web. IMPORTANT WARNING: If you are thinking of writing your own password hashing code, please don't!. If for some reason you missed that big red warning note, please go read it now. You may use the following links to jump to the different sections of this page. What is password hashing? Hash algorithms are one way functions. The user creates an account. How Hashes are Cracked Adding Salt Salt Reuse Short Salt

taggable Note: Latest release and documentation are available from extension GitHub page. This extension allows active record model to manage tags. Resources ¶ Discuss Documentation ¶ Taggable Behavior Allows active record model to manage tags. Installation and configuration ¶ Create a table where you want to store tags and cross-table to store tag-model connections. In your ActiveRecord model define behaviors() method: For using AR model for tags (for example, to bind custom behavior), use EARTaggableBehavior. To do it add following to your config: return array( 'import'=>array( 'application.models.*', 'application.components.*', 'ext.yiiext.behaviors.model.taggable.*', ), ); In your AR model implement behaviors() method: function behaviors() { return array( 'tags_with_model' => array( 'class' => 'ext.yiiext.behaviors.model.taggable.EARTaggableBehavior', 'tagTable' => 'Tag', 'tagModel' => 'Tag', ) ); } Methods ¶ setTags($tags) ¶ Replace model tags with new tags set. addTags($tags) or addTag($tags) ¶ getTags() ¶

Learning Three.js Walden's Blog: Computing MD5 Hash of varbinary(max) in SQL Server CLR SQL Server provides the HASHBYTES function which computes the MD5 hash value of the bytes passed to it with one problem... it only accepts the older (pre-2005) max length of 8000 bytes in a varbinary. That's useful, I suppose, if you're trying to get the MD5 hash of a password, or a name, but completely useless in a case like I had where we needed to compute the MD5 hash of a blob column -- and a blob colum where the max datalength is dozens if not hundreds of megabytes. I needed something different! Our first pass was to write a command line application that selected the filedata column (the blob) from the table and then just computed the MD5 from w/in c#. If you haven't played with them, SQL CLR functions allow you to code a static method in your .Net language of choice (C#!) My first pass looked like the code below. As proof of why you should test corner cases two things happened in production. OK, now there's a new problem.

CActiveRecord Look up a class, method, property or event CActiveRecord is the base class for classes representing relational data. It implements the active record design pattern, a popular Object-Relational Mapping (ORM) technique. Please check the Guide for more details about this class. Protected Methods Hide inherited methods Events Hide inherited events Property Details Returns all column attribute values. commandBuilder Returns the command builder used by this AR. the default database connection for all active record classes. Returns the database connection used by active record. Returns the query criteria associated with this model. Returns if the current record is new. Returns the meta-data for this AR Returns the old primary key value. Returns the primary key value. Returns the table alias to be used by the find methods. Returns the metadata of the table that this AR belongs to Method Details Source Code:framework/db/ar/CActiveRecord.php#210 (show) return parent::__call($name,$parameters);} $this->init();

Related: