Python3 Virtualenv Setup
Requirements
- Python 3
- Pip 3
$ brew install python3
""" candidate 1 """ | |
class Voca(object) : | |
def get(self, book_id) : | |
return Voca.objects.filter(book.id=book_id) | |
class Quiz (object) : | |
@classmethod | |
def logout(cls, request) : | |
logout(request) |
# candidate 1 | |
widgets = { | |
'title': TextInput(attrs={'class':'form-control'}), | |
'url': TextInput(attrs={'class':'form-control'}), | |
'desc': Textarea(attrs={ | |
'class':'form-control', | |
'style':'resize:none;width:100%;height:100px;'}) | |
} | |
# candidate 2 |
# 1 | |
def __init__(self, request=None, reply=None, headers={}, | |
cookies=None, status_code=None): | |
# 2 | |
response = HTTPResponse( | |
headers=self._response_header,status_code=HTTPStatusCode.OK) | |
# 3 | |
return reply( |
import requests | |
from bs4 import BeautifulSoup | |
r = requests.get('http://www.ddp.or.kr/EP010001/getInitPage.do') | |
soup = BeautifulSoup(r.text) | |
exhibit_list = soup.find_all(class_='gallery_list')[0].find_all('li') | |
for ex in exhibit_list: | |
print ex |
if(scrollView.tag == 200) { | |
int page = floor(scrollView.contentOffset.x / kSlideImageWidth); | |
float hRatio = (scrollView.contentOffset.x - kSlideImageWidth * page) / kSlideImageWidth; | |
if(page == [placeImageList count]-1) return; | |
NSDictionary *currentImageInfo = [placeImageList objectAtIndex:page]; | |
NSDictionary *nextImageInfo = [placeImageList objectAtIndex:page+1]; | |
float currentHeight = [[currentImageInfo objectForKey:@"height"] floatValue] / [[currentImageInfo objectForKey:@"width"] floatValue] * kSlideImageWidth; |
- (BOOL)openLink:(NSString *)link withDelay:(int64_t)delay animated:(BOOL)animated sticky:(BOOL)sticky { | |
// 일반 URL | |
if([link hasPrefix:@"http://"] || [link hasPrefix:@"https://"]) { | |
ACWebViewController *controller = [[ACWebViewController alloc] initWithUrl:link]; | |
[self showViewController:controller withDelay:delay modal:YES animated:animated]; | |
return YES; | |
} | |
NSArray *components = [link componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@":/"]]; | |
if (IS_BLANK_ARRAY(components)) |
{ | |
"profiles": [ | |
{ | |
"name": "Default profile", | |
"selected": true, | |
"simple_modifications": { | |
"left_command": "left_option", | |
"left_option": "left_command", | |
"right_option": "right_command", | |
"application": "right_option" |
$ brew install python3
import SwiftUI | |
enum SideMenu: String, CaseIterable { | |
case first | |
case second | |
case third | |
case fourth | |
case fifth | |
var id: String { "\(self)" } |
import SwiftUI | |
enum SideMenu: String, CaseIterable { | |
case first | |
case second | |
case third | |
case fourth | |
case fifth | |
var id: String { "\(self)" } |