投稿時間:2022-03-28 11:34:57 RSSフィード2022-03-28 11:00 分まとめ(32件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
ROBOT ロボスタ NVIDIAが次世代GPU「H100」発表 飛躍的にパフォーマンス向上する「Hopperアーキテクチャ」も登場 https://robotstart.info/2022/03/28/nvidia-h100-hopper.html NVIDIAが次世代GPU「H」発表飛躍的にパフォーマンス向上する「Hopperアーキテクチャ」も登場シェアツイートはてブNVIDIAはGTCにて、NVIDIAHopperアーキテクチャを搭載した次世代のアクセラレーテッドコンピューティングプラットフォームを発表した。 2022-03-28 01:09:26
TECH Techable(テッカブル) ゴミの自動圧縮・量可視化。ソーラー発電で動くスマートゴミ箱「SmaGO」が名古屋進出 https://techable.jp/archives/175963 bigbellysolar 2022-03-28 01:00:32
js JavaScriptタグが付けられた新着投稿 - Qiita GASでファイル一覧とフォルダ一覧取得 https://qiita.com/tenpa_ozisan/items/1ca61f8681db728b636e GASでファイル一覧とフォルダ一覧取得複数人でGoogleDriveを利用しているとファイルやフォルダの数が膨大になり管理が難しくなります。 2022-03-28 10:27:48
Docker dockerタグが付けられた新着投稿 - Qiita Docker使用時にbyebugのブレークポイントをスルーしてしまう問題の解決方法 https://qiita.com/Utsubo/items/71814f19af8311a46ff1 Docker使用時にbyebugのブレークポイントをスルーしてしまう問題の解決方法環境OSmacOSBigSurDockerversion発生した問題①Docker使用中にbyebugで設定したブレークポイントをスルーしてしまう下記のようにgtマークは付くがブレークポイントで止まらず、コマンド入力できない②Dockerのコンテナからデタッチできない原因①、②のどちらもdockerの設定で標準入出力をコンテナに結びつけていなかったことが原因解決方法下記のようにdockercomposeymlファイルにstdinopentruettytrueを追加し、Dockerをビルドし直して解決。 2022-03-28 10:53:15
Git Gitタグが付けられた新着投稿 - Qiita Windows PowerShellでgitのブランチを表示して、変更があったらブランチ名の色を変えるスクリプト https://qiita.com/yyama2/items/e255ba63a1d6e307eda5 WindowsPowerShellでgitのブランチを表示して、変更があったらブランチ名の色を変えるスクリプト概要PowerShellでgit操作する際に、ブランチ名や変更状況等をビジュアライズしたいので、スクリプトを作成しましたー設定DocumentsWindowsPowerShellに配置するMicrosoftPowerSHellprofilepsに下記のスクリプトを配置する。 2022-03-28 10:31:26
Git Gitタグが付けられた新着投稿 - Qiita gitでよく使うコマンドを順に沿って整理してみた。(プロジェクト開始からローカルの変更を反映するまで。) https://qiita.com/shular/items/de1a575dec2a0b2b111a ーリポジトリ作成今回は、コマンドでgit操作をすることを想定としていますので、フォルダの作成、指定もすべてコマンドで行います。 2022-03-28 10:27:35
Ruby Railsタグが付けられた新着投稿 - Qiita Docker使用時にbyebugのブレークポイントをスルーしてしまう問題の解決方法 https://qiita.com/Utsubo/items/71814f19af8311a46ff1 Docker使用時にbyebugのブレークポイントをスルーしてしまう問題の解決方法環境OSmacOSBigSurDockerversion発生した問題①Docker使用中にbyebugで設定したブレークポイントをスルーしてしまう下記のようにgtマークは付くがブレークポイントで止まらず、コマンド入力できない②Dockerのコンテナからデタッチできない原因①、②のどちらもdockerの設定で標準入出力をコンテナに結びつけていなかったことが原因解決方法下記のようにdockercomposeymlファイルにstdinopentruettytrueを追加し、Dockerをビルドし直して解決。 2022-03-28 10:53:15
技術ブログ Developers.IO extendsを使って.gitlab-ci.yml内の重複処理をまとめる https://dev.classmethod.jp/articles/use-extends-in-gitlab-ci-yml/ extends 2022-03-28 01:53:57
技術ブログ Developers.IO DigdagのREST APIを使って特定のワークフローの最新の実行結果を取得する https://dev.classmethod.jp/articles/get-latest-attempt-information-digdag-rest-api/ attempt 2022-03-28 01:45:12
技術ブログ Developers.IO S3→CloudTrail→EventBridge→Step Functionsの構成からCloudTrailを削除した https://dev.classmethod.jp/articles/remove-cloudtrail-from-s3-cloudtrail-eventbridge-stepfunctions/ cloudtrail 2022-03-28 01:29:03
技術ブログ Yahoo! JAPAN Tech Blog キーワード分類モデルを作ったら、機械学習で販促拡大につながった話 https://techblog.yahoo.co.jp/entry/2022032830272274/ 提示方法 2022-03-28 10:45:00
海外TECH DEV Community The ultimate Solana step-by-step guide (including programs, dapps and Rust from scratch) https://dev.to/merlox/the-ultimate-solana-step-by-step-guide-including-programs-dapps-and-rust-from-scratch-46ai The ultimate Solana step by step guide including programs dapps and Rust from scratch Welcome to the most complete open guide for people that want to divedeep into Solana Whether you re an Ethereum developer a blockchain developer a webdeveloper or just a curious person this is the guide to become aSolana developer With extremely detailed steps so there s no room forconfusion along the way By the end of this complete guide you ll have accomplished a workingdapp that can be deployed to the blockchain and interact with the realSolana blockchain for extremely low fees and fast confirmation times Getting into Solana development can be extremely profitable sincethere s already a huge market of investors users defi enthusiasts NFTmaniacs cryptocurrency trades A massive network of people that willpay big money for the right products And it s not nearly as saturated as in Ethereum since many tools andproducts haven t been developed yet in Solana for a good reason learning Solana and Rust is far more difficult but rewarding plus it sa new blockchain that continues to grow tremendously fast I m telling you you ll find Rust hard at first but you ll love it bythe end of this article You ll learn a ton of cool things including Writing Solana Rust programs from scratch no experiencerequired Testing Solana applications with the Anchor frameworkDeveloping a frontend for your dapp step by stepConnecting all the popular Solana wallets to your dappDeploying your dapp so it s permanently onlineI like doing things hands on I believe it s the best way to learn That s why in this guide you ll work through a dapp from an idea to itscomplete deployment including all the blockchain coding and frontenddevelopment as you learn along the way We re gonna build a dapp that allows users to write a collectivearticle Imagine an open blockchain book where anybody can come in andleave their little contribution to a grand story It could end up acool book or a total disaster In any case I m excited to see how itturns out Technically speaking each wallet will be able to write words to acollective public article that lives permanently on the blockchain Kinda like a fun and open experimental game It s a simple dapp and has a few functions which makes it ideal forpeople to start getting into Solana development If you re already familiar with the Solana Anchor setup already skipdirectly to the section Coding the Rust program to see howto start coding this dapp Otherwise read from the beginning If you feel this guide helped you in any way be sure to join my emaillist for updated on things I m building in crypto and NFTs here and subscribe to me here Each chapter contains a short bullet list of the things you ll learn toget you hyped up and excited for the new knowledge you re about toacquire Here s what you re gonna learn Installing Rust Solana Yarn and Anchor Setting up the project from scratch Understanding the Anchor framework setup Coding the Rust program Creating the article update function Testing the Solana program Creating the decentralized application frontend Setting up the Solana wallets connectionLet s do this The updated code is available in my github as alwayspublic and open to everybody If you use it just give me credit sopeople know who created it The code is here Installing Rust Solana Yarn and AnchorStart by installing all the dependencies We re gonna use Anchor whichis a framework that will make our lives easier for developing SolanaRust programs In this section you ll learn How to install rust solana yarn and anchorThe commands required to verify the successful installationExplanations for the different command tools installedFirst install Rust Rust is the programming language used for Solanaprograms also known as Smart Contracts on Ethereum You ll need toinstall it first and foremost To install Rust do curl proto https tlsv sSf lt gt shIf you re in windows install Git Bash from here which is a terminal that allows you torun more unique commands not commonly available on windows and then runthe previous Rust installation command on the Git Bash terminal Then run the following to add all the Rust executables to your PATH export PATH HOME cargo bin PATH Make sure the installation was successful by running rustup version rustc version cargo versionRustup is the upgrade utility that allows you to keep rust updated You won t use it much Rustc is the compiler It s awesome because it allows you to take yourprogram written in rust and make it executable on all operativesystems You won t use it for Solana programs but it s excellent ifyou re building any other app outside of it Including desktop appsfor all major systems Cargo is the utility that allows us to install and managedependencies Think of it as npm for Rust Next you can continue by installing Solana itself with this command sh c curl sSfL Remember to keep an eye on this link to see the latestversion since they are constantly updating it After a successful installation run solana versionTo confirm that it has been added Now you ll have to install node js with yarn which is required to workwith Anchor programs Go to and install the LTSversion Once the installation is completed confirm the successful installationlike this node version npm versionThen install yarn which is an improved version of npm with thiscommand npm i g yarnFinally install Anchor Anchor is a protocol that allows us to buildprograms on solana much faster and easier than without it Think of itas hardhat or truffle from Ethereum An essential tool for any Solanadeveloper To install Anchor run cargo install git anchor cli lockedAs you can see we re using Cargo which we installed earlier it s verysimple just do cargo install and the git repository you wish to receive Confirm the installation with anchor versionThat should be it for the installation of all the dependencies Let smove on by setting up the project so we can create the program Setting up the project from scratchSolana is configured to work on the mainnet network by default Thismeans every transaction has a real SOL coin cost as the transaction fee You don t want to do that when developing applications There s a betterway In this section you ll learn How to configure the solana cli utility to use devnetUseful commands for solanaHow to init a project with anchor frameworkUse the devnet or testnet networks to develop your program and see howthey perform before deploying them to the main network where they willbe available to everyone So start by setting up solana to work with the devnet network like this solana config set url devnetThen generate your wallet which will be required to run and deploy yourprograms with solana keygen new forceYou ll see be asked to input a password to lock your wallet foradditional protection Then you ll see your mnemonic which is acombination of words used to generate infinite addresses for yourwallet img alt Generating a new solana wallet with solana keygen lt br gt new height src cdn images medium com max AyGqcoIBEOjmtSdQ png width You can then check your address with solana addressGive yourself some test Solana coins with the airdrop command solana airdrop You can check your balance anytime with solana balanceNow that you have solana configured to work with the devnet network andhave a new wallet ready let s setup an Anchor project which will createall the folders and boring configuration for us Go to your Desktop andrun this command anchor init solana global article cd solana global article Understanding the Anchor framework setupLet s take a look at what Anchor has done for you Open the project withyour preferred code editor In this section you ll learn How to understand the code that anchor has created for youThe main files to pay attention toResources for deeper understanding of the anchor setupYou only have to pay attention to files to begin coding The first and most important file is the lib rs it s the main one thatwill be loaded in the program use anchor lang prelude declare id FgPaFpoGXkYsidMpWTKWBeZFEfcYkgzPFsLnS program pub mod solana global article use super pub fn initialize ctx Context lt Initialize gt gt ProgramResult Ok derive Accounts pub struct Initialize Anchor programs are pretty simple you import the framework then youindicate where the program contains the main logic and specify the derive Accounts which is where the data will be stored and whereyou can access accounts The first line use anchor lang prelude is just importing Anchorso you can use all the goodness it provides for your program The declare id FgPaFpoGXkYsidMpWTKWBeZFEfcYkgzPFsLnS lineindicates the id of your program the equivalent of the address for yourto be deployed smart contract in Ethereum This is necessary for Anchor Then you specify the structs which are elements that contain the datafor your project with derive Accounts In Rust Solana programsyou separate the data and the functionality Inside the program blockyou modify and access data but you don t store it there all the data isstored in structs Don t worry if it doesn t make much sense yet you ll see what I meanwith the functionality data separation soon enough The second file you have to understand is Cargo toml which is theequivalent to package json if you re a javascript developer package name solana global article version description Created with Anchor edition lib crate type cdylib lib name solana global article features no entrypoint no idl no log ix name cpi no entrypoint default dependencies anchor lang As you can see you define the project data such the name descriptionand then the dependencies at the bottom You ll be adding things therewith cargo install I highly recommend you check this official anchor resource to see aminimal example of the anchor configuration generating a clientContinue ahead with the most interesting section where you ll begin touse one of the coolest languages ever Rust Coding the Rust programNow the fun part let s code the Rust program In this section you ll learn How to create a working Solana program according to yourspecificationThe different attributes anchor gives you to make your life easierHow to understand Rust variables and syntaxIf you remember we wanted to build a simple decentralized applicationthat allows users to write a shared article with anyone that usesSolana Kinda like an open book Where people add their little knowledgeand fun elements The first step before coding is defining what we want our program to doin a simple list Solana users will be able to connect their wallets and write wordson the global articleUp to words per wallet but people can write less so if someonejust wants to add word or to the open book they can do soWords will be separated by spaces and we ll remove any empty spacebetween them in RustEach word will have a maximum of characters to keep it cleanEvery great project always starts with a clear vision of what thefounder wants to build it will save time and define a clear end goalGreat Now open the global article project with your code editor andnavigate to Programs gt src gt lib rs and open that file Remember that lib rs is the starter and main file for our solanaprogram Let s start by creating the data structures where we ll store ourcontent Add the Article struct account pub struct Article pub content String Here s the breakdown for you to fully understand what we just did As you can see we use the pub keyword which indicates this is apublic struct which makes it accessible for other functions andstructs Without it you ll get an error saying can t leak privatetype Next we named our struct Article simply because this will be thearticle where we ll store our data You can name it Book orsomething similar if you d like Then we create the content property which is a String that willcontain our information Important Accounts in Solana programs are like files in yourcomputer Their purpose is to store data So when we say account inSolana we mean a place to store your data Accounts also havemetadata that indicate the owner of that file and more Continue by creating the Initialize struct which is the one used tosetup the initial data and configurations This is required becauseunlike solidity variables must be set initially derive Accounts pub struct Initialize lt info gt account init payer person that pays space account discriminator pubkey make the message max k bytes long pub article Account lt info Article gt account mut pub person that pays Signer lt info gt pub system program Program lt info System gt Let s go line by line to understand what s going on Try to copy thecode first and then read along derive Accounts According to the official documentation deriveaccounts means Implements an Accounts deserializer on the givenstruct Meaning it allows this struct to process user addresses andaccounts You can see the official description here Then we create a public struct like before but this time it iscalled Initialize and it has an info lifetime Lifetimes are aRust thing that allow you to tell him to use a specific data fromsomewhere else It s a way to pass variables Don t worry if it sconfusing you ll get used to it over time Next we initialize an account init payer person that pays space What we re doing here is telling thesolana program to initialize an account where the data will bestored then we define who s gonna pay for that transaction and thespace we need for that data pub article Account lt info Article gt Here we are telling solanato store the article in the new data account we ve created for it tobe retrieved later account mut pub person that pays Signer lt info gt Wedefining the person that will pay to create the data account whichis a Signer type It s the equivalent of setting up an owner insolidity while Signer is the address type pub system program Program lt info System gt The system programis a required element to create your solana data Must be includedin the initializer Now go to the program section and create the main function to startand setup the program like this program pub mod solana global article use super pub fn initialize ctx Context gt ProgramResult Get the article let article account amp mut ctx accounts article Initialize the variables this is required article account content to string Ok The initialize function is receiving a Context with the Initializestruct we ve created before Solana programs don t store state variablesin the same place like Ethereum smart contracts do instead theyseparate the data storage and the functionality That s why we always have to pass a Context into every solana programfunction to receive the data we want to manipulate since it can taccess data on its own What we re doing in this function is select the article struct we vedefined previously let article account amp mut ctx accounts article And setup the content of that article struct to an empty string article account content to string Finally we re returning the function with the Ok result So whatwe did is we went to this struct pub struct Article pub content String And initialized the content to an empty string that can be accessedlater Variables need to be initialized to a starter value always Let s recap what we ve done so far use anchor lang prelude declare id FgPaFpoGXkYsidMpWTKWBeZFEfcYkgzPFsLnS program pub mod solana global article use super pub fn initialize ctx Context lt Initialize gt gt ProgramResult Get the article let article account amp mut ctx accounts article Initialize the variables this is required article account content to string Ok derive Accounts pub struct Initialize lt info gt account init payer person that pays space account discriminator pubkey make the message max k bytes long pub article Account lt info Article gt account mut pub person that pays Signer lt info gt pub system program Program lt info System gt account pub struct Article pub content String You should have that code just like that Now it s the perfect time torun a anchor build in your terminal The build command will tell youwhether your code is great or if it has any errors It s very importantto do it often to catch issues early Continue reading to develop a complex Rust function in the next section Creating the article update functionSo far we ve setup a simple program that doesn t do much It s time tocreate the function that allows people to write the article data In this section you ll learn How to create a struct that updates data in the Solana blockchainA simple explanation on Rust variable typesHow to use the spli function and iterate over itThe first step when creating a function that updates blockchain data isto create a struct with the variables you want to have updated like so derive Accounts pub struct WriteIntoArticle lt info gt Here goes the info that you want to modify like this account mut pub article Account lt info Article gt You start by adding the derive Accounts modifier which is requiredto make this work Then you setup the name of it In this case I chose WriteIntoArticle After that you include the struct you want to modify in this case it sgonna be the Article struct so that s why I saved it with thearticle variable name As you can see we ve added the account mut attribute This is sowe can modify the article data since mut in Rust indicates a mutablevariable that can be updated To put it simply in Rust you declare a constant like this let my variable This value can t be changedAnd a variable with the mut modifier let mut my variable my variable It worksWhen we create a mutable account with an attribute like this account mut what we re doing is telling Solana that this data willbe modified in the future In this case our article variable will beupdated with new data The mutable account attribute is required otherwise we won t be able tomodify that data Now we can write the function that will use our newly created struct pub fn write into article ctx Context three words String If more after they will be removed gt ProgramResult To update the article string let article amp mut ctx accounts article let split iterator three words trim split endraw raw Ok First we define the write into article function which receives thecontext WriteIntoArticle and a String variable called three words which is the data our users will send to write into the global article Then we read the article data by accessting the amp mutctx accounts article context variable Since we want people to send a string made of words we gotta split itinto separate units so we can check that each word is valid meaning Each word is made of less than characters To remove all the extra empty spaces in between words To verify if the user actually sent words or moreThe trim function will remove empty spaces between words while split will separate words by spaces Note that split returnsan iterator We can t access the data without iterating over it first or collect ing it Now let s iterate over those words to check it the user sent more wordsthan permitted since that s not allowed because we want multiple peopleto contribute to this global article project Add the following belowthe split iterator variable rslet split iterator three words trim split let mut final words Vec new let mut counter added for s in split iterator if s trim is empty continue if s trim len gt return Err Errors WordTooLong into final words push s counter added if counter added gt break Ok There s a lot going on so let s break it down for your understanding let mut final words Vec new The final words variable willcontain a list of the words Vectors are arrays of variable sizein Rust You can push items to them They have to be initializedwith Vec new In this case we re making it mut able becausewe want to add items to it later let mut counter added This is a counter that will keeptrack of how many words we re adding to the list to stop at andnot add more than necessary for s in split iterator Remember that split iterator is aniterator which means we gotta loop through it to access each item We are doing that with a simple for in loop which stores each iteminto the s variable if s trim is empty continue Here we re checking if theword is empty or not and if so skip it This is because when wesplit by spaces we may find that we have words separated by severalspaces The split function then recognizes empty spaces as words sowe get rid of those empty words with a simple if statement if s trim len gt return Err Errors WordTooLong into Here we re checking if the word inside the variable s has characters or more in which case we return an error In this caseI ve called the error WordTooLong You ll see later on how wecreate and define the error messages The Err function is fromanchor and it allows us to send and error and stop execution final words push s counter added Here we re simplyadding the word to the final words vector after checking it isvalid to our conditions and increasing the counter if counter added gt break If the counter is or more stop the loop This is so if people send more than words we cutoff and remove the remaining ones As you can see we re doing quite a few things in that little code It sgood that you get familiar with Rust syntax You ll love it in no time Now let s continue with the final part of that function which looks likethe following Join the words after removing spaceslet mut joined words final words join Add a space at the end with thisjoined words push str Article content gets immediately updatedarticle content push str amp joined words First we join the words we ve extracted and cleaned up with the join method which combines words into one string and separates them by aspace Then we add a space at the end of those words The way you do that is you take the joined words string and push another string to it with push str which is the way you concatenate strings in Rust Finally you update your article global variable with the same pushmethod to concatenate words article content push str amp joined words note that we don t do article content article content push str amp joined words that s because the push strmethod updates the original string Now we can go ahead and define the errors section which is pretty simpleas you ll see Right at the end of the file below all the structs andprograms write this error pub enum Errors msg Each word must be less than characters WordTooLong The error attribute indicates this enum is the one containing theerror definitions Then we simply add the keywords we want in my case it s justWordTooLong for the error name and a message on top with the msgattribute The message in quotes will be displayed when the error iscalled That should be it for the Solana program code You did it You can see the updated and complete code for the program in my githubhere Testing the Solana programIn Solana rust programs you always test the code since as far as Iknow there are no tools you can use to interact with the programsdirectly like in ethereum with the verified contracts in etherscan andremix You don t have that here In this section you ll learn How to write Solana tests using the anchor protocolHow to execute Rust programs from anchorHow to get data from the blockchainSo let s get testing It s pretty simple as you ll see just long linesof code This is the initial setup import as anchor from project serum anchor import Program from project serum anchor import GlobalArticleTutorial from target types global article tutorial describe global article tutorial gt Configure the client to use the local cluster anchor setProvider anchor Provider env const program anchor workspace GlobalArticleTutorial as Program it Is initialized async gt Add your test here const tx await program rpc initialize console log Your transaction signature tx Anchor imports all the required libraries for you at the top and thencreates a simple test to see if the intialization would work There s anissue this first test will fail Simply because the initialize function is not receiving the rightparameters Modify the first test initialization function const tx await program rpc initialize with this object for it to work it Is initialized async gt const deployerKeypair anchor web Keypair generate const personThatPays program provider wallet Add your test here await program rpc initialize accounts article deployerKeypair publicKey personThatPays personThatPays publicKey systemProgram anchor web SystemProgram programId signers deployerKeypair What we re doing there is creating a new Keypair which is a sampleaccount used for the test Then we get the wallet that will pay for theinitialization As you can see inside initialize we ve added an accounts objectwhich if you remember from before it s where the data is stored and wesimply add the initial data The required data are the variables from the Initialize struct However note that the variables use camelCase notation when in our rustprogram we ve defined those variables with snake case notation For instance personThatPays in the test is person that pays in theInitialize struct Keep that in mind Now run the test with anchor test and it should be successful You canuse the devnet network or use the local solana network which lives inyour computer exclusively for testing purposes Go ahead and followthese steps Run solana config set url localhost this will change thenetwork you use to localhost instead of devnet Then do run the command solana test validator and stop it after afew seconds If you keep it running your tests won t run since itneeds to work in the background Open your Anchor toml file and update the programs devnet block to programs localnet Then in that same file update cluster devnet to cluster localnet If it was successful you ll see this message passing ms Let s now write the second test which will include the functionality towrite into the global article We ll do a one word test first Start bycreating the test structure it Should write an article with word successfully async gt Then copy the code to from the previous test to initialize the program When testing we don t care if we re repeating code or adding unnecessarylines since it s code used exclusively for development It won t be usedby users it Should write an article with word successfully async gt const deployerKeypair anchor web Keypair generate const personThatPays program provider wallet await program rpc initialize accounts article deployerKeypair publicKey personThatPays personThatPays publicKey systemProgram anchor web SystemProgram programId signers deployerKeypair Now let s add some additional functionality to write an article to theblockchain Go ahead and add the following function right below theinitialize method await program rpc writeIntoArticle hey accounts article deployerKeypair publicKey signers As you can see we re executing the writeIntoArticle function from theprogram The first parameter hey is the word we re gonna add to theblockchain while the second parameter is a javascript object containingthe accounts with the article data Remember that accounts in Solana are pieces of storage kinda likefiles stored in the blockchain They don t represent a username andpassword Although they have some metadata inside them to determine whocreated that data and so on In this case we re simply updating the article variable and we resending it the signer which is the deployedKeypair publicKey to letthe program know who is sending this data At this point you may be wondering how do I read the informationstored in the blockchain Good question And the way you do that iswith the fetch or all methods The all method allows youto retrieve all the elements in a variable in case you have an array orvector in your rust program Here s how we check the article data we just sent to the blockchain const articleData await program account article fetch deployerKeypair publicKey expect articleData content to equal hey We do await the method fetch from the actual article object inour program while sending it the publicKey This way we re gettingthe actual data stored in the blockchain Then we execute the final part of the test which is verifying that theinformation we just sent is what we expected with the expect function Note the empty space right after the word hey It is intentionalto add a separator for the next words people add in the future If you run the test with anchor test you ll notice that there s anerror that s because we re using expect which is a testing functionfrom the chai package In order for the test to work you mustimport expect like this at the top of the file import expect from chai You don t have to install that dependency because anchor has alreadydone that for you Here s how the test looks in its entirity import expect from chai Keep this at the beginning of the file along with the other importsit Should write an article with word successfully async gt const deployerKeypair anchor web Keypair generate const personThatPays program provider wallet Add your test here await program rpc initialize accounts article deployerKeypair publicKey personThatPays personThatPays publicKey systemProgram anchor web SystemProgram programId signers deployerKeypair await program rpc writeIntoArticle hey accounts article deployerKeypair publicKey signers const articleData await program account article fetch deployerKeypair publicKey expect articleData content to equal hey Note the space at the end added by the program Run the tests again with anchor test you should see a message likethe following if they are successful Is initialized ms Should write an article with word successfully ms passing s It s time for the final test The one where we check if we can add words several times We won t write a test for when a user sends morethan words to the article since I don t want to bother you with allthis testing But if the code is right when a user send more than words to theglobal article they should only write words while the rest areremoved Here s how the third test looks like it should write words two times async gt const deployerKeypair anchor web Keypair generate const personThatPays program provider wallet Add your test here await program rpc initialize accounts article deployerKeypair publicKey personThatPays personThatPays publicKey systemProgram anchor web SystemProgram programId signers deployerKeypair await program rpc writeIntoArticle hey whats up accounts article deployerKeypair publicKey signers await program rpc writeIntoArticle this is my accounts article deployerKeypair publicKey signers const articleData await program account article fetch deployerKeypair publicKey console log article data articleData expect articleData content to equal hey whats up this is my Note the space at the end added by the program As you can see we ve copied the previous tests initially to keep thatsame setup while updating the writeIntoArticle function with the text hey whats up and repeating the same function with the text this ismy You can write anything really but that s to see if we are able toconcatenate several writes to the blockchain for the purposes of havinga global article made by several people We then do a fetch and check if the article content is what we want with an empty space at the end Note the console log I ve added that s to see how the data received looks like I encourage you to dothe same and get familiar with the responses the solana blockchain givesyou Write the test by hand don t copy paste it because you don t developthe muscle memory necessary to truly understand how these things workuntil you use your hands Now run it with anchor test for a successful result Is initialized ms Should write an article with word successfully ms article data content hey whats up this is my should write words two times ms passing s As an exercise try to write a new test that tries to writeIntoArticlemore than words and see what happens That should be it The program is tested and ready to go Let us nowcreate the frontend which is what people will use to interact with theprogram from their computers It s gonna be awesome let s go Creating the decentralized application frontendIt s time to put it all together into a great looking dapp for people toplay around and interact with your program Let s get to it In this section you ll learn How to create a React frontend for your dappHow to setup webpack with the different pluginsHow to use Material UI and stylus for the designThe frontend will live in a separate folder inside the same project youstarted before That s because there are many files and they need theirown config Anchor created the app folder specifically for that Forthe frontend I usually start by creating the webpack configuration myself with theinitial files But I found a better way Createapp dev is the app they didn t pay me tosay this I just like it I use now to generate the initial setup You simply go to the website choose webpack and setup the files byclicking on the options you want If you want my configuration justcopy the following gif Make sure to have Material UI selected in the UIlibrary section since we ll use it later img alt A gif showing you the process to generate the starter frontend files lt br gt with createapp dev an awesome utility This is a mac screen recording lt br gt converted to gif with ffmpeg lt br gt btw height src cdn images medium com max AMvmvEfzOzIYEEJsTIWjFJw gif width Once you download the folder you ll see the files according to thechosen configuration in my case they are the following package json README md src App js index js styles styl webpack config jsWhat s great is that we have access to the build webpack configurationand we can adapt it to however we want I chose to use stylus since it sgreat for css configurations I put all those files inside the app folder of the project we hadearlier Navigate to that folder from the terminal and execute yarn installCreate a file called gitignoreAnd inside that file simply indicate which folders and files to ignorewhen uploading your project in github You can copy the configurationfrom the same site you used to create the config Then inside your package json in the scripts section add a newscript used to start our dapp so it looks like the following scripts clean rm dist bundle js build dev webpack mode development build prod webpack mode production watch webpack mode production w serve npx http server docs start npm run all parallel watch serve You ll need to install http server locally with yarn add http serverAnd npm run all globally for the scripts to work npm i g npm run allFor some reason the createapp dev app doesn t create a babelrc file You gotta do it yourself At the root of your app folder create a babelrc file and copy the contents from the page You may see a different configuration based on which parameters youchose Then update your webpack config js to output the compiled files todocs since we ll use that to host our dapp for free with github pagesas you ll see later on output path path resolve dirname docs filename bundle js Now let s go ahead and create a simple frontend design it will looklike the following img alt The solana open global book lt br gt design height src cdn images medium com max ArYfggygDNOzDFZ Hg gif width A simple input where we input the words we want to add to the book andsubmit Users can connect with the button at the top right Then theychoose the wallet they want to use and they approve transactions The first thing is to create the design Open App js you ll seesomething like this import React from react import Button from material ui core Button class App extends React Component render const name this props return lt gt Hello name this is a material UI button lt gt export default AppLet s change that to a functional React component import React from react import Button from material ui core Button const App gt return lt gt Hello this is a material UI button lt gt export default AppYou can see how it looks anytime with yarn start in fact I recommendyou to keep it open while you develop If you get this error ERROR in unable to locate Users merunas Desktop solana global article app tutorial src index html globYou have to simply update the webpack config js file by removing theCopyPlugin for now The Material UI library added by that web app is outdated So go to yourApp js and update the imports import Button from material ui core Button To import Paper Skeleton TextField Button from mui material Then install these ones yarn add mui material emotion react emotion styledUpdate your App component to the following for the initial structurewhile using the Material UI components we ve imported earlier const App gt return lt gt lt header className header gt lt div className title container gt lt h className main title gt Open Global Book lt h gt lt h className main subtitle gt By Merunas lt h gt lt div gt lt header gt lt Paper elevation className content box gt lt Skeleton variant text gt lt Skeleton variant text gt lt Skeleton variant text gt lt Paper gt lt div className three words input container gt lt TextField id outlined basic label Write to the open book words max variant outlined className words input gt lt Button variant contained className submit button gt Submit lt Button gt lt div gt lt gt We added a header with a title and subtitle Then a Paper section with Skeleton to create a loading text component that feels like it sretrieving data from the blockchain We ll create that later on Finally we have a section with the inputs using the TextField andbutton to submit It will look like this Not great But that s what the CSS classes we added are for Go to yourstyles styl file and paste this code font family roboto header display flex align items center title container width main title margin bottom main subtitle margin top wallet connect width px content box max width px margin auto padding px margin top px margin bottom px solana image width px margin top px three words input container max width px margin auto display flex justify content space around align items center words input width px helper description max width px margin auto margin top px color grey font size pt media max width px three words input container flex direction column submit button margin top px words input width Your dapp will look like this now Notice how the font is not quite right That s because we haven t addedthe Roboto font Material Ui uses To add the font we ll updatewebpack config js so that the HtmlWebpackPlugin uses a file we caneasily edit new HtmlWebpackPlugin title Solana Global Book template src index ejs filename index html Then create an index ejs inside src You may be wondering What is ejs EJS is a template node engine that we will use to update thetitle of our dapp directly from webpack with a variable It allows youto add variables easily Here s how the index ejs looks like lt DOCTYPE html gt lt html lang en dir ltr gt lt head gt lt meta charset utf gt lt title gt lt htmlWebpackPlugin options title gt lt title gt lt link rel stylesheet href family Roboto amp display swap gt lt meta name viewport content initial scale width device width gt lt head gt lt body gt lt div id app gt lt div gt lt body gt lt html gt Notice how we re importing the roboto font and using the titlevariable from webpack in between those lt gt special tags They comefrom EJS Now the font is much better The next step is to add the solana logo Simply download it from here Create an assets folder inside app and move the solana jpg fileright there Then modify App js to include the logo lt header className header gt lt img src assets solana jpeg className solana image gt lt div className title container gt lt h className main title gt Open Global Book lt h gt lt h className main subtitle gt By Merunas lt h gt lt div gt lt header gt However that won t work just yet We gotta tell webpack to move theassets to the docs folder where the combined files live Updatewebpack config js plugins to this new CopyPlugin patterns from assets to assets Now reload webpack by stopping the terminal and doing yarn startagain You can see the logo properly positioned That s because of the csswe ve added earlier and the classes in App js In the next section you ll learn how to connect Phantom and other Solanawallets to work with the blockchain Setting up the Solana wallets connectionIn this section you ll learn How to connect Phantom and many other wallets easilyHow to configure the React components to work with SolanaHow to use the different libraries designed by Anchor and SolanaTo interact with the blockchain we need a way to let our dapp send andreceive information to your wallet There are many ways to set it up But in this case we ll use the many libraries configured to work withreact and Phantom If you haven t done so yet download for yourbrowser and create an account It is the Metamask equivalent for Solana Works flawlessly Then create a file called WalletContext js inside src and importall these libraries at the top import React from react import ConnectionProvider WalletProvider from solana wallet adapter react import WalletAdapterNetwork from solana wallet adapter base import LedgerWalletAdapter PhantomWalletAdapter SlopeWalletAdapter SolflareWalletAdapter SolletExtensionWalletAdapter SolletWalletAdapter TorusWalletAdapter from solana wallet adapter wallets import WalletModalProvider from solana wallet adapter react ui import config from config require solana wallet adapter react ui styles css Note that I created a file named config js which simply contains ajavascript object with some configuration that we ll use for severalfiles So go ahead and create a file named config js right outside thesrc folder with these contents export default solana article account network devnet endpoint The solana article account will be the address of the account thatholds the data for the article As you know accounts hold data Install the following dependencies with yarn yarn add solana wallet adapter react solana wallet adapter base solana wallet adapter wallets solana wallet adapter react uiThen add the rest of the configuration for the wallet connectioncontext export default children gt const network WalletAdapterNetwork Devnet const wallets new PhantomWalletAdapter new SlopeWalletAdapter new SolflareWalletAdapter network new TorusWalletAdapter new LedgerWalletAdapter new SolletWalletAdapter network new SolletExtensionWalletAdapter network return lt ConnectionProvider endpoint config endpoint gt lt WalletProvider wallets wallets autoConnect gt lt WalletModalProvider gt children lt WalletModalProvider gt lt WalletProvider gt lt ConnectionProvider gt There s a lot going on It took me a while to set it up properly becausemany tutorial online don t explain how this works so I ll be verydescriptive for you First we take the network that will be used for the walletconnections This is only necessary for the Solflare Sollet andSolletExtension wallets For some reason the WalletAdapterNetworkdoesn t have an option for localhost networks But that s fine wecan work without it Then we create an array of wallets we are gonna use Simply do anew for every wallet we ve imported previously from the solana wallet adapter wallets library You can just importPhantomWalletAdapter if you re not gonna use the others Then in the return you gotta place those components in the orderI ve shown you Notice the children variable That one isnecessary because our entire dapp will be placed there The childrenvariable is a function argument as you can see at the beginningexport default children gt Our entire dapp will be inside that children variable It is requiredbecause all those wallet and connection providers will be passed down tothe main App where they will be used to interact with the programwe ve created Just so you understand in our App component we will add the following lt WalletContext gt lt App gt lt WalletContext gt Where WalletContext is the entire list of providers that we rereturning from the WalletContext js file we created earlier Meaning our app is a child of all those providers so we can access the walletconnection in all of our components Let me know if you got any morequestions regarding this point in the comments Now go back to the App js file and import the file we ve just created import WalletContext from WalletContext Right at the end of the file use it to hold the App like so export default gt return lt WalletContext gt lt App gt lt WalletContext gt Then in the App component add a wallet connect button in the header lt header className header gt lt img src assets solana jpeg className solana image gt lt div className title container gt lt h className main title gt Open Global Book lt h gt lt h className main subtitle gt By Merunas lt h gt lt div gt lt div className wallet connect gt lt WalletMultiButton gt lt div gt lt header gt That button comes from this library import WalletMultiButton from solana wallet adapter react ui Now it s a good time to run yarn start and see how the app looks unfortunately you will find an error in the webpack build that says BREAKING CHANGE webpack lt used to include polyfills fornode js core modules by default This is no longer the case Verify if you need this module and configurea polyfill for it This had me searching for solutions for a good while It basicallymeans some of the libraries we ve imported use specific node jsutilities such as fs or path that are meant to be used for serverpurposes Webpack in versions and older did include all thoselibraries whenever necessary But now webpack doesn t include the required node libraries for yourimports to work In summary you gotta go and tell webpack to not worry about thoseimports You can do that by adding the following to your webpack config resolve fallback fs false tls false net false path false zlib false http false https false stream false crypto false process false Right at the same level of output and entry That should fix allthe compilation errors and your app will load with no issues Some people suggest downgrading to webpack In my opinion that s aterrible idea You shouldn t be forced to use older versions that may ormay not work It is much better to fix those issues like I just did Start your app with yarn start and see how it looks If you still geterrors install and import this webpack plugin You ll now see the phantom solana button like so You can click on it to connect your wallet just be sure to be on thesame network you configured previously Remember that in yourconfig js you ve added this endpoint So in your phantom wallet be sure to select the devnet network HoweverI recommend you to deploy your program to localhost first and thenyou ll be able test it faster In which case you ll have to change yourphantom extension config to use localhost and update the config jsfile endpoint Anyway Congrats you ve got a working wallet connection that not onlylooks good but works flawlessly Your frontend is ready to startinteracting with the blockchain Let s continue with the next section Connecting the Solana program with our created React frontendIn this last section you ll learn How to take connect your program with your phantom wallet throughyour dappHow to read the Solana blockchain data from your programHow to write data into the blockchain for the Article structLet s start by setting up the state variables Import useState fromreact like so in your App js file import React useState from react Then create these variables inside the App component const inputValue setInputValue useState const isLoading setIsLoading useState true const solanaArticle setSolanaArticle useState The inputValue variable will be used to hold the data users type intothe input component The isLoading variable is gonna be used to verifywhen the data has finished loading from the blockchain mainly to displaythe loading lines from Material UI and replace them with actual dataonce available Then the solanaArticle variable is going to hold the data stored inthe solana blockchain used to display that information for the book After doing that we ll setup the variables required for the walletblockchain connection you can place them right below the statevariables const wallet useAnchorWallet const connection useConnection You ll have to import those elements from the wallet adapter reactlibrary like so import useConnection useAnchorWallet from solana wallet adapter react At this point your App component will look like this import React useState from react import Paper Skeleton TextField Button from mui material import WalletContext from WalletContext import WalletMultiButton from solana wallet adapter react ui import useConnection useAnchorWallet from solana wallet adapter react const App gt const inputValue setInputValue useState const isLoading setIsLoading useState true const solanaArticle setSolanaArticle useState const wallet useAnchorWallet const connection useConnection return Omitted for brevity Before diving into the blockchain stuff let s make sure our input HTMLelement works by verifying the user is inputing words while each wordbeing limited to characters separated by a space To do that findyour TextField component and include these fields lt TextField id outlined basic label Write to the open book words max variant outlined className words input value inputValue onChange e gt checkAndAddWords e gt In React the value attribute is required when updating the input dataprogramatically As you can see the onChange function is executingthe checkAndAddWords e we re about to create with the event received const checkAndAddWords e gt let words e target value split for let i i lt words length i if words i length gt return if words length gt return setInputValue words join There we re simply check that the words have chars or less and westop the user from typing after adding words Now let s get to the juicy part We re gonna use the initializefunction from our program into the dapp so we can create and store datainto the blockchain If you remember the Rust initialize function wecreated does create an Account that stores the article data Go aheadand copy this code by hand const initialize async gt const provider new Provider connection wallet const program new Program idl programID provider const keypairOne Keypair generate try await program rpc initialize accounts person that pays provider wallet publicKey article keypairOne publicKey systemProgram SystemProgram programId signers keypairOne console log done keypairOne publicKey toString catch e console log e return alert e Here s the breakdown We create the provider which is the connection to the phantomwallet Then we setup the program to interact with it As you can see weneed an IDL programID and provider We ll get those in a moment Then we create a new account keypair This is the account where thedata of our program will be stored Next we do a try catch to run the initialize function from theprogram methods It receives accounts and signers This is thesame structure we have in our program Accounts holds the person that pays which is the account that paysthe transaction fees and rent costs for years to keep that dataonline The article variable is the account we ve passed and is gonna beused for the data we re about to store And the system program isjust the Solana main program After we re done we log the account generated since we ll need itin a moment to keep updating the same data later on Go ahead and import the required elements like so import idl from solana global article json import Program Provider web from project serum anchor import PublicKey from solana web js import config from config const programID new PublicKey idl metadata address const SystemProgram Keypair webThe solana global article json import you can get it from yourtarget deploy json which was created when you did anchor build Simply copy that one to your src folder Then install yarn add project serum anchor solana web js which arerequired for the dapp to work After that setup the programID and theother web dependencies Try to run it now with yarn start If at this point you re getting aweird error like process not defined in your chrome dev tools you cansimply fix it by following these steps Doo yarn add node polyfill webpack plugin In your webpack config add this const NodePolyfillPlugin require node polyfill webpack plugin Then add it to the plugins section new NodePolyfillPlugin Now it should work The initialize function should only be ran once by the creator of theprogram Although it can be ran as many times as you want to create newarticle accounts used for storing data To execute it simply add a button like this somewhere in your app lt Button onClick initialize color secondary variant contained gt initialize lt Button gt You ll see the button and after clicking it a Phantom wallet transactionpopup will show up for you to confirm the initialization Just make sureyou re in the same network as you configured in your WalletContext jsfile Then you ll see the console log message with the Keypair generate result That s gonna be the address where the article data will be stored Copyit and paste it into your config js file solana article account LUMnyBDTCKqiJPrEsweKzdQktFDiGTsaRqiGc You can now remove or comment out the initialize button you vecreated At this point we can just read the blockchain data with a function likethe following const getAndSetArticle async gt const provider new Provider connection wallet const program new Program idl programID provider const articleData await program account article fetch config solana article account setSolanaArticle articleData content setIsLoading false Which simply initializes the program like before and gets the articledata froom the blockchain with the fetch method Then it updates thestate variables to see that new information in the dapp Make sure to execute that function when the React component is setup andready using useEffect from React like so useEffect gt if wallet getAndSetArticle wallet Remember to import it at the top of your file import React useState useEffect from react That way once the component is ready to use the function will beexecuted and you ll see the article data Now update the Skeleton visual loaders with the information we receivefrom the blockchain isLoading lt Paper elevation className content box gt lt Skeleton variant text gt lt Skeleton variant text gt lt Skeleton variant text gt lt Paper gt lt Paper elevation className content box gt solanaArticle lt Paper gt Once the isLoading state is set to false the app will show thesolanaArticle data to the user Try it and see how it loads Theskeleton will dissapear but you won t see any data because there s nonein the blockchain yet Let s change that We re gonna create a function to upload words to ourglobal article Here s how it looks like const uploadWords async gt const provider new Provider connection wallet const program new Program idl programID provider try await program rpc writeIntoArticle inputValue accounts article config solana article account catch e console log e return alert e getAndSetArticle Here s the breakdown First we setup the provider and program like we did before Then we do a try catch but this time we re executing thewriteIntoArticle method which is exactly the functionwrite into article in our Rust program Notice how we re passing as the first parameter the inputValuewhich is nothing more than what the user has typed in the input formwe have setup Then we pass the article public key that we ve generated before That is nothing more but the address of the account that holds thearticle data At the end we update the data shown in the dapp by retrieving what sbeing stored in the blockchain with the getAndSetArticle function What s left now is to find the submit button and add a click eventlistener that will call the uploadWords function we ve just created lt Button variant contained className submit button onClick uploadWords gt Submit lt Button gt Go ahead and try it out with yarn start You ll see your final dappfully working sending and receiving data from the Solana blockchain Isn t it awesome For sure it is Check it out and play around If you ve liked it be sure to join my new D interactive NFTs project Nuclei One 2022-03-28 01:39:25
海外TECH DEV Community Creating a Django Movie Recommendation App Using Jaccard Index https://dev.to/jamattey/creating-a-django-movie-recommendation-app-using-jaccard-4oco Creating a Django Movie Recommendation App Using Jaccard Index My goals for this projectUnderstand the key components of the django frameworkDescribe The Basic Principles of a recommendation systemBuild a simple movie recommendation app by applying Jaccard Algorithm based on content filtering mechanism Tech StackDjango BackendHTML FrontendBootstrap CSSSQLite Database About Django FrameworkDjango splits its application logic into the following three Model View Controller like components Django Model manages data modelling and database mapping as well as business logic to process dataDjango View describes which data is presented but not how it is presented Typically Django View delegates and renders an HTML page which describes how the data is presentedDjango Template generates dynamic HTML pages to present dataWhen a client sends a request the Django server routes the request to the appropriate view based on the Django URL configuration and acts as a traditional ControllerDjango ModelsDjango uses Django Models to represent database tables and map them to objects such as process is called ORM Django Models tries to make the developer s life easier by abstracting databases and mapping objects and methods into tables and SQL queries automatically You just need to define classes as Django Models and will be later mapped to database tables accordingly Then you can simply use Django Models API to perform CRUD on the database tables without writing a single line of SQLDjango ViewsIn Django a View is essentially a Python function Such a function takes a Web request and applies the necessary logic to generate a Web response such as the HTML contents of a Web page a redirect a error an XML document an image or any other Web response Often View interacts with Django Models to get required data in the form of QuerySet or objects to generate a Web response Django Application Development ProcessFirst I created a Django project which is a container for Django apps and settings Here I can decide to create and add one or more Django apps to the project In Core Development I created Django models to model the data and created views to determine which data need to be presented to the UI I also map the request URLs to our views so Django can forward requests to corresponding views via URLs Then we can start designing and building the UI This movies are populated in a CSV The site does not host actual movies but its is a recommendation engine using regular code and a database This recommendation engine does not use Machine Learning yet To make the recommendation actually work I needed to first mark the movies a user has watched using Django Admin site Then I wrote a recommendation algorithm based on watched movies Marking Watched Movies In Django AdminRun Django Servervisit admin url app url adminThen you click into the movie entry and mark it as watched and press Save Run make recommendations CMD to Generate RecommendationsFor any recommendation systems the key idea is always to come up with a good algorithm model to predict if a specific user will like or dislike his her unseen item as shown in the following screenshot There are probably hundreds of good recommendation algorithms and can be roughly divided into two categories Content filtering based The content filtering based recommendation algorithms assume you may like a new movie if you have watched very similar movies before Or based on your user profile like age gender interests it will try to find new movies matching your profile Collaborative filtering based The collaborative filtering algorithms assume you may like a new movie if other users similar to you similar profile or watched similar movies have watched this movie In this project we will use content filtering based algorithm and we will try to recommend unwatched new movies to you if they are similar to your watched movies How do we calculate such movie similarityHere we will use Jaccard similarity which is probably the simplest but very effective method to calculate similarity between two sets Jaccard Similarity is defined as the size of intersection of two sets divided by the size of union of that two sets 2022-03-28 01:32:04
海外TECH DEV Community Eth-Lottery - Solidity, Hardhat https://dev.to/hussainzz/eth-lottery-solidity-hardhat-3ebg Eth Lottery Solidity HardhatFew months ago i started reading about web technology and fell in love with ethereum and smart contracts I decided to learn solidity to write smart contracts After couple of weeks the first full fledged smart contract which i came across was Lottery Smart Contract which was just a basic smart contract which used to allow anyone to join the lottery by depositing some eth and the lottery Manager owner of the lottery smart contract would pick a random winner But the approach which it took to pick the winner was not actually a true random winner function random private view returns uint return uint keccak abi encode block difficulty block timestamp players Problem with the above snippet is that relying on the block variables for the source of entropy randomness is not the safe approach As miners can easily manipulate those values We will look at how we can solve this issue by generating the random number off chain using chailink oracle VRF v OracleBlockchain oracles are entities that connect blockchains to external systems thereby enabling smart contracts to execute based upon inputs and outputs from the real world Tech StackSolidity With Hardhat FrameworkPrequisitesNodeJSFair understanding of how solidity worksLove for web ️ Let s StartCreate a new directory i ll call it eth lottery why not it sounds cool npm init y inside your eth lottery directoryNext Let s Install Hardhatnpm install save dev hardhatNext we initialize hardhat project gt npx hardhat b d d b b b P d b b d d Yb Yb Y Y Y YWelcome to Hardhat v What do you want to do … Create a basic sample project Create an advanced sample project Create an advanced sample project that uses TypeScript Create an empty hardhat config js QuitOnce the hardhat project is initialized Next we install hardhat deploy which will make our life easier with deployments and testsnpm install hardhat deployNext Lets configure our accounts Hardhat comes with a cool feature NamedAccounts which allows us to access our account with name rather than accessing by specific index account Next In your env add your account private key and alchemy infura url which we will be later required for deployements For now ignore the VRF SUBSCRIPTION ID we will come to that laterRINKEBY URL YOUR ALCHEMY KEY gt PRIVATE KEY xabcabcabcabcabcabcabcabcabcabcabcPRIVATE KEY USER xabcabcabcabcabcabcabcabcabcabcabcPRIVATE KEY USER xabcabcabcabcabcabcabcabcabcabcabcVRF SUBSCRIPTION ID Next update your network section in hardhat config js networks ganache url chainId rinkeby url process env RINKEBY URL chainId accounts process env PRIVATE KEY DEPLOYER process env PRIVATE KEY USER process env PRIVATE KEY USER filter x gt x undefined gasReporter enabled process env REPORT GAS undefined currency USD etherscan apiKey process env ETHERSCAN API KEY namedAccounts deployer default user default user default Next Lets install the required libraries npm install chainlink contracts openzeppelin contractsWe will be using chainlink contracts to implement the vrf and from openzeppeline i ll be using a contract call Counters which helps to get a counter that can be incremented and decremented we will be using it as our lotteryID Next Create two files Lottery sol amp LotteryData sol in contracts folder It Should look like this SPDX License Identifier MITpragma solidity import openzeppelin contracts utils Counters sol import openzeppelin contracts utils math SafeMath sol import chainlink contracts src v VRFConsumerBaseV sol import chainlink contracts src v interfaces LinkTokenInterface sol import chainlink contracts src v interfaces VRFCoordinatorVInterface sol import LotteryData sol contract Lottery is VRFConsumerBaseV VRFCoordinatorVInterface COORDINATOR LinkTokenInterface LINKTOKEN LotteryData LOTTERY DATA using Counters for Counters Counter using SafeMath for uint Counters Counter private lotteryId uint public totalAllowedPlayers address public lotteryManager mapping uint gt uint private lotteryRandomnessRequest bytes private keyHash uint immutable s subscriptionId uint immutable requestConfirmations uint immutable callbackGasLimit uint public s requestId event RandomnessRequested uint uint To emit data which will contain the requestId from chainlink vrf lotteryId winnder address event WinnerDeclared uint uint address To emit data which will contain the lotteryId address of new player amp new Price Pool event NewLotteryPlayer uint address uint To emit data which will contain the id of newly created lottery event LotteryCreated uint custom Errors error invalidValue error invalidFee error lotteryNotActive error lotteryFull error lotteryEnded error playersNotFound error onlyLotteryManagerAllowed constructor bytes keyHash uint subscriptionId address vrfCoordinator address link address lotteryData VRFConsumerBaseV vrfCoordinator lotteryId increment lotteryManager msg sender COORDINATOR VRFCoordinatorVInterface vrfCoordinator LINKTOKEN LinkTokenInterface link s subscriptionId subscriptionId keyHash keyHash LOTTERY DATA LotteryData lotteryData modifier onlyLotteryManager if msg sender lotteryManager revert onlyLotteryManagerAllowed function getAllLotteryIds public view returns uint memory return LOTTERY DATA getAllLotteryIds function startLottery public payable onlyLotteryManager LOTTERY DATA addLotteryData lotteryId current lotteryId increment emit LotteryCreated lotteryId current function enterLottery uint lotteryId public payable uint lId uint ticketPrice uint prizePool address memory players address winner bool isFinished LOTTERY DATA getLottery lotteryId if isFinished revert lotteryNotActive if players length gt totalAllowedPlayers revert lotteryFull if msg value lt ticketPrice revert invalidFee uint updatedPricePool prizePool msg value LOTTERY DATA addPlayerToLottery lotteryId updatedPricePool msg sender emit NewLotteryPlayer lotteryId msg sender updatedPricePool function pickWinner uint lotteryId public onlyLotteryManager if LOTTERY DATA isLotteryFinished lotteryId revert lotteryEnded address memory p LOTTERY DATA getLotteryPlayers lotteryId if p length if p address revert playersNotFound require p address no players found LOTTERY DATA setWinnerForLottery lotteryId payable p transfer address this balance emit WinnerDeclared lotteryId p else LINK is from VRFConsumerBase s requestId COORDINATOR requestRandomWords keyHash s subscriptionId requestConfirmations callbackGasLimit number of random numbers lotteryRandomnessRequest s requestId lotteryId emit RandomnessRequested s requestId lotteryId function fulfillRandomWords uint requestId uint memory randomness internal override uint lotteryId lotteryRandomnessRequest requestId address memory allPlayers LOTTERY DATA getLotteryPlayers lotteryId uint winnerIndex randomness mod allPlayers length LOTTERY DATA setWinnerForLottery lotteryId winnerIndex delete lotteryRandomnessRequest requestId payable allPlayers winnerIndex transfer address this balance emit WinnerDeclared requestId lotteryId allPlayers winnerIndex function getLotteryDetails uint lotteryId public view returns uint uint uint address memory address bool return LOTTERY DATA getLottery lotteryId SPDX License Identifier MITpragma solidity contract LotteryData struct LotteryInfo uint lotteryId uint ticketPrice uint prizePool address players address winner bool isFinished mapping uint gt LotteryInfo public lotteries uint public allLotteries uint public lotteryTicketPrice ether address private manager bool private isLotteryContractSet address private lotteryContract constructor manager msg sender error lotteryNotFound error onlyLotteryManagerAllowed error actionNotAllowed modifier onlyManager if msg sender manager revert onlyLotteryManagerAllowed modifier onlyLoterryContract if isLotteryContractSet revert actionNotAllowed if msg sender lotteryContract revert onlyLotteryManagerAllowed function updateLotteryContract address lotteryContract external onlyManager isLotteryContractSet true lotteryContract lotteryContract function getAllLotteryIds external view returns uint memory return allLotteries function addLotteryData uint lotteryId external onlyLoterryContract LotteryInfo memory lottery LotteryInfo lotteryId lotteryId ticketPrice lotteryTicketPrice prizePool players new address winner address isFinished false lotteries lotteryId lottery allLotteries push lotteryId function addPlayerToLottery uint lotteryId uint updatedPricePool address player external onlyLoterryContract LotteryInfo storage lottery lotteries lotteryId if lottery lotteryId revert lotteryNotFound lottery players push player lottery prizePool updatedPricePool function getLotteryPlayers uint lotteryId public view returns address memory LotteryInfo memory tmpLottery lotteries lotteryId if tmpLottery lotteryId revert lotteryNotFound return tmpLottery players function isLotteryFinished uint lotteryId public view returns bool LotteryInfo memory tmpLottery lotteries lotteryId if tmpLottery lotteryId revert lotteryNotFound return tmpLottery isFinished function getLotteryPlayerLength uint lotteryId public view returns uint LotteryInfo memory tmpLottery lotteries lotteryId if tmpLottery lotteryId revert lotteryNotFound return tmpLottery players length function getLottery uint lotteryId external view returns uint uint uint address memory address bool LotteryInfo memory tmpLottery lotteries lotteryId if tmpLottery lotteryId revert lotteryNotFound return tmpLottery lotteryId tmpLottery ticketPrice tmpLottery prizePool tmpLottery players tmpLottery winner tmpLottery isFinished function setWinnerForLottery uint lotteryId uint winnerIndex external onlyLoterryContract LotteryInfo storage lottery lotteries lotteryId if lottery lotteryId revert lotteryNotFound lottery isFinished true lottery winner lottery players winnerIndex Here we have two smart contracts Lottery amp LotteryData I took this approach so that the LotteryData which holds the overall lotteries and other info can be managed separately Let s Quickly Go through LotteryData sol first we have a struct mapping which holds the info to our specific lottery which maps a uniqueLotteryId gt lottery info struct LotteryInfo uint lotteryId uint ticketPrice uint prizePool address players address winner bool isFinished mapping uint gt LotteryInfo public lotteries Next we define some custom errors i ll be using custom errors rather than require as it saves up on some gas error lotteryNotFound error onlyLotteryManagerAllowed error actionNotAllowed Next we have a function called updateLotteryContract which can only be called by the owner of this LotteryData sol contract which sets the Lottery sol address to the variableaddress private lotteryContract so LotteryData sol can be only accessed and modified by the address set for lotteryContract Next we have other functions which i won t be explaining in depth Which are just to maintain each lottery data which will be modified from our Lottery sol Next Let s Take a look at our Lottery solFirst we import our required contractsimport openzeppelin contracts utils Counters sol import openzeppelin contracts utils math SafeMath sol import chainlink contracts src v VRFConsumerBaseV sol import chainlink contracts src v interfaces LinkTokenInterface sol import chainlink contracts src v interfaces VRFCoordinatorVInterface sol import LotteryData sol Next We Inherit from VRFConsumerBaseVcontract Lottery is VRFConsumerBaseV As we inherit from VRFConsumerBaseV we need to also implement the VRFConsumerBaseV constructor which expects vrfCoordinatorconstructor bytes keyHash uint subscriptionId address vrfCoordinator address link address lotteryData VRFConsumerBaseV vrfCoordinator lotteryId increment lotteryManager msg sender COORDINATOR VRFCoordinatorVInterface vrfCoordinator LINKTOKEN LinkTokenInterface link s subscriptionId subscriptionId keyHash keyHash LOTTERY DATA LotteryData lotteryData VRF Coordinator is a contract that is deployed to a blockchain that will check the randomness of each random number returned from a random node With VRFv we need VRF Subscription which can be created from then add the newly generated subscription id to your env Now in order to generate a random number using vrf we need make a request to vrf coordinator If you take a look at the pickWinner function function pickWinner uint lotteryId public onlyLotteryManager if LOTTERY DATA isLotteryFinished lotteryId revert lotteryEnded address memory p LOTTERY DATA getLotteryPlayers lotteryId if p length if p address revert playersNotFound require p address no players found LOTTERY DATA setWinnerForLottery lotteryId payable p transfer address this balance emit WinnerDeclared lotteryId p else LINK is from VRFConsumerBase s requestId COORDINATOR requestRandomWords keyHash s subscriptionId requestConfirmations callbackGasLimit number of random numbers lotteryRandomnessRequest s requestId lotteryId emit RandomnessRequested s requestId lotteryId when the lottery manager calls pickWinner we first check if there is just one player in lottery if yes we consider the only player player as the winner Else we request a random number from COORDINATOR which has a function requestRandomWords which expects keyHash s subscriptionId requestConfirmations callbackGasLimit and number of random numbers required from oracle You can find the keyHash from hereIn previous version of vrf we had to fund the LINK token address before requesting random number But with VRFv we just add our contract in our case Lottery sol as the consumer in subscription manager and maintain sufficient amount of LINK to request random numbers Next Once we call the requestRandomWords from COORDINATOR To get the random number we need to implement fulfillRandomWords in our Lottery sol which is then called by the coordinator which passes the random numbers to our lottery contract function fulfillRandomWords uint requestId uint memory randomness internal override uint lotteryId lotteryRandomnessRequest requestId address memory allPlayers LOTTERY DATA getLotteryPlayers lotteryId uint winnerIndex randomness mod allPlayers length LOTTERY DATA setWinnerForLottery lotteryId winnerIndex delete lotteryRandomnessRequest requestId payable allPlayers winnerIndex transfer address this balance emit WinnerDeclared requestId lotteryId allPlayers winnerIndex First argument is the requestId which we get when we called requestRandomWords second argument is randomness array of uint random numbers in our case we requested just random number so we access it as randomness Let s take it for a spin with hardhat i ll quickly go through the deploy scripts which i have written and also the mocks which can be used for testing First lets create new directory called config inside that create chainlink config jsconst config Hardhat local network Mock Data it won t work name hardhat keyHash xcbdaadfbbdeaaccbf fee fundAmount ganache name ganache keyHash xcbdaadfbbdeaaccbf fee fundAmount Rinkeby name rinkeby linkToken xBEEBefbCcaAe vrfCoordinator xccFfCaCDcBAEab keyHash xdbbfebeefbcabbceaaeaaacccc fee fundAmount const developmentChains hardhat localhost const VERIFICATION BLOCK CONFIRMATIONS module exports developmentChains VERIFICATION BLOCK CONFIRMATIONS config Create two files Deploy Mocks js amp Deploy Lottery js Deploy Mocks jsconst POINT ONE LINK module exports async getNamedAccounts deployments getChainId network gt const deploy log deployments const deployer await getNamedAccounts const chainId await getChainId log chainId log await getNamedAccounts if chainId chainId log Local network detected Deploying mocks const linkToken await deploy LinkToken from deployer log true await deploy VRFCoordinatorVMock from deployer log true args POINT ONE LINK e LINK per gas await deploy MockOracle from deployer log true args linkToken address log Mocks Deployed module exports tags all mocks main Over here we deploy a mock version of VRFCoordinator contract called VRFCoordinatorVMock to simulate the Oracle We call it MockOracle Deploy Lottery jsconst config developmentChains VERIFICATION BLOCK CONFIRMATIONS require config chainlink config const network require hardhat module exports async getNamedAccounts deployments getChainId ethers gt const deploy get log deployments const deployer await getNamedAccounts const chainId await getChainId let linkToken let linkTokenAddress let vrfCoordinatorAddress let subscriptionId if chainId chainId linkToken await get LinkToken log ethers VRFCoordinatorVMock await get VRFCoordinatorVMock linkTokenAddress linkToken address vrfCoordinatorAddress VRFCoordinatorVMock address const vrfM await ethers getContractAt VRFCoordinatorVMock vrfCoordinatorAddress await ethers getSigner const fundAmount config chainId fundAmount const transaction await vrfM createSubscription const transactionReceipt await transaction wait subscriptionId ethers BigNumber from transactionReceipt events topics await vrfM fundSubscription subscriptionId fundAmount else subscriptionId process env VRF SUBSCRIPTION ID linkTokenAddress config chainId linkToken vrfCoordinatorAddress config chainId vrfCoordinator const keyHash config chainId keyHash const waitBlockConfirmations developmentChains includes network name VERIFICATION BLOCK CONFIRMATIONS const lotteryData await deploy LotteryData from deployer log true const lottery await deploy Lottery from deployer args keyHash subscriptionId vrfCoordinatorAddress linkTokenAddress lotteryData address log true waitConfirmations waitBlockConfirmations const lData await ethers getContractAt LotteryData lotteryData address await ethers getSigner await lData updateLotteryContract lottery address log log VRF subscriptionId subscriptionId log Lottery Data Deployed On lotteryData address network network name log Lottery Deployed On lottery address network network name log module exports tags all main In order to test the oracle locally with mocks we need to fake bunch of flows one is the subscription which can be done using Mock Contracts If you take look at VRFCoordinatorVMock Contract it has bunch of handy functions which we can use to mock the working of oracle vrf coordinator we will use two of those initially createSubscription amp fundSubscription There you go we have our own mock vrf which we can use locally for testing Next We deploy our Lottery sol amp LotteryData sol Contracts const keyHash config chainId keyHash const waitBlockConfirmations developmentChains includes network name VERIFICATION BLOCK CONFIRMATIONS const lotteryData await deploy LotteryData from deployer log true const lottery await deploy Lottery from deployer args keyHash subscriptionId vrfCoordinatorAddress linkTokenAddress lotteryData address log true waitConfirmations waitBlockConfirmations const lData await ethers getContractAt LotteryData lotteryData address await ethers getSigner await lData updateLotteryContract lottery address First i deploy our LotteryData contract then the Lottery Contract with the same deployer account Once we deploy it we call the updateLotteryContract function from LotteryData sol Contract to set the lotteryContract address as the deployed Lottery contract address You can consider LotteryData contract as the storage for your Lottery contract Then we export our deployments as tags Tags in hardhat represent what the deploy script acts on In general it will be a single string value the name of the contract it deploys or modifies Let s Deploy gt npx hardhat deployLocal network detected Deploying mocks deploying LinkToken tx xddabfadefbccefdecbcadbed deployed at xFbDBafecbfdFfaa with gasdeploying VRFCoordinatorVMock tx xecfcbbefbadbebbdeeeccbcee deployed at xefECEFeBbEbbF with gasdeploying MockOracle tx xdebadafafcdacdbbdc deployed at xfEdDaFFdEfcfae with gasMocks Deployed deploying LotteryData tx xdfdecfbeadfdedbacbfdabfb deployed at xFCdccDcddabcBDF with gasdeploying Lottery tx xabedeebfedecbafcdfabbacbac deployed at xAcaadfadfEbF with gas VRF subscriptionId Lottery Data Deployed On xFCdccDcddabcBDF network hardhatLottery Deployed On xAcaadfadfEbF network hardhatThis will spin up the hardhats own test block chain node and deploy the contracts on that node Next Let s write some unit tests ‍Create lottery unit test js inside test directoryconst expect require chai const ethers getChainId deployments require hardhat describe LotteryGame Unit Tests gt let LotteryGame let lotteryGame let vrfCoordinatorVMock let chainId let deployer let user let user before async gt deployer user user await ethers getSigners chainId await getChainId await deployments fixture main vrfCoordinatorVMock await deployments get VRFCoordinatorVMock vrfCMock await ethers getContractAt VRFCoordinatorVMock vrfCoordinatorVMock address LotteryGame await deployments get Lottery lotteryGame await ethers getContractAt Lottery LotteryGame address it Should Pick A Pick A Random Winner async gt const newLottery await ethers getContractAt Lottery LotteryGame address deployer await newLottery startLottery await newLottery connect user enterLottery value ethers utils parseEther await newLottery connect user enterLottery value ethers utils parseEther await expect newLottery pickWinner to emit newLottery RandomnessRequested const requestId await newLottery s requestId simulate callback from the oracle network await expect vrfCMock fulfillRandomWords requestId newLottery address to emit newLottery WinnerDeclared Let s go through one of the tests which simulates the Oracle Should Pick A Pick A Random Winner First we start a lottery called newLottery then we enter with two of our test hardhat test accounts Then we call pickWinner function and expect it to emit event called RandomnessRequested which will return a request id from our vrfMock contract Then we make sure our deployed VrfMock emits the event WinnerDeclared which will be emitted once our VrfMock calls the fulfillRandomWords which we have simulated simulate callback from the oracle networkawait expect vrfCMock fulfillRandomWords requestId newLottery address to emit newLottery WinnerDeclared Let s run our tests gt npx hardhat test test lottery unit test js LotteryGame Unit Tests Should Pick A Pick A Random Winner ms passing s The expect which we are using is from chaijs testing lib They have some great examples here chai matchers Deploying to rinkeby test netThis will deploy all our contracts to Rinkeby test net gt npx hardhat deploy network rinkeby ResourcesAs this was a brief overview explaining my experience with smart contract and chainlink oracle There is Lot that you can improve with these contracts i recommend you to go through the hardhat deploy doc which is straight forward easy to understandHardhat starter kitRead Chainlink docs one of the awesome documentation And let everything sink in you Bonusi have this full code on my github here You can also find the client implementation which i have done using reactJs Feel free to give a 2022-03-28 01:31:38
海外TECH DEV Community Aprendendo com o método 3C https://dev.to/feministech/aprendendo-com-o-metodo-3c-1nbc Aprendendo com o método C Objetivo do Método CO objetivo do método C éte fornecer uma melhor forma para aprender ao mesmo tempo que ensinar e compartilha não sótrazendo benefícios ávocê mas também átoda uma comunidade de pessoas que vão poder consumir esse conteúdo Formas de aprenderAntes de tudo precisamos aprender ou relembrar sobre algumas formas de se aprender que existem e como pessoas com esses tipos de aprendizado podem estudar da melhor maneira VisualO aprendizado visual se baseia em mapas diagramas imagens vídeos etc Basicamente qualquer mídia visual que facilite a compreensão AuditivoPor outra via o aprendizado auditivo se baseia em vozes e aúdios como palestras discussões podcasts etc Aprendendo muito mais pela escuta que pelo visual CinestésicoO aprendizado cinestésico se baseia em ações práticas e experiências Aprendendo algo ao mesmo tempo que estásendo feito No mundo da tecnologia esse aprendizado émuito popular pois muitas pessoas aprendem sobre tecnologias enquanto criamos projetos que usam essas tecnologias Leitura e escritaE por último o aprendizado de leitura e escrita se baseia em ler informações e escrever essas informações para fixar o conhecimento Pra quêservem os tipos de aprendizado no método C A utilidade de saber os tipos de aprendizado épara sabermos qual o melhor formato que podemos usar para aprender e qual via seráa melhor para criarmos nosso conteúdo que éum dos passos do método Método CO método C consiste em passos ConsumirCriarCompartilharVamos abordar parte por parte ConsumirNa etapa de consumo devemos estudar o conteúdo da forma que melhor aprendemos em duas etapas Primeiro fazendo a absorção que éestudar sobre o conteúdo usando artigos vídeos podcasts palestras etc sobre a s tecnologia s E depois fazendo a dispersão Nela devemos aplicar o conteúdo estudado em projetos práticos para fixar o aprendizado criando projetos com a tecnologia que desejamos aprender CriarA etapa da criação consiste em transformar aquela massa mental em conteúdo para outras pessoas Essa etapa émuito importante pois énela que vamos desatar os nós que aquele conteúdo causa na nossa cabeça pois teremos que ensinar outras pessoas como utilizar aquela tecnologia Nessa etapa vocêpode criar o conteúdo em qualquer forma que vocêquiser como artigos lives podcasts vídeos etc Caso vocêqueira começar a criar conteúdo mas ainda não sabe como eu tenho este artigo chamado Como produzir seu primeiro conteúdo e outro chamado Passo a passo para começar a escrever artigos CompartilharA última etapa do método C écompartilhar o seu conteúdo divulgando este em comunidades e mídias sociais Com isso vocêrepete o ciclo de criação e consumo de conteúdo fazendo com que mais pessoas tenham acesso áesse conteúdo A Feministech tem um ótimo espaço para divulgar e pedir feedback sobre o seu conteúdo Caso queira entrar no nosso grupo mande uma DM no Twitter da Feministech ou no meu Twitter FinalizaçãoNesse artigo vocêaprendeu sobre o método C e como ele pode te ajudar a aprender e ensinar ao mesmo tempo Obrigada por ler ️ 2022-03-28 01:16:32
海外TECH DEV Community How to setup a Metamask account. https://dev.to/adeleke5140/how-to-setup-a-metamask-account-50f9 How to setup a Metamask account Metamask is an application you probably have heard of maybe from friends or family or twitter It is a browser based crypto wallet that provides a gateway to blockchain apps Metamask helps users send and receive cryptocurrencies and explore decentralized applications Dapps The definition above is a simplified definition of it If you want to learn more visit this linkMetamask is very useful if you need to create an account to try out a decentralized application or mint an NFT Setting up a Metamask accountFollow the steps below to create a Metamask account to mint that favorite NFT you love Download Metamask Metamask is a browser based wallet You get it by installing a browser extension to your browser of choice The official Metamask website is located at The landing page shows this Click on the Download now button I am currently using Brave browser which uses the same Chromium engine as Google chrome Hence the Install Metamask for Chrome button Once installed the extension logo resides on the top bar adjacent to the search field on most popular browsers Here is where it sits in the brave browser Create a Metamask account Click on the browser extension The screen below pops up click Get started I assume you are a new user With that click on create a wallet Read through the terms and conditions of the extensions Then click on I agree The next page shows two fields A password and confirm password fields The password you create helps to keep your account secured from unauthorized access You can make secure passwords for your apps with a password manager A free open source example is BitwardenOnce that is set up Metamask shows a helpful video for keeping your account secure Watching the video is the most crucial step in creating your account Please pay attention to this detail After reading through click next If you just skimmed through the content here is a summary Your secret phrase is a master key to all of your funds It would help if you did not give it to anyone unless people you trust very much It would be best to keep it secure in either a piece of paper in multiple places or a password manager I use the latter as it is more flexible Click Next The seed phrase sits hidden behind a lock button Once you are sure no one is peeking behind your shoulders click the button to unhide your seed phrase Next you must take note of it and store it in a self place Remember you are in charge of the security of your wallet Save your seed phrase somewhere and follow the required steps That should do it Voila Congratulations You are ready for the next stage of the internet 2022-03-28 01:15:55
金融 ニッセイ基礎研究所 年金積立金、全国統合へ(中国) https://www.nli-research.co.jp/topics_detail1/id=70659?site=nli 目次ー年月、都市職工年金の積立金の全国統合を開始ー新型コロナ後、半分の地域において給付が苦しい状況にー今後の具体的な制度運営や資産運用などについては未発表年月、公的年金制度の主務官庁である人力資源社会保障部は、都市部の就労者を対象とした都市職工年金の積立金の全国統合を月から開始していると発表した。 2022-03-28 10:54:21
金融 article ? The Finance 2024年3月までに対応必須。FATF第4次対日相互審査結果で改めて注目される「継続的顧客管理」を解説 https://thefinance.jp/law/22031282 trustdock 2022-03-28 01:27:02
ニュース BBC News - Home P&O Ferries sackings: Ferry operators face minimum wage law change https://www.bbc.co.uk/news/business-60895833?at_medium=RSS&at_campaign=KARANGA notice 2022-03-28 01:41:33
ニュース BBC News - Home Oscars fashion: Red carpet in pictures https://www.bbc.co.uk/news/entertainment-arts-60896370?at_medium=RSS&at_campaign=KARANGA hollywood 2022-03-28 01:28:49
GCP Google Cloud Platform Japan 公式ブログ 横浜銀行:次世代マーケティング プラットフォームを Google Cloud のテクノロジーをフル活用して構築、パーソナライズされた顧客体験を提供 https://cloud.google.com/blog/ja/topics/customers/bank-of-yokohama-building-a-next-generation-marketing-platform-leveraging-google-cloud/ 「お客様の基本的な属性データや取引データはどこの企業でも保有していると思いますが、例えばお客様の属性データ・取引データに加え、行動データを統合・分析し、顧客理解の高度化や迅速なマーケティング施策への反映といったアクションに繋げるまでのデータ活用ができている例は少ないと考えています。 2022-03-28 03:00:00
GCP Google Cloud Platform Japan 公式ブログ 5 つの業界に見る地理空間データの活用 https://cloud.google.com/blog/ja/products/maps-platform/location-intelligence-fact-sheets-in-five-industry-sectors/ 地理空間データによってビジネスの進め方がどのように変化してきたか、地理空間データを積極的に活用する企業とそうでない企業にどのような違いがあるかなどを深堀りしています。 2022-03-28 02:00:00
GCP Google Cloud Platform Japan 公式ブログ Virta Health が Google Cloud を利用して 2 型糖尿病の治療を変革 https://cloud.google.com/blog/ja/topics/healthcare-life-sciences/virta-health-transforms-type-2-diabetes-care-with-google-cloud/ Virtaのインフラストラクチャへの柔軟性とコントロールの提供年に小規模な医療スタートアップとしてスタートしたVirtaは、有力企業となった今、年までに型糖尿病患者億人を治療することを目標として数万人の患者を治療しています。 2022-03-28 02:00:00
北海道 北海道新聞 クルーズ船、2年4カ月ぶり道内寄港 函館 https://www.hokkaido-np.co.jp/article/661970/ 商船三井客船 2022-03-28 10:15:56
北海道 北海道新聞 【道スポ】輝星、粘投4回3失点 日本ハム https://www.hokkaido-np.co.jp/article/661982/ 日本ハム 2022-03-28 10:20:00
北海道 北海道新聞 住宅火災、2人安否不明 埼玉・越谷 https://www.hokkaido-np.co.jp/article/661979/ 埼玉県越谷市 2022-03-28 10:19:00
マーケティング AdverTimes 一人一人に寄り添う寺になるために ~築地本願寺の「伝え方」改革~ https://www.advertimes.com/20220328/article372070/ 一人一人 2022-03-28 01:54:50
マーケティング AdverTimes ユナイテッドアローズ、CMOに田中氏 営業部門を再編 https://www.advertimes.com/20220328/article379961/ 営業部門 2022-03-28 01:31:44
ニュース THE BRIDGE ARスタートアップのCynack、EC向け3D埋め込みサービス「Figni」をローンチ https://thebridge.jp/2022/03/cynack-launches-figni ARスタートアップのCynack、EC向けD埋め込みサービス「Figni」をローンチ東京を拠点にD基礎技術やARMRサービスを開発するCynackは日、EC事業者向けに商品などのD埋め込みサービス「Figni」の提供を開始した。 2022-03-28 01:00:57
GCP Cloud Blog JA 横浜銀行:次世代マーケティング プラットフォームを Google Cloud のテクノロジーをフル活用して構築、パーソナライズされた顧客体験を提供 https://cloud.google.com/blog/ja/topics/customers/bank-of-yokohama-building-a-next-generation-marketing-platform-leveraging-google-cloud/ 「お客様の基本的な属性データや取引データはどこの企業でも保有していると思いますが、例えばお客様の属性データ・取引データに加え、行動データを統合・分析し、顧客理解の高度化や迅速なマーケティング施策への反映といったアクションに繋げるまでのデータ活用ができている例は少ないと考えています。 2022-03-28 03:00:00
GCP Cloud Blog JA 5 つの業界に見る地理空間データの活用 https://cloud.google.com/blog/ja/products/maps-platform/location-intelligence-fact-sheets-in-five-industry-sectors/ 地理空間データによってビジネスの進め方がどのように変化してきたか、地理空間データを積極的に活用する企業とそうでない企業にどのような違いがあるかなどを深堀りしています。 2022-03-28 02:00:00
GCP Cloud Blog JA Virta Health が Google Cloud を利用して 2 型糖尿病の治療を変革 https://cloud.google.com/blog/ja/topics/healthcare-life-sciences/virta-health-transforms-type-2-diabetes-care-with-google-cloud/ Virtaのインフラストラクチャへの柔軟性とコントロールの提供年に小規模な医療スタートアップとしてスタートしたVirtaは、有力企業となった今、年までに型糖尿病患者億人を治療することを目標として数万人の患者を治療しています。 2022-03-28 02:00:00

コメント

このブログの人気の投稿

投稿時間: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件)