IT |
ITmedia 総合記事一覧 |
[ITmedia エグゼクティブ] 次世代燃料、光触媒・再エネで低コストに 住友商事、米企業と水素・SAF実証試験 |
https://mag.executive.itmedia.co.jp/executive/articles/2303/06/news066.html
|
itmedia |
2023-03-06 08:24:00 |
AWS |
lambdaタグが付けられた新着投稿 - Qiita |
Chatwork上で会話できるChatGPTボットをAWS Lambdaだけで実現するとき、Elixirだと少し良いものができたお話 |
https://qiita.com/erin/items/b5d3ab79c693ee3c7c83
|
awslambda |
2023-03-06 08:49:04 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
Rubyで文字列の長さを取得する |
https://qiita.com/nogizakapython/items/7a0b15bf2ec0ab23f4c9
|
numinputlinelengthputsnum |
2023-03-06 08:20:55 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWSリソース取得スクリプト |
https://qiita.com/Roux_Qiita/items/ae742e7c338745e86a4f
|
batchgetresource |
2023-03-06 08:52:56 |
技術ブログ |
Developers.IO |
みんなベストプラクティスできてる?「AWSセキュリティのベストプラクティスに関する利用実態調査レポート」まとめ |
https://dev.classmethod.jp/articles/security_jaws_best_practice_report/
|
securityjawsinsi |
2023-03-05 23:23:00 |
海外TECH |
DEV Community |
Understanding the Difference Between props and state in React |
https://dev.to/haszankauna/understanding-the-difference-between-props-and-state-in-react-2mg3
|
Understanding the Difference Between props and state in ReactReact is a powerful JavaScript library that enables developers to easily create complex user interfaces However it can be difficult for newcomers to distinguish between props and states Props and state are both important React concepts but they serve different purposes and should be used differently What Are props and state Both props and state are JavaScript objects that hold information that React components can use The distinction is that props are passed down from a parent component to a child component whereas state is managed within the component itself propsprops stands for properties and is short for component properties Props are unchangeable and are passed down from parent to child components Props in other words are read only and should not be modified by the child component Here s an example of a parent component passing props to a child component ParentComponent jsimport React from react import ChildComponent from ChildComponent function ParentComponent const message Hello World return lt div gt lt ChildComponent message message gt lt div gt ChildComponent jsimport React from react function ChildComponent props return lt div gt props message lt div gt The ParentComponent in this example passes the message prop to the ChildComponent The ChildComponent object is passed as an argument to the ChildComponent which then renders the message prop stateAstate object is one that is managed within a component It enables a component to keep track of its own data and automatically update its rendering when that data changes Unlike props state can be changed by the component Here s an example of a component that makes use of state MyComponent jsimport React useState from react function MyComponent const count setCount useState function handleClick setCount count return lt div gt lt p gt You clicked the button count times lt p gt lt button onClick handleClick gt Click me lt button gt lt div gt In this example the MyComponent component manages its own count state using the useState hook When the button is clicked the handleClick function updates the count state and the component re renders to reflect the updated state When Should You Use props or state Depending on the situation props and state should be used in different ways When data is passed down from parent to child use props When passing data from a parent component to a child component use props Because props are immutable the child component should not modify them When Data Is Managed Within a Component Use stateWhen you need to manage data within a component useState The component can change the state using setState or hooks like useState useReducer or useContext ConclusionIn conclusion props and state are both important concepts in React but they serve different functions Props are used to pass data from parent to child components whereas state is used to manage data within a component When using props keep in mind that they are read only and should not be changed by the child component If you need to change the data use state instead Similarly when working with state keep in mind that it should only be changed using the setState method or hooks like useState useReducer or useContext Directly modifying state can result in unexpected behavior and should be avoided You can write more efficient and maintainable React code if you understand the difference between props and state Props are used to pass data from parent to child components and state is used to manage data within a component Always use setState or hooks to modify state and avoid directly modifying props With a better understanding of props and state you can use React s powerful capabilities to create dynamic and responsive user interfaces |
2023-03-05 23:51:28 |
海外TECH |
DEV Community |
KLYNTAR Virtual Machines. Part 0: KLY-EVM — shardable, low-level managed, mutable, and WASM-improved EVM. |
https://dev.to/klyntar/klyntar-virtual-machines-part-0-kly-evm-shardable-low-level-managed-mutable-and-wasm-improved-evm-15cd
|
KLYNTAR Virtual Machines Part KLY EVM ーshardable low level managed mutable and WASM improved EVM IntroHi we re back in touch With this story we start a new cycle of articles about KLY Here we ll discuss virtual machines available on KLYNTAR You can find much interesting information about low level management the workflow of VMs execution cross vm interaction and so on Also we ll publish a set of articles about different use cases of how to write contracts and how to use KLY features available for different VMs EVM amp WASM amp others predeployed contracts special logs WORA principle mutations and much more KLY EVMDefinitely the most popular VM in the blockchain industry is EVM Projects with EVM compatibility propose a well known set of tools for developers for a quick start with their ecosystem You even shouldn t learn new languages or work with docs just use solidity docs web library and life is good Not all of the projects propose new features for their EVM port But it s not true in the case of KLYNTAR Multi level sharding the implementation on EVM levelProbably it s the hottest part of this article As you remember from previous articles in our blog we ve discussed multi level sharding implementation on KLY It s here KLYNTAR Basics Part Architecture by KLYNTAR Feb Medium KLYNTAR・Feb ・ klyntar Medium In the article about basics you can get information about the first level of sharding the whole ecosystem consists of a set of independent chains named symbiotes Also we re working on the next article in this cycle where you ll find out how sharding works on a single symbiote level how the pool per chain principle works and so on In this still not published article you can find the explanation of sharding inside a single symbiote and this illustration can help you Since all the subchains here are related to a single symbiote all of them are part of a single system of accounts Also each symbiote will have its own chainID the number for the EVM registry and bit BLAKE hash for the KLY ecosystem For example our initial symbiote kNULL which will be launched by KLYNTAR Team will have as a chainID for EVM You can see it here KLYNTAR listing VladChernenko posted on Feb KLYNTAR nextgen cloud of everything project that relies on decentralization amp security amp TPS of all blockchains in the industry has multilevel sharding multitasking EVM amp WASM amp Docker compatibility post quantum cryptography RWX codeless smart contracts etc Follow us View on GitHub So exactly on the subchains level we need to implement the sharding for EVM But to make it possible to securely bind accounts to the appropriate subchain shard we should dive deep into bytecodes the workflow of EVM execution via debugging and so on Should be interesting General ideaBack to our picture with subchains gt The simple idea of sharding on KLY is to bind accounts default and accounts of smart contracts to a single subchain and deny all attempts of state changes from txs from other subchains This image can help you to understand Here you see that if you bind your account to a subchain A this is a signal for everyone that the state of your contract or default account can be changed only via transactions via the same subchain Why it s cool Because now we can separate the work and explore each symbiote independently In simple words you can run the special software from the Bumblebee packet which will be the backend for explorers amp wallets and set the subchain to track changes Since the block time is short and TTF time to finality is instant you can easily get updates of state from each symbiote in a parallel way Sounds good and it seems we can implement it For KLY VM WASM based it s easy because all the state is changed via KLYNTAR core level and these operations are transparent for us Even advanced logic like cross contract calls can be tracked because this functionality is passed to the wasm module as an injected dependency from the JS context For instance here is an example from KLY VM tests Here is exampleIn the same way a contract changes its own state and the state of other accounts contracts But what about EVM Let s use reverse engineering skills and try to debug Low level controlTo reverse the workflow of EVM on the deep level we ve built the graph of workflow It helps us to dive into the bytecode level of executing to see the stack changes and black boxed values of EVM inside This is how this graph looks like gt Our goal is to allow changes of contract X only from transactions on subchain A For this we should track all the accounts whose state will be changed and revert amp stop the execution in case the transaction tries to change the account state that is bound to subchain BThe dangerous moment here is that we should remember about so advanced stuff like cross contract calls delegations and so on We know about itWhen EVM is going to change the state of some account the address of its will be added to the inner property touched this is the set of accounts whose state will be changed in a certain tx For demonstration we have a repository with an example of a cross contract call and the results of debug process You can find amp try it hereHere we try to deploy contracts Caller and Receiver Inside contract Caller sol there is a function for cross contract execution which calls a function inside Receiver sol contract We ll deploy using our account xbeadabfefbcbcdafcAfter deployment we can see these logsAnd if we manually override the debug logic inside the EVM source code and call the function crossContractCallFromCallerToReceiver we can see this As you see this set contains all the addresses that will be changed during operation This is exactly what we need because now we can override the logic of the function which add the address to this set We need to stop execution once we detect binding to another subchain This function is touchAccount inside the vmState js module from ethereumjs vm eei package The modified function looks like this In simple words an exception will be thrown and vm will be reverted The extra logic also contains work with mempool to allow the JSON RPC server to accept the transactions and test them in the sandbox with wished context useful for load balancers explorers etc before adding to mempool some filtration practice gt So in simple words amp using examples we ve demonstrated to you a proof of concept PoC of future KLY EVM Mutations principleWe wouldn t be ourselves if we didn t go even further During research work we noticed tons of interesting moments of EVM and going to add them to KLY EVM Since KLYNTAR is a mutable project you ll have the ability to add mutations for EVM workflows For example the stack tracing looks like this The interpreter js has the following code …and opcodes list looks like this gt What it gives us Why it s cool and what we can do with it We ll with this low level control we can create different custom mutations of EVM with different gas prices for opcodes custom opcodes custom inner logic change the execution context for different contracts amp addresses use the off chain functionality and much more It s like having a super powerful debugger and doing everything that you want We promised you that KLY EVM is a gigachad Hope we proved it WORA write functionality for EVM with WASMIt will be the topic of one of the next articles but since we have a WASM compatible VM on the board we should remind you about the ability to use WASM modules for EVM Long story short we assume that it will be worked as a callback mechanism where you stop the EVM execution call the WASM module and return to EVM execution with new extra values But wait for the article SummaryDamn this article looks so hot Detailed simple with examples ーperfect We re working to make KLY the leading project Not only in the crypto industry But too With KLY EVM we started another cycle of articles in our blog Hope you find it interesting We ll try to publish such articles often to get you a detailed explanation of all the components of KLY ecosystem Just imagine your first time launching the KLY node Links |
2023-03-05 23:39:45 |
海外TECH |
DEV Community |
yOU DON'T nEEd a fRamEWoRk |
https://dev.to/gravy59/you-dont-need-a-framework-59ka
|
yOU DON x T nEEd a fRamEWoRkEvery so often there s an article I ll read that s like You don t need a JavaScript Framwork Just use vanilla JS it s so much better Why can t we all just use jQuery again Obviously these people are intelligent in their own right but I respectfully but strongly disagree In this blog post I ll share my experience building a fullstack CRUD chat app with Bootstrap Alpine js and Pocketbase Spoiler alert It f██kin sucks Code Getting StartedTo get started I created a new project folder and created an empty html file I chose not to use npm and instead opt for link and script tags from CDNs I threw in Bootstrap and Alpine js Alpine is basically the modern version of jQuery and I m more comfortable with Alpine from the copious amount of classes my school had on it that one year Bootstrap provided me with a pre built user interface that I could customize and Alpine js allowed me to add interactivity to my app For the back end I chose Pocketbase which is a cloud hosted database service that can be accessed through a simple REST API Pocketbase is easy to use and integrates well with front end frameworks like Bootstrap and Alpine js making it a great choice for this project Creating the User InterfaceAfter setting up the project I started creating the user interface using Bootstrap I designed a simple chat interface with a list of messages on the top and a message input field on the bottom In about five minutes I had a basic chat interface without any interactivity Next I added tried to add interactivity to the interface using Alpine js Full stop here I m not a programming God I don t know too much about data fetching with vanilla JS After pouring to the Alpine docs for a bit longer than I want to tell you I settled on a function called pageData that would fetch data subscribe to messages and expose important variables to the client I also bound the chat form with x model to the text variable on my pageData function This is important because Alpine has a weird form paradigm Now I can use submit prevent to run a function on pageData to grab this text and submit it to pocketbase As a final touch I used x transition for some smoother animation Data modelingPocketbase is awesome because it allows me to abstract security rules I created a messages collection with one column text Pocketbase automagically sets an id relation to a user and creation update dates In my API rules I unlocked List search view create update and delete For creating updating and deleting it s important to restrict those actions to the user who created the message I copied user id request auth id to all of these This forces PB to only allow logged in users to send messages and only allows the creator of a message to edit or delete User AuthenticationUser Auth with PB s SDK is easy It saves sessions in localstorage and verifies them with the server All I needed to do was use Alpine s x show directive to show and hide login sign up and the actual app based on the authentication state R amp DFor reading messages I had to subscribe to them to get realtime communication To do that I used PB s SDK to subscribe and add a callback function to determine what to do with the UI when a message was changed client collection messages subscribe async action record gt if action create const user await client collection users getOne record user record expand user user this messages push record if action delete this messages this messages filter m gt m id record id Final ThoughtsHere s the deal Yes it s possible to not use a framework Is it easy HELL NO Personally If you want some level of interactivity that needs dynamic UIs you can try to use something like Alpine or petite vue but if you need more than that something like svelte or anything from pnpm create vite will make your life so much easier Thanks for reading y all |
2023-03-05 23:11:12 |
Apple |
AppleInsider - Frontpage News |
iPhone 14 Leather Case range to add two colors this spring |
https://appleinsider.com/articles/23/03/05/iphone-14-leather-case-range-to-add-two-colors-this-spring?utm_medium=rss
|
iPhone Leather Case range to add two colors this springApple will be adding two more color options to its iPhone Leather Case range with a violet and a brown option set to join the roster Twitter MajinBuOfficial Owners of the iPhone and iPhone Pro have a selection of five official Apple leather cases they can use for their smartphone If a leak is to be believed the count will reach seven by the spring Read more |
2023-03-05 23:42:46 |
金融 |
JPX マーケットニュース |
[OSE]日経平均株価の構成銘柄の一部入替え |
https://www.jpx.co.jp/news/2020/20230306-01.html
|
日経平均株価 |
2023-03-06 09:00:00 |
ニュース |
BBC News - Home |
Gladiator fights were staged in Roman Britain, evidence suggests |
https://www.bbc.co.uk/news/uk-england-essex-64855991?at_medium=RSS&at_campaign=KARANGA
|
britain |
2023-03-05 23:01:48 |
ニュース |
BBC News - Home |
Bruno Fernandes a 'disgrace' & Manchester United 'eaten alive' in Liverpool thrashing |
https://www.bbc.co.uk/sport/football/64856857?at_medium=RSS&at_campaign=KARANGA
|
Bruno Fernandes a x disgrace x amp Manchester United x eaten alive x in Liverpool thrashingPundits hold nothing back in their assessment of Manchester United s performance in Sunday s defeat at Liverpool describing it as a disgrace and a shambles |
2023-03-05 23:15:23 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
半導体メーカー、苦境でもEVで需要増 - WSJ発 |
https://diamond.jp/articles/-/318973
|
半導体メーカー |
2023-03-06 08:06:00 |
コメント
コメントを投稿