AWS |
AWS Management Tools Blog |
Use the power of script steps in your Systems Manager Automation runbooks |
https://aws.amazon.com/blogs/mt/use-script-steps-in-your-systems-manager-automation-runbooks/
|
Use the power of script steps in your Systems Manager Automation runbooksCustomers have been using AWS Systems Manager Automation documents for years to define to define a sequence of actions to take on their AWS infrastructure such as invoking an AWS Lambda function or copying an Amazon Machine Image AMI These documents now referred to as runbooks are simple to use yet powerful The aws executeScript action … |
2021-05-07 13:38:08 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Python から HTTP POST リクエストで Node-RED と連携するメモ(Python3版) |
https://qiita.com/a10teki/items/3a7ee0f972166349925e
|
行目importurllibモジュールをimporturllibrequestimporturllibparseに変更行目requesturllibRequesturlをrequesturllibrequestRequesturldataencodeに変更行目responseurlliburlopenrequestdataをresponseurllibrequesturlopenrequestに変更まとめプログラムは違いが分かりやすいようにftseabassjpMEMOさんのプログラムで試しました。 |
2021-05-07 22:12:54 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
VSCode 拡張機能の中で Python を動かす |
https://qiita.com/pn11/items/158ad7a8fd80f3fc61a1
|
VSCode拡張機能の中でPythonを動かすTLDRNodejsのpythonshellパッケージを使うとVSCode拡張機能内でPythonが呼び出せます。 |
2021-05-07 22:04:57 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
サブネット内からインターネットにping・tracerouteが通りません |
https://teratail.com/questions/337092?rss=all
|
サブネット内からインターネットにping・tracerouteが通りません前提・実現したいことラズパイを用いたサブネットを構築しています。 |
2021-05-07 22:55:34 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
送付状個別自動作成について |
https://teratail.com/questions/337091?rss=all
|
|
2021-05-07 22:53:20 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
コードが間違っているようで文字が整列されません。 |
https://teratail.com/questions/337090?rss=all
|
コードが間違っているようで文字が整列されません。 |
2021-05-07 22:52:14 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
LaravelのデータをJavaScriptで取得したい。 |
https://teratail.com/questions/337089?rss=all
|
LaravelのデータをJavaScriptで取得したい。 |
2021-05-07 22:50:48 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Webページから起動されるバットファイルが 部分的に動作しない |
https://teratail.com/questions/337088?rss=all
|
Webページから起動されるバットファイルが部分的に動作しない一つのバットファイルがあり当該処理の実行中を表すファイルを、同Webサーバ内に作成クラウド環境からある種のデータファイルを取得する別バットファイルを起動という作りになっています。 |
2021-05-07 22:33:08 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
herokuエラー rails refile 本番環境 |
https://teratail.com/questions/337087?rss=all
|
herokuエラーrailsrefile本番環境前提・実現したいこと今現在webアプリを作っておりherokuにデプロイしたところエラーが出てきたのですがエラー文にあるようにRefilesecretkeyをapplicationcontrollerrenderer入力して再起動をしたのですが同じようなエラーが出てしまいます。 |
2021-05-07 22:31:43 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
WordPress プラグイン「BackWPup」が管理画面のメニューに表示されません |
https://teratail.com/questions/337086?rss=all
|
backwpup |
2021-05-07 22:29:05 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
JAVAのHttpURLConnectionのgetResponseCodeでIOExceptionが発生 |
https://teratail.com/questions/337085?rss=all
|
JAVAのHttpURLConnectionのgetResponseCodeでIOExceptionが発生以下のようにURLが有効かどうか判別したいのですが実行時にintnbspresponseCodenbspnbsphucgetResponseCodeの行でIOExceptionが発生しています。 |
2021-05-07 22:22:04 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
画像から引き出した情報を元にテキストファイルを作成する方法 |
https://teratail.com/questions/337084?rss=all
|
|
2021-05-07 22:22:00 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
kotlinで文字のアニメーション表示をしたいです。 |
https://teratail.com/questions/337083?rss=all
|
kotlinで文字のアニメーション表示をしたいです。 |
2021-05-07 22:17:34 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
GASからGoogleフォームを作るときの特定のひらがなと数字を混ぜた入力規則 |
https://teratail.com/questions/337082?rss=all
|
GASからGoogleフォームを作るときの特定のひらがなと数字を混ぜた入力規則前提・実現したいこと初歩的な質問失礼します。 |
2021-05-07 22:17:12 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
[AWS]未解決エラー:Aws::Sigv4::Errors::MissingCredentialsError: Cannot load `Rails.config.active_storage.service`: |
https://qiita.com/tochisuke221/items/d9070064e7125d792949
|
|
2021-05-07 22:28:00 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
visudo: /etc/sudoers がビジー状態です。後で再試行してくださいエラーへの対応 |
https://qiita.com/YotaHamasaki/items/7b85ef9c77e2e9b1b964
|
例えばecuserの状態でエラーが発生したのであれば、ルートディレクトリではなく、ecuserにて削除を実施する必要があります。 |
2021-05-07 22:06:45 |
Linux |
Ubuntuタグが付けられた新着投稿 - Qiita |
certbotでHTTPS通信を行う |
https://qiita.com/shibafu/items/6fe2f03cd0993cb8a8f3
|
sudoaptinstallcertbotpythoncertbotnginxCertbotを使用する準備ができましたが、NginxにSSLを自動設定するには、Nginxの設定をいくつか確認する必要があります。 |
2021-05-07 22:48:37 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
[AWS]未解決エラー:Aws::Sigv4::Errors::MissingCredentialsError: Cannot load `Rails.config.active_storage.service`: |
https://qiita.com/tochisuke221/items/d9070064e7125d792949
|
|
2021-05-07 22:28:00 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
visudo: /etc/sudoers がビジー状態です。後で再試行してくださいエラーへの対応 |
https://qiita.com/YotaHamasaki/items/7b85ef9c77e2e9b1b964
|
例えばecuserの状態でエラーが発生したのであれば、ルートディレクトリではなく、ecuserにて削除を実施する必要があります。 |
2021-05-07 22:06:45 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
[AWS]未解決エラー:Aws::Sigv4::Errors::MissingCredentialsError: Cannot load `Rails.config.active_storage.service`: |
https://qiita.com/tochisuke221/items/d9070064e7125d792949
|
|
2021-05-07 22:28:00 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
visudo: /etc/sudoers がビジー状態です。後で再試行してくださいエラーへの対応 |
https://qiita.com/YotaHamasaki/items/7b85ef9c77e2e9b1b964
|
例えばecuserの状態でエラーが発生したのであれば、ルートディレクトリではなく、ecuserにて削除を実施する必要があります。 |
2021-05-07 22:06:45 |
海外TECH |
DEV Community |
Data Structure APIs , A brief overview of APIs as they relate to JavaScript data structures. |
https://dev.to/dimer191996/data-structure-apis-a-brief-overview-of-apis-as-they-relate-to-javascript-data-structures-k59
|
Data Structure APIs A brief overview of APIs as they relate to JavaScript data structures Two month of data structure and I m completely lost i have ADHD and this is my only way to learn this stuff writing anyway I m a straight up beginner and if I lie in this article fill free to correct me leeeeet goooo ️Data structures are all about choosing the right tool for the job Do you need to store data in an ordered way or do you just need to be able to store it and retrieve it quickly What s more important to your use case how fast the data structure performs or how much memory it takes up Different data structures all have advantages disadvantages and use cases and that s the whole reason that there are different data structures Consider the Array in JavaScript It s a really great data structure for storing ordered data because you can retrieve elements by index number If you want the first element of an array all you need to do is fetch it with index arrayName It also provides all sorts of helpful methods for manipulating elements such as push pop sort and more However if you want to find out if a particular element exists in an array you may need to iterate through the entire array What if I asked you to keep track of a series of numbers as I gave them to you and then asked at the end whether I d given you a particular number you could probably do that in your memory But if I asked you to do that in a computer program you d have to make choices about how to store the data Let s look at two possibilities of how we d build storeNumber and doYouHaveThisNumber functions Given the following list of numbers How might you store these numbers if I gave you each at a time You might use an array const listOfNumbers const storeNumber num gt listOfNumbers push num const doYouHaveThisNumber num gt listOfNumbers includes num In this program storeNumber adds a number to the array and doYouHaveThisNumber returns true if that number exists in the array and false otherwise Looks pretty good but what if you had numbers doYouHaveThisNumber might start getting pretty slow since Array prototype includes iterates through the entire array until it finds the input value Let s try using another built in data type in JavaScript the Object Since all we want to keep track of is whether we received a particular number we can just store those numbers in an object and set their values to true if we received them const receivedNumbers const storeNumber num gt receivedNumbers num true const doYouHaveThisNumber num gt receivedNumbers num true In this case we ll have the same result on the outside but because retrieving a value from an object is much faster than iterating through an array the overall result will be faster In both cases the public API of the code meaning the parts of the code that we want the end user to interact with remained the same we had two functions storeNumber and doYouHaveThisNumber The underlying implementation or the way the functionality was actually achieved is what altered But wait a minute Wth is an API API is an acronym for application programming interface An API allows end users to access properties and methods of data structures easily and without needing to do the “behind the scenes work For example if you want to add a new element to the end of an array you don t need to loop through the entire array counting how many elements there are and then setting myArray currentCount equal to the new value Instead you can just call push with the value you want to add As a JavaScript programmer you don t actually need to know the actual strategy or the underlying implementation of how push added an element to the end of the array in order to use it The API of arrays provides lots of useful functionality from adding and removing elements to the start and end of the array to iterator methods that call a function on each element If you wanted to find the smallest number in an array of numbers however you d have to implement that functionality yourself Creating Your Own APIsAs you build your own data structures you will implement the functionality to create public APIs As in the example of storeNumber and doYouHaveThisNumber the same public API can be implemented in different ways so it s important to think about the advantages and disadvantages of different implementations An API is like a message to end users Some languages have classes that can have methods or fields that are either public can be called from anywhere or private can only be called from within the class Public methods are the ones that end users of that class can call and private methods are only used by the class itself JavaScript doesn t really support this concept so properties that aren t meant to be public are often preceded by an underscore Let s look at an example where we want to build a data structure with a restricted API A stack is a data structure that only allows data to be added pushed or removed popped from the “top of the stack It just so happens that we could use an array as a stack since it already has a push and pop method However arrays also allow you to add elements to the beginning or randomly access elements by index We re not going to cover all the ins and outs of the stack data structure right now but to demonstrate public API vs implementation let s build a quick custom Stack class class Stack constructor this array In Stack the array itself is stored as array so it s a signal to other developers that to use the Stack as intended they shouldn t need to access it directly From there we can implement the push and pop methods class Stack constructor this array push newValue this array push newValue pop return this array pop Now we ve created a Stack data structure that limits direct interaction with the underlying data to push and pop A developer could still access our underlying array to do other manipulation const stack new Stack stack array unshift value but they would then be breaking the intended behavior of the Stack class The whole point of a public API is that we offer functionality to other end users If somebody were using our Stack class in a program we could totally change the underlying implementation and as long as the end user API remained the same their program should continue to function As you build your own classes and data structures it s important to keep in mind this distinction between implementation what does this need internally to do its job and the outside API how should users of this actually interact with it |
2021-05-07 13:53:52 |
海外TECH |
DEV Community |
Is 0Kb of *HTML* in your future? 🔮 A website without JS...HTML...CSS or IMAGES!?⁉😱 |
https://dev.to/inhuofficial/is-0kb-of-html-in-your-future-a-website-without-js-html-css-or-images-37cn
|
Is Kb of HTML in your future A website without JS HTML CSS or IMAGES If you are new here then you might not have seen that I like to abuse the internet and for those of you who know my shenanigans you know what is coming In case you missed it first I built a countdown timer without any JS CSS or HTML pfff child s play I hear you say Fine I built a password generator in pure CSS yawn Really not even a smile well what about when I managed to make animations without any CSS JS or Images slightly interesting Ok surely you like that I managed to squeeze a game of pong into a px by px image using stenography mildly intriguing you say Well you are one tough cookie So how about this one A website that has network request and bytes of HTML sent with that network request Now of course this isn t possible I mean of course it isn t possible a website with a single network request and bytes of HTML in that request no CSS requests no JS requests no image requests just a single file with no HTML that just isn t going to work right RIGHT Well if you use FireFox then the answer is it is kind of possible Open this page in FireFox it looks like a website albeit a super basic one Sadly it only works in FireFox so you might have to bookmark the article and come back to it when you can get to a laptop PC It isn t that impressive until you open developer tools and head over to the network Tab And this is my second trick I am going to read your mind ready Ok so one request for the page wait there is no HTML like he said how on earth ahhh he used the lt body gt element I get it he must have inlined some styles but wait a minute where are the styles actually coming from there is no CSS file showing in developer tools is it a service worker no that would show up is it from a cookie no but what a great idea for my next article how the Cue stunned silence some head scratching and then a load of fiddling until you realise the trick p s it has nothing to do with the favicon that is just configured site wide So there it is a website with kb of HTML JS CSS or IMAGES Talk about performant I will leave it to you to explore and work out what is going on but I love the fact that I built a website without sending a single byte of HTML Once you have worked out how I did it have a go yourself and see how impressive you can make a website with a single network request and kb of HTML A few thank yous The CSS to create the laptop is a butchered version of a codepen by pandaquests be sure to check out their pens and give them some love as they create some great stuff Also a big shout out to the origin of this or at least the earliest article I could find on it over at impressivewebs com they also explain what is happening if you didn t manage to work it out yourself Yes I stole the title from this article as I thought it was funny go give that article some love or grief depending on your view point it was a controversial one Oh and a little thank you to everyone who has read my silly and not silly articles so far k page views might not be much but it is a nice start for someone who has only been writing for months so once again thanks to you all |
2021-05-07 13:47:39 |
海外TECH |
DEV Community |
🚀10 Trending projects on GitHub for web developers - 7th May 2021 |
https://dev.to/iainfreestone/10-trending-projects-on-github-for-web-developers-7th-may-2021-2ckf
|
|
2021-05-07 13:46:33 |
海外TECH |
DEV Community |
Serverless Framework vs SAM vs AWS CDK |
https://dev.to/tastefulelk/serverless-framework-vs-sam-vs-aws-cdk-1g9g
|
Serverless Framework vs SAM vs AWS CDKWhen building serverless apps on AWS today there s a couple of different toolkits available that helps you develop test and deploy your project Serverless Framework was the king for a long time but both AWS SAM and the CDK have been increasing in popularity lately But which one is the best to use in a new project and what s the difference between them anyway After all they re all just tools to produce Cloudformation templates anyway right To get an understanding of the strengths and disadvantages of each option I decided to build an identical example application across all three and compare the approaches By the end of this post I hope you ll have a basic understanding of the Serverless Framework AWS SAM and the CDK and that you ll be able to make an educated choice on what ll suit your next project best based on your needs and preferences Our Example ApplicationTo keep it interesting the app we re using to showcase each framework certainly isn t your typical ToDo app it s a ToDont app A user can send a POST request to an API Gateway describing something they really shouldn t do a Lambda function takes the ToDont item and puts it on an SQS queue that acts as a buffer before finally another Lambda function consumes the buffer queue pretends to do some heavy processing on the item and persists it in a DynamoDB table The application architecture is simple enough to easily comprehend but complex enough to resemble an actual app To keep the code compact and readable best practices and common sense have sometimes had to be omitted All configs are complete and fully functional however and if you want to play around with the examples and deploy the apps yourself you can find the code and the full examples here Our POST Lambda function looks like this src post jsconst SQS require aws sdk client sqs const sqs new SQS const handler async event gt console log event event const id title JSON parse event body await sqs sendMessage QueueUrl process env QUEUE URL MessageBody JSON stringify id title return statusCode module exports handler the Process Lambda looks like this src process jsconst DynamoDB require aws sdk client dynamodb const marshall require aws sdk util dynamodb const ddb new DynamoDB const handler async event gt console log event event const tasks event Records map record gt const id title JSON parse record body return ddb putItem TableName process env TABLE NAME Item marshall title id return Promise all tasks module exports handler PrerequisitesIf you want to follow along and deploy the apps please note the following Each of the comparisons below assumes that you ve installed the following packages as dependencies in your project aws sdk client dynamodb aws sdk util dynamodb aws sdk client sqsWhile Yarn is used as the package manager amp script runner below you could of course use NPM instead with the corresponding commands All of the examples assume that you ve got an AWS credentials default profile configured Serverless FrameworkServerless Framework Serverless below has been around for a long time now and has long been the preferred framework for a large part of the community It s a simple tool that abstracts away and simplifies many of the nastier parts of CloudFormation and comes packed with features to simplify testing and deployment of your app The preferred way to run the Serverless CLI is to install it as a dev dependency in your project by running yarn add serverless D and then all that s missing is a serverless yml file which is used to define your application and its infrastructure You can find the full configuration reference here but in short the serverless yml consists of two parts Your Serverless Framework configuration is used to describe your application stack AWS environment and lambda functionsAny additional infrastructure defined as CloudFormation resources such as our DynamoDB table and SQS queue Here s how the serverless yml for our application looks serverless ymlservice sls todontprovider name aws region eu north runtime nodejs x environment Inject environment variables TABLE NAME self custom tableName QUEUE URL Ref todontsQueue iamRoleStatements Configure IAM role statements Effect Allow Action sqs sendMessage Resource self custom queueArn Effect Allow Action dynamodb putItem Resource self custom tableArn custom Custom variables that we can reference elsewhere tableName self service table queueName self service queue tableArn Get ARN of table with CloudFormation helper Fn GetAtt todontsTable Arn queueArn Get ARN of queue with CloudFormation helper Fn GetAtt todontsQueue Arn functions Define our two Lambda functions post handler src post handler events Invoke on post requests to todonts http method post path todonts process handler src process handler events Consume SQS queue sqs arn self custom queueArn CloudFormation below to define our infrastructure resourcesresources Resources todontsTable Type AWS DynamoDB Table Properties TableName self custom tableName AttributeDefinitions AttributeName id AttributeType S KeySchema AttributeName id KeyType HASH BillingMode PAY PER REQUEST todontsQueue Type AWS SQS Queue Properties QueueName self custom queueName Now to deploy our application all we need to do is run yarn serverless deploy The Serverless CLI includes some utility features that can be used to print or tail the logs of a deployed function by running yarn serverless logs function process tail or even invoke the function with yarn serverless invoke function process Most of the time during development however you re not going to be invoking the function Instead you ll let Serverless emulate and run the functions locally and you can do that by running yarn serverless invoke local function post ProsLarge amp helpful communityThe plugin ecosystemSimple configuration with neat variable supportGreat debugging and testing utilitiesConsMost apps will need to resort to CloudFormation definitions for some parts of the infrastructureHard to share configuration and componentsOnly YAML configurations It s technically supported to write the configuration in JS but the documentation for it is close to non existentI ve seen a lot of devs struggle with understanding where the line between Serverless configuration and CloudFormation configuration actually or why they have to change the syntax in the middle of the fileResources Get started with Serverless FrameworkServerless Stack tutorial for deplying a production Serverless app AWS SAMMuch like Serverless Framework SAM or the Serverless Application Model is a combination of an abstraction layer to simplify CloudFormation and a CLI with utilities to test and deploy your app Here s the official install instructions for the SAM CLI which is installed globally on your system SAM uses a samconfig toml file to describe information about your app such as the name and where and how it should be deployed and a template yml file to describe the actual resources your app will use The template yml format follows the CloudFormation template anatomy templates but with a few added fields Let s have a look template yml Boilerplate to identify template as SAM templateAWSTemplateFormatVersion Transform AWS Serverless Description sam todontsGlobals Function Runtime nodejs x Environment Inject environment variables Variables QUEUE URL Ref TodontsQueue TABLE NAME Ref TodontsTableParameters Parameters which can be filled by the CLI on deploy TableName Description Name of DynamoDB table Type String Default sam todonts table QueueName Description Name of SQS queue Type String Default sam todonts queueResources PostFunction Type AWS Serverless Function FunctionName sam todonts post Properties Handler src post handler Events Post Invoke on post requests to todonts Type HttpApi Properties Path todonts Method post Policies SQSSendMessagePolicy Use predefined IAM policy QueueName Fn GetAtt TodontsQueue QueueName ProcessFunction Type AWS Serverless Function Properties Handler src process handler Events Consume SQS queue SQSQueueEvent Type SQS Properties Queue Fn GetAtt TodontsQueue Arn Policies Use predefined IAM policy DynamoDBWritePolicy TableName Ref TodontsTable TodontsTable Type AWS DynamoDB Table Properties TableName sam todonts table AttributeDefinitions AttributeName id AttributeType S KeySchema AttributeName id KeyType HASH BillingMode PAY PER REQUEST TodontsQueue Type AWS SQS Queue Properties QueueName sam todonts queueThe configuration is a bit verbose but luckily the CLI can help you with a place to start by running sam init and answering a few questions about what your planning to build We can generate the samconfig tomlfile and deploy at the same time by running sam deploy guided Again much like the Serverless Framework CLI SAM comes loaded with utility features to test and debug your app sam local invoke functionName can be used to run a Lambda function or you can start a local HTTP server that hosts your function by running sam local start api You can also easily fetch the logs from a deployed function by running sam logs name functionName The great thing about separating the definition of the app and how the app is built in two different files is that the template yml file can be written very generically so that it can be shared and re used you ll just have a different samconfig toml in each project SAM also integrates very well with CodeBuild to enable blue green deployments ProsEnables sharing amp re use of templatesWell integrated with AWS build pipelinesGreat debugging and testing utilitiesConsVerbose configurationCLI is missing some features you d expect such as tearing down a deployed app Resources Getting started with AWS SAMServerless Application RepositoryServerless Patterns Collection AWS CDKThe AWS Cloud Development Kit CDK isn t purely a tool for creating serverless apps rather it s a full blown infrastructure as code framework that allows you to use code not config to define your application You can install the CDK CLI by running yarn global add aws cdk and then generate a starter project by running cdk init app language language typescript There s a bunch of project configuration files and boilerplate that s generated when you run the init command but let s have a look at how the lib cdk stack ts file looks like after we ve described our ToDont app in it lib cdk stack tsimport as cdk from aws cdk core import lambda require aws cdk aws lambda nodejs import sqs require aws cdk aws sqs import dynamodb require aws cdk aws dynamodb import ApiEventSource SqsEventSource from aws cdk aws lambda event sources import Runtime from aws cdk aws lambda export class CdkStack extends cdk Stack constructor scope cdk Construct id string props cdk StackProps super scope id props define our DynamoDB table const dynamoTable new dynamodb Table this cdk todonts table tableName cdk todonts table partitionKey name id type dynamodb AttributeType STRING define our SQS buffer queue const sqsBuffer new sqs Queue this cdk todonts queue queueName cdk todonts queue define our processing lambda const processLambda new lambda NodejsFunction this cdk todonts process runtime Runtime NODEJS X handler handler entry src process js events new SqsEventSource sqsBuffer environment TABLE NAME dynamoTable tableName grant write access for the processing lambda to our dynamo table dynamoTable grantWriteData processLambda define the lambda backing our API const postLambda new lambda NodejsFunction this cdk todonts post runtime Runtime NODEJS X entry src post js handler handler events new ApiEventSource POST todonts environment QUEUE URL sqsBuffer queueUrl grant write access to the SQS buffer queue for our API lambda sqsBuffer grantSendMessages postLambda The basic building blocks of a CDK application are called constructs which represent a cloud component whether that s a single service instance such as an SQS Queue or a set of services encapsulated in a component Constructs can then be shared and reused between projects and there s a fantastic community that has built a massive collection of high quality components for you to use Having the app and its infrastructure described fully in code also means that we can write actual tests against our setup pretty darn cool huh Before we can deploy the app for the first app we need to bootstrap the AWS environment account amp region combination to provision some resources that the CDK uses to deploy the app After that we can run cdk deploy to deploy our application The CDK CLI doesn t bring the same utility around testing and debugging as SAM and Serverless does but it is possible to use the SAM CLI together with the CDK to help bridge the gap There s also a newcomer on the block Serverless Stack an extension of the CDK that brings a lot of testing utility and serverless specific constructs ProsEnables sharing amp re use of componentsLarge amp helpful communityMakes the infrastructure testableYou can likely use the same programming language to define the infrastructure of your application as your actual applicationConsNeed to use another tool such as SAM or the AWS CLI if you want to invoke or print the logs of a deployed function Resources Getting started with the AWS CDKCDK PatternsCDK Day Wrapping UpThere s a lot that s happening in this space at the moment and while I think these are the three most prominent players right now alternatives popping up left and right Each framework has its own strengths and benefits and there s rarely a wrong or right when choosing which one will work best in your project Please let me know in the comments which one is your favorite and why If you enjoyed this post and want to see more follow me on Twitter at TastefulElk where I frequently write about serverless tech AWS and developer productivity |
2021-05-07 13:24:30 |
海外TECH |
DEV Community |
Your first steps with Express.js |
https://dev.to/ericchapman/your-first-steps-with-express-js-34op
|
Your first steps with Express jsWhat is Express Express is a Fast unopinionated minimalist web framework for Node js It is also by far the most popular Node js web framework What we can do with Espress Web Application Express is a minimal and flexible Node js web application framework that provides a robust set of features for web and mobile applicationsAPIs With a myriad of HTTP utility methods and middleware at your disposal creating a robust API is quick and easy Espress is not a frontend framework like React or Vue Express is a backend framework that will complement a frontend framework to build full stack applicationsExpress prerequisites To use Express we need a working version of node js already install on our machine You also need to understand node js basic concept If you dont have this basic understanding you can read this small series that cover all node js setup and basic concept Install and setup ExpressFirst we will create a new folder and a start a new app then we will install Espress In your terminal execute mkdir discover express cd discover express touch app js npm init npm install expressThose command will create a new node app install with with Express packages Your first Node js ServerWe are now ready for our first line of code Open app js and type const express require express const app express This code will initialize the app variable as a new express object So now we can start the server app listen gt console log Server running on localhost is the port number That value can be change Understand the basics of how your web browser communicates with the internetTo access a page on the internet your browser must ask the server for the page it want request and then display that page to you response This protocol of requests and responses enables you view this page in your browser For example when you visit facebook com about your browser request the about page from facebook server Facebook server will then find and match your request path will do the processing and send the response associate with this path Here are more examples of different url path root route facebook comprofile facebook com profileabout facebook com aboutlogin facebook com loginGET and POST requestYour browser can ask for a page but your browser can also send data to the server ex login form When the browser ask for information that s call a GET request When a browser send data to the server that s call a POST requestSo asking for facebook about page is a GET request But what if What append if the asked page is not present on the server For example you ask for facebook com blablaThe server will include a status code with every response he send back to the browser If everything work as expected the status code is If the page is not found the return status code will be For reference here a list of some HTTP status codes OK successful Unauthorized Forbidden Not found Internal Server ErrorI dont understand a word of what you just explainIt s totally possible and normal It is very important you understand this base before going further Here a link to a more complet tutorial First client server communicationIn the first part of this post we create a node js server with an express app const express require express const app express We then made the server listen for incoming request app listen gt console log Server running on localhost Now that the server is listening We can create a route to match a potential incoming request path app get request response gt response send Hello World This server is waiting for a request at the route root path Note that the route is waiting for a GET request app get Once that request is receive the server will send Hello World as a response Let s test all this First Launch your server From the terminal type node app js node app jsServer running on localhost Then open your favorite browser and go to localhost Hello World should be display It is possible to send a HTTP status codes with the response That will indicate to the client that the request response is a success or a failure app get request response gt response status send Hello World Status is the number for a successful request HTML responseThe server we create just send a response in plain test Hello World But it is possible to send back HTML or JSON HTML Responseapp get request response gt response status send lt h gt Hello World lt h gt You can now re start the server If your previous server is still running in the terminal Press CTRL C to cancel the server execution You can now start the app to see the change node app jsIf you refresh your browser at localhost you will now see Hello World but this time in big header h format JSON responseThe server can also send back data to the browser For example after a login the server can send back some user profile info One of the standard way to send data back and forth is JSON JSON JavaScript Object Notation is a standard text based format for representing structured data based on JavaScript object syntax It is commonly used for transmitting data in web applications e g sending some data from the server to the client so it can be displayed on a web page or vice versa JSON is often use with API We will cover API in detail in the next lesson To send a json response in express is very easy app get request response gt response status json user Mike Taylor level admin The json convert and send a javascript object as JSON ConclusionWOW congrats You just create your first Web Server That s it for today Tomorrow the journey continue We will start working on one of the most used case of express js building our first rest API Stay tune Follow me on Twitter Follow justericchapman |
2021-05-07 13:19:33 |
海外TECH |
DEV Community |
SMART HOMES ARTIFICIAL INTELLIGENCE |
https://dev.to/221910301044/smart-homes-artificial-intelligence-3fpn
|
SMART HOMES ARTIFICIAL INTELLIGENCESmart home technology has its applications in household appliances home safety amp security lighting and entertainment Key industries have started integrating artificial intelligence with smart devices to enable connectivity among these devices AI encompasses the ability to connect multiple IoT devices coupled with superior processing and learning abilities and use them to pre empt human behavior AI powered smart home devices can interact with each other and acquire new data that assists in learning human habits Data collected is used to predict the behavior of users and develop situational awareness i e understand user preferences and change parameters accordingly Digital Assistantscontrolled through voice commands Researchers are focused on bringing in innovation in the field of voice recognition technology that will further add value to voice control devices Latest advancements in home automation systems can enable owners to gain access to hands free channel surfing and control Bluetooth speakers The emergence of the voice assistant feature also raises security concerns as some researchers have managed to hack smart devices through inaudible Smoke Alarms to Think Speak and Alert the User with the Help of Artificial IntelligenceSophisticated smoke alarms that can think and alert the user with the help of artificial intelligence are currently available in the market Some of the smart features of smoke alarms include providing notification on phones regarding low battery and issuing alerts in case of smoke or carbon monoxide leaks and pinpointing the location where there has been a fire or smoke outbreak These alarms can also be put on silent mode Smoke detectors use the voice alert feature to notify the first sign of smoke which facilitates improved response during emergencies |
2021-05-07 13:13:27 |
Apple |
AppleInsider - Frontpage News |
'iPhone 13 Pro Max' model, AirTag follow-up, and Epic Games v. Apple on the AppleInsider podcast |
https://appleinsider.com/articles/21/05/07/iphone-13-pro-max-model-airtag-follow-up-and-epic-games-v-apple-on-the-appleinsider-podcast?utm_medium=rss
|
x iPhone Pro Max x model AirTag follow up and Epic Games v Apple on the AppleInsider podcastWe review AirTag performance and its missing features Epic Games takes on Apple in court and a possible mockup model of the iPhone has been leaked YouTube channel Unbox Therapy received an iPhone Pro Max mockup model from China claiming it is the closest best look yet at the next generation of iPhone The model sports a smaller notch that other leakers have supported and a redesigned camera lens system on the back We discuss the pre order process for the M iPad Pro new Apple TV K and inch iMac Unlike other pre orders the Apple Store app and website stayed active through the a m PT deadline Although users then attempting to order the new devices had difficulty adding items to cart and purchasing via Apple Pay Read more |
2021-05-07 13:22:24 |
Apple |
AppleInsider - Frontpage News |
Foxconn increases bonuses for staff assembling iPhone 12 as demand increases |
https://appleinsider.com/articles/21/05/07/foxconn-increases-bonuses-for-staff-assembling-iphone-12-as-demand-increases?utm_medium=rss
|
Foxconn increases bonuses for staff assembling iPhone as demand increasesMajor iPhone assembler Foxconn has increased its bonuses for staff on the production line now offering a one time on top of salaries when workers meet certain conditions Workers at FoxconnFoxconn regularly uses bonuses as part of its recruitment drive when ramping up production ahead of a new iPhone launch Now while the company may be preparing for the next iPhone it is predominantly assembling the current iPhone range Read more |
2021-05-07 13:47:56 |
海外TECH |
CodeProject Latest Articles |
Testing HttpClient |
https://www.codeproject.com/Articles/5302033/Testing-HttpClient
|
httpclienthttpclientmocking |
2021-05-07 13:57:00 |
海外TECH |
CodeProject Latest Articles |
Removing a BOMB from Your Text! |
https://www.codeproject.com/Articles/5302027/Removing-a-BOMB-from-Your-Text
|
removing |
2021-05-07 13:33:00 |
海外TECH |
CodeProject Latest Articles |
What Code Editor to Use for .NET Core on MacOS? |
https://www.codeproject.com/Articles/5302029/What-Code-Editor-to-Use-for-NET-Core-on-MacOS
|
macos |
2021-05-07 13:19:00 |
海外科学 |
NYT > Science |
This Moth Is Huge in Australia |
https://www.nytimes.com/2021/05/07/world/australia/giant-moth-australia.html
|
This Moth Is Huge in AustraliaA giant wood moth the heaviest of all known moths appeared on the side of a school building in Queensland Australia enthralling students who are used to diverse wildlife |
2021-05-07 13:09:39 |
海外科学 |
BBC News - Science & Environment |
Big Chinese rocket segment set to fall to Earth |
https://www.bbc.co.uk/news/science-environment-57013540
|
large |
2021-05-07 13:13:24 |
ニュース |
@日本経済新聞 電子版 |
JAL、苦肉のLCC頼み 再上場後初の赤字2866億円
https://t.co/5r33xAcwTr |
https://twitter.com/nikkei/statuses/1390654653398876171
|
頼み |
2021-05-07 13:08:01 |
ニュース |
@日本経済新聞 電子版 |
中国「電池王」車載外販に BYD、競争激化で脱・完成車
https://t.co/TuMc8ujQEd |
https://twitter.com/nikkei/statuses/1390654387052113920
|
競争激化 |
2021-05-07 13:06:57 |
海外ニュース |
Japan Times latest articles |
The world turns to China for vaccines after India and U.S. stumble |
https://www.japantimes.co.jp/news/2021/05/07/asia-pacific/china-vaccine-supplies/
|
The world turns to China for vaccines after India and U S stumbleSome experts are worried about the potential impact of widely deploying Chinese shots that have demonstrated lower efficacy rates than those made by Pfizer and |
2021-05-07 23:42:36 |
海外ニュース |
Japan Times latest articles |
From Singapore to Rio, the smart money is on greener buildings |
https://www.japantimes.co.jp/news/2021/05/07/world/singapore-rio-green-buildings-architecture/
|
From Singapore to Rio the smart money is on greener buildings There s a growing shift toward including the green credentials of a building within what constitutes competitive advantage for a developer according to one industry observer |
2021-05-07 22:51:38 |
ニュース |
BBC News - Home |
Big Chinese rocket segment set to fall to Earth |
https://www.bbc.co.uk/news/science-environment-57013540
|
large |
2021-05-07 13:13:24 |
ニュース |
BBC News - Home |
Elections 2021: As Starmer confronts losses, what went wrong and can it be fixed? |
https://www.bbc.co.uk/news/uk-politics-57024995
|
electoral |
2021-05-07 13:42:18 |
ニュース |
BBC News - Home |
Scottish election 2021: First result announced as counting continues |
https://www.bbc.co.uk/news/uk-scotland-scotland-politics-57014885
|
election |
2021-05-07 13:17:46 |
LifeHuck |
ライフハッカー[日本版] |
macOS 11.3がリリース!HomePodユーザーこそ要チェック |
https://www.lifehacker.jp/2021/05/macos-11-3-audio-output-homepod-stereo.html
|
macOSがリリースHomePodユーザーこそ要チェックMacOSBigSurがリリースされ、多くの新機能が登場しました。 |
2021-05-07 22:05:00 |
北海道 |
北海道新聞 |
D12―6神(7日) DeNAが打ち勝つ |
https://www.hokkaido-np.co.jp/article/541344/
|
神日 |
2021-05-07 22:11:00 |
北海道 |
北海道新聞 |
中国、北京五輪の開催に自信 習氏、欧米のボイコットけん制 |
https://www.hokkaido-np.co.jp/article/541343/
|
中央テレビ |
2021-05-07 22:03:00 |
ビジネス |
東洋経済オンライン |
アリババ系ECサイトに再び独禁法調査のワケ 市場監管総局が事業者集中の疑いで調査へ | 「財新」中国Biz&Tech | 東洋経済オンライン |
https://toyokeizai.net/articles/-/425267?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
biztech |
2021-05-07 22:30:00 |
仮想通貨 |
BITPRESS(ビットプレス) |
日本暗号資産ビジネス協会(JCBA)、ユースケース部会「暗号資産のユースケースに係るディスカッションペーパー 中間報告書」を公表 |
https://bitpress.jp/count2/3_17_12477
|
中間報告 |
2021-05-07 22:37:50 |
仮想通貨 |
BITPRESS(ビットプレス) |
[CoinDesk Japan] 米SEC委員長、暗号資産取引所の規制強化を提言 |
https://bitpress.jp/count2/3_9_12475
|
coindeskjapan |
2021-05-07 22:27:34 |
GCP |
Cloud Blog |
New this month: Data lakes, speed at scale, and SAP data |
https://cloud.google.com/blog/products/data-analytics/new-month-data-lakes-speed-scale-and-sap-data/
|
New this month Data lakes speed at scale and SAP dataAs you ve probably noticed by now our team is all about our customers Earlier in the year the New York Times shared how their data analytics team went from staying up until three in the morning trying to keep their legacy system running to relaxing while eating ice cream after theirmigration over to Google Cloud We also explored the details of why Verizon Media picked BigQuery for scale performance and cost And who could forget the awesome story of how the Golden State Warriors transform on court data into competitive advantage pulling raw data from AWS into Google Cloud for fast analytics Leaders in industry show us the way In April we highlighted the best practices two incredible organizations are using to turn data into value at an incredible pace Carrefour a leading global retailer with over stores in over countries published an outstanding set of best practices on their corporate blogdescribing how Google Cloud fueled the company s digital transformation Yann Barraud the company s Head of Data Platforms revealed how they managed to migrate a TB data lake to Google Cloud in just a few months without any service interruptionーand it s already scaling again with more than TB of new data each day In addition the total cost of ownership is lower than before despite serving more than applications and executing million API calls per month You might also enjoy hearing how the team at Broadcom modernized their data lake with Dataproc Cloud SQL and Bigtable migrating around applications with a data pipeline that receives telemetry data from millions of devices around the world The move increased the company s enterprise agility and translated to a reduction of in monthly support calls Watch a quick interview below with the team that made it happen Broadcom rethinks their cybersecurity data lake with Google CloudBroadcom got rid of their noisy neighbor problem for their security analytics team by moving to Google Cloud This move reduced their data lake support issues by If you like hearing data analytics success stories you should check out how online food delivery network Delivery Hero turned to Google BigQuery to improve data accessibility and sharing across datasets and petabytes of data And you ll love reading this Forbes piece about how Zulily established a set of data driven basics to guide them to business success These principles help remind data science and engineering teams that ultimately technology is meant to serve customer needs If it s failing to do thatーit s time to question why you ve got it One of our final favorite stories from this past month kicked off with the opening day of Major League Baseball s season MLB s data cloud does more than provide insights that increase viewership and sell jerseysーit s about bringing fans a richer appreciation for the game with applications like their baseball metrics platform Statcast which is built on Google Cloud Statcast uses cameras to collect data on everything from pitch speed to ball trajectories to player poses This data then gets fed into the Statcast data pipeline in real time and turned into on screen analytics that announcers use as part of their in game commentary Want to get a taste for what that looks like Check out the video below Funny baseball moments of Statcast style Check out some of the funniest moments of the season analyzed by Statcast and presented by Google Cloud And that s just a few of the many incredible journeys we witness every month Join us on May th for the Data Cloud Summit to hear more about how leading companies like Equifax PayPal Rackspace Keybank Deutsche Bank and many more are using Google Cloud to transform their organizations You ll also hear the latest updates and a few surprises from our data management data analytics and business intelligence product teams about where we re headed in the future Be sure to save your seat for freenow The need for speed intelligence and engagementIn case you missed it we also had a great webinar with FaceIT last month As the world s biggest independent competitive gaming platform FaceIT has more than million users that compete in over million game sessions each month During the webinar Director of Data amp Analytics Maria Laura Scuri talked with us about how her team leveraged BigQuery BI Engine to create better gaming experiences Here are the main takeaways from our conversation along with some of the latest innovations from Google Cloud and Looker that customers are using to build better data experiences Speed is key for succeeding with data High throughput is critical when it comes to streaming data in real time We introduced a new streaming API for ingesting data into BigQuery The BigQuery Storage Write API not only includes stream level transactions and automatic schema update detection but it also comes with a very cost effective pricing model of per GB with the first TB per month free Engagement drives rich customer experiences According to the Mobile Gaming Analysis in most mobile games only see a retention rate for users after the first day Machine learning is a game changer for understanding the likelihood of specific users returning to applications or websites This developer tutorial takes you through how to run propensity models for churn prediction using a BigQuery ML Firebase and Google Analytics Intelligent data services deliver new avenues for enriching data experiences Enabling business users to easily transform data based on their needs not only reduces load on IT teams it puts powerful insights right where they need to be to deliver the most value Our newest solution uses Google Cloud Dataprep to help teams enrich survey data find new insights and visualize results with Looker Data Studio or another BI tool BigQuery Pushdown for Trifacta data prep flows allows teams to use intelligent technology to execute transforms natively inside BigQuery yielding up to X faster job executions and significant cost savings Another exciting announcement from April was our new support for choropleth maps of BigQuery GEOGRAPHY polygons Now you can use Data Studio to visualize BigQuery GIS data in a Google Maps based interface You can play with it today for free using our BigQuery free trialand any of our public datasets This quick tutorial will show you how to visualize the affordability of rental properties in Washington state on a map Give it a spin and let us know what you think More for your SAP dataWe know that many of you want to do more with SAP data That s why we created the SAP Table Batch Source for Cloud Data Fusion our fully managed cloud native data integration service This new capability allows you to seamlessly integrate data from SAP Business Suite SAP ERP and S HANA with the Google data platform including BigQuery Cloud SQL and Spanner With the SAP Table Batch Source you can leverage best in class machine learning capabilities and combine SAP data with other datasets One awesome example is running machine learning on IoT data joined with ERP transactional data to do predictive maintenance run application to application integration with SAP and Cloud SQL based applications fraud detection spend analytics demand forecasting and more For more details about the benefits of the SAP Table Batch Source in Cloud Data Fusion I highly recommend reading the introduction blog post At Google Cloud we re always striving to enable you to do more with data regardless of where the data is stored and how you d like to visualize it And expect more to come in the futureーour work is far from done If you want to hear more about what s coming next don t forget to join us on May th for the Data Cloud Summit to hear from leading companies about how Google Cloud is helping transform their organizations I hope to see you there Related ArticleRead Article |
2021-05-07 14:00:00 |
コメント
コメントを投稿