In many applications you have the need to set users privileges , and while there are many ways to do so, I prefer to using a single integer value to store a users privileges on any single entity.
This has many advantages,
- you only have a single value representing all privileges
- you can add and remove available privileges without altering the schema/entity model/storage logic
- checking for privileges are very simple
Read the rest of this entry »
Posted by oyvind.kinsey on November 17th, 2009 under programmingTags: binary, bitwise, Javascript, privileges • 10 Comments
When building complex web applications it is often necessarry to restrict the user to keeping only a single instance open, and to do this you need to check for the precense of an existing instance, either directly or indirectly.
Read the rest of this entry »
Posted by oyvind.kinsey on November 15th, 2009 under programmingTags: Javascript, Single instance • 1 Comment
The nice people at Packt Publishing has asked me to do a book review of Jorge Ramons “Ext JS 3.0 Cookbook“.
According to the book description the following subjects will be covered
- Work with different browsers, platforms, and the DOM, as well as determine and understand the different ExtJS data types
- Create your own custom Ext JS data types as you extend their functionality
- Build great-looking and friendly forms by using client and server-side field validation, form loading, submission, field customization, and layout techniques
- Explore the different layouts provided by the Ext JS library as well as create your own, and understand their common uses
- Display, edit, and group tabular data generated by the server using Grid Panels
- Explore the advantages and the efficiency tradeoffs of widgets such as Combo boxes
- Use the drag and drop features of the grid component, data editing with the new RowEditor Class, and the new lightweight ListView component
- Explore multiple ways of displaying master-details relationships
- Group components or information under the same container to build hierarchical views of information by using TabPanel components
- Use patterns to build a solid and flexible application architecture and implement additional design patterns such as auto-saving form elements, component state management, and code modules to build robust and flexible applications with Ext JS
- Build your own custom components on top of the Ext framework and enhance the custom components created by the Ext JS users’ community
I’m looking forward to this as Ext and JavaScript are two things that I am quite passionate about
Posted by oyvind.kinsey on November 11th, 2009 under programmingTags: book review, extjs, Javascript • No Comments
Most of my web based projects consist of WCF driven webservices at the backend and a javascript UI using ExtJS, and for access to the WCF webservice I like to use its automatically generated proxies as this abstracts away the feeling of working with XMLHttpRequests, actually it abstracts it to a level where you can call the server side method ‘directly’, specifying only a callback function that should receive the response. These proxies are dynamically generated and will always reflect the serverside methods signature.
Read the rest of this entry »
Posted by oyvind.kinsey on October 28th, 2009 under UncategorizedTags: asp.net ajax, Ext Js, Javascript, proxy, svc, wcf, webservices • No Comments
Today I needed to upgrade the software on my Nokia N97, and was prompted by the Nokia software to download and run NokiaSoftwareUpdaterSetup_en.exe.
The only thing was, this just exited with a message saying unsupported platform or something. I quickly tested if the exe file was an archive and discovered I could unpack it with 7-Zip. Inside the resulting directory, in a folder named Installer, I found a file called Configuration.icf, and in this a line with the string
TargetOSs=winXP,winVista
I added ‘,win7′ on a hunch and ran Installer.exe, and what do you know, it worked
Posted by oyvind.kinsey on October 27th, 2009 under UncategorizedTags: hack, n97, nokia • 20 Comments
The newest version of easyXDM (v1.5.3) now includes two new classes, the easyXDM.WidgetManager, and easyXDM.Widget.
These make it extremely easy to make mashups based on the subscribe/publish architecture.
Read the rest of this entry »
Posted by oyvind.kinsey on September 6th, 2009 under easyXDM, programmingTags: easyxdm, Javascript, widgets • 2 Comments
easyXDM is a javascript library that uses available techniques to provide a means of transporting messages and/or method calls between windows in different domains, in short, by-passing the same-origin policy and letting you call methods across the domain boundry.
This is perfect if you plan to provide a client-side API (e.g Facebook Connect) on your web site as you can expose a method in as little as 7 lines of code.
var remote = new easyXDM.Interface({}, {
local: {
doMagic:{
method: _privateMethod
}
}
});
This can be consumed by a client by using
var remote = new easyXDM.Interface({
local: "../hash.html",
remote: "http://apiprovidersdomain.com/api.html"
},{
remote: {
doMagic: {}
}
});
and can then be called by using
remote.doMagic('argument1',2,function(result){
alert(result)
}
In this CodeProject article I present an example on how easy it is to do this, and in the extensive documentation there are links to several demos showing everything from sending simple strings to letting two applications from different domains send arbitrary objects back and forth, even using older browsers like IE6.
The demos are repeated here
Read the rest of this entry »
Posted by oyvind.kinsey on August 20th, 2009 under easyXDM, programmingTags: AJAX, cross-domain, easyxdm, easyxss, Javascript, rpc, xss • 87 Comments
Please see easyXDM for updated info!
I’ve just completed the first version of my cross-site scripting library easyXSS. It is available at http://code.google.com/p/easyxss/ under a MIT-license.
As it is now it supports simple messaging between windows of different domains, but it also supports proxying method calls and results between them making it well-suited for creating API’s.
I’ve prepared several examples and demo’s at http://code.google.com/p/easyxss/ and look forward to getting feedback!
Read the rest of this entry »
Posted by oyvind.kinsey on June 24th, 2009 under easyXDM, programming, UncategorizedTags: cross-site, easyxss, Javascript, Security, xss • 12 Comments
I just remembered that I had made a decent Ext based calendar (extending Ext.Panel).
You can view a demo of it here.
The calendar supports loading data through a Ext.data.Store, d’n'd of timespans, events for handling d’n'd, editing etc.
Posted by oyvind.kinsey on February 27th, 2009 under programming, UncategorizedTags: Calendar, Ext Js • 22 Comments
Those of you who have taken a look at the new chart controls might have seen that there are multiple ways of rendering these in ASP.NET.
Since my apps (ajax based, no updatepanels etc) use generic httpHandlers for these kind of things, I went looking for the ‘httphandler way’ of rendering the chart controls – but it does not exist..
So I whipped out reflector and took a look at the chart class, and found the three lines needed for doing this
Read the rest of this entry »
Posted by oyvind.kinsey on November 13th, 2008 under programming, UncategorizedTags: .Net, Chart Controls • 7 Comments