投稿時間:2023-02-12 23:14:24 RSSフィード2023-02-12 23:00 分まとめ(17件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita multipart/form-dataで、日本語ファイル名が文字化けする(API Gateway, Lambda構成) https://qiita.com/bonjour_ken/items/1d577d71c3bf6a514313 apigatewayawslambda 2023-02-12 22:46:20
python Pythonタグが付けられた新着投稿 - Qiita class-based viewとfunction-based viewの違い https://qiita.com/devagar/items/7b33e7350877a8c29614 classbasedview 2023-02-12 22:21:22
python Pythonタグが付けられた新着投稿 - Qiita 【Python】EC2インスタンスの起動からIP取得・応用まで https://qiita.com/sKnow_811/items/380f8709e7179fd8fe75 teratarm 2023-02-12 22:20:08
python Pythonタグが付けられた新着投稿 - Qiita 循環小数の途中の桁を求める https://qiita.com/masa0599/items/d46403414c00e9e20b48 単位分数 2023-02-12 22:10:47
js JavaScriptタグが付けられた新着投稿 - Qiita 【React】オブジェクトの一部プロパティ変更 https://qiita.com/Muhyun-Kim/items/4762ec8ec37830d6f8c5 drinker 2023-02-12 22:16:01
AWS AWSタグが付けられた新着投稿 - Qiita オンプレ版Gitlab CE OmnibusをAWS+ALB+Docker版に移行メモ https://qiita.com/comefigo/items/2dc7c4b2b0a174a35889 awsalbacmssl 2023-02-12 22:53:29
AWS AWSタグが付けられた新着投稿 - Qiita 初心者がAWS Identity and Access Management (IAM) 使ってみた① - ポリシー作ってみる - https://qiita.com/Fromi_Frog/items/a1fa8ec11b1e9029658b andaccessmanagementiam 2023-02-12 22:04:26
Azure Azureタグが付けられた新着投稿 - Qiita Spring Boot WEBサービスを AKS (Azure Kubernetes Service) 環境で起動する https://qiita.com/hiroxpepe/items/88c936341d3ffb858536 azurekubernete 2023-02-12 22:56:17
Ruby Railsタグが付けられた新着投稿 - Qiita 【rubocop-airbnb】指摘箇所について https://qiita.com/sekkey_777/items/e76e3d79f30b1c35ea90 rails 2023-02-12 22:52:06
海外TECH DEV Community Build a CRUD Rest API in JavaScript using Nodejs, Express, Postgres, Docker https://dev.to/francescoxx/build-a-crud-rest-api-in-javascript-using-nodejs-express-postgres-docker-jkb Build a CRUD Rest API in JavaScript using Nodejs Express Postgres DockerLet s create a CRUD rest API in JavaScript using Node jsExpressSequelizePostgresDockerDocker ComposeIf you prefer a video version IntroHere is a schema of the architecture of the application we are going to create We will create endpoints for basic CRUD operations CreateRead allRead oneUpdateDeleteWe will create a Node js application using Express as a frameworkSequelize as an ORMWe will Dockerize the Node js applicationWe will have a Postgres istance we will test it with TableplusWe will create a docker compose file to run both the servicesWe will test the APIs with Postman Step by step guideHere is a step by step guide create a new foldermkdir node crud apistep into itcd node crud apiinitialize a new npm projectnpm init yinstall the dependenciesnpm i express pg sequelizeexpress is the Node js frameworkpg is a driver for a connection with a Postgres dbsequelize is the ORM so we avoid typing SQL queriescreate foldersmkdir controllers routes util modelsOpen the folder with your favorite IDE If you have Visual Studio Code you can type this from the terminal code You should now have a folder similar to this one Now let s start coding Database connectionCreate a file called database js inside the util folder This file will contain the internal configuration to allow the connection between the Node js application and the running Postgres instance Populate the util database js fileconst Sequelize require sequelize const sequelize new Sequelize process env PG DB process env PG USER process env PG PASSWORD host process env PG HOST dialect postgres module exports sequelize User modelCreate a file called user js inside the models folder This file will contain the model in this case a user with an auto incremented id a name and an email Populate the models user js file const Sequelize require sequelize const db require util database const User db define user id type Sequelize INTEGER autoIncrement true allowNull false primaryKey true name Sequelize STRING email Sequelize STRING module exports User ControllersThis is the file that contains all the functions to execute in order to interact with the database and have the basic functionalities Create a file called users js inside the controllers folderPopulate the controllers users js fileconst User require models user CRUD Controllers get all usersexports getUsers req res next gt User findAll then users gt res status json users users catch err gt console log err get user by idexports getUser req res next gt const userId req params userId User findByPk userId then user gt if user return res status json message User not found res status json user user catch err gt console log err create userexports createUser req res next gt const name req body name const email req body email User create name name email email then result gt console log Created User res status json message User created successfully user result catch err gt console log err update userexports updateUser req res next gt const userId req params userId const updatedName req body name const updatedEmail req body email User findByPk userId then user gt if user return res status json message User not found user name updatedName user email updatedEmail return user save then result gt res status json message User updated user result catch err gt console log err delete userexports deleteUser req res next gt const userId req params userId User findByPk userId then user gt if user return res status json message User not found return User destroy where id userId then result gt res status json message User deleted catch err gt console log err RoutesCreate a file called users js inside the routes folder Populate the routes users js fileconst controller require controllers users const router require express Router CRUD Routes usersrouter get controller getUsers usersrouter get userId controller getUser users userIdrouter post controller createUser usersrouter put userId controller updateUser users userIdrouter delete userId controller deleteUser users userIdmodule exports router Index fileTo run our application we need to create on more file at the root level this is the file that will be executed by the docker container in the root folder create a file called index jsPopulate the index js file const express require express const bodyparser require body parser const sequelize require util database const User require models user const app express app use bodyparser json app use bodyparser urlencoded extended false app use req res next gt res setHeader Access Control Allow Origin res setHeader Access Control Allow Methods GET POST PUT DELETE next test routeapp get req res next gt res send Hello World CRUD routesapp use users require routes users error handlingapp use error req res next gt console log error const status error statusCode const message error message res status status json message message sync databasesequelize sync then result gt console log Database connected app listen catch err gt console log err Docker PartLet s create more files at the root level dockerignore it starts with a dot Dockerfile capital D docker compose ymlThe structure should look like this the dockerignore will contain a single line node modules The DockerfileTo create a Docker image we need a simple yet powerfule file That s called Dockerfile capital D We might use a different name but let s keep things simple for now FROM node Create app directoryWORKDIR appCOPY package json RUN npm install Bundle app sourceCOPY EXPOSE CMD node index js Docker compose fileTo run multiple services an easy way is to create a file called docker compose yml The docker compose yml file version services node app container name node app build image francescoxx node live app ports environment PG DB node live db PG USER francesco PG PASSWORD PG HOST node db depends on node db node db container name node db image postgres ports environment POSTGRES DB node live db POSTGRES USER francesco POSTGRES PASSWORD volumes node db data var lib postgresql datavolumes node db data Build the Docker image and run the docker containers Run Postgres in a containerFirst let s run the postgres container docker compose up d node dbTo check the logs we can type docker compose logsyou should get an output similar to this one if we see database system is ready to accept connections we are good to go Let s test it using TablePlus Click on the to create a new connectioncopy the values from the docker compose yml file password is if you left the values as they are Build and run the Docker serviceSecond let s build our Docker iamge docker compose buildfinally let s start the service docker compose up node appThis should be the output on the terminal Test the app with PostmanLet s test the app using Postman Make a GET request to localhost Make a GET request to localhost usersWe should have an empty array as a responseLet s create users aaa bbb and cccLet s check again all the users Make a GET request to localhost usersWe should see users Let s get a single user for example the user Make a GET request to localhost users Let s update an existing user for example the same user Make a PUT reqeust to localhost users with a different bodyFinally let s delete the user number Make a DELETE reuqest to localhost users We can also check the values using TablePlus ConclusionThis is a basic example of how you can build a CRUD rest API using Node js Express Sequelize Postres Docker and Docker Compose All the code is available in the GitHub repository For a video version If you prefer a video version That s all If you have any question drop a comment below Francesco 2023-02-12 13:37:31
海外TECH DEV Community First P2E game on Tableland (2) https://dev.to/ponyjackal/first-p2e-game-on-tableland-2-5g31 First PE game on Tableland It s been a while since I posted a blog about the first PE game on Tableland in order to give you an idea about how to manipulate metadata on chain just like normal relational database manipulation Previously I talked about the databases on Tableland for Kart and Asset collections how to create tables on the Tableland and how to return URI based on that If you missed the previous one please check it before you move forward Today I will deep dive into AutobodyShop contract where you will eventually apply many assets to the kart which leads to metadata updates on the Kart collection So we have the applyAssets function which will take assets data for the kart and update the metadata table on Tableland for the kart It will be easy since we will just fetch assets metadata and update the kart table But here is the thing we are not able to get results from tableland on chain we can only do that off chain Furthermore our assets have multiple attributes do you remember This means we have to do some sub queries which is also not possible in the current tableland So I ended up using the hybrid method we will fetch the results from the assets table and do some sub queries to finalize the attributes we will apply to the kart off chain which is node js api Once user hits apply assets button on UI it will hit this api not the smart contract function directly and from that api we make some voucher which contains BE signature query strings to run on tableland tables call the smart contract on UI Hope you will find it easy to understand or this blog will help you Here is the voucher for applyAssets function on Autobodyshop struct AutoBodyShopVoucher address owner uint kartId uint assetIds string resetQuery string applyQuery string updateImageQuery uint nonce uint expiry bytes signature Now that I d love to share applyAssets function dev Apply assets attributes to a kart param voucher The AutoBodyShopVoucher function applyAssets AutoBodyShopVoucher calldata voucher external nonContract nonReentrant address signer verify voucher require signer gameServer amp amp msg sender voucher owner AutoBodyShop invalid call require voucher nonce nonces voucher owner AutoBodyShop invalid nonce require voucher expiry block timestamp lt voucher expiry AutoBodyShop signature is expired require kittyKartGoKart ownerOf voucher kartId msg sender AutoBodyShop not a kart owner nonces voucher owner for uint i i lt voucher assetIds length i require kittyKartAsset ownerOf voucher assetIds i msg sender AutoBodyShop not an asset owner kittyKartAsset safeTransferFrom msg sender address this voucher assetIds i update in use for previously applied asset tableland runSQL address this kittyKartAssetAttributeTableId voucher resetQuery set kart id in asset attribute table tableland runSQL address this kittyKartAssetAttributeTableId voucher applyQuery update image url for kart tableland runSQL address this kittyKartGoKartTableId voucher updateImageQuery emit ApplyAssets voucher kartId voucher assetIds Looks pretty much straight forward doesn t it First there are some validation checks including ownership and voucher And then transfer assets to Autobodyshop contract Finally update tableland tables Note that we need things to update update in use column in asset tableupdate kart id column in asset tableupdate image url column in kart tableOh did I tell you about tableland write permissions Okay no worries let me explain now Each tableland table has privileges so that onlyowners can write into the table though it s public to read And table owner here is the table creator obivously in our case for assets table owner is Asset contract for kart table owner is Kart contract For more details As you notice we are going to update assets and kart tables on Autobodyshop contract which is not the owner In order to make this work we have to grant write permission to Autobodyshop contract and only owner of the table can do this That s why we have grantAccess and revokeAccess functions in Kart and Asset contracts dev Grant access of table to EOA param to The address to grant access function grantAccess address to external onlyOwner require metadataTableId KittyKartGoKart table is not created yet tableland runSQL address this metadataTableId string concat GRANT INSERT UPDATE DELETE ON metadataTable TO StringsUpgradeable toHexString to emit AccessGranted to dev Revoke access of table to EOA param to The address to grant access function revokeAccess address to external onlyOwner require metadataTableId KittyKartGoKart table is not created yet tableland runSQL address this metadataTableId string concat REVOKE INSERT UPDATE DELETE ON metadataTable FROM StringsUpgradeable toHexString to emit AccessRevoked to Once the write permission is granted to the Autobodyshop contract we are able to run SQL queries to update assets and the kart table on Autobodyshop contract Damn I think I went through all the things you need to get familiar with the app Here are things I want to emphasize that shaped our current design There is no way to get query results on chainFor now it s not possible to run sub queries in the tablelandAs you know it will give a sense of building on chain metadata in NFT space with tableland Hope you enjoyed this Thanks 2023-02-12 13:34:51
海外TECH DEV Community tsParticles 2.9.2 Released https://dev.to/tsparticles/tsparticles-292-released-51f3 tsParticles Released tsParticles Changelog Bug FixesAdded missing shapes to confetti bundleFixed issue with emitters plugin that spawned an unwanted emitters fixes Confetti WebsiteStarting from there are two new bundle for easier configurations confetti the demos are available here readme herefireworks a demo website is not ready yet but the readme contains all the options needed here vProbably this will be the last v x version except some bug fixes needed before v will be released You can read more about the upcoming v in the post linked below Preparing tsParticles v Matteo Bruni for tsParticles・Jan ・ min read javascript typescript webdev showdev Social linksDiscordSlackWhatsAppTelegramReddit matteobruni tsparticles tsParticles Easily create highly customizable JavaScript particles effects confetti explosions and fireworks animations and use them as animated backgrounds for your website Ready to use components available for React js Vue js x and x Angular Svelte jQuery Preact Inferno Solid Riot and Web Components tsParticles TypeScript ParticlesA lightweight TypeScript library for creating particles Dependency free browser ready and compatible withReact js Vue js x and x Angular Svelte jQuery Preact Inferno Riot js Solid js and Web ComponentsTable of Contents️️ This readme refers to vversion read here for v documentation ️️tsParticles TypeScript ParticlesTable of ContentsDo you want to use it on your website Library installationHosting CDNjsDelivrcdnjsunpkgnpmyarnpnpmImport and requireNuGetUsageOfficial components for some of the most used frameworksAngularInfernojQueryPreactReactJSRiotJSriot particlesSolidJSsolid particlesSvelteVueJS xVueJS xWeb Componentsweb particlesWordPresswordpress particlesElementorPresetsBig CirclesBubblesConfettiFireFireflyFireworksFountainLinksSea AnemoneSnowStarsTrianglesTemplates and ResourcesDemo GeneratorVideo TutorialsCharacters as particlesPolygon maskAnimated starsNyan cat flying on scrolling starsSnow… View on GitHub 2023-02-12 13:06:24
Apple AppleInsider - Frontpage News Best apps to learn Spanish on iPhone, iPad, or Mac https://appleinsider.com/inside/ios/best/best-apps-to-learn-spanish-on-iphone-ipad-or-mac?utm_medium=rss Best apps to learn Spanish on iPhone iPad or MacLearning a new language is now more accessible than ever These apps and services are best choices for people who want to learn Spanish Whether you re planning to surprise your Valentine with a trip to the Dominican Republic and need to brush up on your skills or just working on late new years resolutions the following apps are sure to help Not only can they help anyone learn Spanish but this list accommodates any learning style and wallet Read more 2023-02-12 13:12:07
Apple AppleInsider - Frontpage News BenQ treVolo U review: Voice clarity and wireless freedom https://appleinsider.com/articles/23/02/12/benq-trevolo-u-review-voice-clarity-and-wireless-freedom?utm_medium=rss BenQ treVolo U review Voice clarity and wireless freedomThe BenQ treVolo U is a compact Bluetooth speaker that emphasizes clear vocals for users who need speech clarity without a sweaty headset or greasy earbuds BenQ treVolo U speaker is compact and colorfulZoom video calls exploded in popularity in the last few years as business meetings have moved online Additionally online classes have become commonplace and many use an iPad or MacBook for these online interactions Read more 2023-02-12 13:10:14
Apple AppleInsider - Frontpage News Daily deals Feb. 12: $15 off HomePod mini, 26% off M1 Pro 14-inch MacBook Pro, Giftcard bonuses, more https://appleinsider.com/articles/23/02/12/daily-deals-feb-12-15-off-homepod-mini-26-off-m1-pro-14-inch-macbook-pro-giftcard-bonuses-more?utm_medium=rss Daily deals Feb off HomePod mini off M Pro inch MacBook Pro Giftcard bonuses moreSome of the best offers we found include a discount on TurboTax Deluxe State off the M MacBook Air smart TVs down as low as and more Get off a HomePod mini todayThe AppleInsider team scours online retailers for unbeatable deals to create a list of discounts on the top tech items including discounts on Apple products TVs accessories and other gadgets We post the top deals in our Daily Deals list to help you save money Read more 2023-02-12 13:03:28
Java Java Code Geeks How To Perform Local Website Testing Using Selenium And Java https://www.javacodegeeks.com/2023/02/how-to-perform-local-website-testing-using-selenium-and-java.html How To Perform Local Website Testing Using Selenium And JavaUsers expect new features and websites to be seamless and user friendly when they go live End to end website testing in local infrastructure becomes an unspoken critical requirement for this However if this test is performed later or after the entire website or app has been developed the possibility of bugs and code issues increases Such issues 2023-02-12 13:14:00
ニュース BBC News - Home 'Human error' - VAR did not draw guide lines for Brentford goal https://www.bbc.co.uk/sport/football/64616645?at_medium=RSS&at_campaign=KARANGA x Human error x VAR did not draw guide lines for Brentford goalVideo assistant referee operator Lee Mason did not draw the system s guide lines to check for offside on Brentford s equaliser against Arsenal on Saturday 2023-02-12 13:45:56

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)