FLT_EPSILON: This is the difference between 1 and the smallest floating point number of type float that is greater than 1.
Машинный эпсилон - это минимальная разница между числами, которую компьютер в состоянии различить.
import sys
from numpy import float32
a = float32(sys.float_info.max)
while a > sys.float_info.max - 10000:
a -= 1
import os
import sys
import time
from urllib import FancyURLopener
import urllib2
import urllib
import simplejson
# Start FancyURLopener with defined version
class MyOpener(FancyURLopener):
version = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'
myopener = MyOpener()
def request(searchTerm, max_count):
# Set count to 0
count= 0
searchTermQuote = urllib.quote(searchTerm + ' language logo', '')
for i in range(0, 10):
# Notice that the start changes for each iteration in order to request a new set of images for each loop
url = ('https://ajax.googleapis.com/ajax/services/search/images?' + 'v=1.0&q=' + searchTermQuote + '&start=' + str(i*4) + '&userip=MyIP')
print url
request = urllib2.Request(url, None, {'Referer': 'testing'})
response = urllib2.urlopen(request)
# Get results using JSON
results = simplejson.load(response)
data = results['responseData']
dataInfo = data['results']
# Iterate for each result and get unescaped url
for myUrl in dataInfo:
count = count + 1
print myUrl['unescapedUrl']
searchTermSafe = ''.join([c for c in searchTerm if c.isalnum() or c == '.'])
name = os.path.join('imgs', searchTermSafe + str(count) + '.jpg')
myopener.retrieve(myUrl['unescapedUrl'], name)
if count >= max_count:
return
def main():
languages_list = open('list.txt', 'r').readlines()
for language in languages_list:
try:
request(language, 1)
except:
print "error with request" + language
time.sleep(1)
if __name__ == '__main__':
main()
a = int(input())
b = a % 10
c = a % 100
if a == 1:
print(a, 'программист')
elif (b == 1 and not c == 11 and not a == 1):
print(a, 'программист')
elif((b == 2 or b == 3 or b == 4) and not(c == 12 or c == 13 or c == 14)):
print(a, 'программиста')
else:
print(a, 'программистов')
class Square
{
void setSide(double side)
{
side_ = side;
area_ = side * side;
}
double getSide()
{
return side_;
}
double getArea()
{
return area_;
}
private:
double side_;
double area_;
}
struct Car
{
int speed;
int pos_x;
int pos_y;
};
void Car_set_pos(struct Car * car, int x, int y)
{
car->pos_x = x;
car->pos_y = y;
}
void Car_print_speed(struct Car * car)
{
printf("%d\n", car->speed);
}