python |
Pythonタグが付けられた新着投稿 - Qiita |
結晶・分子グラフの効率的なDataLoader実装を考える |
https://qiita.com/mi-212/items/e053a11a128ad79595ee
|
dataloader |
2022-09-10 22:50:46 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
WebのフロントエンドでもDockerで開発環境を構築する理由。(余談としての脱node開発) |
https://qiita.com/SFITB/items/27cb917945fa9e721f34
|
docker |
2022-09-10 22:27:38 |
海外TECH |
MakeUseOf |
Edge 2.5D Review: Portable Wireless Touchscreen Display |
https://www.makeuseof.com/edge-25d-review-wireless-monitor/
|
Edge D Review Portable Wireless Touchscreen DisplayThe Edge D is a amp quot FHD zero latency wireless monitor with built in battery and speakers Its WirelessHD transmitter makes cables redundant |
2022-09-10 13:05:13 |
海外TECH |
DEV Community |
React: Write end to end test using cypress |
https://dev.to/clickpesa/react-write-end-to-end-test-using-cypress-3450
|
React Write end to end test using cypress Write end to end test using react cypress What is cypress Cypress is a simple to use testing framework It has many built in features to make your life easier and it s easy to learn and use Cypress is very powerful you can create unit tests without any configuration or scaffolding You just write your code and then run tests in parallel with zero dependencies You can use cypress with other frameworks like Angular Vue or React Native too It is a more developer friendly tool that uses a unique DOM manipulation technique and operates directly in the browser What is the e e test E E testing is a type of test that tests the entire application It can be also known as an integration test because it tests the interaction between different components and modules It is not a unit test as it does not have any dependency on individual modules or components but rather an end to end one Why choose cypress Cypress is a great tool to use when you want to write end to end tests It s easy to use and fast so you don t need to worry about it being slow or complicated Cypress also has many plugins that allow you to do more advanced testing on your app Setup cypress with react React appTo set up cypress first create your react app in this example we will be using a simple todo app using a create react app First create react app in your project foldernpx create react app todoClean all the unwanted files in the src folder and codes and create a folder structure like this or you can use your own structurein app jsx addimport useEffect useState from react import Addtodo from addtodo import app css import Todo from todo const App gt const todos setTodos useState const keyword setKeyword useState All const filteredTodos setFilteredTodos useState todos const addTodo todo gt setTodos todo todos setKeyword All const updateTodo id gt let todosCopy todos const todoIndex todosCopy findIndex el gt el id id const todo todosCopy find el gt el id id todosCopy todoIndex todo isActive todo isActive setTodos todosCopy const deleteTodo id gt const newTodos todos filter el gt el id id setTodos newTodos useEffect gt filterTodos keyword todos keyword const filterTodos key gt if key All setFilteredTodos todos setKeyword All return if key Active setFilteredTodos todos filter el gt el isActive true setKeyword Active return if key Completed setFilteredTodos todos filter el gt el isActive false setKeyword Completed return if key Clear setTodos todos filter el gt el isActive true setKeyword All return lt div className App gt lt div className container gt lt Addtodo addTodo addTodo gt lt ul gt filteredTodos map todo gt lt Todo todo todo key todo id updateTodo updateTodo deleteTodo deleteTodo gt lt ul gt lt div className actions gt lt span gt todos filter el gt el isActive true length Active items left lt span gt amp nbsp lt div gt lt button className filter all onClick gt filterTodos All gt All lt button gt amp nbsp lt button className filter active onClick gt filterTodos Active gt Active lt button gt amp nbsp lt button className filter completed onClick gt filterTodos Completed gt Completed lt button gt amp nbsp lt button className delete all onClick gt filterTodos Clear gt Clear Completed lt button gt lt div gt lt div gt lt div gt lt div gt export default App In addTodo jsximport useState from react const Addtodo addTodo gt const todo setTodo useState id title isActive true const title todo return lt div gt lt form onSubmit e gt e preventDefault todo title trim length gt amp amp addTodo todo setTodo id title isActive true gt lt input placeholder New todo value title onChange e gt let id new Date id id getTime if e target value trim length gt setTodo todo id title e target value gt lt button className submit button title Add Todo gt lt svg width height viewBox fill none xmlns gt lt path d M VHVHVHVHVHVHZ fill white gt lt svg gt lt button gt lt form gt lt div gt export default Addtodo in todo tsx addconst Todo todo deleteTodo updateTodo gt const title id isActive todo return lt li className isActive incomplete complete gt lt div gt lt button className isActive mark mark complete mark mark incomplete onClick gt updateTodo id title isActive Mark complete Mark incomplete gt lt svg width height viewBox fill none xmlns gt lt path d M C C C C L C C C C L C C C C C C C C L L C HZ fill green gt lt svg gt lt button gt amp nbsp title amp nbsp lt div gt lt button onClick gt deleteTodo id className delete title Delete todo gt lt svg width height viewBox fill none xmlns gt lt path d M HC C C C VZM C C C C HC C C C HL C C HC C L HC C C C HZM C C C C VC C C C VZM C C VC C C C VC C VZM C C HC C L HL HZ fill red gt lt svg gt lt button gt lt li gt export default Todo in app css add the following codes for UIbody display flex justify content center align items center min height vh background color ee color white container background color bb padding rem max width px width min width px margin auto form display flex justify content center align items center margin bottom rem input height px width calc px background color ee border none border bottom px solid ee padding rem transition s ease out color white button background none color white border none button submit button width px height px background color cadetblue color white border none input focus border none background color bb border bottom px solid grey input focus button focus outline none important ul list style none color white padding inline start max height calc vh px overflow y auto ul webkit scrollbar width rem ul webkit scrollbar track background gray ul webkit scrollbar thumb background darkgrey border radius em ul li display flex justify content space between background color ee padding rem margin rem transition s ul li complete text decoration line through opacity actions display flex justify content space between margin top rem actions button color lightgray actions button delete all color red Run npm start and this is how it should lookFrom this simple app user should be able to Create a new todo and preview the new todo on the listMark a todo as complete or incompleteDelete a single todoFilter all complete and incomplete todosDelete all complete todosThese are what we ll be testing using cypress Cypress setupinstall cypress in your projectnpm install cypress DRun cypress open to configure cypress in your projectnpx cypress openThis will open a window with two options ee testing and component testing select ee testingThis will open configure files page scroll to the bottom and continue cypress will generate all those price in your project folderThis will open browser selection page select your preferable browserThe following folder structure will be created in your project after configuring filesCreate ee folder inside cypress folder and create todo cy js inside ee folder and start writing the tests Once you create this file in cypress window you should see a file you created in ee test list like thisto run a specific test file click on the file and it should run Write your first ee testsBefore writing test on any scenario first we need to learn cypress commands there are basic custom commands basic commands are the built in cypress commands while custom commands are the commands you can create For this post we ll learn about basic commands since we won t need any custom command The following is the list of some basic commandscy visit url this launches urlcy wait Wait for a certain time in milliseconds or for an aliased element prior to moving the following step cy get selector this returns single or multiple elements with provided selector i e classname tagname id or title class selector can be written as cy get classname cy contains text returns a single or multiple elements that contains textcy click clicks the selected elementcy dblclick double clicks the selected elementcy document It obtains window document on the active page cy type text type text on a selected inputcy get classname eq for multiple elements you can select a specific element depending on the position of such element using eq command with element indexcy should exist checks if a selected element exists or not there are multiple parameters thet can be used inside should for varios checks i e not exist be visible be enabled it can be used with an alias and for multiple checks ie cy get classname should exist and be visible For more basic commands visit here Writing cypress tests works almost the same as writing any other tests Before all start the app by runningnpm startAssuming the app runs on http localhost before any testing any scenario first launch a url using visit command describe create todo spec gt before gt this will launch the page in cypress browser cy visit http localhost Lets write tests in todo cy js by scenarios listed before describe create todo spec gt before gt this will launch the page in cypress browser cy visit http localhost Create a todo scenario it successfully create a todo gt find an input by tagname cy get input type Sprint meeting submit form by title of submit button cy get title Add Todo click create another todo cy get input type Coding submit form by classname of submit button cy get submit button click check if new todos exist cy contains Sprint meeting should exist cy contains Coding should exist Mark todo as complete incomplete it Should mark todo gt mark a first todo as complete cy get button mark complete eq click select using css selector cy get li nth child button mark click Delete a todo it Should delete a todo gt cy get li nth child button delete click Filter all complete and incomplete todos it should filter between all complete and incomplete todos gt create multiple todos cy get input type Sprint meeting cy get title Add Todo click cy get input type Code cy get title Add Todo click cy get input type Exercising cy get title Add Todo click cy get input type Read cy get title Add Todo click cy get input type Eat cy get title Add Todo click cy get input type Code cy get title Add Todo click mark some as complete cy get li nth child button mark click cy get li nth child button mark click cy get li nth child button mark click filter complete only cy get button filter completed click check if only complete exists cy get complete should exist cy get incomplete should not exist filter incomplete only cy get button filter active click cy get complete should not exist cy get incomplete should exist filter all cy get button filter all click cy get complete should exist cy get incomplete should exist Delete all complete todos it should delete all completed todos gt find and click delete all completed todos cy get button delete all click cy get complete should not exist Running cypress run command should show a video of all actions written on the test These tests can run using electron browser this means that you can run these tests on terminal ienpx cypress runCypress can do multiple types tests using basic commands and different plugins such as file uploader At clickpesa we use cypress to do the ee tests making sure we have The following are limitations of cypressOne cannot use Cypress to drive two browsers at the same time It doesn t provide support for multi tabs Cypress only supports JavaScript for creating test cases Cypress doesn t provide support for browsers like Safari and IE at the moment Limited support for iFrames The most popular alternative to cypress is SeleniumIf you like this article there are more like this in our blogs follow us on dev to clickpesa medium com clickpesa engineering blog and clickpesa hashnode devHappy Hacking |
2022-09-10 13:15:31 |
海外TECH |
DEV Community |
Management of data in data engineering. |
https://dev.to/ndurumo254/management-of-data-in-data-engineering-34ij
|
Management of data in data engineering In their line of duty data engineers come across pipelines built with different technologies and they need to understand them Data engineers must have basic knowledge of data storage analytics and pipeline to carry out their duty effectively Databases and data warehousesA database is made up of one or more tables of related data Dynamic growth in the business sector has necessitated the design of tools to be used in bringing different databases together for the purpose of data analysis to carry out data analytics reports from various databases data from these databases are ingested into a central point A data warehouse is a tool that allows the ingestion of structured data from different databases Before entering a data warehouse the data undergoes processes such as validation preprocessing and data transformation Warehouses however face the challenge of holding current era business data because businesses need to handle unstructured and semistructured data Handling of the big and unstructured datasetUnstructured and semistructured data sets come from digital platforms such as IoT sensors social media web and mobile applications videos and audio platforms etc These platforms generate data in high velocity and huge volumes compared to structured data sources Due to the challenges of handling such datasets there was a need for a big data technology platform One such technology is the Hadoop open source framework that was designed in the early s Hadoop was designed to process large datasets on a cluster of computers Hadoop is managed under distributed file system called the Hadoop distributed file systems Providers of HDFS include IBM MAPR and Cloudera among others These packages include distributed data processing frameworks like HIVE spark map reduce etc Benefits of public cloud infrastructurePublic cloud infrastructure has an on demand capacityPublic cloud infrastructures have elastic and limitless scalingPublic cloud infrastructures have global footprintsPublic cloud infrastructure has a cost model based on usagePublic cloud infrastructure has freedom of hardware managementIn AWS made amazon redshift available and they started providing a data warehouse as a cloud native service Data martsA repository containing well structured curated as well as the trusted dataset is termed as an enterprise data warehouse EDW To measure business performance business users analysis data in the warehouse Data in the warehouse contains business subjects such as products sales customers etc data house has four main components These are Enterprise data warehouse Hosts the data assets such as the current and historical datasets Source systems Data sources such as ERP CRMETL pipelines Loads data to the warehousesData consumers Applications used to consume data from the warehouse Parallel processingAmazon redshift contains several computer resources Each redshift cluster has got two nodes •One leader node that interfaces client application to the computer node •Multiple computer nodes that store data from the warehouse and run queries in parallel Each computer node has its own memory and processor separated from each other Dimensional models in data warehouses In warehouses data is stored in relational tables The two common dimensional models in data warehouses are •Star•SnowflakesDimensional models make it easy to filter and retrieve relevant data Data marts are built focusing on a single subject of the business repository such as marketing finance or sales Datamarts are created either through top down or bottom up formats How data is fed into the warehouseOrganizations bring data from different sources into the warehouse through the pipeline Data pipelines are designed to serve the following purposes •Extracting data from the source•Transformation of the data through validation cleaning and standardizing•Loading the transformed data to the warehouse of the enterprise There are two types of pipelines Extract load transform ELT pipelines Extract transform load ETL pipelines Data lakeAs earlier stated warehouses are suitable for handling structured dataset However business needs to get insights into semistructured and unstructured data set from HTML JSON data social media images etc for their analysis Specialized machine learning tools handle such datasets Data lakes have the ability to handle all kinds of data may it be structured unstructured or even semistructured Data lakes also handle huge datasets compared to warehouses Data lake archtectureA data lake has layers These layers include•Storage layer This layer is located at the center of the data lake architecture It provides virtually low cost of unlimited storage This layer has got main zones each with a specific purpose These zones are Landing zone This zone is also known as a raw zone This is the zone where the ingestion layer writes the data from data zones The landing zone stores data permanently from the source Clean zone Also called transform zone Data from the clean zone is stored in the optimized formatsCurated zone Also called the enriched zone Data in the curated zone is optimized and cataloged for the consumption layer •Catalog and search layer Data lakes contain huge structured semistructured or unstructured data sets from internal or external of an organization Different departments use data set in the data lakes in an organization for different purpose and there is a need for the user to search for the available schemas in the dataset The catalog and the search layer provide metadata about the hosted data •Ingestion layer This layer connects to different data sources Data from the ingestion layer is forwarded to the storage layer •Processing layer Data from the storage layer is processed in the processing layer to make it ready for consumption by the consumer Components of both ingestion and processing layers create ELT pipelines •Consumption layer The consumer utilizes the processed data through techniques such as interactive query processing and machine learning among others In the end I tried to create a simple pipeline in aws I named it erick and selected the location as Africa Capetown |
2022-09-10 13:07:19 |
海外TECH |
Engadget |
Twitter's $7 million whistleblower payout violates purchase deal, Musk's lawyers argue |
https://www.engadget.com/twitter-7-million-whistleblower-payout-violates-purchase-deal-elon-musk-elon-lawyers-argue-133057995.html?src=rss
|
Twitter x s million whistleblower payout violates purchase deal Musk x s lawyers argueA judge recently ruled that Elon Musk can use the allegations made by Twitter whistleblower Peiter Zatko as part of the arguments in his countersuit against the company As it turns out Musk intends to use not just Zatko s claims to win his case but also the fact that the former Twitter executive received a settlement to get out of the billion acquisition deal he made with the social network As The Washington Post reports Musk s lawyers sent a letter to Twitter telling the company that the severance payment worth million that it made to Zatko in June violated a provision in their sales agreement nbsp In the letter uploaded to the SEC website Musk s lawyers cited Section e of the merger agreement which says Twitter promised not to quot grant or provide any severance or termination payments or benefits to any Company Service Provider other than the payment of severance amounts or benefits in the ordinary course of business consistent with past practice and subject to the execution and non revocation of a release of claims in favor of the Company and its Subsidiaries quot Former employees are considered Company Service Providers Musk and Twitter entered the purchase agreement in April and it wasn t until June when Zatko received his severance pay The company didn t seek Musk s consent before making the payment or notify him of the transaction the lawyers said in the letter Musk apparently only found out about the settlement when Twitter included the information in its court filing on September rd As such Musk s camp argues that the settlement serves as an additional basis to terminate the parties purchase agreement As The Post notes it s now up to Twitter to prove that such a big payout to a former employee wasn t out of the ordinary We ve reached out to Twitter for a statement and we ll update this post when we hear back Also known as quot Mudge quot Zatko accused the the social network of having quot extreme egregious deficiencies quot in security He said in a complaint filed with the Securities and Exchange Commission that Twitter violated the terms it had agreed to when it settled a privacy dispute with the FTC back in The whistleblower also claimed that he couldn t get a direct response from Twitter regarding the actual number of bots on the website If you ll recall Musk previously accused Twitter of fraud for hiding the real number of bots on its platform and told the court in a legal filing that percent ーnot just percent as the social network maintains ーof its daily active users who see ads are inauthentic accounts Twitter and Musk are set to face off in court in a five day trial scheduled to start on October th |
2022-09-10 13:30:57 |
ニュース |
BBC News - Home |
Bank holiday approved for day of Queen's funeral |
https://www.bbc.co.uk/news/uk-62862225?at_medium=RSS&at_campaign=KARANGA
|
funeral |
2022-09-10 13:27:37 |
ニュース |
BBC News - Home |
Charles praises Queen's reign as he is formally confirmed as king |
https://www.bbc.co.uk/news/uk-62860893?at_medium=RSS&at_campaign=KARANGA
|
selfless |
2022-09-10 13:50:46 |
ニュース |
BBC News - Home |
Kharkiv offensive: Ukraine enters key town as counter-attack gathers pace |
https://www.bbc.co.uk/news/world-europe-62860774?at_medium=RSS&at_campaign=KARANGA
|
early |
2022-09-10 13:12:02 |
北海道 |
北海道新聞 |
ボート転覆で5人死亡、NZ クジラと衝突か |
https://www.hokkaido-np.co.jp/article/729298/
|
転覆 |
2022-09-10 22:19:00 |
北海道 |
北海道新聞 |
25年デフリンピック日本初開催 総会で決定 |
https://www.hokkaido-np.co.jp/article/729283/
|
開催 |
2022-09-10 22:01:43 |
北海道 |
北海道新聞 |
楽4―6ロ(10日) ロッテが3連勝 |
https://www.hokkaido-np.co.jp/article/729291/
|
適時打 |
2022-09-10 22:05:00 |
北海道 |
北海道新聞 |
J1、首位横浜Mが福岡下す 川崎は広島に快勝、2位浮上 |
https://www.hokkaido-np.co.jp/article/729288/
|
日産スタジアム |
2022-09-10 22:01:00 |
コメント
コメントを投稿