Jquery DataTables
икона за подаръкA very useful jquery plugin to display data.
икона за подаръкA very useful jquery plugin to display data.
After getting started with ASP.net MVC , watching the tutorials I ended up creating quite few “Hello world” MVC applications. Then added few database into it. It seemed cool and easy. But going a bit beyond hello world, there is a different wild world of techniques and technologies.Trying to find some best practices I got started from here.
Things I like to do with default generated MVC code from Visual studio:
I use Windsdor Castle that can be found here . The tutorial there will show how to add Windsdor IOC controller to the MVC 3 application. It shows how to download and reference Windsdor but I prefer Nuget way.
There is a Windsdor way of plugging in Log4Net. Its package can be referenced using nuget :
Then after creating necessary installer class for Log4Net, a log4net.config file and its related table can be created from here.
I like membership framework for creating login.The default template has sample code for register/login.But sometimes it is not enough, you may use your own login while extending from MembershipProvider.
In one of the small MVC projects I had some data models created from Model First approach. Till some point the output data required was in same format as the Entities but then the requirements started changing. At that point, it did not made much sense to change the database itself but rather use an adapter. So as a rule, the models that Views use are separate from the models that EF uses. It also helps to avoid some problems that occurs when using data models entities directly as View model.
View < – > ViweModel < …….. > Data Model <-> Database
.. more to be added.
Scenario: QR images has been use for ease of opening URL’s in phone.
There are terribly long ugly URLs which you have no way to copy except u really copy paste or firefox sync or XYZ sync it. Or you could copy the URL and generate a goo.gl link and then QR image from there.
You can run this bookmarkleet ( just browse any URL and when you are there click this ) and all links will have a QR image on right clicking the link.
Drag the following link and drop it in your browser’s bookmark.
Thanks Manish for asking me to blog about it.
Started with a hopeful new HTML5 FileReader API and ended with a frustrating results, finally ended up with accepting this open source script.
https://github.com/valums/file-uploader
It Works.
Facebook C# SDK is on nuget with package names
Facebook, FacebookWeb, FacebookWebMvc
But still have some bugs ![]()
Found here http://stackoverflow.com/questions/3357553/how-to-store-an-array-in-localstorage
HTML5’s window.localStorage can store anything. But for storing an array it’s a bit tricky.
To store an array suppose:
var names = [“Aâ€,â€Bâ€];
Storing :
localStorage.setItem("names", names.join(‘|||’));
Retriving :
var names = localStorage.getItem("names").split(‘|||’);
suppose “data†contains an array of object :
{"data": [
{
"id": "1",
"name": "B"
},
{
"id": "2",
"name": "A"
}] }
Then the sort() method of that array can take a custom function just
like IComparer in C# and sort the array in-memory.
var data = doc.data.sort(function(me,him){
return me.name.localeCompare(him.name);
});
This will sort the objects above comparing with its name property and
results into a sorted array of objects with ascending name property.
This blog is for my own reference.
Was about to write code for RSS thingy but then I found this :
In Namespace : System.ServiceModel.Web
Â
XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);
Â
MSDN source : http://msdn.microsoft.com/en-us/library/bb515814%28v=VS.90%29.aspx
Google’s URL shortening service http://goo.gl is the most fastest service available.
It had been released before operable only from google toolbar and no API, but some people did some hack and extracted the JavaScript that it used.
Now, it does provide a neat API. ![]()
With goo.gl we can not only create short url but also a QR image that can be used by barcode scanner for mobile devices.
An example of post method :
curl https://www.googleapis.com/urlshortener/v1/url \ -H 'Content-Type: application/json' \ -d '{"longUrl": "http://www.google.com/"}'would have a JSON response as :
{
"kind": "urlshortener#url",
"id": "http://goo.gl/fbsS",
"longUrl": "http://www.google.com/"
}
A QR code can be generated just adding .qr to the short URL .
http://goo.gl/fbsS.qr
My blog was down for almost 10 days now. My web hosting moved my websites to new system to support a new control panel so that I can ….. do few things better way like switching between .net versions for ASP.Net. Support tickets went back and forth but sadly they did not take care of my blog database, I had to backup and restore it myself. Aaaw … I still need to restore few other databases and apps that used those databases, I dont even remember all of them. I created them along the timespan of 4 years, since I bought this web hosting.
Well at least I brought my blog back
. Still as I remember, the sites that are not working are
t.bipins.net
notes.bipins.net
facebook.bipins.net
chatis.finally.in
*.finally.in
and few other that I cant remember right now.
(jobs)index3.html is fixed, thanks to a friend who reported it was not working.
Sorry for my friends who used some of my web pages.
Recent Comments