投稿時間:2022-03-29 01:29:50 RSSフィード2022-03-29 01:00 分まとめ(32件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Marketplace Best practices for driving traffic to your AWS Marketplace listing https://aws.amazon.com/blogs/awsmarketplace/best-practices-for-driving-traffic-to-your-aws-marketplace-listing/ Best practices for driving traffic to your AWS Marketplace listingIn this blog post I will share AWS programs and resources you can use to increase awareness and drive traffic to your AWS Marketplace listings AWS Marketplace is a curated digital software catalog that lets AWS customers find test and purchase third party software licenses All purchases are consolidated into a customer s AWS bill Developing a … 2022-03-28 15:52:32
AWS AWS Compute Blog Using larger ephemeral storage for AWS Lambda https://aws.amazon.com/blogs/compute/using-larger-ephemeral-storage-for-aws-lambda/ Using larger ephemeral storage for AWS LambdaServerless developers can now configure the amount of temporary storage available in AWS Lambda functions This blog post discusses common use cases and walks through an example application that uses larger temporary storage 2022-03-28 15:33:02
AWS AWS Open Source Blog Enabling Amazon Simple Storage Service (Amazon S3) Access Points in Apache Hadoop S3A https://aws.amazon.com/blogs/opensource/enabling-amazon-simple-storage-service-s3-access-points-in-apache-hadoop-s3a/ Enabling Amazon Simple Storage Service Amazon S Access Points in Apache Hadoop SAWe re pleased to announce that Amazon Simple Storage Service Amazon S Access Points can now be used in Apache Hadoop and any framework consuming the SA connector or relying on the Hadoop Distributed File System such as Apache Spark Apache Hive Apache Pig and Apache Flink In this post we review what access point … 2022-03-28 15:15:48
python Pythonタグが付けられた新着投稿 - Qiita io.BytesIO()にデータフレームで作成したExcelを保存して、openpyxlで列の幅を変更してメールに添付する方法 https://qiita.com/Akimoto_30s/items/151bc7e3ce99c1d03a42 ioBytesIOにデータフレームで作成したExcelを保存して、openpyxlで列の幅を変更してメールに添付する方法業務でioBytesIOにデータフレームから作成したExcelファイルを保存した後にopenpyxlで列の幅を修正する際につまづいたのでここにメモを残します。 2022-03-29 00:12:45
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScriptでオセロを作ってみた。リファクタリング。 https://qiita.com/tanimoto-hikari/items/81647b4812b0b9af3f92 ついでにすでにオセロが置いてある箇所は無駄な処理が走らないように早期リターンさせておく記述を追記しておきました。 2022-03-29 00:54:11
AWS AWSタグが付けられた新着投稿 - Qiita AWS CLIで別アカウント追加 https://qiita.com/mizuno_jin/items/097217deebb404120e07 AWSCLIで別アカウント追加結論awsconfigureprofileプロファイル名で追加できる。 2022-03-29 00:23:35
海外TECH MakeUseOf 5 Must-Have Opera Extensions to Boost Productivity https://www.makeuseof.com/must-have-opera-extensions-boost-productivity/ boost 2022-03-28 15:30:15
海外TECH DEV Community Hard to swallow pills every new Developer should take. https://dev.to/thepiyushmalhotra/hard-to-swallow-pills-every-new-developer-should-take-5bfl Hard to swallow pills every new Developer should take PHP Bad…Python Good The most important things that every new programmer must know before learning anything are usually the ones that are overlooked or ignored completely Mainly because we don t want to admit that they are correct either it s not the norm and we should always be following trends or because of other reasons related to cough ego cough People like to dive straight into the learning part and create new and amazing things which is not wrong by the way I ve done that too But I wish I knew some of these tips and facts about the tech industry learning when you re working and the shifting technology trends before starting that might have been a big help in my personal learning journey These tips might prove useful for new and budding programmers who have never worked in a professional environment as I ve mentioned below I m sure it s going to be a huge help in their learning path and change the traditional thought process while working in development that many people blindly follow So let s get into it… There are NO bad programming languages Yup I get a little annoyed every time someone makes fun of C PHP or Java and says that they are not good programming languages Well they are you just either don t need them in your current situation right now or you need to spend more time on them if you re struggling All these different languages are there for a reason and if over billion devices are using Java or of the internet runs on PHP then the problem is not the language The only thing required is practice and yes sometimes it is tempting to see your friends playing around with Python or JavaScript creating that cool game and that awesome looking website with smooth animations but that s okay you can use them too Just make sure your goals align with the tools you are using Until and unless you are using some esoteric languages like BrainF Befunge or Malbolge which is highly unlikely you don t need to switch the language you are learning just out of peer pressure I saw this great informative post while scrolling through Reddit and thought it might be of some use here as a guide Your goal should be efficiency at work While working a job more often than not you will come across multiple ways of solving a problem And more often than not there will be an established traditional way of solving that according to your colleagues But you should have the ability to know which solution will be more efficient in terms of your ability and learning speed For example it helps to know terminal commands of course in version control and that feeling of power is great when you push your code using Git via the terminal but if you feel more efficient using a GUI like GitKraken or GitHub Desktop then why not use that You are here to do the job faster and make things more convenient for yourself Don t let ego get in the way of being more efficient The same is the case for languages practice what you feel makes your job easier because the core principles are the same for every one of them Those green squares on GitHub Let s face it you as a beginner in programming should be focused on learning and building things first as a priority Creating your portfolio or jazzing up your GitHub profile part comes later But one thing I usually have noticed is that many developers get stressed out if they don t push their code daily and don t see that green square of contribution on GitHub Guys chillax You re not going to lose a job opportunity because a recruiter noticed you did not push anything for days If you did you dodged a bullet there because that company has some bad hiring practices What good recruiters want to see is whether you have the necessary problem solving skills or not And if not then provided the time whether you can learn them or not That s it My point here is if you do somehow manage to push something every day to GitHub for a whole year it s an impressive feat but that should not be your ultimate goal At the end of the day it s just a vanity metric equivalent to reading books in a year i e it s nice if you can achieve it but don t worry even if you miss it a few times Once you reach that level of experience you re going to notice that it s going to start happening by itself when you re working on various projects at once I m going to write another article in the coming weeks about how to keep your GitHub busy as a newbie developer Meanwhile here is a very interesting read I came across by Andrea Giammarchi who clearly explains why the amount of your GitHub commits mean nothing There is no fixed time for daily learning Too much of anything is a bad thing but too much good whiskey is barely enough Mark TwainAs the title says we all have lives apart from just sitting in front of a screen and it s important to hang out with friends go out and do something fun and just take a break for a while I don t mean to say that you should break your DaysOfCode streak or daily hour Leetcoding sessions but daily minutes of practice also counts as actual work done So if you give a whole day to yourself after studying for hour in the morning then don t feel guilty about it Some days we can work hours straight and still have enough energy left to accomplish other things but then there are days when the mind just goes BrainF It is our developer s passion to learn new stuff and create amazing things out of them be it just another hobby project or something that contributes towards helping the communities out there but when it starts to interfere with our peace of mind and we are feeling overwhelmed rather than relaxed after finishing a project or solving a problem then that s a signal from your brain that you need to slow things down That was it for the hard to swallow pills that every new developer should take There are always more useful tips for newbies that help a lot while learning to code but the ones mentioned above were what I observed from my experience working as a developer and also across multiple social media platforms I noticed many people were asking these questions on a daily basis so that s why I decided to write this nifty little article Hope you guys found it helpful Let me know if I can make some additions or changes to this article or if I missed some other important pills My objective for writing these articles is always to give back to the community which has aided me tremendously to become a good programmer Connect with me on GitHub Twitter or LinkedIn And stay tuned for more stuff ahead Ciao Guys 2022-03-28 15:45:27
海外TECH DEV Community RBAC and CapBAC in IoT https://dev.to/yongchanghe/rbac-and-capbac-in-iot-37f3 RBAC and CapBAC in IoT IntroductionIdentity access and management IAM is an integral part of a security strategy in modern enterprise By ensuring only the right people can access specific systems and data IAM helps limit your organization s exposure and reduce risk What is RBAC Many IAM systems use a method called role based access control RBAC to assign permissions for who can do what within specific IT resources like applications depending on the organization s structure and the users responsibilities RBAC allows you to create and enforce advanced access by assigning a set of permissions The permissions are based on what level of access specific user categories require to perform their duties In other words different people in your company can have completely different levels and types of access privileges based solely on factors such as their job function and responsibilities For example Human Resources employees could view employee records but not customer data And an HR manager could delete or change HR records while a lower level HR specialist would only be able to view them When an individual s responsibilities or functions changeーfor example due to a promotion or department transferーthat person is assigned to the new role in the RBAC system What is CapBAC Capability based access control CapBAC is a concept in the design of secure computing systems one of the existing security models A capability known in some systems as a key is a communicable unforgeable token of authority It refers to a value that references an object along with an associated set of access rights A user program on a capability based operating system must use a capability to access an object CapBAC refers to the principle of designing user programs such that they directly share capabilities with each other according to the principle of least privilege and to the operating system infrastructure necessary to make such transactions efficient and secure Reference elqchannel GoogleSearch amp elqcta CjKCQjwPWRBhDKARIsAPKHFGiIojvRR KqsfoyGHarhPZpOtzpZwT mdGLNdcv ntTDEWnxaArEEALw wcB amp gclid CjKCQjwPWRBhDKARIsAPKHFGiIojvRR KqsfoyGHarhPZpOtzpZwT mdGLNdcv ntTDEWnxaArEEALw wcB 2022-03-28 15:32:30
海外TECH DEV Community Welcome Everyone! https://dev.to/naaamae/welcome-everyone-4hc9 Welcome Everyone Maayong Adlaw before you start seeing my blog let me give you a short introduction about the Author Just call me Niña and I am currently studying at the University of Southern Philippines Foundation as a Computer Science student This is my last year in College and hopefully God will bless me to finish this stage I am now an intern in an ICT department and my main task is to help in the development of the school website version I also do other technical stuff aside from the website So everyone this blog will note the journey I ve been through during this internship Enjoy Reading WEEK March March Day My first week as an intern is a little bit challenging since I am used of staying at home during my rd year to th year first semester in College There is a big adjustment 2022-03-28 15:14:17
海外TECH DEV Community Calculator: Learn How to build a modern Calculator using JavaScript https://dev.to/kebean10/calculator-learn-how-to-build-a-modern-calculator-using-javascript-4dme Calculator Learn How to build a modern Calculator using JavaScriptYou ve probably heard that to get better at anything you need to practice more That s true because through deliberate practice you develop muscle memory That s where projects come in hand Projects are the best way to learn JavaScript and a calculator is one of the best projects to choose A calculator covers all the complex interactions with UI and JavaScript In this article I ll walk you through the steps it takes to build a completely modern Calculator using plain vanilla JavaScript best practices and modern ES practicesThe Calculator will be able to Add multiply divide and subtract operationsDelete operationsClear All operationsUse decimal numbersChain operationsLet s get startedProject Setup How to set up your projectfollow the following steps to setup your project Create a new folder named project and open your code editor e g visual studio code create index html styles css and index jslink the files inside the HTML HTMLCreate a div with a class calculator which will wrap everything inside the body tag You will also need to create another div with a class output with two nested div inside it with classes previous operand and current operand respectively to show the previous operand and the current operand in the Calculator screenlike this lt div class calculator gt lt div class output gt lt div class previous operand gt lt div gt lt div class current operand gt lt div gt lt div gt lt div gt Next create all the buttons on the calculator from AC to buttonlike this lt div class calculator gt lt div class output gt lt div class previous operand gt lt div gt lt div class current operand gt lt div gt lt div gt lt button class span two gt AC lt button gt lt button gt DEL lt button gt lt button gt ÷ lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button gt lt button class span two gt lt button gt lt div gt Ps Remember you have to include the class span two on both AC and buttons to make them span two columns later on Note you may have probably struggled to get the symbol If so you can google the symbol copy and paste it So far so good That s all for the HTML Part let s jump to styles css and start to style the Calculator to make it look nice CSSHere you re going to add CSS to style the Calculator First let s remove the default browser styles by doing the following changing default styles of the browser margin padding box sizing border box Next you need to change the style of the body element body font weight normal font family Gotham Rounded sans serif background linear gradient to right rgb rgb Next you need to style the screen by selecting the calculator wrapping all different buttons and elements class and style itlike this calculator display grid align content center justify content center Oops seems like it s not centred vertically you can fix that by giving the calculator class the full height which means it s going to fill of the height all the time calculator previously written code min height vh Alright With that fixed let s move on with styling the calculator class To make the buttons look like buttons of a calculator you ll need to use in this case grid template rows and grid template columns so we are making the columns repeating times while giving them px wide rows are repeating times while giving them px wide and giving them an initial minimum value of px tall but maximum of it auto essentially says as large as it needs to be to fit everything like this calculator display grid align content center justify content center min height vh grid template rows minmax px auto repeat px grid template columns repeat px Then to properly position the buttons you need to select them and add these styles calculator grid gt button outline none background color rgba font size rem border px solid fff cursor pointer Adding the hover effect calculator grid gt button hover previously written code background color rgba Now let s style that span two class to make the AC and buttons span two columns span two grid column span So far so good but as you can see in your browser the output section is not properly styled To fix that you need to style the actual output as a whole using this trick output background color rgba grid column display flex justify content space around align items flex end flex direction column padding px word wrap break word word break break all The last thing about CSS is to style the operand which are previous operand and current operand you can do thatlike this output previous operand font size rem color rgba output current operand font size rem color fff Congrats you re done with CSS Please take a break and come back for the fun part which is JavaScript JavaScriptAlright let s get started with the most fun part which is coding up the JavaScript to get started first you need to select all the different numbers operands and all the buttons Clear button delete button etc To make that easier you ll need to add attributes in HTML to be easier to select this is important because you don t need styling classes with javaScript the code snippets to do it is like this lt Modifying the HTML by adding attributes to be able to select by gt lt div class calculator gt lt div class output gt lt div data previous operand class previous operand gt lt div gt lt div data current operand class current operand gt lt div gt lt div gt lt button data all clear class span two gt AC lt button gt lt button data delete gt DEL lt button gt lt button data operation gt ÷ lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data operation gt lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data operation gt lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data operation gt lt button gt lt button data number gt lt button gt lt button data number gt lt button gt lt button data equals class span two gt lt button gt lt div gt Here you go Since you have added the attributes to select the HTML elements then you can use JavaSript to select themlike this const currentOperandElement document querySelector data current operand const previousOperandElement document querySelector data previous operand const numberButtons document querySelectorAll data number const operationButtons document querySelectorAll data operation const equalsButton document querySelector data equals const deleteButton document querySelector data delete const allClearButton document querySelector data all clear Now that everything is selected let s see how to use JavaScript to make the calculator works like the normal calculator The first thing you need to think about is how to store all the information of what s number typed by the user the easiest way to do that is to use a Class justlike this class Calculator constructor previousOperandElement currentOperandElement this previousOperandElement previousOperand this currentOperandElement currentOperand delete appendNumber number clear chooseOperation operation compute updateDisplay So what s going on so far Above we have created a Calculator class which holds the constructor This constructor will take all the inputs the user will type as well as all the functions for our calculator these functions will be delete This function will remove a single number append number This function will add the number every time the user select that number Clear This function will clear up all different variables chooseOperation This function will let the user select which operation to use and make it function effectively compute This function will take all the values inside the calculator and compute a single value for what we need to display on the screen updateDisplay This function will update the values inside the output Next let s think about the different properties the calculator needs to store First you need to know the current operand the user is working on previousOperand the user entered and the operation they selected if any So you need to be able to remove all these values and that can be done inside a clear functionlike this class Calculator constructor previousOperandElement currentOperandElement this previousOperandElement previousOperand this currentOperandElement currentOperand this clear clear this previousOperand this currentOperand this operation undefined Note Remember as soon as we create our Calculator we need to call clear function as shown above This is because we need to clear all of the inputs to set them to the default values as soon as we create a new Calculator Now that we know all the functions the Calculator will use let s make all the variables previously created operate on the Calculator Object like this const calculator new Calculator previousOperandElement currentOperandElement Next let s make the numberButtons functionlike this numberButtons forEach button gt button addEventListener click gt calculator appendNumber button innerText calculator updateDisplay Now you ll need to write the appendNumber and updateDisplay functions to make them workslike this class Calculator previously written code appendNumber number if number amp amp this currentOperand includes return this currentOperand this currentOperand toString number toString updateDisplay this currentOperandElement innerText this currentOperand this previousOperandElement innerText this previousOperand Next let s make the operationButtons function as well operationButtons forEach button gt button addEventListener click gt calculator chooseOperation button innerText calculator updateDisplay Now you ll need to write the choose operation function to make it worklike this class Calculator previously written code chooseOperation operation if this currentOperand return if this previousOperand this compute this operation operation this previousOperand this currentOperand this currentOperand Next let s make the equalsButton function also equalsButton addEventListener click button gt calculator compute calculator updateDisplay Now let s work on implementing the compute function class Calculator previously written code compute let computation const prev parseFloat this previousOperand const current parseFloat this currentOperand if isNaN prev isNaN current return switch this operation case computation prev current break case computation prev current break case computation prev current break case ÷ computation prev current break default return this currentOperand computation this operation undefined this previousOperand Next let s make the allClearButton function as well allClearButton addEventListener click button gt calculator clear calculator updateDisplay Next let s make the deleteButton function also deleteButton addEventListener click button gt calculator delete calculator updateDisplay Now let s work on implementing the delete function but here you ll need to use the slice method to get the very last value from the string and cut it offlike this class Calculator previously written code delete this currentOperand this currentOperand toString slice Congrats Now the Calculator is entirely functional at a base value but the actual display of our Calculator is not that nice we don t have commas between numbers the operands are not shown up in the previous operand so it needs to be fixed Just a couple of lines of code First thing we need to modify the update display function and create getDisplayNumber function to delimit numbers with commaslike this previously written code here updateDisplay this currentOperandElement innerText this getDisplayNumber this currentOperand if this operation null this previousOperandElement innerText this getDisplayNumber this previousOperand this operation else this previousOperandElement innerText getDisplayNumber acting like a helper function to delimit numbers with commas getDisplayNumber number const stringNumber number toString for splitting on decimal characters inside it const integerDigits parseFloat stringNumber split turning a string to an array const decimalDigits stringNumber split getting second portion out of the array which is number after decimal place let integerDisplay if isNaN integerDigits integerDisplay else integerDisplay integerDigits toLocaleString en maximumFractionDigits en in the localeString means english if decimalDigits null return integerDisplay decimalDigits else return integerDisplay Here is what the final version of the project looks like ConclusionNow that you ve made it to the end of this project you have a completely functioning modern JavaScript Calculator working in your browser if you found this article helpful please give it a thumbs up Happy Coding 2022-03-28 15:13:22
海外TECH DEV Community Slow and steady https://dev.to/menghif/slow-and-steady-400p Slow and steadyThis past Friday we released version of Telescope and we are now closer and closer to the big final release Breaking things downI received feedback on my PR from the previous week about sharing a single Nginx container for all static sites The restructuring of the directories made the PR too big with hundreds of file changes although most just renaming To make it easier for reviewer and for myself I decided to split the work into multiple PRs I started with moving the src web directory to src web app I searched again through the whole project for paths that needed to be updated This more narrow focus on a smaller task helped me find some relative paths that I missed in the original PR This really shows the benefits of splitting a big task into smaller pieces to make it more manageable Before merging this PR we needed to update the path on Vercel and give a heads up to other students working on frontend issues that they needed to rebase their branch before moving forward I still have to do the same with the docusaurus and test web content directories and then make the necessary Docker and Nginx changes Frontend changesThe other issue I worked on this week was adding a copy button for code snippets I had to revisit a lot of Web APIs features so I spent a lot of time on MDN I love this website there s always something new to learn on it I originally used MouseEvent to capture the mouse movement and add a copy button to the DOM Tue helped out by suggesting to use mouseenter and mouseleave so I made the appropriate changes As of Friday the copy button was working but the code was not great and it used the text copy instead of an icon Because of this it did not make it into the release Busy with an endless Android assignment that took over my weekend I did not manage to continue to work on it To my surprise Duc took over the PR and made it truly great His final version turned the button into a React component that feels a lot more at home on Telescope than my original version Working on this reminded me that Open Source is a team sport and we really shouldn t be afraid to get help from others that might have more experience Tue and I got the ball rolling and then Duc scored the goal In the end we all win 2022-03-28 15:11:26
海外TECH DEV Community Generic em Typescript https://dev.to/jsmbengui/generic-em-typescript-224f Generic em TypescriptNeste post eu vou dar uma introdução sobre o que ée como usar generic em typescript Generic éum funcionalidade que permite criar componentesfunçõesinterfacesclasses que aceitam uma variedade de tipos de dados ao invés de um Com o uso de generic damos a possibilidade da nossa função poder ser usada em diferentes situações e removendo a duplicidade de código Generic aparecem em typescript dentro de colchetes angulares no formato onde T vai representar o tipo de dado E élido como generic do tipo T e este tipo T pode ser usado como tipo de dado para qualquer parâmetro ou variável dentro da função classe ou interface Exemplo function info value string return value Aqui temos um função normal que aceita um valor do tipo string e retorna mas tem casos pretendemos usar a nossa função em cenários onde o value pode ser outro tipo de dado ai chega o ponto em pensar em generic function info lt T gt value T return value Com a adição de info tornamos a nossa função generic possibilitando assim que ela receba diferentes tipos de dados para a variável value Em typescript generic pode ser usado com função classe ou interfaceGenerics com funçãoPara usar generic com função basta adicionar lt gt depois do nome da função e dentro de lt gt colocar a lista dos tipos de dados que a função vai receberfunction info lt T gt function pickValue lt T K gt Nota que os tipos de dados do generic não são usados apenas para os parâmetros da função eles podem ser usados como tipo de dados para todo e qualquer componente dentro da função async function fetchApi lt ResultType gt path string Promise lt ResultType gt const response await fetch path return response json type Info name string const data await fetchApi lt Info gt info Generics com Interfaces ClassesNa criação de interfaces ou classes temos muita vantagem ao usar generic pois conseguimos cobrir uma grande variedade de situação para a nossa interface ou classeInterfacePara criar um interface ou classe generic adicionamos a lista de tipos depois do nome da interface ou classeinterface GenericInterface lt T gt value T Aqui declaramos uma interface que tem uma propriedade value e onde o tipo vai ser determinado quando passarmos o valor de T Classclass Queue lt T gt private data push item T gt this data push item pop T gt this shift const queue new Queue lt number gt queue push queue push ERROR can push string Aqui criamos uma pilha que pode ser usada para diferentes cenários seja ele quando precisamos de um pilha de números string alunos etc ConclusãoNeste pequeno tutorial falamos sobre generic como usá la em funções interface e classes E podemos notar que o bom uso de generic vai nos ajudar a evitar repetir código e deixar as nossas funções interfaces e classes mais flexíveis 2022-03-28 15:09:01
海外TECH DEV Community Introduction to ic-event-hub library https://dev.to/seniorjoinu/introduction-to-ic-event-hub-library-5366 Introduction to ic event hub libraryThis tutorial is dedicated to Rust smart contract canister development on Internet Computer Dfinity platform Completing it you ll know how to use ic event hub library APIs in order to perform efficient cross canister integrations Before digging into this tutorial it is recommended to learn the basics of smart contract development for the Internet Computer Here are some good starting points official website dedicated to canister development on the IC IC developer forum where one could find an answer to almost any technical question This tutorial is intended for new developers who want to understand the basics of ic event hub If you already finished it it is recommended to check out my other tutorials about this library Tutorial Connecting A Token With Multiple Ledgers Using ic event hubTutorial Efficient Canister Networking With ic event hub seniorjoinu ic event hub Event based pub sub for IC canisters IC Event HubA rust library that enables efficient event based pub sub for IC canistersMotivationThe main idea behind the Open Internet Services concept is collaboration The easier it is for us to integratecanisters the more great software we can build together the closer we are to the Open Internet This library greatly simplifies canister integration by flipping integration surface upside down It enables yourcanister to express its interfaces in terms of emitted events Sending a message your canister does not need to know asignature of the remote canister anymore Instead the remote canister should know what events it wants to receive fromyour canister This enables us to create emitter canisters ones which emit events when something important happensinside it and which does not care who are the exact recipients of these events On the other side listener canisters recipients are able to make… View on GitHub MotivationCurrently canisters on the IC use request response model to communicate with each other While this model covers almost of any needs sometimes it limits integration simplicity It s simpler to go through an example here Imagine the following scenario you ve built a token canister that accepts transfer transactions from users and re transmits the info about these transactions to any other canister that will ask for it there are many ledger canisters developed by third parties who want to integrate them with your token each of which is specialized on specific transaction type one of them only keeps track of transactions made by US citizens another one only keeps track of transactions made to from charity organizations a bunch of personal ledgers which keep track of transactions of a particular person or organization and each month there is at least one more ledger appears with some new specific requirements besides all of that you want to make your token as efficient as possible if the token experiences high load e g tx block you don t want to send messages to each ledger since messages you send to ledgers are small only contain some generic transfer data from to amount timestamp you want to pack these messages into a single batch and send them all at once this way you could save a lot of cycles It looks like in order to implement such a scenario one would need a system that fits into the following requirements We want to fire and forget data without bothering about who exactly is going to receive it or if there is an error at the receiver s side We want receivers to be able to specify conditions of desired data e g if this peace of data equals to send it to me otherwise ignore me There should be some kind of data batching functionality that will help us stay on the budget These declarations imply that an event based protocol is what we actually want Such a protocol where there are emitters which emit events and listeners which receive these events based on some conditions ic event hub library implements that event based protocol for us ic event hubThis library defines two types of actors emitters and listeners They communicate via events special data structures optimized for conditional subscription Emitters emit events listeners subscribers subscribe to events they are interested in Here is an example of an event derive Event pub struct TransferEvent topic pub from Principal topic pub to Principal pub amount Nat pub timestamp u Notice two things The whole struct is annotated with derive Event macro This macro will implement the IEvent trait for us the trait that transforms our custom structure into the Event structure Some fields are also annotated with topic macro By annotating a field with this macro we enable listeners to filter all emitted events and only receive events which have these two fields set to some specific value By annotating a struct with derive Event macro you ll also be automatically provided with special EventFilter struct This struct is used by listeners in order to specify events they are interested in For example annotating the TransferEvent struct defined above with derive Event would also generate the following structure pub struct TransferEventFilter pub from Option lt Principal gt pub to Option lt Principal gt If the listener wants to receive all TransferEvents they would initialize this structure this way TransferEventFilter from None to None If they want to receive only those TransferEvents related to some particular sender they would use this structure the following way TransferEventFilter from Some some principal to None Emitter canisterEmitter canisters emit events by calling emit function emit TransferEvent from to amount timestamp As you might notice there is no await after the invocation This is because of fire and forget policy the emitter sends data in form of events to nowhere It doesn t even bother if there is any listener out there the library handles it automatically It is important to say that the fire and forget policy implementation is virtual Under the hood the emitter canister still waits for responses for sent event batches in the background but it just ignores them once they appear The event won t be transmitted immediately Instead the library will push it to an event queue unique for each listener Once this queue grows big enough or once enough time has passed only then this queue is transformed into a batch and sent to the listener canister This implies that even if one writes something like this emit event emit event emit event These events will be merged into a single event batch and sent all at once Both parameters the queue s size in bytes and the desired delay before the transmission are configurable You can pass them into the library initializing macro like this implement event emitter max time interval nano max batch size bytes What about this macro it initializes the state of the library and make functions like emit available for usage so don t forget to call it somewhere in your canister s code In order to activate the transmission of events we have to use the heartbeat function heartbeat pub fn tick send events In order to receive events a listener canister has to subscribe to them An emitter canister s developer could allow any listener to subscribe to events emitted by this canister To do this the developer would have to call implement subscribe macro somewhere inside the canister s code This macro supports guard function declaration inside implement subscribe guard guard function Listener canisterAfter that a listener canister is able to call subscribe function of the emitter canister like this let event filter TransferEventFilter from Some some principal to None emitter canister principal subscribe SubscribeRequest callbacks vec CallbackInfo filter event filter to event filter callback method name String from events callback await expect Subscription failed As you might notice a listener is able to specify the callback method name for each event filter ic event hub on the emitter s side will use this callback function name to send all the events which fit into the provided EventFilter This callback should be implemented like this update fn events callback events Vec lt Event gt for event in events if event get name as str TransferEvent let ev TransferEvent TransferEvent from event event print format Got event ev as str It should also accept a single argument of type Vec lt Event gt and return nothing If you need extra security e g forbid some canisters from sending events to you you can also express it inside this function Combining everything togetherOkay let s define a basic example of how one could use ic event hub in order to implement a solution for the scenario we described earlier On the token canister side we would need to put a code like this define an event data type derive Event pub struct TransferEvent topic pub from Principal topic pub to Principal pub amount Nat pub timestamp u initialize ic event hub state and enable the emit functionimplement event emitter emit events somewhere in your code for example inside the transfer function of the tokenemit TransferEvent from to amount timestamp enable listeners to subscribeimplement subscribe activate event sending heartbeat pub fn tick send events On a ledger canister side define the same event data type derive Event pub struct TransferEvent topic pub from Principal topic pub to Principal pub amount Nat pub timestamp u define event filter s describing the data you want to receivelet event filter TransferEventFilter from Some some principal to None subscribe for events using the filteremitter canister principal subscribe SubscribeRequest callbacks vec CallbackInfo filter event filter to event filter callback method name String from events callback await expect Subscription failed define the callback function to process incoming events update fn events callback events Vec lt Event gt for event in events if event get name as str TransferEvent let ev TransferEvent TransferEvent from event event print format Got event ev as str That s it ic event hub will handle everything else the transmission listener subscription encoding decoding process event filter matching and event batching process AfterwordThe ic event hub library is not only an alternative way of transmitting data between canisters It is also an implementation of Inversion of Control pattern In the standard request response model the receiver defines the data type it want to receive and the sender decides whether it will send the data or not In the ic event hub s event based model the sender defines the data type it will send and the receiver decides whether it wants to receive that data or not In the standard request response model a developer has to keep track of many different things an address canister id of the remote program a signature of the remote function and the right time to transfer the data In exchange for doing this the model rewards a developer with the ability to process the response of the remote call In the ic event hub s event based model a developer gives up on response processing and in exchange is rewarded with simplicity and high throughput It is recommended to use this library as an alternative protocol alongside the standard request response protocol not as a replacement for it This way you as a developer would enjoy the best experience possible Thanks for reading and don t forget to take a look at ic event hub s source code seniorjoinu ic event hub Event based pub sub for IC canisters IC Event HubA rust library that enables efficient event based pub sub for IC canistersMotivationThe main idea behind the Open Internet Services concept is collaboration The easier it is for us to integratecanisters the more great software we can build together the closer we are to the Open Internet This library greatly simplifies canister integration by flipping integration surface upside down It enables yourcanister to express its interfaces in terms of emitted events Sending a message your canister does not need to know asignature of the remote canister anymore Instead the remote canister should know what events it wants to receive fromyour canister This enables us to create emitter canisters ones which emit events when something important happensinside it and which does not care who are the exact recipients of these events On the other side listener canisters recipients are able to make… View on GitHub 2022-03-28 15:06:29
Apple AppleInsider - Frontpage News What to do with an old iPhone after you've moved to a new one https://appleinsider.com/inside/iphone-13/tips/how-to-put-your-old-iphone-to-use-after-you-bought-the-new-iphone-xs?utm_medium=rss What to do with an old iPhone after you x ve moved to a new oneWhether it s last year s model or a digital antique like an iPhone s that once cherished device can have an entirely new life Here s just how an old iPhone can still be immensely useful We need to get two things out of the way first That starts with how you could just give away your old iPhone to your kids or to a charity and maybe that would be the best thing you can do Also though you could trade in that phone Whether you do through Apple at the point of ordering your iPhone or later through another company it can well be worth doing Read more 2022-03-28 15:13:51
海外TECH Engadget Amazon's second-gen Echo Buds are down to only $50 right now https://www.engadget.com/amazons-second-gen-echo-buds-are-down-to-only-50-right-now-152450792.html?src=rss Amazon x s second gen Echo Buds are down to only right nowAmazon improved its Echo Buds in nearly every way when it came out with the second generation last year and at they re a solid option for those who don t want to spend a ton on ANC earbuds Now Amazon s knocked percent off the second gen Echo Buds bringing the models with the standard charging case down to only That s cheaper than they were during the holiday shopping season last year Buy Echo Buds at Amazon The online retailer learned from the shortcomings of its original Echo Buds and rectified many of them when redesigning the latest models The buds are percent smaller than the previous models a bit lighter too and the entire design is IPX rated against water splashes Sound quality has been massively improved audio sounds less compressed and you ll be able to hear the differences at low medium and high volumes In the Alexa companion app you can mess around the the EQ if you wish while also customizing the settings for ANC mode hands free Alexa and Power Save mode Amazon switched from active noise reduction to true active noise cancelling on these buds and it made a world of difference The buds block out surrounding noises and the Passthrough feature which allows some environmental noise in sounds more natural than that of other earbuds Naturally you re also getting Alexa voice commands on these buds and the assistant can do more than it could before controlling music and podcast playback finding specific shows on Amazon Music and making recommendations for other content you may want to listen to Battery life is pretty decent as well ーyou ll get about five hours of listening time before the Echo Buds need more juice and their case can give you two hours of listening time after only minutes of charging While call performance could be better the second gen Echo Buds are still a good option if you rely on Alexa for a lot of things or if you want a pair of ANC earbuds that won t break the bank Follow EngadgetDeals on Twitter for the latest tech deals and buying advice 2022-03-28 15:24:50
Cisco Cisco Blog Five Stars, Four Roles, Three Levels and Two Priorities – Partners’ and Customers’ Success https://blogs.cisco.com/partner/five-stars-four-roles-three-levels-and-two-priorities-partners-and-customers-success Five Stars Four Roles Three Levels and Two Priorities Partners and Customers SuccessFor straight years Cisco has been honored to receive CRN s Star rating in their Partner Program Guide This is a huge honor and our AppDynamics team also earned Star status for their continued dedication to partners 2022-03-28 15:00:46
Cisco Cisco Blog Next-Generation Enterprise Campus Network Virtualization with BGP EVPN VXLAN https://blogs.cisco.com/networking/next-generation-enterprise-campus-network-virtualization-with-bgp-evpn-vxlan Next Generation Enterprise Campus Network Virtualization with BGP EVPN VXLANCisco remains laser focused on listening executing and delivering world class solutions to our customers on their path to digital network transformation And if you are ready we are here to help Reach out to your Cisco sales team to start your BGP EVPN VXLAN journey 2022-03-28 15:00:40
金融 RSS FILE - 日本証券業協会 J-IRISS https://www.jsda.or.jp/anshin/j-iriss/index.html iriss 2022-03-28 15:44:00
金融 金融庁ホームページ 特別研究員を募集しています。 https://www.fsa.go.jp/common/recruit/r3/kenkyu-02/kenkyu-02.html 特別研究員 2022-03-28 17:00:00
金融 金融庁ホームページ 非常勤職員(専門研究員)を募集しています。 https://www.fsa.go.jp/common/recruit/r3/kenkyu-03/kenkyu-03.html 非常勤職員 2022-03-28 17:00:00
金融 金融庁ホームページ 金融安定理事会による「新型コロナウイルス感染症の世界的大流行のもとでのフィンテックと市場構造:金融安定に対するインプリケーション」について掲載しました。 https://www.fsa.go.jp/inter/fsf/20220328/20220328.html 世界的大流行 2022-03-28 17:00:00
ニュース ジェトロ ビジネスニュース(通商弘報) 在中米企業、66%が2022年も投資拡大の意向、市場の成長見通しに対する楽観は減少 https://www.jetro.go.jp/biznews/2022/03/59ebbcd33a7887a2.html 見通し 2022-03-28 15:40:00
ニュース ジェトロ ビジネスニュース(通商弘報) ラオス計画投資省投資奨励局とジェトロでMOC締結 https://www.jetro.go.jp/biznews/2022/03/80cdffdea371d618.html 計画投資省 2022-03-28 15:30:00
ニュース ジェトロ ビジネスニュース(通商弘報) スマート工業団地が着工、デンマークのレゴが進出予定 https://www.jetro.go.jp/biznews/2022/03/859db8c03d1543bb.html 工業団地 2022-03-28 15:20:00
ニュース ジェトロ ビジネスニュース(通商弘報) 2021年中国都市別GRPランキングを発表 https://www.jetro.go.jp/biznews/2022/03/eba63ac9d31b2297.html 都市 2022-03-28 15:10:00
ニュース BBC News - Home P&O Ferries given deadline to reemploy sacked workers https://www.bbc.co.uk/news/business-60895833?at_medium=RSS&at_campaign=KARANGA previous 2022-03-28 15:28:18
ニュース BBC News - Home Energy strategy delayed amid Treasury concerns over costs https://www.bbc.co.uk/news/uk-politics-60903879?at_medium=RSS&at_campaign=KARANGA energy 2022-03-28 15:44:00
ニュース BBC News - Home 'No doubt he can play at the highest level' - Southgate retains faith in Maguire https://www.bbc.co.uk/sport/football/60905107?at_medium=RSS&at_campaign=KARANGA x No doubt he can play at the highest level x Southgate retains faith in MaguireHarry Maguire has shown he can play at the highest level says Gareth Southgate but the England manager also warns that players can t be poor for a couple of years 2022-03-28 15:35:36
北海道 北海道新聞 畑岡奈紗9位、笹生優花は11位 女子ゴルフ世界ランキング https://www.hokkaido-np.co.jp/article/662395/ 世界ランキング 2022-03-29 00:27:00
北海道 北海道新聞 米、国防予算100兆円超 「安全保障に最大級投資」 https://www.hokkaido-np.co.jp/article/662392/ 会計年度 2022-03-29 00:18:00
北海道 北海道新聞 金正恩氏「攻撃手段より多く開発」 新型ICBMの成果強調 韓国報道「既存型」と疑義 https://www.hokkaido-np.co.jp/article/662391/ 攻撃手段 2022-03-29 00:02:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

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

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