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
NSArray *words = [content componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; | |
NSEnumerator *en = [words objectEnumerator]; | |
NSString *word; | |
NSMutableArray *ssl = [[NSMutableArray alloc] initWithCapacity:1]; | |
while(word = [en nextObject]) | |
{ | |
if([word hasPrefix:@"http://"]) | |
{ | |
NSLog(@"%@",word); | |
[ssl addObject:word]; |
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
'''for mass unfollow bot and another fucking user | |
use: download http://code.google.com/p/python-twitter/ this and use http://python-twitter.googlecode.com/issues/attachment?aid=6509573335595538436&name=friends-followers-cursor.patch this patch ''' | |
import twitter | |
api = twitter.Api(username='user', password='pass') | |
friends_list = api.GetFriends() | |
followers_list = api.GetFollowers() |
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
-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
UITouch *myTouch = [touches anyObject]; | |
CGPoint location = [myTouch locationInView: [myTouch view]]; | |
location = [[CCDirector sharedDirector] convertToGL: location]; | |
mouse2 = cpMouseNew(space); | |
cpMouseGrab(mouse, cpv(location.x, location.y), 0); | |
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
Const n=8; | |
Var a:array[1..n] of integer; | |
i,k: integer; | |
begin | |
writeln('Введите 8 чисел, после каждого числа нажимайте Enter'); | |
For i:=1 to n do read(a[i]); readln; | |
k:=0; | |
For i:=1 to n do | |
if a[i] =0 then begin | |
k:=k+1; |
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
# -*- coding: utf8 -*- | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp.util import run_wsgi_app | |
from google.appengine.api import urlfetch | |
from google.appengine.ext import db | |
from google.appengine.api import mail | |
from google.appengine.api.labs import taskqueue | |
from BeautifulSoup import BeautifulStoneSoup | |
import string |
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
kal_uint8 i2c_tp_Readid(void) | |
{ | |
kal_uint8 lcd_id = 0xff; | |
///kal_uint32 savedMask; | |
kal_uint8 readid_cnt=0; | |
kal_uint8 readata; | |
//////tp_i2c_crystal_on(); | |
//////i2c_tp_hw_init(); | |
//I2C_TOUCH_INIT(); |
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
# -*- coding: utf-8 -*- | |
import urllib | |
import urllib2 | |
import re | |
import os | |
import json | |
from BeautifulSoup import BeautifulSoup | |
urllib2.install_opener(urllib2.build_opener(urllib2.HTTPCookieProcessor)) |
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
Bus 002 Device 005: ID 1b3f:2002 Generalplus Technology Inc. | |
Device Descriptor: | |
bLength 18 | |
bDescriptorType 1 | |
bcdUSB 1.10 | |
bDeviceClass 0 (Defined at Interface level) | |
bDeviceSubClass 0 | |
bDeviceProtocol 0 | |
bMaxPacketSize0 8 | |
idVendor 0x1b3f Generalplus Technology Inc. |
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
from xml.dom.minidom import parse | |
import os | |
def getText(nodelist): | |
rc = [] | |
for node in nodelist: | |
if node.nodeType == node.TEXT_NODE: | |
rc.append(node.data) | |
return ''.join(rc) |
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
from math import * | |
def toExpForm(a,s): | |
if a.real != 0: | |
real=sqrt(pow(a.real,2)+pow(a.imag,2)) | |
agle=degrees(atan(a.imag/a.real)) | |
else: | |
real=a.imag | |
agle=90.0 if a.imag>0 else -90.0 | |
print (s+'='+str(round(a.real,3))+'','' if a.imag<0 else '+', str(round(a.imag,3))+'='+str(round(real,3)) + '∠' + str(round(agle,3))) |
OlderNewer