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> | |
using namespace std; | |
int main() | |
{ | |
char s[]="this is a character array"; |
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
.asoundrc | |
--------- | |
pcm.!default { | |
type hw | |
card 2 | |
device 0 | |
} | |
ctl.!default { | |
type hw | |
card 2 |
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
// Paste the line below in Adress bar to translate | |
javascript:void((function(){var en=prompt("Name in english:");var ma={'a':'ka','b':'tu','c':'mi','d':'te','e':'ku','f':'lu','g':'ji','h':'ri','i':'ki','j':'zu','k':'me','l':'ta','m':'rin','n':'to','o':'mo','p':'no','q':'ke','r':'shi','s':'ari','t':'chi','u':'do','v':'ru','w':'mei','x':'na','y':'fu','z':'zi'};var jn='';for(var i=0;i<en.length;++i){ch=en.charAt(i).toLowerCase();if(ch in ma){jn+=ma[ch];}else{jn+=ch;}}alert(jn);})()) |
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
def before_top_post(request): | |
data = '' | |
post_id = request.GET['post_id'] | |
post = Post.objects.get(id=post_id) | |
posts = get_top_posts(request) | |
cond = lambda p: p.id != post.id | |
before_matched = itertools.takewhile(cond, posts) | |
skip = sum(itertools.imap(cond, before_matched)) | |
if skip > 0: | |
matched = next(itertools.islice(posts, skip-1, None), None) |
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
def next_top_post(request): | |
data = '' | |
post_id = request.GET['post_id'] | |
post = Post.objects.get(id=post_id) | |
posts = get_top_posts(request) | |
matches = itertools.dropwhile(lambda p: p.id != post.id, posts) | |
matched = next(itertools.islice(matches, 1, None), None) | |
arrows = get_top_arrows(matched) | |
next_post = profile_post_to_html(request,matched,'top') | |
data = {'post':next_post, 'arrows':arrows} |
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
mposts = ((p.id, posts[i+1] if (i+1) != len(posts) else None) for i, p in enumerate(posts) if p.id == post.id) | |
for (id, next_post) in mposts: | |
print('Matched post id:', id) | |
print('Next post id:', next_post.id) |
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
>>> import apptrace.middleware | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/lib/python2.5/site-packages/apptrace-0.2.2-py2.5.egg/apptrace/middleware.py", line 18, in <module> | |
from instruments import Recorder | |
File "/usr/lib/python2.5/site-packages/apptrace-0.2.2-py2.5.egg/apptrace/instruments.py", line 23, in <module> | |
from django.utils import simplejson | |
ImportError: No module named django.utils | |
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
(03:47:50 PM) h0x5f3759df: Hi, is there any way for me to pass info from my app to my custom middleware? | |
(04:19:03 PM) mitsuhiko: h0x5f3759df: hard | |
(04:19:10 PM) mitsuhiko: h0x5f3759df: what does the middleware do? | |
(04:19:24 PM) h0x5f3759df: It does some profiling | |
(04:19:34 PM) h0x5f3759df: I want to restrict the profiling to a subset of users | |
(04:19:39 PM) h0x5f3759df: *admins | |
(04:20:43 PM) mitsuhiko: h0x5f3759df: the thing is that the middleware starts executing before the application does and stops afterwards | |
(04:20:49 PM) mitsuhiko: but at one point in the middle there will be the application | |
(04:30:57 PM) mitsuhiko: h0x5f3759df: i would probably try not doing that in the middleware :) |
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
(06:39:05 PM) h0x5f3759df: How would i access the request context in my custom wsgi middleware? | |
(06:39:13 PM) mitsuhiko: h0x5f3759df: you can't | |
(06:39:37 PM) mitsuhiko: at least not reliably |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<rss version="2.0"> | |
<channel> | |
<pubDate>Monday, 13. June 2011 12:39AM</pubDate> | |
<title>GroupBachat.com Deals Feed</title> | |
<link>http://www.groupbachat.com/</link> | |
<description>Current Deals</description> | |
<language>en-gb</language> | |
<copyright>Groupbachat 2011</copyright> |