This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct A{ | |
void f(){ | |
std::cout << "A" << std::endl; | |
} | |
}; | |
struct B: public virtual A{ | |
void f(){ | |
std::cout << "B" << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct A{ | |
void f(){ | |
std::cout << "A" << std::endl; | |
} | |
}; | |
struct B: public virtual A{ | |
void f(){ | |
std::cout << "B" << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="studentInfoBox" class="infoBox"> | |
<span>Name: </span> <?= $name ?> | |
<span>Department: </span><?= $deptName ?> | |
<span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="studentInfoBox" class="infoBox"> | |
<span>Name: </span> <?= $name ?> | |
<span>Department: </span><?= $deptName ?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class stdInfoModel extends manualModel{ | |
public function attachOrmMap(){ | |
parent::attachOrmMap('StudentOrm');//attach an Orm Map on file StudentOrm.orm.map.php | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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){ |
OlderNewer