python |
Pythonタグが付けられた新着投稿 - Qiita |
【AtCoder】ABC283 のA,B,C,D における Python解説 |
https://qiita.com/Waaaa1471/items/8f76a4901578489c878a
|
atcoder |
2022-12-25 03:34:54 |
海外TECH |
MakeUseOf |
10 Reasons Why You Should Switch to Telegram |
https://www.makeuseof.com/tag/reasons-telegram-messaging-app/
|
features |
2022-12-24 18:30:15 |
海外TECH |
MakeUseOf |
Can You Play PS3 Games on a PS4? |
https://www.makeuseof.com/can-you-play-ps3-games-on-ps4/
|
playstation |
2022-12-24 18:30:15 |
海外TECH |
MakeUseOf |
A Guide to the Voice Recorder Keyboard Shortcuts on Windows 11 |
https://www.makeuseof.com/windows-11-voice-recorder-keyboard-shortcuts/
|
windows |
2022-12-24 18:15:15 |
海外TECH |
DEV Community |
Why Santa Claus Can't Inherit from Human: A Festive OOP Lesson |
https://dev.to/noriller/why-santa-claus-cant-inherit-from-human-a-festive-oop-lesson-3n34
|
Why Santa Claus Can x t Inherit from Human A Festive OOP Lesson Tis the season to be jolly and what better way to get into the holiday spirit than with a technical blog post about object oriented programming OOP In this festive post I ll explore the concept of inheritance and why it s important to ignore reality to use it appropriately Even if Santa Claus was real which he totally is I checked twice he wouldn t be able to inherit from the class Human What is Inheritance In OOP inheritance is a way for one class to inherit the characteristics and behavior of another class It allows us to create a hierarchy of classes and represent an is a relationship For example a Dog class could inherit from a Mammal class because a dog is a type of mammal Why Santa Claus Can t Inherit from HumanWhile it might seem logical at first to make Santa Claus inherit from Human there are several reasons why this is not a good idea Inheritance is typically used to represent an is a relationship meaning that the subclass in this case Santa Claus is a more specific type of the superclass Human However Santa Claus is not a type of human he has unique characteristics and abilities that do not apply to all humans For example Santa Claus has a list of naughty and nice children a magical sleigh that can fly around the world in a single night and the ability to deliver presents to every good boy and girl on Earth You might think sure that s how it works you have a more generic base with more specific things on top But reality and programming work differently For example if we try to make Santa Claus inherit from Human we might end up with methods such as getAge or getHeight that do not make sense for a character who is hundreds of years old and can shrink or grow to fit through chimneys A Better ApproachA better approach would be to create a separate class for Santa Claus and define his characteristics and behavior in that class This way we can represent him accurately and avoid any confusion or unnecessary checks all over the code After all we wouldn t want any naughty code sneaking its way into our nice list Square and RectangleAnother example of inappropriate inheritance is trying to make a class Square inherit from a class Rectangle While a square is a type of rectangle in real life it has its own unique characteristics such as all sides being equal in length that are not shared by all rectangles In this case for programming purposes it would be better to create a separate class for Square and define its characteristics and behavior independently Here s an example of what can happen when we make Square inherit from Rectangle class Rectangle constructor public length number public width number getArea number return this length this width setLength length number void this length length setWidth width number void this width width class Square extends Rectangle constructor sideLength number super sideLength sideLength const square new Square console log square getArea square setLength console log square getArea In this code we have a Rectangle class with a getArea method for calculating the area of the rectangle as well as setter methods for modifying the length and width of the rectangle We also have a Square class that inherits from Rectangle but overrides the constructor to set the length and width to be equal since they are equal in a square At first when we create a Square object and call the getArea method it works as expected and returns the correct value However when we use the setLength setter method to change the length of the square it breaks the expected behavior of a square In a square all sides are equal so changing the length of the square should also change the width However because we are inheriting from a Rectangle class and not accurately representing the characteristics of a square this does not happen As a result we end up with an incorrect value for the area A better approach would be to create a separate class for Square and define its own setter methods that ensure that all sides remain equal when one of them is changed This way we can avoid any bugs or unrealistic behavior in our code class Square constructor public sideLength number getArea number return Math pow this sideLength setSideLength sideLength number void this sideLength sideLength const square new Square console log square getArea square setSideLength console log square getArea In this revised code we have a separate Square class with its own setter method for changing the side length of the square When we use this setter method to change the side length it correctly updates all sides of the square and maintains the expected behavior Additionally if we tried to support a square as a subclass of the rectangle we would need to include a lot of conditional statements in the code to account for the square or override them in the class square and even then we would still end up with methods like setLength and setHeight This would result in a lot of extra code and complexity making it harder to understand and maintain the codebase Instead it is much simpler and more effective to create a separate class for Square This way we can clearly represent the unique characteristics of a square and avoid any unnecessary complexity in the code FinallyIn some cases such as with Santa Claus and Square it s better to ignore conceptions from real life in favor of doing what will work better for programming concepts So take this time and do like Santa checking your list of classes and separating them into nice and naughty classes and then checking twice Happy holidays and happy coding Cover Photo by Mike Arney on Unsplash |
2022-12-24 18:47:55 |
海外TECH |
DEV Community |
How SQL engine implement the isolation levels in MySQL |
https://dev.to/amitiwary999/how-sql-engine-implement-the-isolation-levels-in-mysql-4l5o
|
How SQL engine implement the isolation levels in MySQLIsolation is one of the ACID properties of DBMS Isolation ensures that each transaction is isolated from other transactions and that transactions don t affect each other There are multiple ways a transaction can be affected by other transactions It is known as a read phenomenon Different types of read phenomena are Dirty read It happens when a transaction reads data written by another transaction that has not been committed yet This is bad because we are not sure if that other transaction will eventually be committed or rolled back So we might end up using incorrect data in case rollback occurs Non repeatable read It happens when a transaction read the same row multiple times and the value is different each time because the row is modified by another transaction that is committed after the previous read This is unexpected Phantom read If the same query is executed multiple times but returns a different number of rows due to some changes made by other recently committed transactions such as inserting new rows or deleting existing rows it is known as a phantom read For example we want to query students that have heights between to It might possible that a new student is added while the previous read transaction is still in progress whose height is between to feet in that case the query will return this newly added user too Lost Update It happens when two different transactions are trying to update the same column on the same row of a table and one transaction overrides the update of another transaction For example there are students with id id id id and id id id belongs to team A and id id belongs to team B mysql gt select from students team id team id A id A id B id B The first transaction updated team A to B but before it commit the second transaction already started that updated team B to A Once the first transaction commits team A converted to team B After the update in first transaction doing the read query in same transactionmysql gt select from students team id team id B id B id B id B So all the students belong to team B now The second transaction converts team B to A Because all students belong to team B now the second transaction converts all of them to team A mysql gt select from students team id team id A id A id A id A SQL engine offers four isolation levels to handle the read phenomenon In this blog post we are going to discuss what are those four isolation levels and how SQL engines ensure these isolation levels SQL use locking to protect a transaction from seeing or changing data that is being queried or changed by other transactions SQL use different locking strategy to for different isolation levelsRead uncommitted In read uncommitted isolation level one transaction can read the changes of another transaction even if the other transaction update is not committed SQL engines don t lock any row in this isolation level So one transaction can affect the other transactions All the read phenomenon is possible at this isolation level Read committed If a transaction tries to read a row which is already locked by another transaction then until that transaction is completed it will wait and once the transaction is committed new changed value will be used Here exclusive lock is used by the SQL engine So if any update transaction comes it acquires the exclusive lock and changes the value and releases the lock Other transactions read the value after that Read committed resolve the dirty read issue but another read phenomenon is still Because it doesn t prevent the new insertion or update in data even if any other transaction is reading the same row Repeatable Read Repeatable Read isolation is achieved by placing a shared lock on the row read by each transaction and the lock is held until the transaction is committed Until the lock is removed other transactions can t change the data of row help by a different transaction But it doesn t prevent the new row insertion So it prevents dirty reads and non repeatable read but phantom read is still possible Serializable SQL engine holds the lock on the row until is committed It is similar to a Repeatable read but if required locks can be acquired on the key range preventing other transactions from updating or inserting rows into the data set until the transaction is complete It helps to prevent phantom reads This is the most strict isolation level and it prevents all the read phenomena MySQL innodb engine default isolation level is Repeatable Read |
2022-12-24 18:47:21 |
海外TECH |
DEV Community |
The Collab Lab TCL-50 recap |
https://dev.to/the-collab-lab/the-collab-lab-tcl-50-recap-2gob
|
The Collab Lab TCL recap OVERVIEW The Collab Lab is a non profit organization that helps early career developers and in particular people in under represented groups in tech gain experience they need to break into tech To achieve that over the course of weeks a team of junior developers work collaboratively on a software project under the guidance of volunteer mentors The goal is for them to gain hands on experience by working in a professional setting with code reviews pair programming sessions weekly meetings and retro sessions The project is a “smart shopping list that learns your behaviour over time and prioritizes the things that you are going to need and reminds you to buy them The developers had to work both on the functionality of the application and the appearance of it Key technologies and tools JS React HTML CSS Git Github Tailwind Firebase THE TEAM THE DEVELOPERS Adegunloye Iyimide Klesta LuliRacheal David Victor Owiti THE MENTORS Chiamaka UmehReda BahaAristos Manolarakis WHAT WE DID FOR THE PERIOD OF THE COHORT Over the period of eight weeks every Sunday the team met for a period of one hour to demo the week s features do retrospectives go over learning modules like pair programming learning module git learning module and accessibility learning module and also assign tasks for the upcoming week The developers collabies were paired in two to work on issues together each week The pairs would meet during the week to pair program remotely and come up with solutions to their features after which they would make a PR on GitHub At the end of the week the pairs reviewed each other PRs followed by final reviews by mentors and the features are merged into the main branch The mentors occasionally checked in and held office hours to help the collabies unblock At the end of the eight weeks we had a fully functional smart shopping list that learns as you go You can view the app here Here s the final demo meeting definitely worth a watch to see what this talented group of devs came up with Some of our developers were just starting out with React while others had built a project or two before collab lab They were all super enthusiastic collaborative and communicative They helped each other unblock and were eager to learn We the mentors definitely saw a lot of improvement over time especially in the use of git making PRs merge conflict resolution and communication This is what the developers had to say WHAT THE DEVELOPERS HAD TO SAY Klesta Being a self taught developer I applied for The Collab Lab because I wanted to learn how to work on a software development team I learned how to work in an Agile environment by working consistently in weekly sprints It was especially a great learning opportunity working with mentors who also brought their experience from their jobs in development We also got to do pair programming with other team members and mentors and at the end of every sprint we had to demo the code and the application in production These experiences were incredibly beneficial for me I got to learn how to talk through my code answer questions and demo the app as a developer putting myself in the shoes of a user I felt much more comfortable going through live coding technical interviews because I was already familiar with talking through my code I learned so much from team members and the mentors Iyimide My experience at Collab lab was amazing I gained robust experience in code review agile methodology pair programming and collaboration The mentorship was superb I was part of a team where the mentors were always willing to support and help resolve any issues that surfaced My teammates were outstanding I learnt something new during every pair programming session The career lab extension of the Collab lab is the icing on the cake After all the experience garnered during the program we were further prepped for job search negotiation LinkedIn profile optimization and interviews I m glad I was a part of the program Michelle My Collab Lab experience was really awesome The mentors were always ready to help and jump on a call whenever we get stuck or needed help I got to learn how to collaborate with a team remotely It was my first time working on a team project Also I learnt how to use the git commands Create pull Request Code reviews Pair programming and working on issues etc The office hours and weekly sync meetings were great too It gave me greater understanding of some topics that were presented team communication and presentation skills Now I m confident that I ll do well working remotely CONCLUSION To wrap things up everyone enjoyed and learned a lot during this period The developers put in a lot of effort dedication and commitment to this project would be huge assets to your team If you are hiring a junior developer you can reach out to any of these hardworking and job ready developers If you are an early career developer the application for the next cohort is ongoing and this is a huge opportunity Apply |
2022-12-24 18:17:07 |
Apple |
AppleInsider - Frontpage News |
Merry Christmas to all of you, from all of us at AppleInsider |
https://appleinsider.com/articles/22/12/24/merry-christmas-to-all-of-you-from-all-of-us-at-appleinsider?utm_medium=rss
|
Merry Christmas to all of you from all of us at AppleInsiderWhether you celebrate Christmas or not we want to wish you a happy holiday season and thank you for being with us throughout Call it the Apple Tree Jony Ive helped design the decorations for this tree which was displayed in London s Claridges store in AppleInsider continues throughout the holidays with the latest news tips and of course all the best deals on Apple related hardware If you get any new Apple device be sure check out our comprehensive guides tips and features about them all Read more |
2022-12-24 18:40:26 |
Apple |
AppleInsider - Frontpage News |
Daily Deals Dec. 24: $220 off Roborock robot vacuum, Mac Studio for $1,849, $199 AirPods Pro 2 & more |
https://appleinsider.com/articles/22/12/24/daily-deals-dec-24-220-off-roborock-robot-vacuum-mac-studio-for-1849-199-airpods-pro-2-more?utm_medium=rss
|
Daily Deals Dec off Roborock robot vacuum Mac Studio for AirPods Pro amp moreSaturday s top deals including stellar discounts on Apple s inch MacBook Pro plus an LG K monitor for free game with Nintendo Switch OLED and off select Sonos speakers Daily deals for December Each day the AppleInsider Deals Team scours the web to bring you the best deals on everything from Apple devices to smart home goods Our Daily Deals roundups contain top picks to enhance your Apple setup plus some phenomenal bargains on everything from robot vacuums to Wi Fi routers Read more |
2022-12-24 18:05:42 |
ニュース |
BBC News - Home |
Faithless lead singer Maxi Jazz dies aged 65 |
https://www.bbc.co.uk/news/entertainment-arts-64087315?at_medium=RSS&at_campaign=KARANGA
|
insomnia |
2022-12-24 18:07:40 |
ニュース |
BBC News - Home |
Russia-Ukraine war: Strikes on Kherson kill 10 |
https://www.bbc.co.uk/news/world-europe-64085480?at_medium=RSS&at_campaign=KARANGA
|
strikes |
2022-12-24 18:12:12 |
ニュース |
BBC News - Home |
Premiership Rugby: Leicester 28-13 Gloucester: Anthony Watson scores twice in Tigers victory |
https://www.bbc.co.uk/sport/rugby-union/64070869?at_medium=RSS&at_campaign=KARANGA
|
gloucester |
2022-12-24 18:03:57 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
人口の半分近くが死亡、大領主や男爵は農民や奴隷を失った…「黒死病」がヨーロッパに与えた大きな衝撃 - 超圧縮 地球生物全史 |
https://diamond.jp/articles/-/314784
|
「地球の誕生」から「サピエンスの絶滅、生命の絶滅」まで全歴史を一冊に凝縮した『超圧縮地球生物全史』は、その奇跡の物語を描き出す。 |
2022-12-25 03:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【出口学長・日本人が最も苦手とする哲学と宗教特別講義】 トマス・ペインが『コモン・センス』で訴えたかったこと - 哲学と宗教全史 |
https://diamond.jp/articles/-/313450
|
|
2022-12-25 03:43:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【91歳の医師が明かす】 医師が実践! 脳の健康を守る“簡単な気づかい” - 91歳の現役医師がやっている 一生ボケない習慣 |
https://diamond.jp/articles/-/313299
|
【歳の医師が明かす】医師が実践脳の健康を守る“簡単な気づかい歳の現役医師がやっている一生ボケない習慣「あれいま何しようとしてたんだっけ」「ほら、あの人、名前なんていうんだっけ」「昨日の晩ごはん、何食べんたんだっけ」……若い頃は気にならなかったのに、いつの頃からか、もの忘れが激しくなってきた。 |
2022-12-25 03:41:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【出身大学&専攻別】「雇われる力」が一発でわかる“就活楽勝度マップ” - 「いい会社」はどこにある? |
https://diamond.jp/articles/-/313603
|
【出身大学専攻別】「雇われる力」が一発でわかる“就活楽勝度マップ「いい会社」はどこにある「いい会社」はどこにあるのかーもちろん「万人にとっていい会社」など存在しない。 |
2022-12-25 03:39:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【ワークマン仕掛け人が教える】 なぜ、CIOで入社したのに 情報システム部員を半減させたのか? - ワークマン式「しない経営」 |
https://diamond.jp/articles/-/312932
|
|
2022-12-25 03:37:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
日本発のアドラー心理学入門書が世界1000万部を突破した「3つの理由」 - 嫌われる勇気──自己啓発の源流「アドラー」の教え |
https://diamond.jp/articles/-/314846
|
嫌われる勇気 |
2022-12-25 03:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ミュージシャンから起業家に転身したぼくが発見した「Web3」の本質とは? - スタンフォード式生き抜く力 |
https://diamond.jp/articles/-/313621
|
予測不可能な時代にシリコンバレーの中心でエリートたちが密かに学ぶ最高の生存戦略を初公開した星校長の処女作『スタンフォード式生き抜く力』が話題となっている。 |
2022-12-25 03:33:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ひろゆきが語る「クリスマスに独りぼっちの人」のたった1つの特徴 - 99%はバイアス |
https://diamond.jp/articles/-/314798
|
独りぼっち |
2022-12-25 03:31:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【整体プロの神ワザ】超簡単!「腰痛」「そり腰」「骨盤のゆがみ」を解消する方法 - すごい自力整体 |
https://diamond.jp/articles/-/315140
|
【整体プロの神ワザ】超簡単「腰痛」「そり腰」「骨盤のゆがみ」を解消する方法すごい自力整体年齢とともに、ますます硬くなる体、痛くて上がらない肩、腰や股関節、ひざの痛み、体のゆがみ、むくみ……。 |
2022-12-25 03:29:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
異常に仕事ができるプロ経営者だけがやっている【お客様目線】の法則 - 時間最短化、成果最大化の法則 |
https://diamond.jp/articles/-/314020
|
異常に仕事ができるプロ経営者だけがやっている【お客様目線】の法則時間最短化、成果最大化の法則【日経新聞掲載】有隣堂横浜駅西口店週間総合ベスト入り東洋経済オンライン「市場が評価した経営者ランキング」位、フォーブスアジア「アジアの優良中小企業ベスト」度受賞の著者が初めて明かす「最短時間で最大の成果を上げる方法」。 |
2022-12-25 03:27:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
親からお子さんへ「学校では習わない暗算法」を教えてみませんか? - 小学生がたった1日で19×19までかんぺきに暗算できる本 |
https://diamond.jp/articles/-/314470
|
暗算 |
2022-12-25 03:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【東大教授×カリフォルニア大学バークレー校准教授、白熱対談】小学生から教えたい「理詰めでじっくり考える力」を身につけるための1つの習慣 - 16歳からのはじめてのゲーム理論 |
https://diamond.jp/articles/-/314743
|
【東大教授×カリフォルニア大学バークレー校准教授、白熱対談】小学生から教えたい「理詰めでじっくり考える力」を身につけるためのつの習慣歳からのはじめてのゲーム理論米国で活躍する経済学者・鎌田雄一郎氏の『歳からのはじめてのゲーム理論』を読めば、難しいと思われがちなゲーム理論の本質を容易に会得できる。 |
2022-12-25 03:23:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【スケジューリングがすべて】 生産性が最大化する「月火水木金土日」それぞれの過ごし方 - だから、この本。 |
https://diamond.jp/articles/-/315127
|
移住後も世界を旅しながら事業運営、メディア連載、プロデュース業などに携わってきた四角さんが再びライフスタイルをリセットし、超シンプルで楽な働き方を実現するためのノウハウを詰め込んだ内容となっている。 |
2022-12-25 03:21:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【池上彰】若い世代に「不都合な未来」をひっくり返すためにすべきこと - だから、この本。 |
https://diamond.jp/articles/-/314170
|
若い世代 |
2022-12-25 03:19:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【本日は一粒万倍日のクリスマス!】 雲の精霊、最大級の幸せを引き寄せる瑞鳥“鳳凰”と出会うために、いちばん大切なこと - 1日1分見るだけで願いが叶う!ふくふく開運絵馬 |
https://diamond.jp/articles/-/313441
|
【本日は一粒万倍日のクリスマス】雲の精霊、最大級の幸せを引き寄せる瑞鳥“鳳凰と出会うために、いちばん大切なこと日分見るだけで願いが叶うふくふく開運絵馬たちまち刷続々TV出演NHK「朝ごはんLab」“絵馬師のおすすめ開運・福福朝ごはんフジテレビ「FNNLiveNewsイット」で話題沸騰見るだけで「癒された」「ホッとした」「本当にいいことが起こった」と大反響Amazon・楽天位史上初神社界から「神道文化賞」を授与された絵馬師が、神様仏様に好かれる開運法を初公開。 |
2022-12-25 03:17:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
一緒にいるだけで「頭がよくなる相手、悪くなる相手」の1つの違い - 自分を変える方法 |
https://diamond.jp/articles/-/314643
|
行動科学 |
2022-12-25 03:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【動画にも効果絶大】「ストーリーチャート」の魔力 - コピーライティング技術大全 |
https://diamond.jp/articles/-/313839
|
魔力 |
2022-12-25 03:13:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【『世界一受けたい授業』で話題】 内臓脂肪でポッコリお腹に…若い頃の“お腹の凹み”を取り戻す「食べトレ」の極意 - 10年後、後悔しない体のつくり方 |
https://diamond.jp/articles/-/312570
|
|
2022-12-25 03:11:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【毎日脳トレ!】日常的に脳を鍛える方法 - 1分間瞬読ドリル 超かんたん!入門編 |
https://diamond.jp/articles/-/315048
|
【毎日脳トレ】日常的に脳を鍛える方法分間瞬読ドリル超かんたん入門編「認知症、ボケ予防に役立つ」「記憶力や思考力がアップし、勉強に活かせる」「頭の回転が速くなった」「本が速く読めて、判断スピードがあがった」「モチベーションの向上、習慣化につながる」「持続力が増して途中で投げ出さなくなった」などの声が届いた、くり返し楽しんで使える『分間瞬読ドリル』に、超入門編が登場。 |
2022-12-25 03:09:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ハイスペ人材なのに、なぜか最終面接で落ちる人の共通点 - 真の「安定」を手に入れるシン・サラリーマン |
https://diamond.jp/articles/-/313820
|
|
2022-12-25 03:07:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
カスタマーサポートを「内製化」しない会社のとっても残念な末路 - 1位思考 |
https://diamond.jp/articles/-/313977
|
|
2022-12-25 03:05:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
わが子がマイペースすぎて心配、放っておいても大丈夫? - ひとりっ子の学力の伸ばし方 |
https://diamond.jp/articles/-/314328
|
自己肯定感 |
2022-12-25 03:03:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「ナイジェリアってどんな国?」2分で学ぶ国際社会 - 読むだけで世界地図が頭に入る本 |
https://diamond.jp/articles/-/314898
|
|
2022-12-25 03:01:00 |
コメント
コメントを投稿