Skip to content

Instantly share code, notes, and snippets.

View neel's full-sized avatar

Neel Basu neel

View GitHub Profile
class User(models.Model):
name = models.CharField(max_length=200)
address = models.CharField(max_length=1000, null=True)
login = models.CharField(max_length=16)
password = models.CharField(max_length=128)
def __unicode__(self):
return self.name
class SuperUser(User):
hessiancln::DataSourceBrowser browser("https://127.0.0.1/api");
hessiancln::net_item_info_list list;
try{
list = browser.networkDiscovery("network");
}catch(hessiancln::invoke_exception& ex){
qDebug() << "DSClientConfigurationMaps::populateGroup" << "Caught Exception: " << QString::fromStdString(ex.what());
}
foreach(hessiancln::net_item_info item_info, list){
qDebug() << "DSClientConfigurationMaps::populateGroup" << QString::fromStdString(item_info.name) << " " << item_info.type;
}
#include <QtCore/QCoreApplication>
#include <stdio.h>
#include <assert.h>
#include <windows.h>
#include <lm.h>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
struct AbstractBucketPrinter{
protected:
std::ostream& _stream;
public:
AbstractBucketPrinter(std::ostream& stream): _stream(stream){}
std::ostream& stream() const{return _stream;}
};
template <typename T, int DepthN>
#include <iostream>
namespace meta{
template <int Begin, int End, bool done = false>
struct iterator{
template<typename F>
static void iterate(F f){
f();
iterator<Begin, End-1, Begin == End-1>::iterate(f);
}
namespace util{
template <class Type, class Param>
class has_operator_round_brackets_with_parameter{
public:
BOOST_CONCEPT_USAGE(has_operator_round_brackets_with_parameter){
_t(_p);
}
private:
Type _t;
Param _p;
#include "config.h"
#include <iostream>
Config::Config(int data):_pimpl(new Impl(data)){
}
Config::Impl::Impl(int data): _data(data){
#include "config.h"
#include <iostream>
Config::Config():_pimpl(new Impl), _refCount(1){
}
Config::Config(const Config& config): _pimpl(config._pimpl), _refCount(1){
config.ref();
}
var core = {
clone: function(o){
var c;
if(typeof o != 'object'){
c = o;
}else{
c = {};
for(i in o){
c[i] = this.clone(o[i]);
}
@neel
neel / jana
Created August 28, 2011 19:13
Written for Arghyadeep Jana
U2FsYSBCb2thY2hvZGEgSGFyYW1pIFN1b3JlciBCYWNoY2hhLiBHYXJlIGVrIExhdGhpIE1hcmJl
IEdhbmR1IGVraG9uIHRvciBHaHVtIFBhY2hjaGhlID8gYm9sIG5hIGtha2UgYWRkcmVzcyBrb3Jl
IExpa2hsaSA/Pw==