python |
Pythonタグが付けられた新着投稿 - Qiita |
ポケモンの最強タイプを全力で考える【グラフ理論】 |
https://qiita.com/masaka_programming/items/503eaa2c1fa776dfdb19
|
攻撃と防御を入れ替えたときの複合ダメージ倍率をそれぞれ計算し、それが段階の中でいくつだけ差があったかによってwxのyzに対する有利さを定めましょう。 |
2022-02-06 18:47:42 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
statsmodels(Python)を使って株価を時系列解析(1) |
https://qiita.com/motoyuki1963/items/feb03ebaa5bed9db5344
|
さて、コロナの大暴落は、時系列解析でどう表れるのでしょうか傾向変動、季節変動、不規則変動最初は基本である変動の解析です。 |
2022-02-06 18:30:13 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Django Custom User Model の作成 |
https://qiita.com/startours777/items/706d38e712b0c737a16a
|
ログイン成功ユーザを押下先ほどのアカウントが表示されている。 |
2022-02-06 18:02:17 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
React Hooks の依存リストのオブジェクトの比較について |
https://qiita.com/kutarou197/items/a09b6aa5d24c5319f470
|
なぜ更新されてしまうのか以下のように、useEffectでは、依存リストにcounterを指定しているのに、なぜ、counterが変更された場合も、メッセージが更新されてしまうのでしょうかuseEffectgtsetMessagenewDatetoStringにcounterが変更されましたcounter理由は、依存リストの比較はshallowequalであるためです。 |
2022-02-06 18:34:33 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
XXS攻撃対策についてNode.js Expressでアプリを構築して実例で理解する |
https://qiita.com/yuta-katayama-23/items/2c904de2bddbada97a5a
|
実際の実装はどうなるのかだが、ExpressであればresrenderviewlocalscallbackでHTMLを返すテンプレートエンジンでHTMLを生成してresponsebodyにセットするを行えば、自動的にContentTypetexthtmlcharsetutfになるので特に追加で実装が必要な事はない※自動的にContentTypeが設定されると言ったが、それはresrenderが実装されているresponsejsで、selfはthisなのでressendが実行されているが、ressendの実装を見ると、こことここでレスポンスbodyがstringの場合HMTLもstring、ContentTypeをtexthtmlに設定し、かつcharsetutfにする実装がされている。 |
2022-02-06 18:09:04 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS MWAA (Amazon Managed Workflows for Apache Airflow) からSecretManagerを使用してBigQueryに接続する |
https://qiita.com/Hisaaki-Kato/items/aec0e110164cfde55ead
|
MWAAでBigQueryのデータを扱うオペレーターを含むDAGを構築SecretManagerにGCPサービスアカウントの秘匿情報を格納実行確認MWAAでBigQueryのデータを扱うオペレーターを含むDAGを構築それでは早速やっていきましょうCloudFormationスタックCloudFormationでリソースを作成していきますが、BigQueryとの接続部分が本題なので、細かい値が公式のクイックスタートチュートリアルの通りにします。 |
2022-02-06 18:58:36 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
【AWS】EC2というサービスと各種設定項目 |
https://qiita.com/onishi_820/items/49a27df74775ecd1f71d
|
使用されていないキャパシティを利用するため、本来のECインスタンスより安価で使用することが可能になります。 |
2022-02-06 18:42:35 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
crond を実行する Docker コンテナを作成する |
https://qiita.com/juno_rmks/items/ef5ec13dd859b780b822
|
crondを実行するDockerコンテナを作成するゴールAmazonLinuxのイメージをベースにSupervisor上でcrondを実行するDockerコンテナを作成します。 |
2022-02-06 18:18:02 |
海外TECH |
DEV Community |
Why does dynamically adding properties is slow in JavaScript? |
https://dev.to/fromaline/why-does-dynamically-adding-properties-is-slow-in-javascript-4hm8
|
Why does dynamically adding properties is slow in JavaScript JS gives an ability to add properties to the object after it was created It gives a lot of freedom but has a performance cost at the same time JavaScript s object modelThe ECMAScript specification defines all objects as dictionaries with string keys mapping to property attributesProperty access is the most common operation in real world programs gt Value needs to be accessed fast so shapes come into play ShapesMultiple objects have the same shape if their properties are the same If it s the case the JS engine stores their Shape separately and then JSObjects point to it Shapes store the Offset of the value inside JSObject instead of the Value itself Transition chainsWhen you dynamically add properties to the object its Shape form a so called transition chain Next time you access a property of the object the JS engine needs to traverse its transition chain At scale performance suffers in this case How to optimize it like a top performer vNode properties are accessed on every render in Preact so this operation needs to be extremely fast To achieve it Preact developers add all properties in advance and assign undefined null to yet unknown const vnode type props key ref children null parent null depth dom null nextDom undefined component null hydrating null constructor undefined original original null vnodeId original P S Follow me on Twitter for more content like this Nick React tinkerer ️ fromaline You can render React App without a wrapper Did you know you can render lt App gt without id root wrapper Let me show you PM Jan |
2022-02-06 09:33:00 |
海外TECH |
DEV Community |
Streaming Data Solutions on AWS - Part 3 |
https://dev.to/aws-builders/streaming-data-solutions-on-aws-part-3-3ef2
|
Streaming Data Solutions on AWS Part You can use streaming data services for real time and near real time applications such as application monitoring fraud detection and live leaderboards Real time use cases require millisecond end to end latencies from ingestion to processing all the way to emitting the results to target data stores and other systems For example Netflix uses Amazon Kinesis Data Streams to monitor the communications between all its applications so it can detect and fix issues quickly ensuring high service uptime and availability to its customers While the most commonly applicable use case is application performance monitoring there are an increasing number of real time applications in ad tech gaming and IoT that fall under this category Streaming data solutions on AWS is a series containing different articles that review several scenarios for streaming workflows In these scenarios streaming data amp processing it provides the example companies with the ability to add new features and functionality By analyzing data as it gets created they can gain insights into what their business is doing AWS streaming services enable you to focus on your application to make time sensitive business decisions rather than deploying and managing the infrastructure Scenario Preparing clickstream data for data insights processesFast Sneakers is a fashion boutique with a focus on trendy sneakers The price of any given pair of shoes can go up or down depending on inventory and trends such as what celebrity or sports star was spotted wearing brand name sneakers on TV last night It is important for Fast Sneakers to track and analyze those trends to maximize their revenue Fast Sneakers does not want to introduce additional overhead into the project with new infrastructure to maintain They want to be able to split the development to the appropriate parties where the data engineers can focus on data transformation and their data scientists can work on their ML functionality independently To react quickly and automatically adjust prices according to demand Fast Sneakers streams significant events like click interest and purchasing data transforming and augmenting the event data and feeding it to a ML model Their ML model is able to determine if a price adjustment is required This allows Fast Sneakers to automatically modify their pricing to maximize profit on their products Fast Sneakers real time price adjustmentsThis architecture diagram shows the real time streaming solution Fast Sneakers created utilizing Kinesis Data Streams AWS Glue and DynamoDB Streams By taking advantage of these services they have a solution that is elastic and reliable without needing to spend time on setting up and maintaining the supporting infrastructure They can spend their time on what brings value to their company by focusing on a streaming extract transform load ETL job and their machine learning model To better understand the architecture and technologies that are used in their workload the following are some details of the services used AWS Glue and AWS Glue streamingAWS Glue is a fully managed ETL service that you can use to catalog your data clean it enrich it and move it reliably between data stores With AWS Glue you can significantly reduce the cost complexity and time spent creating ETL jobs AWS Glue is serverless so there is no infrastructure to set up or manage You pay only for the resources consumed while your jobs are running Utilizing AWS Glue you can create a consumer application with an AWS Glue streaming ETL job This enables you to utilize Apache Spark and other Spark based modules writing to consume and process your event data The next section of this document goes into more depth about this scenario AWS Glue Data CatalogThe AWS Glue Data Catalog contains references to data that is used as sources and targets of your ETL jobs in AWS Glue The AWS Glue Data Catalog is an index to the location schema and runtime metrics of your data You can use information in the Data Catalog to create and monitor your ETL jobs Information in the Data Catalog is stored as metadata tables where each table specifies a single data store By setting up a crawler you can automatically assess numerous types of data stores including DynamoDB S and Java Database Connectivity JDBC connected stores extract metadata and schemas and then create table definitions in the AWS Glue Data Catalog To work with Amazon Kinesis Data Streams in AWS Glue streaming ETL jobs it is best practice to define your stream in a table in an AWS Glue Data Catalog database You define a stream sourced table with the Kinesis stream one of the many formats supported CSV JSON ORC Parquet Avro or a customer format with Grok You can manually enter a schema or you can leave this step to your AWS Glue job to determine during runtime of the job AWS Glue streaming ETL jobAWS Glue runs your ETL jobs in an Apache Spark serverless environment AWS Glue runs these jobs on virtual resources that it provisions and manages in its own service account In addition to being able to run Apache Spark based jobs AWS Glue provides an additional level of functionality on top of Spark with DynamicFrames DynamicFrames are distributed tables that support nested data such as structures and arrays Each record is self describing designed for schema flexibility with semi structured data A record in a DynamicFrame contains both data and the schema describing the data Both Apache Spark DataFrames and DynamicFrames are supported in your ETL scripts and you can convert them back and forth DynamicFrames provide a set of advanced transformations for data cleaning and ETL By using Spark Streaming in your AWS Glue Job you can create streaming ETL jobs that run continuously and consume data from streaming sources like Amazon Kinesis Data Streams Apache Kafka and Amazon MSK The jobs can clean merge and transform the data then load the results into stores including Amazon S Amazon DynamoDB or JDBC data stores AWS Glue processes and writes out data in second windows by default This allows data to be processed efficiently and permits aggregations to be performed on data arriving later than expected You can configure the window size by adjusting it to accommodate the speed in response vs the accuracy of your aggregation AWS Glue streaming jobs use checkpoints to track the data that has been read from the Kinesis Data Stream For a walkthrough on creating a streaming ETL job in AWS Glue you can refer to Adding Streaming ETL Jobs in AWS Glue Amazon DynamoDBAmazon DynamoDB is a key value and document database that delivers single digit millisecond performance at any scale It s a fully managed multi Region multi active durable database with built in security backup and restore and in memory caching for internet scale applications DynamoDB can handle more than ten trillion requests per day and can support peaks of more than million requests per second Change data capture for DynamoDB streamsA DynamoDB stream is an ordered flow of information about changes to items in a DynamoDB table When you enable a stream on a table DynamoDB captures information about every modification to data items in the table DynamoDB runs on AWS Lambda so that you can create triggersーpieces of code that automatically respond to events in DynamoDB streams With triggers you can build applications that react to data modifications in DynamoDB tables When a stream is enabled on a table you can associate the stream Amazon Resource Name ARN with a Lambda function that you write Immediately after an item in the table is modified a new record appears in the table s stream AWS Lambda polls the stream and invokes your Lambda function synchronously when it detects new stream records Amazon SageMaker and Amazon SageMaker service endpointsAmazon SageMaker is a fully managed platform that enables developers and data scientists with the ability to build train and deploy ML models quickly and at any scale SageMaker includes modules that can be used together or independently to build train and deploy your ML models With Amazon SageMaker service endpoints you can create managed hosted endpoint for real time inference with a deployed model that you developed within or outside of Amazon SageMaker By utilizing the AWS SDK you can invoke a SageMaker endpoint passing content type information along with content and then receive real time predictions based on the data passed This enables you to keep the design and development of your ML models separated from your code that performs actions on the inferred results This enables your data scientists to focus on ML and the developers who are using the ML model to focus on how they use it in their code For more information on how to invoke an endpoint in SageMaker see InvokeEnpoint in the Amazon SageMaker API Reference Inferring data insights in real timeThe previous architecture diagram shows that Fast Sneakers existing web application added a Kinesis Data Stream containing click stream events which provides traffic and event data from the website The product catalog which contains information such as categorization product attributes and pricing and the order table which has data such as items ordered billing shipping and so on are separate DynamoDB tables The data stream source and the appropriate DynamoDB tables have their metadata and schemas defined in the AWS Glue Data Catalog to be used by the AWS Glue streaming ETL job By utilizing Apache Spark Spark streaming and DynamicFrames in their AWS Glue streaming ETL job Fast Sneakers is able to extract data from either data stream and transform it merging data from the product and order tables With the hydrated data from the transformation the datasets to get inference results from are submitted to a DynamoDB table The DynamoDB Stream for the table triggers a Lambda function for each new record written The Lambda function submits the previously transformed records to a SageMaker Endpoint with the AWS SDK to infer what if any price adjustments are necessary for a product If the ML model identifies an adjustment to the price is required the Lambda function writes the price change to the product in the catalog DynamoDB table SummaryAmazon Kinesis Data Streams makes it easy to collect process and analyze real time streaming data so you can get timely insights and react quickly to new information Combined with the AWS Glue serverless data integration service you can create real time event streaming applications that prepare and combine data for ML Because both Kinesis Data Streams and AWS Glue services are fully managed AWS takes away the undifferentiated heavy lifting of managing infrastructure for your big data platform letting you focus on generating data insights based on your data Fast Sneakers can utilize real time event processing and ML to enable their website to make fully automated real time price adjustments to maximize their product stock This brings the most value to their business while avoiding the need to create and maintain a big data platform Hope this guide helps you understand how to Design a Streaming Data Solution on AWS for a Preparing clickstream data for data insights processes scenario Let me know your thoughts in the comment section And if you haven t yet make sure to follow me on below handles connect with me on LinkedInconnect with me on Twitterfollow me on github️Do Checkout my blogs Like share and follow me for more content ltag user id follow action button background color important color fac important border color important Adit ModiFollow Cloud Engineer AWS Community Builder x AWS Certified x Azure Certified Author of Cloud Tech DailyDevOps amp BigDataJournal DEV moderator |
2022-02-06 09:22:19 |
海外TECH |
DEV Community |
How to display json in Flutter ? |
https://dev.to/frezyx/how-to-display-json-in-flutter--jf2
|
How to display json in Flutter Often when we developing applications using APIs we work with json models You have to look at the objects in the debugger print them to the console e t c I ve done this a lot and I m tired of it Therefore I want to introduce you the flutter json view package Now this package can work through constructors for json strings and files The package has the ability to customize individual types of fields and the all UI The package does not depend on other packages This makes him lightweight and independent Github link I will be happy if you support the project and put a star |
2022-02-06 09:20:03 |
海外TECH |
DEV Community |
How to use Styled Components with React.js |
https://dev.to/pratham10/how-to-use-styled-components-with-reactjs-59bh
|
How to use Styled Components with React jsStyled Components is react library that allows us to style react components individually In this tutorial you will learn about styled components amp how to use styled components in your React application We can use styled components in React amp react native applications but this guide will focus only on using styled components with React Table of contents What are Styled components But why Styled components Installing styled components Getting started Props in styled components Make it Responsive Overriding Styles Global styling Conclusion What are Styled components Styled Components allows us to write CSS in JavaScriptIt is a component based framework specially developed for react amp react native applications which uses component based approach to manage our styles It removes the mapping between components and styles This means that when you re defining your styles you re actually creating a normal React component that has your styles attached to it But why Styled components Reusable styles You re writing CSS in a component based approach which means once you define your styles you can use that anywhere inside your project No class name bugs In styled components you don t have to worry about naming conventions the library provides unique class name that eliminates duplication overlap or misspellings errors Easy to manage CSS You never have to find different files affecting the styling which makes it easier to manage CSS Eliminates unused code If any specific styled component is unused it automatically deletes all its styles Installing styled componentsStart by creating react applicationnpx create react app styled components tutorialTo use styled components you first have to install it using npm or yarn with npm npm install save styled components with yarn yarn add styled componentsor if you re not using any package manager you can use styled components with CDN just add this to bottom of your html file lt script src gt lt script gt Getting startedstyled components uses tagged template literals to style your components import React from react import styled from styled components Creating a Heading styled component that ll render an lt h gt tag with some additional styles const Heading styled h font size em color FED Creating a Container styled component that ll render an lt section gt tag with some additional styles const Container styled section padding em background BF function App return lt div gt lt Container gt lt Heading gt Styled Components lt Heading gt lt Container gt lt div gt You can visit codesandbox amp see the output In the above example we created styled components inside existing component file we can also create a separate file for styled components Heading js import styled from styled components const Heading styled h font size em color FED export default Heading Now you can use Heading Component in any component of the project App js import React from react import styled from styled components import the styled component import Heading from Heading const App gt return lt div gt lt Heading gt Styled Components lt Heading gt lt div gt export default App Props in styled componentsStyled components are functional components which means we can style components dynamically To make our components styles dynamic we use props Let s take a look at example Suppose you want different buttons in your application for ex Primary Danger etc const Button styled button background props gt props primary blue white color props gt props primary white blue font size em margin em padding em em border px solid blue border radius px return lt div gt lt Button gt Normal lt Button gt lt Button primary gt Primary lt Button gt lt div gt We are rendering two button components one normal button amp one with primary as prop Live code example here Make it ResponsiveTo make your components responsive we can use media queries just as we use them in plain CSS const Button styled button background props gt props primary blue white color props gt props primary white blue font size em margin em padding em em border px solid blue border radius px media min width px padding rem rem width rem media min width px padding rem rem width rem return lt div gt lt Button gt Normal lt Button gt lt Button primary gt Primary lt Button gt lt div gt Overriding stylesTo change a component slightly we can extend the style for a single use case For example const Button styled button color blue font size em margin em padding em em border px solid palevioletred border radius px const TomatoButton styled Button color tomato border color tomato return lt div gt lt Button gt Normal Button lt Button gt lt TomatoButton gt Tomato Button lt TomatoButton gt lt div gt Global StylingThankfully we have a bult in function createGlobalStyle in styled components to apply global styles to our component We can use createGlobalStyle to set same font family override default browser styling etc you got the point App js import React from react import styled createGlobalStyle from styled components import Container Nav Content from components const GlobalStyle createGlobalStyle body margin padding background teal font family Open Sans Helvetica Sans Serif const App gt return lt gt lt GlobalStyle gt lt Container gt lt Nav gt lt Content gt lt Container gt lt gt export default App Note Styles created with createGlobalStyle do not accept any childrenand that s it give yourself a pat on the back if you ve made it till the end ConclusionWe covered the fundamentals amp some basic concepts of styled components amp they are enough to get you rolling Now don t stop here use styled components in your next project and see how it goes Don t forget to check out styled components documentation |
2022-02-06 09:12:21 |
海外ニュース |
Japan Times latest articles |
Yuma Kagiyama lifts Japan into third place in figure skating team event |
https://www.japantimes.co.jp/sports/2022/02/06/olympics/winter-olympics/olympics-figure-skating/higuchi-team-event/
|
Yuma Kagiyama lifts Japan into third place in figure skating team eventKagiyama became just the third person to ever score above in the free skate joining back to back Olympic champion Yuzuru Hanyu and U S star Nathan |
2022-02-06 18:09:37 |
ニュース |
BBC News - Home |
Neighbours under threat after Channel 5 drops show |
https://www.bbc.co.uk/news/entertainment-arts-60277939?at_medium=RSS&at_campaign=KARANGA
|
australian |
2022-02-06 09:36:24 |
ニュース |
BBC News - Home |
'Nightingale of Bollywood' dies at 92 |
https://www.bbc.co.uk/news/world-asia-india-60094193?at_medium=RSS&at_campaign=KARANGA
|
bollywood |
2022-02-06 09:41:40 |
ニュース |
BBC News - Home |
Cyclone Batsirai: Madagascar battered by second storm in two weeks |
https://www.bbc.co.uk/news/world-africa-60264389?at_medium=RSS&at_campaign=KARANGA
|
batsirai |
2022-02-06 09:01:37 |
北海道 |
北海道新聞 |
タリバン「女性の安全確保」強調 アフガンで6命令、抑圧否定 |
https://www.hokkaido-np.co.jp/article/642537/
|
安全確保 |
2022-02-06 18:17:00 |
北海道 |
北海道新聞 |
朝鮮半島伝統衣装に韓国反発 五輪開会式登場に「文化の侵奪」 |
https://www.hokkaido-np.co.jp/article/642536/
|
中国の少数民族 |
2022-02-06 18:11:00 |
北海道 |
北海道新聞 |
ROCワリエワ無敵、圧巻の初陣 大技軽々、情感豊かな15歳 |
https://www.hokkaido-np.co.jp/article/642535/
|
金メダル |
2022-02-06 18:01:00 |
北海道 |
北海道新聞 |
学力低下で2000兆円損失 コロナ禍で生涯収入減、世銀警鐘 |
https://www.hokkaido-np.co.jp/article/642518/
|
世界銀行 |
2022-02-06 18:02:02 |
ビジネス |
プレジデントオンライン |
「平家を捨て源氏に乗り換える」教科書には載っていない北条時政と源頼朝の篤すぎる信頼関係 - 決して「ポンコツ」キャラではない |
https://president.jp/articles/-/54436
|
信頼関係 |
2022-02-06 19:00:00 |
海外TECH |
reddit |
パスタの量1人前100gって多すぎない? みんな何gぐらい茹でてるん? |
https://www.reddit.com/r/lowlevelaware/comments/slsj1f/パスタの量1人前100gって多すぎない_みんな何gぐらい茹でてるん/
|
wlevelawarelinkcomments |
2022-02-06 09:10:34 |
コメント
コメントを投稿