AWS |
lambdaタグが付けられた新着投稿 - Qiita |
Lex使用時、Lambdaでできるテクニック |
https://qiita.com/holdout0521/items/a242a134c3a48f13b654
|
APIキーなので、本来は、確認プロンプトに表示しませんが、以下のように、英数字をスロット値に入れることができました。 |
2022-02-20 22:54:34 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
[JavaScript] プロトタイプチェーンをいじって継承元を変更する |
https://qiita.com/haru52/items/294bf8ef6b224cd397d1
|
JavaScriptプロトタイプチェーンをいじって継承元を変更する環境Nodejsv詳細JavaScriptのプロトタイプチェーンをいじれば人を神のサブクラスにすることもできる。 |
2022-02-20 22:32:00 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
ブラウザゲームを作ってみよう(その5:図形表示) |
https://qiita.com/noji505/items/3c57e0b5fb945a5b3c2f
|
drawRect・・指定した大きさと色の枠を表示するdrawFill・・指定した大きさと色で塗りつぶして表示する実行イメージsamplejsdrawRectxnulldrawFillxFFnull上記のソースで、以下のような表示になります。 |
2022-02-20 22:21:43 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
javaScript84_String型オブジェクトのメソッド |
https://qiita.com/merikento/items/dd67e331f487de5045ae
|
javascriptstring |
2022-02-20 22:14:38 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS SAA 勉強メモ |
https://qiita.com/glaciermelt00/items/b333213176e58e8374fb
|
AWSSAA勉強メモ背景SAA受験に向けて問題を解いていたが、レアケースな問題や、よく理解できていない問題が結構ある。 |
2022-02-20 22:12:28 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
OWSP Top10のとRailsにおける対策 |
https://qiita.com/sobameshi0901/items/39fb4388443cf63c82c5
|
説明アプリケーションスタックのいずれかの部分におけるセキュリティ堅牢化の不足、あるいはクラウドサービスでパーミッションが不適切に設定されている必要のない機能が有効、あるいはインストールされている例えば、必要のないポートやサービス、ページ、アカウント、特権デフォルトのアカウントとパスワードが有効になったまま変更されていないエラー処理がユーザに対して、スタックトレースやその他余計な情報を含むエラーメッセージを見せるアップグレードしたシステムでは、最新のセキュリティ機能が無効になっているか正しく設定されていないアプリケーションサーバやアプリケーションフレームワーク例えば、Struts、Spring、ASPNET、ライブラリ、データベース等のセキュリティの設定が、安全な値に設定されていないサーバがセキュリテイヘッダーやディレクティブを送らなかったり、安全な値に設定されていなかったりする防止方法繰り返し堅牢化するプロセスは、素早くかつ容易に他の環境に展開され、正しくロックダウンすること。 |
2022-02-20 22:09:35 |
海外TECH |
DEV Community |
Minimal Blockchain |
https://dev.to/naemazam/minimal-blockchain-1ma4
|
Minimal Blockchain What is blockchain Blockchain is a system of recording information in a way that makes it difficult or impossible to change hack or cheat the system A blockchain is essentially a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain Each block in the chain contains a number of transactions and every time a new transaction occurs on the blockchain a record of that transaction is added to every participant s ledger The decentralised database managed by multiple participants is known as Distributed Ledger Technology DLT Blockchain is a type of DLT in which transactions are recorded with an immutable cryptographic signature called a Hash HashingWe want a key that can represent a block of data We want a key that is hard to fake or brute force but is easy to verify This is where hashing comes in Hashing is a function H x that satisfies the following properties The same input x always produce the same output H x Different or even similar inputs x should produce entirely different outputs H x Computationally easy to get H x from input x but intractable to reverse the process i e getting the input x from a known hash H This is how Google stores your password without actually storing your password They store the hash of your password H password such that they can verify your password by hashing your input and compare Without going into too much details we will use SHA algorithm to hash our block A Minimal BlockLet s make an object class called MinimalBlock It is initialized by providing an index a timestamp some data you want to store and something called previous hash The previous hash is the hash key of the previous block and it acts as a pointer such that we know which block is the previous block and hence how blocks are connected import hashlibclass MinimalBlock def init self index timestamp data previous hash self index indexself timestamp timestampself data dataself previous hash previous hashself hash self hashing def hashing self key hashlib sha key update str self index encode utf key update str self timestamp encode utf key update str self data encode utf key update str self previous hash encode utf return key hexdigest In other words Block x contains index x a timestamp some data and the hash of the previous block x H Block x Now that this block is complete it can be hashed to generate H Block x as a pointer in the next block A Minimal ChainBlockchain is essentially a chain of blocks and the connection is made by storing the hash of the previous block Therefore a chain can be implemented using a Python list and blocks i representing the i th block class MinimalChain def init self initialize when creating a chainself blocks self get genesis block def get genesis block self return MinimalBlock datetime datetime utcnow Genesis arbitrary def add block self data self blocks append MinimalBlock len self blocks datetime datetime utcnow data self blocks len self blocks hash def get chain size self exclude genesis blockreturn len self blocks def verify self verbose True flag Truefor i in range len self blocks if self blocks i index i flag Falseif verbose print f Wrong block index at block i if self blocks i hash self blocks i previous hash flag Falseif verbose print f Wrong previous hash at block i if self blocks i hash self blocks i hashing flag Falseif verbose print f Wrong hash at block i if self blocks i timestamp gt self blocks i timestamp flag Falseif verbose print f Backdating at block i return flagdef fork self head latest if head in latest whole all return copy deepcopy self deepcopy since they are mutableelse c copy deepcopy self c blocks c blocks head return cdef get root self chain min chain size min self get chain size chain get chain size for i in range min chain size if self blocks i chain blocks i return self fork i return self fork min chain size When we initialize a chain we automatically assign a th block also known as Genesis block to the chain with function get genesis block This block marks the start of your chain Note that previous hash is arbitrary in the Genesis block Adding a block can be achieved by calling add block Data VerificationData integrity is important to databases and blockchains provide an easy way to verify all the data In function verify we check the following Index in blocks i is i and hence no missing or extra blocks Compute block hash H blocks i and cross check with the recorded hash Even if a single bit in a block is altered the computed block hash would be entirely different Verify if H blocks i is correctly stored in next block s previous hash Check if there is any backdating by looking into the timestamps ForkingIn some case you might want to branch out of a chain This is called forking as demonstrated as fork in the code You would copy a chain or root of a chain and then go separate ways It is vital to use deepcopy in Python since Python list is mutable The TakeawayHashing a block creates a unique identifier of a block and a block s hash forms part of the next block to establish a link between blocks Only the same data would create the same hash If you want to amend data in the rd block the hash of the rd block is changed and the previous hash in the th block needs to change as well previous hashis part of the th block and hence its hash changes as well and so on |
2022-02-20 13:49:46 |
海外TECH |
DEV Community |
Responsive Accordion Design using HTML, CSS, and Javascript |
https://dev.to/incoderweb/responsive-accordion-design-using-html-css-and-javascript-gpm
|
Responsive Accordion Design using HTML CSS and JavascriptHello readers today in this blog you ll learn how to create a responsive accordion design using HTML CSS and Javascript In our previous blog we saw how to create custom context or right click menu design using HTML CSS and Javascript Now it s time to create a responsive accordion design I ve also shared many projects related to Javascript So don t forget to check here An accordion is an element used in the graphical user interface Nowadays almost every website uses an accordion for answering frequently asked questions FAQ In this design Responsive Accordion Design we have an accordion in the middle of the page as you can see in the image above When you click on an item then a class will be added by javascript and the accordion will open with a smooth transition The background color of the header part will be changed If you re feeling difficulty understanding what am I trying to say So you can check source code and preview as well Preview is available here Responsive Accordion Design Source Code HTML Code lt Created By InCoder gt lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Responsive FAQ Accordion Design InCoder lt title gt lt link rel stylesheet href main css gt lt link rel stylesheet href gt lt head gt lt body gt lt div class accordionBox gt lt div class accordionItem gt lt div class header gt lt h gt First Accordion lt h gt lt i class fa solid fa angle right gt lt i gt lt div gt lt div class body gt Lorem ipsum dolor sit amet consectetur adipisicing elit Numquam praesentium ut nobis maxime nisi porro Consectetur blanditiis cum molestias doloremque lt div gt lt div gt lt div class accordionItem gt lt div class header gt lt h gt Second Accordion lt h gt lt i class fa solid fa angle right gt lt i gt lt div gt lt div class body gt Lorem ipsum dolor sit amet consectetur adipisicing elit Numquam praesentium ut nobis maxime nisi porro Consectetur blanditiis cum molestias doloremque lt div gt lt div gt lt div class accordionItem gt lt div class header gt lt h gt Third Accordion lt h gt lt i class fa solid fa angle right gt lt i gt lt div gt lt div class body gt Lorem ipsum dolor sit amet consectetur adipisicing elit Numquam praesentium ut nobis maxime nisi porro Consectetur blanditiis cum molestias doloremque lt div gt lt div gt lt div class accordionItem gt lt div class header gt lt h gt Fourth Accordion lt h gt lt i class fa solid fa angle right gt lt i gt lt div gt lt div class body gt Lorem ipsum dolor sit amet consectetur adipisicing elit Numquam praesentium ut nobis maxime nisi porro Consectetur blanditiis cum molestias doloremque lt div gt lt div gt lt div gt lt body gt lt html gt CSS Code Created By InCoder import url display swap margin padding font family Poppins sans serif body height vh display flex max height vh align items center justify content center background color c accordionBox width rem margin rem max width rem padding px px border radius rem background color fff accordionItem transition all s border radius rem accordionItem first child margin top important accordionItem last child margin bottom important accordionItem header display flex cursor pointer padding px px align items center border radius rem justify content space between accordionItem header h accordionItem header i pointer events none accordionItem header hover background color rgba accordionItem header i font size px margin right px accordionItem body max height overflow hidden margin top rem transition all s margin left rem accordionItem active margin px px background color rgba accordionItem active body margin top px max height rem padding bottom rem accordionItem active header background color rgba accordionItem active header i transition all s transform rotate deg Javascript Codelet accordion document querySelector accordionBox accordionItem document querySelectorAll accordionItem accordionItem forEach elem gt elem addEventListener click function e e srcElement parentElement classList toggle active |
2022-02-20 13:49:05 |
ニュース |
BBC News - Home |
The Queen tests positive for Covid |
https://www.bbc.co.uk/news/uk-60453566?at_medium=RSS&at_campaign=KARANGA
|
buckingham |
2022-02-20 13:40:51 |
ニュース |
BBC News - Home |
Storm Franklin: More wind warnings after Storm Eunice |
https://www.bbc.co.uk/news/uk-60452334?at_medium=RSS&at_campaign=KARANGA
|
warnings |
2022-02-20 13:52:21 |
ニュース |
BBC News - Home |
DUP MLA Christopher Stalford dies aged 39 |
https://www.bbc.co.uk/news/uk-northern-ireland-60451845?at_medium=RSS&at_campaign=KARANGA
|
deputy |
2022-02-20 13:48:30 |
北海道 |
北海道新聞 |
羽生が震災被災者らにメッセージ 仙台市出身「私も応援できたら」 |
https://www.hokkaido-np.co.jp/article/648048/
|
北京五輪 |
2022-02-20 22:17:00 |
コメント
コメントを投稿