Saturday, December 29, 2012

Sunday, December 9, 2012

spyne

spyne - Tame the interwebs

Spyne is a Python RPC toolkit that makes it easy to expose online services that have a well-defined API using multiple protocols and transports.

Friday, December 7, 2012

Monday, November 12, 2012

Python Web Crawler in Less Than 50 Lines

Python Web Crawler in Less Than 50 Lines | Code Brain

Python Spider, Web Crawler, Bot Examples

Python Spider, Web Crawler, Bot Examples Source Code

Canvas library : canvas.js

canvas.js | CLiPS

<em>The canvas.js module is a simple and robust JavaScript API for the HTML5 <canvas> element, which can be used to generate interactive 2D graphics in a web browser, using lines, shapes, paths, images and text.</em>

A Simple Web Bot with Requests and BeautifulSoup

stefan.sofa-rockers.org » A Simple Web Bot with Requests and BeautifulSoup

A Simple Web Bot with Requests and BeautifulSoup

How to Build a Python Bot That Can Play Web Games | Activetuts+

How to Build a Python Bot That Can Play Web Games | Activetuts+

How to Build a Python Bot That Can Play Web Games

Saturday, November 10, 2012

Python : web mining

(...)Pattern Pattern is a web mining module for the Python programming language. It bundles tools for data retrieval (Google + Twitter + Wikipedia API, web spider, HTML DOM parser), text analysis (rule-based shallow parser, WordNet interface, syntactical + semantical n-gram search algorithm, tf-idf + cosine similarity + LSA metrics), clustering and classification (k-means, KNN, SVM), and data visualization (graph networks).(...) http://www.clips.ua.ac.be/pages/pattern

Sunday, July 15, 2012

Knockout loading views

<!DOCTYPE html">

<html>
    <head>
        <title></title>
        
        <script src="Scripts/jquery-1.7.min.js" type="text/javascript"></script>
        <script src="Scripts/knockout-2.1.0.js" type="text/javascript"></script>

        <script>
            var counter = 0;

            var model1 = function () {
                this.name = ko.observable("model1");
            };

            var model2 = function () {
                this.name = ko.observable("model2");
            };

            var model3 = function () {
                this.name = ko.observable("model3");
            };

            function fetchView(view, model, divDest) {

                var def = new $.Deferred();

                $.ajax({
                    url: "./" + view,
                    success: function (viewContent) {
                        $("<div id=" + divDest + "></div>").appendTo("#container").html(viewContent);
                        def.resolve();
                    }
                });

                def.done(function (pageContent) {
                    counter += 1;
                    $("#counter").html(counter);
                    ko.applyBindings(model, document.getElementById(divDest));
                });
            }

            function init() {
                fetchView("view1.htm", new model1(), "main1");
                fetchView("view2.htm", new model2(), "main2");
                fetchView("view3.htm", new model3(), "main3");
            }
        </script>

        <script>
            $(function () {
                $("#container").html("Main Application");
                $("#counter").html(counter);
                init();
            });
        </script>
    </head>

    <body>
        <div id="counter">
        </div>
        <div id="container">
        </div>
    </body>

</html>

Tuesday, May 29, 2012

Introduction aux Web Workers d’HTML5 : le multithreading version JavaScript

Introduction aux Web Workers d’HTML5 : le multithreading version JavaScript - David Rousset - Site Home - MSDN Blogs

Run multiple JavaScript threads with HTML5 Web Workers

Run multiple JavaScript threads with HTML5 Web Workers – Roger Stringer

Creative Coding with Camera, Kinect, and C++

Exploring Cinder - O'Reilly Media

Multi-threading in JavaScript

Multi-threading in JavaScript - SitePoint

Pyprocessing

pyprocessing - A Processing-like environment for doing graphics with Python - Google Project Hosting

hacking for artists

Hacking for Artist

Hello, Cinder

Welcome to Cinder

Programmation graphique portable en C avec la SDL

Programmation graphique portable en C avec la SDL

Programmation d'un morpion utilisant C++/SDL (7 parties et série achevée)

fearyoursef.developpez.com :: Page d'index

Programmation d'un morpion utilisant C++/SDL (7 parties et série achevée)

Wednesday, May 16, 2012

Let’s Take This Offline

Offline Web Applications - Dive Into HTML5

application web offline HTML5 avec le cache manifest

Tutoriel : Une application web offline HTML5 avec le cache manifest | HTML5-CSS3.fr

Offline Web applications

6.7 Offline Web applications — HTML Standard

Build a Hangman game with HTML5

Build a Hangman game with HTML5 Canvas, JavaScript, and CSS – Part 2: Implementing the game logic | Adobe Developer Connection

How to build the hangman game in Javascript - Basics

How to build the hangman game in Javascript - Basics | Kligit

 

How to fix orphaned SQL Server users

When you restore a Microsoft SQL Server database on a different machine, you cannot access the database until you fix the permissions. http://www.fileformat.info/tip/microsoft/sql_orphan_user.htm

Wednesday, May 2, 2012

An introduction to jQuery Deferreds

An introduction to jQuery Deferreds | Blog :: The JavaScript Playground

JQuery Deferred - Great presentation

jQuery Deferred - danheberden

jQuery 1.5 - create your own deferred object with parameters

jQuery 1.5 - create deferred object with callback parameters - thanks @neutralthoughts

A Robust Way To Handle Asynchronous Requests Using jQuery 1.5+

A Robust Way To Handle Asynchronous Requests Using jQuery 1.5+ | TechBrij

jQuery Deferred Objects

jQuery Deferred Objects - Part 1

Exploring Deferred and Promise in JQuery

Exploring Deferred and Promise in JQuery | Web Builder Zone

Digging into Deferreds with jQuery: Promises

Digging into Deferreds with jQuery: Promises

Lucid is an uber simple and easy to use event emitter library

RobertWHurst/LucidJS · GitHub

Lucid is an uber simple and easy to use event emitter library. Lucid allows you to create your own event system and even pipe in events from any number of DOM elements.
Read more

Async utilities for node and the browser

caolan/async · GitHub

Using the FileHelpers Library

Éric Moreau's blog : Using the FileHelpers Library

Friday, April 20, 2012

Générateur de particules

[HTML5] Générateur de particules - Partie 1 - Site de Grégory Corgié

 

Explore generating visualisations using JavaScript in HTML5

Explore generating visualisations using JavaScript in HTML5

 

Canvas drawing made easy

oCanvas - Object-based canvas drawing

 

Old School Demo Framework

http://codef.santo.fr/index.php?

 

 

Archive for the 'HTML – JS' Category

HTML – JS « ST Knights Website

 

Unleash the power of HTML 5 Canvas for gaming

Unleash the power of HTML 5 Canvas for gaming - Eternal Coding - Site Home - MSDN Blogs

 

Make it easy: Convert CSV files to XML with LINQ

Make it easy: Convert CSV files to XML with LINQ - CodeProject®

 

csonv.js

A tiny library to fetch relational CSV data at client-side just like JSON

Thursday, April 19, 2012

Code-First Development with Entity Framework 4

Code-First Development with Entity Framework 4 - ScottGu's Blog

 

Data Access Using a Generic Repository in C#

Data Access Using a Generic Repository in C# « Jason Mitchell

 

Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10)

Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10) : Official Microsoft Site

 

Using the Entity Framework Repository and UnitOfWork Pattern in C# ASP .NET

Primary Objects - Using the Entity Framework Repository and UnitOfWork Pattern in C# ASP .NET

 

Using Unit of Work Pattern with Entity Framework

Using Unit of Work Pattern with Entity Framework | .NET Zone

 

Using Repository Pattern with Entity Framework

Using Repository Pattern with Entity Framework | .NET Zone

 

Calling a WCF service from Javascript

Very nice tutorial
http://dotnetbyexample.blogspot.fr/2008/02/calling-wcf-service-from-javascript.html

Wednesday, April 18, 2012

Another look at custom bindings for KnockoutJS

Knock Me Out: Another look at custom bindings for KnockoutJS

 

10 things to know about KnockoutJS on day one

Knock Me Out: 10 things to know about KnockoutJS on day one

 

Guard Your Model: Accept or Cancel Edits to Observables in KnockoutJS

Knock Me Out: Guard Your Model: Accept or Cancel Edits to Observables in KnockoutJS

 

Using KnockoutJS in your ASP.NET applications

Using KnockoutJS in your ASP.NET applications - CodeProject®

 

Introducing the Knockout.Unobtrusive Plugin

Introducing the Knockout.Unobtrusive Plugin | User InExperience

 

Rapid and responsive UI development with Knockout.js

Rapid and responsive UI development with Knockout.js | Tutorial | .net magazine

Rapid and responsive UI
development with Knockout.js

Knockout-Backbone

Using Knockout with Backbone

 

http://www.geekdave.com/?p=79

Monday, April 16, 2012

Javascript Injection at it's Finest!, without even using Eval()!

Javascript Injection at it's Finest!, without even using Eval()! - CodeProject®

 

Managing Your JavaScript Library in ASP.NET

Managing Your JavaScript Library in ASP.NET - CodeProject®

 

Consuming Cross-Domain WCF REST Services with jQuery using JSONP

Consuming Cross-Domain WCF REST Services with jQuery using JSONP - CodeProject®

 

Calling Cross Domain WCF service using Jquery/JavaScript

Calling Cross Domain WCF service using Jquery/JavaScript - CodeProject®

 

Steps to Call WCF Service using jQuery

GMind Solution: Steps to Call WCF Service using jQuery

 

Recipe: WCF basicHttpBinding with Windows Authentication

Recipe: WCF basicHttpBinding with Windows Authentication

 

Eight steps to enable Windows authentication on WCF BasicHttpBinding

Eight steps to enable Windows authentication on WCF BasicHttpBinding - CodeProject®

 

Calling WCF service exposed with different bindings in JQuery

Calling WCF service exposed with different bindings in JQuery - CodeProject®

 

Reusing WCF Service Across Several Applications using Different Bindings

Reusing WCF Service Across Several Applications using Different Bindings - CodeProject®

 

Difference between BasicHttpBinding and WsHttpBinding

Difference between BasicHttpBinding and WsHttpBinding - CodeProject®

 

Wednesday, March 21, 2012

Port of web2py to Bottle, Flask, Pyramid, Tornado, wsgiref and other frameworks

mdipierro/gluino · GitHub

 

JSONP with the framework Bottle

# Author: Samat Jain <http://samat.org/>
# License: MIT (same as Bottle)

import bottle

from bottle import request, response, route
from bottle import install, uninstall

from json import dumps as json_dumps


class JSONAPIPlugin(object):
    name = 'jsonapi'
    api = 1

    def __init__(self, json_dumps=json_dumps):
        uninstall('json')
        self.json_dumps = json_dumps

    def apply(self, callback, context):
        dumps = self.json_dumps
        if not dumps: return callback
        def wrapper(*a, **ka):
            r = callback(*a, **ka)

            # Attempt to serialize, raises exception on failure
            json_response = dumps(r)

            # Set content type only if serialization succesful
            response.content_type = 'application/json'

            # Wrap in callback function for JSONP
            callback_function = request.GET.get('callback')
            if callback_function:
                json_response = ''.join([callback_function, '(', json_response, ')'])

            return json_response
        return wrapper


install(JSONAPIPlugin())


@route('/')
def hello():
    r = [{'hello': 'world'}]
    r.append({1: 2})
    return r

if __name__ == '__main__':
    from bottle import run
    run(reloader=True)

JSONP with jQuery, MooTools, and Dojo

http://davidwalsh.name/jsonp

jquery-jsonp

jquery-jsonp - JSONP for jQuery - Google Project Hosting

 

Small experimental RPC API using bottle web framework and jQuery

foxbunny/HTTPy-RPC · GitHub

 

Accessing-Remote-ASP-NET-Web-Services-Using-JSONP

Geat article

http://www.codeproject.com/Articles/43038/Accessing-Remote-ASP-NET-Web-Services-Using-JSONP

Monday, March 19, 2012

Webservice + WSDL in Python with web.py

Quote from Site

(...)Optio's soaplib makes it really straightforward to write SOAP web service views by using a decorator to specify types. Plus it's the only Python library, as of today, which is able to generate WSDL documents for your web service.(...)
http://webpy.org/cookbook/webservice

import web 
from soaplib.wsgi_soap import SimpleWSGISoapApp
from soaplib.service import soapmethod
from soaplib.serializers import primitive as soap_types

urls = ("/hello", "HelloService",
        "/hello.wsdl", "HelloService",
        )
render = web.template.Template("$def with (var)\n$:var")



class SoapService(SimpleWSGISoapApp):
    """Class for webservice """

    #__tns__ = 'http://test.com'

    @soapmethod(soap_types.String,_returns=soap_types.String)
    def hello(self,message):
        """ Method for webservice"""
        return "Hello world "+message



class HelloService(SoapService):
    """Class for web.py """
    def start_response(self,status, headers):
        web.ctx.status = status
        for header, value in headers:
            web.header(header, value)


    def GET(self):
        response = super(SimpleWSGISoapApp, self).__call__(web.ctx.environ, self.start_response)
        return render("\n".join(response))


    def POST(self):
        response = super(SimpleWSGISoapApp, self).__call__(web.ctx.environ, self.start_response)
        return render("\n".join(response))

app=web.application(urls, globals())

if __name__ == "__main__":
    app.run()

Thursday, March 8, 2012

JavaScript queues

JavaScript queues

JavaScript queues

Detachable navigation using JavaScript

Detachable navigation using JavaScript

Detachable navigation using JavaScript

Smooth movement in JavaScript

Smooth movement in JavaScript

Smooth movement in JavaScript

Scheduling tasks to run on load in JavaScript

Scheduling tasks to run on load in JavaScript

Scheduling tasks to run on load in JavaScript

Colour handling and processing in JavaScript

Colour handling and processing in JavaScript

Colour handling and processing in JavaScript

Javascript color conversion

Javascript color conversion

Javascript color conversion

HSL to RGB converter

convert HSL to RGB using JS? - CodingForums.com

convert HSL to RGB using JS?

jCanvaScript

jCanvaScript

jCanvaScript is a javasript library that provides you methods to manage
with the content of a HTML5 canvas element easily. It runs on any platform
(including iPhone, iPad, Android) that supports canvas and JavaScript.
To add support for canvas in Internet Explorer you can use ExCanvas.

Sunday, February 19, 2012

http://sixrevisions.com/web-development/crazy-tips-help-become-better-coder/

7 Crazy Tips That Will Help You Become a Better Coder

 

 

 

http://visualstudiomagazine.com/articles/2012/02/01/2-great-javascript-data-binding-libraries.aspx

JavaScript libraries help you build powerful, data-driven HTML5 apps.

Toggle element JQuery

I don't who code this snippet but i like it :-)
(I also know there is the toggle function from JQuery)

Togger = function (e) {
    // Show the paragraph if it's hidden.
    var $paragraph = $(e.data);
    var $link = $(this);
    if ($paragraph.is(':hidden')) {
      $paragraph.show();
      $link.text('Click to hide');
     
    }
    // Hide the paragraph if it's visible.
    else {
      $paragraph.hide();
      $link.text(' Click to show');
    }
  };


$('#toggle-link-1').bind('click','#paragraph-1', Togger);
$('#toggle-link-2').bind('click','#paragraph-2', Togger);

Writing JavaScript without anonymous functions

Nice post on...

Javascript Encryption Decryption

JavaScript Encryption and Decryption

JavaScript Encryption and Decryption 2.0

Wednesday, February 15, 2012

Thursday, February 2, 2012

KendoUI : Hiding Columns

Here is a little snippet to hide columns on dataBound event

function HideColumn(gridId,numColumn) {    
    $("#" + gridId +  " th:eq(" + numColumn + ")").hide();
    $("#" + gridId +  " td:nth-child(" + (numColumn+1) + ")").hide();
}

$(document).ready(function () {
     $("#grid").kendoGrid({

        dataBound : function(e) {          
             //RegisterGrid($("#grid").data("kendoGrid"));          
             HideColumn("grid",0);
        },
()

KendoUI : Row Selection

Here is an example which shows how to select a row and saving
a grid instance after creation.
Notice that we register the grid in 'dataBound' event, otherwise
we register an empty grid !!!

var grid;
     
function RegisterGrid(g) {
      grid = g;
      grid.select(grid.tbody.find(">tr").eq(3));         
}

$(document).ready(function () {
    var grid = $("#grid").kendoGrid({

        dataBound : function(e) {          
             RegisterGrid($("#grid").data("kendoGrid"));          
        },
        columns:
            [{
                field: "id",
                title: ""
            
           
            },
                {
                field: "Email",
               title: "Email"
            }],

        dataSource: {
            transport: {
                read: {
                    type: "POST",
                    url: "http://localhost/WebService.asmx/GetAdmin?name=Paul&age=12",
                    data: [],
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: true
                }
            },
            schema: {
                data: "d",
                model: {
                    fields: {
                        id: { type: "number" },
                        Email: { type: "string" }
                    }
                },
                total : function (r) {
                   
                }
            },
        },
        selectable: "row",
        navigatable: true,
        sortable: true,
        pageable: true,

        change: function (arg) {          
            var selected = $.map(this.select(), function (item) {
                alert(item.cells[0].innerHTML);                
            });
        },        
    });   
})

Tuesday, January 31, 2012

Object Oriented JavaScript Class Library in C#/.NET Style

(...)Welcome to Object Oriented JavaScript class library in C#/.NET style.(...)

http://www.codeproject.com/Articles/22073/Object-Oriented-JavaScript-Class-Library-in-C-NET

Stanford Javascript Crypto Library

(...)The Stanford Javascript Crypto Library (hosted here on Stanford's server or here on GitHub) is a project by the Stanford Computer Security Lab to build a secure, powerful, fast, small, easy-to-use, cross-browser library for cryptography in Javascript.(...)

http://crypto.stanford.edu/sjcl/

jQuery Selectbox plugin

Very nice plugin.

http://www.bulgaria-web-developers.com/projects/javascript/selectbox/

KendoUI Grid and WebServices

Here is a simple example on how to do :

$(document).ready(function () {
        $("#grid").kendoGrid({
            columns: [
              {
                  field: "id",
                  title: "ID"
              },
              {
                  field: "Email",
                  title: "Email"
              }],

            dataSource: {
                transport: {
                    read: {
                        type : "POST",
                        url  : "http://localhost/WebService.asmx/GetAdmin",
                        data : null,
                        contentType : "application/json; charset=utf-8",
                        dataType: "json",
                        async: true
                    }
                },
                schema : {
                    data: "d"
                }
            }           
        });
    });

Thursday, January 19, 2012

Ironpython hosting in SilverLight

Here is one of the simplest sample i could make to illustrate.
The only issue i encoutered was adding a reference to 'Microsoft.CSharp'

using System;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Scripting.Silverlight;


///
/// script.py => def Adder (x, y) : return x + y
///


namespace DLRSilverlight
{
    public partial class MainPage : UserControl
    {
        dynamic runtime = DynamicEngine.CreateRuntime().UseFile("script.py");
               
        public MainPage()
        {
            InitializeComponent();                  
        }
       
        private void button1_Click(object sender, RoutedEventArgs e)
        {            
            dynamic result = runtime.Adder(Convert.ToDouble(this.N1.Text), Convert.ToDouble(this.N2.Text));
            MessageBox.Show(String.Format("{0}", result));
        }        
    }
}

Active Directory with IronPython

Here is a little snippet

import clr
clr.AddReference("System.DirectoryServices")
from System.DirectoryServices import DirectorySearcher

class ADHelper(object):

    def __init__(self, strLDAP = "LDAP://******"):
        self.searcher  =  DirectorySearcher(strLDAP)

    def searchUserByLogin(self,user,*prop):
        """        
        searchUserByLogin("alogin","cn","sn",'SAMAccountName')
        """        
        str = ""
        self.searcher.Filter = "(sAMAccountName=%s)"%user
        self.searcher.PropertiesToLoad.Add("cn")
        self.searcher.PropertiesToLoad.Add("SAMAccountName")
        self.searcher.PropertiesToLoad.Add("givenName")
        self.searcher.PropertiesToLoad.Add("sn")   
        result = self.searcher.FindOne()
        for option in prop:
            str +=  (option + " : " + result.Properties[option][0] + " ")
        return str
    
ad = ADHelper()
print ad.searchUserByLogin("alogin","cn","sn",'SAMAccountName')

Wednesday, January 18, 2012

C# 4.0 First Look :: Dynamic Keyword and Calling Python from&nbsp;C#

C# 4.0 First Look :: Dynamic Keyword and Calling Python from C# « AbdulMoniem's Thoughts

Dynamic keyword, Ironpython and Silverlight

Dynamic keyword, Ironpython and Silverlight? - IronPython - Python on .NET & Mono | Google Groupes

Using an IronPython object from C#

Jorge Fioranelli: Using an IronPython object from C#

 

Calling Python from C#

Calling Python from C# « Network Programming in .NET

 

Using the Dynamic Language Runtime to Call IronPython for VS2010

Using the Dynamic Language Runtime to Call IronPython for VS2010 - Paul Kimmel's Blog

 

Using dynamic in the real world with IronPython

http://blog.filipekberg.se/2011/10/04/using-dynamic-in-the-real-world-with-ironpython/

Using MVVM to bring IronPython and WPF together

Nice sample

http://blogs.southworks.net/dschenkelman/2010/09/21/using-mvvm-to-bring-ironpython-and-wpf-together/

Tuesday, January 17, 2012

IronPyhon - SilverLight Deployment

In order to make IIS serves the application
the following MIME-TYPES must be configured

.py -> text/plain
.slvx -> octet/stream

Scripting C# Silverlight apps with IronPython

From Jimmy Schementi, excelent as usual.

http://blog.jimmy.schementi.com/2009/03/scripting-c-silverlight-apps-with.html

WPF Tutorials

Great links

http://www.wpftutorial.net/

http://www.abhisheksur.com/2010/12/wpf-tutorial.html

DLR in C# - Scripting language

Little example on how to use IronPython in C#

http://www.abhisheksur.com/2011/05/dlr-in-c-using-scripting-language.html

Patterns For Large-Scale JavaScript Application Architecture

Nice article

Patterns For Large-Scale JavaScript Application Architecture

Javascript: self invoked functions

Immediately-Invoked Function Expression (IIFE)



Ben Alman » Immediately-Invoked Function Expression (IIFE)

Wednesday, January 4, 2012

Data and Command Bindings for Silverlight MVVM Applications

Quote from site :

(...)This article summarizes two utility classes used for data and command bindings in Silverlight MVVM applications and demonstrates how to use the two classes with a running example. (...)
http://www.codeproject.com/KB/silverlight/MVVMUtility.aspx