やりたいこと
- 本の本文と言語学をリンクしたい(言語学の裏付けをしたい) リンクしたい本文の一例 http://techlife.cookpad.com/entry/2015/08/31/140749
https://gist.github.com/suzukimilanpaak/8b7c914bfb86b984f07a5366b19e619c#file-line-log-L143-L148
| class OpenStruct: | |
| def __init__(self, **dic): | |
| self.__dict__.update(dic) | |
| def __getattr__(self, i): | |
| if i in self.__dict__: | |
| return self.__dict__[i] | |
| else: | |
| None | |
| def __setattr__(self,i,v): | |
| if i in self.__dict__: |
| # -*- coding: utf-8 -*- | |
| ''' | |
| Convenient classes to enable delegate | |
| ..codeauthor Tatsuya Suzuki <[email protected]> | |
| ''' | |
| import copy | |
| import logging as log | |
| from typing import Sequence, Any, Dict, Tuple | |
| # def delegatable(cls): |
| class MessagesViewController: UIViewController { | |
| func addButton(text: String) { | |
| let button = generateButton(from: String(text)) | |
| button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside) | |
| self.buttons.append(button) | |
| } | |
| func layoutButtons() { | |
| buttonView?.removeFromSuperview() |
| /search?category_id=7&prefecture_ids%5B%5D=12&occupation_id=54 |
やりたいこと
https://gist.github.com/suzukimilanpaak/8b7c914bfb86b984f07a5366b19e619c#file-line-log-L143-L148
| import Foundation | |
| enum ThrowableError: Error { case BadError } | |
| func doSomething(_ occursError: Bool) throws -> String { | |
| if !occursError { | |
| return "Everything is ok" | |
| } else { | |
| throw ThrowableError.BadError | |
| } |
| select *, (probability * 91) from dish_ingredients where dish = 'すき焼き' and modifier = '' order by probability desc; | |
| select *, (probability * 79) from dish_ingredients where dish = 'オムライス' and modifier = '' order by probability desc; | |
| select *, (probability * 104) from dish_ingredients where dish = 'カレーライス' and modifier = '' order by probability desc; | |
| select *, (probability * 93) from dish_ingredients where dish = 'チャーハン' and modifier = '' order by probability desc; | |
| select *, (probability * 93) from dish_ingredients where dish = '冷やし中華' and modifier = '' order by probability desc; | |
| select *, (probability * 91) from dish_ingredients where dish = '南蛮漬け' and modifier = '' order by probability desc; | |
| select *, (probability * 68) from dish_ingredients where dish = '生姜焼き' and modifier = '' order by probability desc; | |
| select *, (probability * 78) from dish_ingredients where dish = '餃子' and modifier = '' order by probability desc; |
####################################################################################
| var classExample = { | |
| binded: function(){ console.info(this) }.bind(this), | |
| unBinded: function(){ console.info(this) } | |
| } | |
| classExample.binded(); | |
| // => Window {external: Object, chrome: Object, document: document, React: Object, ReactDOM: Object…} | |
| classExample.unBinded(); | |
| // => Object { binded: function(){ console.info(this) }.bind(this), unBinded: function(){ console.info(this) }} |
Question: Given a sequence of positive integers A and an integer T, return whether there is a continuous sequence of A that sums up to exactly T Example [23, 5, 4, 7, 2, 11], 20. Return True because 7 + 2 + 11 = 20 [1, 3, 5, 23, 2], 8. Return True because 3 + 5 = 8 [1, 3, 5, 23, 2], 7 Return False because no sequence in this array adds up to 7
Note: We are looking for an O(N) solution. There is an obvious O(N^2) solution which is a good starting point but is not the final solution we are looking for.