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):
#include <iostream>
struct A{
void f(){
std::cout << "A" << std::endl;
}
};
struct B: public virtual A{
void f(){
std::cout << "B" << std::endl;
#include <iostream>
struct A{
void f(){
std::cout << "A" << std::endl;
}
};
struct B: public virtual A{
void f(){
std::cout << "B" << std::endl;
std::string buffer;
std::copy(_packet.body(), _packet.body()+_packet.payload_size(), buffer.begin());
const char* buff = buffer.c_str();
const char* i = buff;
boost::uint32_t address_size = *reinterpret_cast<const boost::uint32_t*>(i);
i += sizeof(boost::uint32_t);
std::string address;
std::copy(i, i+address_size, address.begin());
I know the thread is old. But I have to create a fake PCI device with custom read/write function. I am trying to replicate this example and hitting errors. Can you please post an working demo ?
I was getting compilation errors on [CODE]struct pci_bus my_pci_bus = NULL;[/CODE] so I changed that to [CODE]struct pci_bus my_pci_bus = {};[/CODE]
This is my current code
[CODE]#define MY_PCI_DOMAIN_NUM 0x0001
#define MY_PCI_BUS_NUM 0x00
#include <linux/pci.h>
#define MY_PCI_DOMAIN_NUM 0x0001
#define MY_PCI_BUS_NUM 0x00
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci-ats.h>
#include <linux/pci-acpi.h>
<div id="studentInfoBox" class="infoBox">
<span>Name: </span> <?= $name ?>
<span>Department: </span><?= $deptName ?>
<span>
</div>
<div id="studentInfoBox" class="infoBox">
<span>Name: </span> <?= $name ?>
<span>Department: </span><?= $deptName ?>
</div>
<?php
class stdInfoModel extends manualModel{
public function attachOrmMap(){
parent::attachOrmMap('StudentOrm');//attach an Orm Map on file StudentOrm.orm.map.php
}
}
?>
#include <stdio.h>
int main()
{
int i=1,j=1,n=20,gap=5;
for(;i<=n;i++){
for(j=1;j<=n;j++){
if(i==n && j==n){
printf(" ");
}else if(i==1 && j==1){