Skip to content

Instantly share code, notes, and snippets.

--- a/pt3_dma.c
+++ b/pt3_dma.c
@@ -428,7 +428,11 @@
page = &dma->ts_info[i];
page->size = PAGE_BLOCK_SIZE;
page->data_pos = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
page->data = pci_alloc_consistent(hwdev, page->size, &page->addr);
+#else
+ page->data = dma_alloc_coherent(&hwdev->dev, page->size, &page->addr, GFP_KERNEL);
putStrLn $ show $ map (let fizzBuzz x | 0 == (x `mod` 3) && 0 == (x `mod` 5) = "FizzBuzz" | 0 == (x `mod` 3) = "Fizz" | 0 == (x `mod` 5) = "Buzz" | otherwise = show x in fizzBuzz) [1..100]
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import socket
import sys
def main():
if len(sys.argv) != 2:
exit()
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import urllib
import sys
def main(site):
url = 'http://api.b.st-hatena.com/entry.count?'
count = urllib.urlopen(url + 'url=' + site).read()
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import tweepy
import argparse
def get_oauth():
consumer_key = '11hvAz4jGF7ZDSfeDcg'
consumer_secret = 'Q69OTwBdmeTJlaakG9DXx762WYYNgr5V0H2eSocmkM'
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import urllib
import sys
def emotion(keyword):
url = 'http://mueki.net/twana/api.php'
params = urllib.urlencode({'q':keyword})
response = urllib.urlopen(url, params).read()
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import tweepy
import sys
def get_oauth():
consumer_key = ''
consumer_secret = ''
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import os
import BeautifulSoup
import urllib
def search(url):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import tweepy
import sys
def get_oauth():
consumer_key = ''
consumer_secret = ''
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import tweepy
import sys
def get_oauth():
consumer_key = ''
consumer_secret = ''